public override bool IsPossible()
        {
            worker     = new IncidentWorker_ThrumboPasses();
            worker.def = IncidentDef.Named("ThrumboPasses");

            parms = StorytellerUtility.DefaultParmsNow(IncidentCategoryDefOf.Misc, target);

            return(worker.CanFireNow(parms));
        }
Exemplo n.º 2
0
 static bool Prefix(IncidentWorker_ThrumboPasses __instance, ref bool __result, IncidentParms parms)
 {
     if (IncidentInterceptorUtility.isIntercepting_ThrumboPasses == WorkerPatchType.ExecuteOrigin)
     {
         return(true);
     }
     if (IncidentInterceptorUtility.isIntercepting_ThrumboPasses == WorkerPatchType.Forestall)
     {
         IncidentInterceptorUtility.CreateIncidentCaravan_Animal <InterceptedIncident_AnimalHerd_ThrumboPasses>(parms);
         __result = true;
     }
     else
     {
         __result = IncidentInterceptorUtility.tmpIncident.SubstituionWorkerExecution();
     }
     return(false);
 }
        static bool Prefix(IncidentWorker_ThrumboPasses __instance, ref bool __result, IncidentParms parms)
        {
            if (PES_Settings.DebugModeOn)
            {
                Log.Message("-=PS=- Patch_IncidentWorker_ThrumboPasses_TryExecuteWorker Prefix", false);
                IncidentInterceptorUtility.DebugParms(parms, __instance.ToString());
            }

            if (IncidentInterceptorUtility.isIntercepting_ThrumboPasses == WorkerPatchType.ExecuteOrigin)
            {
                return(true);
            }
            if (IncidentInterceptorUtility.isIntercepting_ThrumboPasses == WorkerPatchType.Forestall)
            {
                IncidentInterceptorUtility.CreateIncidentCaravan_Animal <InterceptedIncident_AnimalHerd_ThrumboPasses>(__instance.def, parms);
                __result = true;
            }
            else
            {
                __result = IncidentInterceptorUtility.tmpIncident.SubstituionWorkerExecution();
            }
            return(false);
        }