internal void PlaySenseOfEmergency(int hunterIndex, UserInterface ui) { EventDetail draculaEventCard = Dracula.WillPlayDevilishPower(this, ui); bool eventIsCancelled = false; if (draculaEventCard != null) { switch (draculaEventCard.name) { case "DevilishPower": ui.TellUser("Dracula played Devilish power to cancel this event"); DiscardEventFromDracula("Devilish Power"); int hunterPlayingGoodluck = ui.AskWhichHunterIsUsingGoodLuckToCancelEvent(); if (hunterPlayingGoodluck > -1) { DiscardEventFromHunterAtIndex("Good Luck", hunterPlayingGoodluck, ui); } else { eventIsCancelled = true; } break; } } if (!eventIsCancelled) { Hunters[hunterIndex].Health -= 6; Hunters[hunterIndex].Health += VampirePointTracker; ui.TellUser("Adjust " + Hunters[hunterIndex].Name + "'s health and then perform a move to any location"); } }
internal bool DraculaWillPlayControlStorms(int hunterIndex, UserInterface ui) { EventDetail draculaEventCard = Dracula.PlayControlStorms(this); if (draculaEventCard != null) { switch (draculaEventCard.name) { case "Control Storms": Logger.WriteToDebugLog("Dracula played Control Storms"); Logger.WriteToGameLog("Dracula played Control Storms"); ui.TellUser("Dracula played Control Storms"); DiscardEventFromDracula("Control Storms"); int hunterPlayingGoodluck = ui.AskWhichHunterIsUsingGoodLuckToCancelEvent(); if (hunterPlayingGoodluck > -1) { DiscardEventFromHunterAtIndex("Good Luck", hunterPlayingGoodluck, ui); Logger.WriteToDebugLog(Hunters[hunterPlayingGoodluck].Name + " played Good Luck"); Logger.WriteToGameLog(Hunters[hunterPlayingGoodluck].Name + " played Good Luck"); } else { PlayControlStorms(hunterIndex, ui); return true; } break; } } return false; }
internal EventDetail WillPlayDevilishPower(GameState g, UserInterface ui) { EventDetail eventToReturn = logic.DecideWhetherToPlayDevilishPower(g, this); if (eventToReturn != null) { int hunterIndex = ui.AskWhichHunterIsUsingGoodLuckToCancelEvent(); if (hunterIndex > 0) { g.DiscardEventFromHunterAtIndex("Good Luck", hunterIndex, ui); EventCardsInHand.Remove(EventCardsInHand.Find(c => c.name == "Devilish Power")); eventToReturn = null; } } return eventToReturn; }
private void PlayFalseTipOff(UserInterface ui) { ui.TellUser("I am playing my False Tip-Off card to cancel your train"); Dracula.DiscardEventFromHand(this, "False Tip-Off"); int hunterPlayingGoodluck = ui.AskWhichHunterIsUsingGoodLuckToCancelEvent(); if (hunterPlayingGoodluck > -1) { DiscardEventFromHunterAtIndex("Good Luck", hunterPlayingGoodluck, ui); } }
private bool ResolveEncountersAtLocation(Hunter hunter, Map map, Location location, UserInterface ui) { Dracula.OrderEncounters(hunter, location); foreach (EncounterDetail enc in map.LocationDetails(location).Encounters) { enc.isRevealed = true; ui.TellUser(enc.name + " is revealed"); } ui.drawGameState(this); bool resolveNextEncounter = true; bool discardEncounter = true; List<EncounterDetail> encountersBeingDiscarded = new List<EncounterDetail>(); EncounterDetail firstEncounter = null; EncounterDetail secondEncounter = null; if (map.LocationDetails(location).Encounters.Count() > 0) { firstEncounter = map.LocationDetails(location).Encounters.First(); } if (map.LocationDetails(location).Encounters.Count() > 1) { secondEncounter = map.LocationDetails(location).Encounters[1]; } if (firstEncounter != null) { bool encounterCancelled = false; foreach (Hunter h in Hunters) { int hunterIndex = IndexOfHunter(h); if (h.CurrentLocation == location) { if (ui.AskIfHunterIsPlayingSecretWeapon(h.Name)) { DiscardEventFromHunterAtIndex("Secret Weapon", hunterIndex, ui); Logger.WriteToDebugLog(h.Name + " played Secret Weapon"); Logger.WriteToGameLog(h.Name + " played Secret Weapon"); EventDetail draculaEventCardA = Dracula.WillPlayDevilishPower(this, ui); bool eventIsCancelled = false; if (draculaEventCardA != null) { switch (draculaEventCardA.name) { case "DevilishPower": ui.TellUser("Dracula played Devilish power to cancel this event"); Logger.WriteToDebugLog("Dracula played Devilish Power"); DiscardEventFromDracula("Devilish Power"); int hunterPlayingGoodluck = ui.AskWhichHunterIsUsingGoodLuckToCancelEvent(); if (hunterPlayingGoodluck > -1) { DiscardEventFromHunterAtIndex("Good Luck", hunterPlayingGoodluck, ui); } else { eventIsCancelled = true; } break; } } if (!eventIsCancelled) { PlaySecretWeaponBeforeEncounter(hunterIndex, ui); } } EventDetail draculaEventCard; if (ui.AskIfHunterIsPlayingForeWarned(h.Name)) { draculaEventCard = Dracula.WillPlayDevilishPower(this, ui); bool eventIsCancelled = false; if (draculaEventCard != null) { switch (draculaEventCard.name) { case "DevilishPower": ui.TellUser("Dracula played Devilish power to cancel this event"); DiscardEventFromDracula("Devilish Power"); int hunterPlayingGoodluck = ui.AskWhichHunterIsUsingGoodLuckToCancelEvent(); if (hunterPlayingGoodluck > -1) { DiscardEventFromHunterAtIndex("Good Luck", hunterPlayingGoodluck, ui); } else { eventIsCancelled = true; } break; } } if (!eventIsCancelled) { PlayForewarnedBeforeEncounter(hunterIndex, ui); encounterCancelled = true; } } } } if (encounterCancelled) { resolveNextEncounter = true; discardEncounter = true; } else { resolveNextEncounter = ResolveEncounter(firstEncounter, hunter, out discardEncounter, ui); } if (discardEncounter) { map.LocationDetails(location).Encounters.Remove(firstEncounter); EncounterPool.Add(firstEncounter); firstEncounter.isRevealed = false; } else if (firstEncounter.name == "Bats" || firstEncounter.name == "Fog") { EncounterLimbo.Add(firstEncounter); map.LocationDetails(location).Encounters.Remove(firstEncounter); } } if (secondEncounter != null) { bool encounterCancelled = false; foreach (Hunter h in Hunters) { int hunterIndex = IndexOfHunter(h); if (h.CurrentLocation == location) { if (ui.AskIfHunterIsPlayingSecretWeapon(h.Name)) { DiscardEventFromHunterAtIndex("Secret Weapon", hunterIndex, ui); Logger.WriteToDebugLog(h.Name + " played Secret Weapon"); Logger.WriteToGameLog(h.Name + " played Secret Weapon"); EventDetail draculaEventCardA = Dracula.WillPlayDevilishPower(this, ui); bool eventIsCancelled = false; if (draculaEventCardA != null) { switch (draculaEventCardA.name) { case "DevilishPower": ui.TellUser("Dracula played Devilish power to cancel this event"); Logger.WriteToDebugLog("Dracula played Devilish Power"); DiscardEventFromDracula("Devilish Power"); int hunterPlayingGoodluck = ui.AskWhichHunterIsUsingGoodLuckToCancelEvent(); if (hunterPlayingGoodluck > -1) { DiscardEventFromHunterAtIndex("Good Luck", hunterPlayingGoodluck, ui); } else { eventIsCancelled = true; } break; } } if (!eventIsCancelled) { PlaySecretWeaponBeforeEncounter(hunterIndex, ui); } } EventDetail draculaEventCard; if (ui.AskIfHunterIsPlayingForeWarned(h.Name)) { draculaEventCard = Dracula.WillPlayDevilishPower(this, ui); bool eventIsCancelled = false; if (draculaEventCard != null) { switch (draculaEventCard.name) { case "DevilishPower": ui.TellUser("Dracula played Devilish power to cancel this event"); DiscardEventFromDracula("Devilish Power"); int hunterPlayingGoodluck = ui.AskWhichHunterIsUsingGoodLuckToCancelEvent(); if (hunterPlayingGoodluck > -1) { DiscardEventFromHunterAtIndex("Good Luck", hunterPlayingGoodluck, ui); } else { eventIsCancelled = true; } break; } } if (!eventIsCancelled) { PlayForewarnedBeforeEncounter(hunterIndex, ui); encounterCancelled = true; } } } } if (encounterCancelled) { resolveNextEncounter = true; discardEncounter = true; } else { resolveNextEncounter = ResolveEncounter(secondEncounter, hunter, out discardEncounter, ui); } if (discardEncounter) { map.LocationDetails(location).Encounters.Remove(secondEncounter); EncounterPool.Add(secondEncounter); } else if (secondEncounter.name == "Bats" || secondEncounter.name == "Fog") { EncounterLimbo.Add(secondEncounter); map.LocationDetails(location).Encounters.Remove(secondEncounter); } } return resolveNextEncounter; }
internal void PlayTelegraphAhead(int hunterIndex, UserInterface ui) { EventDetail draculaEventCard = Dracula.WillPlayDevilishPower(this, ui); bool eventIsCancelled = false; if (draculaEventCard != null) { switch (draculaEventCard.name) { case "DevilishPower": ui.TellUser("Dracula played Devilish power to cancel this event"); DiscardEventFromDracula("Devilish Power"); int hunterPlayingGoodluck = ui.AskWhichHunterIsUsingGoodLuckToCancelEvent(); if (hunterPlayingGoodluck > -1) { DiscardEventFromHunterAtIndex("Good Luck", hunterPlayingGoodluck, ui); } else { eventIsCancelled = true; } break; } } if (!eventIsCancelled) { int locationsRevealed = 0; foreach (LocationDetail loc in Hunters[hunterIndex].CurrentLocation.ByRoad) { draculaEventCard = Dracula.WillPlaySensationalistPress(this, 0); bool revealing = true; if (draculaEventCard != null) { switch (draculaEventCard.name) { case "Sensationalist Press": ui.TellUser("Dracula played Sensationalist Press to cancel revealing a location"); DiscardEventFromDracula("Sensationalist Press"); int hunterPlayingGoodluck = ui.AskWhichHunterIsUsingGoodLuckToCancelEvent(); if (hunterPlayingGoodluck > -1) { DiscardEventFromHunterAtIndex("Good Luck", hunterPlayingGoodluck, ui); DiscardEventFromDracula("Control Storms"); } else { revealing = false; } break; } } if (revealing) { loc.IsRevealed = true; locationsRevealed++; } } if (locationsRevealed == 0) { ui.TellUser("No locations revealed"); } } }
internal string ResolveCombat(Hunter hunter, int enemyInCombat, bool hunterMoved, UserInterface ui) { List<ItemDetail> enemyCombatCards = new List<ItemDetail>(); List<ItemDetail> hunterBasicCards = new List<ItemDetail>(); List<Hunter> huntersInCombat = new List<Hunter>(); if (hunterMoved) { foreach (HunterName h in hunter.HuntersInGroup) { huntersInCombat.Add(Hunters[(int)h]); } } else { foreach (Hunter h in Hunters) { if (h.CurrentLocation == Hunters[hunterIndex].CurrentLocation) { huntersInCombat.Add(h); } } } hunterBasicCards.Add(new ItemDetail("Punch")); hunterBasicCards.Add(new ItemDetail("Escape")); bool trapPlayed = false; int rageRounds = 0; string enemyName = "nobody"; switch (enemyInCombat) { case 1: { enemyName = "Dracula"; enemyCombatCards.Add(new ItemDetail("Claws")); enemyCombatCards.Add(new ItemDetail("Escape (Man)")); if (TimeIndex > 2) { enemyCombatCards.Add(new ItemDetail("Strength")); enemyCombatCards.Add(new ItemDetail("Escape (Bat)")); enemyCombatCards.Add(new ItemDetail("Escape (Mist)")); enemyCombatCards.Add(new ItemDetail("Fangs")); enemyCombatCards.Add(new ItemDetail("Mesmerize")); } break; } case 2: { enemyName = "Minion with Knife"; enemyCombatCards.Add(new ItemDetail("Punch")); enemyCombatCards.Add(new ItemDetail("Knife")); break; } case 3: { enemyName = "Minion with Knife and Pistol"; enemyCombatCards.Add(new ItemDetail("Punch")); enemyCombatCards.Add(new ItemDetail("Knife")); enemyCombatCards.Add(new ItemDetail("Pistol")); break; } case 4: { enemyName = "Minion with Knife and Rifle"; enemyCombatCards.Add(new ItemDetail("Punch")); enemyCombatCards.Add(new ItemDetail("Knife")); enemyCombatCards.Add(new ItemDetail("Rifle")); break; } case 5: { enemyName = "Assassin"; enemyCombatCards.Add(new ItemDetail("Punch")); enemyCombatCards.Add(new ItemDetail("Knife")); enemyCombatCards.Add(new ItemDetail("Pistol")); enemyCombatCards.Add(new ItemDetail("Rifle")); break; } case 6: { enemyName = "New Vampire"; enemyCombatCards.Add(new ItemDetail("Claws")); enemyCombatCards.Add(new ItemDetail("Escape (Man)")); if (TimeIndex > 2) { enemyCombatCards.Add(new ItemDetail("Strength")); enemyCombatCards.Add(new ItemDetail("Escape (Bat)")); enemyCombatCards.Add(new ItemDetail("Escape (Mist)")); enemyCombatCards.Add(new ItemDetail("Fangs")); enemyCombatCards.Add(new ItemDetail("Mesmerize")); } break; } } ui.TellUser(Hunters[hunterIndex].Name + " is entering combat against " + enemyName + (huntersInCombat.Count() > 1 ? " with " + huntersInCombat[1].Name : "") + (huntersInCombat.Count() > 2 ? " and " + huntersInCombat[2].Name : "") + (huntersInCombat.Count() > 3 ? " and " + huntersInCombat[3].Name : "")); EventDetail draculaEventCard = null; do { draculaEventCard = Dracula.PlayEventCardAtStartOfCombat(this, trapPlayed, hunterMoved, enemyInCombat); if (draculaEventCard != null) { DiscardEventFromDracula(draculaEventCard.name); switch (draculaEventCard.name) { case "Trap": PlayTrap(ui); int hunterPlayingGoodluck = ui.AskWhichHunterIsUsingGoodLuckToCancelEvent(); if (hunterPlayingGoodluck > -1) { DiscardEventFromHunterAtIndex("Good Luck", hunterPlayingGoodluck, ui); } else { trapPlayed = true; break; } break; case "Rage": PlayRage(huntersInCombat, ui); int hunterPlayingGoodluckB = ui.AskWhichHunterIsUsingGoodLuckToCancelEvent(); if (hunterPlayingGoodluckB > -1) { DiscardEventFromHunterAtIndex("Good Luck", hunterPlayingGoodluckB, ui); } else { rageRounds = 3; try { enemyCombatCards.Remove(enemyCombatCards.Find(card => card.Name == "Escape (Man)")); } catch (Exception e) { } try { enemyCombatCards.Remove(enemyCombatCards.Find(card => card.Name == "Escape (Bat)")); } catch (Exception e) { } try { enemyCombatCards.Remove(enemyCombatCards.Find(card => card.Name == "Escape (Mist)")); } catch (Exception e) { } } break; case "Wild Horses": PlayWildHorses(huntersInCombat, ui); return "Wild Horses"; } } } while (draculaEventCard != null); bool[] hunterPlayedCard = new bool[4] { true, true, true, true }; int hunterPlayingCard = 0; while (hunterPlayedCard[0] || hunterPlayedCard[1] || hunterPlayedCard[2] || hunterPlayedCard[3]) { if (ui.GetHunterPlayingCard(Hunters[hunterPlayingCard].Name)) { string cardName = ""; do { cardName = ui.GetNameOfHunterCardPlayedAtStartOfCombat(Hunters[hunterPlayingCard].Name); } while (GetEventByNameFromEventDeck(cardName).name == "Unknown event" && GetItemByNameFromItemDeck(cardName).Name == "Unknown item" && cardName.ToLower() != "cancel"); if (cardName != "cancel") { hunterPlayedCard[hunterPlayingCard] = true; switch (cardName) { case "Advance Planning": DiscardEventFromHunterAtIndex(cardName, hunterPlayingCard, ui); draculaEventCard = Dracula.WillPlayDevilishPower(this, ui); bool eventIsCancelled = false; if (draculaEventCard != null) { switch (draculaEventCard.name) { case "DevilishPower": ui.TellUser("Dracula played Devilish power to cancel this event"); DiscardEventFromDracula("Devilish Power"); int hunterPlayingGoodluck = ui.AskWhichHunterIsUsingGoodLuckToCancelEvent(); if (hunterPlayingGoodluck > -1) { DiscardEventFromHunterAtIndex("Good Luck", hunterPlayingGoodluck, ui); } else { eventIsCancelled = true; } break; } } if (!eventIsCancelled) { PlayAdvancePlanningInCombat(ui); } break; case "Escape Route": DiscardEventFromHunterAtIndex(cardName, hunterPlayingCard, ui); draculaEventCard = Dracula.WillPlayDevilishPower(this, ui); bool eventIsCancelledB = false; if (draculaEventCard != null) { switch (draculaEventCard.name) { case "DevilishPower": ui.TellUser("Dracula played Devilish power to cancel this event"); DiscardEventFromDracula("Devilish Power"); int hunterPlayingGoodluck = ui.AskWhichHunterIsUsingGoodLuckToCancelEvent(); if (hunterPlayingGoodluck > -1) { DiscardEventFromHunterAtIndex("Good Luck", hunterPlayingGoodluck, ui); } else { eventIsCancelledB = true; } break; } } if (!eventIsCancelledB) { PlayEscapeRouteInCombat(hunterPlayingCard, ui); return "Escape Route"; } break; case "Heroic Leap": DiscardEventFromHunterAtIndex(cardName, hunterPlayingCard, ui); draculaEventCard = Dracula.WillPlayDevilishPower(this, ui); bool eventIsCancelledC = false; if (draculaEventCard != null) { switch (draculaEventCard.name) { case "DevilishPower": ui.TellUser("Dracula played Devilish power to cancel this event"); DiscardEventFromDracula("Devilish Power"); int hunterPlayingGoodluck = ui.AskWhichHunterIsUsingGoodLuckToCancelEvent(); if (hunterPlayingGoodluck > -1) { DiscardEventFromHunterAtIndex("Good Luck", hunterPlayingGoodluck, ui); } else { eventIsCancelledC = true; } break; } } if (!eventIsCancelledC) { PlayHeroicLeapInCombat(hunterPlayingCard, ui); } break; case "Garlic": rageRounds = 3; if (enemyCombatCards.FindIndex(card => card.Name == "Escape (Man)") > -1) { enemyCombatCards.Remove(enemyCombatCards.Find(card => card.Name == "Escape (Man)")); } if (enemyCombatCards.FindIndex(card => card.Name == "Escape (Bat)") > -1) { enemyCombatCards.Remove(enemyCombatCards.Find(card => card.Name == "Escape (Bat)")); } if (enemyCombatCards.FindIndex(card => card.Name == "Escape (Mist)") > -1) { enemyCombatCards.Remove(enemyCombatCards.Find(card => card.Name == "Escape (Mist)")); } DiscardItemFromHunterAtIndex(cardName, hunterPlayingCard, ui); break; } } } else { hunterPlayedCard[hunterPlayingCard] = false; } hunterPlayingCard = (hunterPlayingCard + 1) % 4; } CombatRoundResult roundResult = new CombatRoundResult(); roundResult = ResolveRoundOfCombat(huntersInCombat, enemyCombatCards, hunterBasicCards, roundResult, hunterMoved, enemyInCombat, ui); rageRounds--; if (rageRounds == 0) { enemyCombatCards.Add(new ItemDetail("Escape (Man)")); if (TimeIndex > 2) { enemyCombatCards.Add(new ItemDetail("Escape (Bat)")); enemyCombatCards.Add(new ItemDetail("Escape (Mist)")); } } enemyCombatCards.Add(new ItemDetail("Dodge")); hunterBasicCards.Add(new ItemDetail("Dodge")); while (roundResult.outcome != "Bite" && roundResult.outcome != "Enemy killed" && roundResult.outcome != "Hunter killed" && roundResult.outcome != "End") { if (roundResult.outcome == "Hunter wounded") { if (ui.AskIfHunterIsUsingGreatStrengthToCancelDamage(roundResult.hunterTargeted)) { DiscardEventFromHunterAtIndex("Great Strength", Array.FindIndex(Hunters, h => h.Name == roundResult.hunterTargeted), ui); draculaEventCard = Dracula.WillPlayDevilishPower(this, ui); if (draculaEventCard != null) { switch (draculaEventCard.name) { case "DevilishPower": ui.TellUser("Dracula played Devilish power to cancel this event"); DiscardEventFromDracula("Devilish Power"); int hunterPlayingGoodluck = ui.AskWhichHunterIsUsingGoodLuckToCancelEvent(); if (hunterPlayingGoodluck > -1) { DiscardEventFromHunterAtIndex("Good Luck", hunterPlayingGoodluck, ui); } break; } } } } roundResult = ResolveRoundOfCombat(huntersInCombat, enemyCombatCards, hunterBasicCards, roundResult, hunterMoved, enemyInCombat, ui); } foreach (Hunter h in huntersInCombat) { h.Health -= ui.GetHunterHealthLost(h.Name); } if (enemyInCombat == 1) { Dracula.Blood -= ui.GetDraculaBloodLost(); } ui.TellUser("Be sure to discard any items that were destroyed/consumed in this combat"); if (roundResult.outcome == "Bite" || roundResult.outcome == "Enemy killed" || roundResult.outcome == "Hunter killed" || roundResult.outcome == "End") { switch (roundResult.outcome) { case "Bite": ApplyBiteToHunter(Array.FindIndex(Hunters, hunt => hunt.Name == roundResult.hunterTargeted), ui); HandleDraculaEscape(ui); break; case "End": if (TimeIndex > 2) { HandleDraculaEscape(ui); } break; } return roundResult.outcome; } return ui.GetCombatRoundOutcome(); }
internal void PlayHiredScouts(UserInterface ui) { EventDetail draculaEventCard = Dracula.WillPlayDevilishPower(this, ui); bool eventIsCancelled = false; if (draculaEventCard != null) { switch (draculaEventCard.name) { case "DevilishPower": ui.TellUser("Dracula played Devilish power to cancel this event"); DiscardEventFromDracula("Devilish Power"); int hunterPlayingGoodluck = ui.AskWhichHunterIsUsingGoodLuckToCancelEvent(); if (hunterPlayingGoodluck > -1) { DiscardEventFromHunterAtIndex("Good Luck", hunterPlayingGoodluck, ui); } else { eventIsCancelled = true; } break; } } if (!eventIsCancelled) { string line = ""; LocationDetail locationToReveal; do { line = ui.GetFirstLocationNameForHiredScouts(); locationToReveal = GetLocationFromName(line); ui.TellUser(locationToReveal.Name); } while (locationToReveal.Name == "Unknown location" || locationToReveal.Name == "Multiple locations"); if (LocationIsInTrail(locationToReveal)) { bool revealingThis = true; draculaEventCard = Dracula.WillPlaySensationalistPress(this, 0); if (draculaEventCard != null) { switch (draculaEventCard.name) { case "Sensationalist Press": ui.TellUser("Dracula played Sensationalist Press to cancel revealing" + locationToReveal.Name); DiscardEventFromDracula("Sensationalist Press"); int hunterPlayingGoodluck = ui.AskWhichHunterIsUsingGoodLuckToCancelEvent(); if (hunterPlayingGoodluck > -1) { DiscardEventFromHunterAtIndex("Good Luck", hunterPlayingGoodluck, ui); } else { revealingThis = false; } break; } } if (revealingThis) { locationToReveal.IsRevealed = true; ui.TellUser("Revealing " + locationToReveal.Name); for (int i = 0; i < locationToReveal.Encounters.Count(); i++) { locationToReveal.Encounters[i].isRevealed = true; ui.TellUser(" and " + locationToReveal.Encounters[i].name); } ui.TellUser(""); ui.drawGameState(this); } } else { ui.TellUser(locationToReveal.Name + " is not in Dracula's trail"); } do { line = ui.GetSecondLocationNameForHiredScouts(); locationToReveal = GetLocationFromName(line); ui.TellUser(locationToReveal.Name); } while (locationToReveal.Name == "Unknown location" || locationToReveal.Name == "Multiple locations"); if (LocationIsInTrail(locationToReveal)) { locationToReveal.IsRevealed = true; ui.TellUser("Revealing " + locationToReveal.Name); for (int i = 0; i < locationToReveal.Encounters.Count(); i++) { locationToReveal.Encounters[i].isRevealed = true; ui.TellUser(" and " + locationToReveal.Encounters[i].name); } ui.TellUser(""); } else { ui.TellUser(locationToReveal.Name + " is not in Dracula's trail"); } } }
internal void PlayHypnosis(UserInterface ui) { EventDetail draculaEventCard = Dracula.WillPlayDevilishPower(this, ui); bool eventIsCancelled = false; if (draculaEventCard != null) { switch (draculaEventCard.name) { case "DevilishPower": ui.TellUser("Dracula played Devilish power to cancel this event"); DiscardEventFromDracula("Devilish Power"); int hunterPlayingGoodluck = ui.AskWhichHunterIsUsingGoodLuckToCancelEvent(); if (hunterPlayingGoodluck > -1) { DiscardEventFromHunterAtIndex("Good Luck", hunterPlayingGoodluck, ui); } else { eventIsCancelled = true; } break; } } if (!eventIsCancelled) { if (ui.GetDieRoll() < 3) { ui.TellUser("Nothing happened"); Logger.WriteToDebugLog("Hypnosis was unsuccessful"); } else { ui.TellUser("The hypnosis was successful"); Logger.WriteToDebugLog("The hypnosis was successful"); Logger.WriteToGameLog("The hypnosis was successful"); draculaEventCard = Dracula.WillPlaySensationalistPress(this, 0); bool revealing = true; if (draculaEventCard != null) { switch (draculaEventCard.name) { case "Sensationalist Press": ui.TellUser("Dracula played Sensationalist Press to cancel revealing his current location"); DiscardEventFromDracula("Sensationalist Press"); int hunterPlayingGoodluck = ui.AskWhichHunterIsUsingGoodLuckToCancelEvent(); if (hunterPlayingGoodluck > -1) { DiscardEventFromHunterAtIndex("Good Luck", hunterPlayingGoodluck, ui); } else { revealing = false; } break; } } if (revealing) { ui.TellUser("Dracula's current location is " + Dracula.CurrentLocation.Name); Dracula.CurrentLocation.IsRevealed = true; } foreach (LocationDetail l in Dracula.LocationTrail) { foreach (EncounterDetail e in l.Encounters) { if (e.name == "New Vampire") { e.isRevealed = true; Logger.WriteToDebugLog("Vampire revealed at " + l.Name); Logger.WriteToGameLog("Vampire revealed at " + l.Name); } } } foreach (LocationDetail l in Dracula.Catacombs) { foreach (EncounterDetail e in l.Encounters) { if (e.name == "New Vampire") { e.isRevealed = true; Logger.WriteToDebugLog("Vampire revealed at " + l.Name); Logger.WriteToGameLog("Vampire revealed at " + l.Name); } } } Dracula.DeterminePossibleLocations(); Dracula.DeterminePossiblePowers(Dracula.CurrentLocation.Type == LocationType.Sea ? TimeIndex : TimeIndex + 1); Logger.WriteToDebugLog("Checking if there are legal moves"); if (Dracula.PossibleMoves.Count() + Dracula.PossiblePowers.Count() == 0) { Logger.WriteToDebugLog("Dracula has no legal moves"); ui.TellUser("Dracula is cornered by his own trail"); } else if (Dracula.PossibleMoves.Count() == 0 && Dracula.PossiblePowers.Count() == 1 && Dracula.PossiblePowers.Contains(Dracula.Powers[1])) { Logger.WriteToDebugLog("Dracula has no regular moves available"); Dracula.DeterminePossibleWolfFormLocations(); if (Dracula.PossibleMoves.Count() == 0) { Logger.WriteToDebugLog("Dracula has no moves available by Wolf Form"); ui.TellUser("Dracula is cornered by his own trail"); } Dracula.DeterminePossibleLocations(); } string powerUsed; LocationDetail destination = Dracula.ChooseMoveForHypnosis(this, out powerUsed); ui.TellUser("Dracula will use " + powerUsed + " and move to " + destination.Name); Dracula.AdvanceMovePower = powerUsed; Dracula.AdvanceMoveDestination = destination; } } }
internal void PlayCharteredCarriage(UserInterface ui) { EventDetail draculaEventCard = Dracula.WillPlayCardToCancelCharteredCarriage(this); bool eventIsCancelled = false; if (draculaEventCard != null) { switch (draculaEventCard.name) { case "False Tip-off": ui.TellUser("Dracula played False Tip-off to cancel your Chartered Carriage"); DiscardEventFromDracula("False Tip-off"); int hunterPlayingGoodluck = ui.AskWhichHunterIsUsingGoodLuckToCancelEvent(); if (hunterPlayingGoodluck > -1) { DiscardEventFromHunterAtIndex("Good Luck", hunterPlayingGoodluck, ui); } else { eventIsCancelled = true; } break; case "Devilish Power": ui.TellUser("Dracula played Devilish Power to cancel this event"); DiscardEventFromDracula("Devilish Power"); int hunterPlayingGoodluckB = ui.AskWhichHunterIsUsingGoodLuckToCancelEvent(); if (hunterPlayingGoodluckB > -1) { DiscardEventFromHunterAtIndex("Good Luck", hunterPlayingGoodluckB, ui); } else { eventIsCancelled = true; } break; } } if (!eventIsCancelled) { ui.TellUser("You may catch a fast train this turn"); } }
internal void PlayConsecratedGround(int hunterIndex, UserInterface ui) { EventDetail draculaEventCard = Dracula.WillPlayDevilishPower(this, ui); bool eventIsCancelled = false; if (draculaEventCard != null) { switch (draculaEventCard.name) { case "DevilishPower": ui.TellUser("Dracula played Devilish power to cancel this event"); DiscardEventFromDracula("Devilish Power"); int hunterPlayingGoodluck = ui.AskWhichHunterIsUsingGoodLuckToCancelEvent(); if (hunterPlayingGoodluck > -1) { DiscardEventFromHunterAtIndex("Good Luck", hunterPlayingGoodluck, ui); } else { eventIsCancelled = true; } break; } } if (!eventIsCancelled) { LocationDetail locationToConsecrate; do { locationToConsecrate = GetLocationFromName(ui.GetNameOfLocationToConsecrate()); ui.TellUser(locationToConsecrate.Name); } while (locationToConsecrate.Name == "Unknown location" || locationToConsecrate.Name == "Multiple locations" || (locationToConsecrate.Type != LocationType.City && locationToConsecrate.Type != LocationType.Town) || locationToConsecrate.Name == "Galatz" || locationToConsecrate.Name == "Klausenburg"); Logger.WriteToDebugLog("Consecrate Ground was played in " + locationToConsecrate.Name); Logger.WriteToGameLog("Consecrate Ground was played in " + locationToConsecrate.Name); foreach (LocationDetail loc in Map) { loc.IsConsecrated = false; } locationToConsecrate.IsConsecrated = true; ui.TellUser(locationToConsecrate.Name + " is now consecrated ground"); if (locationToConsecrate == Dracula.CurrentLocation) { locationToConsecrate.IsRevealed = true; List<EncounterDetail> encountersToDiscard = new List<EncounterDetail>(); foreach (EncounterDetail e in locationToConsecrate.Encounters) { ui.TellUser(e.name + " was discarded"); encountersToDiscard.Add(e); e.isRevealed = false; EncounterPool.Add(e); } foreach (EncounterDetail e in encountersToDiscard) { locationToConsecrate.Encounters.Remove(e); } } } }
internal void PlayBloodTransfusion(UserInterface ui) { EventDetail draculaEventCard = Dracula.WillPlayDevilishPower(this, ui); bool eventIsCancelled = false; if (draculaEventCard != null) { switch (draculaEventCard.name) { case "DevilishPower": ui.TellUser("Dracula played Devilish power to cancel this event"); DiscardEventFromDracula("Devilish Power"); int hunterPlayingGoodluck = ui.AskWhichHunterIsUsingGoodLuckToCancelEvent(); if (hunterPlayingGoodluck > -1) { DiscardEventFromHunterAtIndex("Good Luck", hunterPlayingGoodluck, ui); } else { eventIsCancelled = true; } break; } } if (!eventIsCancelled) { int hunterIndexA = ui.GetIndexOfHunterGivingBloodTransfusion(); int hunterIndexB = ui.GetIndexOfHunterReceivingBloodTransfusion(); Hunters[hunterIndexA].Health--; Hunters[hunterIndexB].NumberOfBites--; if (Hunters[hunterIndexB].NumberOfBites < 1) { Hunters[hunterIndexB].ItemShownToDraculaForBeingBitten = null; Hunters[hunterIndexB].EventShownToDraculaForBeingBitten = null; } ui.TellUser(Hunters[hunterIndexA].Name + " donated blood (1 health) to " + Hunters[hunterIndexB].Name + " who was cured of a Bite"); Logger.WriteToDebugLog(Hunters[hunterIndexA].Name + " donated blood (1 health) to " + Hunters[hunterIndexB].Name + " who was cured of a Bite"); Logger.WriteToGameLog(Hunters[hunterIndexA].Name + " donated blood (1 health) to " + Hunters[hunterIndexB].Name + " who was cured of a Bite"); } }
internal void PerformDraculaTurn(UserInterface ui) { if (Dracula.CurrentLocation.Type != LocationType.Sea) { TimeIndex = (TimeIndex + 1) % 6; Logger.WriteToDebugLog("Time is now " + TimesOfDay[TimeIndex]); if (TimeIndex == 0) { VampirePointTracker++; Resolve++; Logger.WriteToDebugLog("Increasing vampire track to " + VampirePointTracker); Logger.WriteToDebugLog("Increasing resolve to " + Resolve); if (VampirePointTracker > 0) { Logger.WriteToGameLog("Dracula earned a point, up to " + VampirePointTracker); Logger.WriteToGameLog("Hunters gained a point of resolve, up to " + Resolve); } } } else { Logger.WriteToDebugLog("Dracula is at sea, skipping Timekeeping phase so time remains " + TimesOfDay[Math.Max(0, TimeIndex)]); } EventDetail draculaEventCard = null; do { draculaEventCard = Dracula.PlayEventCardAtStartOfDraculaTurn(this); if (draculaEventCard != null) { switch (draculaEventCard.name) { case "Time Runs Short": ui.TellUser("Dracula played Time Runs Short"); DiscardEventFromDracula(draculaEventCard.name); int hunterPlayingGoodluckC = ui.AskWhichHunterIsUsingGoodLuckToCancelEvent(); if (hunterPlayingGoodluckC > -1) { DiscardEventFromHunterAtIndex("Good Luck", hunterPlayingGoodluckC, ui); } else { TimeIndex++; } break; case "Unearthly Swiftness": ui.TellUser("Dracula played Unearthly Swiftness"); int hunterPlayingGoodluck = ui.AskWhichHunterIsUsingGoodLuckToCancelEvent(); if (hunterPlayingGoodluck > -1) { DiscardEventFromHunterAtIndex("Good Luck", hunterPlayingGoodluck, ui); } else { DiscardEventFromDracula(draculaEventCard.name); Dracula.DraculaMovementPhase(this, ui); Dracula.DoActionPhase(this, ui); } break; case "Roadblock": ui.TellUser("Dracula played Roadblock "); DiscardEventFromDracula("Roadblock"); int hunterPlayingGoodluckB = ui.AskWhichHunterIsUsingGoodLuckToCancelEvent(); if (hunterPlayingGoodluckB > -1) { DiscardEventFromHunterAtIndex("Good Luck", hunterPlayingGoodluckB, ui); } else { Dracula.PlaceRoadBlockCounter(this, RoadblockCounter); ui.TellUser("Dracula played Roadblock and placed the Roadblock counter on the " + RoadblockCounter.connectionType + " between " + RoadblockCounter.firstLocation + " and " + RoadblockCounter.secondLocation); } break; case "Devilish Power": Dracula.PlayDevilishPowerToRemoveHeavenlyHostOrHunterAlly(this, ui); // Good luck is handled within this function DiscardEventFromDracula("Devilish Power"); break; } } } while (draculaEventCard != null); Dracula.TakeStartOfTurnActions(this, ui); Dracula.DraculaMovementPhase(this, ui); Dracula.HandleDroppedOffLocations(this, ui); Dracula.DoActionPhase(this, ui); Dracula.MatureEncounters(this, ui); Dracula.DrawEncounters(this, Dracula.EncounterHandSize); foreach (EncounterDetail enc in EncounterLimbo) { EncounterPool.Add(enc); enc.isRevealed = false; } EncounterLimbo.Clear(); if (HuntersHaveAlly()) { if (HunterAlly.name == "Jonathan Harker") { if (Dracula.LocationTrail.Count() > 5) { Dracula.LocationTrail[5].IsRevealed = true; } } } }
public void PlayImmediately(GameState g, EventDetail eventCardDrawn, UserInterface ui) { switch (eventCardDrawn.name) { case "Evasion": int hunterPlayingGoodluckC = ui.AskWhichHunterIsUsingGoodLuckToCancelEvent(); if (hunterPlayingGoodluckC > 0) { g.DiscardEventFromHunterAtIndex("Good Luck", hunterPlayingGoodluckC, ui); } else { PlayEvasion(g, ui); break; } break; case "Night Visit": int hunterPlayingGoodluck = ui.AskWhichHunterIsUsingGoodLuckToCancelEvent(); if (hunterPlayingGoodluck > 0) { g.DiscardEventFromHunterAtIndex("Good Luck", hunterPlayingGoodluck, ui); } else { PlayNightVisit(g, ui); break; } break; case "Vampiric Influence": int hunterPlayingGoodluckB = ui.AskWhichHunterIsUsingGoodLuckToCancelEvent(); if (hunterPlayingGoodluckB > 0) { g.DiscardEventFromHunterAtIndex("Good Luck", hunterPlayingGoodluckB, ui); } else { PlayVampiricInfluence(g, ui); break; } break; } }
internal void PlayStormySeas(UserInterface ui) { EventDetail draculaEventCard = Dracula.WillPlayDevilishPower(this, ui); bool eventIsCancelled = false; if (draculaEventCard != null) { switch (draculaEventCard.name) { case "DevilishPower": ui.TellUser("Dracula played Devilish power to cancel this event"); DiscardEventFromDracula("Devilish Power"); int hunterPlayingGoodluck = ui.AskWhichHunterIsUsingGoodLuckToCancelEvent(); if (hunterPlayingGoodluck > -1) { DiscardEventFromHunterAtIndex("Good Luck", hunterPlayingGoodluck, ui); } else { eventIsCancelled = true; } break; } } if (!eventIsCancelled) { LocationDetail locationToStorm; do { locationToStorm = GetLocationFromName(ui.GetNameOfLocationWhereStormySeasIsBeingPlayed()); ui.TellUser(locationToStorm.Name); } while (locationToStorm.Name == "Unknown location" || locationToStorm.Name == "Multiple locations" || locationToStorm.Type != LocationType.Sea); Logger.WriteToDebugLog("Stormy Seas was played in " + locationToStorm.Name); Logger.WriteToGameLog("Stormy Seas was played in " + locationToStorm.Name); locationToStorm.TurnsUntilStormSubsides = 2; if (locationToStorm == Dracula.CurrentLocation) { locationToStorm.IsRevealed = true; ui.TellUser("That is where Dracula was"); LocationDetail locationToMoveTo = Dracula.DecideWhichPortToGoToAfterStormySeas(this, locationToStorm); Dracula.MoveByRoadOrSea(this, locationToMoveTo, ui); draculaEventCard = Dracula.WillPlaySensationalistPress(this, 0); bool revealing = true; if (draculaEventCard != null) { switch (draculaEventCard.name) { case "Sensationalist Press": ui.TellUser("Dracula played Sensationalist Press to cancel revealing the port he went to"); DiscardEventFromDracula("Sensationalist Press"); int hunterPlayingGoodluck = ui.AskWhichHunterIsUsingGoodLuckToCancelEvent(); if (hunterPlayingGoodluck > -1) { DiscardEventFromHunterAtIndex("Good Luck", hunterPlayingGoodluck, ui); } else { revealing = false; } break; } } if (revealing) { Dracula.LocationTrail[0].IsRevealed = true; } Dracula.HandleDroppedOffLocations(this, ui); Dracula.MatureEncounters(this, ui); } } }
internal void PlayLongDay(UserInterface ui) { { EventDetail draculaEventCard = Dracula.WillPlayDevilishPower(this, ui); bool eventIsCancelled = false; if (draculaEventCard != null) { switch (draculaEventCard.name) { case "DevilishPower": ui.TellUser("Dracula played Devilish power to cancel this event"); DiscardEventFromDracula("Devilish Power"); int hunterPlayingGoodluck = ui.AskWhichHunterIsUsingGoodLuckToCancelEvent(); if (hunterPlayingGoodluck > -1) { DiscardEventFromHunterAtIndex("Good Luck", hunterPlayingGoodluck, ui); } else { eventIsCancelled = true; } break; } } if (!eventIsCancelled) { AdjustTime(-1); } } }
internal void PlaySurprisingReturn(int hunterIndex, UserInterface ui) { EventDetail draculaEventCard = Dracula.WillPlayDevilishPower(this, ui); bool eventIsCancelled = false; if (draculaEventCard != null) { switch (draculaEventCard.name) { case "DevilishPower": ui.TellUser("Dracula played Devilish power to cancel this event"); DiscardEventFromDracula("Devilish Power"); int hunterPlayingGoodluck = ui.AskWhichHunterIsUsingGoodLuckToCancelEvent(); if (hunterPlayingGoodluck > -1) { DiscardEventFromHunterAtIndex("Good Luck", hunterPlayingGoodluck, ui); } else { eventIsCancelled = true; } break; } } if (!eventIsCancelled) { string cardToReclaim; do { cardToReclaim = ui.GetEventCardNameBeingReturned(); } while (cardToReclaim.ToLower() != "none" && GetEventByNameFromEventDiscard(cardToReclaim).name == "Unknown event"); if (cardToReclaim.ToLower() != "none") { AddEventCardToHunterAtIndex(hunterIndex, ui); } } }
internal void PlayMoneyTrail(UserInterface ui) { EventDetail draculaEventCard = Dracula.WillPlayDevilishPower(this, ui); bool eventIsCancelled = false; if (draculaEventCard != null) { switch (draculaEventCard.name) { case "DevilishPower": ui.TellUser("Dracula played Devilish power to cancel this event"); DiscardEventFromDracula("Devilish Power"); int hunterPlayingGoodluck = ui.AskWhichHunterIsUsingGoodLuckToCancelEvent(); if (hunterPlayingGoodluck > -1) { DiscardEventFromHunterAtIndex("Good Luck", hunterPlayingGoodluck, ui); } else { eventIsCancelled = true; } break; } } if (!eventIsCancelled) { ui.TellUser("Revealing all sea locations in Dracula's trail"); for (int i = 0; i < TrailLength(); i++) { if (TypeOfLocationAtTrailIndex(i) == LocationType.Sea) { draculaEventCard = Dracula.WillPlaySensationalistPress(this, i); bool revealing = true; if (draculaEventCard != null) { switch (draculaEventCard.name) { case "Sensationalist Press": ui.TellUser("Dracula played Sensationalist Press to cancel revealing location at position " + i); DiscardEventFromDracula("Sensationalist Press"); int hunterPlayingGoodluck = ui.AskWhichHunterIsUsingGoodLuckToCancelEvent(); if (hunterPlayingGoodluck > -1) { DiscardEventFromHunterAtIndex("Good Luck", hunterPlayingGoodluck, ui); } else { revealing = false; } break; } } if (revealing) { RevealLocationAtTrailIndex(i, ui); } } } } }
internal void PlayVampireLair(int hunterIndex, UserInterface ui) { EventDetail draculaEventCard = Dracula.WillPlayDevilishPower(this, ui); bool eventIsCancelled = false; if (draculaEventCard != null) { switch (draculaEventCard.name) { case "DevilishPower": ui.TellUser("Dracula played Devilish power to cancel this event"); DiscardEventFromDracula("Devilish Power"); int hunterPlayingGoodluck = ui.AskWhichHunterIsUsingGoodLuckToCancelEvent(); if (hunterPlayingGoodluck > -1) { DiscardEventFromHunterAtIndex("Good Luck", hunterPlayingGoodluck, ui); } else { eventIsCancelled = true; } break; } } if (!eventIsCancelled) { switch (ResolveCombat(hunterIndex, 6, true, ui)) { case "Bite": if (NumberOfHuntersAtLocation(LocationOfHunterAtHunterIndex(hunterIndex)) > 1) { ApplyBiteToOneOfMultipleHunters(hunterIndex, ui); } else { ApplyBiteToHunter(hunterIndex, ui); } break; case "Enemy wounded": VampirePointTracker--; break; case "Enemy killed": VampirePointTracker--; break; case "Hunter killed": Hunters[ui.GetNameOfHunterKilled()].Health = 0; HandlePossibleHunterDeath(ui); break; } } }
internal void PlayMysticResearch(UserInterface ui) { EventDetail draculaEventCard = Dracula.WillPlayDevilishPower(this, ui); bool eventIsCancelled = false; if (draculaEventCard != null) { switch (draculaEventCard.name) { case "DevilishPower": ui.TellUser("Dracula played Devilish power to cancel this event"); DiscardEventFromDracula("Devilish Power"); int hunterPlayingGoodluck = ui.AskWhichHunterIsUsingGoodLuckToCancelEvent(); if (hunterPlayingGoodluck > -1) { DiscardEventFromHunterAtIndex("Good Luck", hunterPlayingGoodluck, ui); } else { eventIsCancelled = true; } break; } } if (!eventIsCancelled) { ui.TellUser("These are Draculas cards:"); foreach (EventDetail card in Dracula.EventCardsInHand) { ui.TellUser(card.name); } } }
public bool ResolveNewVampire(List<Hunter> huntersEncountered, out bool discard, UserInterface ui) { if (TimeIndex < 3) { ui.TellUser(huntersEncountered[0].Name + " encountered a New Vampire and disposed of it during the day"); discard = true; return true; } else { EventDetail draculaEventCard = Dracula.PlaySeductionCard(this); DiscardEventFromDracula("Seduction"); ui.TellUser("Dracula played Seduction"); int dieRoll; if (draculaEventCard != null) { int hunterPlayingGoodluck = ui.AskWhichHunterIsUsingGoodLuckToCancelEvent(); if (hunterPlayingGoodluck > -1) { DiscardEventFromHunterAtIndex("Good Luck", hunterPlayingGoodluck, ui); dieRoll = ui.GetDieRoll(); } else { dieRoll = 4; } } else { dieRoll = ui.GetDieRoll(); } if (dieRoll < 4) { ui.TellUser("The Vampire attempts to bite you"); for (int i = 0; i < huntersEncountered.Count(); i++) { int answer; if (draculaEventCard != null) { answer = 0; } else { answer = ui.GetHunterHolyItems(huntersEncountered[i].Name); } if (answer > 0) { Logger.WriteToDebugLog(huntersEncountered[i].Name + " negated the encounter with " + (answer == 1 ? "a crucifix" : "a heavenly host")); Logger.WriteToGameLog(huntersEncountered[i].Name + " negated the encounter with " + (answer == 1 ? "a crucifix" : "a heavenly host")); ui.TellUser(huntersEncountered[i].Name + " negated the encounter with " + (answer == 1 ? "a crucifix" : "a heavenly host")); discard = true; return true; } } foreach (Hunter h in huntersEncountered) { Logger.WriteToDebugLog(h.Name + " is bitten"); Logger.WriteToGameLog(h.Name + " is bitten"); ui.TellUser(h.Name + " is bitten"); discard = true; return (!HandlePossibleHunterDeath(ui)); } discard = true; return true; } else { ui.TellUser("The Vampire attempts to escape"); for (int i = 0; i < huntersEncountered.Count(); i++) { int answer = ui.GetHunterSharpItems(huntersEncountered[i].Name); if (answer > 0) { Logger.WriteToDebugLog(huntersEncountered[i].Name + " prevented the Vampire escaping with " + (answer == 1 ? "a Knife" : "a Stake")); Logger.WriteToGameLog(huntersEncountered[i].Name + " prevented the Vampire escaping with " + (answer == 1 ? "a Knife" : "a Stake")); ui.TellUser(huntersEncountered[i].Name + " prevented the Vampire escaping with " + (answer == 1 ? "a Knife" : "a Stake")); ui.TellUser("Don't forget to discard the item"); discard = true; return true; } } ui.TellUser("The Vampire escaped"); discard = false; return true; } } }
public bool ResolveMinionWithKnife(List<Hunter> huntersEncountered, UserInterface ui) { int hunterIndex = 0; switch (huntersEncountered[0].Name) { case "Lord Godalming": hunterIndex = 0; break; case "Van Helsing": hunterIndex = 1; break; case "Dr. Seward": hunterIndex = 2; break; case "Mina Harker": hunterIndex = 3; break; } string combatResult = ResolveCombat(hunterIndex, 2, true, ui); if (combatResult == "Enemy killed" || combatResult == "End") { EventDetail draculaEventCard = Dracula.WillPlayRelentlessMinion(this, huntersEncountered, "Minion with Knife"); if (draculaEventCard != null) { switch (draculaEventCard.name) { case "Relentless Minion": ui.TellUser("Dracula played Relentless Minion"); DiscardEventFromDracula("Relentless Minion"); int hunterPlayingGoodluck = ui.AskWhichHunterIsUsingGoodLuckToCancelEvent(); if (hunterPlayingGoodluck > -1) { DiscardEventFromHunterAtIndex("Good Luck", hunterPlayingGoodluck, ui); } else { combatResult = ResolveCombat(hunterIndex, 2, true, ui); } break; } } if (combatResult == "Enemy killed") { return true; } } return false; }
private void PlayWildHorses(List<Hunter> huntersBeingMoved, UserInterface ui) { ui.TellUser("Dracula played Wild Horses"); int hunterIndex = ui.AskWhichHunterIsUsingGoodLuckToCancelEvent(); if (hunterIndex > -1) { DiscardEventFromHunterAtIndex("Good Luck", hunterIndex, ui); } else { LocationDetail locationToMoveHuntersToWithWildHorses = Dracula.ChooseLocationToSendHuntersToWithWildHorses(this, huntersBeingMoved); ui.TellUser("Dracula moved you to " + locationToMoveHuntersToWithWildHorses.Name); foreach (Hunter h in huntersBeingMoved) { h.CurrentLocation = locationToMoveHuntersToWithWildHorses; } } }
internal void PlayNewspaperReports(UserInterface ui) { EventDetail draculaEventCard = Dracula.WillPlayDevilishPower(this, ui); bool eventIsCancelled = false; if (draculaEventCard != null) { switch (draculaEventCard.name) { case "DevilishPower": ui.TellUser("Dracula played Devilish power to cancel this event"); DiscardEventFromDracula("Devilish Power"); int hunterPlayingGoodluck = ui.AskWhichHunterIsUsingGoodLuckToCancelEvent(); if (hunterPlayingGoodluck > -1) { DiscardEventFromHunterAtIndex("Good Luck", hunterPlayingGoodluck, ui); } else { eventIsCancelled = true; } break; } } if (!eventIsCancelled) { int checkingLocationIndex = TrailLength(); do { checkingLocationIndex--; } while ((TypeOfLocationAtTrailIndex(checkingLocationIndex) != LocationType.Castle && TypeOfLocationAtTrailIndex(checkingLocationIndex) != LocationType.City && TypeOfLocationAtTrailIndex(checkingLocationIndex) != LocationType.Sea && TypeOfLocationAtTrailIndex(checkingLocationIndex) != LocationType.Town) || LocationIsRevealedAtTrailIndex(checkingLocationIndex)); if (DraculaCurrentLocationIsAtTrailIndex(checkingLocationIndex)) { ui.TellUser("The oldest unrevealed location in Dracula's trail is his current location"); if (LocationWhereHideWasUsedIsDraculaCurrentLocation()) { ui.TellUser("Here's the Hide card to prove it"); RevealHide(ui); } } else { draculaEventCard = Dracula.WillPlaySensationalistPress(this, 0); bool revealing = true; if (draculaEventCard != null) { switch (draculaEventCard.name) { case "Sensationalist Press": ui.TellUser("Dracula played Sensationalist Press to cancel revealing the location"); DiscardEventFromDracula("Sensationalist Press"); int hunterPlayingGoodluck = ui.AskWhichHunterIsUsingGoodLuckToCancelEvent(); if (hunterPlayingGoodluck > -1) { DiscardEventFromHunterAtIndex("Good Luck", hunterPlayingGoodluck, ui); } else { revealing = false; } break; } } if (revealing) { RevealLocationAtTrailIndex(checkingLocationIndex, ui); ui.TellUser("Revealing " + NameOfLocationAtTrailIndex(checkingLocationIndex)); } } } }
internal void ApplyBiteToHunter(int hunterIndex, UserInterface ui) { if (ui.AskIfHunterIsUsingGreatStrengthToCancelBite(Hunters[hunterIndex].Name)) { DiscardEventFromHunterAtIndex("Great Strength", hunterIndex, ui); EventDetail draculaEventCard = Dracula.WillPlayDevilishPower(this, ui); bool eventIsCancelled = false; if (draculaEventCard != null) { switch (draculaEventCard.name) { case "DevilishPower": ui.TellUser("Dracula played Devilish power to cancel this event"); DiscardEventFromDracula("Devilish Power"); int hunterPlayingGoodluck = ui.AskWhichHunterIsUsingGoodLuckToCancelEvent(); if (hunterPlayingGoodluck > -1) { DiscardEventFromHunterAtIndex("Good Luck", hunterPlayingGoodluck, ui); } else { eventIsCancelled = true; } break; } } if (!eventIsCancelled) { CheckBittenHunterCards(ui); return; } } Hunters[hunterIndex].NumberOfBites++; ui.TellUser(Hunters[hunterIndex].Name + " was bitten"); }
internal void PlayReEquip(UserInterface ui) { EventDetail draculaEventCard = Dracula.WillPlayDevilishPower(this, ui); bool eventIsCancelled = false; if (draculaEventCard != null) { switch (draculaEventCard.name) { case "DevilishPower": ui.TellUser("Dracula played Devilish power to cancel this event"); DiscardEventFromDracula("Devilish Power"); int hunterPlayingGoodluck = ui.AskWhichHunterIsUsingGoodLuckToCancelEvent(); if (hunterPlayingGoodluck > -1) { DiscardEventFromHunterAtIndex("Good Luck", hunterPlayingGoodluck, ui); } else { eventIsCancelled = true; } break; } } if (!eventIsCancelled) { ui.TellUser("If you choose to discard an item, please tell me what it is and tell me that you have drawn another item"); } }
internal bool DraculaWillPlayCustomsSearch(int hunterIndex, UserInterface ui) { Logger.WriteToDebugLog("Dracula is deciding whether to play Customs Search"); EventDetail draculaEventCard = Dracula.WillPlayCustomsSearch(this, Hunters[hunterIndex]); if (draculaEventCard != null) { switch (draculaEventCard.name) { case "Customs Search": int hunterPlayingGoodluck = ui.AskWhichHunterIsUsingGoodLuckToCancelEvent(); if (hunterPlayingGoodluck > -1) { DiscardEventFromHunterAtIndex("Good Luck", hunterPlayingGoodluck, ui); DiscardEventFromDracula("Customs Search"); } else { PlayCustomsSearch(hunterIndex, ui); return true; } break; } } return false; }
internal void PlayDevilishPowerToRemoveHeavenlyHostOrHunterAlly(GameState g, UserInterface ui) { List<LocationDetail> map = g.GetMap(); if (map.FindIndex(l => l.HasHost == true) > -1) { if (g.HuntersHaveAlly()) { } else { LocationDetail locationToRemoveHost = logic.DecideWhichLocationToRemoveHeavenlyHostFrom(g); Logger.WriteToDebugLog("Dracula played Devilish Power to discard a Heavenly Host from " + locationToRemoveHost.Name); ui.TellUser("Dracula played Devilish Power to discard a Heavenly Host from " + locationToRemoveHost.Name); int hunterIndex = ui.AskWhichHunterIsUsingGoodLuckToCancelEvent(); if (hunterIndex > 0) { g.DiscardEventFromHunterAtIndex("Good Luck", hunterIndex, ui); } else { locationToRemoveHost.HasHost = false; } } } else { ui.TellUser("Dracula played Devilish Power to discard the Hunters' Ally from play"); Logger.WriteToDebugLog("Dracula played Devilish Power to discard the Hunters' Ally from play"); int hunterIndex = ui.AskWhichHunterIsUsingGoodLuckToCancelEvent(); if (hunterIndex > 0) { g.DiscardEventFromHunterAtIndex("Good Luck", hunterIndex, ui); } else { g.RemoveHunterAlly(); } } }