public static string TryToAttack() { string message = GameStrings.NothingToAttackHereString; var monster = CurrentRoom.getMonster(); // First, check if there is a monster to fight if (monster != null) { if (monster.isDead()) { message = $"The {monster.name} is dead."; } else { // If a monster exists, attack it message = CombatService.Attack(monster); if (monster.isDead()) { message += $"\n{monster.deathMessage}"; } else { // If the monster is still alive, defend against its attack: message += "\n" + CombatService.Defend(monster); if (Player.isDead()) { state = false; message += "\n" + Player.death; } } } } return(message); }