Merge pull request #1738 from CIB/master

Dismemberment
This commit is contained in:
Mloc
2012-10-12 09:42:31 -07:00
33 changed files with 1545 additions and 157 deletions
+13 -3
View File
@@ -16,9 +16,6 @@
if(hand) return r_hand
else return l_hand
/mob/proc/equipped()
return get_active_hand()
//Puts the item into your l_hand if possible and calls all necessary triggers/updates. returns 1 on success.
/mob/proc/put_in_l_hand(var/obj/item/W)
if(lying) return 0
@@ -216,3 +213,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
+151 -9
View File
@@ -212,26 +212,26 @@
else//Brain is gone, doesn't matter if they are AFK or present
msg += "<span class='deadsay'>It appears that [t_his] brain is missing...</span>\n"
var/temp = getBruteLoss() //no need to calculate each of these twice
var/temp_dam = getBruteLoss() //no need to calculate each of these twice
msg += "<span class='warning'>"
if(temp)
if(temp < 30)
if(temp_dam)
if(temp_dam < 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)
temp_dam = getFireLoss()
if(temp_dam)
if(temp_dam < 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)
temp_dam = getCloneLoss()
if(temp_dam)
if(temp_dam < 30)
msg += "[t_He] [t_has] minor genetic deformities.\n"
else
msg += "<B>[t_He] [t_has] severe genetic deformities.</B>\n"
@@ -256,6 +256,148 @@
else if(!client && brain_op_stage != 4 && stat != DEAD)
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.display_name]"] = flavor_text_string
if(temp.status & ORGAN_BLEEDING)
is_bleeding["[temp.display_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"
+112 -1
View File
@@ -320,7 +320,118 @@
mymob.flash.screen_loc = "1,1 to 15,15"
mymob.flash.layer = 17
mymob.zone_sel = new /obj/screen/zone_sel()
mymob.pain = new /obj/screen( null )
/*
mymob.hands = new /obj/screen( null )
mymob.hands.icon = ui_style
mymob.hands.icon_state = "hand"
mymob.hands.name = "hand"
mymob.hands.screen_loc = ui_hand
mymob.hands.dir = NORTH
mymob.sleep = new /obj/screen( null )
mymob.sleep.icon = ui_style
mymob.sleep.icon_state = "sleep0"
mymob.sleep.name = "sleep"
mymob.sleep.screen_loc = ui_sleep
mymob.rest = new /obj/screen( null )
mymob.rest.icon = ui_style
mymob.rest.icon_state = "rest0"
mymob.rest.name = "rest"
mymob.rest.screen_loc = ui_rest
*/
/*/Monkey blockers
using = new src.h_type( src )
using.name = "blocked"
using.icon_state = "blocked"
using.screen_loc = ui_ears
using.layer = 20
src.mon_blo += using
using = new src.h_type( src )
using.name = "blocked"
using.icon_state = "blocked"
using.screen_loc = ui_belt
using.layer = 20
src.mon_blo += using
using = new src.h_type( src )
using.name = "blocked"
using.icon_state = "blocked"
using.screen_loc = ui_shoes
using.layer = 20
src.mon_blo += using
using = new src.h_type( src )
using.name = "blocked"
using.icon_state = "blocked"
using.screen_loc = ui_storage2
using.layer = 20
src.mon_blo += using
using = new src.h_type( src )
using.name = "blocked"
using.icon_state = "blocked"
using.screen_loc = ui_glasses
using.layer = 20
src.mon_blo += using
using = new src.h_type( src )
using.name = "blocked"
using.icon_state = "blocked"
using.screen_loc = ui_gloves
using.layer = 20
src.mon_blo += using
using = new src.h_type( src )
using.name = "blocked"
using.icon_state = "blocked"
using.screen_loc = ui_storage1
using.layer = 20
src.mon_blo += using
using = new src.h_type( src )
using.name = "blocked"
using.icon_state = "blocked"
using.screen_loc = ui_headset
using.layer = 20
src.mon_blo += using
using = new src.h_type( src )
using.name = "blocked"
using.icon_state = "blocked"
using.screen_loc = ui_oclothing
using.layer = 20
src.mon_blo += using
using = new src.h_type( src )
using.name = "blocked"
using.icon_state = "blocked"
using.screen_loc = ui_iclothing
using.layer = 20
src.mon_blo += using
using = new src.h_type( src )
using.name = "blocked"
using.icon_state = "blocked"
using.screen_loc = ui_id
using.layer = 20
src.mon_blo += using
using = new src.h_type( src )
using.name = "blocked"
using.icon_state = "blocked"
using.screen_loc = ui_head
using.layer = 20
src.mon_blo += using
//Monkey blockers
*/
mymob.zone_sel = new /obj/screen/zone_sel( null )
mymob.zone_sel.icon = ui_style
mymob.zone_sel.overlays = null
mymob.zone_sel.overlays += image('icons/mob/zone_sel.dmi', "[mymob.zone_sel.selecting]")
+57 -6
View File
@@ -21,9 +21,43 @@
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,
/datum/organ/internal/skeleton, /datum/organ/internal/skin)
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"]
organ = organs_by_name["r_foot"]
organ.parent = organs_by_name["r_leg"]
organ = organs_by_name["head"]
organ.parent = organs_by_name["chest"]
organ = organs_by_name["r_leg"]
organ.parent = organs_by_name["chest"]
organ = organs_by_name["l_leg"]
organ.parent = organs_by_name["chest"]
organ = organs_by_name["r_arm"]
organ.parent = organs_by_name["chest"]
organ = organs_by_name["l_arm"]
organ.parent = organs_by_name["chest"]
for(var/name in organs_by_name)
organs += organs_by_name[name]
for(var/datum/organ/external/O in organs)
O.owner = src
@@ -196,6 +230,15 @@
Paralyse(10)
var/update = 0
// focus most of the blast on one organ
var/datum/organ/external/take_blast = pick(organs)
update |= take_blast.take_damage(b_loss * 0.9, f_loss * 0.9)
// distribute the remaining 10% on all limbs equally
b_loss *= 0.1
f_loss *= 0.1
for(var/datum/organ/external/temp in organs)
switch(temp.name)
if("head")
@@ -210,6 +253,14 @@
update |= temp.take_damage(b_loss * 0.05, f_loss * 0.05)
if("r_leg")
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()
@@ -519,8 +570,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 || (head.status & ORGAN_DESTROYED) || !real_name ) //disfigured. use id-name if possible
return "Unknown"
return real_name
@@ -679,4 +730,4 @@
xylophone = 1
spawn(1200)
xylophone=0
return
return
@@ -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,13 +150,9 @@
/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/sharp = 0)
if((damagetype != BRUTE) && (damagetype != BURN))
..(damage, damagetype, def_zone, blocked)
return 1
@@ -178,10 +174,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
@@ -112,7 +112,7 @@ emp_act
var/datum/organ/external/affecting = get_organ(ran_zone(user.zone_sel.selecting))
var/hit_area = parse_zone(affecting.name)
var/hit_area = affecting.display_name
if((user != src) && check_shields(I.force, "the [I.name]"))
return 0
@@ -126,7 +126,7 @@ emp_act
if(armor >= 2) return 0
if(!I.force) return 0
apply_damage(I.force, I.damtype, affecting, armor , I)
apply_damage(I.force, I.damtype, affecting, armor , I.sharp)
var/bloody = 0
if(((I.damtype == BRUTE) || (I.damtype == HALLOSS)) && prob(25 + (I.force * 2)))
@@ -49,9 +49,10 @@
var/icon/lying_icon = null
var/list/organs = list() //Gets filled up in the constructor (human.dm, New() proc, line 24. I'm sick and tired of missing comments. -Agouri
var/list/organs_by_name = list() // map organ names to organs
var/miming = null //Toggle for the mime's abilities.
var/failed_last_breath = 0 //This is used to determine if the mob failed a breath. If they did fail a brath, they will attempt to breathe each tick, otherwise just once per 4 ticks.
var/xylophone = 0 //For the spoooooooky xylophone cooldown
var/xylophone = 0 //For the spoooooooky xylophone cooldown
@@ -19,6 +19,13 @@
if(shoes)
tally += shoes.slowdown
for(var/organ_name in list("l_foot","r_foot","l_leg","r_leg"))
var/datum/organ/external/E = get_organ(organ_name)
if(!E || (E.status & ORGAN_DESTROYED))
tally += 4
else if(E.status & ORGAN_BROKEN)
tally += 1.5
if(FAT in src.mutations)
tally += 1.5
if (bodytemperature < 283.222)
@@ -6,6 +6,54 @@
del(W)
return null
/mob/living/carbon/human/proc/has_organ(name)
var/datum/organ/external/O = organs_by_name[name]
return (O && !(O.status & ORGAN_DESTROYED) )
/mob/living/carbon/human/proc/has_organ_for_slot(slot)
switch(slot)
if(slot_back)
return has_organ("chest")
if(slot_wear_mask)
return has_organ("head")
if(slot_handcuffed)
return has_organ("l_hand") && has_organ("r_hand")
if(slot_legcuffed)
return has_organ("l_leg") && has_organ("r_leg")
if(slot_l_hand)
return has_organ("l_hand")
if(slot_r_hand)
return has_organ("r_hand")
if(slot_belt)
return has_organ("chest")
if(slot_wear_id)
// the only relevant check for this is the uniform check
return 1
if(slot_ears)
return has_organ("head")
if(slot_glasses)
return has_organ("head")
if(slot_gloves)
return has_organ("l_hand") && has_organ("r_hand")
if(slot_head)
return has_organ("head")
if(slot_shoes)
return has_organ("r_foot") && has_organ("l_foot")
if(slot_wear_suit)
return has_organ("chest")
if(slot_w_uniform)
return has_organ("chest")
if(slot_l_store)
return has_organ("chest")
if(slot_r_store)
return has_organ("chest")
if(slot_s_store)
return has_organ("chest")
if(slot_in_backpack)
return 1
/mob/living/carbon/human/u_equip(obj/item/W as obj)
if(!W) return 0
@@ -124,6 +172,7 @@
/mob/living/carbon/human/equip_to_slot(obj/item/W as obj, slot, redraw_mob = 1)
if(!slot) return
if(!istype(W)) return
if(!has_organ_for_slot(slot)) return
if(W == src.l_hand)
src.l_hand = null
@@ -607,7 +656,7 @@ It can still be worn/put on as normal.
if(target.r_store)
target.u_equip(target.r_store) //At this stage l_store is already processed by the code above, we only need to process r_store.
else
if(item) //Placing an item on the mob
if(item && target.has_organ_for_slot(slot_to_process)) //Placing an item on the mob
if(item.mob_can_equip(target, slot_to_process, 0))
source.u_equip(item)
target.equip_to_slot_if_possible(item, slot_to_process, 0, 1, 1)
@@ -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
// standing is poor
if(leg_tally <= 0 && !paralysis && !(lying || resting) && prob(5))
emote("scream")
emote("collapse")
paralysis = 10
proc/handle_mutations_and_radiation()
if(getFireLoss())
@@ -820,6 +887,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
@@ -123,6 +123,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
@@ -160,47 +161,132 @@ Please contact me on #coderbus IRC. ~Carn x
for(var/image/I in overlays_standing)
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
//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")
var/image/standing_image = new /image("icon" = standing)
var/image/lying_image = new /image("icon" = lying)
// blend the individual damage states with our icons
for(var/datum/organ/external/O in organs)
if(!(O.status & ORGAN_DESTROYED))
O.update_icon()
if(O.damage_state == "00") continue
var/icon/DI = get_damage_icon_part(O.damage_state, O.icon_name)
standing_image.overlays += DI
DI = get_damage_icon_part("[O.damage_state]-2", "[O.icon_name]2")
lying_image.overlays += DI
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) //100% unnecessary -Agouri
//var/fat = (FAT in src.mutations)
if(dna && dna.mutantrace) return
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 in src.mutations)
stand_icon = new /icon('icons/mob/human.dmi', "husk_s")
lying_icon = new /icon('icons/mob/human.dmi', "husk_l")
else if(FAT in src.mutations)
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
// If dismemberment is on, draw individual limbs
else if(config.limbs_can_break)
stand_icon = new /icon('icons/mob/human.dmi', "torso_[g]_s")
lying_icon = new /icon('icons/mob/human.dmi', "torso_[g]_l")
// Otherwise just draw the full body.
else if(SKELETON in src.mutations)
stand_icon = new /icon('icons/mob/human.dmi', "skeleton_s")
lying_icon = new /icon('icons/mob/human.dmi', "skeleton_l")
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
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((SKELETON in src.mutations) == 0)
@@ -219,6 +305,13 @@ Please contact me on #coderbus IRC. ~Carn x
eyes_l.Blend(rgb(r_eyes, g_eyes, b_eyes), ICON_ADD)
stand_icon.Blend(eyes_s, ICON_OVERLAY)
lying_icon.Blend(eyes_l, ICON_OVERLAY)
// 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)
stand_icon.Blend(eyes_s, ICON_OVERLAY)
lying_icon.Blend(eyes_l, ICON_OVERLAY)
//Mouth (lipstick!)
if(lip_style && (SKELETON in src.mutations) == 0)
@@ -227,20 +320,26 @@ Please contact me on #coderbus IRC. ~Carn x
//Underwear
if(underwear >0 && underwear < 12)
if((FAT in src.mutations) == 0 && (SKELETON in src.mutations) == 0)
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(!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)
if(update_icons) update_icons()
//tail update_tail_showing(0)
//HAIR OVERLAY
/mob/living/carbon/human/proc/update_hair(var/update_icons=1)
//Reset our hair
overlays_lying[HAIR_LAYER] = null
overlays_standing[HAIR_LAYER] = null
//mutantraces (xeno crew) can have hair. masks and helmets can obscure our hair too.
if( (head && (head.flags & BLOCKHAIR)) || (wear_mask && (wear_mask.flags & BLOCKHAIR)) )
var/datum/organ/external/head/head = get_organ("head")
if( !head || (head.status & ORGAN_DESTROYED) )
if(update_icons) update_icons()
return
//mutants don't have hair. masks and helmets can obscure our hair too.
if( (dna && dna.mutantrace) || (head && (head.status & BLOCKHAIR)) || (wear_mask && (wear_mask.flags & BLOCKHAIR)))
if(update_icons) update_icons()
return
@@ -367,6 +466,7 @@ Please contact me on #coderbus IRC. ~Carn x
update_inv_handcuffed(0)
update_inv_legcuffed(0)
update_inv_pockets(0)
UpdateDamageIcon()
update_icons()
//Hud Stuff
update_hud()
@@ -688,6 +788,41 @@ Please contact me on #coderbus IRC. ~Carn x
if(update_icons)
update_icons()
// Used mostly for creating head items
/mob/living/carbon/human/proc/generate_head_icon()
//gender no longer matters for the mouth, although there should probably be seperate base head icons.
// 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_l = new/icon('icons/mob/human_face.dmi', "eyes_l")
eyes_l.Blend(rgb(r_eyes, g_eyes, b_eyes), ICON_ADD)
face_lying.Blend(eyes_l, ICON_OVERLAY)
if(lip_style)
face_lying.Blend(new/icon('icons/mob/human_face.dmi', "lips_[lip_style]_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
-1
View File
@@ -219,4 +219,3 @@
var/tajaran_talk_understand = 0
var/soghun_talk_understand = 0
var/skrell_talk_understand = 0
+4 -1
View File
@@ -120,6 +120,9 @@ proc/isorgan(A)
return 1
return 0
proc/hasorgans(A)
return (ishuman(A) || ismonkey(A))
/proc/hsl2rgb(h, s, l)
return
@@ -379,4 +382,4 @@ var/list/intents = list("help","disarm","grab","hurt")
if(a_intent == "hurt")
hud_used.action_intent.icon_state = "harm"
else
hud_used.action_intent.icon_state = "help"
hud_used.action_intent.icon_state = "help"