diff --git a/code/game/objects/items/weapons/tools.dm b/code/game/objects/items/weapons/tools.dm
index e75d6e7b3fb..a8b70bc0b53 100644
--- a/code/game/objects/items/weapons/tools.dm
+++ b/code/game/objects/items/weapons/tools.dm
@@ -163,26 +163,19 @@
/obj/item/weapon/weldingtool/attack(mob/living/carbon/human/H, mob/user)
+ var/obj/item/organ/limb/affecting = H.get_organ(check_zone(user.zone_sel.selecting))
if(istype(H))
- var/obj/item/organ/limb/affecting = H.get_organ(check_zone(user.zone_sel.selecting))
if(affecting.status == ORGAN_ROBOTIC)
if(src.remove_fuel(0))
- if(affecting.brute_dam > 0)
- affecting.heal_damage(30,0,1)
- H.update_damage_overlays(0)
- H.updatehealth()
- for(var/mob/O in viewers(user, null))
- O.show_message(text("[user] has fixed some of the dents on [H]'s [affecting.getDisplayName()]!"), 1)
- return
- else
- user << "[H]'s [affecting.getDisplayName()] is already in good condition"
- return
+ src.item_heal_robotic(H, user, 30, 0)
+ return
else
user << "Need more welding fuel!"
return
else
return ..()
+
else
return ..()
diff --git a/code/modules/power/cable.dm b/code/modules/power/cable.dm
index 06de1d8020a..be06d93f9cc 100644
--- a/code/modules/power/cable.dm
+++ b/code/modules/power/cable.dm
@@ -221,21 +221,12 @@
/obj/item/weapon/cable_coil/attack(mob/living/carbon/human/H, mob/user)
-
+ var/obj/item/organ/limb/affecting = H.get_organ(check_zone(user.zone_sel.selecting))
if(istype(H))
- var/obj/item/organ/limb/affecting = H.get_organ(check_zone(user.zone_sel.selecting))
-
if(affecting.status == ORGAN_ROBOTIC)
- if(affecting.burn_dam > 0)
- affecting.heal_damage(0,30,1)
- H.updatehealth()
- for(var/mob/O in viewers(user, null))
- O.show_message(text("[user] has fixed some of the burnt wires on [H]'s [affecting.getDisplayName()]!"), 1)
- src.use(1)
- return
- else
- user << "[H]'s [affecting.getDisplayName()] is already in good condition"
- return
+ src.item_heal_robotic(H, user, 0, 30)
+ src.use(1)
+ return
else
return ..()
else
diff --git a/code/modules/surgery/organs/organ.dm b/code/modules/surgery/organs/organ.dm
index 6fbc2f55fbd..f55f2888677 100644
--- a/code/modules/surgery/organs/organ.dm
+++ b/code/modules/surgery/organs/organ.dm
@@ -151,6 +151,30 @@
return update_organ_icon()
+/obj/item/proc/item_heal_robotic(var/mob/living/carbon/human/H, var/mob/user, var/brute, var/burn)
+ var/obj/item/organ/limb/affecting = H.get_organ(check_zone(user.zone_sel.selecting))
+
+ var/dam //changes repair text based on how much brute/burn was supplied
+
+ if(brute > burn)
+ dam = 1
+ else
+ dam = 0
+
+ if(affecting.status == ORGAN_ROBOTIC)
+ if(brute > 0 && affecting.brute_dam > 0 || burn > 0 && affecting.burn_dam > 0)
+ affecting.heal_damage(brute,burn,1)
+ H.update_damage_overlays(0)
+ H.updatehealth()
+ for(var/mob/O in viewers(user, null))
+ O.show_message(text("[user] has fixed some of the [dam ? "dents on" : "burnt wires in"] [H]'s [affecting.getDisplayName()]!"), 1)
+ return
+ else
+ user << "[H]'s [affecting.getDisplayName()] is already in good condition"
+ return
+ else
+ return
+
//Returns total damage...kinda pointless really
/obj/item/organ/limb/proc/get_damage()
return brute_dam + burn_dam