RIGs now splint broken limbs correctly (#6987)

Adds to fractured organ process, if the user's wearing a RIG and it's deployed over that part, it'll splint that part.
This commit is contained in:
Geeves
2019-10-12 22:37:27 +03:00
committed by Erki
parent 84b046cbb7
commit 33ccd3d8e1
2 changed files with 62 additions and 16 deletions
+21 -16
View File
@@ -496,9 +496,28 @@ This function completely restores a damaged organ to perfect condition.
//Infections
update_germs()
//check if an online RIG can splint the broken bone
check_rigsplints()
else
..()
/obj/item/organ/external/proc/check_rigsplints()
if((status & ORGAN_BROKEN) && !(status & ORGAN_SPLINTED))
if(istype(owner,/mob/living/carbon/human))
var/mob/living/carbon/human/H = owner
if(H.back && istype(H.back, /obj/item/weapon/rig))
var/obj/item/weapon/rig/R = H.back
if(R.offline)
return
if(H.wear_suit && istype(H.wear_suit,/obj/item/clothing/suit/space))
var/obj/item/clothing/suit/space/suit = H.wear_suit
if(isnull(suit.supporting_limbs))
return
to_chat(owner, "You feel \the [suit] constrict about your [name], supporting it.")
status |= ORGAN_SPLINTED
suit.supporting_limbs |= src
//Updating germ levels. Handles organ germ levels and necrosis.
/*
The INFECTION_LEVEL values defined in setup.dm control the time it takes to reach the different
@@ -931,22 +950,7 @@ Note that amputating the affected organ does in fact remove the infection from t
release_restraints()
// This is mostly for the ninja suit to stop ninja being so crippled by breaks.
// TODO: consider moving this to a suit proc or process() or something during
// hardsuit rewrite.
if(owner && !(status & ORGAN_SPLINTED) && istype(owner,/mob/living/carbon/human))
var/mob/living/carbon/human/H = owner
if(H.wear_suit && istype(H.wear_suit,/obj/item/clothing/suit/space))
var/obj/item/clothing/suit/space/suit = H.wear_suit
if(isnull(suit.supporting_limbs))
return
to_chat(owner, "You feel \the [suit] constrict about your [name], supporting it.")
status |= ORGAN_SPLINTED
suit.supporting_limbs |= src
check_rigsplints()
return
/obj/item/organ/external/proc/mend_fracture()
@@ -956,6 +960,7 @@ Note that amputating the affected organ does in fact remove the infection from t
return 0 //will just immediately fracture again
status &= ~ORGAN_BROKEN
return 1
/obj/item/organ/external/robotize(var/company)