Exemplo n.º 1
0
 // done
 internal EventDetail DecideEventCardToPlayAtStartOfDraculaTurn(GameState g, Dracula dracula)
 {
     Logger.WriteToDebugLog("Deciding what card to play at the start of Dracula's turn");
     List<EventDetail> eventCardsThatCanBePlayed = new List<EventDetail>();
     if (dracula.EventCardsInHand.FindIndex(ev => ev.name == "Time Runs Short") > -1) {
         eventCardsThatCanBePlayed.Add(dracula.EventCardsInHand.Find(ev => ev.name == "Time Runs Short"));
     }
     if (dracula.EventCardsInHand.FindIndex(ev => ev.name == "Unearthly Swiftness") > -1) {
         eventCardsThatCanBePlayed.Add(dracula.EventCardsInHand.Find(ev => ev.name == "Unearthly Swiftness"));
     }
     if (dracula.EventCardsInHand.FindIndex(ev => ev.name == "Roadblock") > -1) {
         eventCardsThatCanBePlayed.Add(dracula.EventCardsInHand.Find(ev => ev.name == "Roadblock"));
     }
     if (dracula.EventCardsInHand.FindIndex(ev => ev.name == "Devilish Power") > -1 && (g.HuntersHaveAlly() || g.HeavenlyHostIsInPlay())) {
         eventCardsThatCanBePlayed.Add(dracula.EventCardsInHand.Find(ev => ev.name == "Devilish Power"));
     }
     if (eventCardsThatCanBePlayed.Count() > 0 && new Random().Next(0, 3) > 1)
     {
         EventDetail cardToPlay = eventCardsThatCanBePlayed[new Random().Next(0, eventCardsThatCanBePlayed.Count())];
         Logger.WriteToDebugLog("Returning " + cardToPlay.name);
     }
     Logger.WriteToDebugLog("Returning null");
     return null;
 }