Ejemplo n.º 1
0
 // done
 internal LocationDetail DecideMove(GameState g, Dracula dracula, out string powerName)
 {
     Logger.WriteToDebugLog("Starting to decide what move to make");
     LocationDetail goingTo;
     if (dracula.AdvanceMovePower != null || dracula.AdvanceMoveDestination != null)
     {
         powerName = dracula.AdvanceMovePower;
         goingTo = dracula.AdvanceMoveDestination;
         dracula.AdvanceMovePower = null;
         dracula.AdvanceMoveDestination = null;
     }
     int chosenActionIndex = new Random().Next(0, dracula.PossibleMoves.Count() + dracula.PossiblePowers.Count());
     if (chosenActionIndex > dracula.PossibleMoves.Count() - 1)
     {
         // choosing a power
         chosenActionIndex -= dracula.PossibleMoves.Count();
         powerName = dracula.PossiblePowers[chosenActionIndex].name;
         if (powerName == "Dark Call" || powerName == "Feed" || powerName == "Hide")
         {
             goingTo = new LocationDetail();
             goingTo.Name = "Nowhere";
         }
         else if (powerName == "Double Back")
         {
             goingTo = dracula.PossibleDoubleBackMoves[new Random().Next(0, dracula.PossibleDoubleBackMoves.Count())];
         }
         else if (powerName == "Wolf Form")
         {
             dracula.DeterminePossibleWolfFormLocations();
             goingTo = dracula.PossibleMoves[new Random().Next(0, dracula.PossibleMoves.Count())];
         }
         else
         {
             goingTo = new LocationDetail();
             goingTo.Name = "Unknown location";
         }
     }
     else
     {
         powerName = "no power";
         goingTo = dracula.PossibleMoves[chosenActionIndex];
     }
     Logger.WriteToDebugLog("Returning " + powerName + " and " + goingTo == null ? "null" : goingTo.Name);
     return goingTo;
 }
Ejemplo n.º 2
0
        public GameState()
        {
            Hunters = new Hunter[4];
            Hunters[(int)HunterName.LordGodalming] = new Hunter((int)HunterName.LordGodalming, "Lord Godalming", 12, 0, 2);
            Hunters[(int)HunterName.DrSeward] = new Hunter((int)HunterName.DrSeward, "Dr. Seward", 10, 0, 2);
            Hunters[(int)HunterName.VanHelsing] = new Hunter((int)HunterName.VanHelsing, "Van Helsing", 8, 0, 3);
            Hunters[(int)HunterName.MinaHarker] = new Hunter((int)HunterName.MinaHarker, "Mina Harker", 8, 1, 2);

            Resolve = -1;
            VampirePointTracker = -1;

            TimeIndex = -1;

            RevealedLocations = new List<Location>();
            EncounterLimbo = new List<Encounter>();
            RevealedEncounters = new List<Encounter>();
            EventDiscard = new List<Event>();
            ItemDiscard = new List<Item>();
            Dracula = new Dracula();
        }
Ejemplo n.º 3
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;
 }
Ejemplo n.º 4
0
 // done
 internal EventDetail DecideWhichEventToDiscard(GameState g, Dracula dracula)
 {
     Logger.WriteToDebugLog("Deciding which event to discard");
     EventDetail eventToDiscard = dracula.EventCardsInHand[new Random().Next(0, dracula.EventCardsInHand.Count())];
     Logger.WriteToDebugLog("Returning " + eventToDiscard.name);
     return eventToDiscard;
 }
Ejemplo n.º 5
0
 // done
 internal EncounterDetail DecideWhichEncounterToPlace(GameState g, Dracula dracula)
 {
     Logger.WriteToDebugLog("Deciding which encounter to place");
     EncounterDetail encounterToPlace = dracula.EncounterHand[new Random().Next(0, dracula.EncounterHand.Count())];
     Logger.WriteToDebugLog("Returning " + encounterToPlace.name);
     return encounterToPlace;
 }
Ejemplo n.º 6
0
 // done
 internal ItemDetail DecideWhichCombatCardToPlay(List<Hunter> huntersFighting, Dracula dracula, List<ItemDetail> combatCards, string hunterAllyName, CombatRoundResult result)
 {
     Logger.WriteToDebugLog("Deciding which combat card to play");
     if (hunterAllyName == "Sister Agatha" && dracula.Blood < 3)
     {
         if (combatCards.FindIndex(card => card.Name == "Fangs") > -1)
         {
             combatCards.Remove(combatCards.Find(card => card.Name == "Fangs"));
         }
         if (combatCards.FindIndex(card => card.Name == "Escape (Man)") > -1)
         {
             combatCards.Remove(combatCards.Find(card => card.Name == "Fangs"));
         }
         if (combatCards.FindIndex(card => card.Name == "Escape (Bat)") > -1)
         {
             combatCards.Remove(combatCards.Find(card => card.Name == "Fangs"));
         }
         if (combatCards.FindIndex(card => card.Name == "Escape (Mist)") > -1)
         {
             combatCards.Remove(combatCards.Find(card => card.Name == "Fangs"));
         }
     }
     int chosenCardIndex;
     do
     {
         chosenCardIndex = new Random().Next(0, combatCards.Count());
     } while (combatCards[chosenCardIndex].Name == result.enemyCardUsed || (result.outcome == "Repel" && combatCards[chosenCardIndex].Name != "Dodge" && combatCards[chosenCardIndex].Name != "Escape (Man)" && combatCards[chosenCardIndex].Name != "Esacpe (Bat)" && combatCards[chosenCardIndex].Name != "Escape (Mist)"));
     Logger.WriteToDebugLog("Returning " + combatCards[chosenCardIndex].Name);
     return combatCards[chosenCardIndex];
 }
Ejemplo n.º 7
0
 // done
 internal EventDetail DecideWhetherToPlaySensationalistPress(GameState g, int trailIndex, Dracula dracula)
 {
     Logger.WriteToDebugLog("Deciding whether to play Sensationalist Press");
     if (dracula.EventCardsInHand.FindIndex(e => e.name == "Sensationalist Press") > -1)
     {
         if (new Random().Next(0, 2) > 0)
         {
             Logger.WriteToDebugLog("Returning Sensationalist Press");
             return dracula.EventCardsInHand.Find(e => e.name == "Sensationalist Press");
         }
     }
     Logger.WriteToDebugLog("Returning null");
     return null;
 }
Ejemplo n.º 8
0
 // done
 internal EventDetail DecideWhetherToPlayRelentlessMinion(GameState g, List<Hunter> huntersEncountered, string enemyType, Dracula dracula)
 {
     Logger.WriteToDebugLog("Deciding whether to play Relentless Minion");
     if (dracula.EventCardsInHand.FindIndex(e => e.name == "Relentless Minion") > -1)
     {
         if (new Random().Next(0, 2) > 0)
         {
             Logger.WriteToDebugLog("Returning Relentless Minion");
             return dracula.EventCardsInHand.Find(e => e.name == "Relentless Minion");
         }
     }
     Logger.WriteToDebugLog("Returning null");
     return null;
 }
Ejemplo n.º 9
0
 // done
 internal EventDetail DecideWhetherToPlayDevilishPower(GameState g, Dracula dracula)
 {
     Logger.WriteToDebugLog("Deciding whether to play Devilish Power");
     if (dracula.EventCardsInHand.FindIndex(e => e.name == "Devilish Power") > -1)
     {
         if (new Random().Next(0, 4) > 2)
         {
             Logger.WriteToDebugLog("Returning Devilish Power");
             return dracula.EventCardsInHand.Find(e => e.name == "Devilish Power");
         }
     }
     Logger.WriteToDebugLog("Returning null");
     return null;
 }
Ejemplo n.º 10
0
 // done
 internal string DecideToDiscardEventOrItem(GameState g, Dracula dracula, Hunter hunter)
 {
     Logger.WriteToDebugLog("Deciding whether to discard hunter's event or item");
     if (hunter.NumberOfEvents + hunter.NumberOfItems > 0)
     {
         int cardToDiscard = new Random().Next(0, hunter.NumberOfEvents + hunter.NumberOfItems);
         if (cardToDiscard + 1 > hunter.NumberOfEvents)
         {
             Logger.WriteToDebugLog("Returning item");
             return "item";
         }
         else
         {
             Logger.WriteToDebugLog("Returning event");
             return "event";
         }
     }
     Logger.WriteToDebugLog("Returning no cards");
     return "no cards";
 }
Ejemplo n.º 11
0
 // done
 internal bool DecideToPutLocationInCatacombs(GameState g, Dracula dracula)
 {
     Logger.WriteToDebugLog("Deciding whether to put a location in the catacombs");
     bool isPuttingLocationInCatacombs = new Random().Next(0, 6) > 4;
     Logger.WriteToDebugLog("Returning " + isPuttingLocationInCatacombs);
     return isPuttingLocationInCatacombs;
 }
Ejemplo n.º 12
0
 // done
 internal EventDetail DecideToPlaySeductionDuringVampireEncounter(GameState g, Dracula dracula)
 {
     Logger.WriteToDebugLog("Deciding to play Seduction");
     if (dracula.EventCardsInHand.FindIndex(e => e.name == "Seduction") > -1)
     {
         if (new Random().Next(0, 2) > 0)
         {
             Logger.WriteToDebugLog("Returning Seduction");
             return dracula.EventCardsInHand.Find(e => e.name == "Seduction");
         }
     }
     Logger.WriteToDebugLog("Returning null");
     return null;
 }
Ejemplo n.º 13
0
 // done
 internal bool DecideToPlayFalseTipOff(GameState g, Dracula dracula, Hunter hunter)
 {
     Logger.WriteToDebugLog("Deciding whether to play False Tip-Off");
     if (dracula.EventCardsInHand.FindIndex(card => card.name == "False Tip-Off") > -1)
     {
         if (new Random().Next(0, 2) > 0)
         {
             Logger.WriteToDebugLog("Returning true");
             return true;
         }
     }
     Logger.WriteToDebugLog("Returning false");
     return false;
 }
Ejemplo n.º 14
0
 // done
 internal EventDetail DecideToPlayCustomsSearch(GameState g, Dracula dracula, Hunter hunter)
 {
     Logger.WriteToDebugLog("Deciding whether to play Customs Search");
     if (dracula.EventCardsInHand.FindIndex(e => e.name == "Customs Search") > -1)
     {
         if (new Random().Next(0, 2) > 0)
         {
             Logger.WriteToDebugLog("Returning Customs Search");
             return dracula.EventCardsInHand.Find(e => e.name == "Customs Search");
         }
     }
     Logger.WriteToDebugLog("Returning null");
     return null;
 }
Ejemplo n.º 15
0
 // done
 internal EventDetail DecideToPlayCardAtStartOfCombat(GameState g, Dracula dracula, bool trapPlayed, bool hunterMoved, int enemyType)
 {
     Logger.WriteToDebugLog("Deciding which card to play at the start of combat");
     List<EventDetail> eventCardsThatCanBePlayed = new List<EventDetail>();
     if (dracula.EventCardsInHand.FindIndex(ev => ev.name == "Trap") > -1)
     {
         eventCardsThatCanBePlayed.Add(dracula.EventCardsInHand.Find(ev => ev.name == "Trap"));
     }
     if (dracula.EventCardsInHand.FindIndex(ev => ev.name == "Rage") > -1)
     {
         if (enemyType == 1)
         {
             eventCardsThatCanBePlayed.Add(dracula.EventCardsInHand.Find(ev => ev.name == "Rage"));
         }
     }
     if (dracula.EventCardsInHand.FindIndex(ev => ev.name == "Wild Horses") > -1)
     {
         if (!hunterMoved && enemyType == 1)
         {
             eventCardsThatCanBePlayed.Add(dracula.EventCardsInHand.Find(ev => ev.name == "Wild Horses"));
         }
     }
     if (eventCardsThatCanBePlayed.Count() > 0 && new Random().Next(0, 2) > 0)
     {
         EventDetail cardToReturn = eventCardsThatCanBePlayed[new Random().Next(0, eventCardsThatCanBePlayed.Count())];
         Logger.WriteToDebugLog("Returning " + cardToReturn.name);
         return cardToReturn;
     }
     Logger.WriteToDebugLog("Returning null");
     return null;
 }
Ejemplo n.º 16
0
 // done
 internal EventDetail DecideWhetherToCancelCharteredCarriage(GameState g, Dracula dracula)
 {
     Logger.WriteToDebugLog("Deciding whether to cancel Chartered Carriage");
     List<EventDetail> eventCardsThatCanBePlayed = new List<EventDetail>();
     if (dracula.EventCardsInHand.FindIndex(ev => ev.name == "False Tip-off") > -1)
     {
         eventCardsThatCanBePlayed.Add(dracula.EventCardsInHand.Find(ev => ev.name == "False Tip-off"));
     }
     if (dracula.EventCardsInHand.FindIndex(ev => ev.name == "Devilish Power") > -1)
     {
         eventCardsThatCanBePlayed.Add(dracula.EventCardsInHand.Find(ev => ev.name == "Devilish Power"));
     }
     if (eventCardsThatCanBePlayed.Count() > 0 && new Random().Next(0, 2) > 0)
     {
         EventDetail eventToReturn = eventCardsThatCanBePlayed[new Random().Next(0, eventCardsThatCanBePlayed.Count())];
         Logger.WriteToDebugLog("Returning " + eventToReturn.name);
         return eventToReturn;
     }
     Logger.WriteToDebugLog("Returning null");
     return null;
 }
Ejemplo n.º 17
0
 // done
 internal bool DecideToDiscardCatacombLocation(GameState g, Dracula dracula)
 {
     Logger.WriteToDebugLog("Deciding whether to discard location from catacombs");
     bool isDiscardingCatacombLocation = new Random().Next(0, 5) > 3;
     Logger.WriteToDebugLog("Returning " + isDiscardingCatacombLocation);
     return isDiscardingCatacombLocation;
 }