public override void Attack(Giant enemy)
 {
     if (rng.NextDouble() < killChance)
     {
         Console.WriteLine($"FireMage {name} instantly killed a giant {enemy.Name}");
         enemy.GetDmg(enemy.HP);
     }
     else
     {
         if (CanCastSpell())
         {
             Console.WriteLine($"FireMage {name} attacked a giant {enemy.Name} and dealt {spellPower}dmg");
             enemy.GetDmg(spellPower);
             mana -= spellPower;
         }
     }
 }
示例#2
0
 public virtual void Attack(Giant enemy)
 {
     if (CanCastSpell())
     {
         Console.WriteLine($"Mage {name} attacked a giant {enemy.Name} and dealt {spellPower}dmg");
         enemy.GetDmg(spellPower);
         mana -= spellPower;
     }
 }
 public override void Attack(Giant enemy)
 {
     if (arrows > 0)
     {
         Console.WriteLine($"Archer {name} attacked a giant {enemy.Name} and dealt {strength}dmg!");
         enemy.GetDmg(strength);
         arrows--;
     }
     else
     {
         Console.WriteLine($"Archer {name} has no arrows left!");
     }
 }
示例#4
0
 public virtual void Attack(Giant enemy)
 {
     Console.WriteLine($"Warrior {name} attacked a giant {enemy.Name} and dealt {strength}dmg!");
     enemy.GetDmg(strength);
 }