From dbafac7ee44ea374f727ebcff3bbc680fee12655 Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Fri, 25 Sep 2020 13:38:32 +0200 Subject: [PATCH] [MIRROR] Makes freerunning quirk prevent falling damage from short falls (#972) * Merge pull request #53822 from Mickyan/freefalling Makes freerunning quirk prevent falling damage from short falls * Makes freerunning quirk prevent falling damage from short falls Co-authored-by: skoglol <33292112+kriskog@users.noreply.github.com> --- code/datums/traits/good.dm | 2 +- code/game/turfs/turf.dm | 2 +- code/modules/mob/living/carbon/human/human.dm | 6 ++++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/code/datums/traits/good.dm b/code/datums/traits/good.dm index ce82e5a26f2..94da7b045d9 100644 --- a/code/datums/traits/good.dm +++ b/code/datums/traits/good.dm @@ -101,7 +101,7 @@ /datum/quirk/freerunning name = "Freerunning" - desc = "You're great at quick moves! You can climb tables more quickly." + desc = "You're great at quick moves! You can climb tables more quickly and take no damage from short falls." value = 2 mob_trait = TRAIT_FREERUNNING gain_text = "You feel lithe on your feet!" diff --git a/code/game/turfs/turf.dm b/code/game/turfs/turf.dm index 07748bbdabe..3056729477d 100755 --- a/code/game/turfs/turf.dm +++ b/code/game/turfs/turf.dm @@ -204,7 +204,7 @@ GLOBAL_LIST_EMPTY(station_turfs) prev_turf.visible_message("[mov_name] falls through [prev_turf]!") if(flags & FALL_INTERCEPTED) return - if(zFall(A, ++levels)) + if(zFall(A, levels + 1)) return FALSE A.visible_message("[A] crashes into [src]!") A.onZImpact(src, levels) diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 924b2b2c41c..6498724b586 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -40,6 +40,12 @@ GLOB.human_list -= src return ..() +/mob/living/carbon/human/ZImpactDamage(turf/T, levels) + if(!HAS_TRAIT(src, TRAIT_FREERUNNING) || levels > 1) // falling off one level + return ..() + visible_message("[src] makes a hard landing on [T] but remains unharmed from the fall.", \ + "You brace for the fall. You make a hard landing on [T] but remain unharmed.") + Knockdown(levels * 50) /mob/living/carbon/human/prepare_data_huds() //Update med hud images...