Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add: Adds an immunity to gravity damage for 5 seconds after exhaustion #6243

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -145,6 +145,7 @@ GLOBAL_LIST_INIT(traits_by_type, list(
"TRAIT_WINGDINGS" = TRAIT_WINGDINGS,
"TRAIT_XENO_HOST" = TRAIT_XENO_HOST,
"TRAIT_XRAY" = TRAIT_XRAY,
"TRAIT_NO_GRAVITY_DAMAGE" = TRAIT_NO_GRAVITY_DAMAGE,
Vladisvell marked this conversation as resolved.
Show resolved Hide resolved
),
/obj/item = list(
"TRAIT_NEEDS_TWO_HANDS" = TRAIT_NEEDS_TWO_HANDS,
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")
Comment on lines +190 to +197
Copy link
Contributor

@Antoonij Antoonij Dec 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

всё это добро переписать с трейта на бафф + сигнал

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Варится долго, снял с тестмержов, этот вопрос стоит решить


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