static bool Prefix(IncidentWorker_TravelerGroup __instance, ref bool __result, IncidentParms parms) { if (PES_Settings.DebugModeOn) { Log.Message("-=PS=- Patch_IncidentWorker_VisitorGroup_TryExecuteWorker Prefix", false); IncidentInterceptorUtility.DebugParms(parms, __instance.ToString()); } if (parms.quest != null || parms.questScriptDef != null) { Log.Message("-=PS=- It's a quest! Bailout! MAYDAY!", false); return(true); } if (parms != null && parms.questTag != null) //Lt.Bob - May be redundant { Log.Error("-=PS=- Not redundant", false); Log.Message("-=PS=- Patch_IncidentWorker_TravelerGroup_TryExecuteWorker - questTag!=Null == " + parms.questTag, false); Log.Message("-=PS=- Returning true", false); return(true); } if (IncidentInterceptorUtility.isIntercepting_TravelerGroup) { return(!IncidentInterceptorUtility.CreateIncidentCaraven_HumanNeutral <InterceptedIncident_HumanCrowd_TravelerGroup>(__instance.def, parms)); } return(true); }
static bool Prefix(IncidentWorker_TravelerGroup __instance, ref bool __result, IncidentParms parms) { if (IncidentInterceptorUtility.isIntercepting_TravelerGroup) { IncidentInterceptorUtility.CreateIncidentCaraven_HumanNeutral <InterceptedIncident_HumanCrowd_TravelerGroup>(parms); } return(true); }
public override bool IsPossible() { worker = new IncidentWorker_TravelerGroup(); worker.def = IncidentDef.Named("TravelerGroup"); parms = StorytellerUtility.DefaultParmsNow(IncidentCategoryDefOf.Misc, target); return(worker.CanFireNow(parms)); }
public static List <Pawn> MountAnimals(IncidentWorker_TravelerGroup instance, IncidentParms parms) { List <Pawn> pawns = Traverse.Create(instance).Method("SpawnPawns", new object[] { parms }).GetValue <List <Pawn> >(); if (!pawns.NullOrEmpty()) { NPCMountUtility.generateMounts(ref pawns, parms, Base.inBiomeWeight, Base.outBiomeWeight, Base.nonWildWeight, Base.visitorMountChance, Base.visitorMountChanceTribal); } return(pawns); }
public static void AddQuestGiverThree(IncidentParms parms, List <Pawn> __result, IncidentWorker_TravelerGroup __instance) { if (__result == null || __result.Count == 0) { return; } if (__instance.def.defName != "TravelerGroup") { //Log.Message($"Skip Incident: {__instance.def.defName}"); return; } var newQuestPawn = RimQuestUtility.GetNewQuestGiver(__result); if (newQuestPawn == null || newQuestPawn?.Faction == null) { return; } var questPawns = Find.World.GetComponent <RimQuestTracker>().questPawns; if (!questPawns.Any(x => x.pawn == newQuestPawn)) { var questPawn = new QuestPawn(newQuestPawn); if (questPawn != null) { questPawns.Add(questPawn); } } }