Esempio n. 1
0
        internal void PlayHiredScouts(UserInterface ui)
        {
            EventDetail draculaEventCard = Dracula.WillPlayDevilishPower(this, ui);
            bool eventIsCancelled = false;
            if (draculaEventCard != null)
            {
                switch (draculaEventCard.name)
                {
                    case "DevilishPower":
                        ui.TellUser("Dracula played Devilish power to cancel this event");
                        DiscardEventFromDracula("Devilish Power");
                        int hunterPlayingGoodluck = ui.AskWhichHunterIsUsingGoodLuckToCancelEvent();
                        if (hunterPlayingGoodluck > -1)
                        {
                            DiscardEventFromHunterAtIndex("Good Luck", hunterPlayingGoodluck, ui);
                        }
                        else
                        {
                            eventIsCancelled = true;
                        }

                        break;
                }
            }
            if (!eventIsCancelled)
            {
                string line = "";
                LocationDetail locationToReveal;
                do
                {
                    line = ui.GetFirstLocationNameForHiredScouts();
                    locationToReveal = GetLocationFromName(line);
                    ui.TellUser(locationToReveal.Name);
                } while (locationToReveal.Name == "Unknown location" || locationToReveal.Name == "Multiple locations");
                if (LocationIsInTrail(locationToReveal))
                {
                    bool revealingThis = true;
                    draculaEventCard = Dracula.WillPlaySensationalistPress(this, 0);
                    if (draculaEventCard != null)
                    {
                        switch (draculaEventCard.name)
                        {
                            case "Sensationalist Press":
                                ui.TellUser("Dracula played Sensationalist Press to cancel revealing" + locationToReveal.Name);
                                DiscardEventFromDracula("Sensationalist Press");
                                int hunterPlayingGoodluck = ui.AskWhichHunterIsUsingGoodLuckToCancelEvent();
                                if (hunterPlayingGoodluck > -1)
                                {
                                    DiscardEventFromHunterAtIndex("Good Luck", hunterPlayingGoodluck, ui);
                                }
                                else
                                {
                                    revealingThis = false;
                                }
                                break;
                        }
                    }
                    if (revealingThis)
                    {
                        locationToReveal.IsRevealed = true;
                        ui.TellUser("Revealing " + locationToReveal.Name);
                        for (int i = 0; i < locationToReveal.Encounters.Count(); i++)
                        {
                            locationToReveal.Encounters[i].isRevealed = true;
                            ui.TellUser(" and " + locationToReveal.Encounters[i].name);
                        }
                        ui.TellUser("");
                        ui.drawGameState(this);
                    }
                }
                else
                {
                    ui.TellUser(locationToReveal.Name + " is not in Dracula's trail");
                }
                do
                {
                    line = ui.GetSecondLocationNameForHiredScouts();
                    locationToReveal = GetLocationFromName(line);
                    ui.TellUser(locationToReveal.Name);
                } while (locationToReveal.Name == "Unknown location" || locationToReveal.Name == "Multiple locations");
                if (LocationIsInTrail(locationToReveal))
                {
                    locationToReveal.IsRevealed = true;
                    ui.TellUser("Revealing " + locationToReveal.Name);
                    for (int i = 0; i < locationToReveal.Encounters.Count(); i++)
                    {
                        locationToReveal.Encounters[i].isRevealed = true;
                        ui.TellUser(" and " + locationToReveal.Encounters[i].name);
                    }
                    ui.TellUser("");
                }
                else
                {
                    ui.TellUser(locationToReveal.Name + " is not in Dracula's trail");
                }
            }
        }
Esempio n. 2
0
        private bool ResolveEncountersAtLocation(Hunter hunter, Map map, Location location, UserInterface ui)
        {
            Dracula.OrderEncounters(hunter, location);
            foreach (EncounterDetail enc in map.LocationDetails(location).Encounters)
            {
                enc.isRevealed = true;
                ui.TellUser(enc.name + " is revealed");
            }
            ui.drawGameState(this);
            bool resolveNextEncounter = true;
            bool discardEncounter = true;
            List<EncounterDetail> encountersBeingDiscarded = new List<EncounterDetail>();
            EncounterDetail firstEncounter = null;
            EncounterDetail secondEncounter = null;

            if (map.LocationDetails(location).Encounters.Count() > 0)
            {
                firstEncounter = map.LocationDetails(location).Encounters.First();
            }
            if (map.LocationDetails(location).Encounters.Count() > 1)
            {
                secondEncounter = map.LocationDetails(location).Encounters[1];
            }
            if (firstEncounter != null)
            {
                bool encounterCancelled = false;
                foreach (Hunter h in Hunters)
                {
                    int hunterIndex = IndexOfHunter(h);
                    if (h.CurrentLocation == location)
                    {
                        if (ui.AskIfHunterIsPlayingSecretWeapon(h.Name))
                        {

                            DiscardEventFromHunterAtIndex("Secret Weapon", hunterIndex, ui);
                            Logger.WriteToDebugLog(h.Name + " played Secret Weapon");
                            Logger.WriteToGameLog(h.Name + " played Secret Weapon");
                            EventDetail draculaEventCardA = Dracula.WillPlayDevilishPower(this, ui);
                            bool eventIsCancelled = false;
                            if (draculaEventCardA != null)
                            {
                                switch (draculaEventCardA.name)
                                {
                                    case "DevilishPower":
                                        ui.TellUser("Dracula played Devilish power to cancel this event");
                                        Logger.WriteToDebugLog("Dracula played Devilish Power");
                                        DiscardEventFromDracula("Devilish Power");
                                        int hunterPlayingGoodluck = ui.AskWhichHunterIsUsingGoodLuckToCancelEvent();
                                        if (hunterPlayingGoodluck > -1)
                                        {
                                            DiscardEventFromHunterAtIndex("Good Luck", hunterPlayingGoodluck, ui);
                                        }
                                        else
                                        {
                                            eventIsCancelled = true;
                                        }
                                        break;
                                }
                            }
                            if (!eventIsCancelled)
                            {
                                PlaySecretWeaponBeforeEncounter(hunterIndex, ui);
                            }
                        }
                        EventDetail draculaEventCard;
                        if (ui.AskIfHunterIsPlayingForeWarned(h.Name))
                        {
                            draculaEventCard = Dracula.WillPlayDevilishPower(this, ui);
                            bool eventIsCancelled = false;
                            if (draculaEventCard != null)
                            {
                                switch (draculaEventCard.name)
                                {
                                    case "DevilishPower":
                                        ui.TellUser("Dracula played Devilish power to cancel this event");
                                        DiscardEventFromDracula("Devilish Power");
                                        int hunterPlayingGoodluck = ui.AskWhichHunterIsUsingGoodLuckToCancelEvent();
                                        if (hunterPlayingGoodluck > -1)
                                        {
                                            DiscardEventFromHunterAtIndex("Good Luck", hunterPlayingGoodluck, ui);
                                        }
                                        else
                                        {
                                            eventIsCancelled = true;
                                        }

                                        break;
                                }
                            }
                            if (!eventIsCancelled)
                            {
                                PlayForewarnedBeforeEncounter(hunterIndex, ui);
                                encounterCancelled = true;
                            }
                        }
                    }
                }
                if (encounterCancelled)
                {
                    resolveNextEncounter = true;
                    discardEncounter = true;
                }
                else
                {
                    resolveNextEncounter = ResolveEncounter(firstEncounter, hunter, out discardEncounter, ui);
                }
                if (discardEncounter)
                {
                    map.LocationDetails(location).Encounters.Remove(firstEncounter);
                    EncounterPool.Add(firstEncounter);
                    firstEncounter.isRevealed = false;
                }
                else if (firstEncounter.name == "Bats" || firstEncounter.name == "Fog")
                {
                    EncounterLimbo.Add(firstEncounter);
                    map.LocationDetails(location).Encounters.Remove(firstEncounter);
                }
            }
            if (secondEncounter != null)
            {
                bool encounterCancelled = false;
                foreach (Hunter h in Hunters)
                {
                    int hunterIndex = IndexOfHunter(h);
                    if (h.CurrentLocation == location)
                    {
                        if (ui.AskIfHunterIsPlayingSecretWeapon(h.Name))
                        {

                            DiscardEventFromHunterAtIndex("Secret Weapon", hunterIndex, ui);
                            Logger.WriteToDebugLog(h.Name + " played Secret Weapon");
                            Logger.WriteToGameLog(h.Name + " played Secret Weapon");
                            EventDetail draculaEventCardA = Dracula.WillPlayDevilishPower(this, ui);
                            bool eventIsCancelled = false;
                            if (draculaEventCardA != null)
                            {
                                switch (draculaEventCardA.name)
                                {
                                    case "DevilishPower":
                                        ui.TellUser("Dracula played Devilish power to cancel this event");
                                        Logger.WriteToDebugLog("Dracula played Devilish Power");
                                        DiscardEventFromDracula("Devilish Power");
                                        int hunterPlayingGoodluck = ui.AskWhichHunterIsUsingGoodLuckToCancelEvent();
                                        if (hunterPlayingGoodluck > -1)
                                        {
                                            DiscardEventFromHunterAtIndex("Good Luck", hunterPlayingGoodluck, ui);
                                        }
                                        else
                                        {
                                            eventIsCancelled = true;
                                        }
                                        break;
                                }
                            }
                            if (!eventIsCancelled)
                            {
                                PlaySecretWeaponBeforeEncounter(hunterIndex, ui);
                            }
                        }
                        EventDetail draculaEventCard;
                        if (ui.AskIfHunterIsPlayingForeWarned(h.Name))
                        {
                            draculaEventCard = Dracula.WillPlayDevilishPower(this, ui);
                            bool eventIsCancelled = false;
                            if (draculaEventCard != null)
                            {
                                switch (draculaEventCard.name)
                                {
                                    case "DevilishPower":
                                        ui.TellUser("Dracula played Devilish power to cancel this event");
                                        DiscardEventFromDracula("Devilish Power");
                                        int hunterPlayingGoodluck = ui.AskWhichHunterIsUsingGoodLuckToCancelEvent();
                                        if (hunterPlayingGoodluck > -1)
                                        {
                                            DiscardEventFromHunterAtIndex("Good Luck", hunterPlayingGoodluck, ui);
                                        }
                                        else
                                        {
                                            eventIsCancelled = true;
                                        }

                                        break;
                                }
                            }
                            if (!eventIsCancelled)
                            {
                                PlayForewarnedBeforeEncounter(hunterIndex, ui);
                                encounterCancelled = true;
                            }
                        }
                    }
                }
                if (encounterCancelled)
                {
                    resolveNextEncounter = true;
                    discardEncounter = true;
                }
                else
                {
                    resolveNextEncounter = ResolveEncounter(secondEncounter, hunter, out discardEncounter, ui);
                }
                if (discardEncounter)
                {
                    map.LocationDetails(location).Encounters.Remove(secondEncounter);
                    EncounterPool.Add(secondEncounter);
                }
                else if (secondEncounter.name == "Bats" || secondEncounter.name == "Fog")
                {
                    EncounterLimbo.Add(secondEncounter);
                    map.LocationDetails(location).Encounters.Remove(secondEncounter);
                }
            }
            return resolveNextEncounter;
        }
Esempio n. 3
0
 public void DoActionPhase(GameState g, UserInterface ui)
 {
     Logger.WriteToDebugLog("PERFORMING ACTION PHASE");
     if (g.IndexOfHunterAtLocation(CurrentLocation) > -1 && LocationWhereHideWasUsed != CurrentLocation && CurrentLocation.Type != LocationType.Sea)
     {
         ui.TellUser("Dracula moved into " + CurrentLocation.Name + " and is entering combat with " + g.NameOfHunterAtIndex(g.IndexOfHunterAtLocation(CurrentLocation)));
         g.RevealLocationAtTrailIndex(0, ui);
         ui.drawGameState(g);
         g.ResolveCombat(g.IndexOfHunterAtLocation(CurrentLocation), 1, false, ui);
     }
     else
     {
         Logger.WriteToDebugLog("Placing an encounter");
         PlaceEncounterIfLegal(g, LocationTrail[0]);
     }
 }