update_icons.dm changes for humans. This ties in with the dna changes and the changes to skin_tone and hair colours

>update_mutantrace() is no more, it is now part of update_body()
>Moved a lot of stuff into update_base_icon_state(), this will allow making mutantraces modular.
Almost all icon operations are now removed from human overlays (obviously some are still required for recolouring hair and eyes). Any remaining dynamically generated overlay icons are applied individually. This will allow byond to cache them better. This will also eliminate the bug where humans are initially invisible/unclickable when you first encounter them (due to network latency where the icons are being downloaded).
>UpdateDamageIcons() renamed to update_damage_overlays(), so it has the same sort of name as the other procs
>update_icons=true or false arguments removed from human overaly-update procs, no longer required. (i.e. the update_body() update_inv_whatever etc procs do not call update_icons() - see documentation for details)
>mutantrace icon_states moved into human.dmi
>skeletons are now a mutantrace, not a mutation.
>update_icons system should now be even more efficient (thanks partly to aranclanos)
>documentation rewritten
>copypasted code moved into helper procs - super tidy code :3

Other:
>Removed compile error where the core code was reliant on compiling away mission code. >:[
>s_tone renamed to skin_tone

Modified   code/modules/mob/living/carbon/human/update_icons.dm
Modified   code/__DEFINES.dm
Modified   code/datums/datumvars.dm
Modified   code/datums/limbs.dm
Modified   code/game/dna.dm
Modified   code/game/gamemodes/changeling/changeling_powers.dm
Modified   code/game/gamemodes/cult/cult_items.dm
Modified   code/game/gamemodes/cult/runes.dm
Modified   code/game/machinery/doors/airlock.dm
Modified   code/game/machinery/portable_turret.dm
Modified   code/game/machinery/teleporter.dm
Modified   code/game/mecha/combat/combat.dm
Modified   code/game/objects/items.dm
Modified   code/game/objects/items/stacks/medical.dm
Modified   code/game/objects/items/stacks/sheets/glass.dm
Modified   code/game/objects/items/weapons/storage/bible.dm
Modified   code/modules/assembly/mousetrap.dm
Modified   code/modules/hydroponics/hydroitemcode.dm
Modified   code/modules/mob/living/carbon/carbon.dm
Modified   code/modules/mob/living/carbon/human/death.dm
Modified   code/modules/mob/living/carbon/human/human.dm
Modified   code/modules/mob/living/carbon/human/human_damage.dm
Modified   code/modules/mob/living/carbon/human/human_defines.dm
Modified   code/modules/mob/living/living.dm
Modified   code/modules/mob/living/simple_animal/friendly/slime.dm
Modified   code/modules/mob/mob_grab.dm
Modified   code/modules/power/lighting.dm
Modified   code/modules/reagents/Chemistry-Reagents.dm
Modified   code/unused/_debug.dm
Modified   icons/effects/genetics.dmi
Modified   icons/mob/human.dmi
Modified   maps/RandomZLevels/wildwest.dm
Modified   tgstation.dme

Signed-off-by: carnie <elly1989@rocketmail.com>
This commit is contained in:
carnie
2013-05-10 18:41:08 +01:00
parent cff9ed5f71
commit 5e7cffcf5c
33 changed files with 339 additions and 423 deletions
-3
View File
@@ -200,9 +200,6 @@ var/turf/space/Space_Tile = locate(/turf/space) // A space tile to reference whe
#define SHOCKWAVE 19 // attack a nearby tile and cause a massive shockwave, knocking most people on their asses (25%)
#define ELECTRICITY 20 // ability to shoot electric attacks (15%)
//2spooky
#define SKELETON 29
//disabilities
#define NEARSIGHTED 1
#define EPILEPSY 2
+3 -2
View File
@@ -727,7 +727,7 @@ client
usr << "This can only be done to instances of type /mob/living/carbon/human"
return
var/new_mutantrace = input("Please choose a new mutantrace","Mutantrace",null) as null|anything in list("NONE","golem","lizard","slime","plant","shadow", "fly")
var/new_mutantrace = input("Please choose a new mutantrace","Mutantrace",null) as null|anything in list("NONE","golem","lizard","slime","plant","shadow", "fly", "skeleton")
switch(new_mutantrace)
if(null) return
if("NONE") new_mutantrace = ""
@@ -736,7 +736,8 @@ client
return
if(H.dna)
H.dna.mutantrace = new_mutantrace
H.update_mutantrace()
H.update_body()
H.update_hair()
else if(href_list["regenerateicons"])
if(!check_rights(0)) return
+1 -1
View File
@@ -119,7 +119,7 @@
return brute_dam + burn_dam
//Updates an organ's brute/burn states for use by updateDamageIcon()
//Updates an organ's brute/burn states for use by update_damage_overlays()
//Returns 1 if we need to update overlays. 0 otherwise.
/datum/limb/proc/update_icon()
var/tbrute = round( (brute_dam/max_damage)*3, 1 )
+3 -2
View File
@@ -88,7 +88,8 @@
owner.dna.mutantrace = mutantrace
if(update_mutantrace && istype(owner, /mob/living/carbon/human))
var/mob/living/carbon/human/H = owner
H.update_mutantrace()
H.update_body()
H.update_hair()
if(se)
owner.dna.struc_enzymes = se
@@ -217,7 +218,7 @@
H.f_style = facial_hair_styles_list[deconstruct_block(getblock(structure, DNA_FACIAL_HAIR_STYLE_BLOCK), facial_hair_styles_list.len)]
H.h_style = hair_styles_list[deconstruct_block(getblock(structure, DNA_HAIR_STYLE_BLOCK), hair_styles_list.len)]
H.update_body(0)
H.update_body()
H.update_hair()
return 1
@@ -75,8 +75,8 @@
src << "<span class='warning'>We must be grabbing a creature in our active hand to absorb them.</span>"
return
var/mob/living/carbon/human/T = G.affecting
if(!istype(T))
var/mob/living/carbon/T = G.affecting
if(!check_dna_integrity(T))
src << "<span class='warning'>[T] is not compatible with our biology.</span>"
return
@@ -695,7 +695,7 @@ var/list/datum/dna/hivemind_bank = list()
var/mob/living/carbon/T = changeling_sting(40,/mob/living/carbon/proc/changeling_transformation_sting)
if(!T) return 0
if((HUSK in T.mutations) || (!ishuman(T) && !ismonkey(T)))
if((HUSK in T.mutations) || !check_dna_integrity(T))
src << "<span class='warning'>Our sting appears ineffective against its DNA.</span>"
return 0
T.visible_message("<span class='warning'>[T] transforms!</span>")
+1 -1
View File
@@ -20,7 +20,7 @@
var/organ = ((user.hand ? "l_":"r_") + "arm")
var/datum/limb/affecting = user.get_organ(organ)
if(affecting.take_damage(rand(force/2, force))) //random amount of damage between half of the blade's force and the full force of the blade.
user.UpdateDamageIcon(0)
user.update_damage_overlays(0)
return
/obj/item/weapon/melee/cultblade/pickup(mob/living/user as mob)
+1 -1
View File
@@ -278,7 +278,7 @@ var/list/sacrificed = list()
// corpse_to_raise.update_inv_handcuffed(0)
corpse_to_raise.stat = CONSCIOUS
corpse_to_raise.updatehealth()
corpse_to_raise.UpdateDamageIcon(0)
corpse_to_raise.update_damage_overlays(0)
corpse_to_raise.key = ghost.key //the corpse will keep its old mind! but a new player takes ownership of it (they are essentially possessed)
//This means, should that player leave the body, the original may re-enter
+1 -1
View File
@@ -626,7 +626,7 @@ About the new airlock wires panel:
H.Stun(8)
H.Weaken(5)
if(affecting.take_damage(10, 0))
H.UpdateDamageIcon(0)
H.update_damage_overlays(0)
else
visible_message("\red [user] headbutts the airlock. Good thing they're wearing a helmet.")
return
+5 -5
View File
@@ -95,15 +95,15 @@
iconholder = 1
eprojectile = /obj/item/projectile/beam
if(/obj/item/weapon/gun/energy/laser/practice/sc_laser)
iconholder = 1
eprojectile = /obj/item/projectile/beam
// if(/obj/item/weapon/gun/energy/laser/practice/sc_laser)
// iconholder = 1
// eprojectile = /obj/item/projectile/beam
if(/obj/item/weapon/gun/energy/laser/retro)
iconholder = 1
if(/obj/item/weapon/gun/energy/laser/retro/sc_retro)
iconholder = 1
// if(/obj/item/weapon/gun/energy/laser/retro/sc_retro)
// iconholder = 1
if(/obj/item/weapon/gun/energy/laser/captain)
iconholder = 1
+3 -2
View File
@@ -159,10 +159,11 @@
do_teleport(M, com.locked)
if(ishuman(M))//don't remove people from the round randomly you jerks
var/mob/living/carbon/human/human = M
if(human.dna.mutantrace == null)
if(human.dna && !human.dna.mutantrace)
M << "<span class='danger'>You hear a buzzing in your ears.</span>"
human.dna.mutantrace = "fly"
human.update_mutantrace()
human.update_body()
human.update_hair()
human.apply_effect((rand(90, 150)), IRRADIATE, 0)
randmutb(human)
domutcheck(human, null)
+1 -1
View File
@@ -58,7 +58,7 @@
H.reagents.add_reagent("cryptobiolin", force)
else
return
if(update) H.UpdateDamageIcon(0)
if(update) H.update_damage_overlays(0)
H.updatehealth()
else
+1 -1
View File
@@ -640,7 +640,7 @@
if(istype(M, /mob/living/carbon/human))
var/datum/limb/affecting = M:get_organ("head")
if(affecting.take_damage(7))
M:UpdateDamageIcon(0)
M:update_damage_overlays(0)
else
M.take_organ_damage(7)
M.eye_blurry += rand(3,4)
+1 -1
View File
@@ -60,7 +60,7 @@
affecting = H.get_organ("head")
if (affecting.heal_damage(src.heal_brute, src.heal_burn))
H.UpdateDamageIcon(0)
H.update_damage_overlays(0)
M.updatehealth()
else
M.heal_organ_damage((src.heal_brute/2), (src.heal_burn/2))
@@ -287,6 +287,6 @@
var/datum/limb/affecting = H.get_organ(pick("l_leg", "r_leg"))
H.Weaken(3)
if(affecting.take_damage(5, 0))
H.UpdateDamageIcon(0)
H.update_damage_overlays(0)
H.updatehealth()
..()
@@ -28,7 +28,7 @@
var/heal_amt = 10
for(var/datum/limb/affecting in H.organs)
if(affecting.heal_damage(heal_amt, heal_amt))
H.UpdateDamageIcon(0)
H.update_damage_overlays(0)
return
/obj/item/weapon/storage/bible/attack(mob/living/M as mob, mob/living/user as mob)
+1 -1
View File
@@ -54,7 +54,7 @@
H.Stun(3)
if(affecting)
if(affecting.take_damage(1, 0))
H.UpdateDamageIcon(0)
H.update_damage_overlays(0)
H.updatehealth()
else if(ismouse(target))
var/mob/living/simple_animal/mouse/M = target
+2 -2
View File
@@ -34,7 +34,7 @@
var/organ = ((user.hand ? "l_":"r_") + "arm")
var/datum/limb/affecting = user.get_organ(organ)
if(affecting.take_damage(0,force))
user.UpdateDamageIcon(0)
user.update_damage_overlays(0)
else
user.take_organ_damage(0,force)
@@ -57,7 +57,7 @@
var/organ = ((user.hand ? "l_":"r_") + "arm")
var/datum/limb/affecting = user.get_organ(organ)
if(affecting.take_damage(0,force))
user.UpdateDamageIcon(0)
user.update_damage_overlays(0)
else
user.take_organ_damage(0,force)
if(prob(50))
+2 -2
View File
@@ -23,7 +23,7 @@
if (istype(organ, /datum/limb))
var/datum/limb/temp = organ
if(temp.take_damage(d, 0))
H.UpdateDamageIcon(0)
H.update_damage_overlays(0)
H.updatehealth()
else
src.take_organ_damage(d)
@@ -174,7 +174,7 @@
if(status == "")
status = "OK"
src << "\t [status == "OK" ? "\blue" : "\red"] My [org.getDisplayName()] is [status]."
if(SKELETON in H.mutations && !H.w_uniform && !H.wear_suit)
if(dna && (dna.mutantrace == "skeleton") && !H.w_uniform && !H.wear_suit)
H.play_xylophone()
else
if(ishuman(src))
+15 -25
View File
@@ -70,36 +70,26 @@
return ..(gibbed)
/mob/living/carbon/human/proc/makeSkeleton()
if(SKELETON in src.mutations) return
if(f_style)
f_style = "Shaved"
if(h_style)
h_style = "Bald"
update_hair(0)
mutations.Add(SKELETON)
if(!check_dna_integrity(src) || (dna.mutantrace == "skeleton")) return
dna.mutantrace = "skeleton"
status_flags |= DISFIGURED
update_body(0)
update_mutantrace()
return
update_hair()
update_body()
return 1
/mob/living/carbon/human/proc/ChangeToHusk()
/mob/living/carbon/proc/ChangeToHusk()
if(HUSK in mutations) return
if(f_style)
f_style = "Shaved" //we only change the icon_state of the hair datum, so it doesn't mess up their UI/UE
if(h_style)
h_style = "Bald"
update_hair(0)
mutations.Add(HUSK)
status_flags |= DISFIGURED //makes them unknown without fucking up other stuff like admintools
update_body(0)
update_mutantrace()
return
return 1
/mob/living/carbon/human/proc/Drain()
/mob/living/carbon/human/ChangeToHusk()
. = ..()
if(.)
update_hair()
update_body()
/mob/living/carbon/proc/Drain()
ChangeToHusk()
mutations |= NOCLONE
return
return 1
@@ -204,7 +204,7 @@
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(update) UpdateDamageIcon(0)
if(update) update_damage_overlays(0)
/mob/living/carbon/human/blob_act()
@@ -224,10 +224,10 @@
if(!affecting) return
if (istype(O, /obj/effect/immovablerod))
if(affecting.take_damage(101, 0))
UpdateDamageIcon(0)
update_damage_overlays(0)
else
if(affecting.take_damage((istype(O, /obj/effect/meteor/small) ? 10 : 25), 30))
UpdateDamageIcon(0)
update_damage_overlays(0)
updatehealth()
return
@@ -80,7 +80,7 @@
if(!parts.len) return
var/datum/limb/picked = pick(parts)
if(picked.heal_damage(brute,burn))
UpdateDamageIcon(0)
update_damage_overlays(0)
updatehealth()
//Damages ONE external organ, organ gets randomly selected from damagable ones.
@@ -91,7 +91,7 @@
if(!parts.len) return
var/datum/limb/picked = pick(parts)
if(picked.take_damage(brute,burn))
UpdateDamageIcon(0)
update_damage_overlays(0)
updatehealth()
@@ -113,7 +113,7 @@
parts -= picked
updatehealth()
if(update) UpdateDamageIcon(0)
if(update) update_damage_overlays(0)
// damage MANY external organs, in random order
/mob/living/carbon/human/take_overall_damage(var/brute, var/burn)
@@ -134,7 +134,7 @@
parts -= picked
updatehealth()
if(update) UpdateDamageIcon(0)
if(update) update_damage_overlays(0)
////////////////////////////////////////////
@@ -143,7 +143,7 @@
var/datum/limb/E = get_organ(zone)
if(istype(E, /datum/limb))
if (E.heal_damage(brute, burn))
UpdateDamageIcon(0)
update_damage_overlays(0)
else
return 0
return
@@ -179,11 +179,11 @@
if(BRUTE)
damageoverlaytemp = 20
if(organ.take_damage(damage, 0))
UpdateDamageIcon(0)
update_damage_overlays(0)
if(BURN)
damageoverlaytemp = 20
if(organ.take_damage(0, damage))
UpdateDamageIcon(0)
update_damage_overlays(0)
// Will set our damageoverlay icon to the next level, which will then be set back to the normal level the next mob.Life().
@@ -34,9 +34,7 @@
var/obj/item/l_store = null
var/obj/item/s_store = null
var/icon/stand_icon = null
var/icon/lying_icon = null
var/base_icon_state = "caucasian1_m"
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
@@ -1,56 +1,38 @@
///////////////////////
//UPDATE_ICONS SYSTEM//
///////////////////////
/*
Calling this a system is perhaps a bit trumped up. It is essentially update_clothing dismantled into its
core parts. The key difference is that when we generate overlays we do not generate either lying or standing
versions. Instead, we generate both and store them in two fixed-length lists, both using the same list-index
(The indexes are in update_icons.dm): Each list for humans is (at the time of writing) of length 19.
This will hopefully be reduced as the system is refined.
/* Keep these comments up-to-date if you -insist- on hurting my code-baby ;_;
This system allows you to update individual mob-overlays, without regenerating them all each time.
When we generate overlays we do not generate either lying or standing, as used to happen.
Instead, we generate both standing and lying stances and store them in two fixed-length lists,
both using the same list-index. (The index values are defines within this file.
var/overlays_lying[19] //For the lying down stance
var/overlays_standing[19] //For the standing stance
As of the time of writing there are 20 layers within this list. Please try to keep this from increasing.
var/overlays_lying[20] //For the lying down stance
var/overlays_standing[20] //For the standing stance
When we call update_icons, the 'lying' variable is checked and then the appropriate list is assigned to our overlays!
That in itself uses a tiny bit more memory (no more than all the ridiculous lists the game has already mind you).
Most of the time we only wish to update one overlay:
e.g. - we dropped the fireaxe out of our left hand and need to remove its icon from our mob
e.g.2 - our hair colour has changed, so we need to update our hair icons on our mob
In these cases, instead of updating every overlay using the old behaviour (regenerate_icons), we instead call
the appropriate update_X proc.
e.g. - update_l_hand()
e.g.2 - update_hair()
On the other-hand, it should be very CPU cheap in comparison to the old system.
In the old system, we updated all our overlays every life() call, even if we were standing still inside a crate!
or dead!. 25ish overlays, all generated from scratch every second for every xeno/human/monkey and then applied.
More often than not update_clothing was being called a few times in addition to that! CPU was not the only issue,
all those icons had to be sent to every client. So really the cost was extremely cumulative. To the point where
update_clothing would frequently appear in the top 10 most CPU intensive procs during profiling.
Another feature of this new system is that our lists are indexed. This means we can update specific overlays!
So we only regenerate icons when we need them to be updated! This is the main saving for this system.
In practice this means that:
everytime you fall over, we just switch between precompiled lists. Which is fast and cheap.
Everytime you do something minor like take a pen out of your pocket, we only update the in-hand overlay
etc...
Note: Recent changes by aranclanos+carn:
update_icons() no longer needs to be called.
This unfortunately means that cloaking is not working properly at time of writing,
however the system is easier to use. update_icons() should not be called unless you absolutely -know- you need it.
One such example would be when var/lying changes state (because every overlay needs to be updated, but not regenerated). In these
very specific cases, update_icons() will be faster than calling each update_X proc individually.
IN ALL OTHER CASES it's better to just call the specific update_X procs.
All of this means that this code is more maintainable, faster and still fairly easy to use.
There are several things that need to be remembered:
> Whenever we do something that should cause an overlay to update (which doesn't use standard procs
( i.e. you do something like l_hand = /obj/item/something new(src) )
You will need to call the relevant update_inv_* proc:
update_inv_head()
update_inv_wear_suit()
update_inv_gloves()
update_inv_shoes()
update_inv_w_uniform()
update_inv_glasses()
update_inv_l_hand()
update_inv_r_hand()
update_inv_belt()
update_inv_wear_id()
update_inv_ears()
update_inv_s_store()
update_inv_pockets()
update_inv_back()
update_inv_handcuffed()
update_inv_wear_mask()
( i.e. you do something like l_hand = /obj/item/something new(src), rather than using the helper procs)
You will need to call the relevant update_inv_* proc
All of these are named after the variable they update from. They are defined at the mob/ level like
update_clothing was, so you won't cause undefined proc runtimes with usr.update_inv_wear_id() if the usr is a
@@ -58,47 +40,30 @@ There are several things that need to be remembered:
> There are also these special cases:
update_mutations() //handles updating your appearance for certain mutations. e.g TK head-glows
update_mutantrace() //handles updating your appearance after setting the mutantrace var
UpdateDamageIcon() //handles damage overlays for brute/burn damage //(will rename this when I geta round to it)
update_body() //Handles updating your mob's icon to reflect their gender/race/complexion etc
update_hair() //Handles updating your hair overlay (used to be update_face, but mouth and
...eyes were merged into update_body)
update_mutations() //handles updating your appearance for certain mutations. e.g TK head-glows
update_damage_overlays() //handles damage overlays for brute/burn damage
update_base_icon_state() //Handles updating var/base_icon_state (WIP) This is used to update the
mob's icon_state easily e.g. "[base_icon_state]_s" is the standing icon_state
update_body() //Handles updating your mob's icon_state (using update_base_icon_state())
as well as sprite-accessories that didn't really fit elsewhere (underwear, lips, eyes)
//NOTE: update_mutantrace() is now merged into this!
update_hair() //Handles updating your hair overlay (used to be update_face, but mouth and
eyes were merged into update_body())
> All of these procs update our overlays_lying and overlays_standing, and then call update_icons() by default.
If you wish to update several overlays at once, you can set the argument to 0 to disable the update and call
it manually:
e.g.
update_inv_head(0)
update_inv_l_hand(0)
update_inv_r_hand() //<---calls update_icons()
or equivillantly:
update_inv_head(0)
update_inv_l_hand(0)
update_inv_r_hand(0)
update_icons()
> If you need to update all overlays you can use regenerate_icons(). it works exactly like update_clothing used to.
> I reimplimented an old unused variable which was in the code called (coincidentally) var/update_icon
> I repurposed an old unused variable which was in the code called (coincidentally) var/update_icon
It can be used as another method of triggering regenerate_icons(). It's basically a flag that when set to non-zero
will call regenerate_icons() at the next life() call and then reset itself to 0.
The idea behind it is icons are regenerated only once, even if multiple events requested it.
//NOTE: fairly unused, maybe this could be removed?
This system is confusing and is still a WIP. It's primary goal is speeding up the controls of the game whilst
reducing processing costs. So please bear with me while I iron out the kinks. It will be worth it, I promise.
If I can eventually free var/lying stuff from the life() process altogether, stuns/death/status stuff
will become less affected by lag-spikes and will be instantaneous! :3
If you have any questions/constructive-comments/bugs-to-report/or have a massivly devestated butt...
Please contact me on #coderbus IRC. ~Carn x
If you have any questions/constructive-comments/bugs-to-report
Please contact me on #coderbus IRC. ~Carnie x
*/
//Human Overlays Indexes/////////
#define MUTANTRACE_LAYER 20 //TODO: make part of body?
#define MUTATIONS_LAYER 19
#define DAMAGE_LAYER 18
#define BODY_LAYER 20 //underwear, eyes, lips(makeup)
#define MUTATIONS_LAYER 19 //Tk headglows etc.
#define DAMAGE_LAYER 18 //damage indicators (cuts and burns)
#define UNIFORM_LAYER 17
#define ID_LAYER 16
#define SHOES_LAYER 15
@@ -115,14 +80,28 @@ Please contact me on #coderbus IRC. ~Carn x
#define HANDCUFF_LAYER 4
#define LEGCUFF_LAYER 3
#define L_HAND_LAYER 2
#define R_HAND_LAYER 1
#define TOTAL_LAYERS 20
#define R_HAND_LAYER 1 //Having the two hands seperate seems rather silly, merge them together? It'll allow for code to be reused on mobs with arbitarily many hands
#define TOTAL_LAYERS 20 //KEEP THIS UP-TO-DATE OR SHIT WILL BREAK ;_;
//////////////////////////////////
/mob/living/carbon/human
var/list/overlays_lying[TOTAL_LAYERS]
var/list/overlays_standing[TOTAL_LAYERS]
/mob/living/carbon/human/proc/update_base_icon_state()
var/race = dna ? dna.mutantrace : null
switch(race)
if("lizard","golem","slime","shadow","adamantine","fly","plant")
base_icon_state = "[dna.mutantrace]_[(gender == FEMALE) ? "f" : "m"]"
if("skeleton")
base_icon_state = "skeleton"
else
if(HUSK in mutations)
base_icon_state = "husk"
else
base_icon_state = "[skin_tone]_[(gender == FEMALE) ? "f" : "m"]"
/mob/living/carbon/human/proc/apply_overlay(cache_index)
var/image/I = lying ? overlays_lying[cache_index] : overlays_standing[cache_index]
if(I)
@@ -143,11 +122,11 @@ Please contact me on #coderbus IRC. ~Carn x
lying_prev = lying //so we don't update overlays for lying/standing unless our stance changes again
update_hud() //TODO: remove the need for this
overlays.Cut()
if(lying) //can't be cloaked when lying. (for now)
icon = lying_icon
for(var/image/I in overlays_lying)
overlays += I
if(lying) //can't be cloaked whilst lying down
icon_state = "[base_icon_state]_l"
for(var/thing in overlays_lying)
if(thing) overlays += thing
else
var/stealth = 0
if(istype(wear_suit, /obj/item/clothing/suit/space/space_ninja) && wear_suit:s_active)
@@ -159,26 +138,25 @@ Please contact me on #coderbus IRC. ~Carn x
stealth = 1
break
if(stealth)
icon = 'icons/mob/human.dmi'
icon_state = "body_cloaked"
var/image/I = overlays_standing[L_HAND_LAYER]
if(istype(I)) overlays += I
I = overlays_standing[R_HAND_LAYER]
if(istype(I)) overlays += I
if(overlays_standing[L_HAND_LAYER])
overlays += overlays_standing[L_HAND_LAYER]
if(overlays_standing[R_HAND_LAYER])
overlays += overlays_standing[R_HAND_LAYER]
else
icon = stand_icon
for(var/image/I in overlays_standing)
overlays += I
icon_state = "[base_icon_state]_s"
for(var/thing in overlays_standing)
if(thing) overlays += thing
//DAMAGE OVERLAYS
//constructs damage icon for each organ from mask * damage field and saves it in our overlays_ lists
/mob/living/carbon/human/UpdateDamageIcon(update_icons=0)
/mob/living/carbon/human/update_damage_overlays()
remove_overlay(DAMAGE_LAYER)
var/image/standing = image("icon" = 'icons/mob/dam_human.dmi', "icon_state" = "blank", "layer" = -DAMAGE_LAYER)
var/image/lying = image("icon" = 'icons/mob/dam_human.dmi', "icon_state" = "blank2", "layer" = -DAMAGE_LAYER)
var/image/standing = image("icon"='icons/mob/dam_human.dmi', "icon_state"="blank", "layer"=-DAMAGE_LAYER)
var/image/lying = image("icon"='icons/mob/dam_human.dmi', "icon_state"="blank2", "layer"=-DAMAGE_LAYER)
overlays_standing[DAMAGE_LAYER] = standing
overlays_lying[DAMAGE_LAYER] = lying
@@ -191,186 +169,151 @@ Please contact me on #coderbus IRC. ~Carn x
lying.overlays += "[O.icon_name]2_0[O.burnstate]"
apply_overlay(DAMAGE_LAYER)
if(update_icons) update_icons()
//BASE MOB SPRITE
/mob/living/carbon/human/proc/update_body(update_icons=0)
stand_icon = null
lying_icon = null
if(dna && dna.mutantrace) return
var/skeleton = (SKELETON in src.mutations)
//HAIR OVERLAY
/mob/living/carbon/human/proc/update_hair()
//Reset our hair
remove_overlay(HAIR_LAYER)
//mutants don't have hair. masks and helmets can obscure our hair too.
if( (HUSK in mutations) || (dna && dna.mutantrace) || (head && (head.flags & BLOCKHAIR)) || (wear_mask && (wear_mask.flags & BLOCKHAIR)) )
return
//base icons
var/list/standing = list()
var/list/lying = list()
var/base_icon_state
//Base mob icon
if(skeleton)
base_icon_state = "skeleton"
else
if(HUSK in src.mutations)
base_icon_state = "husk"
else
base_icon_state = "[skin_tone]_[(gender == FEMALE) ? "f" : "m"]"
stand_icon = icon('icons/mob/human.dmi', "[base_icon_state]_s")
lying_icon = icon('icons/mob/human.dmi', "[base_icon_state]_l")
if(f_style)
var/datum/sprite_accessory/facial_hair_style = facial_hair_styles_list[f_style]
if(facial_hair_style)
var/icon/facial_s = icon("icon"=facial_hair_style.icon, "icon_state"="[facial_hair_style.icon_state]_s")
var/icon/facial_l = icon("icon"=facial_hair_style.icon, "icon_state"="[facial_hair_style.icon_state]_l")
facial_s.Blend("#[f_color]", ICON_ADD)
facial_l.Blend("#[f_color]", ICON_ADD)
standing += image("icon"=facial_s, "layer"=-HAIR_LAYER)
lying += image("icon"=facial_l, "layer"=-HAIR_LAYER)
//Applies the debrained overlay if there is no brain
if(!getbrain(src))
standing += image("icon"='icons/mob/human_face.dmi', "icon_state"="debrained_s", "layer"=-HAIR_LAYER)
lying += image("icon"='icons/mob/human_face.dmi', "icon_state"="debrained_l", "layer"=-HAIR_LAYER)
else if(h_style)
var/datum/sprite_accessory/hair_style = hair_styles_list[h_style]
if(hair_style)
var/icon/hair_s = icon("icon"=hair_style.icon, "icon_state"="[hair_style.icon_state]_s")
var/icon/hair_l = icon("icon"=hair_style.icon, "icon_state"="[hair_style.icon_state]_l")
hair_s.Blend("#[h_color]", ICON_ADD)
hair_l.Blend("#[h_color]", ICON_ADD)
standing += image("icon"=hair_s, "layer"=-HAIR_LAYER)
lying += image("icon"=hair_l, "layer"=-HAIR_LAYER)
if(lying.len)
overlays_lying[HAIR_LAYER] = lying
if(standing.len)
overlays_standing[HAIR_LAYER] = standing
apply_overlay(HAIR_LAYER)
/mob/living/carbon/human/update_mutations()
remove_overlay(MUTATIONS_LAYER)
var/list/standing = list()
var/list/lying = list()
var/g = (gender == FEMALE) ? "f" : "m"
for(var/mut in mutations)
switch(mut)
if(HULK)
lying += image("icon"='icons/effects/genetics.dmi', "icon_state"="hulk_[g]_l", "layer"=-MUTATIONS_LAYER)
standing += image("icon"='icons/effects/genetics.dmi', "icon_state"="hulk_[g]_s", "layer"=-MUTATIONS_LAYER)
if(COLD_RESISTANCE)
lying += image("icon"='icons/effects/genetics.dmi', "icon_state"="fire_l", "layer"=-MUTATIONS_LAYER)
standing += image("icon"='icons/effects/genetics.dmi', "icon_state"="fire_s", "layer"=-MUTATIONS_LAYER)
if(TK)
lying += image("icon"='icons/effects/genetics.dmi', "icon_state"="telekinesishead_l", "layer"=-MUTATIONS_LAYER)
standing += image("icon"='icons/effects/genetics.dmi', "icon_state"="telekinesishead_s", "layer"=-MUTATIONS_LAYER)
if(LASER)
lying += image("icon"='icons/effects/genetics.dmi', "icon_state"="lasereyes_l", "layer"=-MUTATIONS_LAYER)
standing += image("icon"='icons/effects/genetics.dmi', "icon_state"="lasereyes_s", "layer"=-MUTATIONS_LAYER)
if(lying.len)
overlays_lying[MUTATIONS_LAYER] = lying
if(standing.len)
overlays_standing[MUTATIONS_LAYER] = standing
apply_overlay(MUTATIONS_LAYER)
/mob/living/carbon/human/proc/update_body()
remove_overlay(BODY_LAYER)
update_base_icon_state()
icon_state = "[base_icon_state]_[src.lying ? "l" : "s"]"
var/list/lying = list()
var/list/standing = list()
//Mouth (lipstick!)
if(lip_style) //skeletons are allowed to wear lipstick no matter what you think, agouri.
stand_icon.Blend(icon('icons/mob/human_face.dmi', "lips_[lip_style]_s"), ICON_OVERLAY)
lying_icon.Blend(icon('icons/mob/human_face.dmi', "lips_[lip_style]_l"), ICON_OVERLAY)
if(lip_style)
standing += image("icon"='icons/mob/human_face.dmi', "icon_state"="lips_[lip_style]_s", "layer"=-BODY_LAYER)
lying += image("icon"='icons/mob/human_face.dmi', "icon_state"="lips_[lip_style]_l", "layer"=-BODY_LAYER)
//Eyes
if(!skeleton)
if(!dna || dna.mutantrace != "skeleton")
var/icon/eyes_s = icon('icons/mob/human_face.dmi', "eyes_s")
var/icon/eyes_l = icon('icons/mob/human_face.dmi', "eyes_l")
eyes_s.Blend("#[eye_color]", ICON_ADD)
eyes_l.Blend("#[eye_color]", ICON_ADD)
stand_icon.Blend(eyes_s, ICON_OVERLAY)
lying_icon.Blend(eyes_l, ICON_OVERLAY)
standing += image("icon"=eyes_s, "layer"=-BODY_LAYER)
lying += image("icon"=eyes_l, "layer"=-BODY_LAYER)
//Underwear
if(underwear)
var/datum/sprite_accessory/underwear/U = underwear_all[underwear]
if(U)
stand_icon.Blend(icon(U.icon, "[U.icon_state]_s"), ICON_OVERLAY)
lying_icon.Blend(icon(U.icon, "[U.icon_state]_l"), ICON_OVERLAY)
if(update_icons) update_icons()
//HAIR OVERLAY
/mob/living/carbon/human/proc/update_hair(update_icons=0)
//Reset our hair
remove_overlay(HAIR_LAYER)
//mutants don't have hair. masks and helmets can obscure our hair too.
if( (dna && dna.mutantrace) || (head && (head.flags & BLOCKHAIR)) || (wear_mask && (wear_mask.flags & BLOCKHAIR)) )
if(update_icons) update_icons()
return
//base icons
var/icon/face_standing = new /icon('icons/mob/human_face.dmi',"bald_s")
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_s = new/icon("icon" = facial_hair_style.icon, "icon_state" = "[facial_hair_style.icon_state]_s")
var/icon/facial_l = new/icon("icon" = facial_hair_style.icon, "icon_state" = "[facial_hair_style.icon_state]_l")
facial_s.Blend("#[f_color]", ICON_ADD)
facial_l.Blend("#[f_color]", ICON_ADD)
face_standing.Blend(facial_s, ICON_OVERLAY)
face_lying.Blend(facial_l, ICON_OVERLAY)
//Applies the debrained overlay if there is no brain
if(!getbrain(src))
face_standing.Blend(new /icon('icons/mob/human_face.dmi', "debrained_s"), ICON_OVERLAY)
face_lying.Blend(new /icon('icons/mob/human_face.dmi', "debrained_l"), ICON_OVERLAY)
h_style = "Bald"
else if(h_style)
var/datum/sprite_accessory/hair_style = hair_styles_list[h_style]
if(hair_style)
var/icon/hair_s = new/icon("icon" = hair_style.icon, "icon_state" = "[hair_style.icon_state]_s")
var/icon/hair_l = new/icon("icon" = hair_style.icon, "icon_state" = "[hair_style.icon_state]_l")
hair_s.Blend("#[h_color]", ICON_ADD)
hair_l.Blend("#[h_color]", ICON_ADD)
face_standing.Blend(hair_s, ICON_OVERLAY)
face_lying.Blend(hair_l, ICON_OVERLAY)
overlays_lying[HAIR_LAYER] = image(face_lying, "layer" = -HAIR_LAYER)
overlays_standing[HAIR_LAYER] = image(face_standing, "layer" = -HAIR_LAYER)
apply_overlay(HAIR_LAYER)
if(update_icons) update_icons()
/mob/living/carbon/human/update_mutations(update_icons=0)
remove_overlay(MUTATIONS_LAYER)
var/image/lying = image("icon" = 'icons/effects/genetics.dmi', "layer" = -MUTATIONS_LAYER)
var/image/standing = image("icon" = 'icons/effects/genetics.dmi', "layer" = -MUTATIONS_LAYER)
var/add_image = 0
var/g = "m"
if(gender == FEMALE) g = "f"
for(var/mut in mutations)
switch(mut)
if(HULK)
lying.underlays += "hulk_[g]_l"
standing.underlays += "hulk_[g]_s"
add_image = 1
if(COLD_RESISTANCE)
lying.underlays += "fire_l"
standing.underlays += "fire_s"
add_image = 1
if(TK)
lying.underlays += "telekinesishead_l"
standing.underlays += "telekinesishead_s"
add_image = 1
if(LASER)
lying.overlays += "lasereyes_l"
standing.overlays += "lasereyes_s"
add_image = 1
if(add_image)
overlays_lying[MUTATIONS_LAYER] = lying
overlays_standing[MUTATIONS_LAYER] = standing
standing += image("icon"=U.icon, "icon_state"="[U.icon_state]_s", "layer"=-BODY_LAYER)
lying += image("icon"=U.icon, "icon_state"="[U.icon_state]_l", "layer"=-BODY_LAYER)
apply_overlay(MUTATIONS_LAYER)
if(update_icons) update_icons()
/mob/living/carbon/human/proc/update_mutantrace(update_icons=0)
remove_overlay(MUTANTRACE_LAYER)
if(dna)
switch(dna.mutantrace)
if("lizard","golem","slime","shadow","adamantine", "fly")
overlays_lying[MUTANTRACE_LAYER] = image("icon" = 'icons/effects/genetics.dmi', "icon_state" = "[dna.mutantrace]_[gender]_l", "layer" = -MUTANTRACE_LAYER)
overlays_standing[MUTANTRACE_LAYER] = image("icon" = 'icons/effects/genetics.dmi', "icon_state" = "[dna.mutantrace]_[gender]_s", "layer" = -MUTANTRACE_LAYER)
if("plant")
if(stat == DEAD) //TODO
overlays_lying[MUTANTRACE_LAYER] = image("icon" = 'icons/effects/genetics.dmi', "icon_state" = "[dna.mutantrace]_d", "layer" = -MUTANTRACE_LAYER)
else
overlays_lying[MUTANTRACE_LAYER] = image("icon" = 'icons/effects/genetics.dmi', "icon_state" = "[dna.mutantrace]_[gender]_l", "layer" = -MUTANTRACE_LAYER)
overlays_standing[MUTANTRACE_LAYER] = image("icon" = 'icons/effects/genetics.dmi', "icon_state" = "[dna.mutantrace]_[gender]_s", "layer" = -MUTANTRACE_LAYER)
update_body(0)
update_hair(0)
if(lying.len)
overlays_lying[BODY_LAYER] = lying
if(standing.len)
overlays_standing[BODY_LAYER] = standing
apply_overlay(MUTANTRACE_LAYER)
if(update_icons) update_icons()
apply_overlay(BODY_LAYER)
/* --------------------------------------- */
//For legacy support.
/mob/living/carbon/human/regenerate_icons()
..()
if(monkeyizing) return
update_mutations(0)
update_mutantrace(0)
update_inv_w_uniform(0)
update_inv_wear_id(0)
update_inv_gloves(0)
update_inv_glasses(0)
update_inv_ears(0)
update_inv_shoes(0)
update_inv_s_store(0)
update_inv_wear_mask(0)
update_inv_head(0)
update_inv_belt(0)
update_inv_back(0)
update_inv_wear_suit(0)
update_inv_r_hand(0)
update_inv_l_hand(0)
update_inv_handcuffed(0)
update_inv_legcuffed(0)
update_inv_pockets(0)
update_icons()
update_body()
update_hair()
update_mutations()
update_inv_w_uniform()
update_inv_wear_id()
update_inv_gloves()
update_inv_glasses()
update_inv_ears()
update_inv_shoes()
update_inv_s_store()
update_inv_wear_mask()
update_inv_head()
update_inv_belt()
update_inv_back()
update_inv_wear_suit()
update_inv_r_hand()
update_inv_l_hand()
update_inv_handcuffed()
update_inv_legcuffed()
update_inv_pockets()
//Hud Stuff
update_hud()
/* --------------------------------------- */
//vvvvvv UPDATE_INV PROCS vvvvvv
/mob/living/carbon/human/update_inv_w_uniform(update_icons=0)
/mob/living/carbon/human/update_inv_w_uniform()
remove_overlay(UNIFORM_LAYER)
if(istype(w_uniform, /obj/item/clothing/under))
@@ -381,42 +324,42 @@ Please contact me on #coderbus IRC. ~Carn x
var/t_color = w_uniform.color
if(!t_color) t_color = icon_state
var/image/lying = image("icon" = 'icons/mob/uniform.dmi', "icon_state" = "[t_color]_l", "layer" = -UNIFORM_LAYER)
var/image/standing = image("icon" = 'icons/mob/uniform.dmi', "icon_state" = "[t_color]_s", "layer" = -UNIFORM_LAYER)
var/image/lying = image("icon"='icons/mob/uniform.dmi', "icon_state"="[t_color]_l", "layer"=-UNIFORM_LAYER)
var/image/standing = image("icon"='icons/mob/uniform.dmi', "icon_state"="[t_color]_s", "layer"=-UNIFORM_LAYER)
overlays_lying[UNIFORM_LAYER] = lying
overlays_standing[UNIFORM_LAYER] = standing
if(w_uniform.blood_DNA)
lying.overlays += image("icon" = 'icons/effects/blood.dmi', "icon_state" = "uniformblood2")
standing.overlays += image("icon" = 'icons/effects/blood.dmi', "icon_state" = "uniformblood")
lying.overlays += image("icon"='icons/effects/blood.dmi', "icon_state"="uniformblood2")
standing.overlays += image("icon"='icons/effects/blood.dmi', "icon_state"="uniformblood")
if(U.hastie)
var/tie_color = U.hastie.color
if(!tie_color) tie_color = U.hastie.icon_state
lying.overlays += image("icon" = 'icons/mob/ties.dmi', "icon_state" = "[tie_color]2")
standing.overlays += image("icon" = 'icons/mob/ties.dmi', "icon_state" = "[tie_color]")
lying.overlays += image("icon"='icons/mob/ties.dmi', "icon_state"="[tie_color]2")
standing.overlays += image("icon"='icons/mob/ties.dmi', "icon_state"="[tie_color]")
else
// Automatically drop anything in store / id / belt if you're not wearing a uniform. //CHECK IF NECESARRY
for(var/obj/item/thing in list(r_store, l_store, wear_id, belt)) //
drop_from_inventory(thing)
apply_overlay(UNIFORM_LAYER)
if(update_icons) update_icons()
/mob/living/carbon/human/update_inv_wear_id(update_icons=0)
/mob/living/carbon/human/update_inv_wear_id()
remove_overlay(ID_LAYER)
if(wear_id)
if(client && hud_used && hud_used.hud_shown)
wear_id.screen_loc = ui_id //TODO
client.screen += wear_id
overlays_lying[ID_LAYER] = image("icon" = 'icons/mob/mob.dmi', "icon_state" = "id2", "layer" = -ID_LAYER)
overlays_standing[ID_LAYER] = image("icon" = 'icons/mob/mob.dmi', "icon_state" = "id", "layer" = -ID_LAYER)
overlays_lying[ID_LAYER] = image("icon"='icons/mob/mob.dmi', "icon_state"="id2", "layer"=-ID_LAYER)
overlays_standing[ID_LAYER] = image("icon"='icons/mob/mob.dmi', "icon_state"="id", "layer"=-ID_LAYER)
apply_overlay(ID_LAYER)
if(update_icons) update_icons()
/mob/living/carbon/human/update_inv_gloves(update_icons=0)
/mob/living/carbon/human/update_inv_gloves()
remove_overlay(GLOVES_LAYER)
if(gloves)
if(client && hud_used && hud_used.hud_shown && hud_used.inventory_shown)
@@ -425,24 +368,24 @@ Please contact me on #coderbus IRC. ~Carn x
var/t_state = gloves.item_state
if(!t_state) t_state = gloves.icon_state
var/image/lying = image("icon" = 'icons/mob/hands.dmi', "icon_state" = "[t_state]2", "layer" = -GLOVES_LAYER)
var/image/standing = image("icon" = 'icons/mob/hands.dmi', "icon_state" = "[t_state]", "layer" = -GLOVES_LAYER)
var/image/lying = image("icon"='icons/mob/hands.dmi', "icon_state"="[t_state]2", "layer"=-GLOVES_LAYER)
var/image/standing = image("icon"='icons/mob/hands.dmi', "icon_state"="[t_state]", "layer"=-GLOVES_LAYER)
overlays_lying[GLOVES_LAYER] = lying
overlays_standing[GLOVES_LAYER] = standing
if(gloves.blood_DNA)
lying.overlays += image("icon" = 'icons/effects/blood.dmi', "icon_state" = "bloodyhands2")
standing.overlays += image("icon" = 'icons/effects/blood.dmi', "icon_state" = "bloodyhands")
lying.overlays += image("icon"='icons/effects/blood.dmi', "icon_state"="bloodyhands2")
standing.overlays += image("icon"='icons/effects/blood.dmi', "icon_state"="bloodyhands")
else
if(blood_DNA)
overlays_lying[GLOVES_LAYER] = image("icon" = 'icons/effects/blood.dmi', "icon_state" = "bloodyhands2")
overlays_standing[GLOVES_LAYER] = image("icon" = 'icons/effects/blood.dmi', "icon_state" = "bloodyhands")
overlays_lying[GLOVES_LAYER] = image("icon"='icons/effects/blood.dmi', "icon_state"="bloodyhands2")
overlays_standing[GLOVES_LAYER] = image("icon"='icons/effects/blood.dmi', "icon_state"="bloodyhands")
apply_overlay(GLOVES_LAYER)
if(update_icons) update_icons()
/mob/living/carbon/human/update_inv_glasses(update_icons=0)
/mob/living/carbon/human/update_inv_glasses()
remove_overlay(GLASSES_LAYER)
if(glasses)
@@ -450,13 +393,13 @@ Please contact me on #coderbus IRC. ~Carn x
glasses.screen_loc = ui_glasses
client.screen += glasses
overlays_lying[GLASSES_LAYER] = image("icon" = 'icons/mob/eyes.dmi', "icon_state" = "[glasses.icon_state]2", "layer" = -GLASSES_LAYER)
overlays_standing[GLASSES_LAYER] = image("icon" = 'icons/mob/eyes.dmi', "icon_state" = "[glasses.icon_state]", "layer" = -GLASSES_LAYER)
overlays_lying[GLASSES_LAYER] = image("icon"='icons/mob/eyes.dmi', "icon_state"="[glasses.icon_state]2", "layer"=-GLASSES_LAYER)
overlays_standing[GLASSES_LAYER] = image("icon"='icons/mob/eyes.dmi', "icon_state"="[glasses.icon_state]", "layer"=-GLASSES_LAYER)
apply_overlay(GLASSES_LAYER)
if(update_icons) update_icons()
/mob/living/carbon/human/update_inv_ears(update_icons=0)
/mob/living/carbon/human/update_inv_ears()
remove_overlay(EARS_LAYER)
if(ears)
@@ -464,13 +407,13 @@ Please contact me on #coderbus IRC. ~Carn x
ears.screen_loc = ui_ears
client.screen += ears
overlays_lying[EARS_LAYER] = image("icon" = 'icons/mob/ears.dmi', "icon_state" = "[ears.icon_state]2", "layer" = -EARS_LAYER)
overlays_standing[EARS_LAYER] = image("icon" = 'icons/mob/ears.dmi', "icon_state" = "[ears.icon_state]", "layer" = -EARS_LAYER)
overlays_lying[EARS_LAYER] = image("icon"='icons/mob/ears.dmi', "icon_state"="[ears.icon_state]2", "layer"=-EARS_LAYER)
overlays_standing[EARS_LAYER] = image("icon"='icons/mob/ears.dmi', "icon_state"="[ears.icon_state]", "layer"=-EARS_LAYER)
apply_overlay(EARS_LAYER)
if(update_icons) update_icons()
/mob/living/carbon/human/update_inv_shoes(update_icons=0)
/mob/living/carbon/human/update_inv_shoes()
remove_overlay(SHOES_LAYER)
if(shoes)
@@ -478,19 +421,19 @@ Please contact me on #coderbus IRC. ~Carn x
shoes.screen_loc = ui_shoes
client.screen += shoes
var/image/lying = image("icon" = 'icons/mob/feet.dmi', "icon_state" = "[shoes.icon_state]2", "layer" = -SHOES_LAYER)
var/image/standing = image("icon" = 'icons/mob/feet.dmi', "icon_state" = "[shoes.icon_state]", "layer" = -SHOES_LAYER)
var/image/lying = image("icon"='icons/mob/feet.dmi', "icon_state"="[shoes.icon_state]2", "layer"=-SHOES_LAYER)
var/image/standing = image("icon"='icons/mob/feet.dmi', "icon_state"="[shoes.icon_state]", "layer"=-SHOES_LAYER)
overlays_lying[SHOES_LAYER] = lying
overlays_standing[SHOES_LAYER] = standing
if(shoes.blood_DNA)
lying.overlays += image("icon" = 'icons/effects/blood.dmi', "icon_state" = "shoeblood2")
standing.overlays += image("icon" = 'icons/effects/blood.dmi', "icon_state" = "shoeblood")
lying.overlays += image("icon"='icons/effects/blood.dmi', "icon_state"="shoeblood2")
standing.overlays += image("icon"='icons/effects/blood.dmi', "icon_state"="shoeblood")
apply_overlay(SHOES_LAYER)
if(update_icons) update_icons()
/mob/living/carbon/human/update_inv_s_store(update_icons=0)
/mob/living/carbon/human/update_inv_s_store()
remove_overlay(SUIT_STORE_LAYER)
if(s_store)
@@ -500,14 +443,14 @@ Please contact me on #coderbus IRC. ~Carn x
var/t_state = s_store.item_state
if(!t_state) t_state = s_store.icon_state
overlays_lying[SUIT_STORE_LAYER] = image("icon" = 'icons/mob/belt_mirror.dmi', "icon_state" = "[t_state]2", "layer" = -SUIT_STORE_LAYER)
overlays_standing[SUIT_STORE_LAYER] = image("icon" = 'icons/mob/belt_mirror.dmi', "icon_state" = "[t_state]", "layer" = -SUIT_STORE_LAYER)
overlays_lying[SUIT_STORE_LAYER] = image("icon"='icons/mob/belt_mirror.dmi', "icon_state"="[t_state]2", "layer"=-SUIT_STORE_LAYER)
overlays_standing[SUIT_STORE_LAYER] = image("icon"='icons/mob/belt_mirror.dmi', "icon_state"="[t_state]", "layer"=-SUIT_STORE_LAYER)
apply_overlay(SUIT_STORE_LAYER)
if(update_icons) update_icons()
/mob/living/carbon/human/update_inv_head(update_icons=0)
/mob/living/carbon/human/update_inv_head()
remove_overlay(HEAD_LAYER)
if(head)
@@ -519,22 +462,22 @@ Please contact me on #coderbus IRC. ~Carn x
var/image/standing
if(istype(head,/obj/item/clothing/head/kitty))
var/obj/item/clothing/head/kitty/K = head
lying = image("icon" = K.mob2, "layer" = -HEAD_LAYER)
standing = image("icon" = K.mob, "layer" = -HEAD_LAYER)
lying = image("icon"=K.mob2, "layer"=-HEAD_LAYER)
standing = image("icon"=K.mob, "layer"=-HEAD_LAYER)
else
lying = image("icon" = 'icons/mob/head.dmi', "icon_state" = "[head.icon_state]2", "layer" = -HEAD_LAYER)
standing = image("icon" = 'icons/mob/head.dmi', "icon_state" = "[head.icon_state]", "layer" = -HEAD_LAYER)
lying = image("icon"='icons/mob/head.dmi', "icon_state"="[head.icon_state]2", "layer"=-HEAD_LAYER)
standing = image("icon"='icons/mob/head.dmi', "icon_state"="[head.icon_state]", "layer"=-HEAD_LAYER)
overlays_lying[HEAD_LAYER] = lying
overlays_standing[HEAD_LAYER] = standing
if(head.blood_DNA)
lying.overlays += image("icon" = 'icons/effects/blood.dmi', "icon_state" = "helmetblood2")
standing.overlays += image("icon" = 'icons/effects/blood.dmi', "icon_state" = "helmetblood")
lying.overlays += image("icon"='icons/effects/blood.dmi', "icon_state"="helmetblood2")
standing.overlays += image("icon"='icons/effects/blood.dmi', "icon_state"="helmetblood")
apply_overlay(HEAD_LAYER)
if(update_icons) update_icons()
/mob/living/carbon/human/update_inv_belt(update_icons=0)
/mob/living/carbon/human/update_inv_belt()
remove_overlay(BELT_LAYER)
if(belt)
@@ -544,14 +487,14 @@ Please contact me on #coderbus IRC. ~Carn x
var/t_state = belt.item_state
if(!t_state) t_state = belt.icon_state
overlays_lying[BELT_LAYER] = image("icon" = 'icons/mob/belt.dmi', "icon_state" = "[t_state]2", "layer" = -BELT_LAYER)
overlays_standing[BELT_LAYER] = image("icon" = 'icons/mob/belt.dmi', "icon_state" = "[t_state]", "layer" = -BELT_LAYER)
overlays_lying[BELT_LAYER] = image("icon"='icons/mob/belt.dmi', "icon_state"="[t_state]2", "layer"=-BELT_LAYER)
overlays_standing[BELT_LAYER] = image("icon"='icons/mob/belt.dmi', "icon_state"="[t_state]", "layer"=-BELT_LAYER)
apply_overlay(BELT_LAYER)
if(update_icons) update_icons()
/mob/living/carbon/human/update_inv_wear_suit(update_icons=0)
/mob/living/carbon/human/update_inv_wear_suit()
remove_overlay(SUIT_LAYER)
if(istype(wear_suit, /obj/item/clothing/suit))
@@ -559,8 +502,8 @@ Please contact me on #coderbus IRC. ~Carn x
wear_suit.screen_loc = ui_oclothing //TODO
client.screen += wear_suit
var/image/lying = image("icon" = 'icons/mob/suit.dmi', "icon_state" = "[wear_suit.icon_state]2", "layer" = -SUIT_LAYER)
var/image/standing = image("icon" = 'icons/mob/suit.dmi', "icon_state" = "[wear_suit.icon_state]", "layer" = -SUIT_LAYER)
var/image/lying = image("icon"='icons/mob/suit.dmi', "icon_state"="[wear_suit.icon_state]2", "layer"=-SUIT_LAYER)
var/image/standing = image("icon"='icons/mob/suit.dmi', "icon_state"="[wear_suit.icon_state]", "layer"=-SUIT_LAYER)
overlays_lying[SUIT_LAYER] = lying
overlays_standing[SUIT_LAYER] = standing
@@ -571,13 +514,13 @@ Please contact me on #coderbus IRC. ~Carn x
if(wear_suit.blood_DNA)
var/obj/item/clothing/suit/S = wear_suit
lying.overlays += image("icon" = 'icons/effects/blood.dmi', "icon_state" = "[S.blood_overlay_type]blood2")
standing.overlays += image("icon" = 'icons/effects/blood.dmi', "icon_state" = "[S.blood_overlay_type]blood")
lying.overlays += image("icon"='icons/effects/blood.dmi', "icon_state"="[S.blood_overlay_type]blood2")
standing.overlays += image("icon"='icons/effects/blood.dmi', "icon_state"="[S.blood_overlay_type]blood")
apply_overlay(SUIT_LAYER)
if(update_icons) update_icons()
/mob/living/carbon/human/update_inv_pockets(update_icons=0)
/mob/living/carbon/human/update_inv_pockets()
if(l_store)
if(client && hud_used && hud_used.hud_shown)
l_store.screen_loc = ui_storage1 //TODO
@@ -586,10 +529,9 @@ Please contact me on #coderbus IRC. ~Carn x
if(client && hud_used && hud_used.hud_shown)
r_store.screen_loc = ui_storage2 //TODO
client.screen += r_store
if(update_icons) update_icons()
/mob/living/carbon/human/update_inv_wear_mask(update_icons=0)
/mob/living/carbon/human/update_inv_wear_mask()
remove_overlay(FACEMASK_LAYER)
if(istype(wear_mask, /obj/item/clothing/mask))
@@ -597,20 +539,20 @@ Please contact me on #coderbus IRC. ~Carn x
wear_mask.screen_loc = ui_mask //TODO
client.screen += wear_mask
var/image/lying = image("icon" = 'icons/mob/mask.dmi', "icon_state" = "[wear_mask.icon_state]2", "layer" = -FACEMASK_LAYER)
var/image/standing = image("icon" = 'icons/mob/mask.dmi', "icon_state" = "[wear_mask.icon_state]", "layer" = -FACEMASK_LAYER)
var/image/lying = image("icon"='icons/mob/mask.dmi', "icon_state"="[wear_mask.icon_state]2", "layer"=-FACEMASK_LAYER)
var/image/standing = image("icon"='icons/mob/mask.dmi', "icon_state"="[wear_mask.icon_state]", "layer"=-FACEMASK_LAYER)
overlays_lying[FACEMASK_LAYER] = lying
overlays_standing[FACEMASK_LAYER] = standing
if(wear_mask.blood_DNA && !istype(wear_mask, /obj/item/clothing/mask/cigarette))
lying.overlays += image("icon" = 'icons/effects/blood.dmi', "icon_state" = "maskblood2")
standing.overlays += image("icon" = 'icons/effects/blood.dmi', "icon_state" = "maskblood")
lying.overlays += image("icon"='icons/effects/blood.dmi', "icon_state"="maskblood2")
standing.overlays += image("icon"='icons/effects/blood.dmi', "icon_state"="maskblood")
apply_overlay(FACEMASK_LAYER)
if(update_icons) update_icons()
/mob/living/carbon/human/update_inv_back(update_icons=0)
/mob/living/carbon/human/update_inv_back()
remove_overlay(BACK_LAYER)
if(back)
@@ -618,11 +560,11 @@ Please contact me on #coderbus IRC. ~Carn x
back.screen_loc = ui_back //TODO
client.screen += back
overlays_lying[BACK_LAYER] = image("icon" = 'icons/mob/back.dmi', "icon_state" = "[back.icon_state]2", "layer" = -BACK_LAYER)
overlays_standing[BACK_LAYER] = image("icon" = 'icons/mob/back.dmi', "icon_state" = "[back.icon_state]", "layer" = -BACK_LAYER)
overlays_lying[BACK_LAYER] = image("icon"='icons/mob/back.dmi', "icon_state"="[back.icon_state]2", "layer"=-BACK_LAYER)
overlays_standing[BACK_LAYER] = image("icon"='icons/mob/back.dmi', "icon_state"="[back.icon_state]", "layer"=-BACK_LAYER)
apply_overlay(BACK_LAYER)
if(update_icons) update_icons()
/mob/living/carbon/human/update_hud() //TODO: do away with this if possible
@@ -632,7 +574,7 @@ Please contact me on #coderbus IRC. ~Carn x
hud_used.hidden_inventory_update() //Updates the screenloc of the items on the 'other' inventory bar
/mob/living/carbon/human/update_inv_handcuffed(update_icons=0)
/mob/living/carbon/human/update_inv_handcuffed()
remove_overlay(HANDCUFF_LAYER)
if(handcuffed)
@@ -642,11 +584,11 @@ Please contact me on #coderbus IRC. ~Carn x
if(hud_used) //hud handcuff icons
var/obj/screen/inventory/R = hud_used.adding[3]
var/obj/screen/inventory/L = hud_used.adding[4]
R.overlays += image("icon" = 'icons/mob/screen_gen.dmi', "icon_state" = "markus")
L.overlays += image("icon" = 'icons/mob/screen_gen.dmi', "icon_state" = "gabrielle")
R.overlays += image("icon"='icons/mob/screen_gen.dmi', "icon_state"="markus")
L.overlays += image("icon"='icons/mob/screen_gen.dmi', "icon_state"="gabrielle")
overlays_lying[HANDCUFF_LAYER] = image("icon" = 'icons/mob/mob.dmi', "icon_state" = "handcuff2", "layer" = -HANDCUFF_LAYER)
overlays_standing[HANDCUFF_LAYER] = image("icon" = 'icons/mob/mob.dmi', "icon_state" = "handcuff1", "layer" = -HANDCUFF_LAYER)
overlays_lying[HANDCUFF_LAYER] = image("icon"='icons/mob/mob.dmi', "icon_state"="handcuff2", "layer"=-HANDCUFF_LAYER)
overlays_standing[HANDCUFF_LAYER] = image("icon"='icons/mob/mob.dmi', "icon_state"="handcuff1", "layer"=-HANDCUFF_LAYER)
else
if(hud_used)
var/obj/screen/inventory/R = hud_used.adding[3]
@@ -655,9 +597,9 @@ Please contact me on #coderbus IRC. ~Carn x
L.overlays = null
apply_overlay(HANDCUFF_LAYER)
if(update_icons) update_icons()
/mob/living/carbon/human/update_inv_legcuffed(update_icons=0)
/mob/living/carbon/human/update_inv_legcuffed()
remove_overlay(LEGCUFF_LAYER)
if(legcuffed)
@@ -666,14 +608,14 @@ Please contact me on #coderbus IRC. ~Carn x
if(src.hud_used && src.hud_used.move_intent)
src.hud_used.move_intent.icon_state = "walking"
overlays_lying[LEGCUFF_LAYER] = image("icon" = 'icons/mob/mob.dmi', "icon_state" = "legcuff2", "layer" = -LEGCUFF_LAYER)
overlays_standing[LEGCUFF_LAYER] = image("icon" = 'icons/mob/mob.dmi', "icon_state" = "legcuff1", "layer" = -LEGCUFF_LAYER)
overlays_lying[LEGCUFF_LAYER] = image("icon"='icons/mob/mob.dmi', "icon_state"="legcuff2", "layer"=-LEGCUFF_LAYER)
overlays_standing[LEGCUFF_LAYER] = image("icon"='icons/mob/mob.dmi', "icon_state"="legcuff1", "layer"=-LEGCUFF_LAYER)
apply_overlay(LEGCUFF_LAYER)
if(update_icons) update_icons()
/mob/living/carbon/human/update_inv_r_hand(update_icons=0)
/mob/living/carbon/human/update_inv_r_hand()
remove_overlay(R_HAND_LAYER)
if(r_hand)
@@ -684,13 +626,13 @@ Please contact me on #coderbus IRC. ~Carn x
var/t_state = r_hand.item_state
if(!t_state) t_state = r_hand.icon_state
overlays_standing[R_HAND_LAYER] = image("icon" = 'icons/mob/items_righthand.dmi', "icon_state" = "[t_state]", "layer" = -R_HAND_LAYER)
overlays_standing[R_HAND_LAYER] = image("icon"='icons/mob/items_righthand.dmi', "icon_state"="[t_state]", "layer"=-R_HAND_LAYER)
apply_overlay(R_HAND_LAYER)
if(update_icons) update_icons()
/mob/living/carbon/human/update_inv_l_hand(update_icons=0)
/mob/living/carbon/human/update_inv_l_hand()
remove_overlay(L_HAND_LAYER)
if(l_hand)
@@ -701,13 +643,13 @@ Please contact me on #coderbus IRC. ~Carn x
var/t_state = l_hand.item_state
if(!t_state) t_state = l_hand.icon_state
overlays_standing[L_HAND_LAYER] = image("icon" = 'icons/mob/items_lefthand.dmi', "icon_state" = "[t_state]", "layer" = -L_HAND_LAYER)
overlays_standing[L_HAND_LAYER] = image("icon"='icons/mob/items_lefthand.dmi', "icon_state"="[t_state]", "layer"=-L_HAND_LAYER)
apply_overlay(L_HAND_LAYER)
if(update_icons) update_icons()
//Human Overlays Indexes/////////
#undef MUTANTRACE_LAYER
#undef BODY_LAYER
#undef MUTATIONS_LAYER
#undef DAMAGE_LAYER
#undef UNIFORM_LAYER
+2 -2
View File
@@ -41,7 +41,7 @@
for(var/datum/limb/affecting in H.organs)
if(!affecting) continue
if(affecting.take_damage(0, divided_damage+extradam)) //TODO: fix the extradam stuff. Or, ebtter yet...rewrite this entire proc ~Carn
H.UpdateDamageIcon(0)
H.update_damage_overlays(0)
H.updatehealth()
return 1
else if(istype(src, /mob/living/carbon/monkey))
@@ -260,7 +260,7 @@
..()
return
/mob/living/proc/UpdateDamageIcon()
/mob/living/proc/update_damage_overlays()
return
@@ -22,11 +22,6 @@
now_pushing = 1
if(ismob(AM))
var/mob/tmob = AM
if(istype(tmob, /mob/living/carbon/human) && (FAT in tmob.mutations))
if(prob(70))
src << "\red <B>You fail to push [tmob]'s fat ass out of the way.</B>"
now_pushing = 0
return
if(!(tmob.status_flags & CANPUSH))
now_pushing = 0
return
-6
View File
@@ -122,12 +122,6 @@
icon_state = "grabbed1"
else
if(state < GRAB_NECK)
if(istype(affecting, /mob/living/carbon/human))
var/mob/living/carbon/human/H = affecting
if(FAT in H.mutations)
assailant << "<span class='notice'>You can't strangle [affecting] through all that fat!</span>"
return
if(isslime(affecting))
assailant << "<span class='notice'>You squeeze [affecting], but nothing interesting happens.</span>"
return
+1 -1
View File
@@ -497,7 +497,7 @@
var/datum/limb/affecting = H.get_organ("[user.hand ? "l" : "r" ]_arm")
if(affecting.take_damage( 0, 5 )) // 5 burn damage
H.UpdateDamageIcon(0)
H.update_damage_overlays(0)
H.updatehealth()
return // if burned, don't remove the light
+4 -3
View File
@@ -315,10 +315,11 @@ datum
if(!M) M = holder.my_atom
if(ishuman(M))
var/mob/living/carbon/human/human = M
if(human.dna.mutantrace == null)
if(human.dna && !human.dna.mutantrace)
M << "\red Your flesh rapidly mutates!"
human.dna.mutantrace = "slime"
human.update_mutantrace()
human.update_body()
human.update_hair()
..()
return
@@ -1620,7 +1621,7 @@ datum
var/datum/limb/affecting = H.get_organ("head")
if(affecting)
if(affecting.take_damage(10*toxpwr, 5*toxpwr))
H.UpdateDamageIcon(0)
H.update_damage_overlays(0)
if(prob(meltprob))
H.emote("scream")
H.f_style = "Shaved"
+1 -1
View File
@@ -489,7 +489,7 @@ Doing this because FindTurfs() isn't even used
e.update_icon()
if(src.type == /mob/living/carbon/human)
var/mob/living/carbon/human/H = src
H.UpdateDamageIcon()
H.update_damage_overlays()
else
alert("Debugging off")
return
Binary file not shown.

Before

Width:  |  Height:  |  Size: 55 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

After

Width:  |  Height:  |  Size: 81 KiB

+4 -4
View File
@@ -59,19 +59,19 @@
user.see_invisible = SEE_INVISIBLE_LEVEL_TWO
user << "\blue The walls suddenly disappear."
user.dna.mutantrace = "shadow"
user.update_mutantrace()
user.update_body()
if("Wealth")
user << "<B>Your wish is granted, but at a terrible cost...</B>"
user << "The Wish Granter punishes you for your selfishness, claiming your soul and warping your body to match the darkness in your heart."
new /obj/structure/closet/syndicate/resources/everything(loc)
user.dna.mutantrace = "shadow"
user.update_mutantrace()
user.update_body()
if("Immortality")
user << "<B>Your wish is granted, but at a terrible cost...</B>"
user << "The Wish Granter punishes you for your selfishness, claiming your soul and warping your body to match the darkness in your heart."
user.verbs += /mob/living/carbon/proc/immortality
user.dna.mutantrace = "shadow"
user.update_mutantrace()
user.update_body()
if("To Kill")
user << "<B>Your wish is granted, but at a terrible cost...</B>"
user << "The Wish Granter punishes you for your wickedness, claiming your soul and warping your body to match the darkness in your heart."
@@ -86,7 +86,7 @@
user << "<B>Objective #[obj_count]</B>: [OBJ.explanation_text]"
obj_count++
user.dna.mutantrace = "shadow"
user.update_mutantrace()
user.update_body()
if("Peace")
user << "<B>Whatever alien sentience that the Wish Granter possesses is satisfied with your wish. There is a distant wailing as the last of the Faithless begin to die, then silence.</B>"
user << "You feel as if you just narrowly avoided a terrible fate..."
-4
View File
@@ -1112,8 +1112,4 @@
#include "interface\interface.dm"
#include "interface\skin.dmf"
#include "maps\tgstation.2.1.2.dmm"
#include "maps\RandomZLevels\Academy.dm"
#include "maps\RandomZLevels\challenge.dm"
#include "maps\RandomZLevels\stationCollision.dm"
#include "maps\RandomZLevels\wildwest.dm"
// END_INCLUDE