From 569d12facf19dcdd3efc3429bf0f2e0fb1ccc779 Mon Sep 17 00:00:00 2001 From: Rockdtben Date: Thu, 5 Jun 2014 19:25:08 -0500 Subject: [PATCH] Moved item_heal_robotic out of obj/item and into mob_helpers.dm --- code/game/objects/items/weapons/tools.dm | 2 +- code/modules/mob/mob_helpers.dm | 26 +++++++++++++++++++++++- code/modules/power/cable.dm | 2 +- code/modules/surgery/organs/organ.dm | 24 ---------------------- 4 files changed, 27 insertions(+), 27 deletions(-) diff --git a/code/game/objects/items/weapons/tools.dm b/code/game/objects/items/weapons/tools.dm index 385115c97a8..877d943f1bc 100644 --- a/code/game/objects/items/weapons/tools.dm +++ b/code/game/objects/items/weapons/tools.dm @@ -173,7 +173,7 @@ if(affecting.status == ORGAN_ROBOTIC) if(src.remove_fuel(0)) - src.item_heal_robotic(H, user, 30, 0) + item_heal_robotic(H, user, 30, 0) return else user << "Need more welding fuel!" diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm index ea8ff8040f2..e295e0b6553 100644 --- a/code/modules/mob/mob_helpers.dm +++ b/code/modules/mob/mob_helpers.dm @@ -418,4 +418,28 @@ proc/is_special_character(mob/M) // returns 1 for special characters and 2 for h /proc/get_both_hands(mob/living/carbon/M) var/list/hands = list(M.l_hand, M.r_hand) - return hands \ No newline at end of file + return hands + +/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 \ No newline at end of file diff --git a/code/modules/power/cable.dm b/code/modules/power/cable.dm index 5dc3e03aef9..3aa64529fc7 100644 --- a/code/modules/power/cable.dm +++ b/code/modules/power/cable.dm @@ -491,7 +491,7 @@ obj/structure/cable/proc/avail() var/obj/item/organ/limb/affecting = H.get_organ(check_zone(user.zone_sel.selecting)) if(affecting.status == ORGAN_ROBOTIC) - src.item_heal_robotic(H, user, 0, 30) + item_heal_robotic(H, user, 0, 30) src.use(1) return else diff --git a/code/modules/surgery/organs/organ.dm b/code/modules/surgery/organs/organ.dm index f55f2888677..6fbc2f55fbd 100644 --- a/code/modules/surgery/organs/organ.dm +++ b/code/modules/surgery/organs/organ.dm @@ -151,30 +151,6 @@ 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