mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-07-12 00:20:42 +01:00
Ported parts of the BS12 organ system.
This includes: - Individual wounds - Dismemberment - Bone breaking It also adds configuration values to config/game_options.txt to control the point at which bones break and limbs are cut off. Does not include surgery or bleeding yet. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4720 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
@@ -203,3 +203,16 @@
|
||||
//if(hasvar(src,"r_hand")) if(src:r_hand) items += src:r_hand
|
||||
|
||||
return items
|
||||
|
||||
/** BS12's proc to get the item in the active hand. Couldn't find the /tg/ equivalent. **/
|
||||
/mob/proc/equipped()
|
||||
if(issilicon(src))
|
||||
if(isrobot(src))
|
||||
if(src:module_active)
|
||||
return src:module_active
|
||||
else
|
||||
if (hand)
|
||||
return l_hand
|
||||
else
|
||||
return r_hand
|
||||
return
|
||||
@@ -10,3 +10,8 @@
|
||||
|
||||
var/silent = null //Can't talk. Value goes down every life proc.
|
||||
var/last_eating = 0 //Not sure what this does... I found it hidden in food.dm
|
||||
|
||||
var/life_tick = 0 // The amount of life ticks that have processed on this mob.
|
||||
|
||||
// total amount of wounds on mob, used to spread out healing and the like over all wounds
|
||||
var/number_wounds = 0
|
||||
@@ -201,40 +201,6 @@
|
||||
msg += "...</span>\n"
|
||||
|
||||
else
|
||||
|
||||
msg += "<span class='warning'>"
|
||||
|
||||
var/temp = getBruteLoss() //no need to calculate each of these twice
|
||||
if(temp)
|
||||
if(temp < 30)
|
||||
msg += "[t_He] [t_has] minor bruising.\n"
|
||||
else
|
||||
msg += "<B>[t_He] [t_has] severe bruising!</B>\n"
|
||||
|
||||
temp = getFireLoss()
|
||||
if(temp)
|
||||
if(temp < 30)
|
||||
msg += "[t_He] [t_has] minor burns.\n"
|
||||
else
|
||||
msg += "<B>[t_He] [t_has] severe burns!</B>\n"
|
||||
|
||||
temp = getCloneLoss()
|
||||
if(temp)
|
||||
if(temp < 30)
|
||||
msg += "[t_He] [t_has] minor genetic deformities.\n"
|
||||
else
|
||||
msg += "<B>[t_He] [t_has] severe genetic deformities.</B>\n"
|
||||
|
||||
if(nutrition < 100)
|
||||
msg += "[t_He] [t_is] severely malnourished.\n"
|
||||
else if(nutrition >= 500)
|
||||
if(usr.nutrition < 100)
|
||||
msg += "[t_He] [t_is] plump and delicious looking - Like a fat little piggy. A tasty piggy.\n"
|
||||
else
|
||||
msg += "[t_He] [t_is] quite chubby.\n"
|
||||
|
||||
msg += "</span>"
|
||||
|
||||
if(stat == UNCONSCIOUS)
|
||||
msg += "[t_He] [t_is]n't responding to anything around [t_him] and seems to be asleep.\n"
|
||||
else if(getBrainLoss() >= 60)
|
||||
@@ -245,6 +211,148 @@
|
||||
else if(!client)
|
||||
msg += "[t_He] [t_has] a vacant, braindead stare...\n"
|
||||
|
||||
msg += "<span class='warning'>"
|
||||
|
||||
if(nutrition < 100)
|
||||
msg += "[t_He] [t_is] severely malnourished.\n"
|
||||
else if(nutrition >= 500)
|
||||
if(usr.nutrition < 100)
|
||||
msg += "[t_He] [t_is] plump and delicious looking - Like a fat little piggy. A tasty piggy.\n"
|
||||
else
|
||||
msg += "[t_He] [t_is] quite chubby.\n"
|
||||
msg += "</span>"
|
||||
|
||||
var/list/wound_flavor_text = list()
|
||||
var/list/is_destroyed = list()
|
||||
var/list/is_bleeding = list()
|
||||
for(var/datum/organ/external/temp in organs)
|
||||
if(temp)
|
||||
if(temp.status & ORGAN_DESTROYED)
|
||||
is_destroyed["[temp.display_name]"] = 1
|
||||
wound_flavor_text["[temp.display_name]"] = "<span class='warning'><b>[t_He] is missing [t_his] [temp.display_name].</b></span>\n"
|
||||
continue
|
||||
if(temp.status & ORGAN_ROBOT)
|
||||
if(!(temp.brute_dam + temp.burn_dam))
|
||||
wound_flavor_text["[temp.display_name]"] = "<span class='warning'>[t_He] has a robot [temp.display_name]!</span>\n"
|
||||
continue
|
||||
else
|
||||
wound_flavor_text["[temp.display_name]"] = "<span class='warning'>[t_He] has a robot [temp.display_name], it has"
|
||||
if(temp.brute_dam) switch(temp.brute_dam)
|
||||
if(0 to 20)
|
||||
wound_flavor_text["[temp.display_name]"] += " some dents"
|
||||
if(21 to INFINITY)
|
||||
wound_flavor_text["[temp.display_name]"] += pick(" a lot of dents"," severe denting")
|
||||
if(temp.brute_dam && temp.burn_dam)
|
||||
wound_flavor_text["[temp.display_name]"] += " and"
|
||||
if(temp.burn_dam) switch(temp.burn_dam)
|
||||
if(0 to 20)
|
||||
wound_flavor_text["[temp.display_name]"] += " some burns"
|
||||
if(21 to INFINITY)
|
||||
wound_flavor_text["[temp.display_name]"] += pick(" a lot of burns"," severe melting")
|
||||
wound_flavor_text["[temp.display_name]"] += "!</span>\n"
|
||||
else if(temp.wounds.len > 0)
|
||||
var/list/wound_descriptors = list()
|
||||
for(var/datum/wound/W in temp.wounds)
|
||||
if(W.desc in wound_descriptors)
|
||||
wound_descriptors[W.desc] += W.amount
|
||||
continue
|
||||
wound_descriptors[W.desc] = W.amount
|
||||
var/list/flavor_text = list()
|
||||
var/list/no_exclude = list("gaping wound", "big gaping wound", "massive wound", "large bruise",\
|
||||
"huge bruise", "massive bruise", "severe burn", "large burn", "deep burn", "carbonised area")
|
||||
for(var/wound in wound_descriptors)
|
||||
switch(wound_descriptors[wound])
|
||||
if(1)
|
||||
if(!flavor_text.len)
|
||||
flavor_text += "<span class='warning'>[t_He] has[prob(10) && !(wound in no_exclude) ? " what might be" : ""] a [wound]"
|
||||
else
|
||||
flavor_text += "[prob(10) && !(wound in no_exclude) ? " what might be" : ""] a [wound]"
|
||||
if(2)
|
||||
if(!flavor_text.len)
|
||||
flavor_text += "<span class='warning'>[t_He] has[prob(10) && !(wound in no_exclude) ? " what might be" : ""] a pair of [wound]s"
|
||||
else
|
||||
flavor_text += "[prob(10) && !(wound in no_exclude) ? " what might be" : ""] a pair of [wound]s"
|
||||
if(3 to 5)
|
||||
if(!flavor_text.len)
|
||||
flavor_text += "<span class='warning'>[t_He] has several [wound]s"
|
||||
else
|
||||
flavor_text += " several [wound]s"
|
||||
if(6 to INFINITY)
|
||||
if(!flavor_text.len)
|
||||
flavor_text += "<span class='warning'>[t_He] has a bunch of [wound]s"
|
||||
else
|
||||
flavor_text += " a ton of [wound]\s"
|
||||
var/flavor_text_string = ""
|
||||
for(var/text = 1, text <= flavor_text.len, text++)
|
||||
if(text == flavor_text.len && flavor_text.len > 1)
|
||||
flavor_text_string += ", and"
|
||||
else if(flavor_text.len > 1 && text > 1)
|
||||
flavor_text_string += ","
|
||||
flavor_text_string += flavor_text[text]
|
||||
flavor_text_string += " on [t_his] [temp.display_name].</span><br>"
|
||||
wound_flavor_text["[temp.name]"] = flavor_text_string
|
||||
if(temp.status & ORGAN_BLEEDING)
|
||||
is_bleeding["[temp.name]"] = 1
|
||||
else
|
||||
wound_flavor_text["[temp.display_name]"] = ""
|
||||
|
||||
//Handles the text strings being added to the actual description.
|
||||
//If they have something that covers the limb, and it is not missing, put flavortext. If it is covered but bleeding, add other flavortext.
|
||||
var/display_chest = 0
|
||||
var/display_shoes = 0
|
||||
var/display_gloves = 0
|
||||
if(wound_flavor_text["head"] && (is_destroyed["head"] || (!skipmask && !(wear_mask && istype(wear_mask, /obj/item/clothing/mask/gas)))))
|
||||
msg += wound_flavor_text["head"]
|
||||
else if(is_bleeding["head"])
|
||||
msg += "<span class='warning'>[src] has blood running down [t_his] face!</span>\n"
|
||||
if(wound_flavor_text["chest"] && !w_uniform && !skipjumpsuit) //No need. A missing chest gibs you.
|
||||
msg += wound_flavor_text["chest"]
|
||||
else if(is_bleeding["chest"])
|
||||
display_chest = 1
|
||||
if(wound_flavor_text["left arm"] && (is_destroyed["left arm"] || (!w_uniform && !skipjumpsuit)))
|
||||
msg += wound_flavor_text["left arm"]
|
||||
else if(is_bleeding["left arm"])
|
||||
display_chest = 1
|
||||
if(wound_flavor_text["left hand"] && (is_destroyed["left hand"] || (!gloves && !skipgloves)))
|
||||
msg += wound_flavor_text["left hand"]
|
||||
else if(is_bleeding["left hand"])
|
||||
display_gloves = 1
|
||||
if(wound_flavor_text["right arm"] && (is_destroyed["right arm"] || (!w_uniform && !skipjumpsuit)))
|
||||
msg += wound_flavor_text["right arm"]
|
||||
else if(is_bleeding["right arm"])
|
||||
display_chest = 1
|
||||
if(wound_flavor_text["right hand"] && (is_destroyed["right hand"] || (!gloves && !skipgloves)))
|
||||
msg += wound_flavor_text["right hand"]
|
||||
else if(is_bleeding["right hand"])
|
||||
display_gloves = 1
|
||||
if(wound_flavor_text["groin"] && (is_destroyed["groin"] || (!w_uniform && !skipjumpsuit)))
|
||||
msg += wound_flavor_text["groin"]
|
||||
else if(is_bleeding["groin"])
|
||||
display_chest = 1
|
||||
if(wound_flavor_text["left leg"] && (is_destroyed["left leg"] || (!w_uniform && !skipjumpsuit)))
|
||||
msg += wound_flavor_text["left leg"]
|
||||
else if(is_bleeding["left leg"])
|
||||
display_chest = 1
|
||||
if(wound_flavor_text["left foot"]&& (is_destroyed["left foot"] || (!shoes && !skipshoes)))
|
||||
msg += wound_flavor_text["left foot"]
|
||||
else if(is_bleeding["left foot"])
|
||||
display_shoes = 1
|
||||
if(wound_flavor_text["right leg"] && (is_destroyed["right leg"] || (!w_uniform && !skipjumpsuit)))
|
||||
msg += wound_flavor_text["right leg"]
|
||||
else if(is_bleeding["right leg"])
|
||||
display_chest = 1
|
||||
if(wound_flavor_text["right foot"]&& (is_destroyed["right foot"] || (!shoes && !skipshoes)))
|
||||
msg += wound_flavor_text["right foot"]
|
||||
else if(is_bleeding["right foot"])
|
||||
display_shoes = 1
|
||||
if(display_chest)
|
||||
msg += "<span class='warning'><b>[src] has blood soaking through from under [t_his] clothing!</b></span>\n"
|
||||
if(display_shoes)
|
||||
msg += "<span class='warning'><b>[src] has blood running from [t_his] shoes!</b></span>\n"
|
||||
if(display_gloves)
|
||||
msg += "<span class='warning'><b>[src] has blood running from under [t_his] gloves!</b></span>\n"
|
||||
|
||||
|
||||
if(digitalcamo)
|
||||
msg += "[t_He] [t_is] repulsively uncanny!\n"
|
||||
|
||||
|
||||
@@ -587,6 +587,8 @@
|
||||
mymob.flash.screen_loc = "1,1 to 15,15"
|
||||
mymob.flash.layer = 17
|
||||
|
||||
mymob.pain = new /obj/screen( null )
|
||||
|
||||
/*
|
||||
mymob.hands = new /obj/screen( null )
|
||||
mymob.hands.icon = ui_style
|
||||
|
||||
@@ -21,8 +21,31 @@
|
||||
dna = new /datum/dna(null)
|
||||
|
||||
//initialise organs
|
||||
organs = newlist(/datum/organ/external/chest, /datum/organ/external/head, /datum/organ/external/l_arm, \
|
||||
/datum/organ/external/r_arm, /datum/organ/external/r_leg, /datum/organ/external/l_leg)
|
||||
organs = list()
|
||||
organs_by_name["chest"] = new/datum/organ/external/chest()
|
||||
organs_by_name["head"] = new/datum/organ/external/head()
|
||||
organs_by_name["l_arm"] = new/datum/organ/external/l_arm()
|
||||
organs_by_name["r_arm"] = new/datum/organ/external/r_arm()
|
||||
organs_by_name["r_leg"] = new/datum/organ/external/r_leg()
|
||||
organs_by_name["l_leg"] = new/datum/organ/external/l_leg()
|
||||
organs_by_name["l_hand"] = new/datum/organ/external/l_hand()
|
||||
organs_by_name["r_hand"] = new/datum/organ/external/r_hand()
|
||||
organs_by_name["l_foot"] = new/datum/organ/external/l_foot()
|
||||
organs_by_name["r_foot"] = new/datum/organ/external/r_foot()
|
||||
|
||||
// connect feet to legs and hands to arms
|
||||
var/datum/organ/external/organ = organs_by_name["l_hand"]
|
||||
organ.parent = organs_by_name["l_arm"]
|
||||
organ = organs_by_name["r_hand"]
|
||||
organ.parent = organs_by_name["r_arm"]
|
||||
organ = organs_by_name["l_foot"]
|
||||
organ.parent = organs_by_name["l_leg"]
|
||||
organ = organs_by_name["r_foot"]
|
||||
organ.parent = organs_by_name["r_leg"]
|
||||
|
||||
for(var/name in organs_by_name)
|
||||
organs += organs_by_name[name]
|
||||
|
||||
for(var/datum/organ/external/O in organs)
|
||||
O.owner = src
|
||||
|
||||
@@ -518,8 +541,8 @@
|
||||
|
||||
//Returns "Unknown" if facially disfigured and real_name if not. Useful for setting name when polyacided or when updating a human's name variable
|
||||
/mob/living/carbon/human/proc/get_face_name()
|
||||
var/datum/organ/external/O = get_organ("head")
|
||||
if( (status_flags&DISFIGURED) || (O.brutestate+O.burnstate)>2 || !real_name ) //disfigured. use id-name if possible
|
||||
var/datum/organ/external/head/head = get_organ("head")
|
||||
if( !head || head.disfigured || !real_name ) //disfigured. use id-name if possible
|
||||
return "Unknown"
|
||||
return real_name
|
||||
|
||||
|
||||
@@ -86,11 +86,11 @@
|
||||
//Damages ONE external organ, organ gets randomly selected from damagable ones.
|
||||
//It automatically updates damage overlays if necesary
|
||||
//It automatically updates health status
|
||||
/mob/living/carbon/human/take_organ_damage(var/brute, var/burn)
|
||||
/mob/living/carbon/human/take_organ_damage(var/brute, var/burn, var/sharp = 0)
|
||||
var/list/datum/organ/external/parts = get_damageable_organs()
|
||||
if(!parts.len) return
|
||||
var/datum/organ/external/picked = pick(parts)
|
||||
if(picked.take_damage(brute,burn))
|
||||
if(picked.take_damage(brute,burn,sharp))
|
||||
UpdateDamageIcon()
|
||||
updatehealth()
|
||||
|
||||
@@ -116,7 +116,7 @@
|
||||
if(update) UpdateDamageIcon()
|
||||
|
||||
// damage MANY external organs, in random order
|
||||
/mob/living/carbon/human/take_overall_damage(var/brute, var/burn)
|
||||
/mob/living/carbon/human/take_overall_damage(var/brute, var/burn, var/sharp = 0)
|
||||
if(nodamage) return //godmode
|
||||
var/list/datum/organ/external/parts = get_damageable_organs()
|
||||
var/update = 0
|
||||
@@ -126,7 +126,7 @@
|
||||
var/brute_was = picked.brute_dam
|
||||
var/burn_was = picked.burn_dam
|
||||
|
||||
update |= picked.take_damage(brute,burn)
|
||||
update |= picked.take_damage(brute,burn,sharp)
|
||||
|
||||
brute -= (picked.brute_dam - brute_was)
|
||||
burn -= (picked.burn_dam - burn_was)
|
||||
@@ -150,19 +150,17 @@
|
||||
|
||||
/mob/living/carbon/human/proc/get_organ(var/zone)
|
||||
if(!zone) zone = "chest"
|
||||
for(var/datum/organ/external/O in organs)
|
||||
if(O.name == zone)
|
||||
return O
|
||||
return null
|
||||
return organs_by_name[zone]
|
||||
|
||||
|
||||
/mob/living/carbon/human/apply_damage(var/damage = 0,var/damagetype = BRUTE, var/def_zone = null, var/blocked = 0)
|
||||
/mob/living/carbon/human/apply_damage(var/damage = 0,var/damagetype = BRUTE, var/def_zone = null, var/blocked = 0, var/obj/item/weapon)
|
||||
if((damagetype != BRUTE) && (damagetype != BURN))
|
||||
..(damage, damagetype, def_zone, blocked)
|
||||
return 1
|
||||
|
||||
if(blocked >= 2) return 0
|
||||
|
||||
var/sharp = weapon.sharp
|
||||
|
||||
var/datum/organ/external/organ = null
|
||||
if(isorgan(def_zone))
|
||||
organ = def_zone
|
||||
@@ -178,10 +176,10 @@
|
||||
|
||||
switch(damagetype)
|
||||
if(BRUTE)
|
||||
if(organ.take_damage(damage, 0))
|
||||
if(organ.take_damage(damage, 0, sharp))
|
||||
UpdateDamageIcon()
|
||||
if(BURN)
|
||||
if(organ.take_damage(0, damage))
|
||||
if(organ.take_damage(0, damage, sharp))
|
||||
UpdateDamageIcon()
|
||||
updatehealth()
|
||||
return 1
|
||||
|
||||
@@ -44,6 +44,7 @@
|
||||
var/icon/lying_icon = null
|
||||
|
||||
var/list/organs = list()
|
||||
var/list/organs_by_name = list() // map organ names to organs
|
||||
|
||||
var/miming = null //Toggle for the mime's abilities.
|
||||
|
||||
|
||||
@@ -53,6 +53,8 @@
|
||||
fire_alert = 0 //Reset this here, because both breathe() and handle_environment() have a chance to set it.
|
||||
|
||||
//TODO: seperate this out
|
||||
// update the current life tick, can be used to e.g. only do something every 4 ticks
|
||||
life_tick++
|
||||
var/datum/gas_mixture/environment = loc.return_air()
|
||||
|
||||
//No need to update all of these procs if the guy is dead.
|
||||
@@ -167,6 +169,71 @@
|
||||
if(3)
|
||||
emote("drool")
|
||||
|
||||
proc/handle_organs()
|
||||
// take care of organ related updates, such as broken and missing limbs
|
||||
|
||||
// recalculate number of wounds
|
||||
number_wounds = 0
|
||||
for(var/datum/organ/external/E in organs)
|
||||
if(!E)
|
||||
world << name
|
||||
continue
|
||||
number_wounds += E.number_wounds
|
||||
|
||||
var/leg_tally = 2
|
||||
for(var/datum/organ/external/E in organs)
|
||||
E.process()
|
||||
if(E.status & ORGAN_ROBOT && prob(E.brute_dam + E.burn_dam))
|
||||
if(E.name == "l_hand" || E.name == "l_arm")
|
||||
if(hand && equipped())
|
||||
drop_item()
|
||||
emote("custom v drops what they were holding, their [E.display_name?"[E.display_name]":"[E]"] malfunctioning!")
|
||||
var/datum/effect/effect/system/spark_spread/spark_system = new /datum/effect/effect/system/spark_spread()
|
||||
spark_system.set_up(5, 0, src)
|
||||
spark_system.attach(src)
|
||||
spark_system.start()
|
||||
spawn(10)
|
||||
del(spark_system)
|
||||
else if(E.name == "r_hand" || E.name == "r_arm")
|
||||
if(!hand && equipped())
|
||||
drop_item()
|
||||
emote("custom v drops what they were holding, their [E.display_name?"[E.display_name]":"[E]"] malfunctioning!")
|
||||
var/datum/effect/effect/system/spark_spread/spark_system = new /datum/effect/effect/system/spark_spread()
|
||||
spark_system.set_up(5, 0, src)
|
||||
spark_system.attach(src)
|
||||
spark_system.start()
|
||||
spawn(10)
|
||||
del(spark_system)
|
||||
else if(E.name == "l_leg" || E.name == "l_foot" \
|
||||
|| E.name == "r_leg" || E.name == "r_foot" && !lying)
|
||||
leg_tally-- // let it fail even if just foot&leg
|
||||
if(E.status & ORGAN_BROKEN || E.status & ORGAN_DESTROYED)
|
||||
if(E.name == "l_hand" || E.name == "l_arm")
|
||||
if(hand && equipped())
|
||||
if(E.status & ORGAN_SPLINTED && prob(10))
|
||||
drop_item()
|
||||
emote("scream")
|
||||
else
|
||||
drop_item()
|
||||
emote("scream")
|
||||
else if(E.name == "r_hand" || E.name == "r_arm")
|
||||
if(!hand && equipped())
|
||||
if(E.status & ORGAN_SPLINTED && prob(10))
|
||||
drop_item()
|
||||
emote("scream")
|
||||
else
|
||||
drop_item()
|
||||
emote("scream")
|
||||
else if(E.name == "l_leg" || E.name == "l_foot" \
|
||||
|| E.name == "r_leg" || E.name == "r_foot" && !lying)
|
||||
if(!(E.status & ORGAN_SPLINTED))
|
||||
leg_tally-- // let it fail even if just foot&leg
|
||||
// can't stand
|
||||
if(leg_tally == 0 && !paralysis && !(lying || resting))
|
||||
emote("scream")
|
||||
emote("collapse")
|
||||
paralysis = 10
|
||||
|
||||
|
||||
proc/handle_mutations_and_radiation()
|
||||
if(getFireLoss())
|
||||
@@ -817,6 +884,7 @@
|
||||
silent = 0
|
||||
else //ALIVE. LIGHTS ARE ON
|
||||
updatehealth() //TODO
|
||||
handle_organs()
|
||||
if(health <= config.health_threshold_dead || brain_op_stage == 4.0)
|
||||
death()
|
||||
blinded = 1
|
||||
|
||||
@@ -122,6 +122,7 @@ Please contact me on #coderbus IRC. ~Carn x
|
||||
/mob/living/carbon/human
|
||||
var/list/overlays_lying[TOTAL_LAYERS]
|
||||
var/list/overlays_standing[TOTAL_LAYERS]
|
||||
var/previous_damage_appearance // store what the body last looked like, so we only have to update it if something changed
|
||||
|
||||
|
||||
//UPDATES OVERLAYS FROM OVERLAYS_LYING/OVERLAYS_STANDING
|
||||
@@ -164,39 +165,108 @@ Please contact me on #coderbus IRC. ~Carn x
|
||||
//DAMAGE OVERLAYS
|
||||
//constructs damage icon for each organ from mask * damage field and saves it in our overlays_ lists
|
||||
/mob/living/carbon/human/UpdateDamageIcon(var/update_icons=1)
|
||||
var/image/standing = image("icon" = 'icons/mob/dam_human.dmi', "icon_state" = "blank")
|
||||
var/image/lying = image("icon" = 'icons/mob/dam_human.dmi', "icon_state" = "blank2")
|
||||
for(var/datum/organ/external/O in organs)
|
||||
if(O.brutestate)
|
||||
standing.overlays += "[O.icon_name]_[O.brutestate]0" //we're adding icon_states of the base image as overlays
|
||||
lying.overlays += "[O.icon_name]2_[O.brutestate]0"
|
||||
if(O.burnstate)
|
||||
standing.overlays += "[O.icon_name]_0[O.burnstate]"
|
||||
lying.overlays += "[O.icon_name]2_0[O.burnstate]"
|
||||
// first check whether something actually changed about damage appearance
|
||||
var/damage_appearance = ""
|
||||
|
||||
for(var/datum/organ/external/O in organs)
|
||||
if(O.status & ORGAN_DESTROYED) damage_appearance += "d"
|
||||
else
|
||||
damage_appearance += O.damage_state
|
||||
|
||||
if(damage_appearance == previous_damage_appearance)
|
||||
// nothing to do here
|
||||
return
|
||||
|
||||
previous_damage_appearance = damage_appearance
|
||||
|
||||
var/icon/standing = new /icon('dam_human.dmi', "00")
|
||||
var/icon/lying = new /icon('dam_human.dmi', "00-2")
|
||||
|
||||
// blend the individual damage states with our icons
|
||||
for(var/datum/organ/external/O in organs)
|
||||
if(!(O.status & ORGAN_DESTROYED))
|
||||
O.update_icon()
|
||||
var/icon/DI = new /icon('icons/mob/dam_human.dmi', O.damage_state) // the damage icon for whole human
|
||||
DI.Blend(new /icon('dam_mask.dmi', O.icon_name), ICON_MULTIPLY) // mask with this organ's pixels
|
||||
|
||||
standing.Blend(DI,ICON_OVERLAY)
|
||||
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)
|
||||
|
||||
var/image/standing_image = new /image("icon" = standing)
|
||||
var/image/lying_image = new /image("icon" = lying)
|
||||
|
||||
overlays_standing[DAMAGE_LAYER] = standing_image
|
||||
overlays_lying[DAMAGE_LAYER] = lying_image
|
||||
|
||||
overlays_standing[DAMAGE_LAYER] = standing
|
||||
overlays_lying[DAMAGE_LAYER] = lying
|
||||
if(update_icons) update_icons()
|
||||
|
||||
//BASE MOB SPRITE
|
||||
/mob/living/carbon/human/proc/update_body(var/update_icons=1)
|
||||
|
||||
if(stand_icon) del(stand_icon)
|
||||
if(lying_icon) del(lying_icon)
|
||||
if(dna && dna.mutantrace) return
|
||||
var/husk = (HUSK in src.mutations)
|
||||
var/fat = (FAT in src.mutations)
|
||||
|
||||
var/g = "m"
|
||||
if(gender == FEMALE) g = "f"
|
||||
var/husk = (HUSK in src.mutations)
|
||||
var/obese = (FAT in src.mutations)
|
||||
|
||||
// whether to draw the individual limbs
|
||||
var/individual_limbs = 1
|
||||
|
||||
//Base mob icon
|
||||
if(husk)
|
||||
stand_icon = new /icon('icons/mob/human.dmi', "husk_s")
|
||||
lying_icon = new /icon('icons/mob/human.dmi', "husk_l")
|
||||
else if(fat)
|
||||
if(obese)
|
||||
// Sorry, no dismemberment for fat people.
|
||||
stand_icon = new /icon('icons/mob/human.dmi', "fatbody_s")
|
||||
lying_icon = new /icon('icons/mob/human.dmi', "fatbody_l")
|
||||
individual_limbs = 0
|
||||
else
|
||||
stand_icon = new /icon('icons/mob/human.dmi', "body_[g]_s")
|
||||
lying_icon = new /icon('icons/mob/human.dmi', "body_[g]_l")
|
||||
stand_icon = new /icon('icons/mob/human.dmi', "torso_[g]_s")
|
||||
lying_icon = new /icon('icons/mob/human.dmi', "torso_[g]_l")
|
||||
|
||||
// Draw each individual limb
|
||||
if(individual_limbs)
|
||||
stand_icon.Blend(new /icon('icons/mob/human.dmi', "chest_[g]_s"), ICON_OVERLAY)
|
||||
lying_icon.Blend(new /icon('icons/mob/human.dmi', "chest_[g]_l"), ICON_OVERLAY)
|
||||
|
||||
var/datum/organ/external/head = get_organ("head")
|
||||
if(head && !(head.status & ORGAN_DESTROYED))
|
||||
stand_icon.Blend(new /icon('icons/mob/human.dmi', "head_[g]_s"), ICON_OVERLAY)
|
||||
lying_icon.Blend(new /icon('icons/mob/human.dmi', "head_[g]_l"), ICON_OVERLAY)
|
||||
|
||||
for(var/datum/organ/external/part in organs)
|
||||
if(!istype(part, /datum/organ/external/groin) \
|
||||
&& !istype(part, /datum/organ/external/chest) \
|
||||
&& !istype(part, /datum/organ/external/head) \
|
||||
&& !(part.status & ORGAN_DESTROYED))
|
||||
var/icon/temp = new /icon('human.dmi', "[part.icon_name]_s")
|
||||
if(part.status & ORGAN_ROBOT) temp.MapColors(rgb(77,77,77), rgb(150,150,150), rgb(28,28,28), rgb(0,0,0))
|
||||
stand_icon.Blend(temp, ICON_OVERLAY)
|
||||
temp = new /icon('human.dmi', "[part.icon_name]_l")
|
||||
if(part.status & ORGAN_ROBOT) temp.MapColors(rgb(77,77,77), rgb(150,150,150), rgb(28,28,28), rgb(0,0,0))
|
||||
lying_icon.Blend(temp , ICON_OVERLAY)
|
||||
|
||||
stand_icon.Blend(new /icon('human.dmi', "groin_[g]_s"), ICON_OVERLAY)
|
||||
lying_icon.Blend(new /icon('human.dmi', "groin_[g]_l"), ICON_OVERLAY)
|
||||
|
||||
if (husk)
|
||||
var/icon/husk_s = new /icon('human.dmi', "husk_s")
|
||||
var/icon/husk_l = new /icon('human.dmi', "husk_l")
|
||||
|
||||
for(var/datum/organ/external/part in organs)
|
||||
if(!istype(part, /datum/organ/external/groin) \
|
||||
&& !istype(part, /datum/organ/external/chest) \
|
||||
&& !istype(part, /datum/organ/external/head) \
|
||||
&& (part.status & ORGAN_DESTROYED))
|
||||
husk_s.Blend(new /icon('dam_mask.dmi', "[part.icon_name]"), ICON_SUBTRACT)
|
||||
husk_l.Blend(new /icon('dam_mask.dmi', "[part.icon_name]2"), ICON_SUBTRACT)
|
||||
|
||||
stand_icon.Blend(husk_s, ICON_OVERLAY)
|
||||
lying_icon.Blend(husk_l, ICON_OVERLAY)
|
||||
|
||||
//Skin tone
|
||||
if(s_tone >= 0)
|
||||
@@ -207,6 +277,7 @@ Please contact me on #coderbus IRC. ~Carn x
|
||||
lying_icon.Blend(rgb(-s_tone, -s_tone, -s_tone), ICON_SUBTRACT)
|
||||
|
||||
//Eyes
|
||||
// Note: These used to be in update_face(), and the fact they're here will make it difficult to create a disembodied head
|
||||
var/icon/eyes_s = new/icon('icons/mob/human_face.dmi', "eyes_s")
|
||||
var/icon/eyes_l = new/icon('icons/mob/human_face.dmi', "eyes_l")
|
||||
eyes_s.Blend(rgb(r_eyes, g_eyes, b_eyes), ICON_ADD)
|
||||
@@ -219,11 +290,11 @@ Please contact me on #coderbus IRC. ~Carn x
|
||||
lying_icon.Blend(new/icon('icons/mob/human_face.dmi', "mouth_[g]_l"), ICON_OVERLAY)
|
||||
|
||||
//Underwear
|
||||
if(underwear < 12 && underwear > 0)
|
||||
if(!fat)
|
||||
stand_icon.Blend(new /icon('icons/mob/human.dmi', "underwear[underwear]_[g]_s"), ICON_OVERLAY)
|
||||
lying_icon.Blend(new /icon('icons/mob/human.dmi', "underwear[underwear]_[g]_l"), ICON_OVERLAY)
|
||||
if(update_icons) update_icons()
|
||||
if(underwear < 6 && underwear > 0)
|
||||
if(!obese)
|
||||
stand_icon.Blend(new /icon('human.dmi', "underwear[underwear]_[g]_s"), ICON_OVERLAY)
|
||||
lying_icon.Blend(new /icon('human.dmi', "underwear[underwear]_[g]_l"), ICON_OVERLAY)
|
||||
|
||||
|
||||
|
||||
//HAIR OVERLAY
|
||||
@@ -649,6 +720,42 @@ Please contact me on #coderbus IRC. ~Carn x
|
||||
overlays_standing[L_HAND_LAYER] = null
|
||||
if(update_icons) update_icons()
|
||||
|
||||
// Used mostly for creating head items
|
||||
/mob/living/carbon/human/proc/generate_head_icon()
|
||||
var/g = "m"
|
||||
if (gender == FEMALE) g = "f"
|
||||
|
||||
//base icons
|
||||
var/icon/face_lying = new /icon('icons/mob/human_face.dmi',"bald_l")
|
||||
|
||||
if(f_style)
|
||||
var/datum/sprite_accessory/facial_hair_style = facial_hair_styles_list[f_style]
|
||||
if(facial_hair_style)
|
||||
var/icon/facial_l = new/icon("icon" = facial_hair_style.icon, "icon_state" = "[facial_hair_style.icon_state]_l")
|
||||
facial_l.Blend(rgb(r_facial, g_facial, b_facial), ICON_ADD)
|
||||
face_lying.Blend(facial_l, ICON_OVERLAY)
|
||||
|
||||
if(h_style)
|
||||
var/datum/sprite_accessory/hair_style = hair_styles_list[h_style]
|
||||
if(hair_style)
|
||||
var/icon/hair_l = new/icon("icon" = hair_style.icon, "icon_state" = "[hair_style.icon_state]_l")
|
||||
hair_l.Blend(rgb(r_hair, g_hair, b_hair), ICON_ADD)
|
||||
face_lying.Blend(hair_l, ICON_OVERLAY)
|
||||
|
||||
//Eyes
|
||||
// Note: These used to be in update_face(), and the fact they're here will make it difficult to create a disembodied head
|
||||
var/icon/eyes_s = new/icon('icons/mob/human_face.dmi', "eyes_s")
|
||||
var/icon/eyes_l = new/icon('icons/mob/human_face.dmi', "eyes_l")
|
||||
eyes_s.Blend(rgb(r_eyes, g_eyes, b_eyes), ICON_ADD)
|
||||
eyes_l.Blend(rgb(r_eyes, g_eyes, b_eyes), ICON_ADD)
|
||||
face_lying.Blend(eyes_l, ICON_OVERLAY)
|
||||
|
||||
//Mouth
|
||||
face_lying.Blend(new/icon('icons/mob/human_face.dmi', "mouth_[g]_l"), ICON_OVERLAY)
|
||||
|
||||
var/image/face_lying_image = new /image(icon = face_lying)
|
||||
return face_lying_image
|
||||
|
||||
//Human Overlays Indexes/////////
|
||||
#undef MUTANTRACE_LAYER
|
||||
#undef MUTATIONS_LAYER
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
var/obj/screen/nutrition_icon = null
|
||||
var/obj/screen/pressure = null
|
||||
var/obj/screen/damageoverlay = null
|
||||
var/obj/screen/pain = null
|
||||
|
||||
/*A bunch of this stuff really needs to go under their own defines instead of being globally attached to mob.
|
||||
A variable should only be globally attached to turfs/objects/whatever, when it is in fact needed as such.
|
||||
|
||||
@@ -115,6 +115,9 @@ proc/isorgan(A)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
proc/hasorgans(A)
|
||||
return (ishuman(A) || ismonkey(A))
|
||||
|
||||
/proc/hsl2rgb(h, s, l)
|
||||
return
|
||||
|
||||
|
||||
Reference in New Issue
Block a user