예제 #1
0
파일: Dracula.cs 프로젝트: UncleGus/dracula
 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;
             }
         }
     }
 }
예제 #2
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()));
        }
예제 #3
0
파일: Dracula.cs 프로젝트: UncleGus/dracula
 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;
             }
     }
 }