mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-23 21:18:37 +01:00
[MIRROR] Mob stays vertical while in cryo (#1639)
* Mob stays vertical while in cryo (#54800) Currently, mobs in cryo will turn horizontal in the cryotube when they fall unconscious. This should stop that. * Mob stays vertical while in cryo Co-authored-by: prodirus <44090982+prodirus@users.noreply.github.com>
This commit is contained in:
@@ -82,6 +82,8 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai
|
||||
#define TRAIT_IMMOBILIZED "immobilized"
|
||||
/// Prevents voluntary standing or staying up on its own.
|
||||
#define TRAIT_FLOORED "floored"
|
||||
/// Forces user to stay standing
|
||||
#define TRAIT_FORCED_STANDING "forcedstanding"
|
||||
/// Prevents usage of manipulation appendages (picking, holding or using items, manipulating storage).
|
||||
#define TRAIT_HANDS_BLOCKED "handsblocked"
|
||||
/// Inability to access UI hud elements. Turned into a trait from [MOBILITY_UI] to be able to track sources.
|
||||
|
||||
@@ -8,6 +8,7 @@ GLOBAL_LIST_INIT(traits_by_type, list(
|
||||
"TRAIT_KNOCKEDOUT" = TRAIT_KNOCKEDOUT,
|
||||
"TRAIT_IMMOBILIZED" = TRAIT_IMMOBILIZED,
|
||||
"TRAIT_FLOORED" = TRAIT_FLOORED,
|
||||
"TRAIT_FORCED_STANDING" = TRAIT_FORCED_STANDING,
|
||||
"TRAIT_HANDS_BLOCKED" = TRAIT_HANDS_BLOCKED,
|
||||
"TRAIT_RESTRAINED" = TRAIT_RESTRAINED,
|
||||
"TRAIT_INCAPACITATED" = TRAIT_INCAPACITATED,
|
||||
|
||||
@@ -30,8 +30,7 @@
|
||||
if(occupant)
|
||||
vis_contents -= occupant
|
||||
REMOVE_TRAIT(occupant, TRAIT_IMMOBILIZED, CRYO_TRAIT)
|
||||
if(occupant.resting || HAS_TRAIT(occupant, TRAIT_FLOORED))
|
||||
occupant.set_lying_down()
|
||||
REMOVE_TRAIT(occupant, TRAIT_FORCED_STANDING, CRYO_TRAIT)
|
||||
|
||||
occupant = new_occupant
|
||||
if(!occupant)
|
||||
@@ -41,8 +40,8 @@
|
||||
vis_contents += occupant
|
||||
pixel_y = 22
|
||||
ADD_TRAIT(occupant, TRAIT_IMMOBILIZED, CRYO_TRAIT)
|
||||
occupant.set_body_position(STANDING_UP)
|
||||
occupant.set_lying_angle(0)
|
||||
// Keep them standing! They'll go sideways in the tube when they fall asleep otherwise.
|
||||
ADD_TRAIT(occupant, TRAIT_FORCED_STANDING, CRYO_TRAIT)
|
||||
|
||||
/// COMSIG_CRYO_SET_ON callback
|
||||
/atom/movable/visual/cryo_occupant/proc/on_set_on(datum/source, on)
|
||||
|
||||
@@ -12,6 +12,9 @@
|
||||
RegisterSignal(src, SIGNAL_ADDTRAIT(TRAIT_FLOORED), .proc/on_floored_trait_gain)
|
||||
RegisterSignal(src, SIGNAL_REMOVETRAIT(TRAIT_FLOORED), .proc/on_floored_trait_loss)
|
||||
|
||||
RegisterSignal(src, SIGNAL_ADDTRAIT(TRAIT_FORCED_STANDING), .proc/on_forced_standing_trait_gain)
|
||||
RegisterSignal(src, SIGNAL_REMOVETRAIT(TRAIT_FORCED_STANDING), .proc/on_forced_standing_trait_loss)
|
||||
|
||||
RegisterSignal(src, SIGNAL_ADDTRAIT(TRAIT_HANDS_BLOCKED), .proc/on_handsblocked_trait_gain)
|
||||
RegisterSignal(src, SIGNAL_REMOVETRAIT(TRAIT_HANDS_BLOCKED), .proc/on_handsblocked_trait_loss)
|
||||
|
||||
@@ -78,6 +81,8 @@
|
||||
SIGNAL_HANDLER
|
||||
if(buckled && buckled.buckle_lying != NO_BUCKLE_LYING)
|
||||
return // Handled by the buckle.
|
||||
if(HAS_TRAIT(src, TRAIT_FORCED_STANDING))
|
||||
return // Don't go horizontal if mob has forced standing trait.
|
||||
mobility_flags &= ~MOBILITY_STAND
|
||||
on_floored_start()
|
||||
|
||||
@@ -88,6 +93,15 @@
|
||||
mobility_flags |= MOBILITY_STAND
|
||||
on_floored_end()
|
||||
|
||||
/// Called when [TRAIT_FORCED_STANDING] is added to the mob.
|
||||
/mob/living/proc/on_forced_standing_trait_gain(datum/source)
|
||||
set_body_position(STANDING_UP)
|
||||
set_lying_angle(0)
|
||||
|
||||
/// Called when [TRAIT_FORCED_STANDING] is removed from the mob.
|
||||
/mob/living/proc/on_forced_standing_trait_loss(datum/source)
|
||||
if(resting || HAS_TRAIT(src, TRAIT_FLOORED))
|
||||
set_lying_down()
|
||||
|
||||
/// Called when [TRAIT_HANDS_BLOCKED] is added to the mob.
|
||||
/mob/living/proc/on_handsblocked_trait_gain(datum/source)
|
||||
|
||||
@@ -490,7 +490,7 @@
|
||||
if(body_position == LYING_DOWN)
|
||||
if(!silent)
|
||||
to_chat(src, "<span class='notice'>You will now try to stay lying down on the floor.</span>")
|
||||
else if(buckled && buckled.buckle_lying != NO_BUCKLE_LYING)
|
||||
else if(HAS_TRAIT(src, TRAIT_FORCED_STANDING) || (buckled && buckled.buckle_lying != NO_BUCKLE_LYING))
|
||||
if(!silent)
|
||||
to_chat(src, "<span class='notice'>You will now lay down as soon as you are able to.</span>")
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user