Merge branch 'bandages'

This commit is contained in:
Chinsky
2012-12-02 21:17:11 +04:00

View File

@@ -23,70 +23,34 @@
if (istype(M, /mob/living/carbon/human))
var/mob/living/carbon/human/H = M
var/datum/organ/external/affecting = H.get_organ("chest")
var/datum/organ/external/affecting = H.get_organ(user.zone_sel.selecting)
if(affecting.status & ORGAN_ROBOT)
user << "\red This isn't useful at all on a robotic limb.."
return 1
if(istype(user, /mob/living/carbon/human))
var/mob/living/carbon/human/user2 = user
affecting = H.get_organ(check_zone(user2.zone_sel.selecting))
else
if(!istype(affecting, /datum/organ/external) || affecting:burn_dam <= 0)
affecting = H.get_organ("head")
if(src.heal_brute)
if(!affecting.bandage())
user << "\red The wounds on [M]'s [affecting.display_name] have already been bandaged."
return 1
else
user.visible_message( "\blue [user] bandages wounds on [M]'s [affecting.display_name].", \
"\blue You bandage wounds on [M]'s [affecting.display_name]." )
// If we're targetting arms or legs, also heal the respective hand/foot
if(affecting.name in list("l_arm","r_arm","l_leg","r_leg"))
var/datum/organ/external/child
if(affecting.name == "l_arm")
child = H.get_organ("l_hand")
else if(affecting.name == "r_arm")
child = H.get_organ("r_hand")
else if(affecting.name == "r_leg")
child = H.get_organ("r_foot")
else if(affecting.name == "l_leg")
child = H.get_organ("l_foot")
if(src.heal_brute)
if(!affecting.bandage() && !child.bandage())
user << "\red The wounds on this limb have already been bandaged."
return 1
else if(src.heal_burn)
if(!affecting.salve() && !child.salve())
user << "\red The wounds on this limb have already been salved."
return 1
else
if(src.heal_brute)
if(!affecting.bandage())
user << "\red The wounds on this limb have already been bandaged."
return 1
else if(src.heal_burn)
if(!affecting.salve())
user << "\red The wounds on this limb have already been salved."
return 1
else if(src.heal_burn)
if(!affecting.salve())
user << "\red The wounds on [M]'s [affecting.display_name] have already been salved."
return 1
else
user.visible_message( "\blue [user] salves wounds on [M]'s [affecting.display_name].", \
"\blue You salve wounds on [M]'s [affecting.display_name]." )
H.UpdateDamageIcon()
M.updatehealth()
else
M.heal_organ_damage((src.heal_brute/2), (src.heal_burn/2))
user.visible_message( \
"\blue [M] has been applied with [src] by [user].", \
"\blue You apply \the [src] to [M]." \
)
use(1)
if (user)
if (M != user)
user.visible_message( \
"\blue [M] has been applied with [src] by [user].", \
"\blue You apply \the [src] to [M]." \
)
else
var/t_himself = "itself"
if (user.gender == MALE)
t_himself = "himself"
else if (user.gender == FEMALE)
t_himself = "herself"
user.visible_message( \
"\blue [M] applied [src] on [t_himself].", \
"\blue You apply \the [src] on yourself." \
)
M.updatehealth()