Adds item_heal_robotic() - a way for items to trigger robotic limb heal procs without copy-paste

This commit is contained in:
Robson Richards
2014-01-21 07:38:46 +00:00
parent 86eae3a376
commit 1ff14a5fcf
3 changed files with 32 additions and 24 deletions
+24
View File
@@ -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("<span class='notice'>[user] has fixed some of the [dam ? "dents on" : "burnt wires in"] [H]'s [affecting.getDisplayName()]!</span>"), 1)
return
else
user << "<span class='notice'>[H]'s [affecting.getDisplayName()] is already in good condition</span>"
return
else
return
//Returns total damage...kinda pointless really
/obj/item/organ/limb/proc/get_damage()
return brute_dam + burn_dam