Esempio n. 1
0
 public bool ResolveNewVampire(List<Hunter> huntersEncountered, out bool discard, UserInterface ui)
 {
     if (TimeIndex < 3)
     {
         ui.TellUser(huntersEncountered[0].Name + " encountered a New Vampire and disposed of it during the day");
         discard = true;
         return true;
     }
     else
     {
         EventDetail draculaEventCard = Dracula.PlaySeductionCard(this);
         DiscardEventFromDracula("Seduction");
         ui.TellUser("Dracula played Seduction");
         int dieRoll;
         if (draculaEventCard != null)
         {
             int hunterPlayingGoodluck = ui.AskWhichHunterIsUsingGoodLuckToCancelEvent();
             if (hunterPlayingGoodluck > -1)
             {
                 DiscardEventFromHunterAtIndex("Good Luck", hunterPlayingGoodluck, ui);
                 dieRoll = ui.GetDieRoll();
             }
             else
             {
                 dieRoll = 4;
             }
         }
         else
         {
             dieRoll = ui.GetDieRoll();
         }
         if (dieRoll < 4)
         {
             ui.TellUser("The Vampire attempts to bite you");
             for (int i = 0; i < huntersEncountered.Count(); i++)
             {
                 int answer;
                 if (draculaEventCard != null)
                 {
                     answer = 0;
                 }
                 else
                 {
                     answer = ui.GetHunterHolyItems(huntersEncountered[i].Name);
                 }
                 if (answer > 0)
                 {
                     Logger.WriteToDebugLog(huntersEncountered[i].Name + " negated the encounter with " + (answer == 1 ? "a crucifix" : "a heavenly host"));
                     Logger.WriteToGameLog(huntersEncountered[i].Name + " negated the encounter with " + (answer == 1 ? "a crucifix" : "a heavenly host"));
                     ui.TellUser(huntersEncountered[i].Name + " negated the encounter with " + (answer == 1 ? "a crucifix" : "a heavenly host"));
                     discard = true;
                     return true;
                 }
             }
             foreach (Hunter h in huntersEncountered)
             {
                 Logger.WriteToDebugLog(h.Name + " is bitten");
                 Logger.WriteToGameLog(h.Name + " is bitten");
                 ui.TellUser(h.Name + " is bitten");
                 discard = true;
                 return (!HandlePossibleHunterDeath(ui));
             }
             discard = true;
             return true;
         }
         else
         {
             ui.TellUser("The Vampire attempts to escape");
             for (int i = 0; i < huntersEncountered.Count(); i++)
             {
                 int answer = ui.GetHunterSharpItems(huntersEncountered[i].Name);
                 if (answer > 0)
                 {
                     Logger.WriteToDebugLog(huntersEncountered[i].Name + " prevented the Vampire escaping with " + (answer == 1 ? "a Knife" : "a Stake"));
                     Logger.WriteToGameLog(huntersEncountered[i].Name + " prevented the Vampire escaping with " + (answer == 1 ? "a Knife" : "a Stake"));
                     ui.TellUser(huntersEncountered[i].Name + " prevented the Vampire escaping with " + (answer == 1 ? "a Knife" : "a Stake"));
                     ui.TellUser("Don't forget to discard the item");
                     discard = true;
                     return true;
                 }
             }
             ui.TellUser("The Vampire escaped");
             discard = false;
             return true;
         }
     }
 }
Esempio n. 2
0
 private void PlayHeroicLeapInCombat(int hunterIndex, UserInterface ui)
 {
     ui.TellUser("First roll a die for you and then roll a die for Dracula and tell me the results");
     int hunterHealthLost = ui.GetDieRoll();
     int draculaBloodLost = ui.GetDieRoll();
     Hunters[hunterIndex].Health -= hunterHealthLost;
     Dracula.Blood -= draculaBloodLost;
     HandlePossibleHunterDeath(ui);
 }
Esempio n. 3
0
        internal void PlayHypnosis(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)
            {
                if (ui.GetDieRoll() < 3)
                {
                    ui.TellUser("Nothing happened");
                    Logger.WriteToDebugLog("Hypnosis was unsuccessful");
                }
                else
                {
                    ui.TellUser("The hypnosis was successful");
                    Logger.WriteToDebugLog("The hypnosis was successful");
                    Logger.WriteToGameLog("The hypnosis was successful");
                    draculaEventCard = Dracula.WillPlaySensationalistPress(this, 0);
                    bool revealing = true;
                    if (draculaEventCard != null)
                    {
                        switch (draculaEventCard.name)
                        {
                            case "Sensationalist Press":
                                ui.TellUser("Dracula played Sensationalist Press to cancel revealing his current location");
                                DiscardEventFromDracula("Sensationalist Press");
                                int hunterPlayingGoodluck = ui.AskWhichHunterIsUsingGoodLuckToCancelEvent();
                                if (hunterPlayingGoodluck > -1)
                                {
                                    DiscardEventFromHunterAtIndex("Good Luck", hunterPlayingGoodluck, ui);
                                }
                                else
                                {
                                    revealing = false;
                                }
                                break;
                        }
                    }
                    if (revealing)
                    {
                        ui.TellUser("Dracula's current location is " + Dracula.CurrentLocation.Name);
                        Dracula.CurrentLocation.IsRevealed = true;
                    }
                    foreach (LocationDetail l in Dracula.LocationTrail)
                    {
                        foreach (EncounterDetail e in l.Encounters)
                        {
                            if (e.name == "New Vampire")
                            {
                                e.isRevealed = true;
                                Logger.WriteToDebugLog("Vampire revealed at " + l.Name);
                                Logger.WriteToGameLog("Vampire revealed at " + l.Name);
                            }
                        }
                    }
                    foreach (LocationDetail l in Dracula.Catacombs)
                    {
                        foreach (EncounterDetail e in l.Encounters)
                        {
                            if (e.name == "New Vampire")
                            {
                                e.isRevealed = true;
                                Logger.WriteToDebugLog("Vampire revealed at " + l.Name);
                                Logger.WriteToGameLog("Vampire revealed at " + l.Name);
                            }
                        }
                    }
                    Dracula.DeterminePossibleLocations();
                    Dracula.DeterminePossiblePowers(Dracula.CurrentLocation.Type == LocationType.Sea ? TimeIndex : TimeIndex + 1);

                    Logger.WriteToDebugLog("Checking if there are legal moves");
                    if (Dracula.PossibleMoves.Count() + Dracula.PossiblePowers.Count() == 0)
                    {
                        Logger.WriteToDebugLog("Dracula has no legal moves");
                        ui.TellUser("Dracula is cornered by his own trail");
                    }
                    else if (Dracula.PossibleMoves.Count() == 0 && Dracula.PossiblePowers.Count() == 1 && Dracula.PossiblePowers.Contains(Dracula.Powers[1]))
                    {
                        Logger.WriteToDebugLog("Dracula has no regular moves available");
                        Dracula.DeterminePossibleWolfFormLocations();
                        if (Dracula.PossibleMoves.Count() == 0)
                        {
                            Logger.WriteToDebugLog("Dracula has no moves available by Wolf Form");
                            ui.TellUser("Dracula is cornered by his own trail");
                        }
                        Dracula.DeterminePossibleLocations();
                    }

                    string powerUsed;
                    LocationDetail destination = Dracula.ChooseMoveForHypnosis(this, out powerUsed);
                    ui.TellUser("Dracula will use " + powerUsed + " and move to " + destination.Name);
                    Dracula.AdvanceMovePower = powerUsed;
                    Dracula.AdvanceMoveDestination = destination;
                }
            }
        }