Skip to content

Commit

Permalink
Serpentids cannot fly if you disable their torso.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mechoid committed Jul 8, 2023
1 parent 9ba76b5 commit 30989c6
Showing 1 changed file with 24 additions and 20 deletions.
44 changes: 24 additions & 20 deletions code/modules/mob/living/carbon/human/species/outsider/nabber.dm
Original file line number Diff line number Diff line change
Expand Up @@ -126,15 +126,17 @@

/datum/species/nabber/can_overcome_gravity(mob/living/carbon/human/H)
if(H.stat == CONSCIOUS)
var/datum/gas_mixture/mixture = H.loc.return_air()

if(mixture)
var/pressure = mixture.return_pressure()
if(pressure > 50)
var/turf/below = GetBelow(H)
var/turf/T = H.loc
if(!T.CanZPass(H, DOWN) || !below.CanZPass(H, DOWN))
return TRUE
var/obj/item/organ/external/chest/Torso = H.organs_by_name[BP_TORSO]
if(!Torso.is_broken() || !(Torso.is_bruised() && prob(5)))
var/datum/gas_mixture/mixture = H.loc.return_air()

if(mixture)
var/pressure = mixture.return_pressure()
if(pressure > 50)
var/turf/below = GetBelow(H)
var/turf/T = H.loc
if(!T.CanZPass(H, DOWN) || !below.CanZPass(H, DOWN))
return TRUE

return FALSE

Expand All @@ -146,17 +148,19 @@
// Nabbers will only fall when there isn't enough air pressure for them to keep themselves aloft.
/datum/species/nabber/can_fall(mob/living/carbon/human/H)
if(H.stat == CONSCIOUS)
var/datum/gas_mixture/mixture = H.loc.return_air()

//nabbers should not be trying to break their fall on stairs.
var/turf/T = GetBelow(H.loc)
for(var/obj/O in T)
if(istype(O, /obj/structure/stairs))
return TRUE
if(mixture)
var/pressure = mixture.return_pressure()
if(pressure > 80)
return FALSE
var/obj/item/organ/external/chest/Torso = H.organs_by_name[BP_TORSO]
if(!Torso.is_broken() || !(Torso.is_bruised() && prob(5)))
var/datum/gas_mixture/mixture = H.loc.return_air()

//nabbers should not be trying to break their fall on stairs.
var/turf/T = GetBelow(H.loc)
for(var/obj/O in T)
if(istype(O, /obj/structure/stairs))
return TRUE
if(mixture)
var/pressure = mixture.return_pressure()
if(pressure > 80)
return FALSE

return TRUE

Expand Down

0 comments on commit 30989c6

Please sign in to comment.