sigh
This commit is contained in:
@@ -79,7 +79,7 @@
|
||||
if(leaping)
|
||||
leaping = 0
|
||||
update_icons()
|
||||
update_canmove()
|
||||
update_mobility()
|
||||
|
||||
|
||||
/mob/living/carbon/alien/humanoid/float(on)
|
||||
|
||||
@@ -22,13 +22,13 @@
|
||||
if(stat == CONSCIOUS)
|
||||
stat = UNCONSCIOUS
|
||||
blind_eyes(1)
|
||||
update_canmove()
|
||||
update_mobility()
|
||||
else
|
||||
if(stat == UNCONSCIOUS)
|
||||
stat = CONSCIOUS
|
||||
if(!recoveringstam)
|
||||
resting = 0
|
||||
adjust_blindness(-1)
|
||||
update_canmove()
|
||||
update_mobility()
|
||||
update_damage_hud()
|
||||
update_health_hud()
|
||||
|
||||
@@ -296,7 +296,7 @@
|
||||
if(M.force > 35) // durand and other heavy mechas
|
||||
DefaultCombatKnockdown(50)
|
||||
src.throw_at(throw_target, rand(1,5), 7)
|
||||
else if(M.force >= 20 && !IsKnockdown()) // lightweight mechas like gygax
|
||||
else if(M.force >= 20 && CHECK_BITFIELD(mobility_flags, MOBILITY_STAND)) // lightweight mechas like gygax
|
||||
DefaultCombatKnockdown(30)
|
||||
src.throw_at(throw_target, rand(1,3), 7)
|
||||
update |= temp.receive_damage(dmg, 0)
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
else if(resisting)
|
||||
resisting = FALSE
|
||||
else if((mode == MONKEY_IDLE && !pickupTarget && !prob(MONKEY_SHENANIGAN_PROB)) || !handle_combat())
|
||||
if(prob(25) && canmove && isturf(loc) && !pulledby)
|
||||
if(prob(25) && CHECK_BITFIELD(mobility_flags, MOBILITY_MOVE) && isturf(loc) && !pulledby)
|
||||
step(src, pick(GLOB.cardinals))
|
||||
else if(prob(1))
|
||||
emote(pick("scratch","jump","roll","tail"))
|
||||
|
||||
@@ -486,7 +486,7 @@
|
||||
stat = UNCONSCIOUS //the mob starts unconscious,
|
||||
blind_eyes(1)
|
||||
updatehealth() //then we check if the mob should wake up.
|
||||
update_canmove()
|
||||
update_mobility()
|
||||
update_sight()
|
||||
clear_alert("not_enough_oxy")
|
||||
reload_fullscreen()
|
||||
@@ -520,7 +520,7 @@
|
||||
ExtinguishMob()
|
||||
fire_stacks = 0
|
||||
confused = 0
|
||||
update_canmove()
|
||||
update_mobility()
|
||||
var/datum/component/mood/mood = GetComponent(/datum/component/mood)
|
||||
if (mood)
|
||||
QDEL_LIST_ASSOC_VAL(mood.mood_events)
|
||||
|
||||
@@ -92,61 +92,14 @@
|
||||
var/stun = _MOBILITYFLAGTEMPORARY_IsStun()
|
||||
var/paralyze = IsParalyzed()
|
||||
var/knockdown = _MOBILITYFLAGTEMPORARY_IsKnockdown()
|
||||
var/daze = IsDazed()
|
||||
var/immobilize = IsImmobilized()
|
||||
|
||||
|
||||
/*
|
||||
var/ko = IsKnockdown() || IsUnconscious() || (stat && (stat != SOFT_CRIT || pulledby)) || (HAS_TRAIT(src, TRAIT_DEATHCOMA))
|
||||
var/move_and_fall = stat == SOFT_CRIT && !pulledby
|
||||
var/chokehold = pulledby && pulledby.grab_state >= GRAB_NECK
|
||||
var/buckle_lying = !(buckled && !buckled.buckle_lying)
|
||||
var/pinned = resting && pulledby && pulledby.grab_state >= GRAB_AGGRESSIVE // Cit change - adds pinning for aggressive-grabbing people on the ground
|
||||
if(ko || move_and_fall || IsStun() || chokehold) // Cit change - makes resting not force you to drop everything
|
||||
drop_all_held_items()
|
||||
unset_machine()
|
||||
if(pulling)
|
||||
stop_pulling()
|
||||
else if(resting) //CIT CHANGE - makes resting make you stop pulling and interacting with machines
|
||||
unset_machine() //CIT CHANGE - Ditto!
|
||||
if(pulling) //CIT CHANGE - Ditto.
|
||||
stop_pulling() //CIT CHANGE - Ditto...
|
||||
else if(has_legs || ignore_legs)
|
||||
lying = 0
|
||||
if (pulledby)
|
||||
var/mob/living/L = pulledby
|
||||
L.update_pull_movespeed()
|
||||
if(buckled)
|
||||
lying = 90*buckle_lying
|
||||
else if(!lying)
|
||||
if(resting)
|
||||
lying = pick(90, 270) // Cit change - makes resting not force you to drop your held items
|
||||
if(has_gravity()) // Cit change - Ditto
|
||||
playsound(src, "bodyfall", 50, 1) // Cit change - Ditto!
|
||||
else if(ko || move_and_fall || (!has_legs && !ignore_legs) || chokehold)
|
||||
fall(forced = 1)
|
||||
canmove = !(ko || recoveringstam || pinned || IsStun() || IsFrozen() || chokehold || buckled || (!has_legs && !ignore_legs && !has_arms)) //Cit change - makes it plausible to move while resting, adds pinning and stamina crit
|
||||
density = !lying
|
||||
if(lying)
|
||||
if(layer == initial(layer)) //to avoid special cases like hiding larvas.
|
||||
layer = LYING_MOB_LAYER //so mob lying always appear behind standing mobs
|
||||
else
|
||||
if(layer == LYING_MOB_LAYER)
|
||||
layer = initial(layer)
|
||||
update_transform()
|
||||
if(!lying && lying_prev)
|
||||
if(client)
|
||||
client.move_delay = world.time + movement_delay()
|
||||
lying_prev = lying
|
||||
if(canmove && !intentionalresting && iscarbon(src) && client && client.prefs && client.prefs.autostand)//CIT CHANGE - adds autostanding as a preference
|
||||
addtimer(CALLBACK(src, .proc/resist_a_rest, TRUE), 0) //CIT CHANGE - ditto
|
||||
return canmove
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
var/chokehold = pulledby && pulledby.grab_state >= GRAB_NECK
|
||||
var/restrained = restrained()
|
||||
var/canmove = !IsImmobilized() && !stun && conscious && !paralyzed && !buckled && (!stat_softcrit || !pulledby) && !chokehold && !IsFrozen() && !IS_IN_STASIS(src) && (has_arms || ignore_legs || has_legs)
|
||||
var/pinned = resting && pulledby && pulledby.grab_state >= GRAB_AGGRESSIVE // Cit change - adds pinning for aggressive-grabbing people on the ground
|
||||
var/canmove = !IsImmobilized() && !stun && conscious && !paralyzed && !buckled && (!stat_softcrit || !pulledby) && !chokehold && !IsFrozen() && !IS_IN_STASIS(src) && (has_arms || ignore_legs || has_legs) && !pinned
|
||||
|
||||
if(canmove)
|
||||
mobility_flags |= MOBILITY_MOVE
|
||||
else
|
||||
@@ -175,24 +128,27 @@
|
||||
else
|
||||
mobility_flags |= MOBILITY_UI|MOBILITY_PULL
|
||||
|
||||
|
||||
|
||||
var/canitem = !paralyzed && !stun && conscious && !chokehold && !restrained && has_arms
|
||||
if(canitem)
|
||||
mobility_flags |= (MOBILITY_USE | MOBILITY_PICKUP | MOBILITY_STORAGE)
|
||||
else
|
||||
mobility_flags &= ~(MOBILITY_USE | MOBILITY_PICKUP | MOBILITY_STORAGE)
|
||||
if(!(mobility_flags & MOBILITY_USE))
|
||||
if(!(mobility_flags & MOBILITY_HOLD))
|
||||
drop_all_held_items()
|
||||
if(!(mobility_flags & MOBILITY_PULL))
|
||||
if(pulling)
|
||||
stop_pulling()
|
||||
if(!(mobility_flags & MOBILITY_UI))
|
||||
unset_machine()
|
||||
|
||||
if(pulledby)
|
||||
pulledby.update_pull_movespeed()
|
||||
|
||||
//Handle lying down, voluntary or involuntary
|
||||
density = !lying
|
||||
if(lying)
|
||||
if(!lying_prev)
|
||||
fall(!canstand_involuntary)
|
||||
set_resting(TRUE, TRUE, FALSE)
|
||||
if(layer == initial(layer)) //to avoid special cases like hiding larvas.
|
||||
layer = LYING_MOB_LAYER //so mob lying always appear behind standing mobs
|
||||
else
|
||||
@@ -201,17 +157,15 @@
|
||||
update_transform()
|
||||
lying_prev = lying
|
||||
|
||||
// Movespeed mods based on arms/legs quantity
|
||||
if(!get_leg_ignore())
|
||||
var/limbless_slowdown = 0
|
||||
// These checks for <2 should be swapped out for something else if we ever end up with a species with more than 2
|
||||
if(has_legs < 2)
|
||||
limbless_slowdown += 6 - (has_legs * 3)
|
||||
if(!has_legs && has_arms < 2)
|
||||
limbless_slowdown += 6 - (has_arms * 3)
|
||||
if(limbless_slowdown)
|
||||
add_movespeed_modifier(MOVESPEED_ID_LIVING_LIMBLESS, update=TRUE, priority=100, override=TRUE, multiplicative_slowdown=limbless_slowdown, movetypes=GROUND)
|
||||
else
|
||||
remove_movespeed_modifier(MOVESPEED_ID_LIVING_LIMBLESS, update=TRUE)
|
||||
*/
|
||||
//Handle citadel autoresist
|
||||
if((mobility_flags & MOBILITY_MOVE) && !intentionalresting && canstand_involuntary && iscarbon(src) && client?.prefs?.autostand)//CIT CHANGE - adds autostanding as a preference
|
||||
addtimer(CALLBACK(src, .proc/resist_a_rest, TRUE), 0) //CIT CHANGE - ditto
|
||||
|
||||
return mobility_flags
|
||||
|
||||
if(HAS_TRAIT(src, TRAIT_MOBILITY_NOMOVE))
|
||||
DISABLE_BITFIELD(mobility_flags, MOBILITY_MOVE)
|
||||
if(HAS_TRAIT(src, TRAIT_MOBILITY_NOPICKUP))
|
||||
DISABLE_BITFIELD(mobility_flags, MOBILITY_PICKUP)
|
||||
if(HAS_TRAIT(src, TRAIT_MOBILITY_NOUSE))
|
||||
DISABLE_BITFIELD(mobility_flags, MOBILITY_USE)
|
||||
|
||||
@@ -755,7 +755,7 @@
|
||||
else
|
||||
clear_alert("locked")
|
||||
locked_down = state
|
||||
update_canmove()
|
||||
update_mobility()
|
||||
|
||||
/mob/living/silicon/robot/proc/SetEmagged(new_state)
|
||||
emagged = new_state
|
||||
@@ -1024,13 +1024,13 @@
|
||||
if(stat == CONSCIOUS)
|
||||
stat = UNCONSCIOUS
|
||||
blind_eyes(1)
|
||||
update_canmove()
|
||||
update_mobility()
|
||||
update_headlamp()
|
||||
else
|
||||
if(stat == UNCONSCIOUS)
|
||||
stat = CONSCIOUS
|
||||
adjust_blindness(-1)
|
||||
update_canmove()
|
||||
update_mobility()
|
||||
update_headlamp()
|
||||
diag_hud_set_status()
|
||||
diag_hud_set_health()
|
||||
|
||||
@@ -11,4 +11,4 @@
|
||||
mobility_flags = newflags
|
||||
update_transform()
|
||||
update_action_buttons_icon()
|
||||
return canmove
|
||||
return mobility_flags
|
||||
|
||||
@@ -234,12 +234,66 @@
|
||||
P = apply_status_effect(STATUS_EFFECT_PARALYZED, amount, updating)
|
||||
return P
|
||||
|
||||
///////////////////////////////// DAZED ////////////////////////////////////
|
||||
/mob/living/proc/IsDazed() //If we're Dazed
|
||||
return has_status_effect(STATUS_EFFECT_DAZED)
|
||||
|
||||
/mob/living/proc/AmountDazed() //How many deciseconds remain in our Dazed status effect
|
||||
var/datum/status_effect/incapacitating/dazed/I = IsDazed()
|
||||
if(I)
|
||||
return I.duration - world.time
|
||||
return 0
|
||||
|
||||
/mob/living/proc/Daze(amount, updating = TRUE, ignore_canstun = FALSE) //Can't go below remaining duration
|
||||
if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_DAZE, 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/dazed/I = IsDazed()
|
||||
if(I)
|
||||
I.duration = max(world.time + amount, I.duration)
|
||||
else if(amount > 0)
|
||||
I = apply_status_effect(STATUS_EFFECT_DAZED, amount, updating)
|
||||
return I
|
||||
|
||||
/mob/living/proc/SetDazed(amount, updating = TRUE, ignore_canstun = FALSE) //Sets remaining duration
|
||||
if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_DAZE, amount, updating, ignore_canstun) & COMPONENT_NO_STUN)
|
||||
return
|
||||
if(((status_flags & CANKNOCKDOWN) && !HAS_TRAIT(src, TRAIT_STUNIMMUNE)) || ignore_canstun)
|
||||
var/datum/status_effect/incapacitating/dazed/I = IsDazed()
|
||||
if(amount <= 0)
|
||||
if(I)
|
||||
qdel(I)
|
||||
else
|
||||
if(absorb_stun(amount, ignore_canstun))
|
||||
return
|
||||
if(I)
|
||||
I.duration = world.time + amount
|
||||
else
|
||||
I = apply_status_effect(STATUS_EFFECT_DAZED, amount, updating)
|
||||
return I
|
||||
|
||||
/mob/living/proc/AdjustDazed(amount, updating = TRUE, ignore_canstun = FALSE) //Adds to remaining duration
|
||||
if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_DAZE, 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/dazed/I = IsDazed()
|
||||
if(I)
|
||||
I.duration += amount
|
||||
else if(amount > 0)
|
||||
I = apply_status_effect(STATUS_EFFECT_DAZED, amount, updating)
|
||||
return I
|
||||
|
||||
//Blanket
|
||||
/mob/living/proc/AllImmobility(amount, updating, ignore_canstun = FALSE)
|
||||
Paralyze(amount, FALSE, ignore_canstun)
|
||||
_MOBILITYFLAGTEMPORARY_Knockdown(amount, FALSE, ignore_canstun)
|
||||
Stun(amount, FALSE, ignore_canstun)
|
||||
Immobilize(amount, FALSE, ignore_canstun)
|
||||
Daze(amount, FALSE, ignore_canstun)
|
||||
if(updating)
|
||||
update_mobility()
|
||||
|
||||
@@ -248,6 +302,7 @@
|
||||
_MOBILITYFLAGTEMPORARY_SetKnockdown(amount, FALSE, ignore_canstun)
|
||||
_MOBILITYFLAGTEMPORARY_SetStun(amount, FALSE, ignore_canstun)
|
||||
SetImmobilized(amount, FALSE, ignore_canstun)
|
||||
SetDazed(amount, FALSE, ignore_canstun)
|
||||
if(updating)
|
||||
update_mobility()
|
||||
|
||||
@@ -256,10 +311,11 @@
|
||||
_MOBILITYFLAGTEMPORARY_AdjustKnockdown(amount, FALSE, ignore_canstun)
|
||||
_MOBILITYFLAGTEMPORARY_AdjustStun(amount, FALSE, ignore_canstun)
|
||||
AdjustImmobilized(amount, FALSE, ignore_canstun)
|
||||
AdjustDazed(amount, FALSE, ignore_canstun)
|
||||
if(updating)
|
||||
update_mobility()
|
||||
|
||||
/// Makes sure all 4 of the non-knockout immobilizing status effects are lower or equal to amount.
|
||||
/// 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(_MOBILITYFLAGTEMPORARY_AmountStun() > amount)
|
||||
_MOBILITYFLAGTEMPORARY_SetStun(amount, FALSE, ignore_canstun)
|
||||
@@ -269,6 +325,8 @@
|
||||
SetParalyzed(amount, FALSE, ignore_canstun)
|
||||
if(AmountImmobilized() > amount)
|
||||
SetImmobilized(amount, FALSE, ignore_canstun)
|
||||
if(AmountDazed() > amount)
|
||||
SetImmobilized(amount, FALSE, ignore_canstun)
|
||||
if(updating)
|
||||
update_mobility()
|
||||
|
||||
|
||||
@@ -407,7 +407,7 @@
|
||||
dropItemToGround(W)
|
||||
regenerate_icons()
|
||||
notransform = 1
|
||||
canmove = 0
|
||||
Paralyze(INFINITY)
|
||||
icon = null
|
||||
invisibility = INVISIBILITY_MAXIMUM
|
||||
for(var/t in bodyparts)
|
||||
@@ -440,7 +440,7 @@
|
||||
dropItemToGround(W)
|
||||
regenerate_icons()
|
||||
notransform = 1
|
||||
canmove = 0
|
||||
Paralyze(INFINITY)
|
||||
icon = null
|
||||
invisibility = INVISIBILITY_MAXIMUM
|
||||
for(var/t in bodyparts)
|
||||
|
||||
Reference in New Issue
Block a user