public override void Attack(Rat enemy) { if (rng.NextDouble() < killChance) { Console.WriteLine($"FireMage {name} instantly killed a rat {enemy.Name}"); enemy.GetDmg(enemy.HP); } else { if (CanCastSpell()) { Console.WriteLine($"FireMage {name} attacked a rat {enemy.Name} and dealt {spellPower}dmg"); enemy.GetDmg(spellPower); mana -= spellPower; } } }
public virtual void Attack(Rat enemy) { if (CanCastSpell()) { Console.WriteLine($"Mage attacked a rat {enemy.Name} and dealt {spellPower}dmg"); enemy.GetDmg(spellPower); mana -= spellPower; } }
public virtual void Attack(Rat enemy) { if (rng.NextDouble() < enemy.Speed / 100) { Console.WriteLine($"Warrior {name} missed attack on rat {enemy.Name}!"); } else { Console.WriteLine($"Warrior {name} attacked a rat {enemy.Name} and dealt {strength}dmg!"); enemy.GetDmg(strength); } }
public void Attack(Rat enemy) { if (hasRat) { Console.WriteLine($"RatCatcher {name} is currently holding a rat, so he can't attack a rat {enemy.Name}!"); } else { Console.WriteLine($"RatCatcher {name} attacked a rat {enemy.Name}, killed him and took his body!"); enemy.GetDmg(enemy.HP); hasRat = true; } }
public override void Attack(Rat enemy) { if (arrows > 0) { if (rng.NextDouble() < enemy.Speed / 100) { Console.WriteLine($"Archer {name} missed attack on rat {enemy.Name}!"); } else { Console.WriteLine($"Archer {name} attacked a rat {enemy.Name} and dealt {strength}dmg!"); enemy.GetDmg(strength); arrows--; } } else { Console.WriteLine($"Archer {name} has no arrows left!"); } }