Exemple #1
0
 // done
 internal LocationDetail DecideLocationToSendHunterWithControlStorms(GameState g, int hunterIndex, List<LocationDetail> possiblePorts)
 {
     Logger.WriteToDebugLog("Deciding where to send hunter with Control Storms");
     LocationDetail destination = possiblePorts[new Random().Next(0, possiblePorts.Count())];
     Logger.WriteToDebugLog("Returning " + destination.Name);
     return destination;
 }
Exemple #2
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;
 }
Exemple #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;
 }
Exemple #4
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;
 }
Exemple #5
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;
 }
Exemple #6
0
 internal void ShowGroupMembersAtHunterIndex(GameState g, int hunterIndex)
 {
     TellUser("Members of " + g.Hunters[hunterIndex] + "'s group, other than himself:");
     foreach (int ind in g.Hunters[hunterIndex].HuntersInGroup)
     {
         if (ind != hunterIndex)
         {
             TellUser(g.Hunters[ind].Name);
         }
     }
 }
Exemple #7
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;
             }
         }
     }
 }
Exemple #8
0
 // done
 internal Hunter DecideWhoToNightVisit(GameState g)
 {
     Logger.WriteToDebugLog("Deciding who to attack with Night Visit");
     List <Hunter> bittenHunters = g.GetBittenHunters();
     Hunter victim = bittenHunters[new Random().Next(0, bittenHunters.Count())];
     Logger.WriteToDebugLog("Returning " + victim.Name);
     return victim;
 }
Exemple #9
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;
 }
Exemple #10
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;
 }
Exemple #11
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;
 }
Exemple #12
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;
 }
Exemple #13
0
 // done
 internal LocationDetail DecideWhereToEvadeTo(GameState g)
 {
     Logger.WriteToDebugLog("Deciding where to move with Evade");
     List<LocationDetail> map = g.GetMap();
     LocationDetail locationToReturn;
     do {
     locationToReturn = map[new Random().Next(0, map.Count())];
     } while (g.LocationIsInTrail(locationToReturn) || g.LocationIsInCatacombs(locationToReturn));
     Logger.WriteToDebugLog("Returning " + locationToReturn.Name);
     return locationToReturn;
 }
Exemple #14
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;
 }
Exemple #15
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;
 }
Exemple #16
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;
 }
Exemple #17
0
 // done
 internal EncounterDetail DecideWhichCatacombsEncounterToDiscard(GameState g, LocationDetail goingTo, UserInterface ui)
 {
     Logger.WriteToDebugLog("Deciding which encounter to discard off a location previously in the catacombs");
     if (goingTo.Encounters.Count() > 1)
     {
         int random = new Random().Next(0, 2);
         ui.TellUser("Dracula discarded the encounter in slot " + random);
         Logger.WriteToDebugLog("Returning " + goingTo.Encounters[random]);
         return goingTo.Encounters[random];
     }
     else
     {
         Logger.WriteToDebugLog("Returning " + goingTo.Encounters.First().name);
         return goingTo.Encounters.First();
     }
 }
Exemple #18
0
 // done
 internal LocationDetail DecideWhichPortToGoToAfterStormySeas(GameState g, LocationDetail locationStormed)
 {
     Logger.WriteToDebugLog("Deciding which port to go to after having Stormy Seas played on current location");
     LocationDetail port;
     do
     {
         port = locationStormed.BySea[new Random().Next(0, locationStormed.BySea.Count())];
     } while (port.Type != LocationType.City && port.Type != LocationType.Town);
     Logger.WriteToDebugLog("Returning " + port.Name);
     return port;
 }
Exemple #19
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;
 }
Exemple #20
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";
 }
Exemple #21
0
 // done
 internal LocationDetail DecideWhichLocationToRemoveHeavenlyHostFrom(GameState g)
 {
     Logger.WriteToDebugLog("Deciding from which location to remove Heavenly Host");
     List<LocationDetail> map = g.GetMap();
     List<LocationDetail> locationsWithHost = new List<LocationDetail>();
     foreach (LocationDetail loc in map)
     {
         if (loc.HasHost)
         {
             locationsWithHost.Add(loc);
         }
     }
     LocationDetail target = locationsWithHost[new Random().Next(0, locationsWithHost.Count())];
     Logger.WriteToDebugLog("Returning " + target.Name);
     return target;
 }
Exemple #22
0
 // done
 internal void DecideWhereToPutRoadblock(GameState g, Roadblock roadblockCounter)
 {
     Logger.WriteToDebugLog("Deciding where to put Roadblock");
     List<LocationDetail> map = g.GetMap();
     LocationDetail firstLocationToBlock;
     do
     {
         firstLocationToBlock = map[new Random().Next(0, map.Count())];
     } while (firstLocationToBlock.Type != LocationType.City && firstLocationToBlock.Type != LocationType.Town);
     List<LocationDetail> secondLocationToBlockCandidates = new List<LocationDetail>();
     foreach (LocationDetail loc in firstLocationToBlock.ByRoad)
     {
         secondLocationToBlockCandidates.Add(loc);
     }
     foreach (LocationDetail loc in firstLocationToBlock.ByTrain)
     {
         secondLocationToBlockCandidates.Add(loc);
     }
     LocationDetail secondLocationToBlock = secondLocationToBlockCandidates[new Random().Next(0, secondLocationToBlockCandidates.Count())];
     if (firstLocationToBlock.ByRoad.Contains(secondLocationToBlock))
     {
         if (firstLocationToBlock.ByTrain.Contains(secondLocationToBlock))
         {
             if (new Random().Next(0, 2) > 0)
             {
                 roadblockCounter.connectionType = "road";
             }
             else
             {
                 roadblockCounter.connectionType = "rail";
             }
         }
         else
         {
             roadblockCounter.connectionType = "road";
         }
     }
     else
     {
         roadblockCounter.connectionType = "rail";
     }
     roadblockCounter.firstLocation = firstLocationToBlock;
     roadblockCounter.secondLocation = secondLocationToBlock;
     Logger.WriteToDebugLog("Nothing is returned, but the Roadblock counter has been put on the " + roadblockCounter.connectionType + " between " + roadblockCounter.firstLocation + " and " + roadblockCounter.secondLocation);
 }
Exemple #23
0
 // done
 internal Hunter DecideWhoToInfluence(GameState g)
 {
     Logger.WriteToDebugLog("Deciding which hunter to target with Vampiric Influence");
     List<Hunter> bittenHunters = g.GetBittenHunters();
     Hunter victim = bittenHunters[new Random().Next(0, bittenHunters.Count())];
     Logger.WriteToDebugLog("Returning " + victim.Name);
     return victim;
 }
Exemple #24
0
 // done
 internal LocationDetail DecideWhereToSendHuntersWithBats(GameState g, Hunter hunter, List<LocationDetail> batsMoves)
 {
     Logger.WriteToDebugLog("Deciding where to send hunter with Bats");
     LocationDetail destination = batsMoves[new Random().Next(0, batsMoves.Count())];
     Logger.WriteToDebugLog("Returning " + destination.Name);
     return destination;
 }
Exemple #25
0
 // done
 internal LocationDetail DecideWhereToSendHuntersWithWildHorses(GameState g, List<Hunter> hunters)
 {
     Logger.WriteToDebugLog("Deciding where to send hunter with Wild Horses");
     LocationDetail destination = hunters.First().CurrentLocation.ByRoad[new Random().Next(0, hunters.First().CurrentLocation.ByRoad.Count())];
     Logger.WriteToDebugLog("Returning " + destination);
     return destination;
 }
Exemple #26
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;
 }
Exemple #27
0
        internal void drawGameState(GameState g)
        {
            // top line, trail headers, time header, Dracula blood and Vampire track header, Catacombs header, Dracula cards header
            Console.WriteLine("6th 5th 4th 3rd 2nd 1st   Time        Blood    Vampires  Catacombs    Events");
            // second line, trail cards, time, Dracula blood, Vampires, Catacombs cards, Events
            // trail cards
            for (int i = 5; i >= 0; i--)
            {
                if (i + 1 > g.TrailLength())
                {
                    Console.Write("    ");
                }
                else
                {
                    g.DrawLocationAtTrailIndex(i);
                }
            }

            string timeOfDay = g.TimeOfDay();
            switch (timeOfDay)
            {
                case "Dawn": Console.ForegroundColor = ConsoleColor.DarkYellow; break;
                case "Noon": Console.ForegroundColor = ConsoleColor.Yellow; break;
                case "Dusk": Console.ForegroundColor = ConsoleColor.DarkYellow; break;
                case "Twilight": Console.ForegroundColor = ConsoleColor.Cyan; break;
                case "Midnight": Console.ForegroundColor = ConsoleColor.Blue; break;
                case "Small Hours": Console.ForegroundColor = ConsoleColor.Cyan; break;
            }
            // time of day
            Console.Write("  " + timeOfDay);
            Console.ForegroundColor = ConsoleColor.Red;
            for (int i = 0; i < (12 - timeOfDay.Length); i++)
            {
                Console.Write(" ");
            }
            // Dracula blood
            Console.Write(g.DraculaBloodLevel());
            Console.ResetColor();
            for (int i = 0; i < (9 - g.DraculaBloodLevel().ToString().Length); i++)
            {
                Console.Write(" ");
            }
            // Vampire tracker
            Console.Write(Math.Max(0, g.VampireTracker()));
            for (int i = 0; i < (10 - g.VampireTracker().ToString().Length); i++)
            {
                Console.Write(" ");
            }
            Console.ForegroundColor = ConsoleColor.Red;
            // Catacombs cards
            for (int i = 0; i < 3; i++)
            {
                if (!g.LocationIsEmptyAtCatacombIndex(i))
                {
                    if (g.LocationIsRevealedAtCatacombIndex(i))
                    {
                        Console.Write(g.LocationAbbreviationAtCatacombIndex(i) + " ");
                    }
                    else
                    {
                        Console.Write("### ");
                    }
                }
                else
                {
                    Console.Write("    ");
                }
            }
            Console.ResetColor();
            // Events
            Console.WriteLine(" " + g.NumberOfEventCardsInDraculaHand());
            // third line power cards,
            Console.ForegroundColor = ConsoleColor.DarkGreen;
            string tempString;
            // power cards
            for (int counter = 5; counter > -1; counter--)
            {
                tempString = "    ";
                for (int i = 0; i < g.NumberOfDraculaPowers(); i++)
                {
                    if (g.DraculaPowerAtPowerIndexIsAtLocationIndex(i, counter) && g.DraculaPowerNameAtPowerIndex(i) != "Hide" && g.DraculaPowerNameAtPowerIndex(i) != "Dark Call" && g.DraculaPowerNameAtPowerIndex(i) != "Feed")
                    {
                        tempString = g.DraculaPowerNameAtPowerIndex(i).Substring(0, 3).ToUpper() + " ";
                    }
                }
                Console.Write(tempString);
            }
            Console.ForegroundColor = ConsoleColor.Red;
            Console.Write("                                 ");
            // first Catacombs encounters
            for (int i = 0; i < 3; i++)
            {
                if (!g.LocationIsEmptyAtCatacombIndex(i))
                {
                    if (g.NumberOfEncountersAtLocationAtCatacombIndex(i) > 0)
                    {
                        g.DrawEncounterAtCatacombIndex(i);
                    }
                }
                else
                {
                    Console.Write("    ");
                }
            }

            Console.WriteLine("");
            // fourth line trail encounters, ally headers, second Catacomb encounters
            // trail encounters
            for (int i = 5; i > -1; i--)
            {
                if (i + 1 > g.TrailLength())
                {
                    Console.Write("    ");
                }
                else
                {
                    g.DrawEncounterAtTrailIndex(i);
                }
            }
            Console.ResetColor();
            // ally headers
            Console.Write("  Dracula's Ally    Hunters' Ally");

            // second Catacomb encounters
            for (int i = 0; i < 3; i++)
            {
                if (!g.LocationIsEmptyAtCatacombIndex(i))
                {
                    if (g.NumberOfEncountersAtLocationAtCatacombIndex(i) > 0)
                    {
                        g.DrawEncounterAtCatacombIndex(i, true);
                    }
                }
                else
                {
                    Console.Write("    ");
                }
            }
            Console.WriteLine("");
            // fifth line, ally names
            Console.Write("                          ");
            Console.ResetColor();
            if (g.DraculaHasAlly())
            {
                Console.Write(g.NameOfDraculaAlly().Substring(0, 3).ToUpper());
            }
            else
            {
                Console.Write("   ");
            }
            Console.Write("               ");
            if (g.HuntersHaveAlly())
            {
                Console.Write(g.NameOfHunterAlly().Substring(0, 3).ToUpper());
            }
            else
            {
                Console.Write("   ");
            }
            Console.ResetColor();
            Console.WriteLine("");
            // sixth line, nothing
            Console.WriteLine("");
            // seventh line, resolve header
            Console.WriteLine("                          Resolve");
            // eighth line, resolve value
            Console.WriteLine("                          " + Math.Max(0, g.ResolveTracker()));
        }
Exemple #28
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;
 }
Exemple #29
0
        // move to UserInterface
        public void DrawLocation(GameState g)
        {
            if (Type == LocationType.Sea)
            {
                Console.ForegroundColor = ConsoleColor.Cyan;
            }
            else if (Type == LocationType.Power)
            {
                Console.ForegroundColor = ConsoleColor.DarkGreen;
            }
            else
            {
                Console.ForegroundColor = ConsoleColor.Red;
            }

            if (g.RevealedLocations.Contains(Index))
            {
                Console.Write(Abbreviation + " ");
            }
            else
            {
                Console.Write("### ");
            }
            Console.ResetColor();
        }
Exemple #30
0
 public void PlayImmediately(GameState g, EventDetail eventCardDrawn, UserInterface ui)
 {
     switch (eventCardDrawn.name)
     {
         case "Evasion":
             int hunterPlayingGoodluckC = ui.AskWhichHunterIsUsingGoodLuckToCancelEvent();
             if (hunterPlayingGoodluckC > 0)
             {
                 g.DiscardEventFromHunterAtIndex("Good Luck", hunterPlayingGoodluckC, ui);
             }
             else
             {
                 PlayEvasion(g, ui); break;
             }
             break;
         case "Night Visit":
             int hunterPlayingGoodluck = ui.AskWhichHunterIsUsingGoodLuckToCancelEvent();
             if (hunterPlayingGoodluck > 0)
             {
                 g.DiscardEventFromHunterAtIndex("Good Luck", hunterPlayingGoodluck, ui);
             }
             else
             {
                 PlayNightVisit(g, ui); break;
             }
             break;
         case "Vampiric Influence":
             int hunterPlayingGoodluckB = ui.AskWhichHunterIsUsingGoodLuckToCancelEvent();
             if (hunterPlayingGoodluckB > 0)
             {
                 g.DiscardEventFromHunterAtIndex("Good Luck", hunterPlayingGoodluckB, ui);
             }
             else
             {
                 PlayVampiricInfluence(g, ui); break;
             }
             break;
     }
 }