public void SetTarget(Hunter target,Transform target_ui_potision) { current_target_hunter = target; this.transform.SetParent(target_ui_potision); this.GetComponent<RectTransform>().anchoredPosition = Vector2.zero; SetInteractable(true); }
public void Select(Hunter hunter) { hunter_name_text.text = hunter.GetHunterName(); hunter_view_camera.transform.SetParent(hunter.transform); hunter_view_camera.transform.localPosition = new Vector3(0,0.75F,0); }
public void Init() { if(user)cha = user.GetComponentInChildren<Hunter>(); if(user)hea = user.GetComponentInChildren<Health>(); if(user)wep = user.GetComponentInChildren<WeaponHolder>(); Camera cam = GetComponentInChildren<Camera>(); ratio = cam.orthographicSize/cam.pixelHeight; camsize = new Vector2(cam.pixelWidth*ratio,cam.pixelHeight*ratio); screensize = camsize/ratio; }
public Character ReadClass(int archetype, string wrmc) { int choice; Character player; MyTTY.Show("The following " + wrmc + " are available to you:\n\n"); switch (archetype) { case 1: MyTTY.Show("1) Knight\n"); MyTTY.Show("2) Berserker\n"); break; case 2: MyTTY.Show("1) Hunter\n"); MyTTY.Show("2) Assassin\n"); break; case 3: MyTTY.Show("1) Sorcerer\n"); MyTTY.Show("2) Warlock\n"); break; case 4: MyTTY.Show("1) Priest\n"); MyTTY.Show("2) Druid\n"); break; } choice = MyTTY.ReadIntLimit("\nEnter the number of your selection: ", 2); switch (archetype) { case 1: if (choice < 2) player = new Knight(); else player = new Berserker(); break; case 2: if (choice < 2) player = new Hunter(); else player = new Assassin(); break; case 3: if (choice < 2) player = new Sorcerer(); else player = new Warlock(); break; case 4: if (choice < 2) player = new Priest(); else player = new Druid(); break; default: player = null; } return player; }
public HunterPlayer(Hunter hunter, int health, int numberOfBites, int bitesRequiredToKill) { Hunter = hunter; MaxHealth = health; Health = health; BiteCount = numberOfBites; BitesRequiredToKill = bitesRequiredToKill; ItemCount = 0; EventCount = 0; ItemsKnownToDracula = new List<ItemCard>(); ItemsPartiallyKnownToDracula = new List<ItemCard>(); PartiallyKnownItemChances = new List<float>(); EventsKnownToDracula = new List<EventCard>(); HasDogsFaceUp = false; HuntersInGroup = new List<Hunter>(); HuntersInGroup.Add(Hunter); EncountersInFrontOfPlayer = new List<EncounterTile>(); }
public void CreateHunter() { _classUnderTest = new Hunter(); }
/// <summary> /// Determines if Dracula is playing Control Storms at the start of a Hunter's movement /// </summary> /// <param name="game">The GameState</param> /// <param name="hunterMoved">The Hunter moving</param> /// <param name="logic">The artificial intelligence component</param> /// <returns>True if Dracula successfully played Control Storms</returns> private static bool DraculaIsPlayingControlStorms(GameState game, Hunter hunterMoved, DecisionMaker logic) { if (logic.ChooseToPlayControlStorms(game, hunterMoved)) { Console.WriteLine("Dracula is playing Control Storms to control your movement"); game.Dracula.DiscardEvent(Event.ControlStorms, game.EventDiscard); if (HunterPlayingGoodLuckToCancelDraculaEvent(game, Event.ControlStorms, Event.ControlStorms, logic) > 0) { Console.WriteLine("Control Storms cancelled"); return false; } return true; } return false; }
/// <summary> /// Resolves the Vampire Lair Event card /// </summary> /// <param name="game">The GameState</param> /// <param name="hunterPlayingEvent">The Hunter playing the Event</param> /// <param name="logic">The artificial intelligence component</param> private static void PlayVampireLair(GameState game, Hunter hunterPlayingEvent, DecisionMaker logic) { if (game.Vampires < 1) { Console.WriteLine("No Vampires to battle"); return; } if (ResolveCombat(game, new List<HunterPlayer> { game.Hunters[(int)hunterPlayingEvent] }, Opponent.NewVampire, logic)) { game.AdjustVampires(-1); } }
/// <summary> /// Resolves the Surprising Return Event /// </summary> /// <param name="game">The GameState</param> /// <param name="hunterPlayingEvent">The Hunter playing the Event</param> private static void PlaySurprisingReturn(GameState game, Hunter hunterPlayingEvent) { if (game.EventDiscard.Count == 0) { return; } Console.WriteLine("What is the name of the card you are taking from the Event discard pile?"); var eventRetrieved = Event.None; string line = ""; while (eventRetrieved == Event.None && line.ToLower() != "nothing") { eventRetrieved = Enumerations.GetEventFromString(Console.ReadLine()); } if (line.ToLower() == "nothing") { Console.WriteLine("Event discarded"); return; } game.Hunters[(int)hunterPlayingEvent].DrawEventCard(); var eventCardRetrieved = game.EventDiscard.Find(card => card.Event == eventRetrieved); game.Hunters[(int)hunterPlayingEvent].EventsKnownToDracula.Add(eventCardRetrieved); game.EventDiscard.Remove(eventCardRetrieved); }
/// <summary> /// Handles the Sense of Emergency card or Resolve ability /// </summary> /// <param name="game">The GameState</param> /// <param name="hunterPlayingEvent">The Hunter playing the Event</param> /// <param name="logic">The artificial intelligence component</param> private static void PlaySenseOfEmergency(GameState game, Hunter hunterPlayingEvent, DecisionMaker logic) { if (game.Hunters[(int)hunterPlayingEvent].Health <= 6 - game.Vampires) { Console.WriteLine("{0} does not have enough health", hunterPlayingEvent.Name()); return; } Console.WriteLine("{0} loses {1} health", hunterPlayingEvent.Name(), 6 - game.Vampires); game.Hunters[(int)hunterPlayingEvent].AdjustHealth(game.Vampires - 6); Console.WriteLine("Where is {0} moving?"); var destination = Location.Nowhere; while (destination == Location.Nowhere) { destination = Enumerations.GetLocationFromString(Console.ReadLine()); } HandleMoveOperation(game, ((int)hunterPlayingEvent).ToString(), destination.Name(), logic); }
/// <summary> /// Resolves the Newspaper Reports Event or Resolve ability /// </summary> /// <param name="game">The GameState</param> /// <param name="hunterPlayingEvent">The Hunter playing the Event</param> /// <param name="logic">The artificial intelligence component</param> private static void PlayNewsPaperReports(GameState game, Hunter hunterPlayingEvent, DecisionMaker logic) { for (var i = 5; i > 0; i--) { if (game.Dracula.Trail[i] != null && game.Dracula.Trail[i].DraculaCards.First().Location != Location.Nowhere && game.Dracula.Trail[i].DraculaCards.First().Location != game.Dracula.CurrentLocation && !game.Dracula.Trail[i].DraculaCards.First().IsRevealed) { if (DraculaIsPlayingSensationalistPressToPreventRevealingLocation(game, game.Dracula.Trail[i].DraculaCards.First().Location, logic)) { Console.WriteLine("Dracula prevented a location from being revealed"); } else { game.Dracula.RevealCardAtPosition(i); logic.EliminateTrailsThatDoNotContainLocationAtPosition(game, game.Dracula.Trail[i].DraculaCards.First().Location, i); break; } } } }
/// <summary> /// Resolves the Consecrated Ground Event /// </summary> /// <param name="game">The GameState</param> /// <param name="hunterPlayingEvent">The Hunter playing the Event</param> private static void PlayConsecratedGround(GameState game, Hunter hunterPlayingEvent, DecisionMaker logic) { Console.WriteLine("Where would you like to place the Consecrated Ground marker?"); var ground = Location.Nowhere; while (ground == Location.Nowhere || ground == Location.CastleDracula || ground == Location.Galatz || ground == Location.Klausenburg || (game.Map.TypeOfLocation(ground) != LocationType.SmallCity && game.Map.TypeOfLocation(ground) != LocationType.LargeCity)) { ground = Enumerations.GetLocationFromString(Console.ReadLine()); } game.ConsecratedGroundLocation = ground; if (ground == game.Dracula.CurrentLocation) { var index = game.Dracula.RevealCardInTrailWithLocation(ground); logic.EliminateTrailsThatDoNotContainLocationAtPosition(game, ground, index); game.Dracula.RevealEncountersAtPositionInTrail(index); } else { logic.EliminateTrailsThatContainLocationAtPosition(game, ground, game.Dracula.CurrentLocationPosition); } }
/// <summary> /// Resolves the Chartered Carriage Event /// </summary> /// <param name="game">The GameState</param> /// <param name="hunterPlayingEvent">The Hunter playing the Event</param> /// <param name="logic">The artificial intelligence component</param> private static void PlayCharteredCarriage(GameState game, Hunter hunterPlayingEvent, DecisionMaker logic) { if (DraculaIsPlayingFalseTipoffToCancelCharteredCarriage(game, logic)) { Console.WriteLine("Chartered Carriage cancelled"); return; } Console.WriteLine("{0} catches a fast train this turn", hunterPlayingEvent.Name()); }
/// <summary> /// Resolves the Blood Transfusion Event /// </summary> /// <param name="game">The GameState</param> /// <param name="hunterPlayingEvent">The Hunter playing the Event</param> private static void PlayBloodTransfusion(GameState game, Hunter hunterPlayingEvent) { Console.WriteLine( "Who is receiving the transfusion? { 0}= { 1}, { 2}= { 3}, { 4}= { 5}, { 6}= { 7} (-1 to cancel)", (int)Hunter.LordGodalming, Hunter.LordGodalming.Name(), (int)Hunter.DrSeward, Hunter.DrSeward.Name(), (int)Hunter.VanHelsing, Hunter.VanHelsing.Name(), (int)Hunter.MinaHarker, Hunter.MinaHarker.Name()); var answer = 0; while (answer == 0) { if (int.TryParse(Console.ReadLine(), out answer)) { if (answer < 1 || answer > 4) { answer = 0; } if (answer == -1) { Console.WriteLine("Cancelled, card is still discarded"); return; } } } if ((Hunter)answer == hunterPlayingEvent) { Console.WriteLine( "Who is giving the transfusion? { 0}= { 1}, { 2}= { 3}, { 4}= { 5}, { 6}= { 7} (-1 to cancel)", (int)Hunter.LordGodalming, Hunter.LordGodalming.Name(), (int)Hunter.DrSeward, Hunter.DrSeward.Name(), (int)Hunter.VanHelsing, Hunter.VanHelsing.Name(), (int)Hunter.MinaHarker, Hunter.MinaHarker.Name()); answer = 0; while (answer == 0) { if (int.TryParse(Console.ReadLine(), out answer)) { if (answer < 1 || answer > 4) { answer = 0; } } } game.Hunters[(int)hunterPlayingEvent].AdjustBites(-1); game.Hunters[answer].AdjustHealth(-1); CheckForHunterDeath(game); } else { game.Hunters[(int)hunterPlayingEvent].AdjustHealth(-1); game.Hunters[answer].AdjustBites(-1); CheckForHunterDeath(game); } }
/// <summary> /// Moves the given Hunter to the given Location, along with all Hunters in the given Hunter's group /// </summary> /// <param name="game">The GameState</param> /// <param name="hunterIndex">A string to be converted to the Hunter discarding the card</param> /// <param name="location">The name of the Location to move to</param> /// <returns>The position of the card in Dracula's trail (0-5) or catacombs (6-8) that corresponds to the given location, or -1 if not in the trail/catacombs</returns> private static int MoveHunter(GameState game, string hunterIndex, string location, out Hunter hunterMoved, out Location originatingLocation, DecisionMaker logic) { var hunterToMove = Hunter.Nobody; int index; if (int.TryParse(hunterIndex, out index)) { hunterToMove = game.GetHunterFromInt(index); } var line = ""; while (hunterToMove == Hunter.Nobody && index != -1) { Console.WriteLine("Who is moving? {0}= {1}, {2}= {3}, {4}= {5}, {6}= {7} (-1 to cancel)", (int)Hunter.LordGodalming, Hunter.LordGodalming.Name(), (int)Hunter.DrSeward, Hunter.DrSeward.Name(), (int)Hunter.VanHelsing, Hunter.VanHelsing.Name(), (int)Hunter.MinaHarker, Hunter.MinaHarker.Name()); line = Console.ReadLine(); if (int.TryParse(line, out index)) { if (index == -1) { Console.WriteLine("Cancelled"); hunterMoved = Hunter.Nobody; originatingLocation = Location.Nowhere; return -1; } hunterToMove = game.GetHunterFromInt(index); Console.WriteLine(hunterToMove.Name()); } else { Console.WriteLine("I didn't understand that"); } } hunterMoved = (Hunter)index; originatingLocation = game.Hunters[(int)hunterMoved].CurrentLocation; Location destination; if (DraculaIsPlayingControlStorms(game, hunterMoved, logic)) { Console.WriteLine("Dracula is controlling the ship's movement"); destination = logic.ChoosePortToMoveHuntersToWithControlStorms(game, hunterMoved); } else { destination = Enumerations.GetLocationFromString(location); while (destination == Location.Nowhere && line.ToLower() != "cancel") { Console.WriteLine("Where is {0} moving? (Type cancel to cancel)", hunterToMove.Name()); line = Console.ReadLine(); destination = Enumerations.GetLocationFromString(line); Console.WriteLine(destination.Name()); } if (line.ToLower() == "cancel") { Console.WriteLine("Cancelled"); return -1; } } Console.Write("{0} moved from {1} to ", hunterToMove.Name(), game.Hunters[(int)hunterToMove].CurrentLocation.Name()); foreach (var h in game.Hunters[(int)hunterToMove].HuntersInGroup) { game.Hunters[(int)h].MoveTo(destination); } Console.WriteLine(destination.Name() + (game.Hunters[(int)hunterToMove].HuntersInGroup.Count() > 1 ? " with his group" : "")); for (var i = 0; i < 6; i++) { if (game.Dracula.Trail[i] != null && game.Dracula.Trail[i].DraculaCards.First().Location == destination) { return i; } } for (var i = 0; i < 3; i++) { if (game.Dracula.Catacombs[i] != null && game.Dracula.Catacombs[i].DraculaCards.First().Location == destination) { return i + 6; } } return -1; }
/// <summary> /// Resolves the Money Trail Event /// </summary> /// <param name="game">The GameState</param> /// <param name="hunterPlayingEvent">The Hunter playing the Event</param> /// <param name="logic">The artificial intelligence component</param> private static void PlayMoneyTrail(GameState game, Hunter hunterPlayingEvent, DecisionMaker logic) { for (var i = 5; i > 0; i--) { if (game.Dracula.Trail[i] != null && game.Map.TypeOfLocation(game.Dracula.Trail[i].DraculaCards.First().Location) == LocationType.Sea) { if (DraculaIsPlayingSensationalistPressToPreventRevealingLocation(game, game.Dracula.Trail[i].DraculaCards.First().Location, logic)) { Console.WriteLine("Dracula prevented a location from being revealed"); } else { game.Dracula.RevealCardAtPosition(i); logic.EliminateTrailsThatDoNotContainLocationAtPosition(game, game.Dracula.Trail[i].DraculaCards.First().Location, i); } } } }
/// <summary> /// Resolves the Mystic Research Event /// </summary> /// <param name="game">The GameState</param> /// <param name="hunterPlayingEvent">The Hunter playing the Event</param> private static void PlayMysticResearch(GameState game, Hunter hunterPlayingEvent) { if (!game.Dracula.EventHand.Any()) { Console.WriteLine("Dracula has no Events to reveal"); return; } Console.WriteLine("These are Dracula's Event cards: "); foreach (var e in game.Dracula.EventHand) { Console.Write(" {0},", e.Event.Name()); } Console.WriteLine(""); }
/// <summary> /// Resolves the Excellent Weather Event /// </summary> /// <param name="game">The GameState</param> /// <param name="hunterPlayingEvent">The Hunter playing the Event</param> private static void PlayExcellentWeather(GameState game, Hunter hunterPlayingEvent) { Console.WriteLine("{0} may make up to four sea moves this turng", hunterPlayingEvent.Name()); }
/// <summary> /// Resolves the Re-Equip Event /// </summary> /// <param name="game">The GameState</param> /// <param name="hunterPlayingEvent">The Hunter playing the Event</param> private static void PlayReEquip(GameState game, Hunter hunterPlayingEvent) { if (DiscardUnknownItemFromHunter(game, game.Hunters[(int)hunterPlayingEvent])) { game.Hunters[(int)hunterPlayingEvent].DrawItemCard(); Console.WriteLine("Now draw another card from the Item deck and shuffle it. You now have {0} Items", game.Hunters[(int)hunterPlayingEvent].ItemCount); } CheckForCardsRevealedForBeingBitten(game); }
/// <summary> /// Resolves the Good Luck Event played at the start of a Hunter's turn /// </summary> /// <param name="game">The GameState</param> /// <param name="hunterPlayingEvent">The Hunter playing the Event</param> private static void PlayGoodLuck(GameState game, Hunter hunterPlayingEvent) { Console.WriteLine("What would you like to discard? 0= Nothing (cancel), 1= Roadblock, 2= Dracula's Ally"); var answer = -1; while (answer == -1) { if (int.TryParse(Console.ReadLine(), out answer)) { if (answer < 0 || answer > 2) { answer = -1; } } switch (answer) { case 0: Console.WriteLine("Take the card back"); var goodLuckCard = game.EventDiscard.Find(card => card.Event == Event.GoodLuck); game.EventDiscard.Remove(goodLuckCard); game.Hunters[(int)hunterPlayingEvent].EventsKnownToDracula.Add(goodLuckCard); game.Hunters[(int)hunterPlayingEvent].DrawEventCard(); break; case 1: game.RoadBlockLocation1 = Location.Nowhere; game.RoadBlockLocation2 = Location.Nowhere; game.RoadBlockConnectionType = ConnectionType.None; break; case 2: if (game.DraculaAlly != null) { game.EventDiscard.Add(game.DraculaAlly); game.DraculaAlly = null; } break; } } }
/// <summary> /// Resolves the Stormy Seas Event /// </summary> /// <param name="game">The GameState</param> /// <param name="hunterPlayingEvent">The Hunter playing the Event</param> /// <param name="logic">The artificial intelligence component</param> private static void PlayStormySeas(GameState game, Hunter hunterPlayingEvent, DecisionMaker logic) { Console.WriteLine("Where is {0} playing Stormy Seas?", hunterPlayingEvent.Name()); var stormySeasLocation = Location.Nowhere; while (stormySeasLocation == Location.Nowhere || game.Map.TypeOfLocation(stormySeasLocation) != LocationType.Sea) { stormySeasLocation = Enumerations.GetLocationFromString(Console.ReadLine()); } game.StormySeasLocation = stormySeasLocation; game.StormySeasRounds = 2; if (stormySeasLocation == game.Dracula.CurrentLocation) { Console.WriteLine("Dracula was in {0}", stormySeasLocation.Name()); int position = game.Dracula.RevealCardInTrailWithLocation(stormySeasLocation); logic.EliminateTrailsThatDoNotContainLocationAtPosition(game, stormySeasLocation, position); var destination = logic.ChoosePortToGoToAfterStormySeas(game); if (destination == Location.Nowhere) { Console.WriteLine("Dracula cannot make a legal move"); game.Dracula.TakePunishmentForCheating(game); return; } int doubleBackSlot; var cardDroppedOffTrail = game.Dracula.MoveTo(destination, Power.None, out doubleBackSlot); logic.AddDisembarkedCardToAllPossibleTrails(game); if (doubleBackSlot > -1) { Console.WriteLine("Dracula Doubled Back to the location in slot {0}", doubleBackSlot + 1); } var cardsDroppedOffTrail = new List<DraculaCardSlot>(); if (cardDroppedOffTrail != null) { cardsDroppedOffTrail.Add(cardDroppedOffTrail); } if (DraculaIsPlayingSensationalistPressToPreventRevealingLocation(game, destination, logic)) { Console.WriteLine("Dracula prevented a location from being revealed"); } else { game.Dracula.RevealCardInTrailWithLocation(destination); logic.EliminateTrailsThatDoNotContainLocationAtPosition(game, destination, 0); } DealWithDroppedOffCardSlots(game, cardsDroppedOffTrail, logic); CheckForJonathanHarker(game, logic); } else { logic.EliminateTrailsThatContainLocation(game, stormySeasLocation); } }
/// <summary> /// Resolves the Hired Scouts Event /// </summary> /// <param name="game">The GameState</param> /// <param name="hunterPlayingEvent">The Hunter playing the Event</param> /// <param name="logic">The artificial intelligence component</param> private static void PlayHiredScouts(GameState game, Hunter hunterPlayingEvent, DecisionMaker logic) { Console.WriteLine("Name the first city"); var firstLocationToReveal = Location.Nowhere; while (firstLocationToReveal == Location.Nowhere || (game.Map.TypeOfLocation(firstLocationToReveal) != LocationType.SmallCity && game.Map.TypeOfLocation(firstLocationToReveal) != LocationType.LargeCity)) { firstLocationToReveal = Enumerations.GetLocationFromString(Console.ReadLine()); } var secondLocationToReveal = Location.Nowhere; Console.WriteLine("Name the second city"); secondLocationToReveal = Location.Nowhere; while (secondLocationToReveal == Location.Nowhere || (game.Map.TypeOfLocation(secondLocationToReveal) != LocationType.SmallCity && game.Map.TypeOfLocation(secondLocationToReveal) != LocationType.LargeCity)) { secondLocationToReveal = Enumerations.GetLocationFromString(Console.ReadLine()); } if (DraculaIsPlayingSensationalistPressToPreventRevealingLocation(game, firstLocationToReveal, logic)) { Console.WriteLine("Dracula prevented a location from being revealed"); logic.EliminateTrailsThatDoNotContainLocation(game, firstLocationToReveal); } else { var trailIndex = game.Dracula.RevealCardInTrailWithLocation(firstLocationToReveal); if (trailIndex > -1) { Console.WriteLine("{0} revealed", firstLocationToReveal.Name()); logic.EliminateTrailsThatDoNotContainLocationAtPosition(game, firstLocationToReveal, trailIndex); trailIndex = -2; } else { trailIndex = game.Dracula.RevealCardInCatacombsWithLocation(firstLocationToReveal); } if (trailIndex > -1) { Console.WriteLine("{0} revealed", firstLocationToReveal.Name()); logic.EliminateTrailsThatDoNotContainLocationAtPosition(game, firstLocationToReveal, trailIndex); game.Dracula.RevealEncountersAtPositionInTrail(trailIndex); DrawGameState(game); } else if (trailIndex == -1) { Console.WriteLine("{0} is not in Dracula's trail or Catacombs", firstLocationToReveal.Name()); logic.EliminateTrailsThatContainLocation(game, firstLocationToReveal); } } if (DraculaIsPlayingSensationalistPressToPreventRevealingLocation(game, secondLocationToReveal, logic)) { Console.WriteLine("Dracula prevented a location from being revealed"); logic.EliminateTrailsThatDoNotContainLocation(game, secondLocationToReveal); } else { var trailIndex = game.Dracula.RevealCardInTrailWithLocation(secondLocationToReveal); if (trailIndex > -1) { Console.WriteLine("{0} revealed", secondLocationToReveal.Name()); logic.EliminateTrailsThatDoNotContainLocationAtPosition(game, secondLocationToReveal, trailIndex); trailIndex = -2; } else { trailIndex = game.Dracula.RevealCardInCatacombsWithLocation(secondLocationToReveal); } if (trailIndex > -1) { Console.WriteLine("{0} revealed", secondLocationToReveal.Name()); logic.EliminateTrailsThatDoNotContainLocationAtPosition(game, secondLocationToReveal, trailIndex); game.Dracula.RevealEncountersAtPositionInTrail(trailIndex); DrawGameState(game); } else if (trailIndex == -1) { Console.WriteLine("{0} is not in Dracula's trail or Catacombs", secondLocationToReveal.Name()); logic.EliminateTrailsThatContainLocation(game, secondLocationToReveal); } } }
/// <summary> /// Resolves the Telegraph Ahead Event /// </summary> /// <param name="game">The GameState</param> /// <param name="hunterPlayingEvent">The Hunter playing the Event</param> /// <param name="logic">The artificial intelligence component</param> private static void PlayTelegraphAhead(GameState game, Hunter hunterPlayingEvent, DecisionMaker logic) { foreach (var loc in game.Map.LocationsConnectedByRoadTo(game.Hunters[(int)hunterPlayingEvent].CurrentLocation)) { if (DraculaIsPlayingSensationalistPressToPreventRevealingLocation(game, loc, logic)) { Console.WriteLine("Dracula prevented a location from being revealed"); } else { int position = game.Dracula.RevealCardInTrailWithLocation(loc); if (position > -1) { Console.WriteLine("{0} revealed", loc.Name()); logic.EliminateTrailsThatDoNotContainLocationAtPosition(game, loc, position); } else { position = game.Dracula.RevealCardInCatacombsWithLocation(loc); if (position > -1) { Console.WriteLine("{0} revealed", loc.Name()); logic.EliminateTrailsThatContainLocation(game, loc); } else { logic.EliminateTrailsThatContainLocation(game, loc); } } } } }
/// <summary> /// Resolves the situation when a Hunter plays an Ally /// </summary> /// <param name="game">The GameState</param> /// <param name="hunterPlayingEvent">The Hunter playing the Ally Event</param> /// <param name="allyBeingPlayed">The Ally Event being played</param> private static void PlayHunterAlly(GameState game, Hunter hunterPlayingEvent, Event allyBeingPlayed, DecisionMaker logic) { if (game.HunterAlly != null) { game.EventDiscard.Add(game.HunterAlly); } game.HunterAlly = game.EventDiscard.Find(card => card.Event == allyBeingPlayed); game.EventDiscard.Remove(game.HunterAlly); if (game.HunterAlly.Event == Event.JonathanHarker) { CheckForJonathanHarker(game, logic); } }
/// <summary> /// Resolves a Hunter using the Holy Water Item or the Holy Water font at St. Joseph & St. Mary /// </summary> /// <param name="game">The GameState</param> /// <param name="hunterReceivingHolyWater">The Hunter receiving the Holy Water effect</param> private static void UseHolyWaterOnHunter(GameState game, Hunter hunterReceivingHolyWater) { if (hunterReceivingHolyWater == Hunter.MinaHarker) { Console.WriteLine("Mina's bite cannot be cured"); return; } Console.WriteLine("Roll a die and enter the result"); var dieRoll = 0; while (dieRoll == 0) { if (int.TryParse(Console.ReadLine(), out dieRoll)) { if (dieRoll < 1 || dieRoll > 7) { dieRoll = 0; } } } switch (dieRoll) { case 1: Console.WriteLine("{0} loses 2 health", hunterReceivingHolyWater.Name()); game.Hunters[(int)hunterReceivingHolyWater].AdjustHealth(-2); CheckForHunterDeath(game); break; case 2: case 3: case 4: Console.WriteLine("Nothing happens"); break; case 5: case 6: Console.WriteLine("{0} is cured of a Bite", hunterReceivingHolyWater.Name()); game.Hunters[(int)hunterReceivingHolyWater].AdjustBites(-1); break; } }
/// <summary> /// Resolves the Hypnosis Event /// </summary> /// <param name="game">The GameState</param> /// <param name="hunterPlayingEvent">The Hunter playing the Event</param> /// <param name="logic">The artificial intelligence component</param> private static void PlayHypnosis(GameState game, Hunter hunterPlayingEvent, DecisionMaker logic) { Console.WriteLine("Roll a die and enter the result"); var dieRoll = 0; while (dieRoll == 0) { if (int.TryParse(Console.ReadLine(), out dieRoll)) { if (dieRoll < 1 || dieRoll > 7) { dieRoll = 0; } } } switch (dieRoll) { case 1: case 2: Console.WriteLine("No effect"); break; case 3: case 4: case 5: case 6: if (DraculaIsPlayingSensationalistPressToPreventRevealingLocation(game, game.Dracula.CurrentLocation, logic)) { Console.WriteLine("Dracula prevented a location from being revealed"); } else { game.Dracula.RevealCardInTrailWithLocation(game.Dracula.CurrentLocation); logic.EliminateTrailsThatDoNotContainLocationAtPosition(game, game.Dracula.CurrentLocation, game.Dracula.CurrentLocationPosition); } game.Dracula.RevealAllVampires(); var power = Power.None; var advanceMoveLocation = logic.ChooseDestinationAndPower(game, out power); if (advanceMoveLocation == Location.Nowhere && power == Power.None) { Console.WriteLine("Dracula will have no legal moves next turn"); } else { game.Dracula.AdvanceMoveLocation = advanceMoveLocation; game.Dracula.AdvanceMovePower = power; Console.WriteLine("Dracula's next move will be to {0}{1}", game.Dracula.AdvanceMoveLocation, power == Power.None ? "" : " using " + game.Dracula.AdvanceMovePower.Name()); } break; } }
/// <summary> /// Determines if Dracula is playing Customs Search on a Hunter /// </summary> /// <param name="game">The GameState</param> /// <param name="hunterMoved">The Hunter who moved</param> /// <param name="origin">The original Location</param> /// <param name="logic">The artificial intelligence component</param> /// <returns>True if Dracula successfully plays Customs Search</returns> private static bool DraculaIsPlayingCustomsSearch(GameState game, Hunter hunterMoved, Location origin, DecisionMaker logic) { if (logic.ChooseToPlayCustomsSearch(game, hunterMoved, origin)) { Console.WriteLine("Dracula is playing Customs Search"); game.Dracula.DiscardEvent(Event.CustomsSearch, game.EventDiscard); if (HunterPlayingGoodLuckToCancelDraculaEvent(game, Event.CustomsSearch, Event.CustomsSearch, logic) > 0) { Console.WriteLine("Customs Search cancelled"); return false; } return true; } return false; }
/// <summary> /// Spends a point of Resolve using the Inner Strength ability /// </summary> /// <param name="game">The GameState</param> /// <param name="hunterSpendingResolve">The Hunter spending the resolve and being healed</param> private static void PlayInnerStrength(GameState game, Hunter hunterSpendingResolve) { game.Hunters[(int)hunterSpendingResolve].AdjustHealth(4); Console.WriteLine("{0} now has {1} health", hunterSpendingResolve.Name(), game.Hunters[(int)hunterSpendingResolve].Health); }
private void AddHunterLoss(HSCounter hsc) { Hunter hunter = new Hunter(); hunter.LoseButton_Clicked(hsc); }
/// <summary> /// Resolves the Long Day Event /// </summary> /// <param name="game">The GameState</param> /// <param name="hunterPlayingEvent">The Hunter playing the Event</param> private static void PlayLongDay(GameState game, Hunter hunterPlayingEvent) { if (game.TimeOfDay == TimeOfDay.Dawn) { Console.WriteLine("You cannot play this card during Dawn. Take the card back."); var longDayCard = game.EventDiscard.Find(card => card.Event == Event.LongDay); game.Hunters[(int)hunterPlayingEvent].EventsKnownToDracula.Add(longDayCard); game.EventDiscard.Remove(longDayCard); game.Hunters[(int)hunterPlayingEvent].DrawEventCard(); return; } game.RegressTimeTracker(); }