diff --git a/code/game/objects/structures/cliff.dm b/code/game/objects/structures/cliff.dm index ad4b23bdb8..24dbb6d25e 100644 --- a/code/game/objects/structures/cliff.dm +++ b/code/game/objects/structures/cliff.dm @@ -195,27 +195,45 @@ two tiles on initialization, and which way a cliff is facing may change during m displaced = TRUE if(istype(T)) - visible_message(span("danger", "\The [L] falls off \the [src]!")) + + var/safe_fall = FALSE + if(ishuman(L)) + var/mob/living/carbon/human/H = L + safe_fall = H.species.handle_falling(H, T, silent = TRUE, planetary = FALSE) + + if(safe_fall) + visible_message(span("notice", "\The [L] glides down from \the [src].")) + else + visible_message(span("danger", "\The [L] falls off \the [src]!")) L.forceMove(T) - // Do the actual hurting. Double cliffs do halved damage due to them most likely hitting twice. var/harm = !is_double_cliff ? 1 : 0.5 - if(istype(L.buckled, /obj/vehicle)) // People falling off in vehicles will take less damage, but will damage the vehicle severely. - var/obj/vehicle/vehicle = L.buckled - vehicle.adjust_health(40 * harm) - to_chat(L, span("warning", "\The [vehicle] absorbs some of the impact, damaging it.")) - harm /= 2 + if(!safe_fall) + // Do the actual hurting. Double cliffs do halved damage due to them most likely hitting twice. + if(istype(L.buckled, /obj/vehicle)) // People falling off in vehicles will take less damage, but will damage the vehicle severely. + var/obj/vehicle/vehicle = L.buckled + vehicle.adjust_health(40 * harm) + to_chat(L, span("warning", "\The [vehicle] absorbs some of the impact, damaging it.")) + harm /= 2 + + playsound(L, 'sound/effects/break_stone.ogg', 70, 1) + L.Weaken(5 * harm) - playsound(L, 'sound/effects/break_stone.ogg', 70, 1) - L.Weaken(5 * harm) var/fall_time = 3 if(displaced) // Make the fall look more natural when falling sideways. L.pixel_z = 32 * 2 animate(L, pixel_z = 0, time = fall_time) sleep(fall_time) // A brief delay inbetween the two sounds helps sell the 'ouch' effect. + + if(safe_fall) + visible_message(span("notice", "\The [L] lands on \the [T].")) + playsound(L, "rustle", 25, 1) + return + playsound(L, "punch", 70, 1) shake_camera(L, 1, 1) - visible_message(span("danger", "\The [L] hits the ground!")) + + visible_message(span("danger", "\The [L] hits \the [T]!")) // The bigger they are, the harder they fall. // They will take at least 20 damage at the minimum, and tries to scale up to 40% of their max health. diff --git a/code/modules/mob/living/carbon/human/species/station/teshari.dm b/code/modules/mob/living/carbon/human/species/station/teshari.dm index 55569135a9..4e029be04d 100644 --- a/code/modules/mob/living/carbon/human/species/station/teshari.dm +++ b/code/modules/mob/living/carbon/human/species/station/teshari.dm @@ -161,6 +161,7 @@ ..() H.equip_to_slot_or_del(new /obj/item/clothing/shoes/sandal(H),slot_shoes) +<<<<<<< HEAD //CHOMPStation Removal Start - TFF 24/12/19 - Bruh. This ain't a fun thing. /* /datum/species/teshari/handle_environment_special(var/mob/living/carbon/human/H) @@ -260,3 +261,104 @@ return SEE_SELF */ //CHOMPStation Removal End +||||||| parent of b36921514b... Merge pull request #10055 from VOREStation/upstream-merge-8012 +/datum/species/teshari/handle_falling(mob/living/carbon/human/H, atom/hit_atom, damage_min, damage_max, silent, planetary) + + // Tesh can glide to save themselves from some falls. Basejumping bird + // without parachute, or falling bird without free wings goes splat. + + // Are we landing from orbit, or handcuffed/unconscious/tied to something? + if(planetary || !istype(H) || H.incapacitated()) + return ..() + + // Are we landing on a turf? Not sure how this could not be the case, but let's be safe. + var/turf/landing = get_turf(hit_atom) + if(!istype(landing)) + return ..() + + if(H.buckled) + if(!silent) + to_chat(H, SPAN_WARNING("You try to spread your wings to slow your fall, but \the [H.buckled] weighs you down!")) + return ..() + + // Is there enough air to flap against? + var/datum/gas_mixture/environment = landing.return_air() + if(!environment || environment.return_pressure() < (ONE_ATMOSPHERE * 0.75)) + if(!silent) + to_chat(H, SPAN_WARNING("You spread your wings to slow your fall, but the air is too thin!")) + return ..() + + // Are we wearing a space suit? + if(H.wear_suit) + for(var/blacklisted_type in flight_suit_blacklisted_types) + if(istype(H.wear_suit, blacklisted_type)) + if(!silent) + to_chat(H, SPAN_WARNING("You try to spread your wings to slow your fall, but \the [H.wear_suit] is in the way!")) + return ..() + + // Do we have working wings? + for(var/bp in flight_bodyparts) + var/obj/item/organ/external/E = H.organs_by_name[bp] + if(!istype(E) || !E.is_usable() || E.is_broken() || E.is_stump()) + if(!silent) + to_chat(H, SPAN_WARNING("You try to spread your wings to slow your fall, but they won't hold your weight!")) + return ..() + + // Handled! + if(!silent) + to_chat(H, SPAN_NOTICE("You catch the air in your wings and greatly slow your fall.")) + H.visible_message(SPAN_NOTICE("\The [H] glides down from above, landing safely.")) + H.Stun(2) + playsound(H, "rustle", 25, 1) + return TRUE +======= +/datum/species/teshari/handle_falling(mob/living/carbon/human/H, atom/hit_atom, damage_min, damage_max, silent, planetary) + + // Tesh can glide to save themselves from some falls. Basejumping bird + // without parachute, or falling bird without free wings goes splat. + + // Are we landing from orbit, or handcuffed/unconscious/tied to something? + if(planetary || !istype(H) || H.incapacitated(INCAPACITATION_DEFAULT|INCAPACITATION_DISABLED)) + return ..() + + // Are we landing on a turf? Not sure how this could not be the case, but let's be safe. + var/turf/landing = get_turf(hit_atom) + if(!istype(landing)) + return ..() + + if(H.buckled) + if(!silent) + to_chat(H, SPAN_WARNING("You try to spread your wings to slow your fall, but \the [H.buckled] weighs you down!")) + return ..() + + // Is there enough air to flap against? + var/datum/gas_mixture/environment = landing.return_air() + if(!environment || environment.return_pressure() < (ONE_ATMOSPHERE * 0.75)) + if(!silent) + to_chat(H, SPAN_WARNING("You spread your wings to slow your fall, but the air is too thin!")) + return ..() + + // Are we wearing a space suit? + if(H.wear_suit) + for(var/blacklisted_type in flight_suit_blacklisted_types) + if(istype(H.wear_suit, blacklisted_type)) + if(!silent) + to_chat(H, SPAN_WARNING("You try to spread your wings to slow your fall, but \the [H.wear_suit] is in the way!")) + return ..() + + // Do we have working wings? + for(var/bp in flight_bodyparts) + var/obj/item/organ/external/E = H.organs_by_name[bp] + if(!istype(E) || !E.is_usable() || E.is_broken() || E.is_stump()) + if(!silent) + to_chat(H, SPAN_WARNING("You try to spread your wings to slow your fall, but they won't hold your weight!")) + return ..() + + // Handled! + if(!silent) + to_chat(H, SPAN_NOTICE("You catch the air in your wings and greatly slow your fall.")) + landing.visible_message(SPAN_NOTICE("\The [H] glides down from above, landing safely.")) + H.Stun(1) + playsound(H, "rustle", 25, 1) + return TRUE +>>>>>>> b36921514b... Merge pull request #10055 from VOREStation/upstream-merge-8012