Allows Teshari to glide in some multiz fall conditions. (#7990)

* Allows Teshari to glide in some multiz fall conditions.

* Carried mobs will now fall off you if you go prone.
This commit is contained in:
MistakeNot4892
2021-03-21 17:58:26 -09:00
committed by GitHub
parent 47d2c55157
commit 0b5bb3fbf0
5 changed files with 81 additions and 4 deletions
@@ -1617,3 +1617,6 @@
to_chat(src, span("warning", "\The [rig]'s visor has shuddenly deactivated!"))
..()
/mob/living/carbon/human/get_mob_riding_slots()
return list(back, head, wear_suit)
@@ -528,3 +528,6 @@
amount *= water_damage_mod
if(amount > 0)
H.adjustToxLoss(amount)
/datum/species/proc/handle_falling(mob/living/carbon/human/H, atom/hit_atom, damage_min, damage_max, silent, planetary)
return FALSE
@@ -141,6 +141,67 @@
/datum/mob_descriptor/build = -3
)
var/static/list/flight_bodyparts = list(
BP_L_ARM,
BP_R_ARM,
BP_L_HAND,
BP_R_HAND
)
var/static/list/flight_suit_blacklisted_types = list(
/obj/item/clothing/suit/space,
/obj/item/clothing/suit/straight_jacket
)
/datum/species/teshari/equip_survival_gear(var/mob/living/carbon/human/H)
..()
H.equip_to_slot_or_del(new /obj/item/clothing/shoes/sandal(H),slot_shoes)
/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
+10 -2
View File
@@ -839,8 +839,12 @@
if(lying)
density = 0
if(l_hand) unEquip(l_hand)
if(r_hand) unEquip(r_hand)
if(l_hand)
unEquip(l_hand)
if(r_hand)
unEquip(r_hand)
for(var/obj/item/weapon/holder/holder in get_mob_riding_slots())
unEquip(holder)
update_water() // Submerges the mob.
else
density = initial(density)
@@ -856,6 +860,10 @@
return canmove
// Mob holders in these slots will be spilled if the mob goes prone.
/mob/living/proc/get_mob_riding_slots()
return list(back)
// Adds overlays for specific modifiers.
// You'll have to add your own implementation for non-humans currently, just override this proc.
/mob/living/proc/update_modifier_visuals()
+4 -2
View File
@@ -442,8 +442,10 @@
adjustBruteLoss(rand(damage_min, damage_max))
Weaken(4)
updatehealth()
return
return
/mob/living/carbon/human/fall_impact(atom/hit_atom, damage_min, damage_max, silent, planetary)
if(!species?.handle_falling(src, hit_atom, damage_min, damage_max, silent, planetary))
..()
//Using /atom/movable instead of /obj/item because I'm not sure what all humans can pick up or wear
/atom/movable