Esempio n. 1
0
        public override void Run()
        {
            var companyName = _companyNames[Random.Range(0, _companyNames.Count)];

            Description =
                $"The party spots a large gathering and decides to check it out.\n\n'WELCOME TO THE {companyName.ToUpper()} COMPANY RETREAT!' a huge banner exclaims.\n\nYou are about to tell everyone break's over when an ENTHUSIASTIC gentleman with a ponytail challenges your party to 'unleash their inner power'. His arm is extended towards a bed of hot coals surrounded by totally thrilled employees.\n\nWho will take the challenge?";

            Options = new Dictionary <string, Option>();

            var sacrifices = Party.GetRandomCompanions(3);

            const int success = 15;

            string optionResultText;

            foreach (var sacrifice in sacrifices)
            {
                var optionReward  = new Reward();
                var optionPenalty = new Penalty();

                var coordCheck = Dice.Roll($"{sacrifice.Attributes.Coordination - 1}d6");

                var wildRoll = GlobalHelper.RollWildDie();

                coordCheck += wildRoll;

                if (coordCheck > success)
                {
                    optionResultText = $"{sacrifice.FirstName()} marches across the coals. They indeed feel a burning sensation -- not on their feet, but within. Just like the pamphlet said!";

                    optionReward.AddEntityGain(sacrifice, EntityStatTypes.CurrentMorale, 10);
                    optionReward.AddEntityGain(sacrifice, EntitySkillTypes.Endurance, 1);
                }
                else
                {
                    optionResultText = $"{sacrifice.FirstName()} tries walking on the sides of their feet to keep from burning their soles, but ends up slipping and slams onto the hot coals!";

                    optionPenalty.AddEntityLoss(sacrifice, EntityStatTypes.CurrentMorale, 5);
                    optionPenalty.AddEntityLoss(sacrifice, EntityStatTypes.CurrentHealth, 5);
                }

                var option = new Option(sacrifice.Name, optionResultText, optionReward, optionPenalty, EncounterType.Normal);

                Options.Add(sacrifice.Name, option);
            }

            var optionTitle = "Get out of there";

            optionResultText = $"The man whips his ponytail round and round in a rage!\n\n\"You'll never know true enlightenment!\"";

            var optionFour = new Option(optionTitle, optionResultText, null, null, EncounterType.Normal);

            Options.Add(optionTitle, optionFour);

            SubscribeToOptionSelectedEvent();

            var eventMediator = Object.FindObjectOfType <EventMediator>();

            eventMediator.Broadcast(GlobalHelper.FourOptionEncounter, this);
        }
Esempio n. 2
0
        public override void Run()
        {
            var forager = Party.GetCompanionWithHighestSurvivalSkill();

            Description = $"{forager.FirstName()} gets bored and wanders off the trail a bit. They come back with an armful of mushrooms.\n\n\"Of course they're safe! See?\"\n\nThey pop one in their mouth and swallow. ";

            const int success = 15;

            var survivalRoll = Dice.Roll($"{forager.Skills.Survival - 1}d6");

            var wildRoll = GlobalHelper.RollWildDie();

            survivalRoll += wildRoll;

            if (survivalRoll > success)
            {
                Description += $"A short while passes on the trail and {forager.FirstName()} hasn't keeled over so they must be okay!";

                Reward = new Reward();

                Reward.AddPartyGain(PartySupplyTypes.Food, 6);
            }
            else
            {
                Description += $"A short while passes on the trail and {forager.FirstName()} gets horribly sick! Derpus chucks the mushrooms as far as he can.";

                Penalty = new Penalty();

                Penalty.AddEntityLoss(forager, EntityStatTypes.CurrentHealth, 5);
                Penalty.AddEntityLoss(forager, EntityStatTypes.CurrentMorale, 5);
            }

            var travelManager = Object.FindObjectOfType <TravelManager>();

            if (Reward != null)
            {
                travelManager.ApplyEncounterReward(Reward);
            }

            if (Penalty != null)
            {
                travelManager.ApplyEncounterPenalty(Penalty);
            }

            var fullResultDescription = new List <string> {
                Description + "\n"
            };

            var eventMediator = Object.FindObjectOfType <EventMediator>();

            eventMediator.Broadcast(GlobalHelper.EncounterResult, this, fullResultDescription);
        }
Esempio n. 3
0
        public StayInSchool()
        {
            Rarity        = Rarity.Rare;
            EncounterType = EncounterType.Normal;
            Title         = "Stay In School Kids";
            Description   = @"The group spots a schoolhouse off the trail.";

            Options = new Dictionary <string, Option>();

            var optionTitle      = "Send Derpus to investigate";
            var optionResultText =
                "Derpus SPRINTS towards the schoolhouse, the wagon bouncing behind him. He always wanted to learn to read! Alas, the teacher explains to him that they don't have any room for him. The best she can do is offer some food if he agrees to be a guest speaker. Derpus agrees and speaks to the children about the importance of staying in school using himself as an example.";

            var reward = new Reward();

            reward.AddPartyGain(PartySupplyTypes.Food, 10);

            var penalty = new Penalty();

            var travelManager = Object.FindObjectOfType <TravelManager>();

            penalty.AddEntityLoss(travelManager.Party.Derpus, EntityStatTypes.CurrentMorale, 10);

            var optionOne = new Option(optionTitle, optionResultText, reward, penalty, EncounterType);

            Options.Add(optionTitle, optionOne);

            optionTitle      = "We don't need any learnin'";
            optionResultText =
                "You decide to pass it by. You swear you catch Derpus staring at it as it fades out of sight.";

            var optionTwo = new Option(optionTitle, optionResultText, EncounterType);

            Options.Add(optionTitle, optionTwo);
        }
Esempio n. 4
0
        public override void Run()
        {
            Description = $"It's a narrow part of the trail and everyone has to walk in a tight group when someone farts!\n\n\"Who dun did it?\"";

            Options = new Dictionary <string, Option>();

            var farters = Party.GetRandomCompanions(3);

            string optionResultText;

            foreach (var farter in farters)
            {
                optionResultText = $"{farter.FirstName()} is the culprit!\n\nThe stench sticks to them like glue!\n\n\"Maybe check your drawers...\"";

                var optionPenalty = new Penalty();

                optionPenalty.AddEntityLoss(farter, EntityStatTypes.CurrentMorale, 10);

                var option = new Option(farter.Name, optionResultText, null, optionPenalty, EncounterType.Normal);

                Options.Add(farter.Name, option);
            }

            var optionTitle = "Burrito Ghost";

            var battleChance = 100;

            optionResultText = $"{farters.First().FirstName()} scoffs.\n\n\"Ain't no such thing as ghost wandering around, farting, and moaning 'burrito'!\"";

            var roll = Dice.Roll("1d100");

            Option optionFour;

            if (roll < battleChance)
            {
                optionResultText += $"\n\n\"BURRRIIIIIITOOOO...\" something moans back. Everyone stops and looks around. Suddenly, another fart blasts their nostrils and the culprit reveals themself!\n\nThe Burrito Ghost is real, y'all! Prepare for battle!";

                optionFour = new FightCombatOption(optionTitle, optionResultText, new List <Entity> {
                    new BurritoGhost(), new Ghost(), new Ghost()
                });
            }
            else
            {
                optionResultText += "\n\nThe mystery remains unsolved.";

                var optionFourPenalty = new Penalty();

                optionFourPenalty.EveryoneLoss(Party, EntityStatTypes.CurrentMorale, 5);

                optionFour = new Option(optionTitle, optionResultText, null, optionFourPenalty, EncounterType.Normal);
            }

            Options.Add(optionTitle, optionFour);

            SubscribeToOptionSelectedEvent();

            var eventMediator = Object.FindObjectOfType <EventMediator>();

            eventMediator.Broadcast(GlobalHelper.FourOptionEncounter, this);
        }
Esempio n. 5
0
        public override void Run()
        {
            var klutz = Party.GetRandomCompanion();

            Description = $"While walking along a riverbank, the ground gives out from under {klutz.FirstName()}'s feet and they slide into the water. Some of their gear is lost or ruined!";

            Penalty = new Penalty();

            Penalty.AddEntityLoss(klutz, EntityStatTypes.CurrentMorale, 10);

            Penalty.AddPartyLoss(PartySupplyTypes.Food, 2);
            Penalty.AddPartyLoss(PartySupplyTypes.HealthPotions, 2);

            var fullResultDescription = new List <string> {
                Description + "\n"
            };

            var travelManager = Object.FindObjectOfType <TravelManager>();

            travelManager.ApplyEncounterPenalty(Penalty);

            var eventMediator = Object.FindObjectOfType <EventMediator>();

            eventMediator.Broadcast(GlobalHelper.EncounterResult, this, fullResultDescription);
        }
Esempio n. 6
0
        public override void Run()
        {
            var chosen = Party.GetRandomCompanion();

            Description =
                $"The party makes camp and it's a pretty uneventful evening until {chosen.FirstName()} decides to cut their own hair. It turns out awful!";

            Reward = new Reward();

            Reward.EveryoneGain(Party, EntityStatTypes.CurrentEnergy, 10);

            Penalty = new Penalty();

            Penalty.AddEntityLoss(chosen, EntityStatTypes.CurrentMorale, 5);

            var fullResultDescription = new List <string> {
                Description + "\n"
            };

            var travelManager = Object.FindObjectOfType <TravelManager>();

            travelManager.ApplyEncounterPenalty(Penalty);
            travelManager.ApplyEncounterReward(Reward);

            var eventMediator = Object.FindObjectOfType <EventMediator>();

            eventMediator.Broadcast(GlobalHelper.EncounterResult, this, fullResultDescription);
        }
Esempio n. 7
0
        public override void Run()
        {
            var travelManager = Object.FindObjectOfType <TravelManager>();

            var chosenCompanions = travelManager.Party.GetRandomCompanions(3);

            Description = $"While doing some spring cleaning in the wagon, {chosenCompanions.First().FirstName()} finds an old chest completely covered with some kind of pale green slime. It's super gross and there doesn't seem to be a way to get around touching the slime to open it!";

            Options = new Dictionary <string, Option>();

            string optionResult;

            foreach (var companion in chosenCompanions)
            {
                Reward optionReward = new Reward();

                optionReward.AddPartyGain(PartySupplyTypes.Food, 15);

                Penalty optionPenalty = null;

                if (companion.EntityClass == EntityClass.Wizard)
                {
                    optionResult =
                        $"{companion.FirstName()} waggles their fingers and opens the chest without touching the goo. There's a bunch of supplies inside!";
                }
                else
                {
                    optionResult =
                        $"{companion.FirstName()} tries to use a cloth to open the chest, but it goes horribly wrong! They are super disgusted! They'll never get over this!";

                    optionPenalty = new Penalty();

                    optionPenalty.AddEntityLoss(companion, EntityStatTypes.MaxMorale, 10);
                }

                var option = new Option(companion.Name, optionResult, optionReward, optionPenalty,
                                        EncounterType.Normal);

                Options.Add(companion.Name, option);
            }

            var optionTitle = "Leave it";

            optionResult = "Everyone decides it's best to just pretend it's not there and move on with their lives.";

            var ignoreOption = new Option(optionTitle, optionResult, null, null, EncounterType.Normal);

            Options.Add(optionTitle, ignoreOption);

            SubscribeToOptionSelectedEvent();

            var eventMediator = Object.FindObjectOfType <EventMediator>();

            eventMediator.Broadcast(GlobalHelper.FourOptionEncounter, this);
        }
Esempio n. 8
0
        public override void Run()
        {
            var partyPal = Party.GetRandomCompanion();

            Title = $"{partyPal.FirstName()} Forty Hands";

            Description = $"The party camps outside a town known for its taverns. In the morning, {partyPal.FirstName()} is missing! After a short search, they are found in a nearby field in their underwear with empty bottles tied to their hands.";

            const int equipmentLostChance = 18;

            var roll = Dice.Roll("1d100");

            if (roll <= equipmentLostChance)
            {
                partyPal.UnEquipAll();

                Description += "\n\nTheir equipment is nowhere to be found!";
            }
            else
            {
                Description += "\n\nLuckily, their equipment is found close by.";
            }

            Penalty = new Penalty();

            Penalty.AddEntityLoss(partyPal, EntityStatTypes.CurrentEnergy, 10);

            Reward = new Reward();

            Reward.AddEntityGain(Party.Derpus, EntityStatTypes.CurrentEnergy, 10);

            foreach (var companion in Party.GetCompanions())
            {
                if (companion == partyPal)
                {
                    continue;
                }

                Reward.AddEntityGain(companion, EntityStatTypes.CurrentEnergy, 10);
            }

            var fullResultDescription = new List <string> {
                Description + "\n"
            };

            var travelManager = Object.FindObjectOfType <TravelManager>();

            travelManager.ApplyEncounterPenalty(Penalty);
            travelManager.ApplyEncounterReward(Reward);

            var eventMediator = Object.FindObjectOfType <EventMediator>();

            eventMediator.Broadcast(GlobalHelper.EncounterResult, this, fullResultDescription);
        }
Esempio n. 9
0
        public override void Run()
        {
            var travelManager = Object.FindObjectOfType <TravelManager>();

            Penalty = new Penalty();
            Penalty.AddEntityLoss(travelManager.Party.Derpus, EntityStatTypes.CurrentEnergy, 10);

            foreach (var companion in travelManager.Party.GetCompanions())
            {
                Penalty.AddEntityLoss(companion, EntityStatTypes.CurrentEnergy, 10);
            }

            var fullResultDescription = new List <string> {
                Description + "\n"
            };

            travelManager.ApplyEncounterPenalty(Penalty);

            var eventMediator = Object.FindObjectOfType <EventMediator>();

            eventMediator.Broadcast(GlobalHelper.EncounterResult, this, fullResultDescription);
        }
Esempio n. 10
0
        public override void Run()
        {
            Penalty = new Penalty();

            Penalty.AddEntityLoss(_companion, EntitySkillTypes.Melee, 1);
            Penalty.AddEntityLoss(_companion, EntitySkillTypes.Ranged, 1);
            Penalty.AddEntityLoss(_companion, EntitySkillTypes.Survival, 1);

            var fullResultDescription = new List <string> {
                Description + "\n"
            };

            var travelManager = Object.FindObjectOfType <TravelManager>();

            travelManager.ApplyEncounterPenalty(Penalty);

            _companion.Stats.CurrentMorale = _companion.Stats.MaxMorale;

            var eventMediator = Object.FindObjectOfType <EventMediator>();

            eventMediator.Broadcast(GlobalHelper.EncounterResult, this, fullResultDescription);
        }
Esempio n. 11
0
        public override void Run()
        {
            var victim = Party.GetRandomCompanion();

            Description = $"It's getting close to sundown when the sound of music carries through the air. A short while later, the party happens upon a music festival! Everyone decides this would be as good a spot to camp as any and parks the wagon out of the way.\n\n{victim.FirstName()} wanders towards a stage, but starts getting pushed around when the lute player is seven minutes into a solo! They try to get away, but go down for the count when they are hit in the head by a dwarf someone tossed!\n\nA festival goer stands over them and screams in their face \"WELCOME TO THE PIT!\"";

            Reward = new Reward();

            if (victim.Stats.CurrentHealth > 5)
            {
                Description += $"\n\n{victim.FirstName()} wakes in the morning with a horrible headache.";

                Reward.EveryoneGain(Party, EntityStatTypes.CurrentEnergy, 10);
            }
            else
            {
                Reward.AddEntityGain(Party.Derpus, EntityStatTypes.CurrentEnergy, 10);

                foreach (var companion in Party.GetCompanions())
                {
                    if (companion == victim)
                    {
                        continue;
                    }

                    Reward.AddEntityGain(companion, EntityStatTypes.CurrentEnergy, 10);
                }
            }

            Penalty = new Penalty();

            Penalty.AddEntityLoss(victim, EntityStatTypes.CurrentHealth, 5);

            var travelManager = Object.FindObjectOfType <TravelManager>();

            travelManager.ApplyEncounterReward(Reward);
            travelManager.ApplyEncounterPenalty(Penalty);

            var fullResultDescription = new List <string> {
                Description + "\n"
            };

            var eventMediator = Object.FindObjectOfType <EventMediator>();

            eventMediator.Broadcast(GlobalHelper.EncounterResult, this, fullResultDescription);
        }
Esempio n. 12
0
        public override void Run()
        {
            Penalty = new Penalty();
            Penalty.AddEntityLoss(_companion, EntityStatTypes.CurrentHealth, 10);

            Penalty.AddPartyLoss(PartySupplyTypes.Gold, 35);

            var fullResultDescription = new List <string> {
                Description + "\n"
            };

            var travelManager = Object.FindObjectOfType <TravelManager>();

            travelManager.ApplyEncounterPenalty(Penalty);

            var eventMediator = Object.FindObjectOfType <EventMediator>();

            eventMediator.Broadcast(GlobalHelper.EncounterResult, this, fullResultDescription);

            _companion.Stats.CurrentMorale = _companion.Stats.MaxMorale;
        }
Esempio n. 13
0
        public override void Run()
        {
            var entityStore = Object.FindObjectOfType <EntityPrefabStore>();

            var rudeFella = entityStore.GetRandomCompanion();  //todo give drunk trait

            var travelManager = Object.FindObjectOfType <TravelManager>();

            if (travelManager.Party.IsFull())
            {
                Description = $"The party passes by a {rudeFella.EntityClass.ToString().ToLower()} face down on the ground. They stir and wobble to their knees. \n\n\"Oi! Ye wagon is a hunk of junk!\"\n\nDerpus continues to tug the wagon along with tears in his eyes.";

                Penalty = new Penalty();

                Penalty.AddEntityLoss(travelManager.Party.Derpus, EntityStatTypes.CurrentMorale, 5);

                travelManager.ApplyEncounterPenalty(Penalty);
            }
            else
            {
                Description = $"The party passes by a {rudeFella.EntityClass.ToString().ToLower()} face down on the ground. Later, they make a stop to rest and notice the {rudeFella.EntityClass.ToString().ToLower()} clinging to the bottom of the wagon! \n\n\"Haha! I'm comin' with ya!\"";

                Reward = new Reward();

                Reward.AddToParty(rudeFella);

                travelManager.ApplyEncounterReward(Reward);
            }

            var fullResultDescription = new List <string> {
                Description + "\n"
            };

            var eventMediator = Object.FindObjectOfType <EventMediator>();

            eventMediator.Broadcast(GlobalHelper.EncounterResult, this, fullResultDescription);
        }
Esempio n. 14
0
        public override void Run()
        {
            Options = new Dictionary <string, Option>();

            var volunteers = Party.GetRandomCompanions(3);

            string optionResultText;

            foreach (var volunteer in volunteers)
            {
                optionResultText = $"The fire really hits the spot!";

                var optionReward = new Reward();

                optionReward.AddEntityGain(volunteer, EntityAttributeTypes.Physique, 1);

                optionReward.EveryoneGain(Party, EntityStatTypes.CurrentMorale, 5);

                optionReward.AddEntityGain(Party.Derpus, EntityStatTypes.CurrentEnergy, 10);

                foreach (var companion in Party.GetCompanions())
                {
                    if (companion == volunteer)
                    {
                        continue;
                    }

                    optionReward.AddEntityGain(companion, EntityStatTypes.CurrentEnergy, 10);
                }

                var optionPenalty = new Penalty();

                optionPenalty.AddEntityLoss(volunteer, EntityStatTypes.CurrentEnergy, 20);

                var option = new Option(volunteer.Name, optionResultText, optionReward, optionPenalty, EncounterType.Camping);

                Options.Add(volunteer.Name, option);
            }

            var optionTitle = "Don't bother chopping any";

            var littleSpoon = Party.GetRandomCompanion();

            optionResultText = $"Everyone is curled up into a ball trying to stay warm. {littleSpoon.FirstName()} wakes up to Derpus spooning them!";

            var optionFourReward = new Reward();

            optionFourReward.EveryoneGain(Party, EntityStatTypes.CurrentEnergy, 10);

            var optionFourPenalty = new Penalty();

            optionFourPenalty.AddEntityLoss(littleSpoon, EntityStatTypes.CurrentMorale, 5);

            var optionFour = new Option(optionTitle, optionResultText, optionFourReward, optionFourPenalty,
                                        EncounterType.Camping);

            Options.Add(optionTitle, optionFour);

            SubscribeToOptionSelectedEvent();

            var eventMediator = Object.FindObjectOfType <EventMediator>();

            eventMediator.Broadcast(GlobalHelper.FourOptionEncounter, this);
        }
Esempio n. 15
0
        public override void Run()
        {
            var travelManager    = Object.FindObjectOfType <TravelManager>();
            var curiousCompanion = travelManager.Party.GetRandomCompanion();

            Description  = "The party happens upon an odd sight: A bubbling cauldron smack dab in the middle of a clearing. \n\n";
            Description += $"Four items sit on a table next to the cauldron. {curiousCompanion.Name} thinks they should cast one of the items in. They approach the cauldron and toss in: ";

            Options = new Dictionary <string, Option>();

            var optionTitle      = "A Steak";
            var optionResultText = "The cauldron glows and a disembodied voice bellows:\n\n";

            optionResultText += "PROTEIN PROTEIN PROTEIN PROTEIN";

            var     optionReward  = new Reward();
            Penalty optionPenalty = null;

            optionReward.AddEntityGain(curiousCompanion, EntityAttributeTypes.Physique, 1);

            var optionOne = new Option(optionTitle, optionResultText, optionReward, null, EncounterType);

            Options.Add(optionTitle, optionOne);

            optionTitle      = "A Vial of Water";
            optionResultText = "The cauldron explodes showering everyone with hot liquid!";

            optionPenalty = new Penalty();

            foreach (var companion in travelManager.Party.GetCompanions())
            {
                optionPenalty.AddEntityLoss(companion, EntityStatTypes.CurrentHealth, 5);
            }

            var optionTwo = new Option(optionTitle, optionResultText, null, optionPenalty, EncounterType);

            Options.Add(optionTitle, optionTwo);

            optionTitle      = "A Pair of Rat Legs";
            optionResultText = $"The cauldron's bubbling grows violent and a discolored cloud envelopes {curiousCompanion.FirstName()}. The cloud clears and they feel... different. \n\nFaster? \n\nFaster.";

            optionReward = new Reward();
            optionReward.AddEntityGain(curiousCompanion, EntityAttributeTypes.Agility, 1);

            var optionThree = new Option(optionTitle, optionResultText, optionReward, null, EncounterType);

            Options.Add(optionTitle, optionThree);

            optionTitle      = "A Shopping List";
            optionResultText = $"{curiousCompanion.FirstName()} drops the shopping list into the cauldron. Supplies appear out of thin air next to the wagon!";

            optionReward = new Reward();
            optionReward.AddPartyGain(PartySupplyTypes.Food, 15);
            optionReward.AddPartyGain(PartySupplyTypes.HealthPotions, 3);

            var optionFour = new Option(optionTitle, optionResultText, optionReward, null, EncounterType);

            Options.Add(optionTitle, optionFour);

            SubscribeToOptionSelectedEvent();

            var eventMediator = Object.FindObjectOfType <EventMediator>();

            eventMediator.Broadcast(GlobalHelper.FourOptionEncounter, this);
        }
Esempio n. 16
0
        public override void Run()
        {
            Description = @"The group finds a run-down shop. Looks like there may be stuff inside, but it's hard to make out anything in the darkness. It gives everyone the creeps.";

            Options = new Dictionary<string, Option>();

            var optionTitle = "Ignore the creepy building and keep moving";

            string optionResultText = "The group moves on and soon forgets about the whole incident.";

            var optionOne = new Option(optionTitle, optionResultText, EncounterType.Normal);

            Options.Add(optionTitle, optionOne);

            var travelManager = Object.FindObjectOfType<TravelManager>();

            optionTitle = "Send someone in to investigate";

            var chosenCompanion = travelManager.Party.GetRandomCompanion();

            Reward optionTwoReward = null;
            Penalty optionTwoPenalty = null;

            const int acumenSuccess = 15;

            var acumenRoll = Dice.Roll($"{chosenCompanion.Attributes.Acumen - 1}d6");

            var wildRoll = GlobalHelper.RollWildDie();

            acumenRoll += wildRoll;

            if (chosenCompanion.Attributes.Intellect > 5 && chosenCompanion.Attributes.Charisma < 3)
            {
                optionResultText =
                    $"They wander into the darkness mumbling and singing to themselves to distract from the creepiness. As they near the back of the store, the fear overcomes them. {chosenCompanion.FirstName()} sees a tiny spider and screams like a banshee!";

                optionTwoPenalty = new Penalty();

                optionTwoPenalty.AddEntityLoss(chosenCompanion, EntityStatTypes.CurrentMorale, 10);
            }
            else if (chosenCompanion.Attributes.Charisma > 5 && chosenCompanion.Attributes.Intellect < 3)
            {
                optionResultText = $"{chosenCompanion.FirstName()} doesn't notice anything creepy or dangerous in there.";

                optionTwoReward = new Reward();

                optionTwoReward.AddPartyGain(PartySupplyTypes.Food, Random.Range(7, 11));

                const int potionChance = 70;

                var roll = Dice.Roll("1d100");

                if (roll <= potionChance)
                {
                    optionTwoReward.AddPartyGain(PartySupplyTypes.HealthPotions, Random.Range(3, 8));
                }

                const int goldChance = 30;

                roll = Dice.Roll("1d100");

                if (roll <= goldChance)
                {
                    optionTwoReward.AddPartyGain(PartySupplyTypes.Gold, Random.Range(30, 61));
                }
            }
            else if (chosenCompanion.Attributes.Acumen > 5 || acumenRoll > acumenSuccess)
            {
                optionResultText = $"{chosenCompanion.FirstName()} keeps calm, grabs what they can find, and gets the heck out of there!";

                optionTwoReward = new Reward();

                optionTwoReward.AddPartyGain(PartySupplyTypes.Food, Random.Range(7, 11));

                const int potionChance = 70;

                var roll = Dice.Roll("1d100");

                if (roll <= potionChance)
                {
                    optionTwoReward.AddPartyGain(PartySupplyTypes.HealthPotions, Random.Range(3, 8));
                }

                const int goldChance = 30;

                roll = Dice.Roll("1d100");

                if (roll <= goldChance)
                {
                    optionTwoReward.AddPartyGain(PartySupplyTypes.Gold, Random.Range(30, 61));
                }
            }
            else
            {
                optionResultText =
                    $"{chosenCompanion.FirstName()} disappears into the darkness for a few moments before sprinting out of the shop claiming there was nothing worth taking!";

                optionTwoPenalty = new Penalty();

                optionTwoPenalty.AddEntityLoss(chosenCompanion, EntityStatTypes.CurrentMorale, 5);
            }

            var optionTwo = new Option(optionTitle, optionResultText, optionTwoReward, optionTwoPenalty, EncounterType);

            Options.Add(optionTitle, optionTwo);

            optionTitle = "Send the whole group in!";

            Penalty optionThreePenalty = null;

            Entity scaredCompanion = null;
            foreach (var companion in travelManager.Party.GetCompanions())
            {
                if (companion.Attributes.Acumen < 2)
                {
                    scaredCompanion = companion;
                    break;
                }
            }

            var optionThreeReward = new Reward();

            if (scaredCompanion != null)
            {
                optionResultText =
                    $"{scaredCompanion.FirstName()} attacks another party member after mistaking them for a ghost! The whole group panics and starts swinging their weapons wildly! Once the dust settles, the building is barely left standing.";

                optionThreePenalty = new Penalty();

                foreach (var companion in travelManager.Party.GetCompanions())
                {
                    optionThreePenalty.AddEntityLoss(companion, EntityStatTypes.CurrentHealth, 5);
                }

                optionThreeReward.AddPartyGain(PartySupplyTypes.Food, Random.Range(7, 11));

                const int potionChance = 70;

                var roll = Dice.Roll("1d100");

                if (roll <= potionChance)
                {
                    optionThreeReward.AddPartyGain(PartySupplyTypes.HealthPotions, Random.Range(3, 8));
                }

                const int goldChance = 30;

                roll = Dice.Roll("1d100");

                if (roll <= goldChance)
                {
                    optionThreeReward.AddPartyGain(PartySupplyTypes.Gold, Random.Range(30, 61));
                }
            }
            else
            {
                optionResultText = $"Everyone keeps their cool and grabs what they can find.";

                optionThreeReward.AddPartyGain(PartySupplyTypes.Food, Random.Range(7, 11));

                const int potionChance = 70;

                var roll = Dice.Roll("1d100");

                if (roll <= potionChance)
                {
                    optionThreeReward.AddPartyGain(PartySupplyTypes.HealthPotions, Random.Range(3, 8));
                }

                const int goldChance = 30;

                roll = Dice.Roll("1d100");

                if (roll <= goldChance)
                {
                    optionThreeReward.AddPartyGain(PartySupplyTypes.Gold, Random.Range(30, 61));
                }
            }

            var optionThree = new Option(optionTitle, optionResultText, optionThreeReward, optionThreePenalty,
                EncounterType.Normal);

            Options.Add(optionTitle, optionThree);

            SubscribeToOptionSelectedEvent();

            var eventMediator = Object.FindObjectOfType<EventMediator>();

            eventMediator.Broadcast(GlobalHelper.FourOptionEncounter, this);
        }
Esempio n. 17
0
        public override void Run()
        {
            Options = new Dictionary <string, Option>();

            var optionTitle = "Look for a safe way out";

            const int escapeSuccess = 26;

            var travelManager = Object.FindObjectOfType <TravelManager>();
            var smartyPants   = travelManager.Party.GetCompanionWithHighestIntellect();

            //todo diceroller here
            var intCheck = smartyPants.Attributes.Intellect + Random.Range(1, 21);

            Debug.Log("Holy Inferno safe way out check: ");
            Debug.Log($"Value Needed: {escapeSuccess}");
            Debug.Log(
                $"Rolled: {intCheck - smartyPants.Attributes.Intellect} + Intellect: {smartyPants.Attributes.Intellect} = Final Value {intCheck}");

            Penalty penalty = null;

            string optionResultText;

            if (intCheck > escapeSuccess)
            {
                optionResultText = $"{smartyPants.Name} thinks fast and finds a way out. No one is injured!";
            }
            else if (intCheck == escapeSuccess)
            {
                optionResultText = $"{smartyPants.Name} tries to find a safe exit, but wastes precious time making a decision. Everyone escapes, but they look a little crispy...";

                penalty = new Penalty();

                foreach (var companion in travelManager.Party.GetCompanions())
                {
                    penalty.AddEntityLoss(companion, EntityStatTypes.CurrentHealth, 10);
                }
            }
            else
            {
                optionResultText = $"{smartyPants.Name} tries to find a safe exit, but panics instead! Everyone runs screaming from the building!";

                penalty = new Penalty();
                penalty.AddEntityLoss(travelManager.Party.Derpus, EntityStatTypes.CurrentMorale, 10);

                foreach (var companion in travelManager.Party.GetCompanions())
                {
                    penalty.AddEntityLoss(companion, EntityStatTypes.CurrentMorale, 10);
                }
            }

            var optionOne = new Option(optionTitle, optionResultText, null, penalty, EncounterType);

            Options.Add(optionTitle, optionOne);

            optionTitle = "RUN!";

            var chosenCompanion = travelManager.Party.GetRandomCompanion();

            optionResultText = $"Everyone flees to safety in a panic. After ensuring everyone is unharmed, {chosenCompanion.Name} notices that their bag was left behind.";

            penalty = new Penalty();

            var foodLost = travelManager.Party.Food / 4;

            penalty.AddPartyLoss(PartySupplyTypes.Food, foodLost);

            var goldLost = travelManager.Party.Gold / 4;

            penalty.AddPartyLoss(PartySupplyTypes.Gold, goldLost);

            var potionsLost = travelManager.Party.HealthPotions / 4;

            penalty.AddPartyLoss(PartySupplyTypes.HealthPotions, potionsLost);

            var optionTwo = new Option(optionTitle, optionResultText, null, penalty, EncounterType);

            Options.Add(optionTitle, optionTwo);

            SubscribeToOptionSelectedEvent();

            var eventMediator = Object.FindObjectOfType <EventMediator>();

            eventMediator.Broadcast(GlobalHelper.FourOptionEncounter, this);
        }
Esempio n. 18
0
        public override void Run()
        {
            var travelManager   = Object.FindObjectOfType <TravelManager>();
            var chosenCompanion = travelManager.Party.GetRandomCompanion();

            Description =
                $"{chosenCompanion.FirstName()} finds an abandoned cabin. There are some supplies inside. They are about to leave when they notice a trapdoor to an underground lab. Looks like some unfinished health potions were left behind. Handling these could be dangerous!";

            Options = new Dictionary <string, Option>();

            var optionTitle = "Leave them alone!";

            string optionResultText = "Everyone agrees it's not worth the risk and leaves the lab untouched.";

            var optionOne = new Option(optionTitle, optionResultText, null, null, EncounterType);

            Options.Add(optionTitle, optionOne);

            optionTitle = "Finish making them";

            Reward  optionTwoReward  = null;
            Penalty optionTwoPenalty = null;

            const int finishSuccess = 20;

            var bestCoord = travelManager.Party.GetCompanionWithHighestCoordination();

            var coordCheck = Dice.Roll($"{bestCoord.Attributes.Coordination - 1}d6");

            var wildRoll = GlobalHelper.RollWildDie();

            coordCheck += wildRoll;

            if (bestCoord.Attributes.Coordination > 5)
            {
                optionResultText = $"{chosenCompanion.FirstName()} attempts to finish the potions. \n\nThey finish them easily and end up with 5 potions.";

                optionTwoReward = new Reward();
                optionTwoReward.AddPartyGain(PartySupplyTypes.HealthPotions, 5);
            }
            else if (coordCheck >= finishSuccess)
            {
                optionResultText = $"{chosenCompanion.FirstName()} attempts to finish the potions. \n\nThey ruin a few of the potions, but nobody gets hurt.";

                optionTwoReward = new Reward();
                optionTwoReward.AddPartyGain(PartySupplyTypes.HealthPotions, 3);
            }
            else
            {
                optionResultText = $"{chosenCompanion.FirstName()} attempts to finish the potions. \n\nThey are in over their head and make a horrible mistake!";

                optionTwoPenalty = new Penalty();

                foreach (var companion in travelManager.Party.GetCompanions())
                {
                    optionTwoPenalty.AddEntityLoss(companion, EntityStatTypes.CurrentHealth,
                                                   ReferenceEquals(companion, chosenCompanion) ? 15 : 5);
                }
            }

            var optionTwo = new Option(optionTitle, optionResultText, optionTwoReward, optionTwoPenalty, EncounterType);

            Options.Add(optionTitle, optionTwo);

            SubscribeToOptionSelectedEvent();

            var eventMediator = Object.FindObjectOfType <EventMediator>();

            eventMediator.Broadcast(GlobalHelper.FourOptionEncounter, this);
        }
Esempio n. 19
0
        public override void Run()
        {
            Options = new Dictionary <string, Option>();

            var travelManager = Object.FindObjectOfType <TravelManager>();

            var totalCost = CostPerPerson * travelManager.Party.GetCompanions().Count;

            string optionTitle;
            string optionResultText;

            if (totalCost <= travelManager.Party.Gold)
            {
                optionTitle      = $"Pay the {totalCost} gold";
                optionResultText = $"The group pays {totalCost} gold to stay the night. It's pretty comfy!";

                var optionReward = new Reward();
                optionReward.AddEntityGain(travelManager.Party.Derpus, EntityStatTypes.CurrentEnergy, EnergyGain);

                foreach (var companion in travelManager.Party.GetCompanions())
                {
                    optionReward.AddEntityGain(companion, EntityStatTypes.CurrentEnergy, EnergyGain);
                }

                var optionOnePenalty = new Penalty();
                optionOnePenalty.AddPartyLoss(PartySupplyTypes.Gold, totalCost);

                var rollForBreakfast = Random.Range(0, 101); //todo diceroller

                if (rollForBreakfast <= BreakfastChance)
                {
                    optionResultText = "\nThe innkeeper serves breakfast as thanks for being great guests!";

                    optionReward.AddEntityGain(travelManager.Party.Derpus, EntityStatTypes.CurrentMorale, EnergyGain);

                    foreach (var companion in travelManager.Party.GetCompanions())
                    {
                        optionReward.AddEntityGain(companion, EntityStatTypes.CurrentMorale, EnergyGain);
                    }

                    optionReward.AddPartyGain(PartySupplyTypes.Food, travelManager.Party.GetCompanions().Count *Party.FoodConsumedPerCompanion);
                }

                Options.Add(optionTitle, new Option(optionTitle, optionResultText, optionReward, optionOnePenalty, EncounterType));
            }

            optionTitle      = "No thanks";
            optionResultText = "You keep on going and travel through the night.";

            var optionTwoPenalty = new Penalty();

            optionTwoPenalty.AddEntityLoss(travelManager.Party.Derpus, EntityStatTypes.CurrentEnergy, 10);

            foreach (var companion in travelManager.Party.GetCompanions())
            {
                optionTwoPenalty.AddEntityLoss(companion, EntityStatTypes.CurrentEnergy, 10);
            }

            Options.Add(optionTitle, new Option(optionTitle, optionResultText, null, optionTwoPenalty, EncounterType));

            SubscribeToOptionSelectedEvent();

            var eventMediator = Object.FindObjectOfType <EventMediator>();

            eventMediator.Broadcast(GlobalHelper.FourOptionEncounter, this);
        }
Esempio n. 20
0
        public override void Run()
        {
            var travelManager = Object.FindObjectOfType <TravelManager>();

            var chosenCompanion = travelManager.Party.GetRandomCompanion();

            Description = $"{chosenCompanion.FirstName()} gets cut pretty badly after challenging a crab to a knife fight.";

            Options = new Dictionary <string, Option>();

            var optionTitle = "Ignore it";

            var optionResultText = $"{chosenCompanion.FirstName()} insists that they don't need any help and proudly bleeds everywhere.";

            var optionOnePenalty = new Penalty();

            optionOnePenalty.AddEntityLoss(chosenCompanion, EntityStatTypes.CurrentHealth, 5);
            optionOnePenalty.AddEntityLoss(chosenCompanion, EntityAttributeTypes.Physique, 1);

            var optionOne = new Option(optionTitle, optionResultText, null, optionOnePenalty, EncounterType.Normal);

            Options.Add(optionTitle, optionOne);

            optionTitle = "Heal the wound";

            var medicalCompanion = travelManager.Party.GetCompanionWithHighestHealing();

            var healRoll = Dice.Roll($"{medicalCompanion.Skills.Healing - 1}d6");

            var wildRoll = GlobalHelper.RollWildDie();

            healRoll += wildRoll;

            const int healSuccess = 15;

            Reward  optionTwoReward = null;
            Penalty optionTwoPenalty;

            if (medicalCompanion.Skills.Healing > 5 || healRoll > healSuccess)
            {
                if (travelManager.Party.HealthPotions > 0)
                {
                    optionResultText =
                        $"{medicalCompanion.FirstName()} is able to treat the wound and it heals properly.";

                    optionTwoReward = new Reward();

                    optionTwoReward.AddEntityGain(medicalCompanion, EntitySkillTypes.Healing, 1);

                    optionTwoPenalty = new Penalty();

                    optionTwoPenalty.AddPartyLoss(PartySupplyTypes.HealthPotions, 1);
                }
                else
                {
                    optionResultText =
                        $"{medicalCompanion.FirstName()} does the best they can with no health potions. The wound ends up smelling funny later on.";

                    optionTwoPenalty = new Penalty();

                    optionTwoPenalty.AddEntityLoss(chosenCompanion, EntityStatTypes.CurrentMorale, 5);
                }
            }
            else
            {
                optionResultText =
                    $"{medicalCompanion.FirstName()} tries to help, but makes the wound much worse. The bleeding stops, but {chosenCompanion.FirstName()} feels weaker.";

                optionTwoPenalty = new Penalty();

                optionTwoPenalty.AddEntityLoss(chosenCompanion, EntityStatTypes.CurrentHealth, 5);
                optionTwoPenalty.AddEntityLoss(chosenCompanion, EntityAttributeTypes.Physique, 1);
            }

            var optionTwo = new Option(optionTitle, optionResultText, optionTwoReward, optionTwoPenalty,
                                       EncounterType.Normal);

            Options.Add(optionTitle, optionTwo);

            SubscribeToOptionSelectedEvent();

            var eventMediator = Object.FindObjectOfType <EventMediator>();

            eventMediator.Broadcast(GlobalHelper.FourOptionEncounter, this);
        }
Esempio n. 21
0
        public override void Run()
        {
            Description = @"The group gets irritated because one of the wagon's wheels is squeaking. Who should try to repair it?";

            Options = new Dictionary <string, Option>();

            var travelManager    = Object.FindObjectOfType <TravelManager>();
            var chosenCompanions = travelManager.Party.GetRandomCompanions(4);

            const int fixSuccess = 10;

            Reward  optionReward;
            Penalty optionPenalty;

            foreach (var chosenCompanion in chosenCompanions)
            {
                if (Options.ContainsKey(chosenCompanion.FirstName()))
                {
                    continue;
                }

                optionReward  = null;
                optionPenalty = null;

                var optionTitle = $"{chosenCompanion.FirstName()}";

                string optionResultText;

                var fixCheck = Dice.Roll($"{chosenCompanion.Attributes.Acumen - 1}d6");

                var wildRoll = GlobalHelper.RollWildDie();

                fixCheck += wildRoll;

                if (fixCheck > fixSuccess)
                {
                    optionResultText = "They figure out what was wrong and repair it!";

                    optionReward = new Reward();
                    optionReward.AddEntityGain(travelManager.Party.Derpus, EntityStatTypes.CurrentMorale, 10);

                    foreach (var companion in travelManager.Party.GetCompanions())
                    {
                        optionReward.AddEntityGain(companion, EntityStatTypes.CurrentMorale, 10);
                    }
                }
                else
                {
                    optionResultText = "They can't repair it and the squeaking continues to be annoying.";

                    optionPenalty = new Penalty();
                    optionPenalty.AddEntityLoss(travelManager.Party.Derpus, EntityStatTypes.CurrentMorale, 10);

                    foreach (var companion in travelManager.Party.GetCompanions())
                    {
                        optionPenalty.AddEntityLoss(companion, EntityStatTypes.CurrentMorale, 10);
                    }
                }

                var option = new Option(optionTitle, optionResultText, optionReward, optionPenalty, EncounterType);

                Options.Add(optionTitle, option);
            }

            SubscribeToOptionSelectedEvent();

            var eventMediator = Object.FindObjectOfType <EventMediator>();

            eventMediator.Broadcast(GlobalHelper.FourOptionEncounter, this);
        }
Esempio n. 22
0
        //todo refactor
        public override void Run()
        {
            var travelManager   = Object.FindObjectOfType <TravelManager>();
            var chosenCompanion = travelManager.Party.GetRandomCompanion();

            Description =
                $"While scouting a town, {chosenCompanion.Name} decides the caravan would not be welcome here. Before they can leave, a guard sees through their disguise! {chosenCompanion.FirstName()} is cornered in an alley with large crates and a tall fence.";

            Options = new Dictionary <string, Option>();

            var optionTitle = "Scale The Fence";

            string optionResultText;

            Reward  optionOneReward  = null;
            Penalty optionOnePenalty = null;

            const int scaleSuccess = 10;

            var agilityCheck = Dice.Roll($"{chosenCompanion.Attributes.Agility - 1}d6");

            var wildRoll = GlobalHelper.RollWildDie();

            agilityCheck += wildRoll;

            Debug.Log($"Value Needed: {scaleSuccess}");
            Debug.Log(
                $"Rolled: {agilityCheck - chosenCompanion.Attributes.Agility} + Agility: {chosenCompanion.Attributes.Agility} = Final Value {agilityCheck}");

            if (agilityCheck > scaleSuccess)
            {
                optionResultText = $"{chosenCompanion.FirstName()} runs up one of the crates and flips over the fence!";

                optionOneReward = new Reward();
                optionOneReward.AddEntityGain(chosenCompanion, EntityStatTypes.CurrentMorale, 30);
            }
            else if (agilityCheck == scaleSuccess)
            {
                optionResultText = $"{chosenCompanion.FirstName()} barely manages to escape over the fence unharmed!";
            }
            else
            {
                optionResultText =
                    $"{chosenCompanion.FirstName()} struggles to climb the fence. One of the guards deals a blow to his leg before he makes it over!";

                optionOnePenalty = new Penalty();
                optionOnePenalty.AddEntityLoss(chosenCompanion, EntityStatTypes.CurrentHealth, 15);
            }

            var optionOne = new Option(optionTitle, optionResultText, optionOneReward, optionOnePenalty, EncounterType);

            Options.Add(optionTitle, optionOne);

            optionTitle = "Throw Crates";

            Reward  optionTwoReward  = null;
            Penalty optionTwoPenalty = null;

            const int throwSuccess = 20;

            //todo diceroller here
            var physiqueCheck = chosenCompanion.Attributes.Physique + Random.Range(1, 21);

            Debug.Log($"Value Needed: {throwSuccess}");
            Debug.Log(
                $"Rolled: {physiqueCheck - chosenCompanion.Attributes.Physique} + Physique: {chosenCompanion.Attributes.Physique} = Final Value {physiqueCheck}");

            if (physiqueCheck >= throwSuccess)
            {
                optionResultText =
                    $"{chosenCompanion.FirstName()} knocks several guards to the ground with a well placed throw and escapes!";

                optionTwoReward = new Reward();
                optionTwoReward.AddEntityGain(chosenCompanion, EntityStatTypes.CurrentMorale, 30);
            }
            else
            {
                optionResultText =
                    $"{chosenCompanion.FirstName()} manages to hit a guard or two with the crates, but has to fight off the rest!";

                optionTwoPenalty = new Penalty();
                optionTwoPenalty.AddEntityLoss(chosenCompanion, EntityStatTypes.CurrentHealth, 30);
            }

            var optionTwo = new Option(optionTitle, optionResultText, optionTwoReward, optionTwoPenalty, EncounterType);

            Options.Add(optionTitle, optionTwo);

            SubscribeToOptionSelectedEvent();

            var eventMediator = Object.FindObjectOfType <EventMediator>();

            eventMediator.Broadcast(GlobalHelper.FourOptionEncounter, this);
        }
Esempio n. 23
0
        public override void Run()
        {
            Options = new Dictionary <string, Option>();

            var    optionTitle = "Help fix wagon";
            string optionResultText;

            Reward        optionReward  = null;
            Penalty       optionPenalty = null;
            EncounterType targetEncounterType;

            const int fixChance = 51;

            //todo diceroller
            var roll = Random.Range(1, 101);

            Debug.Log($"Fix Value Needed: {fixChance}");
            Debug.Log($"Rolled: {roll}");

            const int potionChance = 50;
            const int goldChance   = 30;

            if (roll < fixChance)
            {
                targetEncounterType = EncounterType;

                optionResultText = "No one here is a wagon expert, but the group puts their heads together and manages to get the wagon repaired enough to get into the next town! The man gives some supplies as a reward!";

                optionReward = new Reward();

                optionReward.AddPartyGain(PartySupplyTypes.Food, 10);

                //todo diceroller
                roll = Random.Range(1, 101);

                Debug.Log($"Potion Value Needed: {potionChance}");
                Debug.Log($"Rolled: {roll}");

                if (roll <= potionChance)
                {
                    optionReward.AddPartyGain(PartySupplyTypes.HealthPotions, 3);
                }

                //todo diceroller
                roll = Random.Range(1, 101);

                Debug.Log($"Potion Value Needed: {goldChance}");
                Debug.Log($"Rolled: {roll}");

                if (roll <= goldChance)
                {
                    optionReward.AddPartyGain(PartySupplyTypes.Gold, 40);
                }
            }
            else if (roll == fixChance)
            {
                targetEncounterType = EncounterType.Camping;

                optionResultText = "Try as they might, no one can figure out how to fix the wagon. It's sundown by the time the group calls it quits so they make camp.";
            }
            else
            {
                targetEncounterType = EncounterType.Camping;

                optionResultText = "No one has a clue how to help and they spend most of the day arguing. It's sundown by the time the group calls it quits so they make camp.";

                optionPenalty = new Penalty();

                var travelManager = Object.FindObjectOfType <TravelManager>();

                optionPenalty.AddEntityLoss(travelManager.Party.Derpus, EntityStatTypes.CurrentMorale, 10);

                foreach (var companion in travelManager.Party.GetCompanions())
                {
                    optionPenalty.AddEntityLoss(companion, EntityStatTypes.CurrentMorale, 10);
                }
            }

            var optionOne = new Option(optionTitle, optionResultText, optionReward, optionPenalty, targetEncounterType);

            Options.Add(optionTitle, optionOne);

            optionTitle      = "Rob him";
            optionResultText = "Unarmed and outnumbered, the man gives up his supplies and sits helpless by the wagon as the group vanishes over the horizon.";

            //todo entity penalty for companions with "good guy" traits
            //todo entity reward for companions with "bad guy" traits

            optionReward = new Reward();

            optionReward.AddPartyGain(PartySupplyTypes.Food, 7);

            //todo diceroller
            roll = Random.Range(1, 101);

            Debug.Log($"Potion Value Needed: {potionChance}");
            Debug.Log($"Rolled: {roll}");

            if (roll <= potionChance)
            {
                optionReward.AddPartyGain(PartySupplyTypes.HealthPotions, 9);
            }

            //todo diceroller
            roll = Random.Range(1, 101);

            Debug.Log($"Potion Value Needed: {goldChance}");
            Debug.Log($"Rolled: {roll}");

            if (roll <= goldChance)
            {
                optionReward.AddPartyGain(PartySupplyTypes.Gold, 40);
            }

            var optionTwo = new Option(optionTitle, optionResultText, optionReward, null, EncounterType.Normal);

            Options.Add(optionTitle, optionTwo);

            optionTitle = "Pass'm by";

            var optionThree = new Option(optionTitle, "The man sits helpless by the wagon as the group vanishes over the horizon.", EncounterType.Normal);

            Options.Add(optionTitle, optionThree);

            SubscribeToOptionSelectedEvent();

            var eventMediator = Object.FindObjectOfType <EventMediator>();

            eventMediator.Broadcast(GlobalHelper.FourOptionEncounter, this);
        }
Esempio n. 24
0
        public override void Run()
        {
            var travelManager = Object.FindObjectOfType <TravelManager>();

            var chosenCompanion = travelManager.Party.GetRandomCompanion();

            Description =
                $"The group finds an abandoned archery range with a surprising amount of arrows and even a few bows. The sun sets and they decide to camp here for the night. \n\n{chosenCompanion.FirstName()} looks outside and notices a horde of giant spiders headed straight towards the range!";

            Options = new Dictionary <string, Option>();

            var optionTitle = "Shoot arrows at the spiders";

            string optionResultText;

            var party = travelManager.Party;

            var partyEndurance = party.GetTotalPartyEndurance();
            var partyPhysique  = party.GetTotalPartyPhysique();

            Reward  optionOneReward  = null;
            Penalty optionOnePenalty = null;

            if (partyEndurance < 8)
            {
                optionResultText =
                    "Shooting arrows uses a lot of energy. The group gets tired and the spiders overrun the range.";

                optionOnePenalty = new Penalty();

                foreach (var companion in party.GetCompanions())
                {
                    optionOnePenalty.AddEntityLoss(companion, EntityStatTypes.CurrentHealth, 5);
                }
            }
            else if (partyPhysique < 8)
            {
                optionResultText =
                    "They send arrows raining into the spiders, but they lack the strength to fire the arrows effectively. A few spiders are injured, but the group ends up having to fight them hand to hand.";

                optionOnePenalty = new Penalty();

                optionOnePenalty.AddEntityLoss(party.GetRandomCompanion(), EntityStatTypes.CurrentHealth, 5);

                if (party.GetCompanions().Count > 1)
                {
                    optionOnePenalty.AddEntityLoss(party.GetRandomCompanion(), EntityStatTypes.CurrentHealth, 5);
                }
            }
            else
            {
                optionResultText =
                    "Spider after spider falls dead as arrows slam into them from afar. They were barely a threat!";

                optionOneReward = new Reward();

                optionOneReward.AddEntityGain(party.Derpus, EntityStatTypes.CurrentMorale, 5);

                foreach (var companion in party.GetCompanions())
                {
                    optionOneReward.AddEntityGain(companion, EntityStatTypes.CurrentMorale, 5);
                }

                optionOneReward.AddEntityGain(party.GetCompanionWithLowestEndurance(), EntitySkillTypes.Endurance, 1);
            }

            var optionOne = new Option(optionTitle, optionResultText, optionOneReward, optionOnePenalty,
                                       EncounterType.Camping);

            Options.Add(optionTitle, optionOne);

            optionTitle = "Escape!";

            optionResultText = "The party makes a run for it and doesn't stop til sun up.";

            var optionTwoPenalty = new Penalty();

            optionTwoPenalty.AddEntityLoss(party.Derpus, EntityStatTypes.CurrentEnergy, 10);

            foreach (var companion in party.GetCompanions())
            {
                optionTwoPenalty.AddEntityLoss(companion, EntityStatTypes.CurrentEnergy, 10);
            }

            var optionTwo = new Option(optionTitle, optionResultText, null, optionTwoPenalty, EncounterType.Camping);

            Options.Add(optionTitle, optionTwo);

            SubscribeToOptionSelectedEvent();

            var eventMediator = Object.FindObjectOfType <EventMediator>();

            eventMediator.Broadcast(GlobalHelper.FourOptionEncounter, this);
        }