/// <summary> /// Removes the "Sore Back" debuff if the Duplicant is Narcoleptic. /// </summary> /// <param name="monitor">The sleep chore monitor of that Duplicant.</param> /// <param name="locator">The locator for the pending sleep chore.</param> internal static void RemoveSoreBack(SleepChoreMonitor.Instance monitor, GameObject locator) { var sleepable = locator.GetComponentSafe <Sleepable>(); var traits = monitor.gameObject.GetComponentSafe <Traits>(); if (traits != null && sleepable != null && traits.HasTrait("Narcolepsy")) { sleepable.wakeEffects = null; } }
/// <summary> /// Applied after CreatePassedOutLocator runs. /// </summary> internal static void Postfix(SleepChoreMonitor.Instance __instance, GameObject __result) { TraitReworkUtils.RemoveSoreBack(__instance, __result); }