示例#1
0
 public bool Attack(Hero hero)
 {
     if (hero.isAlive)
     {
         var offenserValue = this.Agility + new Random().Next(2, 12);
         var defenserValue = hero.Agility + new Random().Next(2, 12);
         if (offenserValue - defensePoint > 0)
         {
             var attack = this.AttackValue();
             hero.ChangeHealth(attack);
             return true;
         }
         else
         {
             var offenserValue2 = hero.Agility + new Random().Next(2, 12);
             var defenserValue2 = this.Agility + new Random().Next(1, 6);
             if (offenserValue - defensePoint > 0)
             {
                 var attack = hero.AttackValue();
                 this.ChangeHealth(attack);
                 return true;
             }
            return false;
         }
     }
     else
         return false;
 }
示例#2
0
 protected virtual void Attack(Hero enemy, int phase)
 {
     var myAttack = this.AttackValue();
     var enemyDefense = enemy.DefenseValue();
     var myHit = myAttack + DiceProvider.Instance.Throw(1, 12 / phase);
     var enemyHit = enemyDefense + DiceProvider.Instance.Throw(1, 12);
     if (myHit > enemyHit)
     {
         var HitPoints = (int)(myHit * DrawAttack());
         enemy.ChangeHealth(HitPoints);
     }
     else
     {
         if (phase < 2)
             enemy.Attack(this, phase + 1);
     }
 }
示例#3
0
 public void DodajPostac(Hero hero)
 {
     druzynaPostaci.Add(hero);
 }
示例#4
0
 public virtual void Attack(Hero enemy)
 {
     Attack(enemy, 1);
 }