From 9db5968f3edab4e4f5ff79da4dff9627065bae89 Mon Sep 17 00:00:00 2001 From: Heroman Date: Wed, 3 Nov 2021 06:47:55 +1000 Subject: [PATCH] Adjustments to mob falling mechanics --- code/modules/multiz/movement.dm | 5 ++++- code/modules/multiz/movement_vr.dm | 27 +++++++++++++++++---------- 2 files changed, 21 insertions(+), 11 deletions(-) diff --git a/code/modules/multiz/movement.dm b/code/modules/multiz/movement.dm index 725eda4848..69ea1051f0 100644 --- a/code/modules/multiz/movement.dm +++ b/code/modules/multiz/movement.dm @@ -467,13 +467,16 @@ // Take damage from falling and hitting the ground /mob/living/fall_impact(var/atom/hit_atom, var/damage_min = 0, var/damage_max = 5, var/silent = FALSE, var/planetary = FALSE) var/turf/landing = get_turf(hit_atom) + var/safe_fall = FALSE + if(src.softfall || (istype(src, /mob/living/simple_mob) && src.mob_size <= MOB_SMALL)) + safe_fall = TRUE if(planetary && src.CanParachute()) if(!silent) visible_message("\The [src] glides in from above and lands on \the [landing]!", \ "You land on \the [landing]!", \ "You hear something land \the [landing].") return - else if(!planetary && src.softfall) // Falling one floor and falling one atmosphere are very different things + else if(!planetary && safe_fall) // Falling one floor and falling one atmosphere are very different things if(!silent) visible_message("\The [src] falls from above and lands on \the [landing]!", \ "You land on \the [landing]!", \ diff --git a/code/modules/multiz/movement_vr.dm b/code/modules/multiz/movement_vr.dm index b217176e50..7dc56a391a 100644 --- a/code/modules/multiz/movement_vr.dm +++ b/code/modules/multiz/movement_vr.dm @@ -32,7 +32,10 @@ return 0 var/mob/living/pred = hit_atom - pred.visible_message("\The [hit_atom] falls onto \the [src]!") + var/safe_fall = FALSE + if(pred.softfall || (istype(pred, /mob/living/simple_mob) && pred.mob_size <= MOB_SMALL)) // TODO: add ability for mob below to be 'soft' and cushion fall + safe_fall = TRUE + pred.Weaken(8) var/mob/living/prey = src var/fallloc = prey.loc @@ -42,16 +45,20 @@ else if(prey.can_be_drop_pred && pred.can_be_drop_prey) prey.feed_grabbed_to_self_falling_nom(prey,pred) else - prey.Weaken(8) pred.loc = prey.loc - playsound(src, "punch", 25, 1, -1) - var/tdamage - for(var/i = 1 to 10) - tdamage = rand(0, 10)/2 - pred.adjustBruteLoss(tdamage) - prey.adjustBruteLoss(tdamage) - pred.updatehealth() - prey.updatehealth() + if(!safe_fall) + prey.Weaken(8) + playsound(src, "punch", 25, 1, -1) + var/tdamage + for(var/i = 1 to 5) //Twice as less damage because cushioned fall, but both get damaged. + tdamage = rand(0, 5) + pred.adjustBruteLoss(tdamage) + prey.adjustBruteLoss(tdamage) + pred.updatehealth() + prey.updatehealth() + pred.visible_message("\The [pred] falls onto \the [src]!") + else + pred.visible_message("\The [pred] safely brushes past \the [src] as they land.") return 1 /mob/observer/dead/CheckFall()