public void fireball(object enemy) { human opponent = enemy as human; Random rand = new Random(); int attackrand = rand.Next(20, 51); if (opponent != null) { opponent.health -= attackrand; } }
public void attack(object obj) { human enemy = obj as human; if (enemy == null) { Console.WriteLine("Missed!"); } else { enemy.health -= 5 * strength; } }