public override void Attack(Ogre enemy) { if (rng.NextDouble() < killChance) { Console.WriteLine($"FireMage {name} instantly killed an ogre {enemy.Name}"); enemy.GetDmg(enemy.HP + enemy.Armor); } else { if (CanCastSpell()) { Console.WriteLine($"FireMage {name} attacked an ogre {enemy.Name} and dealt {spellPower}dmg"); enemy.GetDmg(spellPower); mana -= spellPower; } } }
public virtual void Attack(Ogre enemy) { if (CanCastSpell()) { Console.WriteLine($"Mage {name} attacked an ogre {enemy.Name} and dealt {spellPower}dmg"); enemy.GetDmg(spellPower); mana -= spellPower; } }
public void Attack(Ogre enemy) { if (hasRat) { Console.WriteLine($"RatCatcher {name} threw a rat on ogre {enemy.Name}!"); enemy.GetDmg(enemy.HP); hasRat = false; } else { Console.WriteLine($"RatCatcher {name} met an ogre {enemy.Name}, but doesn't have a rat"); } }
public override void Attack(Ogre enemy) { if (arrows > 0) { Console.WriteLine($"Archer {name} attacked an ogre {enemy.Name} and dealt {Math.Max(1, strength - enemy.Armor)}dmg!"); enemy.GetDmg(strength); arrows -= 2; } else { Console.WriteLine($"Archer {name} has no arrows left!"); } }
public virtual void Attack(Ogre enemy) { Console.WriteLine($"Warrior {name} attacked an ogre {enemy.Name} and dealt {Math.Max(1, strength - enemy.Armor)}dmg!"); enemy.GetDmg(strength); }