Skip to content

Commit

Permalink
add: Adds an immunity to gravity damage for 5 seconds after exhaustion (
Browse files Browse the repository at this point in the history
#6243) [testmerge][03144ee]
  • Loading branch information
actions-user committed Dec 18, 2024
1 parent 0dbc1c2 commit f67dee1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
3 changes: 2 additions & 1 deletion code/__DEFINES/traits/declarations.dm
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,8 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai
#define TRAIT_GUSTPROTECTION "gustprotection"
/// This mob can strip other mobs.
#define TRAIT_CAN_STRIP "can_strip"

/// This mob has immune to gravity damage.
#define TRAIT_NO_GRAVITY_DAMAGE "no_gravity_damage"

/// Unlinks gliding from movement speed, meaning that there will be a delay between movements rather than a single move movement between tiles
#define TRAIT_NO_GLIDE "no_glide"
Expand Down
1 change: 1 addition & 0 deletions code/_globalvars/traits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ GLOBAL_LIST_INIT(traits_by_type, list(
"TRAIT_NO_FINGERPRINTS" = TRAIT_NO_FINGERPRINTS,
"TRAIT_NO_GERMS" = TRAIT_NO_GERMS,
"TRAIT_NO_GLIDE" = TRAIT_NO_GLIDE,
"TRAIT_NO_GRAVITY_DAMAGE" = TRAIT_NO_GRAVITY_DAMAGE,
"TRAIT_NO_GUNS" = TRAIT_NO_GUNS,
"TRAIT_NO_HUNGER" = TRAIT_NO_HUNGER,
"TRAIT_NO_INTORGANS" = TRAIT_NO_INTORGANS,
Expand Down
11 changes: 8 additions & 3 deletions code/modules/mob/living/carbon/human/human_movement.dm
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,14 @@
if(m_intent != MOVE_INTENT_RUN)
return

to_chat(src, span_userdanger("Gravity exhausts you!"))
apply_damage(35, STAMINA)

if(!HAS_TRAIT(src, TRAIT_NO_GRAVITY_DAMAGE))
to_chat(src, span_userdanger("Gravity exhausts you!"))
apply_damage(35, STAMINA)
ADD_TRAIT(src, TRAIT_NO_GRAVITY_DAMAGE, "gravity_exhaustion")
addtimer(CALLBACK(src, PROC_REF(remove_gravity_immune)), 5 SECONDS)

/mob/living/carbon/human/proc/remove_gravity_immune()
REMOVE_TRAIT(src, TRAIT_NO_GRAVITY_DAMAGE, "gravity_exhaustion")

/mob/living/carbon/human/slip(weaken, obj/slipped_on, lube_flags, tilesSlipped)
if(HAS_TRAIT(src, TRAIT_NO_SLIP_ALL))
Expand Down

0 comments on commit f67dee1

Please sign in to comment.