Beispiel #1
0
        public override void Run()
        {
            var travelManager = Object.FindObjectOfType<TravelManager>();

            var gold = travelManager.Party.Gold;

            const int pastryCost = 30;

            const int foodGain = 9;

            Reward = new Reward();
            Penalty = new Penalty();

            var fatty = travelManager.Party.GetRandomCompanion();

            Description = $"The party decides to camp outside of a small village. {fatty.FirstName()} disappears for awhile to check things out. When they return, they're carrying an armful of pastries. ";

            if (gold <= 0)
            {
                Description += $"\n\nThey found them in a basket with no one around to claim them!";
            }
            else if (gold <= pastryCost)
            {
                Description += $"\n\nThey spent the rest of the gold!";

                Reward.AddPartyGain(PartySupplyTypes.Food, foodGain - 2);

                Penalty.AddPartyLoss(PartySupplyTypes.Gold, gold);
            }
            else
            {
                Description += $"\n\nThey spent {pastryCost} gold!";

                Reward.AddPartyGain(PartySupplyTypes.Food, foodGain);

                Penalty.AddPartyLoss(PartySupplyTypes.Gold, pastryCost);
            }

            Description += $"\n\nThe pastries are pretty good though and there are plenty leftover after everyone stuffs their faces!";

            Reward.EveryoneGain(travelManager.Party, EntityStatTypes.CurrentEnergy, 10);
            Reward.EveryoneGain(travelManager.Party, EntityStatTypes.CurrentMorale, 5);

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

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

            var eventMediator = Object.FindObjectOfType<EventMediator>();
            eventMediator.Broadcast(GlobalHelper.EncounterResult, this, fullResultDescription);
        }
Beispiel #2
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);
        }
Beispiel #3
0
        public override void Run()
        {
            Options = new Dictionary <string, Option>();

            var optionTitle = "Open it";

            var optionResultText = "Derpus snatches it up and takes a look inside. There's a lot of junk, but there were a couple health potions in there!";

            var optionOneReward = new Reward();

            optionOneReward.AddPartyGain(PartySupplyTypes.HealthPotions, 3);

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

            Options.Add(optionTitle, optionOne);

            optionTitle = "Carefully go around it";

            optionResultText = "Everyone gives the sack a wide berth and leaves it behind untouched.";

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

            Options.Add(optionTitle, optionTwo);

            SubscribeToOptionSelectedEvent();

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

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

            string  optionTitle;
            string  optionResultText;
            Reward  optionReward  = null;
            Penalty optionPenalty = null;

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

            if (travelManager.Party.Gold >= BetAmount)
            {
                var bestArm = travelManager.Party.GetCompanionWithHighestRangedSkill();

                optionTitle      = $"{bestArm.Name} takes the bet";
                optionResultText = $"\"Best two out of three?\" says {bestArm.FirstName()}. \n\n";

                var opponentRoll = Dice.Roll("2d6");

                var companionRoll = Dice.Roll($"{bestArm.Skills.Ranged}d6");

                if (companionRoll >= opponentRoll)
                {
                    optionResultText += $"{bestArm.FirstName()} crushes the challenger. Easy money!";

                    optionReward = new Reward();
                    optionReward.AddPartyGain(PartySupplyTypes.Gold, BetAmount);
                }
                else
                {
                    optionResultText += $"{bestArm.FirstName()} tries his best, but can't quite beat the young man's skipping ability.";

                    optionPenalty = new Penalty();
                    optionPenalty.AddPartyLoss(PartySupplyTypes.Gold, BetAmount);
                }

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

                Options.Add(optionTitle, optionOne);
            }

            optionTitle      = "Keep moving";
            optionResultText = "The group starts moving again down the trail. \n\n \"HA! Yee that's what I thought! Don't stand a chance against me!\"";

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

            Options.Add(optionTitle, optionTwo);

            SubscribeToOptionSelectedEvent();

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

            eventMediator.Broadcast(GlobalHelper.FourOptionEncounter, this);
        }
Beispiel #5
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);
        }
Beispiel #6
0
        public override void Run()
        {
            var travelManager   = Object.FindObjectOfType <TravelManager>();
            var chosenCompanion = travelManager.Party.GetRandomCompanion();

            Description =
                $"While taking a whizz {chosenCompanion.Name} notices a black bottle sticking out from under a bush. They pick it up and inspect it, but they can't quite make out the contents. Curiosity gets the best of {chosenCompanion.FirstName()} and they open the bottle. Black smoke erupts from the bottle and forms into a genie! \n\nMAKE A WISH!";

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

            var optionTitle      = "I want to feast tonight!";
            var optionResultText =
                $"The genie snaps his fingers and {chosenCompanion.FirstName()}'s arms are overflowing with delicious food!";

            var reward = new Reward();

            var foodGained = Random.Range(15, 21);

            reward.AddPartyGain(PartySupplyTypes.Food, foodGained);

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

            Options.Add(optionTitle, optionOne);

            optionTitle      = "Good health!";
            optionResultText = $"{chosenCompanion.FirstName()}'s wounds are completely healed! They feel like a million bucks!";

            reward = new Reward();

            reward.AddEntityGain(chosenCompanion, EntityStatTypes.CurrentHealth, chosenCompanion.Stats.MaxHealth);
            reward.AddEntityGain(chosenCompanion, EntityStatTypes.CurrentEnergy, chosenCompanion.Stats.MaxEnergy);

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

            Options.Add(optionTitle, optionTwo);

            optionTitle      = "MAKE IT RAIN";
            optionResultText = $"The genie disappears in a flash! Gold coins rain down upon {chosenCompanion.FirstName()}'s skull much to their delight!";

            var goldAmount = Random.Range(20, 81);

            reward = new Reward();

            reward.AddPartyGain(PartySupplyTypes.Gold, goldAmount);

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

            Options.Add(optionTitle, optionThree);

            SubscribeToOptionSelectedEvent();

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

            eventMediator.Broadcast(GlobalHelper.FourOptionEncounter, this);
        }
Beispiel #7
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);
        }
Beispiel #8
0
        public override void Run()
        {
            Reward = new Reward();

            Reward.AddPartyGain(PartySupplyTypes.Gold, 80);
            Reward.AddPartyGain(PartySupplyTypes.Food, 9);
            Reward.EveryoneGain(Party, EntityStatTypes.CurrentMorale, 20);

            //todo Derpus is wearing a lei for the rest of the adventure

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

            travelManager.ApplyEncounterReward(Reward);

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

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

            eventMediator.Broadcast(GlobalHelper.EncounterResult, this, fullResultDescription);
        }
Beispiel #9
0
        public override void Run()
        {
            Reward = new Reward();

            Reward.AddPartyGain(PartySupplyTypes.Food, Party.Size * FoodPerPerson);
            Reward.EveryoneGain(Party, EntityStatTypes.CurrentMorale, 15);

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

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

            travelManager.ApplyEncounterReward(Reward);

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

            eventMediator.Broadcast(GlobalHelper.EncounterResult, this, fullResultDescription);
        }
Beispiel #10
0
        public SweetrollRobbery()
        {
            Rarity          = Rarity.Common;
            EncounterType   = EncounterType.Normal;
            Title           = "Sweetroll Robbery";
            Description     = "The group finds an overturned wagon on the side of the trail. It's unclear what happened here, but the group manages to find some baked goods!";
            ImageResultName = "crashed wagon";

            Reward = new Reward();

            Reward.AddPartyGain(PartySupplyTypes.Food, 8);

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

            //todo need a method for giving entire party the same reward or penalty
            Reward.AddEntityGain(travelManager.Party.Derpus, EntityStatTypes.CurrentMorale, 10);

            foreach (var companion in travelManager.Party.GetCompanions())
            {
                Reward.AddEntityGain(companion, EntityStatTypes.CurrentMorale, 10);
            }
        }
Beispiel #11
0
        public override void Run()
        {
            var fisher = Party.GetRandomCompanion();

            Description = $"The trail follows along side a small river and {fisher.FirstName()} thinks they can catch some fish to fry up later. They wade out a bit and manage to catch a few fish by hand!";

            Reward = new Reward();

            Reward.AddPartyGain(PartySupplyTypes.Food, 5);

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

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

            travelManager.ApplyEncounterReward(Reward);

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

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

            string optionTitle;
            string optionResultText = "\"Pleasure doing business with you!\"";

            var itemStore = Object.FindObjectOfType <ItemStore>();

            var weapon = itemStore.GetRandomEquipableItem(EquipLocation.Weapon);

            if (Party.Gold >= weapon.GetPrice())
            {
                optionTitle = $"{weapon.GetDisplayName()} ({weapon.GetPrice()})";

                var weaponReward = new Reward();

                weaponReward.AddToInventory(weapon);

                var weaponPenalty = new Penalty();

                weaponPenalty.AddPartyLoss(PartySupplyTypes.Gold, weapon.GetPrice());

                var weaponOption = new Option(optionTitle, optionResultText, weaponReward, weaponPenalty,
                                              EncounterType.Normal);

                Options.Add(optionTitle, weaponOption);
            }

            var slot = GlobalHelper.GetRandomEnumValue <EquipLocation>();

            while (slot == EquipLocation.Weapon || slot == EquipLocation.Book)
            {
                slot = GlobalHelper.GetRandomEnumValue <EquipLocation>();
            }

            var armor = itemStore.GetRandomEquipableItem(slot);

            if (Party.Gold >= armor.GetPrice())
            {
                optionTitle = $"{armor.GetDisplayName()} ({armor.GetPrice()})";

                var armorReward = new Reward();

                armorReward.AddToInventory(armor);

                var armorPenalty = new Penalty();

                armorPenalty.AddPartyLoss(PartySupplyTypes.Gold, armor.GetPrice());

                var armorOption = new Option(optionTitle, optionResultText, armorReward, armorPenalty,
                                             EncounterType.Normal);

                Options.Add(optionTitle, armorOption);
            }

            const int supplyCost = 30;

            if (Party.Gold >= supplyCost)
            {
                optionTitle = $"Some supplies {supplyCost}";

                var supplyReward = new Reward();

                supplyReward.AddPartyGain(PartySupplyTypes.Food, 5);
                supplyReward.AddPartyGain(PartySupplyTypes.HealthPotions, 1);

                var supplyPenalty = new Penalty();

                supplyPenalty.AddPartyLoss(PartySupplyTypes.Gold, supplyCost);

                var supplyOption = new Option(optionTitle, optionResultText, supplyReward, supplyPenalty,
                                              EncounterType.Normal);

                Options.Add(optionTitle, supplyOption);
            }

            optionTitle = "Nothing";

            optionResultText = "You continue down the trail.";

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

            Options.Add(optionTitle, nothingOption);

            SubscribeToOptionSelectedEvent();

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

            eventMediator.Broadcast(GlobalHelper.FourOptionEncounter, this);
        }
Beispiel #13
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);
        }
Beispiel #14
0
        public override void Run()  //todo possible continuity
        {
            var chosen = Party.GetRandomCompanion();

            Description =
                $"The party is setting up camp when a group of traveling lizardmen approach. They would like to {chosen.FirstName()} as food.\n\nThey offer 125 gold!";

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

            var optionTitle = "Agree for 125 gold";

            var optionResultText = $"You turn {chosen.Name} over to the lizardmen. Your companions are horrified!";

            var optionOnePenalty = new Penalty();

            optionOnePenalty.RemoveFromParty(chosen);

            optionOnePenalty.EveryoneLoss(Party, EntityStatTypes.CurrentMorale, 15);

            var optionOneReward = new Reward();

            optionOneReward.AddPartyGain(PartySupplyTypes.Gold, 125);

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

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

            Options.Add(optionTitle, optionOne);

            optionTitle = "Counter with 200 gold";

            const int success = 33;

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

            var optionTwoPenalty = new Penalty();

            var optionTwoReward = new Reward();

            if (roll <= success)
            {
                optionResultText = $"They discuss the price briefly and agree. You turn {chosen.Name} over to the lizardmen. Your companions are horrified!";

                optionTwoPenalty.RemoveFromParty(chosen);

                optionTwoPenalty.EveryoneLoss(Party, EntityStatTypes.CurrentMorale, 15);

                optionTwoReward.AddPartyGain(PartySupplyTypes.Gold, 200);

                optionTwoReward.EveryoneGain(Party, EntityStatTypes.CurrentEnergy, 10);
            }
            else
            {
                optionResultText = $"They decline and continue on their way hungry and disappointed. Your companions are horrified! {chosen.FirstName()} is especially angry that you tried to sell them like a piece of beef!";

                var chosenMorale = chosen.Stats.CurrentMorale;

                if (chosenMorale - 20 < 0)
                {
                    optionResultText += "They stomp off and don't come back!";

                    optionTwoPenalty.RemoveFromParty(chosen);
                }

                optionTwoPenalty.EveryoneLoss(Party, EntityStatTypes.CurrentMorale, 15);

                optionTwoReward.EveryoneGain(Party, EntityStatTypes.CurrentEnergy, 10);
            }

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

            Options.Add(optionTitle, optionTwo);

            optionTitle = "Uhh no";

            optionResultText = $"The lizardmen continue on their way hungry and disappointed. {chosen.FirstName()} is looking themselves up and down trying to figure out why they were picked. They can't decide if they should be worried or flattered.";

            var optionThreeReward = new Reward();

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

            var optionThree = new Option(optionTitle, optionResultText, optionThreeReward, null, EncounterType.Camping);

            Options.Add(optionTitle, optionThree);

            SubscribeToOptionSelectedEvent();

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

            eventMediator.Broadcast(GlobalHelper.FourOptionEncounter, this);
        }
Beispiel #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);
        }
Beispiel #16
0
        public override void Run()
        {
            var entityStore = Object.FindObjectOfType <EntityPrefabStore>();

            var trappedFella = entityStore.GetRandomCompanion();

            var eClass = GlobalHelper.GetEnumDescription(trappedFella.EntityClass).ToLower();

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

            Description =
                $"While scouting a potential campsite, the party finds a {eClass} trapped under a fallen tree. Evidently, woodcutting is not their strong suit. A bag of supplies rests on the ground just out of the {eClass}'s reach. \n\n\"A little help?\"";

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

            var    optionTitle = $"Rescue the {eClass}";
            string optionResultText;

            Reward optionOneReward;

            const int joinChance = 16;

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

            if (!travelManager.Party.IsFull() && joinRoll <= joinChance)
            {
                optionResultText =
                    $"Everyone helps lift the tree so the {eClass} can escape. They spring to their feet and shake everyone's hand! \n\n\"I owe you a life debt! Name's {trappedFella.Name}! I'm comin' with!\"";

                optionOneReward = new Reward();

                optionOneReward.AddToParty(trappedFella);

                optionOneReward.AddPartyGain(PartySupplyTypes.HealthPotions, Random.Range(2, 5));
                optionOneReward.AddPartyGain(PartySupplyTypes.Food, Random.Range(1, 7));
                optionOneReward.AddPartyGain(PartySupplyTypes.Gold, Random.Range(5, 16));
            }
            else
            {
                optionResultText =
                    $"Everyone helps lift the tree so the {eClass} can escape. They're not able to give us a reward, but they promise to pay it forward.";

                optionOneReward = new Reward();

                optionOneReward.EveryoneGain(travelManager.Party, EntityStatTypes.CurrentMorale, 5);
            }

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

            Options.Add(optionTitle, optionOne);

            optionTitle = "Steal his supplies";

            var chosen = travelManager.Party.GetRandomCompanion();

            optionResultText = $"{chosen.FirstName()} grabs the bag of supplies and leaves the {eClass} to their fate.";

            var optionTwoReward = new Reward();

            optionTwoReward.AddPartyGain(PartySupplyTypes.HealthPotions, Random.Range(2, 5));
            optionTwoReward.AddPartyGain(PartySupplyTypes.Food, Random.Range(1, 7));
            optionTwoReward.AddPartyGain(PartySupplyTypes.Gold, Random.Range(5, 16));

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

            Options.Add(optionTitle, optionTwo);

            SubscribeToOptionSelectedEvent();

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

            eventMediator.Broadcast(GlobalHelper.FourOptionEncounter, this);
        }
Beispiel #17
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);
        }
Beispiel #18
0
        public override void Run()
        {
            Options = new Dictionary <string, Option>();

            var optionTitle = "Scavenge for supplies (free)";

            var optionResultText = "Everyone splits up and scrounges up what they can from the streets and alleys.";

            var optionReward = new Reward();

            var foodGained = Random.Range(4, 9);

            optionReward.AddPartyGain(PartySupplyTypes.Food, foodGained);

            const int potionChance = 50;

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

            int potionsGained;

            if (roll <= potionChance)
            {
                potionsGained = Random.Range(1, 6);

                optionReward.AddPartyGain(PartySupplyTypes.HealthPotions, potionsGained);
            }

            const int goldChance = 30;

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

            if (roll <= goldChance)
            {
                var goldGained = Random.Range(20, 41);

                optionReward.AddPartyGain(PartySupplyTypes.Gold, goldGained);
            }

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

            Options.Add(optionTitle, optionOne);

            var supplyCost = Random.Range(25, 81);

            optionTitle      = $"Buy supplies ({supplyCost} gold)";
            optionResultText = "A local shopkeeper is happy to do business.";

            optionReward = new Reward();

            foodGained *= 2;

            optionReward.AddPartyGain(PartySupplyTypes.Food, foodGained);

            potionsGained = Random.Range(2, 12);

            optionReward.AddPartyGain(PartySupplyTypes.HealthPotions, potionsGained);

            var optionPenalty = new Penalty();

            optionPenalty.AddPartyLoss(PartySupplyTypes.Gold, supplyCost);

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

            Options.Add(optionTitle, optionTwo);

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

            var restCost = travelManager.Party.GetCompanions().Count * 10;

            if (travelManager.Party.Gold >= restCost)
            {
                optionTitle      = $"Rest for a day ({restCost} gold)";
                optionResultText = $"The party stays at the local inn and gets some good shut-eye.";

                optionReward = new Reward();

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

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

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

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

                optionPenalty = new Penalty();

                optionPenalty.AddPartyLoss(PartySupplyTypes.Gold, restCost);

                EncounterType = EncounterType.Camping;

                CountsAsDayTraveled = false;

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

                Options.Add(optionTitle, optionThree);
            }

            SubscribeToOptionSelectedEvent();

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

            eventMediator.Broadcast(GlobalHelper.FourOptionEncounter, this);
        }
Beispiel #19
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);
        }
Beispiel #20
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);
        }