mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 02:34:00 +00:00
More fixes for the organ system.
git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4731 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
@@ -50,8 +50,23 @@
|
|||||||
if(!istype(affecting, /datum/organ/external) || affecting:burn_dam <= 0)
|
if(!istype(affecting, /datum/organ/external) || affecting:burn_dam <= 0)
|
||||||
affecting = H.get_organ("head")
|
affecting = H.get_organ("head")
|
||||||
|
|
||||||
if (affecting.heal_damage(src.heal_brute, src.heal_burn))
|
// If we're targetting arms or legs, also heal the respective hand/foot
|
||||||
H.UpdateDamageIcon()
|
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 (affecting.heal_damage(src.heal_brute, src.heal_burn) || child.heal_damage(src.heal_brute, src.heal_burn))
|
||||||
|
H.UpdateDamageIcon()
|
||||||
|
else
|
||||||
|
if (affecting.heal_damage(src.heal_brute, src.heal_burn))
|
||||||
|
H.UpdateDamageIcon()
|
||||||
M.updatehealth()
|
M.updatehealth()
|
||||||
else
|
else
|
||||||
M.heal_organ_damage((src.heal_brute/2), (src.heal_burn/2))
|
M.heal_organ_damage((src.heal_brute/2), (src.heal_burn/2))
|
||||||
|
|||||||
@@ -253,6 +253,14 @@
|
|||||||
update |= temp.take_damage(b_loss * 0.05, f_loss * 0.05)
|
update |= temp.take_damage(b_loss * 0.05, f_loss * 0.05)
|
||||||
if("r_leg")
|
if("r_leg")
|
||||||
update |= temp.take_damage(b_loss * 0.05, f_loss * 0.05)
|
update |= temp.take_damage(b_loss * 0.05, f_loss * 0.05)
|
||||||
|
if("r_foot")
|
||||||
|
update |= temp.take_damage(b_loss * 0.05, f_loss * 0.05)
|
||||||
|
if("l_foot")
|
||||||
|
update |= temp.take_damage(b_loss * 0.05, f_loss * 0.05)
|
||||||
|
if("r_arm")
|
||||||
|
update |= temp.take_damage(b_loss * 0.05, f_loss * 0.05)
|
||||||
|
if("l_arm")
|
||||||
|
update |= temp.take_damage(b_loss * 0.05, f_loss * 0.05)
|
||||||
if(update) UpdateDamageIcon()
|
if(update) UpdateDamageIcon()
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -160,7 +160,15 @@ Please contact me on #coderbus IRC. ~Carn x
|
|||||||
for(var/image/I in overlays_standing)
|
for(var/image/I in overlays_standing)
|
||||||
overlays += I
|
overlays += I
|
||||||
|
|
||||||
|
var/global/list/damage_icon_parts = list()
|
||||||
|
proc/get_damage_icon_part(damage_state, body_part)
|
||||||
|
if(damage_icon_parts["[damage_state]/[body_part]"] == null)
|
||||||
|
var/icon/DI = new /icon('icons/mob/dam_human.dmi', damage_state) // the damage icon for whole human
|
||||||
|
DI.Blend(new /icon('dam_mask.dmi', body_part), ICON_MULTIPLY) // mask with this organ's pixels
|
||||||
|
damage_icon_parts["[damage_state]/[body_part]"] = DI
|
||||||
|
return DI
|
||||||
|
else
|
||||||
|
return damage_icon_parts["[damage_state]/[body_part]"]
|
||||||
|
|
||||||
//DAMAGE OVERLAYS
|
//DAMAGE OVERLAYS
|
||||||
//constructs damage icon for each organ from mask * damage field and saves it in our overlays_ lists
|
//constructs damage icon for each organ from mask * damage field and saves it in our overlays_ lists
|
||||||
@@ -182,21 +190,23 @@ Please contact me on #coderbus IRC. ~Carn x
|
|||||||
var/icon/standing = new /icon('dam_human.dmi', "00")
|
var/icon/standing = new /icon('dam_human.dmi', "00")
|
||||||
var/icon/lying = new /icon('dam_human.dmi', "00-2")
|
var/icon/lying = new /icon('dam_human.dmi', "00-2")
|
||||||
|
|
||||||
|
var/image/standing_image = new /image("icon" = standing)
|
||||||
|
var/image/lying_image = new /image("icon" = lying)
|
||||||
|
|
||||||
|
|
||||||
// blend the individual damage states with our icons
|
// blend the individual damage states with our icons
|
||||||
for(var/datum/organ/external/O in organs)
|
for(var/datum/organ/external/O in organs)
|
||||||
if(!(O.status & ORGAN_DESTROYED))
|
if(!(O.status & ORGAN_DESTROYED))
|
||||||
O.update_icon()
|
O.update_icon()
|
||||||
var/icon/DI = new /icon('icons/mob/dam_human.dmi', O.damage_state) // the damage icon for whole human
|
if(O.damage_state == "00") continue
|
||||||
DI.Blend(new /icon('dam_mask.dmi', O.icon_name), ICON_MULTIPLY) // mask with this organ's pixels
|
|
||||||
|
|
||||||
standing.Blend(DI,ICON_OVERLAY)
|
var/icon/DI = get_damage_icon_part(O.damage_state, O.icon_name)
|
||||||
DI = new /icon('icons/mob/dam_human.dmi', "[O.damage_state]-2") // repeat for lying icons
|
|
||||||
DI.Blend(new /icon('dam_mask.dmi', "[O.icon_name]2"), ICON_MULTIPLY)
|
|
||||||
|
|
||||||
lying.Blend(DI,ICON_OVERLAY)
|
standing_image.overlays += DI
|
||||||
|
|
||||||
|
DI = get_damage_icon_part("[O.damage_state]-2", "[O.icon_name]2")
|
||||||
|
lying_image.overlays += DI
|
||||||
|
|
||||||
var/image/standing_image = new /image("icon" = standing)
|
|
||||||
var/image/lying_image = new /image("icon" = lying)
|
|
||||||
|
|
||||||
overlays_standing[DAMAGE_LAYER] = standing_image
|
overlays_standing[DAMAGE_LAYER] = standing_image
|
||||||
overlays_lying[DAMAGE_LAYER] = lying_image
|
overlays_lying[DAMAGE_LAYER] = lying_image
|
||||||
@@ -224,9 +234,15 @@ Please contact me on #coderbus IRC. ~Carn x
|
|||||||
stand_icon = new /icon('icons/mob/human.dmi', "fatbody_s")
|
stand_icon = new /icon('icons/mob/human.dmi', "fatbody_s")
|
||||||
lying_icon = new /icon('icons/mob/human.dmi', "fatbody_l")
|
lying_icon = new /icon('icons/mob/human.dmi', "fatbody_l")
|
||||||
individual_limbs = 0
|
individual_limbs = 0
|
||||||
else
|
// If dismemberment is on, draw individual limbs
|
||||||
|
else if(config.limbs_can_break)
|
||||||
stand_icon = new /icon('icons/mob/human.dmi', "torso_[g]_s")
|
stand_icon = new /icon('icons/mob/human.dmi', "torso_[g]_s")
|
||||||
lying_icon = new /icon('icons/mob/human.dmi', "torso_[g]_l")
|
lying_icon = new /icon('icons/mob/human.dmi', "torso_[g]_l")
|
||||||
|
// Otherwise just draw the full body.
|
||||||
|
else
|
||||||
|
stand_icon = new /icon('icons/mob/human.dmi', "body_[g]_s")
|
||||||
|
lying_icon = new /icon('icons/mob/human.dmi', "body_[g]_l")
|
||||||
|
individual_limbs = 0
|
||||||
|
|
||||||
// Draw each individual limb
|
// Draw each individual limb
|
||||||
if(individual_limbs)
|
if(individual_limbs)
|
||||||
|
|||||||
Reference in New Issue
Block a user