From 1749af51b212102a2efe0ff35ca5dde2aac7445b Mon Sep 17 00:00:00 2001 From: Arokha Sieyes Date: Wed, 18 May 2016 01:14:41 -0400 Subject: [PATCH] Makes robolimbs repair completely Previously, because noncritical robolimbs did not count for bruteloss or burnloss (per line 13 in human_damage.dm), nothing would ever cause robot limbs to call update_wounds() on the organs to clear wounds after repair. Furthermore, update_wounds ignored wounds on robotic limbs and edited early without even checking if it should remove them. This caused a problem. This corrects this, and still exits early(er) in update_wounds() for robotic limbs, but makes sure there are no 0-damage wounds left and if there are, removes them. As a 'backup', hitting a robolimb with a welder when there's nothing to fix will also call this proc, to catch any cases where someone has directly changed wounds or anything like that. Also fixes spacing on robolimb damage examine text (get_wound_desc had spaces, but should not have in most cases), and added a message for having an open maintenance panel on a limb. --- code/game/objects/items/weapons/tools.dm | 1 + code/modules/organs/organ_external.dm | 20 +++++++++++++++----- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/code/game/objects/items/weapons/tools.dm b/code/game/objects/items/weapons/tools.dm index a9e6192796a..c1922b735e9 100644 --- a/code/game/objects/items/weapons/tools.dm +++ b/code/game/objects/items/weapons/tools.dm @@ -441,6 +441,7 @@ return ..() else user << "Nothing to fix!" + S.update_wounds() return return ..() diff --git a/code/modules/organs/organ_external.dm b/code/modules/organs/organ_external.dm index 28d054b3779..0a08817ef0d 100644 --- a/code/modules/organs/organ_external.dm +++ b/code/modules/organs/organ_external.dm @@ -349,6 +349,7 @@ //Sync the organ's damage with its wounds src.update_damages() + src.update_wounds() owner.updatehealth() var/result = update_icon() @@ -602,6 +603,9 @@ Note that amputating the affected organ does in fact remove the infection from t /obj/item/organ/external/proc/update_wounds() if((status & ORGAN_ROBOT)) //Robotic limbs don't heal or get worse. + for(var/datum/wound/W in wounds) + if(W.damage <= 0) + wounds -= W return for(var/datum/wound/W in wounds) @@ -1129,17 +1133,23 @@ Note that amputating the affected organ does in fact remove the infection from t if(brute_dam) switch(brute_dam) if(0 to 20) - . += " some dents" + . += "some dents" if(21 to INFINITY) - . += pick(" a lot of dents"," severe denting") + . += pick("a lot of dents","severe denting") if(brute_dam && burn_dam) - . += " and" + . += " and " if(burn_dam) switch(burn_dam) if(0 to 20) - . += " some burns" + . += "some burns" if(21 to INFINITY) - . += pick(" a lot of burns"," severe melting") + . += pick("a lot of burns","severe melting") + if(open) + if(brute_dam || burn_dam) + . += " and an open panel" + else + . += "an open panel" + return var/list/wound_descriptors = list()