From bfa1542009aa7fecbe0e50aef9561b49a4874448 Mon Sep 17 00:00:00 2001 From: Cimika/Lessie/KathyRyals <65850818+KathyRyals@users.noreply.github.com> Date: Thu, 11 Nov 2021 23:04:00 +0100 Subject: [PATCH] Felinids don't like getting sprayed with water. (#59506) This PR is an ode to @Ryll-Ryll, who inspired me to try and find fun, silly things to PR to try and make people smile. About The Pull Request Felinids now get a SMALL and SHORT mood debuff when getting sprayed with water. The intent of this PR is not to provide content to grief felinid (flashback to the "Felinids hate water" pr), but rather to provide a funny interaction. Bonus point (Suggested by Ninja) : Getting sprayed with water interrupts do_after. Felinid climbing on your table ? Pssshttt. Straight in the face. PR with permission from @ninjanomnom Why It's Good For The Game Light-hearted fun and a bit of flavour to felinids. Changelog cl add: Felinids don't like getting sprayed with water. code: Adds a new status effect, incapacitated, which causes your do_afters to stop. /cl --- code/__DEFINES/status_effects.dm | 2 + .../mood_events/generic_negative_events.dm | 5 + code/datums/status_effects/debuffs.dm | 17 + code/modules/mob/living/status_procs.dm | 389 ++++++++++-------- .../chemistry/reagents/other_reagents.dm | 6 + 5 files changed, 250 insertions(+), 169 deletions(-) diff --git a/code/__DEFINES/status_effects.dm b/code/__DEFINES/status_effects.dm index c806e2f63a7..e98d918845f 100644 --- a/code/__DEFINES/status_effects.dm +++ b/code/__DEFINES/status_effects.dm @@ -57,6 +57,8 @@ #define STATUS_EFFECT_PARALYZED /datum/status_effect/incapacitating/paralyzed //the affected is unable to move, use items, or stand up. +#define STATUS_EFFECT_INCAPACITATED /datum/status_effect/incapacitating/incapacitated //the incapacitated is unable to perform some basic actions and gets their do_afters canceled + #define STATUS_EFFECT_UNCONSCIOUS /datum/status_effect/incapacitating/unconscious //the affected is unconscious #define STATUS_EFFECT_SLEEPING /datum/status_effect/incapacitating/sleeping //the affected is asleep diff --git a/code/datums/mood_events/generic_negative_events.dm b/code/datums/mood_events/generic_negative_events.dm index aafaec1ef24..34237c8db75 100644 --- a/code/datums/mood_events/generic_negative_events.dm +++ b/code/datums/mood_events/generic_negative_events.dm @@ -351,3 +351,8 @@ description = span_warning("Cool! That's fine, I wanted to wear that soda, not drink it...\n") mood_change = -2 timeout = 1 MINUTES + +/datum/mood_event/watersprayed + description = "I hate being sprayed with water!\n" + mood_change = -5 + timeout = 30 SECONDS diff --git a/code/datums/status_effects/debuffs.dm b/code/datums/status_effects/debuffs.dm index a5f051e6564..3f8dfd929a1 100644 --- a/code/datums/status_effects/debuffs.dm +++ b/code/datums/status_effects/debuffs.dm @@ -91,6 +91,23 @@ REMOVE_TRAIT(owner, TRAIT_HANDS_BLOCKED, TRAIT_STATUS_EFFECT(id)) return ..() +//INCAPACITATED +/// This status effect represents anything that leaves a character unable to perform basic tasks (interrupting do-afters, for example), but doesn't incapacitate them further than that (no stuns etc..) +/datum/status_effect/incapacitating/incapacitated + id = "incapacitated" + +// What happens when you get the incapacitated status. You get TRAIT_INCAPACITATED added to you for the duration of the status effect. +/datum/status_effect/incapacitating/incapacitated/on_apply() + . = ..() + if(!.) + return + ADD_TRAIT(owner, TRAIT_INCAPACITATED, TRAIT_STATUS_EFFECT(id)) + +// When the status effect runs out, your TRAIT_INCAPACITATED is removed. +/datum/status_effect/incapacitating/incapacitated/on_remove() + REMOVE_TRAIT(owner, TRAIT_INCAPACITATED, TRAIT_STATUS_EFFECT(id)) + return ..() + //UNCONSCIOUS /datum/status_effect/incapacitating/unconscious diff --git a/code/modules/mob/living/status_procs.dm b/code/modules/mob/living/status_procs.dm index bd028f576b6..e8a26a76528 100644 --- a/code/modules/mob/living/status_procs.dm +++ b/code/modules/mob/living/status_procs.dm @@ -2,9 +2,9 @@ //The effects include: stun, knockdown, unconscious, sleeping, resting, jitteriness, dizziness, // eye damage, eye_blind, eye_blurry, druggy, TRAIT_BLIND trait, and TRAIT_NEARSIGHT trait. +#define IS_STUN_IMMUNE(source, ignore_canstun) ((source.status_flags & GODMODE) || (!ignore_canstun && (!(source.status_flags & CANKNOCKDOWN) || HAS_TRAIT(source, TRAIT_STUNIMMUNE)))) -////////////////////////////// STUN //////////////////////////////////// - +/* STUN */ /mob/living/proc/IsStun() //If we're stunned return has_status_effect(STATUS_EFFECT_STUN) @@ -17,54 +17,50 @@ /mob/living/proc/Stun(amount, ignore_canstun = FALSE) //Can't go below remaining duration if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_STUN, amount, ignore_canstun) & COMPONENT_NO_STUN) return - if(status_flags & GODMODE) + if(IS_STUN_IMMUNE(src, ignore_canstun)) return - if(((status_flags & CANSTUN) && !HAS_TRAIT(src, TRAIT_STUNIMMUNE)) || ignore_canstun) - if(absorb_stun(amount, ignore_canstun)) - return - var/datum/status_effect/incapacitating/stun/S = IsStun() - if(S) - S.duration = max(world.time + amount, S.duration) - else if(amount > 0) - S = apply_status_effect(STATUS_EFFECT_STUN, amount) - return S + if(absorb_stun(amount, ignore_canstun)) + return + var/datum/status_effect/incapacitating/stun/S = IsStun() + if(S) + S.duration = max(world.time + amount, S.duration) + else if(amount > 0) + S = apply_status_effect(STATUS_EFFECT_STUN, amount) + return S /mob/living/proc/SetStun(amount, ignore_canstun = FALSE) //Sets remaining duration if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_STUN, amount, ignore_canstun) & COMPONENT_NO_STUN) return - if(status_flags & GODMODE) + if(IS_STUN_IMMUNE(src, ignore_canstun)) return - if(((status_flags & CANSTUN) && !HAS_TRAIT(src, TRAIT_STUNIMMUNE)) || ignore_canstun) - var/datum/status_effect/incapacitating/stun/S = IsStun() - if(amount <= 0) - if(S) - qdel(S) + var/datum/status_effect/incapacitating/stun/S = IsStun() + if(amount <= 0) + if(S) + qdel(S) + else + if(absorb_stun(amount, ignore_canstun)) + return + if(S) + S.duration = world.time + amount else - if(absorb_stun(amount, ignore_canstun)) - return - if(S) - S.duration = world.time + amount - else - S = apply_status_effect(STATUS_EFFECT_STUN, amount) - return S + S = apply_status_effect(STATUS_EFFECT_STUN, amount) + return S /mob/living/proc/AdjustStun(amount, ignore_canstun = FALSE) //Adds to remaining duration if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_STUN, amount, ignore_canstun) & COMPONENT_NO_STUN) return - if(status_flags & GODMODE) + if(IS_STUN_IMMUNE(src, ignore_canstun)) return - if(((status_flags & CANSTUN) && !HAS_TRAIT(src, TRAIT_STUNIMMUNE)) || ignore_canstun) - if(absorb_stun(amount, ignore_canstun)) - return - var/datum/status_effect/incapacitating/stun/S = IsStun() - if(S) - S.duration += amount - else if(amount > 0) - S = apply_status_effect(STATUS_EFFECT_STUN, amount) - return S - -///////////////////////////////// KNOCKDOWN ///////////////////////////////////// + if(absorb_stun(amount, ignore_canstun)) + return + var/datum/status_effect/incapacitating/stun/S = IsStun() + if(S) + S.duration += amount + else if(amount > 0) + S = apply_status_effect(STATUS_EFFECT_STUN, amount) + return S +/* KNOCKDOWN */ /mob/living/proc/IsKnockdown() //If we're knocked down return has_status_effect(STATUS_EFFECT_KNOCKDOWN) @@ -77,53 +73,50 @@ /mob/living/proc/Knockdown(amount, ignore_canstun = FALSE) //Can't go below remaining duration if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_KNOCKDOWN, amount, ignore_canstun) & COMPONENT_NO_STUN) return - if(status_flags & GODMODE) + if(IS_STUN_IMMUNE(src, ignore_canstun)) return - if(((status_flags & CANKNOCKDOWN) && !HAS_TRAIT(src, TRAIT_STUNIMMUNE)) || ignore_canstun) - if(absorb_stun(amount, ignore_canstun)) - return - var/datum/status_effect/incapacitating/knockdown/K = IsKnockdown() - if(K) - K.duration = max(world.time + amount, K.duration) - else if(amount > 0) - K = apply_status_effect(STATUS_EFFECT_KNOCKDOWN, amount) - return K + if(absorb_stun(amount, ignore_canstun)) + return + var/datum/status_effect/incapacitating/knockdown/K = IsKnockdown() + if(K) + K.duration = max(world.time + amount, K.duration) + else if(amount > 0) + K = apply_status_effect(STATUS_EFFECT_KNOCKDOWN, amount) + return K /mob/living/proc/SetKnockdown(amount, ignore_canstun = FALSE) //Sets remaining duration if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_KNOCKDOWN, amount, ignore_canstun) & COMPONENT_NO_STUN) return - if(status_flags & GODMODE) + if(IS_STUN_IMMUNE(src, ignore_canstun)) return - if(((status_flags & CANKNOCKDOWN) && !HAS_TRAIT(src, TRAIT_STUNIMMUNE)) || ignore_canstun) - var/datum/status_effect/incapacitating/knockdown/K = IsKnockdown() - if(amount <= 0) - if(K) - qdel(K) + var/datum/status_effect/incapacitating/knockdown/K = IsKnockdown() + if(amount <= 0) + if(K) + qdel(K) + else + if(absorb_stun(amount, ignore_canstun)) + return + if(K) + K.duration = world.time + amount else - if(absorb_stun(amount, ignore_canstun)) - return - if(K) - K.duration = world.time + amount - else - K = apply_status_effect(STATUS_EFFECT_KNOCKDOWN, amount) - return K + K = apply_status_effect(STATUS_EFFECT_KNOCKDOWN, amount) + return K /mob/living/proc/AdjustKnockdown(amount, ignore_canstun = FALSE) //Adds to remaining duration if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_KNOCKDOWN, amount, ignore_canstun) & COMPONENT_NO_STUN) return - if(status_flags & GODMODE) + if(IS_STUN_IMMUNE(src, ignore_canstun)) return - if(((status_flags & CANKNOCKDOWN) && !HAS_TRAIT(src, TRAIT_STUNIMMUNE)) || ignore_canstun) - if(absorb_stun(amount, ignore_canstun)) - return - var/datum/status_effect/incapacitating/knockdown/K = IsKnockdown() - if(K) - K.duration += amount - else if(amount > 0) - K = apply_status_effect(STATUS_EFFECT_KNOCKDOWN, amount) - return K + if(absorb_stun(amount, ignore_canstun)) + return + var/datum/status_effect/incapacitating/knockdown/K = IsKnockdown() + if(K) + K.duration += amount + else if(amount > 0) + K = apply_status_effect(STATUS_EFFECT_KNOCKDOWN, amount) + return K -///////////////////////////////// IMMOBILIZED //////////////////////////////////// +/* IMMOBILIZED */ /mob/living/proc/IsImmobilized() //If we're immobilized return has_status_effect(STATUS_EFFECT_IMMOBILIZED) @@ -136,53 +129,50 @@ /mob/living/proc/Immobilize(amount, ignore_canstun = FALSE) //Can't go below remaining duration if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_IMMOBILIZE, amount, ignore_canstun) & COMPONENT_NO_STUN) return - if(status_flags & GODMODE) + if(IS_STUN_IMMUNE(src, ignore_canstun)) return - if(((status_flags & CANKNOCKDOWN) && !HAS_TRAIT(src, TRAIT_STUNIMMUNE)) || ignore_canstun) - if(absorb_stun(amount, ignore_canstun)) - return - var/datum/status_effect/incapacitating/immobilized/I = IsImmobilized() - if(I) - I.duration = max(world.time + amount, I.duration) - else if(amount > 0) - I = apply_status_effect(STATUS_EFFECT_IMMOBILIZED, amount) - return I + if(absorb_stun(amount, ignore_canstun)) + return + var/datum/status_effect/incapacitating/immobilized/I = IsImmobilized() + if(I) + I.duration = max(world.time + amount, I.duration) + else if(amount > 0) + I = apply_status_effect(STATUS_EFFECT_IMMOBILIZED, amount) + return I /mob/living/proc/SetImmobilized(amount, ignore_canstun = FALSE) //Sets remaining duration if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_IMMOBILIZE, amount, ignore_canstun) & COMPONENT_NO_STUN) return - if(status_flags & GODMODE) + if(IS_STUN_IMMUNE(src, ignore_canstun)) return - if(((status_flags & CANKNOCKDOWN) && !HAS_TRAIT(src, TRAIT_STUNIMMUNE)) || ignore_canstun) - var/datum/status_effect/incapacitating/immobilized/I = IsImmobilized() - if(amount <= 0) - if(I) - qdel(I) + var/datum/status_effect/incapacitating/immobilized/I = IsImmobilized() + if(amount <= 0) + if(I) + qdel(I) + else + if(absorb_stun(amount, ignore_canstun)) + return + if(I) + I.duration = world.time + amount else - if(absorb_stun(amount, ignore_canstun)) - return - if(I) - I.duration = world.time + amount - else - I = apply_status_effect(STATUS_EFFECT_IMMOBILIZED, amount) - return I + I = apply_status_effect(STATUS_EFFECT_IMMOBILIZED, amount) + return I /mob/living/proc/AdjustImmobilized(amount, ignore_canstun = FALSE) //Adds to remaining duration if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_IMMOBILIZE, amount, ignore_canstun) & COMPONENT_NO_STUN) return - if(status_flags & GODMODE) + if(IS_STUN_IMMUNE(src, ignore_canstun)) return - if(((status_flags & CANKNOCKDOWN) && !HAS_TRAIT(src, TRAIT_STUNIMMUNE)) || ignore_canstun) - if(absorb_stun(amount, ignore_canstun)) - return - var/datum/status_effect/incapacitating/immobilized/I = IsImmobilized() - if(I) - I.duration += amount - else if(amount > 0) - I = apply_status_effect(STATUS_EFFECT_IMMOBILIZED, amount) - return I + if(absorb_stun(amount, ignore_canstun)) + return + var/datum/status_effect/incapacitating/immobilized/I = IsImmobilized() + if(I) + I.duration += amount + else if(amount > 0) + I = apply_status_effect(STATUS_EFFECT_IMMOBILIZED, amount) + return I -///////////////////////////////// PARALYZED ////////////////////////////////// +/* PARALYZED */ /mob/living/proc/IsParalyzed() //If we're paralyzed return has_status_effect(STATUS_EFFECT_PARALYZED) @@ -195,51 +185,116 @@ /mob/living/proc/Paralyze(amount, ignore_canstun = FALSE) //Can't go below remaining duration if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_PARALYZE, amount, ignore_canstun) & COMPONENT_NO_STUN) return - if(status_flags & GODMODE) + if(IS_STUN_IMMUNE(src, ignore_canstun)) return - if(((status_flags & CANKNOCKDOWN) && !HAS_TRAIT(src, TRAIT_STUNIMMUNE)) || ignore_canstun) - if(absorb_stun(amount, ignore_canstun)) - return - var/datum/status_effect/incapacitating/paralyzed/P = IsParalyzed(FALSE) - if(P) - P.duration = max(world.time + amount, P.duration) - else if(amount > 0) - P = apply_status_effect(STATUS_EFFECT_PARALYZED, amount) - return P + if(absorb_stun(amount, ignore_canstun)) + return + var/datum/status_effect/incapacitating/paralyzed/P = IsParalyzed(FALSE) + if(P) + P.duration = max(world.time + amount, P.duration) + else if(amount > 0) + P = apply_status_effect(STATUS_EFFECT_PARALYZED, amount) + return P /mob/living/proc/SetParalyzed(amount, ignore_canstun = FALSE) //Sets remaining duration if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_PARALYZE, amount, ignore_canstun) & COMPONENT_NO_STUN) return - if(status_flags & GODMODE) + if(IS_STUN_IMMUNE(src, ignore_canstun)) return - if(((status_flags & CANKNOCKDOWN) && !HAS_TRAIT(src, TRAIT_STUNIMMUNE)) || ignore_canstun) - var/datum/status_effect/incapacitating/paralyzed/P = IsParalyzed(FALSE) - if(amount <= 0) - if(P) - qdel(P) + var/datum/status_effect/incapacitating/paralyzed/P = IsParalyzed(FALSE) + if(amount <= 0) + if(P) + qdel(P) + else + if(absorb_stun(amount, ignore_canstun)) + return + if(P) + P.duration = world.time + amount else - if(absorb_stun(amount, ignore_canstun)) - return - if(P) - P.duration = world.time + amount - else - P = apply_status_effect(STATUS_EFFECT_PARALYZED, amount) - return P + P = apply_status_effect(STATUS_EFFECT_PARALYZED, amount) + return P /mob/living/proc/AdjustParalyzed(amount, ignore_canstun = FALSE) //Adds to remaining duration if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_PARALYZE, amount, ignore_canstun) & COMPONENT_NO_STUN) return - if(status_flags & GODMODE) + if(IS_STUN_IMMUNE(src, ignore_canstun)) return - if(((status_flags & CANKNOCKDOWN) && !HAS_TRAIT(src, TRAIT_STUNIMMUNE)) || ignore_canstun) + if(absorb_stun(amount, ignore_canstun)) + return + var/datum/status_effect/incapacitating/paralyzed/P = IsParalyzed(FALSE) + if(P) + P.duration += amount + else if(amount > 0) + P = apply_status_effect(STATUS_EFFECT_PARALYZED, amount) + return P + +/* INCAPACITATED */ + + +/// Proc that returns the remaining duration of the status efect in deciseconds. +/mob/living/proc/amount_incapacitated() + var/datum/status_effect/incapacitating/incapacitated/incapacitated_status_effect = has_status_effect(STATUS_EFFECT_INCAPACITATED) + if (incapacitated_status_effect) + return incapacitated_status_effect.duration - world.time + else + return 0 + +/** Proc that actually applies the status effect. + * Applies the Incapacitated status effect to a mob/living. + * * amount - Amount of time the status effect should be applied for, in deciseconds. + * * ignore_canstun - If TRUE, the mob's resistance to stuns is ignored. + */ +/mob/living/proc/incapacitate(amount, ignore_canstun = FALSE) + if(IS_STUN_IMMUNE(src, ignore_canstun)) + return + if(absorb_stun(amount, ignore_canstun)) + return + var/datum/status_effect/incapacitating/incapacitated/incapacitated_status_effect = has_status_effect(STATUS_EFFECT_INCAPACITATED) + if(incapacitated_status_effect) + incapacitated_status_effect.duration = max(world.time + amount, incapacitated_status_effect.duration) + else if(amount > 0) + incapacitated_status_effect = apply_status_effect(STATUS_EFFECT_INCAPACITATED, amount) + return incapacitated_status_effect + +/** Proc that set the incapacitated status effect's remaining duration to a certain time. + * Checks if the mob has the status effect. If yes, it sets the duration to the amount passed in arguments. If not, applies the status effect + * and sets the duration to the amount passed in arguments. + * * amount - Amount of time the status effect should be set to, in deciseconds. + * * ignore_canstun - If TRUE, the mob's resistance to stuns is ignored. + */ +/mob/living/proc/set_incapacitated(amount, ignore_canstun = FALSE) + if(IS_STUN_IMMUNE(src, ignore_canstun)) + return + var/datum/status_effect/incapacitating/incapacitated/incapacitated_status_effect = has_status_effect(STATUS_EFFECT_INCAPACITATED) + if(amount <= 0) + if(incapacitated_status_effect) + qdel(incapacitated_status_effect) + else if(absorb_stun(amount, ignore_canstun)) return - var/datum/status_effect/incapacitating/paralyzed/P = IsParalyzed(FALSE) - if(P) - P.duration += amount - else if(amount > 0) - P = apply_status_effect(STATUS_EFFECT_PARALYZED, amount) - return P + if(incapacitated_status_effect) + incapacitated_status_effect.duration = world.time + amount + else + incapacitated_status_effect = apply_status_effect(STATUS_EFFECT_INCAPACITATED, amount) + return incapacitated_status_effect + +/** Proc that adds duration to an incapacitated status effect. + * Checks if the mob has the status effect. If yes, it adds the amount passed in arguments to the remaining duration. If not, applies the status effect + * and sets the duration to the amount passed in arguments. + * * amount - Amount of time the status effect should be set to, in deciseconds. + * * ignore_canstun - If TRUE, the mob's resistance to stuns is ignored. + */ +/mob/living/proc/adjust_incapacitated(amount, ignore_canstun = FALSE) //Adds to remaining duration + if(IS_STUN_IMMUNE(src, ignore_canstun)) + return + if(absorb_stun(amount, ignore_canstun)) + return + var/datum/status_effect/incapacitating/incapacitated/incapacitated_status_effect = has_status_effect(STATUS_EFFECT_INCAPACITATED) + if(incapacitated_status_effect) + incapacitated_status_effect.duration += amount + else if(amount > 0) + incapacitated_status_effect = apply_status_effect(STATUS_EFFECT_INCAPACITATED, amount) + return incapacitated_status_effect //Blanket /mob/living/proc/AllImmobility(amount) @@ -263,7 +318,7 @@ AdjustImmobilized(amount) -//////////////////UNCONSCIOUS +/* UNCONSCIOUS */ /mob/living/proc/IsUnconscious() //If we're unconscious return has_status_effect(STATUS_EFFECT_UNCONSCIOUS) @@ -276,47 +331,43 @@ /mob/living/proc/Unconscious(amount, ignore_canstun = FALSE) //Can't go below remaining duration if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_UNCONSCIOUS, amount, ignore_canstun) & COMPONENT_NO_STUN) return - if(status_flags & GODMODE) + if(IS_STUN_IMMUNE(src, ignore_canstun)) return - if(((status_flags & CANUNCONSCIOUS) && !HAS_TRAIT(src, TRAIT_STUNIMMUNE)) || ignore_canstun) - var/datum/status_effect/incapacitating/unconscious/U = IsUnconscious() - if(U) - U.duration = max(world.time + amount, U.duration) - else if(amount > 0) - U = apply_status_effect(STATUS_EFFECT_UNCONSCIOUS, amount) - return U + var/datum/status_effect/incapacitating/unconscious/U = IsUnconscious() + if(U) + U.duration = max(world.time + amount, U.duration) + else if(amount > 0) + U = apply_status_effect(STATUS_EFFECT_UNCONSCIOUS, amount) + return U /mob/living/proc/SetUnconscious(amount, ignore_canstun = FALSE) //Sets remaining duration if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_UNCONSCIOUS, amount, ignore_canstun) & COMPONENT_NO_STUN) return - if(status_flags & GODMODE) + if(IS_STUN_IMMUNE(src, ignore_canstun)) return - if(((status_flags & CANUNCONSCIOUS) && !HAS_TRAIT(src, TRAIT_STUNIMMUNE)) || ignore_canstun) - var/datum/status_effect/incapacitating/unconscious/U = IsUnconscious() - if(amount <= 0) - if(U) - qdel(U) - else if(U) - U.duration = world.time + amount - else - U = apply_status_effect(STATUS_EFFECT_UNCONSCIOUS, amount) - return U + var/datum/status_effect/incapacitating/unconscious/U = IsUnconscious() + if(amount <= 0) + if(U) + qdel(U) + else if(U) + U.duration = world.time + amount + else + U = apply_status_effect(STATUS_EFFECT_UNCONSCIOUS, amount) + return U /mob/living/proc/AdjustUnconscious(amount, ignore_canstun = FALSE) //Adds to remaining duration if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_UNCONSCIOUS, amount, ignore_canstun) & COMPONENT_NO_STUN) return - if(status_flags & GODMODE) + if(IS_STUN_IMMUNE(src, ignore_canstun)) return - if(((status_flags & CANUNCONSCIOUS) && !HAS_TRAIT(src, TRAIT_STUNIMMUNE)) || ignore_canstun) - var/datum/status_effect/incapacitating/unconscious/U = IsUnconscious() - if(U) - U.duration += amount - else if(amount > 0) - U = apply_status_effect(STATUS_EFFECT_UNCONSCIOUS, amount) - return U - -/////////////////////////////////// SLEEPING //////////////////////////////////// + var/datum/status_effect/incapacitating/unconscious/U = IsUnconscious() + if(U) + U.duration += amount + else if(amount > 0) + U = apply_status_effect(STATUS_EFFECT_UNCONSCIOUS, amount) + return U +/* SLEEPING */ /mob/living/proc/IsSleeping() //If we're asleep if(!HAS_TRAIT(src, TRAIT_SLEEPIMMUNE)) return has_status_effect(STATUS_EFFECT_SLEEPING) @@ -391,11 +442,12 @@ ///////////////////////////////// FROZEN ///////////////////////////////////// +/* FROZEN */ /mob/living/proc/IsFrozen() return has_status_effect(/datum/status_effect/freon) -///////////////////////////////////// STUN ABSORPTION ///////////////////////////////////// +/* STUN ABSORPTION*/ /mob/living/proc/add_stun_absorption(key, duration, priority, message, self_message, examine_message) //adds a stun absorption with a key, a duration in deciseconds, its priority, and the messages it makes when you're stun/examined, if any if(!islist(stun_absorption)) @@ -457,8 +509,7 @@ return TRUE return FALSE -/////////////////////////////////// TRAIT PROCS //////////////////////////////////// - +/* TRAIT PROCS */ /mob/living/proc/cure_blind(source) if(source) REMOVE_TRAIT(src, TRAIT_BLIND, source) diff --git a/code/modules/reagents/chemistry/reagents/other_reagents.dm b/code/modules/reagents/chemistry/reagents/other_reagents.dm index 85c1a5b47c4..7c1a8d64aac 100644 --- a/code/modules/reagents/chemistry/reagents/other_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/other_reagents.dm @@ -212,6 +212,12 @@ . = ..() if(methods & TOUCH) exposed_mob.extinguish_mob() // extinguish removes all fire stacks + if(methods & VAPOR) + if(!isfelinid(exposed_mob)) + return + exposed_mob.incapacitate(1) // startles the felinid, canceling any do_after + SEND_SIGNAL(exposed_mob, COMSIG_ADD_MOOD_EVENT, "watersprayed", /datum/mood_event/watersprayed) + /datum/reagent/water/on_mob_life(mob/living/carbon/M, delta_time, times_fired) . = ..()