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); }
public override void Run() { var numBandits = Random.Range(MinBandits, MaxBandits + 1); Description = $"{numBandits} bandits have blocked the trail. Their leader steps forward and demands that you turn over all your supplies."; var bandits = new List <Entity>(); for (var i = 0; i < numBandits; i++) { var banditIndex = Dice.Roll("1d2"); Entity bandit; if (banditIndex == 1) { bandit = new ManAtArms(Race.RaceType.Human, false); } else { bandit = new Crossbowman(Race.RaceType.Human, false); } bandits.Add(bandit); } Options = new Dictionary <string, Option>(); var optionTitle = "Give up the supplies."; string optionResultText = "The group stands aside and watches as the bandits make off with their supplies."; var optionOnePenalty = new Penalty(); var travelManager = Object.FindObjectOfType <TravelManager>(); optionOnePenalty.AddPartyLoss(PartySupplyTypes.Gold, travelManager.Party.Gold); optionOnePenalty.AddPartyLoss(PartySupplyTypes.HealthPotions, travelManager.Party.HealthPotions); optionOnePenalty.AddPartyLoss(PartySupplyTypes.Food, travelManager.Party.Food); var optionOne = new Option(optionTitle, optionResultText, null, optionOnePenalty, EncounterType.Normal); Options.Add(optionTitle, optionOne); optionTitle = "Fight!"; optionResultText = "Those supplies are essential to the group's survival. They must fight!"; var fightOption = new FightCombatOption(optionTitle, optionResultText, bandits); Options.Add(optionTitle, fightOption); SubscribeToOptionSelectedEvent(); var eventMediator = Object.FindObjectOfType <EventMediator>(); eventMediator.Broadcast(GlobalHelper.FourOptionEncounter, this); }
public override void Run() { var numBandits = Random.Range(MinZombies, MaxZombies + 1); var travelManager = Object.FindObjectOfType <TravelManager>(); var chosenCompanion = travelManager.Party.GetRandomCompanion(); Description = $"The party is passing through a particularly dark part of the trail. {chosenCompanion.FirstName()} is nervously snapping their gaze side to side when they notice several figures lumbering towards them! The wagon is surrounded by zombies!"; var zombies = new List <Entity>(); for (var i = 0; i < numBandits; i++) { zombies.Add(new Zombie()); } Options = new Dictionary <string, Option>(); var optionTitle = "Retreat"; string optionResultText; const int retreatSuccessValue = 47; var retreatCheck = Dice.Roll("1d100"); var retreatSuccess = retreatCheck <= retreatSuccessValue; if (retreatSuccess) { optionResultText = "You manage to evade the undead attackers and escape safely."; } else { optionResultText = "You try to get away, but the attackers are too fast! Prepare for battle!"; } var retreatOption = new RetreatCombatOption(optionTitle, optionResultText, zombies, retreatSuccess); Options.Add(optionTitle, retreatOption); optionTitle = "To arms!"; optionResultText = "Prepare for battle..."; var fightOption = new FightCombatOption(optionTitle, optionResultText, zombies); Options.Add(optionTitle, fightOption); SubscribeToOptionSelectedEvent(); var eventMediator = Object.FindObjectOfType <EventMediator>(); eventMediator.Broadcast(GlobalHelper.FourOptionEncounter, this); }
public override void Run() { var numBandits = Random.Range(MinBandits, MaxBandits + 1); Description = $"{numBandits} bandits have blocked the trail with their weapons drawn!"; var bandits = new List <Entity>(); for (var i = 0; i < numBandits; i++) { var banditIndex = Dice.Roll("1d2"); Entity bandit; if (banditIndex == 1) { bandit = new ManAtArms(Race.RaceType.Human, false); } else { bandit = new Crossbowman(Race.RaceType.Human, false); } bandits.Add(bandit); } Options = new Dictionary <string, Option>(); var optionTitle = "Retreat"; string optionResultText; const int retreatSuccessValue = 47; var retreatCheck = Dice.Roll("1d100"); var retreatSuccess = retreatCheck <= retreatSuccessValue; Debug.Log($"Value Needed: {retreatSuccessValue}"); Debug.Log($"Rolled: {retreatCheck}"); if (retreatSuccess) { optionResultText = "They manage to evade the attackers and escape safely."; } else { optionResultText = "They try to get away, but the attackers are too fast! Prepare for battle!"; } var retreatOption = new RetreatCombatOption(optionTitle, optionResultText, bandits, retreatSuccess); Options.Add(optionTitle, retreatOption); optionTitle = "To arms!"; optionResultText = "Prepare for battle..."; var fightOption = new FightCombatOption(optionTitle, optionResultText, bandits); Options.Add(optionTitle, fightOption); SubscribeToOptionSelectedEvent(); var eventMediator = Object.FindObjectOfType <EventMediator>(); eventMediator.Broadcast(GlobalHelper.FourOptionEncounter, this); }
public override void Run() { var numBandits = Random.Range(MinBandits, MaxBandits + 1); Description = $"{numBandits} bandits have blocked the trail. "; const int foodThreshold = 6; Description += "Their leader steps forward and shakily demands that you turn over "; Penalty = new Penalty(); if (Party.Food > foodThreshold && Party.Gold > 4 && Party.HealthPotions > 4) { var numGold = Party.Gold / 4; Description += $"{numGold} gold, "; var numPotions = Party.HealthPotions / 4; Description += $"{numPotions} potion"; if (numPotions > 1) { Description += $"s"; } Description += ", "; Description += "and the rest of your food!"; Penalty.AddPartyLoss(PartySupplyTypes.Gold, Party.Gold / 4); Penalty.AddPartyLoss(PartySupplyTypes.HealthPotions, Party.HealthPotions / 4); Penalty.AddPartyLoss(PartySupplyTypes.Food, Party.Food); } else { Description += "half of all your supplies!"; if (Party.Gold > 1) { Penalty.AddPartyLoss(PartySupplyTypes.Gold, Party.Gold / 2); } if (Party.HealthPotions > 1) { Penalty.AddPartyLoss(PartySupplyTypes.HealthPotions, Party.HealthPotions / 2); } if (Party.Food > 1) { Penalty.AddPartyLoss(PartySupplyTypes.Food, Party.Food / 2); } } var bandits = new List <Entity>(); for (var i = 0; i < numBandits; i++) { var banditIndex = Dice.Roll("1d2"); Entity bandit; if (banditIndex == 1) { bandit = new ManAtArms(Race.RaceType.Human, false); } else { bandit = new Crossbowman(Race.RaceType.Human, false); } bandits.Add(bandit); } Options = new Dictionary <string, Option>(); var optionTitle = "Give up the supplies."; string optionResultText = "The group stands aside and watches as the bandits make off with their supplies."; var optionOnePenalty = Penalty; Penalty = null; var optionOne = new Option(optionTitle, optionResultText, null, optionOnePenalty, EncounterType.Normal); Options.Add(optionTitle, optionOne); optionTitle = "Fight!"; optionResultText = "Those supplies are essential to the group's survival. They must fight!"; var fightOption = new FightCombatOption(optionTitle, optionResultText, bandits); Options.Add(optionTitle, fightOption); SubscribeToOptionSelectedEvent(); var eventMediator = Object.FindObjectOfType <EventMediator>(); eventMediator.Broadcast(GlobalHelper.FourOptionEncounter, this); }