[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:
SkyratBot
2020-11-09 09:42:53 +01:00
committed by GitHub
parent da9b2794e9
commit 6b1da44c8a
5 changed files with 21 additions and 5 deletions
@@ -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)
+14
View File
@@ -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)
+1 -1
View File
@@ -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