From 95839714c7c499cb8bad956b68324c75dd9ab071 Mon Sep 17 00:00:00 2001 From: CHOMPStation2StaffMirrorBot <94713762+CHOMPStation2StaffMirrorBot@users.noreply.github.com> Date: Wed, 29 Oct 2025 20:04:13 -0700 Subject: [PATCH] [MIRROR] More Remote View Fixes (#11886) Co-authored-by: Will <7099514+Willburd@users.noreply.github.com> Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com> --- code/__defines/dcs/signals.dm | 22 ++++-- code/datums/components/remote_view.dm | 33 +++++++- code/datums/components/species/xenochimera.dm | 2 +- .../diseases/advance/symptoms/confusion.dm | 2 +- code/game/machinery/doors/airlock.dm | 2 +- .../objects/items/devices/body_snatcher_vr.dm | 4 +- code/modules/eventkit/medical_issues.dm | 8 +- code/modules/events/ion_storm.dm | 2 +- .../mob/living/carbon/human/human_damage.dm | 18 ++--- code/modules/mob/living/living.dm | 36 ++++----- code/modules/mob/login.dm | 6 +- code/modules/mob/mob.dm | 76 ++++++++++++++----- .../reagents/reagents/food_drinks_vr.dm | 2 +- code/modules/reagents/reagents/vore_vr.dm | 3 +- code/modules/resleeving/machines.dm | 2 +- code/modules/vore/resizing/crackers.dm | 2 +- .../modules/xenoarcheaology/effects/health.dm | 2 +- 17 files changed, 147 insertions(+), 75 deletions(-) diff --git a/code/__defines/dcs/signals.dm b/code/__defines/dcs/signals.dm index 65f99f2530..a973c0afd1 100644 --- a/code/__defines/dcs/signals.dm +++ b/code/__defines/dcs/signals.dm @@ -438,19 +438,27 @@ //ALL OF THESE DO NOT TAKE INTO ACCOUNT WHETHER AMOUNT IS 0 OR LOWER AND ARE SENT REGARDLESS! -///from base of mob/living/Stun() (amount, update, ignore) +///from base of mob/Stun() (amount, ignore_canstun) #define COMSIG_LIVING_STATUS_STUN "living_stun" -///from base of mob/living/Knockdown() (amount, update, ignore) +///from base of mob/Knockdown() (amount, update, ignore) #define COMSIG_LIVING_STATUS_KNOCKDOWN "living_knockdown" -///from base of mob/living/Paralyze() (amount, update, ignore) +///from base of mob/Weaken() (amount, ignore_canstun) +#define COMSIG_LIVING_STATUS_WEAKEN "living_weaken" +///from base of mob/Paralyze() (amount, ignore_canstun) #define COMSIG_LIVING_STATUS_PARALYZE "living_paralyze" -///from base of mob/living/Immobilize() (amount, update, ignore) +///from base of mob/Immobilize() (amount, update, ignore) #define COMSIG_LIVING_STATUS_IMMOBILIZE "living_immobilize" -///from base of mob/living/Unconscious() (amount, update, ignore) +///from base of mob/Unconscious() (amount, update, ignore) #define COMSIG_LIVING_STATUS_UNCONSCIOUS "living_unconscious" -///from base of mob/living/Sleeping() (amount, update, ignore) +///from base of mob/Sleeping() (amount, ignore_canstun) #define COMSIG_LIVING_STATUS_SLEEP "living_sleeping" - #define COMPONENT_NO_STUN (1<<0) //For all of them +///from base of mob/Confuse() (amount, ignore_canstun) +#define COMSIG_LIVING_STATUS_CONFUSE "living_confuse" +///from base of mob/Blind() (amount, ignore_canstun) +#define COMSIG_LIVING_STATUS_BLIND "living_blind" +/// from mob/living/check_stun_immunity(): (check_flags) +#define COMSIG_LIVING_GENERIC_STUN_CHECK "living_check_stun" + #define COMPONENT_NO_STUN (1<<0) //For all of them ///from base of /mob/living/can_track(): (mob/user) #define COMSIG_LIVING_CAN_TRACK "mob_cantrack" #define COMPONENT_CANT_TRACK (1<<0) diff --git a/code/datums/components/remote_view.dm b/code/datums/components/remote_view.dm index 130514610f..ada85c644f 100644 --- a/code/datums/components/remote_view.dm +++ b/code/datums/components/remote_view.dm @@ -25,9 +25,14 @@ else RegisterSignal(host_mob, COMSIG_MOVABLE_Z_CHANGED, PROC_REF(handle_hostmob_moved)) RegisterSignal(host_mob, COMSIG_MOB_RESET_PERSPECTIVE, PROC_REF(on_reset_perspective)) - RegisterSignal(host_mob, COMSIG_MOB_LOGOUT, PROC_REF(handle_endview)) RegisterSignal(host_mob, COMSIG_MOB_DEATH, PROC_REF(handle_endview)) RegisterSignal(host_mob, COMSIG_REMOTE_VIEW_CLEAR, PROC_REF(handle_forced_endview)) + // Upon any disruptive status effects + RegisterSignal(host_mob, COMSIG_LIVING_STATUS_STUN, PROC_REF(handle_status_effects)) + RegisterSignal(host_mob, COMSIG_LIVING_STATUS_WEAKEN, PROC_REF(handle_status_effects)) + RegisterSignal(host_mob, COMSIG_LIVING_STATUS_PARALYZE, PROC_REF(handle_status_effects)) + RegisterSignal(host_mob, COMSIG_LIVING_STATUS_SLEEP, PROC_REF(handle_status_effects)) + RegisterSignal(host_mob, COMSIG_LIVING_STATUS_BLIND, PROC_REF(handle_status_effects)) // Recursive move component fires this, we only want it to handle stuff like being inside a paicard when releasing turf lock if(isturf(focused_on)) RegisterSignal(host_mob, COMSIG_OBSERVER_MOVED, PROC_REF(handle_recursive_moved)) @@ -45,9 +50,14 @@ else UnregisterSignal(host_mob, COMSIG_MOVABLE_Z_CHANGED) UnregisterSignal(host_mob, COMSIG_MOB_RESET_PERSPECTIVE) - UnregisterSignal(host_mob, COMSIG_MOB_LOGOUT) UnregisterSignal(host_mob, COMSIG_MOB_DEATH) UnregisterSignal(host_mob, COMSIG_REMOTE_VIEW_CLEAR) + // Status effects + UnregisterSignal(host_mob, COMSIG_LIVING_STATUS_STUN) + UnregisterSignal(host_mob, COMSIG_LIVING_STATUS_WEAKEN) + UnregisterSignal(host_mob, COMSIG_LIVING_STATUS_PARALYZE) + UnregisterSignal(host_mob, COMSIG_LIVING_STATUS_SLEEP) + UnregisterSignal(host_mob, COMSIG_LIVING_STATUS_BLIND) if(isturf(remote_view_target)) UnregisterSignal(host_mob, COMSIG_OBSERVER_MOVED) // Cleanup remote view @@ -92,6 +102,18 @@ end_view() qdel(src) +/datum/component/remote_view/proc/handle_status_effects(datum/source, amount, ignore_canstun) + SIGNAL_HANDLER + PROTECTED_PROC(TRUE) + if(!host_mob) + return + // We don't really care what effect was caused, just that it was increasing the value and thus negatively affecting us. + if(amount <= 0) + return + if(host_mob.client && isturf(host_mob.client.eye) && host_mob.client.eye == get_turf(host_mob.client.mob)) // This handles turf decoupling being protected until we actually move. + return + handle_endview(source) + /datum/component/remote_view/proc/on_reset_perspective(datum/source) SIGNAL_HANDLER PRIVATE_PROC(TRUE) @@ -158,6 +180,7 @@ RegisterSignal(host_item, COMSIG_QDELETING, PROC_REF(handle_endview)) RegisterSignal(host_item, COMSIG_MOVABLE_MOVED, PROC_REF(handle_endview)) RegisterSignal(host_item, COMSIG_ITEM_DROPPED, PROC_REF(handle_endview)) + RegisterSignal(host_item, COMSIG_ITEM_EQUIPPED, PROC_REF(handle_endview)) RegisterSignal(host_item, COMSIG_REMOTE_VIEW_CLEAR, PROC_REF(handle_forced_endview)) // If the user has already limited their HUD this avoids them having a HUD when they zoom in if(host_mob.hud_used.hud_shown) @@ -206,6 +229,7 @@ UnregisterSignal(host_item, COMSIG_QDELETING) UnregisterSignal(host_item, COMSIG_MOVABLE_MOVED) UnregisterSignal(host_item, COMSIG_ITEM_DROPPED) + UnregisterSignal(host_item, COMSIG_ITEM_EQUIPPED) UnregisterSignal(host_item, COMSIG_REMOTE_VIEW_CLEAR) host_item = null . = ..() @@ -304,6 +328,11 @@ UnregisterSignal(host_mob, COMSIG_OBSERVER_MOVED) . = ..() +/datum/component/remote_view/mob_holding_item/handle_status_effects(datum/source, amount, ignore_canstun) + if(host_mob.loc == remote_view_target) // If we are still inside our holder or belly than don't bother spamming this + return + . = ..() + /datum/component/remote_view/mob_holding_item/handle_hostmob_moved(atom/source, atom/oldloc) // We handle this in recursive move if(!host_mob) diff --git a/code/datums/components/species/xenochimera.dm b/code/datums/components/species/xenochimera.dm index c66c57f45c..c9fa43cd5b 100644 --- a/code/datums/components/species/xenochimera.dm +++ b/code/datums/components/species/xenochimera.dm @@ -47,7 +47,7 @@ /datum/component/xenochimera/proc/handle_regeneration() if(revive_ready == REVIVING_NOW || revive_ready == REVIVING_DONE) - owner.stunned = 5 + owner.SetStunned(5) owner.canmove = 0 owner.does_not_breathe = TRUE if(prob(2)) // 2% chance of playing squelchy noise while reviving, which is run roughly every 2 seconds/tick while regenerating. diff --git a/code/datums/diseases/advance/symptoms/confusion.dm b/code/datums/diseases/advance/symptoms/confusion.dm index 29911dd7b2..e47a7fbaaa 100644 --- a/code/datums/diseases/advance/symptoms/confusion.dm +++ b/code/datums/diseases/advance/symptoms/confusion.dm @@ -61,4 +61,4 @@ Bonus to_chat(L, span_warning(pick("Your head hurts", "Your mind blanks for a moment."))) else to_chat(L, span_userdanger("You can't think straight!")) - L.confused = min(50 * power, L.confused+8) + L.SetConfused(min(50 * power, L.confused+8)) diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm index 60791cc236..529061d929 100644 --- a/code/game/machinery/doors/airlock.dm +++ b/code/game/machinery/doors/airlock.dm @@ -166,7 +166,7 @@ About the new airlock wires panel: to_chat(user, span_danger("You feel a powerful shock course through your body!")) user.playsound_local(get_turf(user), get_sfx("sparks"), vol = 75) user.halloss += 10 - user.stunned += 10 + user.AdjustStunned(10) return ..(user) diff --git a/code/game/objects/items/devices/body_snatcher_vr.dm b/code/game/objects/items/devices/body_snatcher_vr.dm index 33861f3bed..568a518957 100644 --- a/code/game/objects/items/devices/body_snatcher_vr.dm +++ b/code/game/objects/items/devices/body_snatcher_vr.dm @@ -93,11 +93,11 @@ user.ooc_notes = target_ooc_notes user.ooc_notes_likes = target_likes user.ooc_notes_dislikes = target_dislikes - user.sleeping = 10 //Device knocks out both the user and the target. + user.SetSleeping(10) //Device knocks out both the user and the target. user.eye_blurry = 30 //Blurry vision while they both get used to their new body's vision user.slurring = 50 //And let's also have them slurring while they attempt to get used to using their new body. if(ishuman(M)) //Let's not have the AI slurring, even though its downright hilarious. - M.sleeping = 10 + M.SetSleeping(10) M.eye_blurry = 30 M.slurring = 50 diff --git a/code/modules/eventkit/medical_issues.dm b/code/modules/eventkit/medical_issues.dm index dd8998a51d..7e1bbc2bc1 100644 --- a/code/modules/eventkit/medical_issues.dm +++ b/code/modules/eventkit/medical_issues.dm @@ -96,22 +96,22 @@ if(prob(5)) owner.AdjustWeakened(5) if("permanent weakness") - owner.weakened = max(owner.weakened,10) + owner.SetWeakened(max(owner.weakened,10)) if("temporary sleeping") if(prob(5)) owner.AdjustSleeping(5) if("permanent sleeping") - owner.sleeping = max(owner.sleeping+10,10) + owner.SetSleeping(max(owner.sleeping+10,10)) if("jittery") if(owner.get_jittery() < 100) owner.make_jittery(100) if("paralysed") - owner.paralysis = max(owner.paralysis,10) + owner.SetParalysis(max(owner.paralysis,10)) if("cough") if(prob(3)) owner.emote("cough") if("confusion") - owner.confused = max(owner.confused,10) + owner.SetConfused(max(owner.confused,10)) // Proc for setting all this up for GMs diff --git a/code/modules/events/ion_storm.dm b/code/modules/events/ion_storm.dm index 9b616c6315..25743dfe8e 100644 --- a/code/modules/events/ion_storm.dm +++ b/code/modules/events/ion_storm.dm @@ -42,7 +42,7 @@ continue to_chat(S, span_warning("Your integrated sensors detect an ionospheric anomaly. Your systems will be impacted as you begin a partial restart.")) var/ionbug = rand(3, 9) - S.confused += ionbug + S.AdjustConfused(ionbug) S.eye_blurry += (ionbug - 1) // Ionize silicon mobs diff --git a/code/modules/mob/living/carbon/human/human_damage.dm b/code/modules/mob/living/carbon/human/human_damage.dm index 3ad8412e0d..fe8e5c220c 100644 --- a/code/modules/mob/living/carbon/human/human_damage.dm +++ b/code/modules/mob/living/carbon/human/human_damage.dm @@ -240,15 +240,15 @@ BITSET(hud_updateflag, HEALTH_HUD) -/mob/living/carbon/human/Stun(amount) +/mob/living/carbon/human/Stun(amount, ignore_canstun = FALSE) if(HULK in mutations) return ..() -/mob/living/carbon/human/Weaken(amount) +/mob/living/carbon/human/Weaken(amount, ignore_canstun = FALSE) if(HULK in mutations) return ..() -/mob/living/carbon/human/Paralyse(amount) +/mob/living/carbon/human/Paralyse(amount, ignore_canstun = FALSE) if(HULK in mutations) return // Notify our AI if they can now control the suit. if(wearing_rig && !stat && paralysis < amount) //We are passing out right this second. @@ -357,28 +357,28 @@ else ..() -/mob/living/carbon/human/Stun(var/amount) +/mob/living/carbon/human/Stun(var/amount, ignore_canstun = FALSE) if(amount > 0) //only multiply it by the mod if it's positive, or else it takes longer to fade too! amount = amount*species.stun_mod ..(amount) -/mob/living/carbon/human/SetStunned(var/amount) +/mob/living/carbon/human/SetStunned(var/amount, ignore_canstun = FALSE) ..() -/mob/living/carbon/human/AdjustStunned(var/amount) +/mob/living/carbon/human/AdjustStunned(var/amount, ignore_canstun = FALSE) if(amount > 0) // Only multiply it if positive. amount = amount*species.stun_mod ..(amount) -/mob/living/carbon/human/Weaken(var/amount) +/mob/living/carbon/human/Weaken(var/amount, ignore_canstun = FALSE) if(amount > 0) //only multiply it by the mod if it's positive, or else it takes longer to fade too! amount = amount*species.weaken_mod ..(amount) -/mob/living/carbon/human/SetWeakened(var/amount) +/mob/living/carbon/human/SetWeakened(var/amount, ignore_canstun = FALSE) ..() -/mob/living/carbon/human/AdjustWeakened(var/amount) +/mob/living/carbon/human/AdjustWeakened(var/amount, ignore_canstun = FALSE) if(amount > 0) // Only multiply it if positive. amount = amount*species.weaken_mod ..(amount) diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 281ebb3df4..23b155c6c3 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -493,7 +493,7 @@ cloneloss = round(cloneloss / h_mult) maxHealth = newMaxHealth -/mob/living/Stun(amount) +/mob/living/Stun(amount, ignore_canstun = FALSE) for(var/datum/modifier/M in modifiers) if(!isnull(M.disable_duration_percent)) amount = round(amount * M.disable_duration_percent) @@ -501,14 +501,14 @@ if(stunned > 0) add_status_indicator("stunned") -/mob/living/SetStunned(amount) +/mob/living/SetStunned(amount, ignore_canstun = FALSE) ..() if(stunned <= 0) remove_status_indicator("stunned") else add_status_indicator("stunned") -/mob/living/AdjustStunned(amount) +/mob/living/AdjustStunned(amount, ignore_canstun = FALSE) if(amount > 0) for(var/datum/modifier/M in modifiers) if(!isnull(M.disable_duration_percent)) @@ -519,7 +519,7 @@ else add_status_indicator("stunned") -/mob/living/Weaken(amount) +/mob/living/Weaken(amount, ignore_canstun = FALSE) for(var/datum/modifier/M in modifiers) if(!isnull(M.disable_duration_percent)) amount = round(amount * M.disable_duration_percent) @@ -527,14 +527,14 @@ if(weakened > 0) add_status_indicator("weakened") -/mob/living/SetWeakened(amount) +/mob/living/SetWeakened(amount, ignore_canstun = FALSE) ..() if(weakened <= 0) remove_status_indicator("weakened") else add_status_indicator("weakened") -/mob/living/AdjustWeakened(amount) +/mob/living/AdjustWeakened(amount, ignore_canstun = FALSE) if(amount > 0) for(var/datum/modifier/M in modifiers) if(!isnull(M.disable_duration_percent)) @@ -545,7 +545,7 @@ else add_status_indicator("weakened") -/mob/living/Paralyse(amount) +/mob/living/Paralyse(amount, ignore_canstun = FALSE) for(var/datum/modifier/M in modifiers) if(!isnull(M.disable_duration_percent)) amount = round(amount * M.disable_duration_percent) @@ -553,14 +553,14 @@ if(paralysis > 0) add_status_indicator("paralysis") -/mob/living/SetParalysis(amount) +/mob/living/SetParalysis(amount, ignore_canstun = FALSE) ..() if(paralysis <= 0) remove_status_indicator("paralysis") else add_status_indicator("paralysis") -/mob/living/AdjustParalysis(amount) +/mob/living/AdjustParalysis(amount, ignore_canstun = FALSE) if(amount > 0) for(var/datum/modifier/M in modifiers) if(!isnull(M.disable_duration_percent)) @@ -571,7 +571,7 @@ else add_status_indicator("paralysis") -/mob/living/Sleeping(amount) +/mob/living/Sleeping(amount, ignore_canstun = FALSE) for(var/datum/modifier/M in modifiers) if(!isnull(M.disable_duration_percent)) amount = round(amount * M.disable_duration_percent) @@ -579,14 +579,14 @@ if(sleeping > 0) add_status_indicator("sleeping") -/mob/living/SetSleeping(amount) +/mob/living/SetSleeping(amount, ignore_canstun = FALSE) ..() if(sleeping <= 0) remove_status_indicator("sleeping") else add_status_indicator("sleeping") -/mob/living/AdjustSleeping(amount) +/mob/living/AdjustSleeping(amount, ignore_canstun = FALSE) if(amount > 0) for(var/datum/modifier/M in modifiers) if(!isnull(M.disable_duration_percent)) @@ -597,7 +597,7 @@ else add_status_indicator("sleeping") -/mob/living/Confuse(amount) +/mob/living/Confuse(amount, ignore_canstun = FALSE) for(var/datum/modifier/M in modifiers) if(!isnull(M.disable_duration_percent)) amount = round(amount * M.disable_duration_percent) @@ -605,14 +605,14 @@ if(confused > 0) add_status_indicator("confused") -/mob/living/SetConfused(amount) +/mob/living/SetConfused(amount, ignore_canstun = FALSE) ..() if(confused <= 0) remove_status_indicator("confused") else add_status_indicator("confused") -/mob/living/AdjustConfused(amount) +/mob/living/AdjustConfused(amount, ignore_canstun = FALSE) if(amount > 0) for(var/datum/modifier/M in modifiers) if(!isnull(M.disable_duration_percent)) @@ -623,7 +623,7 @@ else add_status_indicator("confused") -/mob/living/Blind(amount) +/mob/living/Blind(amount, ignore_canstun = FALSE) for(var/datum/modifier/M in modifiers) if(!isnull(M.disable_duration_percent)) amount = round(amount * M.disable_duration_percent) @@ -631,14 +631,14 @@ if(eye_blind > 0) add_status_indicator("blinded") -/mob/living/SetBlinded(amount) +/mob/living/SetBlinded(amount, ignore_canstun = FALSE) ..() if(eye_blind <= 0) remove_status_indicator("blinded") else add_status_indicator("blinded") -/mob/living/AdjustBlinded(amount) +/mob/living/AdjustBlinded(amount, ignore_canstun = FALSE) if(amount > 0) for(var/datum/modifier/M in modifiers) if(!isnull(M.disable_duration_percent)) diff --git a/code/modules/mob/login.dm b/code/modules/mob/login.dm index 5e288ba376..215d9b6689 100644 --- a/code/modules/mob/login.dm +++ b/code/modules/mob/login.dm @@ -52,9 +52,9 @@ ..() SEND_SIGNAL(src, COMSIG_MOB_LOGIN) - if(!restore_remote_views()) - client.perspective = MOB_PERSPECTIVE - client.set_eye(src) + client.perspective = MOB_PERSPECTIVE + client.eye = src + add_click_catcher() update_client_color() diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 5dbb801702..9cc7e0e48f 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -281,8 +281,8 @@ //If we return focus to our own mob, but we are still inside something with an inherent remote view. Restart it. if(restore_remote_views()) return TRUE - //Reset to common defaults: mob if on turf, otherwise current loc - if(isturf(loc)) + //Reset to common defaults: mob if on turf, otherwise current loc. Fallback to mob if we are in nullspace. + if(isturf(loc) || isnull(loc)) client.set_eye(client.mob) client.perspective = MOB_PERSPECTIVE else @@ -833,94 +833,130 @@ /mob/proc/IsAdvancedToolUser() return 0 -/mob/proc/Stun(amount) +/mob/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 & CANSTUN) facing_dir = null stunned = max(max(stunned,amount),0) //can't go below 0, getting a low amount of stun doesn't lower your current stun update_canmove() //updates lying, canmove and icons return -/mob/proc/SetStunned(amount) //if you REALLY need to set stun to a set amount without the whole "can't go below current stunned" +/mob/proc/SetStunned(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 & CANSTUN) stunned = max(amount,0) update_canmove() //updates lying, canmove and icons return -/mob/proc/AdjustStunned(amount) +/mob/proc/AdjustStunned(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 & CANSTUN) stunned = max(stunned + amount,0) update_canmove() //updates lying, canmove and icons return -/mob/proc/Weaken(amount) +/mob/proc/Weaken(amount, ignore_canstun = FALSE) //Can't go below remaining duration + if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_WEAKEN, amount, ignore_canstun) & COMPONENT_NO_STUN) + return if(status_flags & CANWEAKEN) facing_dir = null weakened = max(max(weakened,amount),0) update_canmove() //updates lying, canmove and icons return -/mob/proc/SetWeakened(amount) +/mob/proc/SetWeakened(amount, ignore_canstun = FALSE) //Sets remaining duration + if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_WEAKEN, amount, ignore_canstun) & COMPONENT_NO_STUN) + return if(status_flags & CANWEAKEN) weakened = max(amount,0) update_canmove() //can you guess what this does yet? return -/mob/proc/AdjustWeakened(amount) +/mob/proc/AdjustWeakened(amount, ignore_canstun = FALSE) //Adds to remaining duration + if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_WEAKEN, amount, ignore_canstun) & COMPONENT_NO_STUN) + return if(status_flags & CANWEAKEN) weakened = max(weakened + amount,0) update_canmove() //updates lying, canmove and icons return -/mob/proc/Paralyse(amount) +/mob/proc/Paralyse(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 & CANPARALYSE) facing_dir = null paralysis = max(max(paralysis,amount),0) return -/mob/proc/SetParalysis(amount) +/mob/proc/SetParalysis(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 & CANPARALYSE) paralysis = max(amount,0) return -/mob/proc/AdjustParalysis(amount) +/mob/proc/AdjustParalysis(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 & CANPARALYSE) paralysis = max(paralysis + amount,0) return -/mob/proc/Sleeping(amount) +/mob/proc/Sleeping(amount, ignore_canstun = FALSE) //Can't go below remaining duration + if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_SLEEP, amount, ignore_canstun) & COMPONENT_NO_STUN) + return facing_dir = null sleeping = max(max(sleeping,amount),0) return -/mob/proc/SetSleeping(amount) +/mob/proc/SetSleeping(amount, ignore_canstun = FALSE) //Sets remaining duration + if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_SLEEP, amount, ignore_canstun) & COMPONENT_NO_STUN) + return sleeping = max(amount,0) return -/mob/proc/AdjustSleeping(amount) +/mob/proc/AdjustSleeping(amount, ignore_canstun = FALSE) //Adds to remaining duration + if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_SLEEP, amount, ignore_canstun) & COMPONENT_NO_STUN) + return sleeping = max(sleeping + amount,0) return -/mob/proc/Confuse(amount) +/mob/proc/Confuse(amount, ignore_canstun = FALSE) //Can't go below remaining duration + if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_CONFUSE, amount, ignore_canstun) & COMPONENT_NO_STUN) + return confused = max(max(confused,amount),0) return -/mob/proc/SetConfused(amount) +/mob/proc/SetConfused(amount, ignore_canstun = FALSE) //Sets remaining duration + if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_CONFUSE, amount, ignore_canstun) & COMPONENT_NO_STUN) + return confused = max(amount,0) return -/mob/proc/AdjustConfused(amount) +/mob/proc/AdjustConfused(amount, ignore_canstun = FALSE) //Adds to remaining duration + if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_CONFUSE, amount, ignore_canstun) & COMPONENT_NO_STUN) + return confused = max(confused + amount,0) return -/mob/proc/Blind(amount) +/mob/proc/Blind(amount, ignore_canstun = FALSE) //Adds to remaining duration + if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_BLIND, amount, ignore_canstun) & COMPONENT_NO_STUN) + return eye_blind = max(max(eye_blind,amount),0) return -/mob/proc/SetBlinded(amount) +/mob/proc/SetBlinded(amount, ignore_canstun = FALSE) //Sets remaining duration + if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_BLIND, amount, ignore_canstun) & COMPONENT_NO_STUN) + return eye_blind = max(amount,0) return -/mob/proc/AdjustBlinded(amount) +/mob/proc/AdjustBlinded(amount, ignore_canstun = FALSE) //Adds to remaining duration + if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_BLIND, amount, ignore_canstun) & COMPONENT_NO_STUN) + return eye_blind = max(eye_blind + amount,0) return diff --git a/code/modules/reagents/reagents/food_drinks_vr.dm b/code/modules/reagents/reagents/food_drinks_vr.dm index fad189a55e..51dca2ce73 100644 --- a/code/modules/reagents/reagents/food_drinks_vr.dm +++ b/code/modules/reagents/reagents/food_drinks_vr.dm @@ -877,7 +877,7 @@ nif.stat = NIF_INSTALLING nif.repair(removed) else if(prob(5)) - M.confused = max(M.confused, 20) + M.SetConfused(max(M.confused, 20)) M.emote(pick("shudders", "seems lost", "blanks for a moment")) M.adjust_nutrition(4 * removed) diff --git a/code/modules/reagents/reagents/vore_vr.dm b/code/modules/reagents/reagents/vore_vr.dm index 47bf1787da..0cb32177a3 100644 --- a/code/modules/reagents/reagents/vore_vr.dm +++ b/code/modules/reagents/reagents/vore_vr.dm @@ -111,8 +111,7 @@ /datum/reagent/unsorbitol/affect_blood(var/mob/living/carbon/M, var/alien, var/removed) M.make_dizzy(1) M.adjustHalLoss(1) - if(!M.confused) M.confused = 1 - M.confused = max(M.confused, 20) + M.SetConfused(max(M.confused, 20)) M.hallucination = max(M.hallucination, 20) //This used to be += 15 resulting in INFINITE HALLUCINATION for(var/obj/belly/B as anything in M.vore_organs) diff --git a/code/modules/resleeving/machines.dm b/code/modules/resleeving/machines.dm index a53eaeb25d..1c2a470577 100644 --- a/code/modules/resleeving/machines.dm +++ b/code/modules/resleeving/machines.dm @@ -486,7 +486,7 @@ else to_chat(occupant, span_warning("You feel a small pain in your head as you're given a new backup implant. Oh, and a new body. It's disorienting, to say the least.")) - occupant.confused = max(occupant.confused, confuse_amount) + occupant.SetConfused(max(occupant.confused, confuse_amount)) // Apply immedeate effects occupant.eye_blurry = max(occupant.eye_blurry, blur_amount) // Vore deaths get a fake modifier labeled as such diff --git a/code/modules/vore/resizing/crackers.dm b/code/modules/vore/resizing/crackers.dm index dd75e8faf2..244fd19b9e 100644 --- a/code/modules/vore/resizing/crackers.dm +++ b/code/modules/vore/resizing/crackers.dm @@ -117,7 +117,7 @@ winner.visible_message(span_bold("\The [winner]") + " appears as if from thin air.") if(FALLING_CRACKER) winner.visible_message(span_bold("\The [winner]") + " is suddenly knocked to the ground.") - winner.weakened = max(winner.weakened,50) + winner.SetWeakened(max(winner.weakened,50)) if(TELEPORTING_CRACKER) if(loser.can_be_drop_pred && loser.vore_selected) if(winner.devourable && winner.can_be_drop_prey) diff --git a/code/modules/xenoarcheaology/effects/health.dm b/code/modules/xenoarcheaology/effects/health.dm index fda8387301..f6b29a02a1 100644 --- a/code/modules/xenoarcheaology/effects/health.dm +++ b/code/modules/xenoarcheaology/effects/health.dm @@ -53,7 +53,7 @@ C.adjust_nutrition(-50 * weakness) C.nutrition -= min(50 * weakness, C.nutrition) C.make_dizzy(6 * weakness) - C.weakened += 6 * weakness + C.AdjustWeakened(6 * weakness) return 1 /datum/artifact_effect/health/DoEffectAura()