public string RemoveMonsterCompanions() { // removes companions that were transfromed from monsters using a hero ability if (!PartyDice.Any(d => d.IsFromMonster)) { return(""); // no companions from monsters } // we have companions from monsters let's grab them List <PartyDie> companionsToRemove = PartyDice.Where(d => d.IsFromMonster).ToList(); PartyDice.RemoveAll(d => d.IsFromMonster); if (companionsToRemove.Count == 1) { return($"A {companionsToRemove[0].Companion} was discarded from your party. "); } // we have two that we need to remove return($"Two{companionsToRemove[0].Companion} companions were discarded from your party. "); }
public string DefeatDragon(TreasureItem treasureItem, Dungeon dungeon) { // player defeated dragon, let's remove the dice selection and move companions to graveyard string selectedCompanions = string.Join(", ", PartyDice.Where(d => d.IsSelected).Select(d => d.Name).ToList()); int companionCount = PartyDice.Count(d => d.IsSelected); for (int i = 0; i < companionCount; i++) { UsePartyDie(PartyDice.First(d => d.IsSelected).Companion); } Inventory.Add(treasureItem); string message = $"{SoundManager.DragonDeathSound(true)} <amazon:emotion name=\"excited\" intensity=\"medium\">You used your {selectedCompanions}, to defeat the dragon. You acquired {treasureItem.TreasureType.GetDescription()}. "; message += GainExperiencePoints(1, dungeon); message += "</amazon:emotion>"; return(message); }