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())); }
public void PlayAlly(GameState g, EventDetail allyDrawn, UserInterface ui) { string allyKept; if (!g.DraculaHasAlly()) { Logger.WriteToDebugLog("Dracula has no current Ally, keeping this one"); g.SetDraculaAlly(allyDrawn); g.RemoveEventFromEventDeck(allyDrawn); Logger.WriteToDebugLog("Dracula put " + allyDrawn.name + " into his empty Ally slot"); Logger.WriteToGameLog("Dracula put " + allyDrawn.name + " into his empty Ally slot"); allyKept = allyDrawn.name; } else { Logger.WriteToDebugLog("Dracula already has an Ally, deciding which one to keep"); string allyToKeep = logic.DecideWhichAllyToKeep(g.NameOfDraculaAlly(), allyDrawn.name); string allyDiscarded = (allyToKeep == allyDrawn.name ? g.NameOfDraculaAlly() : allyDrawn.name); Logger.WriteToDebugLog("Keeping " + allyToKeep); if (allyToKeep == allyDrawn.name) { g.RemoveDraculaAlly(); g.SetDraculaAlly(g.GetEventByNameFromEventDeck(allyToKeep)); } else { g.DiscardEventCard(allyDrawn.name); } switch (allyDiscarded) { case "Immanuel Hildesheim": { Logger.WriteToDebugLog("Discarded Immanuel Hildesheim, discarding events down to 4"); EventHandSize = 4; DiscardEventsDownTo(g, EventHandSize, ui); break; } case "Dracula's Brides": { Logger.WriteToDebugLog("Discarding Dracula's Brides, discarding encounters down to 5"); EncounterHandSize = 5; DiscardEncountersDownTo(g, EncounterHandSize); break; } } allyKept = allyToKeep; } switch (allyKept) { case "Dracula's Brides": { Logger.WriteToDebugLog("Dracula's Brides is in play, encounter hand size is 7"); EncounterHandSize = 7; break; } case "Immanuel Hildesheim": { Logger.WriteToDebugLog("Immanueal Hildesheim is in play, event hand size is 6"); EventHandSize = 6; break; } } }