// A function that attacks player and decreases his health. public void Attack(int xPos, int yPos, Player player) { string text = "\n"; ConsoleMessage msg = new ConsoleMessage(xPos, yPos, text); msg.Display(); player.DecreaseHealth(2); }
// Attacks player with flame. public override void Attack(int xPos, int yPos, Player player) { string text = "Attacking player with flame. "; ConsoleMessage msg = new ConsoleMessage(xPos, yPos, text); msg.Display(); player.DecreaseHealth(5); this.decoratedAttacker.Attack(xPos + text.Length, yPos, player); }