Skip to content

Commit 90f4b0c

Browse files
authored
prone screen alert (#1151)
1 parent c11cc07 commit 90f4b0c

File tree

2 files changed

+23
-2
lines changed

2 files changed

+23
-2
lines changed

code/_onclick/hud/alert.dm

+13
Original file line numberDiff line numberDiff line change
@@ -839,6 +839,19 @@ or shoot a gun to move around via Newton's 3rd Law of Motion."
839839
desc = "You are in very bad shape. Max stamina reduced by 100 and stamina regen reduced by 5."
840840
icon_state = ALERT_SOFTCRIT
841841

842+
/atom/movable/screen/alert/lying_down
843+
name = "Prone"
844+
desc = "You are prone. Click to attempt to stand up."
845+
icon_state = "paralysis"
846+
847+
/atom/movable/screen/alert/lying_down/Click(location, control, params)
848+
. = ..()
849+
if(!.)
850+
return
851+
852+
var/mob/living/living_owner = owner
853+
living_owner.set_resting(FALSE)
854+
842855
// PRIVATE = only edit, use, or override these if you're editing the system as a whole
843856

844857
// Re-render all alerts - also called in /datum/hud/show_hud() because it's needed there

code/modules/mob/living/living.dm

+10-2
Original file line numberDiff line numberDiff line change
@@ -528,25 +528,33 @@
528528
/mob/living/proc/on_lying_down(new_lying_angle)
529529
if(layer == initial(layer)) //to avoid things like hiding larvas.
530530
layer = LYING_MOB_LAYER //so mob lying always appear behind standing mobs
531+
531532
ADD_TRAIT(src, TRAIT_UI_BLOCKED, LYING_DOWN_TRAIT)
532533
ADD_TRAIT(src, TRAIT_PULL_BLOCKED, LYING_DOWN_TRAIT)
534+
533535
set_density(FALSE) // We lose density and stop bumping passable dense things.
536+
534537
if(HAS_TRAIT(src, TRAIT_FLOORED) && !(dir & (NORTH|SOUTH)))
535538
setDir(pick(NORTH, SOUTH)) // We are and look helpless.
539+
536540
body_position_pixel_y_offset = PIXEL_Y_OFFSET_LYING
537-
playsound(loc, 'goon/sounds/body_thud.ogg', ishuman(src) ? 40 : 15, 1, 0.3)
538541

542+
playsound(loc, 'goon/sounds/body_thud.ogg', ishuman(src) ? 40 : 15, 1, 0.3)
543+
throw_alert("lying_down", /atom/movable/screen/alert/lying_down)
539544

540545
/// Proc to append behavior related to lying down.
541546
/mob/living/proc/on_standing_up()
542547
if(layer == LYING_MOB_LAYER)
543548
layer = initial(layer)
549+
544550
set_density(initial(density)) // We were prone before, so we become dense and things can bump into us again.
551+
545552
REMOVE_TRAIT(src, TRAIT_UI_BLOCKED, LYING_DOWN_TRAIT)
546553
REMOVE_TRAIT(src, TRAIT_PULL_BLOCKED, LYING_DOWN_TRAIT)
547-
body_position_pixel_y_offset = 0
548554

555+
body_position_pixel_y_offset = 0
549556

557+
clear_alert("lying_down")
550558

551559
//Recursive function to find everything a mob is holding. Really shitty proc tbh.
552560
/mob/living/get_contents()

0 commit comments

Comments
 (0)