[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>
This commit is contained in:
SkyratBot
2020-09-25 13:38:32 +02:00
committed by GitHub
parent 59ce61e60c
commit dbafac7ee4
3 changed files with 8 additions and 2 deletions
+1 -1
View File
@@ -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 = "<span class='notice'>You feel lithe on your feet!</span>"
+1 -1
View File
@@ -204,7 +204,7 @@ GLOBAL_LIST_EMPTY(station_turfs)
prev_turf.visible_message("<span class='danger'>[mov_name] falls through [prev_turf]!</span>")
if(flags & FALL_INTERCEPTED)
return
if(zFall(A, ++levels))
if(zFall(A, levels + 1))
return FALSE
A.visible_message("<span class='danger'>[A] crashes into [src]!</span>")
A.onZImpact(src, levels)
@@ -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("<span class='danger'>[src] makes a hard landing on [T] but remains unharmed from the fall.</span>", \
"<span class='userdanger'>You brace for the fall. You make a hard landing on [T] but remain unharmed.</span>")
Knockdown(levels * 50)
/mob/living/carbon/human/prepare_data_huds()
//Update med hud images...