public static void TryGiveJob(Pawn pawn, Job __result) { if (__result == null || pawn == null) { return; } if (!pawn.Spawned) { return; } if (__result.def != JobDefOf.Ingest) { return; } if (!__result.CanBeginNow(pawn)) { return; } if (!Settings.EdibleBingesEnabled) { return; } if ((Find.TickManager.TicksGame - Snapshot) < 60) { return; } MPE.Debug(string.Format("{0} ticks passed since last food binge.", Find.TickManager.TicksGame - Snapshot)); MPE.Info(string.Format("Pawn {0} is on a food binge; pausing the game...", pawn.LabelDefinite())); Find.TickManager.Pause(); Snapshot = Find.TickManager.TicksGame; }
public static void PostStart(MentalState_SadisticRageTantrum __instance) { if (!Settings.SadisticRageEnabled) { return; } if (__instance == null) { return; } if (__instance.target == null || __instance.pawn == null) { return; } if (!__instance.pawn.Spawned) { return; } if (!(__instance.pawn.MentalState is MentalState_SadisticRageTantrum)) { return; } if (__instance.Age > 150) { return; } if (MPE.Cache.SadisticRage.Contains(__instance.pawn.GetUniqueLoadID())) { return; } MPE.Info(string.Format("Pawn {0} is on a sadistic rage; pausing the game...", __instance.pawn.LabelDefinite())); MPE.Cache.SadisticRage.Add(__instance.pawn.GetUniqueLoadID()); Find.TickManager.Pause(); }