You fall down stairs if staggered (or in hard crit, or dead) (#90973)

## About The Pull Request

Trying to travel down stairs while staggered (like from a shove) will
result in you falling down the stairs

This means shove + shove results in someone tumbling down (but not just
a single shove)


https://github.com/user-attachments/assets/e5a9eaa5-28c7-4096-ac65-5f44a11196fd

## Why It's Good For The Game

Combats stair combat with stair combat. (Stair swapping is annoying and
jank, but giving players a way to punish stair swapping would help
counteract that.)

## Changelog

🆑 Melbert
balance: If you're staggered, and try to walk down stairs, you'll
instead fall down the stairs (stunning and causing damage).
balance: Hard crit and dead people will also roll down the stairs.
/🆑

---------

Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com>
This commit is contained in:
MrMelbert
2025-05-10 07:33:58 -05:00
committed by GitHub
parent ee1a66483d
commit 51f7ac38db
+28 -2
View File
@@ -142,8 +142,34 @@
/obj/structure/stairs/intercept_zImpact(list/falling_movables, levels = 1)
. = ..()
if(levels == 1 && isTerminator()) // Stairs won't save you from a steep fall.
. |= FALL_INTERCEPTED | FALL_NO_MESSAGE | FALL_RETAIN_PULL
// falling from a higher z level onto stairs
if(levels != 1 || !isTerminator())
return
for(var/mob/living/guy in falling_movables)
if(!can_fall_down_stairs(guy))
continue
to_chat(guy, span_warning("You fall down [src]!"))
on_fall(guy)
. |= FALL_INTERCEPTED | FALL_NO_MESSAGE | FALL_RETAIN_PULL
/// Will the passed mob tumble down the stairs instead of walking?
/obj/structure/stairs/proc/can_fall_down_stairs(mob/living/falling)
if(falling.buckled || falling.pulledby)
return FALSE
if(falling.stat >= UNCONSCIOUS) // if you shove someone unconscious down the stairs, they'd probably roll
return TRUE
if(falling.has_status_effect(/datum/status_effect/staggered)) // off balance
return TRUE
return FALSE
/// What happens when a mob tumbles down the stairs
/obj/structure/stairs/proc/on_fall(mob/living/falling)
falling.AdjustParalyzed(2 SECONDS)
falling.adjust_staggered(2 SECONDS)
falling.AdjustKnockdown(5 SECONDS)
falling.spin(1 SECONDS, 0.25 SECONDS)
falling.apply_damage(rand(4, 8), BRUTE, spread_damage = TRUE)
GLOB.move_manager.move_towards(falling, get_ranged_target_turf(src, REVERSE_DIR(dir), 2), delay = 0.4 SECONDS, timeout = 1 SECONDS)
/obj/structure/stairs/proc/isTerminator() //If this is the last stair in a chain and should move mobs up
if(terminator_mode != STAIR_TERMINATOR_AUTOMATIC)