Makes the groin into a non-vital organ, changes to stance handling, bloody feet bugfix. (#11195)

This commit is contained in:
Matt Atlas
2021-02-18 14:22:35 +01:00
committed by GitHub
parent a02f649ade
commit 13af6304be
14 changed files with 99 additions and 37 deletions
@@ -5,7 +5,7 @@
parent_organ = BP_HEAD
icon = 'icons/mob/npc/alien.dmi'
icon_state = "chitin"
vital = 1
vital = TRUE
/obj/item/organ/internal/brain/xeno
name = "thinkpan"
@@ -378,7 +378,8 @@ This function restores all organs.
/mob/living/carbon/human/proc/get_organ(var/zone)
if(!zone) zone = BP_CHEST
if(!zone)
zone = BP_CHEST
if (zone in list(BP_EYES, BP_MOUTH))
zone = BP_HEAD
return organs_by_name[zone]
@@ -83,10 +83,21 @@
if (istype(buckled_to, /obj/structure/bed))
return
for(var/limb_tag in list(BP_L_LEG,BP_R_LEG,BP_L_FOOT,BP_R_FOOT))
var/static/support_limbs = list(
BP_L_LEG = BP_R_LEG,
BP_L_FOOT = BP_R_FOOT
)
var/has_opposite_limb = FALSE
for(var/limb_tag in list(BP_L_LEG, BP_L_FOOT, BP_R_LEG, BP_R_FOOT))
var/obj/item/organ/external/E = organs_by_name[limb_tag]
if(!E || (E.status & (ORGAN_MUTATED|ORGAN_DEAD)) || E.is_stump()) //should just be !E.is_usable() here but dislocation screws that up.
stance_damage += 2 // let it fail even if just foot&leg
has_opposite_limb = get_organ(support_limbs[limb_tag])
if(!has_opposite_limb)
stance_damage += 10 //No walking for you with no supporting limb, buddy.
break
else
stance_damage += 2
else if (E.is_malfunctioning())
//malfunctioning only happens intermittently so treat it as a missing limb when it procs
stance_damage += 2
@@ -100,20 +111,25 @@
// Canes and crutches help you stand (if the latter is ever added)
// One cane mitigates a broken leg+foot, or a missing foot.
// Two canes are needed for a lost leg. If you are missing both legs, canes aren't gonna help you.
if (l_hand && istype(l_hand, /obj/item/cane))
stance_damage -= 2
if (r_hand && istype(r_hand, /obj/item/cane))
stance_damage -= 2
// No double caning allowed, sorry. Canes also don't work if you're missing a functioning pair of feet or legs.
if(has_opposite_limb)
if(l_hand && istype(l_hand, /obj/item/cane))
stance_damage -= 2
else if(r_hand && istype(r_hand, /obj/item/cane))
stance_damage -= 2
// standing is poor
//Standing is poor.
if(stance_damage >= 4 || (stance_damage >= 2 && prob(5)))
if(!(lying || resting))
emote("scream")
if(!weakened)
custom_emote(VISIBLE_MESSAGE, "collapses!")
Weaken(3)
next_stance_collapse = world.time + (rand(8, 16) SECONDS)
if(stance_damage <= 5)
Weaken(3)
next_stance_collapse = world.time + (rand(8, 16) SECONDS)
else
Weaken(6) //No legs or feet means you should be really fucked.
/mob/living/carbon/human/proc/handle_grasp()
if(!l_hand && !r_hand)
@@ -865,10 +865,13 @@ There are several things that need to be remembered:
overlays_raw[shoe_layer] = ovr || result_layer
else
if(footprint_color) // Handles bloody feet.
var/image/bloodsies = image(species.blood_mask, "shoeblood")
bloodsies.color = footprint_color
bloodsies.appearance_flags = RESET_ALPHA
overlays_raw[SHOES_LAYER] = bloodsies
for(var/limb_tag in list(BP_L_FOOT, BP_R_FOOT))
var/obj/item/organ/external/E = get_organ(limb_tag)
if(E && !E.is_stump())
var/image/bloodsies = image(species.blood_mask, "shoeblood_[E.limb_name]")
bloodsies.color = footprint_color
bloodsies.appearance_flags = RESET_ALPHA
overlays_raw[SHOES_LAYER] = bloodsies
else
overlays_raw[SHOES_LAYER] = null
overlays_raw[SHOES_LAYER_ALT] = null