From f67dee1ec1f5106fe79b4db2fece5efcc0fd18b0 Mon Sep 17 00:00:00 2001 From: Testmerge Worker Date: Wed, 18 Dec 2024 19:00:20 +0000 Subject: [PATCH] add: Adds an immunity to gravity damage for 5 seconds after exhaustion (#6243) [testmerge][03144ee] --- code/__DEFINES/traits/declarations.dm | 3 ++- code/_globalvars/traits.dm | 1 + .../modules/mob/living/carbon/human/human_movement.dm | 11 ++++++++--- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/code/__DEFINES/traits/declarations.dm b/code/__DEFINES/traits/declarations.dm index f6eefaa8686..dac605e8c52 100644 --- a/code/__DEFINES/traits/declarations.dm +++ b/code/__DEFINES/traits/declarations.dm @@ -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" diff --git a/code/_globalvars/traits.dm b/code/_globalvars/traits.dm index 54ad01b0fe2..ee7ca34e4eb 100644 --- a/code/_globalvars/traits.dm +++ b/code/_globalvars/traits.dm @@ -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, diff --git a/code/modules/mob/living/carbon/human/human_movement.dm b/code/modules/mob/living/carbon/human/human_movement.dm index 62a0c337ef5..03ac43f096c 100644 --- a/code/modules/mob/living/carbon/human/human_movement.dm +++ b/code/modules/mob/living/carbon/human/human_movement.dm @@ -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))