[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>
This commit is contained in:
CHOMPStation2StaffMirrorBot
2025-10-29 20:04:13 -07:00
committed by GitHub
parent 680c4d1396
commit 95839714c7
17 changed files with 147 additions and 75 deletions

View File

@@ -438,19 +438,27 @@
//ALL OF THESE DO NOT TAKE INTO ACCOUNT WHETHER AMOUNT IS 0 OR LOWER AND ARE SENT REGARDLESS! //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" #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" #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" #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" #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" #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 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) ///from base of /mob/living/can_track(): (mob/user)
#define COMSIG_LIVING_CAN_TRACK "mob_cantrack" #define COMSIG_LIVING_CAN_TRACK "mob_cantrack"
#define COMPONENT_CANT_TRACK (1<<0) #define COMPONENT_CANT_TRACK (1<<0)

View File

@@ -25,9 +25,14 @@
else else
RegisterSignal(host_mob, COMSIG_MOVABLE_Z_CHANGED, PROC_REF(handle_hostmob_moved)) 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_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_MOB_DEATH, PROC_REF(handle_endview))
RegisterSignal(host_mob, COMSIG_REMOTE_VIEW_CLEAR, PROC_REF(handle_forced_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 // 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)) if(isturf(focused_on))
RegisterSignal(host_mob, COMSIG_OBSERVER_MOVED, PROC_REF(handle_recursive_moved)) RegisterSignal(host_mob, COMSIG_OBSERVER_MOVED, PROC_REF(handle_recursive_moved))
@@ -45,9 +50,14 @@
else else
UnregisterSignal(host_mob, COMSIG_MOVABLE_Z_CHANGED) UnregisterSignal(host_mob, COMSIG_MOVABLE_Z_CHANGED)
UnregisterSignal(host_mob, COMSIG_MOB_RESET_PERSPECTIVE) UnregisterSignal(host_mob, COMSIG_MOB_RESET_PERSPECTIVE)
UnregisterSignal(host_mob, COMSIG_MOB_LOGOUT)
UnregisterSignal(host_mob, COMSIG_MOB_DEATH) UnregisterSignal(host_mob, COMSIG_MOB_DEATH)
UnregisterSignal(host_mob, COMSIG_REMOTE_VIEW_CLEAR) 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)) if(isturf(remote_view_target))
UnregisterSignal(host_mob, COMSIG_OBSERVER_MOVED) UnregisterSignal(host_mob, COMSIG_OBSERVER_MOVED)
// Cleanup remote view // Cleanup remote view
@@ -92,6 +102,18 @@
end_view() end_view()
qdel(src) 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) /datum/component/remote_view/proc/on_reset_perspective(datum/source)
SIGNAL_HANDLER SIGNAL_HANDLER
PRIVATE_PROC(TRUE) PRIVATE_PROC(TRUE)
@@ -158,6 +180,7 @@
RegisterSignal(host_item, COMSIG_QDELETING, PROC_REF(handle_endview)) RegisterSignal(host_item, COMSIG_QDELETING, PROC_REF(handle_endview))
RegisterSignal(host_item, COMSIG_MOVABLE_MOVED, 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_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)) 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 the user has already limited their HUD this avoids them having a HUD when they zoom in
if(host_mob.hud_used.hud_shown) if(host_mob.hud_used.hud_shown)
@@ -206,6 +229,7 @@
UnregisterSignal(host_item, COMSIG_QDELETING) UnregisterSignal(host_item, COMSIG_QDELETING)
UnregisterSignal(host_item, COMSIG_MOVABLE_MOVED) UnregisterSignal(host_item, COMSIG_MOVABLE_MOVED)
UnregisterSignal(host_item, COMSIG_ITEM_DROPPED) UnregisterSignal(host_item, COMSIG_ITEM_DROPPED)
UnregisterSignal(host_item, COMSIG_ITEM_EQUIPPED)
UnregisterSignal(host_item, COMSIG_REMOTE_VIEW_CLEAR) UnregisterSignal(host_item, COMSIG_REMOTE_VIEW_CLEAR)
host_item = null host_item = null
. = ..() . = ..()
@@ -304,6 +328,11 @@
UnregisterSignal(host_mob, COMSIG_OBSERVER_MOVED) 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) /datum/component/remote_view/mob_holding_item/handle_hostmob_moved(atom/source, atom/oldloc)
// We handle this in recursive move // We handle this in recursive move
if(!host_mob) if(!host_mob)

View File

@@ -47,7 +47,7 @@
/datum/component/xenochimera/proc/handle_regeneration() /datum/component/xenochimera/proc/handle_regeneration()
if(revive_ready == REVIVING_NOW || revive_ready == REVIVING_DONE) if(revive_ready == REVIVING_NOW || revive_ready == REVIVING_DONE)
owner.stunned = 5 owner.SetStunned(5)
owner.canmove = 0 owner.canmove = 0
owner.does_not_breathe = TRUE 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. if(prob(2)) // 2% chance of playing squelchy noise while reviving, which is run roughly every 2 seconds/tick while regenerating.

View File

@@ -61,4 +61,4 @@ Bonus
to_chat(L, span_warning(pick("Your head hurts", "Your mind blanks for a moment."))) to_chat(L, span_warning(pick("Your head hurts", "Your mind blanks for a moment.")))
else else
to_chat(L, span_userdanger("You can't think straight!")) 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))

View File

@@ -166,7 +166,7 @@ About the new airlock wires panel:
to_chat(user, span_danger("You feel a powerful shock course through your body!")) 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.playsound_local(get_turf(user), get_sfx("sparks"), vol = 75)
user.halloss += 10 user.halloss += 10
user.stunned += 10 user.AdjustStunned(10)
return return
..(user) ..(user)

View File

@@ -93,11 +93,11 @@
user.ooc_notes = target_ooc_notes user.ooc_notes = target_ooc_notes
user.ooc_notes_likes = target_likes user.ooc_notes_likes = target_likes
user.ooc_notes_dislikes = target_dislikes 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.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. 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. 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.eye_blurry = 30
M.slurring = 50 M.slurring = 50

View File

@@ -96,22 +96,22 @@
if(prob(5)) if(prob(5))
owner.AdjustWeakened(5) owner.AdjustWeakened(5)
if("permanent weakness") if("permanent weakness")
owner.weakened = max(owner.weakened,10) owner.SetWeakened(max(owner.weakened,10))
if("temporary sleeping") if("temporary sleeping")
if(prob(5)) if(prob(5))
owner.AdjustSleeping(5) owner.AdjustSleeping(5)
if("permanent sleeping") if("permanent sleeping")
owner.sleeping = max(owner.sleeping+10,10) owner.SetSleeping(max(owner.sleeping+10,10))
if("jittery") if("jittery")
if(owner.get_jittery() < 100) if(owner.get_jittery() < 100)
owner.make_jittery(100) owner.make_jittery(100)
if("paralysed") if("paralysed")
owner.paralysis = max(owner.paralysis,10) owner.SetParalysis(max(owner.paralysis,10))
if("cough") if("cough")
if(prob(3)) if(prob(3))
owner.emote("cough") owner.emote("cough")
if("confusion") if("confusion")
owner.confused = max(owner.confused,10) owner.SetConfused(max(owner.confused,10))
// Proc for setting all this up for GMs // Proc for setting all this up for GMs

View File

@@ -42,7 +42,7 @@
continue continue
to_chat(S, span_warning("Your integrated sensors detect an ionospheric anomaly. Your systems will be impacted as you begin a partial restart.")) 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) var/ionbug = rand(3, 9)
S.confused += ionbug S.AdjustConfused(ionbug)
S.eye_blurry += (ionbug - 1) S.eye_blurry += (ionbug - 1)
// Ionize silicon mobs // Ionize silicon mobs

View File

@@ -240,15 +240,15 @@
BITSET(hud_updateflag, HEALTH_HUD) 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 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 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 if(HULK in mutations) return
// Notify our AI if they can now control the suit. // Notify our AI if they can now control the suit.
if(wearing_rig && !stat && paralysis < amount) //We are passing out right this second. if(wearing_rig && !stat && paralysis < amount) //We are passing out right this second.
@@ -357,28 +357,28 @@
else 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! 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 = amount*species.stun_mod
..(amount) ..(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. if(amount > 0) // Only multiply it if positive.
amount = amount*species.stun_mod amount = amount*species.stun_mod
..(amount) ..(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! 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 = amount*species.weaken_mod
..(amount) ..(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. if(amount > 0) // Only multiply it if positive.
amount = amount*species.weaken_mod amount = amount*species.weaken_mod
..(amount) ..(amount)

View File

@@ -493,7 +493,7 @@
cloneloss = round(cloneloss / h_mult) cloneloss = round(cloneloss / h_mult)
maxHealth = newMaxHealth maxHealth = newMaxHealth
/mob/living/Stun(amount) /mob/living/Stun(amount, ignore_canstun = FALSE)
for(var/datum/modifier/M in modifiers) for(var/datum/modifier/M in modifiers)
if(!isnull(M.disable_duration_percent)) if(!isnull(M.disable_duration_percent))
amount = round(amount * M.disable_duration_percent) amount = round(amount * M.disable_duration_percent)
@@ -501,14 +501,14 @@
if(stunned > 0) if(stunned > 0)
add_status_indicator("stunned") add_status_indicator("stunned")
/mob/living/SetStunned(amount) /mob/living/SetStunned(amount, ignore_canstun = FALSE)
..() ..()
if(stunned <= 0) if(stunned <= 0)
remove_status_indicator("stunned") remove_status_indicator("stunned")
else else
add_status_indicator("stunned") add_status_indicator("stunned")
/mob/living/AdjustStunned(amount) /mob/living/AdjustStunned(amount, ignore_canstun = FALSE)
if(amount > 0) if(amount > 0)
for(var/datum/modifier/M in modifiers) for(var/datum/modifier/M in modifiers)
if(!isnull(M.disable_duration_percent)) if(!isnull(M.disable_duration_percent))
@@ -519,7 +519,7 @@
else else
add_status_indicator("stunned") add_status_indicator("stunned")
/mob/living/Weaken(amount) /mob/living/Weaken(amount, ignore_canstun = FALSE)
for(var/datum/modifier/M in modifiers) for(var/datum/modifier/M in modifiers)
if(!isnull(M.disable_duration_percent)) if(!isnull(M.disable_duration_percent))
amount = round(amount * M.disable_duration_percent) amount = round(amount * M.disable_duration_percent)
@@ -527,14 +527,14 @@
if(weakened > 0) if(weakened > 0)
add_status_indicator("weakened") add_status_indicator("weakened")
/mob/living/SetWeakened(amount) /mob/living/SetWeakened(amount, ignore_canstun = FALSE)
..() ..()
if(weakened <= 0) if(weakened <= 0)
remove_status_indicator("weakened") remove_status_indicator("weakened")
else else
add_status_indicator("weakened") add_status_indicator("weakened")
/mob/living/AdjustWeakened(amount) /mob/living/AdjustWeakened(amount, ignore_canstun = FALSE)
if(amount > 0) if(amount > 0)
for(var/datum/modifier/M in modifiers) for(var/datum/modifier/M in modifiers)
if(!isnull(M.disable_duration_percent)) if(!isnull(M.disable_duration_percent))
@@ -545,7 +545,7 @@
else else
add_status_indicator("weakened") add_status_indicator("weakened")
/mob/living/Paralyse(amount) /mob/living/Paralyse(amount, ignore_canstun = FALSE)
for(var/datum/modifier/M in modifiers) for(var/datum/modifier/M in modifiers)
if(!isnull(M.disable_duration_percent)) if(!isnull(M.disable_duration_percent))
amount = round(amount * M.disable_duration_percent) amount = round(amount * M.disable_duration_percent)
@@ -553,14 +553,14 @@
if(paralysis > 0) if(paralysis > 0)
add_status_indicator("paralysis") add_status_indicator("paralysis")
/mob/living/SetParalysis(amount) /mob/living/SetParalysis(amount, ignore_canstun = FALSE)
..() ..()
if(paralysis <= 0) if(paralysis <= 0)
remove_status_indicator("paralysis") remove_status_indicator("paralysis")
else else
add_status_indicator("paralysis") add_status_indicator("paralysis")
/mob/living/AdjustParalysis(amount) /mob/living/AdjustParalysis(amount, ignore_canstun = FALSE)
if(amount > 0) if(amount > 0)
for(var/datum/modifier/M in modifiers) for(var/datum/modifier/M in modifiers)
if(!isnull(M.disable_duration_percent)) if(!isnull(M.disable_duration_percent))
@@ -571,7 +571,7 @@
else else
add_status_indicator("paralysis") add_status_indicator("paralysis")
/mob/living/Sleeping(amount) /mob/living/Sleeping(amount, ignore_canstun = FALSE)
for(var/datum/modifier/M in modifiers) for(var/datum/modifier/M in modifiers)
if(!isnull(M.disable_duration_percent)) if(!isnull(M.disable_duration_percent))
amount = round(amount * M.disable_duration_percent) amount = round(amount * M.disable_duration_percent)
@@ -579,14 +579,14 @@
if(sleeping > 0) if(sleeping > 0)
add_status_indicator("sleeping") add_status_indicator("sleeping")
/mob/living/SetSleeping(amount) /mob/living/SetSleeping(amount, ignore_canstun = FALSE)
..() ..()
if(sleeping <= 0) if(sleeping <= 0)
remove_status_indicator("sleeping") remove_status_indicator("sleeping")
else else
add_status_indicator("sleeping") add_status_indicator("sleeping")
/mob/living/AdjustSleeping(amount) /mob/living/AdjustSleeping(amount, ignore_canstun = FALSE)
if(amount > 0) if(amount > 0)
for(var/datum/modifier/M in modifiers) for(var/datum/modifier/M in modifiers)
if(!isnull(M.disable_duration_percent)) if(!isnull(M.disable_duration_percent))
@@ -597,7 +597,7 @@
else else
add_status_indicator("sleeping") add_status_indicator("sleeping")
/mob/living/Confuse(amount) /mob/living/Confuse(amount, ignore_canstun = FALSE)
for(var/datum/modifier/M in modifiers) for(var/datum/modifier/M in modifiers)
if(!isnull(M.disable_duration_percent)) if(!isnull(M.disable_duration_percent))
amount = round(amount * M.disable_duration_percent) amount = round(amount * M.disable_duration_percent)
@@ -605,14 +605,14 @@
if(confused > 0) if(confused > 0)
add_status_indicator("confused") add_status_indicator("confused")
/mob/living/SetConfused(amount) /mob/living/SetConfused(amount, ignore_canstun = FALSE)
..() ..()
if(confused <= 0) if(confused <= 0)
remove_status_indicator("confused") remove_status_indicator("confused")
else else
add_status_indicator("confused") add_status_indicator("confused")
/mob/living/AdjustConfused(amount) /mob/living/AdjustConfused(amount, ignore_canstun = FALSE)
if(amount > 0) if(amount > 0)
for(var/datum/modifier/M in modifiers) for(var/datum/modifier/M in modifiers)
if(!isnull(M.disable_duration_percent)) if(!isnull(M.disable_duration_percent))
@@ -623,7 +623,7 @@
else else
add_status_indicator("confused") add_status_indicator("confused")
/mob/living/Blind(amount) /mob/living/Blind(amount, ignore_canstun = FALSE)
for(var/datum/modifier/M in modifiers) for(var/datum/modifier/M in modifiers)
if(!isnull(M.disable_duration_percent)) if(!isnull(M.disable_duration_percent))
amount = round(amount * M.disable_duration_percent) amount = round(amount * M.disable_duration_percent)
@@ -631,14 +631,14 @@
if(eye_blind > 0) if(eye_blind > 0)
add_status_indicator("blinded") add_status_indicator("blinded")
/mob/living/SetBlinded(amount) /mob/living/SetBlinded(amount, ignore_canstun = FALSE)
..() ..()
if(eye_blind <= 0) if(eye_blind <= 0)
remove_status_indicator("blinded") remove_status_indicator("blinded")
else else
add_status_indicator("blinded") add_status_indicator("blinded")
/mob/living/AdjustBlinded(amount) /mob/living/AdjustBlinded(amount, ignore_canstun = FALSE)
if(amount > 0) if(amount > 0)
for(var/datum/modifier/M in modifiers) for(var/datum/modifier/M in modifiers)
if(!isnull(M.disable_duration_percent)) if(!isnull(M.disable_duration_percent))

View File

@@ -52,9 +52,9 @@
..() ..()
SEND_SIGNAL(src, COMSIG_MOB_LOGIN) SEND_SIGNAL(src, COMSIG_MOB_LOGIN)
if(!restore_remote_views()) client.perspective = MOB_PERSPECTIVE
client.perspective = MOB_PERSPECTIVE client.eye = src
client.set_eye(src)
add_click_catcher() add_click_catcher()
update_client_color() update_client_color()

View File

@@ -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 we return focus to our own mob, but we are still inside something with an inherent remote view. Restart it.
if(restore_remote_views()) if(restore_remote_views())
return TRUE return TRUE
//Reset to common defaults: mob if on turf, otherwise current loc //Reset to common defaults: mob if on turf, otherwise current loc. Fallback to mob if we are in nullspace.
if(isturf(loc)) if(isturf(loc) || isnull(loc))
client.set_eye(client.mob) client.set_eye(client.mob)
client.perspective = MOB_PERSPECTIVE client.perspective = MOB_PERSPECTIVE
else else
@@ -833,94 +833,130 @@
/mob/proc/IsAdvancedToolUser() /mob/proc/IsAdvancedToolUser()
return 0 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) if(status_flags & CANSTUN)
facing_dir = null 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 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 update_canmove() //updates lying, canmove and icons
return 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) if(status_flags & CANSTUN)
stunned = max(amount,0) stunned = max(amount,0)
update_canmove() //updates lying, canmove and icons update_canmove() //updates lying, canmove and icons
return 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) if(status_flags & CANSTUN)
stunned = max(stunned + amount,0) stunned = max(stunned + amount,0)
update_canmove() //updates lying, canmove and icons update_canmove() //updates lying, canmove and icons
return 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) if(status_flags & CANWEAKEN)
facing_dir = null facing_dir = null
weakened = max(max(weakened,amount),0) weakened = max(max(weakened,amount),0)
update_canmove() //updates lying, canmove and icons update_canmove() //updates lying, canmove and icons
return 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) if(status_flags & CANWEAKEN)
weakened = max(amount,0) weakened = max(amount,0)
update_canmove() //can you guess what this does yet? update_canmove() //can you guess what this does yet?
return 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) if(status_flags & CANWEAKEN)
weakened = max(weakened + amount,0) weakened = max(weakened + amount,0)
update_canmove() //updates lying, canmove and icons update_canmove() //updates lying, canmove and icons
return 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) if(status_flags & CANPARALYSE)
facing_dir = null facing_dir = null
paralysis = max(max(paralysis,amount),0) paralysis = max(max(paralysis,amount),0)
return 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) if(status_flags & CANPARALYSE)
paralysis = max(amount,0) paralysis = max(amount,0)
return 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) if(status_flags & CANPARALYSE)
paralysis = max(paralysis + amount,0) paralysis = max(paralysis + amount,0)
return 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 facing_dir = null
sleeping = max(max(sleeping,amount),0) sleeping = max(max(sleeping,amount),0)
return 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) sleeping = max(amount,0)
return 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) sleeping = max(sleeping + amount,0)
return 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) confused = max(max(confused,amount),0)
return 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) confused = max(amount,0)
return 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) confused = max(confused + amount,0)
return 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) eye_blind = max(max(eye_blind,amount),0)
return 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) eye_blind = max(amount,0)
return 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) eye_blind = max(eye_blind + amount,0)
return return

View File

@@ -877,7 +877,7 @@
nif.stat = NIF_INSTALLING nif.stat = NIF_INSTALLING
nif.repair(removed) nif.repair(removed)
else if(prob(5)) 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.emote(pick("shudders", "seems lost", "blanks for a moment"))
M.adjust_nutrition(4 * removed) M.adjust_nutrition(4 * removed)

View File

@@ -111,8 +111,7 @@
/datum/reagent/unsorbitol/affect_blood(var/mob/living/carbon/M, var/alien, var/removed) /datum/reagent/unsorbitol/affect_blood(var/mob/living/carbon/M, var/alien, var/removed)
M.make_dizzy(1) M.make_dizzy(1)
M.adjustHalLoss(1) M.adjustHalLoss(1)
if(!M.confused) M.confused = 1 M.SetConfused(max(M.confused, 20))
M.confused = max(M.confused, 20)
M.hallucination = max(M.hallucination, 20) //This used to be += 15 resulting in INFINITE HALLUCINATION 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) for(var/obj/belly/B as anything in M.vore_organs)

View File

@@ -486,7 +486,7 @@
else 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.")) 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) occupant.eye_blurry = max(occupant.eye_blurry, blur_amount)
// Vore deaths get a fake modifier labeled as such // Vore deaths get a fake modifier labeled as such

View File

@@ -117,7 +117,7 @@
winner.visible_message(span_bold("\The [winner]") + " appears as if from thin air.") winner.visible_message(span_bold("\The [winner]") + " appears as if from thin air.")
if(FALLING_CRACKER) if(FALLING_CRACKER)
winner.visible_message(span_bold("\The [winner]") + " is suddenly knocked to the ground.") 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(TELEPORTING_CRACKER)
if(loser.can_be_drop_pred && loser.vore_selected) if(loser.can_be_drop_pred && loser.vore_selected)
if(winner.devourable && winner.can_be_drop_prey) if(winner.devourable && winner.can_be_drop_prey)

View File

@@ -53,7 +53,7 @@
C.adjust_nutrition(-50 * weakness) C.adjust_nutrition(-50 * weakness)
C.nutrition -= min(50 * weakness, C.nutrition) C.nutrition -= min(50 * weakness, C.nutrition)
C.make_dizzy(6 * weakness) C.make_dizzy(6 * weakness)
C.weakened += 6 * weakness C.AdjustWeakened(6 * weakness)
return 1 return 1
/datum/artifact_effect/health/DoEffectAura() /datum/artifact_effect/health/DoEffectAura()