public void DisplayTalkTo() { int locationID = _gameOgre.SwampLocationID; List <Dragon> dragonsInSwamp = new List <Dragon>(); Dragon dragonToTalkTo = new Dragon(); dragonsInSwamp = _gameKingdom.GetDragonsBySwampLocationID(locationID); ConsoleUtil.HeaderText = "Talk To"; ConsoleUtil.DisplayReset(); ConsoleUtil.DisplayMessage(""); ConsoleUtil.DisplayMessage(_gameKingdom.GetSwampLocationByID(locationID).Name); ConsoleUtil.DisplayMessage(""); if (dragonsInSwamp != null) { ConsoleUtil.DisplayMessage(""); ConsoleUtil.DisplayMessage("Dragons in Current location."); foreach (Dragon dragon in _gameKingdom.Dragons) { if (dragon.SwampLocationID == locationID) { Console.WriteLine(dragon.CharacterID + " - " + dragon.Name); Console.WriteLine(); } } ConsoleUtil.DisplayPromptMessage("Select a number to speak with a dragon."); Console.WriteLine(); int dragonIDChoice; if (int.TryParse(Console.ReadLine(), out dragonIDChoice)) { dragonToTalkTo = _gameKingdom.GetDragonByID(dragonIDChoice); ConsoleUtil.DisplayMessage(dragonToTalkTo.Message); } DisplayContinuePrompt(); } }
//not currently using the ogreActionChoice function private void UpdateGameStatus(OgreAction ogreActionChoice) { if (_gameOgre.SwampLocationID == 1) { _gameOgre.Health = 500; } if (_gameOgre.SwampLocationID == 5 && ogreActionChoice == OgreAction.TalkTo) { Dragon enemyDragon; enemyDragon = _gameKingdom.GetDragonByID(2); enemyDragon.Health = enemyDragon.Health - 100; _gameOgre.Health = _gameOgre.Health - 100; if (_gameOgre.Health == 0) { Console.WriteLine("You have died in battle. Bardul will now eat what remains of you."); Console.ReadLine(); _usingGame = false; } else if (_gameOgre.Health < 200) { Console.WriteLine("Your health is getting low. You should return to Silvara to heal."); Console.ReadLine(); } else if (enemyDragon.Health == 0 && _gameOgre.Health != 0) { Console.WriteLine("Hurry!! You have have defeated the evil Dragon and made the world a better place."); Console.ReadLine(); _usingGame = false; } } }