Esempio n. 1
0
        public bool IsWonVs(HeroState hero, MonsterConditions cond) // todo move cond to constructor?
        {
            if (hero == null)
            {
                throw new ArgumentNullException(nameof(hero));
            }

            if (cond == null)
            {
                throw new ArgumentNullException(nameof(cond));
            }

            var heroProabability = Math.Min(
                cond.MinProbability + hero.Power * cond.PowerFactor,
                cond.MaxProbability);

            return(heroProabability < _random.GenerateRealProbability());
        }
Esempio n. 2
0
 public MonsterScenario(MonsterConditions cond, IMonster monster, IRandom random)
 {
     _cond    = cond;
     _random  = random;
     _monster = monster;
 }