Skip to content

Commit

Permalink
Merge pull request tgstation#53822 from Mickyan/freefalling
Browse files Browse the repository at this point in the history
Makes freerunning quirk prevent falling damage from short falls
  • Loading branch information
kriskog authored Sep 25, 2020
2 parents d289d6e + d0b64d5 commit 505146f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion code/datums/traits/good.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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>"
Expand Down
2 changes: 1 addition & 1 deletion code/game/turfs/turf.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 6 additions & 0 deletions code/modules/mob/living/carbon/human/human.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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...
Expand Down

0 comments on commit 505146f

Please sign in to comment.