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; } } }
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!"); } }
public virtual void Attack(Giant enemy) { Console.WriteLine($"Warrior {name} attacked a giant {enemy.Name} and dealt {strength}dmg!"); enemy.GetDmg(strength); }