Beispiel #1
0
 public void TakeStartOfTurnActions(GameState g, UserInterface ui)
 {
     if (g.NameOfDraculaAlly() == "Quincey P. Morris")
     {
         Hunter victim = logic.DecideWhichHunterToAttackWithQuincey(g.GetHunters());
         ui.TellUser("Dracula has chosen " + victim.Name + " to affect with Quincey P. Morris");
         switch (ui.GetHunterHolyItems(victim.Name)) {
             case 0:
                 ui.TellUser(victim.Name + " loses 1 health");
                 victim.Health--;
                 g.HandlePossibleHunterDeath(ui);
                 break;
             case 1:
                 if (victim.ItemsKnownToDracula.FindIndex(item => item.Name == "Crucifix") == -1)
                 {
                     g.AddToHunterItemsKnownToDracula(victim, "Crucifix");
                 }
                 ui.TellUser("No effect from Quincey P. Morris");
                 break;
             case 2:
                 if (victim.ItemsKnownToDracula.FindIndex(item => item.Name == "Heavenly Host") == -1)
                 {
                     g.AddToHunterItemsKnownToDracula(victim, "Heavenly Host");
                 }
                 ui.TellUser("No effect from Quincey P. Morris");
                 break;
         }
     }
     Logger.WriteToDebugLog("Deciding what to do with Catacombs locations");
     for (int i = 0; i < 3; i++)
     {
         if (Catacombs[i] != null)
         {
             Logger.WriteToDebugLog("Deciding what to do with location " + Catacombs[i].Name);
             if (logic.DecideToDiscardCatacombLocation(g, this))
             {
                 Logger.WriteToDebugLog("Discarding " + Catacombs[i].Name);
                 while (Catacombs[i].Encounters.Count() > 0)
                 {
                     Logger.WriteToDebugLog("Putting encounter " + Catacombs[i].Encounters.First().name + " back into the encounter pool");
                     g.AddEncounterToEncounterPool(Catacombs[i].Encounters.First());
                     Catacombs[i].Encounters.Remove(Catacombs[i].Encounters.First());
                 }
                 Logger.WriteToDebugLog("Emptying " + Catacombs[i].Name + " from Catacombs");
                 Catacombs[i] = null;
             }
         }
     }
 }
Beispiel #2
0
 public void MatureEncounters(GameState g, UserInterface ui)
 {
     Logger.WriteToDebugLog("MATURING ENCOUNTERS");
     while (EncountersToMature.Count > 0)
     {
         Logger.WriteToDebugLog("Maturing encounter " + EncountersToMature.First().name);
         Logger.WriteToGameLog(EncountersToMature.First().name + " matured");
         g.MatureEncounter(EncountersToMature.First().name, ui);
         g.AddEncounterToEncounterPool(EncountersToMature.First());
         EncountersToMature.Remove(EncountersToMature.First());
     }
 }
Beispiel #3
0
 public void DiscardEncountersDownTo(GameState g, int encountersToKeep)
 {
     while (EncounterHand.Count() > encountersToKeep)
     {
         EncounterDetail encounterToDiscard = logic.DecideWhichEncounterToDiscard(g, this);
         EncounterHand.Remove(encounterToDiscard);
         g.AddEncounterToEncounterPool(encounterToDiscard);
         Logger.WriteToDebugLog("Dracula discarded " + encounterToDiscard.name);
         Logger.WriteToGameLog("Dracula discarded " + encounterToDiscard.name);
     }
 }
Beispiel #4
0
        public void DoDoubleBackMove(GameState g, LocationDetail goingTo, UserInterface ui)
        {
            Logger.WriteToDebugLog("Remembering that Dracula is moving from a location of type " + CurrentLocation.Type);
            LocationType previousLocationType = CurrentLocation.Type;

            bool doublingBackToCatacombs = false;

            int doubleBackIndex = LocationTrail.FindIndex(location => location == goingTo);
            if (doubleBackIndex > -1)
            {
                Logger.WriteToDebugLog("Doubling back to a location in the trail");
                if (doubleBackIndex > 0)
                {
                    if (LocationTrail[doubleBackIndex - 1].Name == "Hide")
                    {
                        Logger.WriteToDebugLog("Dracula Doubled Back to " + goingTo + " and Hide is the next card in the trail");
                        ui.TellUser("Dracula Doubled Back to a location where he previously used Hide (position " + (doubleBackIndex - 1) + ")");
                        RevealHide(doubleBackIndex - 1, ui);
                    }
                    else if (doubleBackIndex > 1)
                    {
                        if (LocationTrail[doubleBackIndex - 1].Type == LocationType.Power && LocationTrail[doubleBackIndex - 2].Name == "Hide")
                        {
                            Logger.WriteToDebugLog("Dracula Doubled Back to " + goingTo + " and Hide is the next card in the trail, after " + LocationTrail[doubleBackIndex - 1].Name);
                            ui.TellUser("Dracula Doubled Back to a location where he previously used Hide (position " + (doubleBackIndex - 1) + ")");
                            RevealHide(doubleBackIndex - 2, ui);
                        }
                        else if (doubleBackIndex > 2)
                        {
                            if (LocationTrail[doubleBackIndex - 1].Type == LocationType.Power && LocationTrail[doubleBackIndex - 2].Type == LocationType.Power && LocationTrail[doubleBackIndex - 3].Name == "Hide")
                            {
                                Logger.WriteToDebugLog("Dracula Doubled Back to " + goingTo + " and Hide is the next card in the trail, after " + LocationTrail[doubleBackIndex - 1].Name + " and " + LocationTrail[doubleBackIndex - 2].Name);
                                ui.TellUser("Dracula Doubled Back to a location where he previously used Hide (position " + (doubleBackIndex - 1) + ")");
                                RevealHide(doubleBackIndex - 3, ui);
                            }
                        }
                    }
                }
                else
                {
                    Logger.WriteToDebugLog("TRIED TO DOUBLE BACK TO A LOCATION WHEN THERE ARE NONE IN THE LIST");
                }

            }
            else
            {
                Logger.WriteToDebugLog("Doubling back to a location in the Catacombs");
                doublingBackToCatacombs = true;
            }

            int doubleBackLocation = LocationTrail.FindIndex(loc => loc == goingTo);
            // move location to the front of the trail
            Logger.WriteToDebugLog("Temporarily holding " + goingTo.Name);
            if (doublingBackToCatacombs)
            {
                Logger.WriteToDebugLog("Removing " + goingTo.Name + " from the Catacombs");
                Catacombs[Array.IndexOf(Catacombs, goingTo)] = null;
                EncounterDetail encounterToDiscard = logic.DecideWhichCatacombsEncounterToDiscard(g, goingTo, ui);
                goingTo.Encounters.Remove(encounterToDiscard);
                g.AddEncounterToEncounterPool(encounterToDiscard);
            }
            else
            {
                Logger.WriteToDebugLog("Removing " + goingTo.Name + " from the trail");
                LocationTrail.Remove(goingTo);
            }
            Logger.WriteToDebugLog("Putting " + goingTo.Name + " back at the head of the trail");
            LocationTrail.Insert(0, goingTo);
            Logger.WriteToDebugLog("Dracula's current location is now " + CurrentLocation.Name);
            CurrentLocation = LocationTrail[0];

            Logger.WriteToGameLog("Dracula Doubled Back to " + CurrentLocation.Name + " from " + (doublingBackToCatacombs ? " the Catacombs" : " his trail"));

            // move the power cards that are in the trail
            for (int i = 0; i < Powers.Count(); i++)
            {
                if (Powers[i].positionInTrail == doubleBackLocation)
                {
                    Logger.WriteToDebugLog("Moving Double Back power position to the head of the trail");
                    Powers[i].positionInTrail = 0;
                }
                else if (Powers[i].positionInTrail < doubleBackLocation)
                {
                    Logger.WriteToDebugLog("Moving power " + Powers[i].name + " position further along the trail");
                    Powers[i].positionInTrail++;
                }
            }
            CheckBloodLossAtSea(previousLocationType, g.NameOfHunterAlly());
        }
Beispiel #5
0
        public void TrimTrail(GameState g, int length)
        {
            Logger.WriteToDebugLog("Trimming Dracula's trail to length " + length);

            while (LocationTrail.Count() > length)
            {
                for (int i = 0; i < Powers.Count(); i++)
                {
                    if (Powers[i].positionInTrail > length - 1)
                    {
                        Powers[i].positionInTrail = 6;
                    }
                }
                if (LocationTrail.Last().Name == "Hide")
                {
                    LocationWhereHideWasUsed = null;
                }
                LocationTrail.Last().IsRevealed = false;
                if (LocationTrail.Last() != CurrentLocation)
                {
                    while (LocationTrail.Last().Encounters.Count() > 0)
                    {
                        Logger.WriteToDebugLog("Moving encounter " + LocationTrail.Last().Encounters[0].name + " back to the encounter pool");
                        g.AddEncounterToEncounterPool(LocationTrail.Last().Encounters[0]);
                        LocationTrail.Last().Encounters[0].isRevealed = false;
                        LocationTrail.Last().Encounters.Remove(LocationTrail.Last().Encounters[0]);
                    }
                }
                else
                {
                    Logger.WriteToDebugLog("Not moving this location's encounters back to the encounter pool because it is Dracula's current location");
                }
                Logger.WriteToDebugLog("Removing " + LocationTrail.Last().Name + " from the trail");
                LocationTrail.Remove(LocationTrail.Last());
            }
            if (!LocationTrail.Contains(CurrentLocation))
            {
                Logger.WriteToDebugLog("Dracula's current location was removed from the trail, adding it back at what will be the end of the trail");
                LocationTrail.Insert(length - 1, CurrentLocation);
                Logger.WriteToDebugLog("Removing " + LocationTrail.Last().Name);
                LocationTrail.Remove(LocationTrail.Last());
            }
        }