private void PlaySecretWeaponBeforeEncounter(int hunterIndex, UserInterface ui) { string line = ""; do { line = ui.GetNameOfItemDiscardedByHunter(Hunters[hunterIndex].Name); } while (GetItemByNameFromItemDeck(line).Name == "Unknown item"); DiscardItemFromHunterAtIndex(line, hunterIndex, ui); do { line = ui.GetNameOfItemRetrievedFromDiscardByHunter(Hunters[hunterIndex].Name); } while (GetItemByNameFromItemDiscard(line).Name == "Unknown item"); Hunters[hunterIndex].ItemsKnownToDracula.Add(GetItemByNameFromItemDiscard(line)); ItemDiscard.Remove(GetItemByNameFromItemDiscard(line)); Hunters[hunterIndex].NumberOfItems++; }
internal bool HandlePossibleHunterDeath(UserInterface ui) { bool hunterDied = false; foreach (Hunter h in Hunters) { if (h.Health < 1 || (h.Name != "Van Helsing" && h.NumberOfBites > 1) || h.NumberOfBites > 2) { hunterDied = true; ui.TellUser(h.Name + " is defeated"); h.CurrentLocation = GetLocationFromName("St. Joseph & St. Mary"); int hunterIndex = 0; switch (h.Name) { case "Lord Godalming": h.Health = 12; h.NumberOfBites = 0; hunterIndex = 0; break; case "Van Helsing": h.Health = 8; h.NumberOfBites = 0; hunterIndex = 1; break; case "Dr. Seward": h.Health = 10; h.NumberOfBites = 0; hunterIndex = 2; break; case "Mina Harker": h.Health = 8; h.NumberOfBites = 1; hunterIndex = 3; break; } while (h.NumberOfEvents > 0) { string eventName = "Unknown event"; while (eventName == "Unknown event") { eventName = GetEventByNameFromEventDeck(ui.GetNameOfEventDiscardedByHunter(h.Name)).name; if (eventName == "Unknown event") { ui.TellUser("I can't find that event"); } } DiscardEventFromHunterAtIndex(eventName, hunterIndex, ui); } while (h.NumberOfItems > 0) { string itemName = "Unknown item"; while (itemName == "Unknown item") { itemName = GetItemByNameFromItemDeck(ui.GetNameOfItemDiscardedByHunter(h.Name)).Name; if (itemName == "Unknown item") { ui.TellUser("I can't find that item"); } } DiscardItemFromHunterAtIndex(itemName, hunterIndex, ui); } } } return hunterDied; }