static bool Prefix(IncidentWorker_ManhunterPack __instance, ref bool __result, IncidentParms parms) { if (PES_Settings.DebugModeOn) { Log.Message("-=PS=- Patch_IncidentWorker_ManhunterPack_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 (IncidentInterceptorUtility.isIntercepting_ManhunterPack == WorkerPatchType.ExecuteOrigin) { return(true); } if (IncidentInterceptorUtility.isIntercepting_ManhunterPack == WorkerPatchType.Forestall) { IncidentInterceptorUtility.CreateIncidentCaravan_Animal <InterceptedIncident_AnimalHerd_ManhunterPack>(__instance.def, parms); __result = true; } else { __result = IncidentInterceptorUtility.tmpIncident.SubstituionWorkerExecution(); } return(false); }
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 void Postfix(PawnsArrivalModeWorker_EdgeWalkIn __instance, IncidentParms parms, ref bool __result) { //return; if (PreemptiveStrike.Mod.PES_Settings.DebugModeOn) { Log.Message("-=PS=- Patch_EdgeWalkIn_TryResolveRaidSpawnCenter Postfix"); //Lt. Bob - Logging IncidentInterceptorUtility.DebugParms(parms, __instance.ToString()); } if (parms != null && parms.questTag != null) //Lt. Bob - "Temporary" bypass fix? for Quest handling { Log.Message("-=PS=- It's a quest! Bailout! MAYDAY!", false); return; } //This is a temporary fix for refugee chased if (IncidentInterceptorUtility.IncidentInQueue(parms, IncidentDefOf.RaidEnemy)) { return; } if (IncidentInterceptorUtility.IsIntercepting_IncidentExcecution) { if (IncidentInterceptorUtility.Intercept_Raid(parms)) { __result = false; } } }
static bool Prefix(IncidentWorker __instance, ref bool __result, IncidentParms parms) { if (PES_Settings.DebugModeOn) { Messages.Message("-=PS=- Caught Patch_IncidentWorker_TryExecute Prefix", MessageTypeDefOf.NeutralEvent, true); Log.Message("-=PS=- Patch_IncidentWorker_TryExecute 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 (__instance.def == null) { Log.Error("-=PS=- __instance.def=NULL", false); Log.Error(" PS=- Returning true", false); return(true); } Log.Message(" PS=- __instance.def= " + __instance.def.ToString(), false); if (__instance.def.ToString() == "RRY_PowerCut_Xenomorph") //Lt.Bob - Handling for AvP powercut event { Log.Message("-=PS=- AVP PowerCut event", false); Log.Message(" PS=- Returning true", false); return(true); } //TODO: This is for the ship part incident //I have no choice but do the patch like this //'cause the incidentworker for shippart is an internal class //and manual patching doesn't work var def = __instance.def; if (def != DefDatabase <IncidentDef> .GetNamed("PsychicEmanatorShipPartCrash") && def != DefDatabase <IncidentDef> .GetNamed("DefoliatorShipPartCrash")) //Lt. Bob: 1.1 - Replaced PoisonShipPartCrash with DefoliatorShipPartCrash { return(true); } if (IncidentInterceptorUtility.IsIntercepting_ShipPart == WorkerPatchType.ExecuteOrigin) { return(true); } else { if (!IncidentInterceptorUtility.Intercept_SkyFaller <InterceptedIncident_SkyFaller_ShipPartCrash>(__instance.def, parms)) { return(true); } __result = true; return(false); } }
static void Postfix(PawnsArrivalModeWorker_EdgeWalkIn __instance, IncidentParms parms, ref bool __result) { if (PES_Settings.DebugModeOn) { Log.Message("-=PS=- Patch_EdgeWalkInGroups_TryResolveRaidSpawnCenter 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; } if (IncidentInterceptorUtility.IsIntercepting_IncidentExcecution) { if (IncidentInterceptorUtility.Intercept_Raid(parms, true)) { __result = false; } } }
public static bool Prefix(IncidentWorker __instance, ref bool __result, IncidentParms parms) { if (PES_Settings.DebugModeOn) { Log.Message("-=PS=- Patch_IncidentWorker_Alphabeavers_TryExecuteWorker Prefix", false); IncidentInterceptorUtility.DebugParms(parms, __instance.ToString()); } if (IncidentInterceptorUtility.isIntercepting_Alphabeavers == WorkerPatchType.ExecuteOrigin) { return(true); } if (IncidentInterceptorUtility.isIntercepting_Alphabeavers == WorkerPatchType.Forestall) { IncidentInterceptorUtility.CreateIncidentCaravan_Animal <InterceptedIncident_AnimalHerd_Alphabeavers>(__instance.def, parms); __result = true; } else { __result = IncidentInterceptorUtility.tmpIncident.SubstituionWorkerExecution(); } return(false); }