refactor tags
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
for(var/I in overlays_standing)
|
||||
add_overlay(I)
|
||||
|
||||
var/asleep = _REFACTORING_IsSleeping()
|
||||
var/asleep = IsSleeping()
|
||||
if(stat == DEAD)
|
||||
//If we mostly took damage from fire
|
||||
if(fireloss > 125)
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
if(health<= -maxHealth || !getorgan(/obj/item/organ/brain))
|
||||
death()
|
||||
return
|
||||
if(_REFACTORING_IsUnconscious() || _REFACTORING_IsSleeping() || getOxyLoss() > 50 || (HAS_TRAIT(src, TRAIT_DEATHCOMA)) || health <= crit_threshold)
|
||||
if(IsUnconscious() || IsSleeping() || getOxyLoss() > 50 || (HAS_TRAIT(src, TRAIT_DEATHCOMA)) || health <= crit_threshold)
|
||||
if(stat == CONSCIOUS)
|
||||
stat = UNCONSCIOUS
|
||||
blind_eyes(1)
|
||||
|
||||
@@ -14,9 +14,9 @@
|
||||
icon_state = "larva[state]_dead"
|
||||
else if(handcuffed || legcuffed) //This should be an overlay. Who made this an icon_state?
|
||||
icon_state = "larva[state]_cuff"
|
||||
else if(stat == UNCONSCIOUS || lying || _REFACTORING_resting)
|
||||
else if(stat == UNCONSCIOUS || lying || resting)
|
||||
icon_state = "larva[state]_sleep"
|
||||
else if(_REFACTORING_IsStun() || IsParalyzed())
|
||||
else if(IsStun() || IsParalyzed())
|
||||
icon_state = "larva[state]_stun"
|
||||
else
|
||||
icon_state = "larva[state]"
|
||||
|
||||
@@ -803,7 +803,7 @@
|
||||
if(health <= HEALTH_THRESHOLD_DEAD && !HAS_TRAIT(src, TRAIT_NODEATH))
|
||||
death()
|
||||
return
|
||||
if(_REFACTORING_IsUnconscious() || _REFACTORING_IsSleeping() || getOxyLoss() > 50 || (HAS_TRAIT(src, TRAIT_DEATHCOMA)) || (health <= HEALTH_THRESHOLD_FULLCRIT && !HAS_TRAIT(src, TRAIT_NOHARDCRIT)))
|
||||
if(IsUnconscious() || IsSleeping() || getOxyLoss() > 50 || (HAS_TRAIT(src, TRAIT_DEATHCOMA)) || (health <= HEALTH_THRESHOLD_FULLCRIT && !HAS_TRAIT(src, TRAIT_NOHARDCRIT)))
|
||||
stat = UNCONSCIOUS
|
||||
blind_eyes(1)
|
||||
if(combatmode)
|
||||
@@ -965,7 +965,7 @@
|
||||
return FALSE
|
||||
if(hallucinating())
|
||||
return TRUE
|
||||
if(_REFACTORING_IsSleeping())
|
||||
if(IsSleeping())
|
||||
return TRUE
|
||||
if(HAS_TRAIT(src, TRAIT_DUMB))
|
||||
return TRUE
|
||||
|
||||
@@ -79,7 +79,7 @@
|
||||
visible_message("<span class='danger'>[M] has attempted to punch [name]!</span>", \
|
||||
"<span class='userdanger'>[M] has attempted to punch [name]!</span>", null, COMBAT_MESSAGE_RANGE)
|
||||
if(INTENT_DISARM)
|
||||
if(!_REFACTORING_IsUnconscious())
|
||||
if(!IsUnconscious())
|
||||
M.do_attack_animation(src, ATTACK_EFFECT_DISARM)
|
||||
if (prob(25))
|
||||
DefaultCombatKnockdown(40)
|
||||
|
||||
@@ -416,7 +416,7 @@
|
||||
set name = "Sleep"
|
||||
set category = "IC"
|
||||
|
||||
if(_REFACTORING_IsSleeping())
|
||||
if(IsSleeping())
|
||||
to_chat(src, "<span class='notice'>You are already sleeping.</span>")
|
||||
return
|
||||
else
|
||||
@@ -674,7 +674,7 @@
|
||||
if(on_fire)
|
||||
resist_fire() //stop, drop, and roll
|
||||
return
|
||||
if(_REFACTORING_resting) //cit change - allows resisting out of resting
|
||||
if(resting) //cit change - allows resisting out of resting
|
||||
resist_a_rest() // ditto
|
||||
return
|
||||
if(resist_embedded()) //Citadel Change for embedded removal memes
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
|
||||
//Force-set resting variable, without needing to resist/etc.
|
||||
/mob/living/proc/set_resting(new_resting, silent = FALSE, updating = TRUE)
|
||||
_REFACTORING_resting = new_resting
|
||||
resting = new_resting
|
||||
if(!silent)
|
||||
to_chat(src, "<span class='notice'>You are now [_REFACTORING_resting? "resting" : "getting up"].</span>")
|
||||
to_chat(src, "<span class='notice'>You are now [resting? "resting" : "getting up"].</span>")
|
||||
update_resting(updating)
|
||||
|
||||
/mob/living/proc/update_resting(update_mobility = TRUE)
|
||||
@@ -25,20 +25,20 @@
|
||||
set category = "IC"
|
||||
if(client?.prefs?.autostand)
|
||||
intentionalresting = !intentionalresting
|
||||
to_chat(src, "<span class='notice'>You are now attempting to [intentionalresting ? "[!_REFACTORING_resting ? "lay down and ": ""]stay down" : "[_REFACTORING_resting ? "get up and ": ""]stay up"].</span>")
|
||||
if(intentionalresting && !_REFACTORING_resting)
|
||||
to_chat(src, "<span class='notice'>You are now attempting to [intentionalresting ? "[!resting ? "lay down and ": ""]stay down" : "[resting ? "get up and ": ""]stay up"].</span>")
|
||||
if(intentionalresting && !resting)
|
||||
set_resting(TRUE, FALSE)
|
||||
else
|
||||
resist_a_rest()
|
||||
else
|
||||
if(!_REFACTORING_resting)
|
||||
if(!resting)
|
||||
set_resting(TRUE, FALSE)
|
||||
to_chat(src, "<span class='notice'>You are now laying down.</span>")
|
||||
else
|
||||
resist_a_rest()
|
||||
|
||||
/mob/living/proc/resist_a_rest(automatic = FALSE, ignoretimer = FALSE) //Lets mobs resist out of resting. Major QOL change with combat reworks.
|
||||
if(!_REFACTORING_resting || stat || attemptingstandup)
|
||||
if(!resting || stat || attemptingstandup)
|
||||
return FALSE
|
||||
if(ignoretimer)
|
||||
set_resting(FALSE, FALSE)
|
||||
@@ -84,20 +84,20 @@
|
||||
var/stat_softcrit = stat == SOFT_CRIT
|
||||
var/stat_conscious = (stat == CONSCIOUS) || stat_softcrit
|
||||
|
||||
var/conscious = !_REFACTORING_IsUnconscious() && stat_conscious && !HAS_TRAIT(src, TRAIT_DEATHCOMA)
|
||||
var/conscious = !IsUnconscious() && stat_conscious && !HAS_TRAIT(src, TRAIT_DEATHCOMA)
|
||||
|
||||
var/has_arms = get_num_arms()
|
||||
var/has_legs = get_num_legs()
|
||||
var/ignore_legs = get_leg_ignore()
|
||||
var/stun = _REFACTORING_IsStun()
|
||||
var/stun = IsStun()
|
||||
var/paralyze = IsParalyzed()
|
||||
var/knockdown = _REFACTORING_IsKnockdown()
|
||||
var/knockdown = IsKnockdown()
|
||||
var/daze = IsDazed()
|
||||
var/immobilize = IsImmobilized()
|
||||
|
||||
var/chokehold = pulledby && pulledby.grab_state >= GRAB_NECK
|
||||
var/restrained = restrained()
|
||||
var/pinned = _REFACTORING_resting && pulledby && pulledby.grab_state >= GRAB_AGGRESSIVE // Cit change - adds pinning for aggressive-grabbing people on the ground
|
||||
var/pinned = resting && pulledby && pulledby.grab_state >= GRAB_AGGRESSIVE // Cit change - adds pinning for aggressive-grabbing people on the ground
|
||||
var/canmove = !immobilize && !stun && conscious && !paralyze && !buckled && (!stat_softcrit || !pulledby) && !chokehold && !IsFrozen() && (has_arms || ignore_legs || has_legs) && !pinned && !recoveringstam
|
||||
|
||||
if(canmove)
|
||||
@@ -105,7 +105,7 @@
|
||||
else
|
||||
mobility_flags &= ~MOBILITY_MOVE
|
||||
var/canstand_involuntary = conscious && !stat_softcrit && !knockdown && !chokehold && !paralyze && (ignore_legs || has_legs) && !(buckled && buckled.buckle_lying) || !recoveringstam
|
||||
var/canstand = canstand_involuntary && !_REFACTORING_resting
|
||||
var/canstand = canstand_involuntary && !resting
|
||||
|
||||
var/should_be_lying = !canstand
|
||||
if(buckled)
|
||||
|
||||
@@ -100,7 +100,7 @@
|
||||
/mob/living/silicon/pai/lay_down()
|
||||
. = ..()
|
||||
if(loc != card)
|
||||
visible_message("<span class='notice'>[src] [_REFACTORING_resting? "lays down for a moment..." : "perks up from the ground"]</span>")
|
||||
visible_message("<span class='notice'>[src] [resting? "lays down for a moment..." : "perks up from the ground"]</span>")
|
||||
update_icon()
|
||||
|
||||
/mob/living/silicon/pai/start_pulling(atom/movable/AM, gs)
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
icon = dynamic_chassis_icons[dynamic_chassis]
|
||||
var/list/states = icon_states(icon)
|
||||
icon_state = ""
|
||||
if(_REFACTORING_resting) //The next line is some bullshit but I can make it worse if you want and make it a single line instead of four.. :)
|
||||
if(resting) //The next line is some bullshit but I can make it worse if you want and make it a single line instead of four.. :)
|
||||
if(dynamic_chassis_sit && ("sit") in states)
|
||||
icon_state = "sit"
|
||||
else if(dynamic_chassis_bellyup && ("bellyup") in states)
|
||||
@@ -21,7 +21,7 @@
|
||||
rotate_on_lying = TRUE
|
||||
else
|
||||
icon = initial(icon)
|
||||
icon_state = "[chassis][_REFACTORING_resting? "_rest" : (stat == DEAD? "_dead" : "")]"
|
||||
icon_state = "[chassis][resting? "_rest" : (stat == DEAD? "_dead" : "")]"
|
||||
rotate_on_lying = FALSE
|
||||
pixel_x = ((chassis == "dynamic") && chassis_pixel_offsets_x[dynamic_chassis]) || 0
|
||||
update_transform()
|
||||
|
||||
@@ -675,7 +675,7 @@
|
||||
if(module.cyborg_base_icon == "robot")
|
||||
icon = 'icons/mob/robots.dmi'
|
||||
pixel_x = initial(pixel_x)
|
||||
if(stat != DEAD && !(_REFACTORING_IsUnconscious() ||_REFACTORING_IsStun() || _REFACTORING_IsKnockdown() || IsParalyzed() || low_power_mode)) //Not dead, not stunned.
|
||||
if(stat != DEAD && !(IsUnconscious() ||IsStun() || IsKnockdown() || IsParalyzed() || low_power_mode)) //Not dead, not stunned.
|
||||
if(!eye_lights)
|
||||
eye_lights = new()
|
||||
if(lamp_intensity > 2)
|
||||
@@ -699,7 +699,7 @@
|
||||
update_fire()
|
||||
|
||||
if(client && stat != DEAD && module.dogborg == TRUE)
|
||||
if(_REFACTORING_resting)
|
||||
if(resting)
|
||||
if(sitting)
|
||||
icon_state = "[module.cyborg_base_icon]-sit"
|
||||
if(bellyup)
|
||||
@@ -1020,7 +1020,7 @@
|
||||
if(health <= -maxHealth) //die only once
|
||||
death()
|
||||
return
|
||||
if(_REFACTORING_IsUnconscious() || _REFACTORING_IsStun() || IsParalyzed() || getOxyLoss() > maxHealth*0.5)
|
||||
if(IsUnconscious() || IsStun() || IsParalyzed() || getOxyLoss() > maxHealth*0.5)
|
||||
if(stat == CONSCIOUS)
|
||||
stat = UNCONSCIOUS
|
||||
blind_eyes(1)
|
||||
@@ -1271,7 +1271,7 @@
|
||||
/mob/living/silicon/robot/update_mobility()
|
||||
. = ..()
|
||||
if(client && stat != DEAD && dogborg == FALSE)
|
||||
if(_REFACTORING_resting)
|
||||
if(resting)
|
||||
cut_overlays()
|
||||
icon_state = "[module.cyborg_base_icon]-rest"
|
||||
else
|
||||
|
||||
@@ -136,7 +136,7 @@
|
||||
|
||||
/mob/living/silicon/robot/proc/beep_boop_rogue_bot(mob/user)
|
||||
SetEmagged(1)
|
||||
_REFACTORING_SetStun(60) //Borgs were getting into trouble because they would attack the emagger before the new laws were shown
|
||||
SetStun(60) //Borgs were getting into trouble because they would attack the emagger before the new laws were shown
|
||||
lawupdate = 0
|
||||
connected_ai = null
|
||||
message_admins("[ADMIN_LOOKUPFLW(user)] emagged cyborg [ADMIN_LOOKUPFLW(src)]. Laws overridden.")
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/mob/living/silicon/robot/update_mobility()
|
||||
var/newflags = NONE
|
||||
if(!stat)
|
||||
if(!_REFACTORING_resting)
|
||||
if(!resting)
|
||||
newflags |= MOBILITY_STAND
|
||||
if(!locked_down)
|
||||
newflags |= MOBILITY_MOVE
|
||||
|
||||
@@ -170,7 +170,7 @@
|
||||
if(!..())
|
||||
return
|
||||
|
||||
if(_REFACTORING_IsStun() || IsParalyzed())
|
||||
if(IsStun() || IsParalyzed())
|
||||
old_target_fire = target_fire
|
||||
target_fire = null
|
||||
mode = BOT_IDLE
|
||||
@@ -287,7 +287,7 @@
|
||||
if(!on)
|
||||
icon_state = "firebot0"
|
||||
return
|
||||
if(_REFACTORING_IsStun() || IsParalyzed())
|
||||
if(IsStun() || IsParalyzed())
|
||||
icon_state = "firebots1"
|
||||
else if(stationary_mode) //Bot has yellow light to indicate stationary mode.
|
||||
icon_state = "firebots1"
|
||||
|
||||
@@ -149,7 +149,7 @@ Maintenance panel panel is [open ? "opened" : "closed"]"},
|
||||
if (emagged <= 1)
|
||||
honk_attack(A)
|
||||
else
|
||||
if(!C._REFACTORING_IsStun() || arrest_type)
|
||||
if(!C.IsStun() || arrest_type)
|
||||
stun_attack(A)
|
||||
..()
|
||||
else if (!spam_flag) //honking at the ground
|
||||
|
||||
@@ -86,7 +86,7 @@
|
||||
if(!on)
|
||||
icon_state = "medibot0"
|
||||
return
|
||||
if(_REFACTORING_IsStun())
|
||||
if(IsStun())
|
||||
icon_state = "medibota"
|
||||
return
|
||||
if(mode == BOT_HEALING)
|
||||
@@ -278,7 +278,7 @@
|
||||
if(mode == BOT_HEALING)
|
||||
return
|
||||
|
||||
if(_REFACTORING_IsStun())
|
||||
if(IsStun())
|
||||
oldpatient = patient
|
||||
patient = null
|
||||
mode = BOT_IDLE
|
||||
|
||||
@@ -180,7 +180,7 @@
|
||||
collar_type = "[initial(collar_type)]_sit"
|
||||
set_resting(TRUE)
|
||||
else if (prob(1))
|
||||
if (_REFACTORING_resting)
|
||||
if (resting)
|
||||
emote("me", EMOTE_VISIBLE, pick("gets up and meows.", "walks around.", "stops resting."))
|
||||
icon_state = "[icon_living]"
|
||||
collar_type = "[initial(collar_type)]"
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
..()
|
||||
//CRAB movement
|
||||
if(!ckey && !stat)
|
||||
if(isturf(loc) && !_REFACTORING_resting && !buckled) //This is so it only moves if it's not inside a closet, gentics machine, etc.
|
||||
if(isturf(loc) && !resting && !buckled) //This is so it only moves if it's not inside a closet, gentics machine, etc.
|
||||
turns_since_move++
|
||||
if(turns_since_move >= turns_per_move)
|
||||
var/east_vs_west = pick(4,8)
|
||||
|
||||
@@ -418,7 +418,7 @@
|
||||
..()
|
||||
|
||||
/mob/living/simple_animal/update_mobility(value_otherwise = MOBILITY_FLAGS_DEFAULT)
|
||||
if(_REFACTORING_IsUnconscious() || _REFACTORING_IsStun() || IsParalyzed() || stat || _REFACTORING_resting)
|
||||
if(IsUnconscious() || IsStun() || IsParalyzed() || stat || resting)
|
||||
drop_all_held_items()
|
||||
mobility_flags = NONE
|
||||
else if(buckled)
|
||||
|
||||
@@ -22,11 +22,11 @@
|
||||
|
||||
////////////////////////////// STUN ////////////////////////////////////
|
||||
|
||||
/mob/living/proc/_REFACTORING_IsStun() //If we're stunned
|
||||
/mob/living/proc/IsStun() //If we're stunned
|
||||
return has_status_effect(STATUS_EFFECT_STUN)
|
||||
|
||||
/mob/living/proc/_REFACTORING_AmountStun() //How many deciseconds remain in our stun
|
||||
var/datum/status_effect/incapacitating/stun/S = _REFACTORING_IsStun()
|
||||
/mob/living/proc/AmountStun() //How many deciseconds remain in our stun
|
||||
var/datum/status_effect/incapacitating/stun/S = IsStun()
|
||||
if(S)
|
||||
return S.duration - world.time
|
||||
return 0
|
||||
@@ -37,18 +37,18 @@
|
||||
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 = _REFACTORING_IsStun()
|
||||
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, updating)
|
||||
return S
|
||||
|
||||
/mob/living/proc/_REFACTORING_SetStun(amount, updating = TRUE, ignore_canstun = FALSE) //Sets remaining duration
|
||||
/mob/living/proc/SetStun(amount, updating = TRUE, ignore_canstun = FALSE) //Sets remaining duration
|
||||
if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_STUN, amount, updating, ignore_canstun) & COMPONENT_NO_STUN)
|
||||
return
|
||||
if(((status_flags & CANSTUN) && !HAS_TRAIT(src, TRAIT_STUNIMMUNE)) || ignore_canstun)
|
||||
var/datum/status_effect/incapacitating/stun/S = _REFACTORING_IsStun()
|
||||
var/datum/status_effect/incapacitating/stun/S = IsStun()
|
||||
if(amount <= 0)
|
||||
if(S)
|
||||
qdel(S)
|
||||
@@ -61,13 +61,13 @@
|
||||
S = apply_status_effect(STATUS_EFFECT_STUN, amount, updating)
|
||||
return S
|
||||
|
||||
/mob/living/proc/_REFACTORING_AdjustStun(amount, updating = TRUE, ignore_canstun = FALSE) //Adds to remaining duration
|
||||
/mob/living/proc/AdjustStun(amount, updating = TRUE, ignore_canstun = FALSE) //Adds to remaining duration
|
||||
if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_STUN, amount, updating, ignore_canstun) & COMPONENT_NO_STUN)
|
||||
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 = _REFACTORING_IsStun()
|
||||
var/datum/status_effect/incapacitating/stun/S = IsStun()
|
||||
if(S)
|
||||
S.duration += amount
|
||||
else if(amount > 0)
|
||||
@@ -76,33 +76,33 @@
|
||||
|
||||
///////////////////////////////// KNOCKDOWN /////////////////////////////////////
|
||||
|
||||
/mob/living/proc/_REFACTORING_IsKnockdown() //If we're knocked down
|
||||
/mob/living/proc/IsKnockdown() //If we're knocked down
|
||||
return has_status_effect(STATUS_EFFECT_KNOCKDOWN)
|
||||
|
||||
/mob/living/proc/_REFACTORING_AmountKnockdown() //How many deciseconds remain in our knockdown
|
||||
var/datum/status_effect/incapacitating/knockdown/K = _REFACTORING_IsKnockdown()
|
||||
/mob/living/proc/AmountKnockdown() //How many deciseconds remain in our knockdown
|
||||
var/datum/status_effect/incapacitating/knockdown/K = IsKnockdown()
|
||||
if(K)
|
||||
return K.duration - world.time
|
||||
return 0
|
||||
|
||||
/mob/living/proc/_REFACTORING_Knockdown(amount, updating = TRUE, ignore_canstun = FALSE) //Can't go below remaining duration
|
||||
/mob/living/proc/Knockdown(amount, updating = TRUE, ignore_canstun = FALSE) //Can't go below remaining duration
|
||||
if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_KNOCKDOWN, amount, updating, ignore_canstun) & COMPONENT_NO_STUN)
|
||||
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 = _REFACTORING_IsKnockdown()
|
||||
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, updating)
|
||||
return K
|
||||
|
||||
/mob/living/proc/_REFACTORING_SetKnockdown(amount, updating = TRUE, ignore_canstun = FALSE) //Sets remaining duration
|
||||
/mob/living/proc/SetKnockdown(amount, updating = TRUE, ignore_canstun = FALSE) //Sets remaining duration
|
||||
if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_KNOCKDOWN, amount, updating, ignore_canstun) & COMPONENT_NO_STUN)
|
||||
return
|
||||
if(((status_flags & CANKNOCKDOWN) && !HAS_TRAIT(src, TRAIT_STUNIMMUNE)) || ignore_canstun)
|
||||
var/datum/status_effect/incapacitating/knockdown/K = _REFACTORING_IsKnockdown()
|
||||
var/datum/status_effect/incapacitating/knockdown/K = IsKnockdown()
|
||||
if(amount <= 0)
|
||||
if(K)
|
||||
qdel(K)
|
||||
@@ -115,13 +115,13 @@
|
||||
K = apply_status_effect(STATUS_EFFECT_KNOCKDOWN, amount, updating)
|
||||
return K
|
||||
|
||||
/mob/living/proc/_REFACTORING_AdjustKnockdown(amount, updating = TRUE, ignore_canstun = FALSE) //Adds to remaining duration
|
||||
/mob/living/proc/AdjustKnockdown(amount, updating = TRUE, ignore_canstun = FALSE) //Adds to remaining duration
|
||||
if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_KNOCKDOWN, amount, updating, ignore_canstun) & COMPONENT_NO_STUN)
|
||||
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 = _REFACTORING_IsKnockdown()
|
||||
var/datum/status_effect/incapacitating/knockdown/K = IsKnockdown()
|
||||
if(K)
|
||||
K.duration += amount
|
||||
else if(amount > 0)
|
||||
@@ -290,7 +290,7 @@
|
||||
//Blanket
|
||||
/mob/living/proc/AllImmobility(amount, updating, ignore_canstun = FALSE)
|
||||
Paralyze(amount, FALSE, ignore_canstun)
|
||||
_REFACTORING_Knockdown(amount, FALSE, ignore_canstun)
|
||||
Knockdown(amount, FALSE, ignore_canstun)
|
||||
Stun(amount, FALSE, ignore_canstun)
|
||||
Immobilize(amount, FALSE, ignore_canstun)
|
||||
Daze(amount, FALSE, ignore_canstun)
|
||||
@@ -299,8 +299,8 @@
|
||||
|
||||
/mob/living/proc/SetAllImmobility(amount, updating, ignore_canstun = FALSE)
|
||||
SetParalyzed(amount, FALSE, ignore_canstun)
|
||||
_REFACTORING_SetKnockdown(amount, FALSE, ignore_canstun)
|
||||
_REFACTORING_SetStun(amount, FALSE, ignore_canstun)
|
||||
SetKnockdown(amount, FALSE, ignore_canstun)
|
||||
SetStun(amount, FALSE, ignore_canstun)
|
||||
SetImmobilized(amount, FALSE, ignore_canstun)
|
||||
SetDazed(amount, FALSE, ignore_canstun)
|
||||
if(updating)
|
||||
@@ -308,8 +308,8 @@
|
||||
|
||||
/mob/living/proc/AdjustAllImmobility(amount, updating, ignore_canstun = FALSE)
|
||||
AdjustParalyzed(amount, FALSE, ignore_canstun)
|
||||
_REFACTORING_AdjustKnockdown(amount, FALSE, ignore_canstun)
|
||||
_REFACTORING_AdjustStun(amount, FALSE, ignore_canstun)
|
||||
AdjustKnockdown(amount, FALSE, ignore_canstun)
|
||||
AdjustStun(amount, FALSE, ignore_canstun)
|
||||
AdjustImmobilized(amount, FALSE, ignore_canstun)
|
||||
AdjustDazed(amount, FALSE, ignore_canstun)
|
||||
if(updating)
|
||||
@@ -317,10 +317,10 @@
|
||||
|
||||
/// Makes sure all 5 of the non-knockout immobilizing status effects are lower or equal to amount.
|
||||
/mob/living/proc/HealAllImmobilityUpTo(amount, updating, ignore_canstun = FALSE)
|
||||
if(_REFACTORING_AmountStun() > amount)
|
||||
_REFACTORING_SetStun(amount, FALSE, ignore_canstun)
|
||||
if(_REFACTORING_AmountKnockdown() > amount)
|
||||
_REFACTORING_SetKnockdown(amount, FALSE, ignore_canstun)
|
||||
if(AmountStun() > amount)
|
||||
SetStun(amount, FALSE, ignore_canstun)
|
||||
if(AmountKnockdown() > amount)
|
||||
SetKnockdown(amount, FALSE, ignore_canstun)
|
||||
if(AmountParalyzed() > amount)
|
||||
SetParalyzed(amount, FALSE, ignore_canstun)
|
||||
if(AmountImmobilized() > amount)
|
||||
@@ -331,14 +331,14 @@
|
||||
update_mobility()
|
||||
|
||||
/mob/living/proc/HighestImmobilityAmount()
|
||||
return max(max(max(max(_REFACTORING_AmountStun(), _REFACTORING_AmountKnockdown()), AmountParalyzed()), AmountImmobilized()), AmountDazed())
|
||||
return max(max(max(max(AmountStun(), AmountKnockdown()), AmountParalyzed()), AmountImmobilized()), AmountDazed())
|
||||
|
||||
//////////////////UNCONSCIOUS
|
||||
/mob/living/proc/_REFACTORING_IsUnconscious() //If we're unconscious
|
||||
/mob/living/proc/IsUnconscious() //If we're unconscious
|
||||
return has_status_effect(STATUS_EFFECT_UNCONSCIOUS)
|
||||
|
||||
/mob/living/proc/AmountUnconscious() //How many deciseconds remain in our unconsciousness
|
||||
var/datum/status_effect/incapacitating/unconscious/U = _REFACTORING_IsUnconscious()
|
||||
var/datum/status_effect/incapacitating/unconscious/U = IsUnconscious()
|
||||
if(U)
|
||||
return U.duration - world.time
|
||||
return 0
|
||||
@@ -347,7 +347,7 @@
|
||||
if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_UNCONSCIOUS, amount, updating, ignore_canstun) & COMPONENT_NO_STUN)
|
||||
return
|
||||
if(((status_flags & CANUNCONSCIOUS) && !HAS_TRAIT(src, TRAIT_STUNIMMUNE)) || ignore_canstun)
|
||||
var/datum/status_effect/incapacitating/unconscious/U = _REFACTORING_IsUnconscious()
|
||||
var/datum/status_effect/incapacitating/unconscious/U = IsUnconscious()
|
||||
if(U)
|
||||
U.duration = max(world.time + amount, U.duration)
|
||||
else if(amount > 0)
|
||||
@@ -358,7 +358,7 @@
|
||||
if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_UNCONSCIOUS, amount, updating, ignore_canstun) & COMPONENT_NO_STUN)
|
||||
return
|
||||
if(((status_flags & CANUNCONSCIOUS) && !HAS_TRAIT(src, TRAIT_STUNIMMUNE)) || ignore_canstun)
|
||||
var/datum/status_effect/incapacitating/unconscious/U = _REFACTORING_IsUnconscious()
|
||||
var/datum/status_effect/incapacitating/unconscious/U = IsUnconscious()
|
||||
if(amount <= 0)
|
||||
if(U)
|
||||
qdel(U)
|
||||
@@ -372,7 +372,7 @@
|
||||
if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_UNCONSCIOUS, amount, updating, ignore_canstun) & COMPONENT_NO_STUN)
|
||||
return
|
||||
if(((status_flags & CANUNCONSCIOUS) && !HAS_TRAIT(src, TRAIT_STUNIMMUNE)) || ignore_canstun)
|
||||
var/datum/status_effect/incapacitating/unconscious/U = _REFACTORING_IsUnconscious()
|
||||
var/datum/status_effect/incapacitating/unconscious/U = IsUnconscious()
|
||||
if(U)
|
||||
U.duration += amount
|
||||
else if(amount > 0)
|
||||
@@ -381,11 +381,11 @@
|
||||
|
||||
/////////////////////////////////// SLEEPING ////////////////////////////////////
|
||||
|
||||
/mob/living/proc/_REFACTORING_IsSleeping() //If we're asleep
|
||||
/mob/living/proc/IsSleeping() //If we're asleep
|
||||
return has_status_effect(STATUS_EFFECT_SLEEPING)
|
||||
|
||||
/mob/living/proc/AmountSleeping() //How many deciseconds remain in our sleep
|
||||
var/datum/status_effect/incapacitating/sleeping/S = _REFACTORING_IsSleeping()
|
||||
var/datum/status_effect/incapacitating/sleeping/S = IsSleeping()
|
||||
if(S)
|
||||
return S.duration - world.time
|
||||
return 0
|
||||
@@ -394,7 +394,7 @@
|
||||
if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_SLEEP, amount, updating, ignore_canstun) & COMPONENT_NO_STUN)
|
||||
return
|
||||
if((!HAS_TRAIT(src, TRAIT_SLEEPIMMUNE)) || ignore_canstun)
|
||||
var/datum/status_effect/incapacitating/sleeping/S = _REFACTORING_IsSleeping()
|
||||
var/datum/status_effect/incapacitating/sleeping/S = IsSleeping()
|
||||
if(S)
|
||||
S.duration = max(world.time + amount, S.duration)
|
||||
else if(amount > 0)
|
||||
@@ -405,7 +405,7 @@
|
||||
if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_SLEEP, amount, updating, ignore_canstun) & COMPONENT_NO_STUN)
|
||||
return
|
||||
if((!HAS_TRAIT(src, TRAIT_SLEEPIMMUNE)) || ignore_canstun)
|
||||
var/datum/status_effect/incapacitating/sleeping/S = _REFACTORING_IsSleeping()
|
||||
var/datum/status_effect/incapacitating/sleeping/S = IsSleeping()
|
||||
if(amount <= 0)
|
||||
if(S)
|
||||
qdel(S)
|
||||
@@ -419,7 +419,7 @@
|
||||
if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_SLEEP, amount, updating, ignore_canstun) & COMPONENT_NO_STUN)
|
||||
return
|
||||
if((!HAS_TRAIT(src, TRAIT_SLEEPIMMUNE)) || ignore_canstun)
|
||||
var/datum/status_effect/incapacitating/sleeping/S = _REFACTORING_IsSleeping()
|
||||
var/datum/status_effect/incapacitating/sleeping/S = IsSleeping()
|
||||
if(S)
|
||||
S.duration += amount
|
||||
else if(amount > 0)
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
var/eye_blurry = 0 //Carbon
|
||||
var/real_name = null
|
||||
var/spacewalk = FALSE
|
||||
var/_REFACTORING_resting = 0 //Carbon
|
||||
var/resting = 0 //Carbon
|
||||
var/lying = 0
|
||||
var/lying_prev = 0
|
||||
|
||||
|
||||
Reference in New Issue
Block a user