private bool DoExecute(IncidentParms parms, List<Pawn> generatedEnemies, IntVec3 existingMapEdgeCell)
		{
			Map map = parms.target as Map;
			bool flag = false;
			if (map == null)
			{
				map = CaravanIncidentUtility.SetupCaravanAttackMap((Caravan)parms.target, generatedEnemies, false);
				flag = true;
			}
			else
			{
				for (int i = 0; i < generatedEnemies.Count; i++)
				{
					IntVec3 loc = CellFinder.RandomSpawnCellForPawnNear(existingMapEdgeCell, map, 4);
					GenSpawn.Spawn(generatedEnemies[i], loc, map, Rot4.Random, WipeMode.Vanish, false);
				}
			}
			this.PostProcessGeneratedPawnsAfterSpawning(generatedEnemies);
			LordJob lordJob = this.CreateLordJob(generatedEnemies, parms);
			if (lordJob != null)
			{
				LordMaker.MakeNewLord(parms.faction, lordJob, map, generatedEnemies);
			}
			string letterLabel = this.GetLetterLabel(generatedEnemies[0], parms);
			string letterText = this.GetLetterText(generatedEnemies[0], parms);
			PawnRelationUtility.Notify_PawnsSeenByPlayer_Letter(generatedEnemies, ref letterLabel, ref letterText, this.GetRelatedPawnsInfoLetterText(parms), true, true);
			Find.LetterStack.ReceiveLetter(letterLabel, letterText, this.GetLetterDef(generatedEnemies[0], parms), generatedEnemies[0], parms.faction, null);
			if (flag)
			{
				Find.TickManager.CurTimeSpeed = TimeSpeed.Paused;
			}
			return true;
		}
Ejemplo n.º 2
0
 private void Outcome_Disaster(Caravan caravan)
 {
     LongEventHandler.QueueLongEvent(delegate
     {
         int randomInRange = WorldObject_ResearchRequestLGE.DisasterFactionRelationOffset.RandomInRange;
         this.Faction.TryAffectGoodwillWith(Faction.OfPlayer, randomInRange, false, false, null, null);
         if (!this.Faction.HostileTo(Faction.OfPlayer))
         {
             this.Faction.TrySetRelationKind(Faction.OfPlayer, FactionRelationKind.Hostile, false, null, null);
         }
         IncidentParms incidentParms = StorytellerUtility.DefaultParmsNow(IncidentCategoryDefOf.ThreatBig, caravan);
         incidentParms.faction       = this.Faction;
         PawnGroupMakerParms defaultPawnGroupMakerParms  = IncidentParmsUtility.GetDefaultPawnGroupMakerParms(PawnGroupKindDefOf.Combat, incidentParms, true);
         defaultPawnGroupMakerParms.generateFightersOnly = true;
         List <Pawn> list = PawnGroupMakerUtility.GeneratePawns(defaultPawnGroupMakerParms, true).ToList <Pawn>();
         Map map          = CaravanIncidentUtility.SetupCaravanAttackMap(caravan, list, false);
         if (list.Any <Pawn>())
         {
             LordMaker.MakeNewLord(incidentParms.faction, new LordJob_AssaultColony(this.Faction, true, true, false, false, true), map, list);
         }
         Find.TickManager.CurTimeSpeed = TimeSpeed.Paused;
         GlobalTargetInfo lookTarget   = (!list.Any <Pawn>()) ? GlobalTargetInfo.Invalid : new GlobalTargetInfo(list[0].Position, map, false);
         Find.LetterStack.ReceiveLetter("LetterLabelResearchRequest_DisasterLGE".Translate(), this.GetLetterText("LetterResearchRequest_DisasterLGE".Translate(this.Faction.def.pawnsPlural.CapitalizeFirst(),
                                                                                                                                                               this.Faction.Name,
                                                                                                                                                               Mathf.RoundToInt(randomInRange)), caravan), LetterDefOf.ThreatBig, lookTarget, null);
     }, "GeneratingMapForNewEncounter", false, null);
 }
Ejemplo n.º 3
0
 protected void CaravanAmbushManhuntersNoTreasure(Caravan caravan)
 {
     LongEventHandler.QueueLongEvent(delegate
     {
         IncidentParms incidentParms = StorytellerUtility.DefaultParmsNow(IncidentCategoryDefOf.ThreatBig, caravan);
         //make sure a minimum point threshold is hit
         if (incidentParms.points < MinimumPointThreshold)
         {
             incidentParms.points = MinimumPointThreshold;
         }
         PawnKindDef animalKind;
         if (!ManhunterPackIncidentUtility.TryFindManhunterAnimalKind(this.AdjustedPoints(incidentParms.points), incidentParms.target.Tile, out animalKind) && !ManhunterPackIncidentUtility.TryFindManhunterAnimalKind(this.AdjustedPoints(incidentParms.points), -1, out animalKind))
         {
             Log.Warning("Could not find any valid animal kind for " + this.def + " incident. Going with Wargs", false);
             animalKind = ThingDefOfVanilla.Warg;
         }
         List <Pawn> list = ManhunterPackIncidentUtility.GenerateAnimals(animalKind, incidentParms.target.Tile, this.AdjustedPoints(incidentParms.points));
         Map map          = CaravanIncidentUtility.SetupCaravanAttackMap(caravan, list, false);
         for (int i = 0; i < list.Count; i++)
         {
             list[i].mindState.mentalStateHandler.TryStartMentalState(MentalStateDefOf.ManhunterPermanent, null, false, false, null, false);
         }
         Find.TickManager.CurTimeSpeed = TimeSpeed.Paused;
         GlobalTargetInfo lookTarget   = (!list.Any <Pawn>()) ? GlobalTargetInfo.Invalid : new GlobalTargetInfo(list[0].Position, map, false);
         Find.LetterStack.ReceiveLetter("LetterLabelIMAmbushLGE".Translate(), "LetterIMAmbushLGE".Translate(), LetterDefOf.ThreatBig, lookTarget, null);
     }, "GeneratingMapForNewEncounter", false, null);
 }
Ejemplo n.º 4
0
        protected void TreasureWithManhunters(Caravan caravan)
        {
            List <Thing> rewardList = GenerateReward();

            for (int i = 0; i < rewardList.Count; i++)
            {
                caravan.AddPawnOrItem(rewardList[i], true);
            }
            LongEventHandler.QueueLongEvent(delegate
            {
                IncidentParms incidentParms = StorytellerUtility.DefaultParmsNow(IncidentCategoryDefOf.ThreatBig, caravan);
                //make sure a minimum point threshold is hit
                if (incidentParms.points < MinimumPointThreshold)
                {
                    incidentParms.points = MinimumPointThreshold + 100f;
                }
                PawnKindDef animalKind;
                if (!ManhunterPackIncidentUtility.TryFindManhunterAnimalKind(this.AdjustedPoints(incidentParms.points), incidentParms.target.Tile, out animalKind) && !ManhunterPackIncidentUtility.TryFindManhunterAnimalKind(this.AdjustedPoints(incidentParms.points), -1, out animalKind))
                {
                    Log.Warning("Could not find any valid animal kind for " + this.def + " incident. Going with Wargs", false);
                    animalKind = ThingDefOfVanilla.Warg;
                }
                List <Pawn> pawnList = ManhunterPackIncidentUtility.GenerateAnimals(animalKind, incidentParms.target.Tile, this.AdjustedPoints(incidentParms.points));
                Map map = CaravanIncidentUtility.SetupCaravanAttackMap(caravan, pawnList, false);
                for (int i = 0; i < pawnList.Count; i++)
                {
                    pawnList[i].mindState.mentalStateHandler.TryStartMentalState(MentalStateDefOf.ManhunterPermanent, null, false, false, null, false);
                }
                Find.TickManager.CurTimeSpeed = TimeSpeed.Paused;
                GlobalTargetInfo lookTarget   = (!pawnList.Any <Pawn>()) ? GlobalTargetInfo.Invalid : new GlobalTargetInfo(pawnList[0].Position, map, false);
                Find.LetterStack.ReceiveLetter("LetterLabelTreasureAmbushLGE".Translate(), "LetterTreasureAmbushLGE".Translate(GenThing.GetMarketValue(rewardList).ToStringMoney(null), GenLabel.ThingsLabel(rewardList, string.Empty)), LetterDefOf.ThreatBig, lookTarget, null);
            }, "GeneratingMapForNewEncounter", false, null);
        }
Ejemplo n.º 5
0
        protected void TreasureWithHumanAmbush(Caravan caravan)
        {
            List <Thing> rewardList = GenerateReward();

            for (int i = 0; i < rewardList.Count; i++)
            {
                caravan.AddPawnOrItem(rewardList[i], true);
            }
            LongEventHandler.QueueLongEvent(delegate
            {
                IncidentParms incidentParms = StorytellerUtility.DefaultParmsNow(IncidentCategoryDefOf.ThreatBig, caravan);
                //make sure a minimum point threshold is hit
                if (incidentParms.points < MinimumPointThreshold)
                {
                    incidentParms.points = MinimumPointThreshold + 100f;
                }
                incidentParms.faction = Find.FactionManager.RandomEnemyFaction();
                PawnGroupMakerParms defaultPawnGroupMakerParms  = IncidentParmsUtility.GetDefaultPawnGroupMakerParms(PawnGroupKindDefOf.Combat, incidentParms, true);
                defaultPawnGroupMakerParms.generateFightersOnly = true;
                List <Pawn> pawnList = PawnGroupMakerUtility.GeneratePawns(defaultPawnGroupMakerParms, true).ToList <Pawn>();
                Map map = CaravanIncidentUtility.SetupCaravanAttackMap(caravan, pawnList, false);
                if (pawnList.Any <Pawn>())
                {
                    LordMaker.MakeNewLord(incidentParms.faction, new LordJob_AssaultColony(incidentParms.faction, true, true, false, false, true), map, pawnList);
                }
                Find.TickManager.CurTimeSpeed = TimeSpeed.Paused;
                GlobalTargetInfo lookTarget   = (!pawnList.Any <Pawn>()) ? GlobalTargetInfo.Invalid : new GlobalTargetInfo(pawnList[0].Position, map, false);
                Find.LetterStack.ReceiveLetter("LetterLabelTreasureAmbushLGE".Translate(), "LetterTreasureAmbushLGE".Translate(GenThing.GetMarketValue(rewardList).ToStringMoney(null), GenLabel.ThingsLabel(rewardList, string.Empty)), LetterDefOf.ThreatBig, lookTarget, null);
            }, "GeneratingMapForNewEncounter", false, null);
        }
 public void AlienAmbush(Caravan caravan, WorldObjectComp_InfectedTile site)
 {
     LongEventHandler.QueueLongEvent(delegate()
     {
         IncidentParms incidentParms = StorytellerUtility.DefaultParmsNow
                                           (IncidentCategoryDefOf.ThreatBig, caravan);
         List <Pawn> list = this.generateAliensFrom(site);
         Map map          = CaravanIncidentUtility.SetupCaravanAttackMap(caravan, list, false);
         Find.TickManager.CurTimeSpeed     = 0;
         GlobalTargetInfo globalTargetInfo = (!GenCollection.Any <Pawn>(list))
         ? GlobalTargetInfo.Invalid : new GlobalTargetInfo(list[0].Position, map, false);
         Find.LetterStack.ReceiveLetter("AlienAmbush".Translate(), "AlienAmbushDesc".Translate()
                                        , LetterDefOf.ThreatBig, globalTargetInfo, null, null, null, null);
     }, "GeneratingMapForNewEncounter", false, null, true);
 }
        private static void Outcome_TalksSabotageDisaster(Faction favouredFaction, Faction burdenedFaction, Pawn pawn, IIncidentTarget incidentTarget)
        {
            favouredFaction.TryAffectGoodwillWith(other: pawn.Faction,
                                                  goodwillChange: -FactionInteractionDiplomacyTuningsBlatantlyCopiedFromPeaceTalks
                                                  .GoodWill_FactionWarPeaceTalks_ImpactHuge.RandomInRange);

            favouredFaction.TrySetRelationKind(other: pawn.Faction, kind: FactionRelationKind.Hostile, canSendLetter: false, reason: null, lookTarget: null);

            burdenedFaction.TryAffectGoodwillWith(other: pawn.Faction,
                                                  goodwillChange: -FactionInteractionDiplomacyTuningsBlatantlyCopiedFromPeaceTalks
                                                  .GoodWill_FactionWarPeaceTalks_ImpactHuge.RandomInRange);
            burdenedFaction.TrySetRelationKind(other: pawn.Faction, kind: FactionRelationKind.Hostile, canSendLetter: false, reason: null, lookTarget: null);

            Find.World.GetComponent <WorldComponent_MFI_FactionWar>().StartWar(factionOne: favouredFaction, factionInstigator: burdenedFaction, selfResolved: favouredFaction.leader == pawn);

            LongEventHandler.QueueLongEvent(action: delegate
            {
                IncidentParms incidentParms = StorytellerUtility.DefaultParmsNow(incCat: IncidentCategoryDefOf.ThreatBig, target: incidentTarget);
                incidentParms.faction       = favouredFaction;
                PawnGroupMakerParms defaultPawnGroupMakerParms  = IncidentParmsUtility.GetDefaultPawnGroupMakerParms(groupKind: PawnGroupKindDefOf.Combat, parms: incidentParms, ensureCanGenerateAtLeastOnePawn: true);
                defaultPawnGroupMakerParms.generateFightersOnly = true;
                List <Pawn> list = PawnGroupMakerUtility.GeneratePawns(parms: defaultPawnGroupMakerParms).ToList();

                IncidentParms burdenedFactionIncidentParms              = incidentParms;
                burdenedFactionIncidentParms.faction                    = burdenedFaction;
                PawnGroupMakerParms burdenedFactionPawnGroupMakerParms  = IncidentParmsUtility.GetDefaultPawnGroupMakerParms(groupKind: PawnGroupKindDefOf.Combat, parms: incidentParms, ensureCanGenerateAtLeastOnePawn: true);
                burdenedFactionPawnGroupMakerParms.generateFightersOnly = true;
                List <Pawn> burdenedFactionWarriors = PawnGroupMakerUtility.GeneratePawns(parms: burdenedFactionPawnGroupMakerParms).ToList();

                List <Pawn> combinedList = new List <Pawn>();
                combinedList.AddRange(collection: list);
                combinedList.AddRange(collection: burdenedFactionWarriors);

                Map map = CaravanIncidentUtility.SetupCaravanAttackMap(caravan: incidentTarget as Caravan, enemies: combinedList, sendLetterIfRelatedPawns: true);

                if (list.Any())
                {
                    LordMaker.MakeNewLord(faction: incidentParms.faction, lordJob: new LordJob_AssaultColony(assaulterFaction: favouredFaction), map: map, startingPawns: list);
                }

                if (burdenedFactionWarriors.Any())
                {
                    LordMaker.MakeNewLord(faction: burdenedFactionIncidentParms.faction, lordJob: new LordJob_AssaultColony(assaulterFaction: burdenedFaction), map: map, startingPawns: burdenedFactionWarriors);
                }

                Find.TickManager.Notify_GeneratedPotentiallyHostileMap();
            }, textKey: "GeneratingMapForNewEncounter", doAsynchronously: false, exceptionHandler: null);
        }
        private void ActionFight(Caravan caravan, List <Pawn> attackers)
        {
            Faction enemyFaction = attackers[0].Faction;

            TaleRecorder.RecordTale(TaleDefOf.CaravanAmbushedByHumanlike, caravan.RandomOwner());
            LongEventHandler.QueueLongEvent(delegate
            {
                Map map = CaravanIncidentUtility.SetupCaravanAttackMap(caravan, attackers, sendLetterIfRelatedPawns: true);
                LordJob_AssaultColony lordJob_AssaultColony = new LordJob_AssaultColony(enemyFaction, canKidnap: true, canTimeoutOrFlee: false);
                if (lordJob_AssaultColony != null)
                {
                    LordMaker.MakeNewLord(enemyFaction, lordJob_AssaultColony, map, attackers);
                }
                Find.TickManager.Notify_GeneratedPotentiallyHostileMap();
                CameraJumper.TryJump(attackers[0]);
            }, "GeneratingMapForNewEncounter", false, null);
        }
Ejemplo n.º 9
0
        private void ActionFight(Caravan caravan, List <Pawn> attackers)
        {
            Faction enemyFaction = attackers[0].Faction;

            TaleRecorder.RecordTale(TaleDefOf.CaravanAmbushedByHumanlike, caravan.RandomOwner());
            LongEventHandler.QueueLongEvent(delegate
            {
                Map map = CaravanIncidentUtility.SetupCaravanAttackMap(caravan, attackers);
                LordJob_AssaultColony lordJob_AssaultColony = new LordJob_AssaultColony(enemyFaction, true, false, false, false, true);
                if (lordJob_AssaultColony != null)
                {
                    LordMaker.MakeNewLord(enemyFaction, lordJob_AssaultColony, map, attackers);
                }
                Find.TickManager.CurTimeSpeed = TimeSpeed.Paused;
                CameraJumper.TryJump(attackers[0]);
            }, "GeneratingMapForNewEncounter", false, null);
        }
        private bool DoExecute(IncidentParms parms)
        {
            Map     map     = parms.target as Map;
            IntVec3 invalid = IntVec3.Invalid;

            if (map != null && !CellFinder.TryFindRandomEdgeCellWith((Predicate <IntVec3>)((IntVec3 x) => x.Standable(map) && map.reachability.CanReachColony(x)), map, CellFinder.EdgeRoadChance_Hostile, out invalid))
            {
                return(false);
            }
            List <Pawn> list = this.GeneratePawns(parms);

            if (!list.Any())
            {
                return(false);
            }
            bool flag = false;

            if (map == null)
            {
                map  = CaravanIncidentUtility.SetupCaravanAttackMap((Caravan)parms.target, list);
                flag = true;
            }
            else
            {
                for (int i = 0; i < list.Count; i++)
                {
                    IntVec3 loc = CellFinder.RandomSpawnCellForPawnNear(invalid, map, 4);
                    GenSpawn.Spawn(list[i], loc, map, Rot4.Random, false);
                }
            }
            this.PostProcessGeneratedPawnsAfterSpawning(list);
            LordJob lordJob = this.CreateLordJob(list, parms);

            if (lordJob != null)
            {
                LordMaker.MakeNewLord(parms.faction, lordJob, map, list);
            }
            this.SendAmbushLetter(list[0], parms);
            if (flag)
            {
                Find.TickManager.CurTimeSpeed = TimeSpeed.Paused;
            }
            return(true);
        }
Ejemplo n.º 11
0
        private bool DoExecute(IncidentParms parms, List <Pawn> generatedEnemies, IntVec3 existingMapEdgeCell)
        {
            Map  map  = parms.target as Map;
            bool flag = false;

            if (map == null)
            {
                map  = CaravanIncidentUtility.SetupCaravanAttackMap((Caravan)parms.target, generatedEnemies, sendLetterIfRelatedPawns: false);
                flag = true;
            }
            else
            {
                for (int i = 0; i < generatedEnemies.Count; i++)
                {
                    IntVec3 loc = CellFinder.RandomSpawnCellForPawnNear(existingMapEdgeCell, map);
                    GenSpawn.Spawn(generatedEnemies[i], loc, map, Rot4.Random);
                }
            }
            PostProcessGeneratedPawnsAfterSpawning(generatedEnemies);
            LordJob lordJob = CreateLordJob(generatedEnemies, parms);

            if (lordJob != null)
            {
                LordMaker.MakeNewLord(parms.faction, lordJob, map, generatedEnemies);
            }
            TaggedString letterLabel = GetLetterLabel(generatedEnemies[0], parms);
            TaggedString letterText  = GetLetterText(generatedEnemies[0], parms);

            PawnRelationUtility.Notify_PawnsSeenByPlayer_Letter(generatedEnemies, ref letterLabel, ref letterText, GetRelatedPawnsInfoLetterText(parms), informEvenIfSeenBefore: true);
            SendStandardLetter(letterLabel, letterText, GetLetterDef(generatedEnemies[0], parms), parms, generatedEnemies[0]);
            if (flag)
            {
                Find.TickManager.Notify_GeneratedPotentiallyHostileMap();
            }
            return(true);
        }
Ejemplo n.º 12
0
 protected void CaravanAmbushHumansNoTreasure(Caravan caravan)
 {
     LongEventHandler.QueueLongEvent(delegate
     {
         IncidentParms incidentParms = StorytellerUtility.DefaultParmsNow(IncidentCategoryDefOf.ThreatBig, caravan);
         //make sure a minimum point threshold is hit
         if (incidentParms.points < MinimumPointThreshold)
         {
             incidentParms.points = MinimumPointThreshold;
         }
         incidentParms.faction = Find.FactionManager.RandomEnemyFaction();
         PawnGroupMakerParms defaultPawnGroupMakerParms  = IncidentParmsUtility.GetDefaultPawnGroupMakerParms(PawnGroupKindDefOf.Combat, incidentParms, true);
         defaultPawnGroupMakerParms.generateFightersOnly = true;
         List <Pawn> list = PawnGroupMakerUtility.GeneratePawns(defaultPawnGroupMakerParms, true).ToList <Pawn>();
         Map map          = CaravanIncidentUtility.SetupCaravanAttackMap(caravan, list, false);
         if (list.Any <Pawn>())
         {
             LordMaker.MakeNewLord(incidentParms.faction, new LordJob_AssaultColony(incidentParms.faction, true, true, false, false, true), map, list);
         }
         Find.TickManager.CurTimeSpeed = TimeSpeed.Paused;
         GlobalTargetInfo lookTarget   = (!list.Any <Pawn>()) ? GlobalTargetInfo.Invalid : new GlobalTargetInfo(list[0].Position, map, false);
         Find.LetterStack.ReceiveLetter("LetterLabelIMAmbushLGE".Translate(), "LetterIMAmbushLGE".Translate(), LetterDefOf.ThreatBig, lookTarget, null);
     }, "GeneratingMapForNewEncounter", false, null);
 }
Ejemplo n.º 13
0
        public void Notify_CaravanArrived(Caravan caravan)
        {
            var participants    = new List <Pawn>();
            var nonParticipants = new List <Pawn>();

            MedievalTournamentUtility.GroupParticipants(caravan.PlayerPawnsForStoryteller.Where(p => p.RaceProps.Humanlike).ToList(), category, participants, nonParticipants);

            // Create dialogue tree
            var leader      = Faction.leader;
            var tourneyNode = new DiaNode("VanillaFactionsExpanded.MedievalTournamentInitial".Translate(leader.LabelShort, Faction.Name, category.label, competitorCount, GenLabel.ThingsLabel(rewards), leader.Named("PAWN")));

            // Option 1: Participate
            var participateNode   = new DiaNode("VanillaFactionsExpanded.ParticipateInitial".Translate());
            var participateOption = new DiaOption("VanillaFactionsExpanded.Participate".Translate())
            {
                link = participateNode
            };

            tourneyNode.options.Add(participateOption);
            for (int i = 0; i < participants.Count; i++)
            {
                var pawn       = participants[i];
                var pawnOption = new DiaOption(MedievalTournamentUtility.ParticipantOptionText(pawn, category))
                {
                    action      = () => DoTournament(caravan, pawn),
                    resolveTree = true
                };
                participateNode.options.Add(pawnOption);
            }
            for (int i = 0; i < nonParticipants.Count; i++)
            {
                var pawn       = nonParticipants[i];
                var pawnOption = new DiaOption(MedievalTournamentUtility.ParticipantOptionText(pawn, category))
                {
                    disabled = true
                };
                participateNode.options.Add(pawnOption);
            }
            var participateGoBack = new DiaOption("GoBack".Translate())
            {
                link = tourneyNode
            };

            participateNode.options.Add(participateGoBack);

            // Option 2: Attack (angers faction)
            var attackOption = new DiaOption($"{"CommandAttackSettlement".Translate()} ({"AngersFaction".Translate()})")
            {
                action = () =>
                {
                    LongEventHandler.QueueLongEvent(() =>
                    {
                        Faction.TrySetRelationKind(Faction.OfPlayer, FactionRelationKind.Hostile, false);
                        var competitorPool       = PossibleCompetitors.ToList();
                        var extraPawnParams      = StorytellerUtility.DefaultParmsNow(IncidentCategoryDefOf.ThreatBig, caravan);
                        extraPawnParams.faction  = Faction;
                        var pawnGroupMakerParams = IncidentParmsUtility.GetDefaultPawnGroupMakerParms(PawnGroupKindDefOf.Combat, extraPawnParams, true);
                        pawnGroupMakerParams.generateFightersOnly = true;
                        var hostilePawns = MedievalTournamentUtility.GenerateCompetitors(competitorCount, category, Faction, PossibleCompetitors).Concat(PawnGroupMakerUtility.GeneratePawns(pawnGroupMakerParams)).ToList();
                        var map          = CaravanIncidentUtility.SetupCaravanAttackMap(caravan, hostilePawns, true);
                        if (hostilePawns.Any())
                        {
                            LordMaker.MakeNewLord(Faction, new LordJob_AssaultColony(Faction), map, hostilePawns);
                        }
                        Find.TickManager.Notify_GeneratedPotentiallyHostileMap();
                        for (int i = 0; i < rewards.Count; i++)
                        {
                            GenPlace.TryPlaceThing(rewards[i], map.Center, map, ThingPlaceMode.Near);
                        }
                    },
                                                    "GeneratingMapForNewEncounter", false, null);
                    Find.WorldObjects.Remove(this);
                },
                resolveTree = true
            };

            tourneyNode.options.Add(attackOption);

            // Option 3: Leave
            var leaveOption = new DiaOption("VanillaFactionsExpanded.Leave".Translate())
            {
                resolveTree = true
            };

            tourneyNode.options.Add(leaveOption);

            // Add dialogue menu
            Find.WindowStack.Add(new Dialog_NodeTree(tourneyNode, title: LabelCap));
        }