示例#1
0
 /// <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);
     }
 }