Ejemplo n.º 1
0
 /// <summary>
 /// Matures an Encounter
 /// </summary>
 /// <param name="game">The GameState</param>
 /// <param name="encounterTileBeingMatured">The EncounterTile being matured</param>
 /// <param name="logic">The artificial intelligence component</param>
 private static void MatureEncounter(GameState game, EncounterTile encounterTileBeingMatured, DecisionMaker logic)
 {
     switch (encounterTileBeingMatured.Encounter)
     {
         case Encounter.Ambush:
             Console.WriteLine("Dracula matured Ambush");
             var hunterToAmbush = logic.ChooseHunterToAmbush(game);
             if (hunterToAmbush != Hunter.Nobody)
             {
                 var encounterToAmbushWith = logic.ChooseEncounterTileToAmbushHunterWith(game, hunterToAmbush);
                 ResolveEncounterTile(game, encounterToAmbushWith, new List<Hunter> { hunterToAmbush }, logic, -1);
                 game.Dracula.DiscardEncounterTile(game, encounterToAmbushWith);
                 game.EncounterPool.Add(encounterToAmbushWith);
             }
             break;
         case Encounter.DesecratedSoil:
             Console.WriteLine("Dracula matured Desecrated Soil");
             game.Dracula.ClearTrailDownTo(game, 3);
             logic.TrimAllPossibleTrails(3);
             for (var i = 0; i < 2; i++)
             {
                 Console.WriteLine(
                     "Draw an Event card. If it is a Hunter card, name it, otherwise type \"take\"");
                 var line = "";
                 var eventDrawn = Event.None;
                 do
                 {
                     line = Console.ReadLine();
                     eventDrawn = Enumerations.GetEventFromString(line);
                 } while (eventDrawn == Event.None &&
                          !"take".StartsWith(line.ToLower()));
                 if (eventDrawn == Event.None)
                 {
                     var eventPlayedByDracula = game.Dracula.TakeEvent(game.EventDeck, game.EventDiscard);
                     PlayImmediatelyDraculaCard(game, eventPlayedByDracula, logic);
                     if (game.Dracula.EventHand.Count() > game.Dracula.EventHandSize)
                     {
                         Console.WriteLine("Dracula discarded {0}", game.Dracula.DiscardEvent(logic.ChooseEventToDiscard(game), game.EventDiscard).Name());
                     }
                 }
                 else
                 {
                     var eventCardDiscarded = game.EventDeck.Find(card => card.Event == eventDrawn);
                     game.EventDeck.Remove(eventCardDiscarded);
                     game.EventDiscard.Add(eventCardDiscarded);
                 }
             }
             break;
         case Encounter.NewVampire:
             Console.WriteLine("Dracula matured a New Vampire");
             game.AdjustVampires(2);
             game.Dracula.ClearTrailDownTo(game, 1);
             logic.TrimAllPossibleTrails(1); break;
     }
     game.EncounterPool.Add(encounterTileBeingMatured);
 }