Replaces ORGAN_SPLINTED

This commit is contained in:
Yoshax
2016-09-15 18:00:59 +01:00
parent 2007c143d2
commit 8b48c8856e
14 changed files with 36 additions and 38 deletions

View File

@@ -35,9 +35,8 @@
#define ORGAN_BLEEDING (1<<1)
#define ORGAN_BROKEN (1<<2)
#define ORGAN_DESTROYED (1<<3)
#define ORGAN_SPLINTED (1<<4)
#define ORGAN_DEAD (1<<5)
#define ORGAN_MUTATED (1<<6)
#define ORGAN_DEAD (1<<4)
#define ORGAN_MUTATED (1<<5)
#define DROPLIMB_EDGE 0
#define DROPLIMB_BLUNT 1

View File

@@ -329,7 +329,7 @@
organStatus["broken"] = E.broken_description
if(E.status & ORGAN_ROBOT)
organStatus["robotic"] = 1
if(E.status & ORGAN_SPLINTED)
if(E.splinted)
organStatus["splinted"] = 1
if(E.status & ORGAN_BLEEDING)
organStatus["bleeding"] = 1
@@ -483,7 +483,7 @@
break
if(istype(e, /obj/item/organ/external/chest) && occupant.is_lung_ruptured())
lung_ruptured = "Lung ruptured:"
if(e.status & ORGAN_SPLINTED)
if(e.splinted)
splint = "Splinted:"
if(e.status & ORGAN_BLEEDING)
bled = "Bleeding:"

View File

@@ -161,7 +161,7 @@ REAGENT SCANNER
continue
var/limb = e.name
if(e.status & ORGAN_BROKEN)
if(((e.name == "l_arm") || (e.name == "r_arm") || (e.name == "l_leg") || (e.name == "r_leg")) && (!(e.status & ORGAN_SPLINTED)))
if(((e.name == "l_arm") || (e.name == "r_arm") || (e.name == "l_leg") || (e.name == "r_leg")) && (!e.splinted))
user << "<span class='warning'>Unsecured fracture in subject [limb]. Splinting recommended for transport.</span>"
if(e.has_infected_wound())
user << "<span class='warning'>Infected wound detected in subject [limb]. Disinfection recommended.</span>"

View File

@@ -264,7 +264,7 @@
if(!(affecting.organ_tag in splintable_organs))
user << "<span class='danger'>You can't use \the [src] to apply a splint there!</span>"
return
if(affecting.status & ORGAN_SPLINTED)
if(affecting.splinted)
user << "<span class='danger'>[M]'s [limb] is already splinted!</span>"
return
if (M != user)

View File

@@ -82,7 +82,7 @@
if(user.wear_suit == src)
for(var/obj/item/organ/external/E in user.organs)
if(E.apply_splint(src))
if(E.is_broken() && E.apply_splint(src))
user << "You feel [src] constrict about your [E.name], supporting it."
supporting_limbs |= E
else

View File

@@ -251,8 +251,8 @@
//splints
for(var/organ in list(BP_L_LEG, BP_R_LEG, BP_L_ARM, BP_R_ARM))
var/obj/item/organ/external/o = get_organ(organ)
if(o && o.status & ORGAN_SPLINTED)
msg += "<span class='warning'>[T.He] [T.has] a splint on [T.his] [o.name]!</span>\n"
if(o && o.splinted && o.splinted.loc == o)
msg += "<span class='warning'>[T.He] [T.has] \a [o.splinted] on [T.his] [o.name]!</span>\n"
if(suiciding)
msg += "<span class='warning'>[T.He] appears to have commited suicide... there is no hope of recovery.</span>\n"

View File

@@ -1013,7 +1013,7 @@
/mob/living/carbon/human/proc/handle_embedded_objects()
for(var/obj/item/organ/external/organ in src.organs)
if(organ.status & ORGAN_SPLINTED) //Splints prevent movement.
if(organ.splinted) //Splints prevent movement.
continue
for(var/obj/item/O in organ.implants)
if(!istype(O,/obj/item/weapon/implant) && prob(5)) //Moving with things stuck in you could be bad.

View File

@@ -45,7 +45,7 @@
var/obj/item/organ/external/E = get_organ(organ_name)
if(!E || E.is_stump())
tally += 4
if(E.status & ORGAN_SPLINTED)
if(E.splinted)
tally += 0.5
else if(E.status & ORGAN_BROKEN)
tally += 1.5
@@ -57,7 +57,7 @@
var/obj/item/organ/external/E = get_organ(organ_name)
if(!E || E.is_stump())
tally += 4
else if(E.status & ORGAN_SPLINTED)
else if(E.splinted)
tally += 0.5
else if(E.status & ORGAN_BROKEN)
tally += 1.5

View File

@@ -142,10 +142,10 @@
return
for (var/obj/item/organ/external/E in organs)
if(!E || !E.can_grasp || (E.status & ORGAN_SPLINTED))
if(!E || !E.can_grasp)
continue
if(E.is_broken() || E.is_dislocated())
if((E.is_broken() || E.is_dislocated()) && !E.splinted)
switch(E.body_part)
if(HAND_LEFT, ARM_LEFT)
if(!l_hand)

View File

@@ -125,11 +125,11 @@
if(can_reach_splints)
var/removed_splint
for(var/obj/item/organ/external/o in organs)
if (o && o.status & ORGAN_SPLINTED)
if (o && o.splinted)
var/obj/item/S = o.splinted
if(istype(S) && S.loc == o) //can only remove splints that are actually worn on the organ (deals with hardsuit splints)
S.add_fingerprint(user)
if(o.remove_splints())
if(o.remove_splint())
user.put_in_active_hand(S)
removed_splint = 1
if(removed_splint)

View File

@@ -519,7 +519,7 @@
for(var/name in H.organs_by_name)
var/obj/item/organ/external/e = H.organs_by_name[name]
if(e && H.lying)
if(((e.status & ORGAN_BROKEN && !(e.status & ORGAN_SPLINTED)) || e.status & ORGAN_BLEEDING) && (H.getBruteLoss() + H.getFireLoss() >= 100))
if(((e.status & ORGAN_BROKEN && !(e.splinted)) || e.status & ORGAN_BLEEDING) && (H.getBruteLoss() + H.getFireLoss() >= 100))
return 1
break
return 0

View File

@@ -254,7 +254,6 @@ var/list/organ_cache = list()
robotic = ORGAN_ROBOT
src.status &= ~ORGAN_BROKEN
src.status &= ~ORGAN_BLEEDING
src.status &= ~ORGAN_SPLINTED
src.status &= ~ORGAN_CUT_AWAY
/obj/item/organ/proc/mechassist() //Used to add things like pacemakers, etc

View File

@@ -529,11 +529,11 @@ This function completely restores a damaged organ to perfect condition.
//external organs handle brokenness a bit differently when it comes to damage. Instead brute_dam is checked inside process()
//this also ensures that an external organ cannot be "broken" without broken_description being set.
/obj/item/organ/external/is_broken()
return ((status & ORGAN_CUT_AWAY) || ((status & ORGAN_BROKEN) && !(status & ORGAN_SPLINTED)))
return ((status & ORGAN_CUT_AWAY) || ((status & ORGAN_BROKEN) && !(splinted)))
//Determines if we even need to process this organ.
/obj/item/organ/external/proc/need_process()
if(status & (ORGAN_CUT_AWAY|ORGAN_BLEEDING|ORGAN_BROKEN|ORGAN_DESTROYED|ORGAN_SPLINTED|ORGAN_DEAD|ORGAN_MUTATED))
if(status & (ORGAN_CUT_AWAY|ORGAN_BLEEDING|ORGAN_BROKEN|ORGAN_DESTROYED|ORGAN_DEAD|ORGAN_MUTATED))
return 1
if((brute_dam || burn_dam) && (robotic < ORGAN_ROBOT)) //Robot limbs don't autoheal and thus don't need to process when damaged
return 1
@@ -1011,25 +1011,11 @@ Note that amputating the affected organ does in fact remove the infection from t
// 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(!(status & ORGAN_SPLINTED) && owner && istype(owner.wear_suit, /obj/item/clothing/suit/space))
if(!(splinted) && owner && istype(owner.wear_suit, /obj/item/clothing/suit/space))
var/obj/item/clothing/suit/space/suit = owner.wear_suit
suit.check_limb_support()
/obj/item/organ/external/proc/apply_splint(var/atom/movable/splint)
if(!splinted)
splinted = splint
status |= ORGAN_SPLINTED
return 1
return 0
/obj/item/organ/external/proc/remove_splint()
if(splinted)
if(splinted.loc == src)
splinted.dropInto(owner? owner.loc : src.loc)
splinted = null
status &= ~(ORGAN_SPLINTED)
return 1
return 0
/obj/item/organ/external/proc/mend_fracture()
if(robotic >= ORGAN_ROBOT)
@@ -1040,6 +1026,20 @@ Note that amputating the affected organ does in fact remove the infection from t
status &= ~ORGAN_BROKEN
return 1
/obj/item/organ/external/proc/apply_splint(var/atom/movable/splint)
if(!splinted)
splinted = splint
return 1
return 0
/obj/item/organ/external/proc/remove_splint()
if(splinted)
if(splinted.loc == src)
splinted.dropInto(owner? owner.loc : src.loc)
splinted = null
return 1
return 0
/obj/item/organ/external/robotize(var/company, var/skip_prosthetics = 0, var/keep_organs = 0)
if(robotic >= ORGAN_ROBOT)
@@ -1063,6 +1063,7 @@ Note that amputating the affected organ does in fact remove the infection from t
dislocated = -1
cannot_break = 1
remove_splint()
get_icon()
unmutate()

View File

@@ -140,7 +140,6 @@
user.visible_message("\blue [user] has mended the damaged bones in [target]'s [affected.name] with \the [tool]." , \
"\blue You have mended the damaged bones in [target]'s [affected.name] with \the [tool]." )
affected.status &= ~ORGAN_BROKEN
affected.status &= ~ORGAN_SPLINTED
affected.stage = 0
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)