WARNING: This has been thoroughly tested and I'm happy that it's -stable- (it shouldn't runtime). However, it might have a few niggly bugs caused by specific items using no-standard or weird code. Most bugs will be stuff like it not updating overlays and such and can be fixed simply by dropping the item. That being said, if you're not comfortable with this, I'd suggest waiting to update past this revision.

update_clothing() has been broken up into it's key parts. A full explanation can be found in code/modules/mob/living/carbon/human/update_icons.dm
the tl;dr of it is that overlay updates are no longer called by the gameticker. Instead they are called by procs such as u_equip db_cick etc. This means faster updates (although admittedly, more of them can be called per tick). This however is offset by the fact that specific overlays can be updated now, vastly improving its efficiency. This will especially help when there are large numbers of dead mobs.

Fixed the throw code for TKgrab so it can be toggled.

Cloaking for aliens/humans/ninjas was changed. It's very crude at the moment and for that I apologise. But it works and is very efficient.It also stops cloaked individuals becomming invincible due to people being unable to hit them (even when they know exactly where  they are)

Fixed a bunch of bugs with damage-overlays. They  were updating FAR FAR to frequently. They were also horribly inefficient. They should now be virtually seamless when updating and only use cached icons, so they aren't affected by lag as badly. This may help with explosions lag a little.

There's still a tonne of stuff I need to refine with this. I'll be refining it down into some helper procs to reduce on code duplication and such

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@3811 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
elly1989@rocketmail.com
2012-06-13 19:03:25 +00:00
parent e8161929d1
commit 8961bd96d0
114 changed files with 1699 additions and 1590 deletions
+1 -1
View File
@@ -2092,7 +2092,7 @@ var/global/BSACooldown = 0
feedback_add_details("admin_secrets_fun_used","DF")
for(var/mob/living/carbon/human/B in world)
B.face_icon_state = "facial_wise"
B.update_face()
B.update_hair()
message_admins("[key_name_admin(usr)] activated dorf mode")
else
alert("You cannot perform this action. You must be of a higher administrative rank!")
+2 -2
View File
@@ -380,7 +380,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
id.assignment = "Captain"
id.name = "[id.registered_name]'s ID Card ([id.assignment])"
H.equip_if_possible(id, H.slot_wear_id)
H.update_clothing()
H.update_inv_wear_id()
else
alert("Invalid mob")
feedback_add_details("admin_verb","GFA") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
@@ -765,7 +765,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
W.registered_name = M.real_name
M.equip_if_possible(W, M.slot_wear_id)
M.update_clothing()
M.regenerate_icons()
log_admin("[key_name(usr)] changed the equipment of [key_name(M)] to [dresscode].")
message_admins("\blue [key_name_admin(usr)] changed the equipment of [key_name_admin(M)] to [dresscode]..", 1)
+1 -1
View File
@@ -269,7 +269,7 @@ var/list/forbidden_varedit_object_types = list(
variable = holder.marked_datum
/client/proc/modify_variables(var/atom/O, var/param_var_name = null, var/autodetect_class = 0)
var/list/locked = list("vars", "key", "ckey", "client", "firemut", "ishulk", "telekinesis", "xray", "virus", "cuffed", "ka", "last_eaten", "urine", "poo", "icon", "icon_state")
var/list/locked = list("vars", "key", "ckey", "client", "firemut", "ishulk", "telekinesis", "xray", "virus", "cuffed", "ka", "last_eaten", "icon", "icon_state", "mutantrace")
if(!src.holder)
src << "Only administrators may use this command."
+4 -1
View File
@@ -34,7 +34,10 @@
if(usr.control_object && usr.name_archive) //if you have a name archived and if you are actually relassing an object
usr.real_name = usr.name_archive
usr.name = usr.real_name
usr.update_clothing() //So the name is updated properly
if(ishuman(usr))
var/mob/living/carbon/human/H = usr
H.name = H.get_visible_name()
// usr.regenerate_icons() //So the name is updated properly
usr.loc = O.loc // Appear where the object you were controlling is -- TLE
usr.client.eye = usr
+6 -6
View File
@@ -658,8 +658,8 @@ datum
var/datum/organ/external/affecting = M:get_organ("head")
if(affecting)
affecting.take_damage(25, 0)
M:UpdateDamageIcon()
if(affecting.take_damage(25, 0))
M:UpdateDamageIcon()
M:emote("scream")
else
M.take_organ_damage(min(15, volume * 2)) // uses min() and volume to make sure they aren't being sprayed in trace amounts (1 unit != insta rape) -- Doohl
@@ -708,8 +708,8 @@ datum
if(!M.unacidable)
var/datum/organ/external/affecting = M:get_organ("head")
affecting.take_damage(15, 0)
M:UpdateDamageIcon()
if(affecting.take_damage(15, 0))
M:UpdateDamageIcon()
M:emote("scream")
else
if(istype(M, /mob/living/carbon/monkey) && M:wear_mask)
@@ -724,8 +724,8 @@ datum
if(!M.unacidable)
if(istype(M, /mob/living/carbon/human))
var/datum/organ/external/affecting = M:get_organ("head")
affecting.take_damage(15, 0)
M:UpdateDamageIcon()
if(affecting.take_damage(15, 0))
M:UpdateDamageIcon()
M:emote("scream")
else
M.take_organ_damage(min(15, volume * 4))
+2
View File
@@ -1838,9 +1838,11 @@
if (user.r_hand == D)
user.u_equip(D)
user.r_hand = B
user.update_inv_r_hand()
else
user.u_equip(D)
user.l_hand = B
user.update_inv_l_hand()
B.layer = 20
user << "You add the sensor to the bucket"
del(D)
@@ -5,17 +5,8 @@
if(src.name == "alien drone")
src.name = text("alien drone ([rand(1, 1000)])")
src.real_name = src.name
spawn (1)
src.verbs += /mob/living/carbon/alien/humanoid/proc/corrode_target
src.verbs -= /mob/living/carbon/alien/humanoid/verb/ActivateHuggers
src.stand_icon = new /icon('alien.dmi', "aliend_s")
src.lying_icon = new /icon('alien.dmi', "aliend_l")
src.resting_icon = new /icon('alien.dmi', "aliend_sleep")
src.running_icon = new /icon('alien.dmi', "aliend_running")
src.icon = src.stand_icon
update_clothing()
src << "\blue Your icons have been generated!"
src.verbs += /mob/living/carbon/alien/humanoid/proc/corrode_target
src.verbs -= /mob/living/carbon/alien/humanoid/verb/ActivateHuggers
//Drones use the same base as generic humanoids.
//Drone verbs
@@ -5,16 +5,7 @@
if(src.name == "alien hunter")
src.name = text("alien hunter ([rand(1, 1000)])")
src.real_name = src.name
spawn (1)
src.verbs -= /mob/living/carbon/alien/humanoid/verb/corrode
src.stand_icon = new /icon('alien.dmi', "alienh_s")
src.lying_icon = new /icon('alien.dmi', "alienh_l")
src.resting_icon = new /icon('alien.dmi', "alienh_sleep")
src.running_icon = new /icon('alien.dmi', "alienh_running")
src.icon = src.stand_icon
update_clothing()
src << "\blue Your icons have been generated!"
src.verbs -= /mob/living/carbon/alien/humanoid/verb/corrode
/mob/living/carbon/alien/humanoid/hunter
@@ -154,16 +145,21 @@
set desc = "Makes you invisible for 15 seconds"
set category = "Alien"
if(powerc(50))
adjustToxLoss(-50)
alien_invis = 1.0
src << "\green You are now invisible."
for(var/mob/O in oviewers(src, null))
O.show_message(text("\red <B>[src] fades into the surroundings!</B>"), 1)
spawn(150)
if(!isnull(src))//Don't want the game to runtime error when the mob no-longer exists.
alien_invis = 0.0
src << "\green You are no longer invisible."
if(alien_invis)
update_icons()
else
if(powerc(50))
adjustToxLoss(-50)
alien_invis = 1.0
update_icons()
src << "\green You are now invisible."
for(var/mob/O in oviewers(src, null))
O.show_message(text("\red <B>[src] fades into the surroundings!</B>"), 1)
spawn(250)
if(!isnull(src))//Don't want the game to runtime error when the mob no-longer exists.
alien_invis = 0.0
update_icons()
src << "\green You are no longer invisible."
return
/mob/living/carbon/alien/humanoid/hunter/verb/regurgitate()
@@ -5,16 +5,7 @@
if(src.name == "alien sentinel")
src.name = text("alien sentinel ([rand(1, 1000)])")
src.real_name = src.name
spawn (1)
src.verbs += /mob/living/carbon/alien/humanoid/proc/corrode_target
src.stand_icon = new /icon('alien.dmi', "aliens_s")
src.lying_icon = new /icon('alien.dmi', "aliens_l")
src.resting_icon = new /icon('alien.dmi', "aliens_sleep")
src.running_icon = new /icon('alien.dmi', "aliens_running")
src.icon = src.stand_icon
update_clothing()
src << "\blue Your icons have been generated!"
src.verbs += /mob/living/carbon/alien/humanoid/proc/corrode_target
/mob/living/carbon/alien/humanoid/sentinel
@@ -2,13 +2,8 @@
src.adding = list( )
src.other = list( )
src.intents = list( )
src.mon_blo = list( )
src.m_ints = list( )
src.mov_int = list( )
src.vimpaired = list( )
src.darkMask = list( )
src.intent_small_hud_objects = list( )
src.g_dither = new src.h_type( src )
src.g_dither.screen_loc = "WEST,SOUTH to EAST,NORTH"
@@ -50,41 +45,6 @@
src.adding += using
action_intent = using
//intent small hud objects
using = new src.h_type( src )
using.name = "help"
using.icon = 'screen1_alien.dmi'
using.icon_state = "help_small"
using.screen_loc = ui_help_small
using.layer = 21
src.intent_small_hud_objects += using
using = new src.h_type( src )
using.name = "disarm"
using.icon = 'screen1_alien.dmi'
using.icon_state = "disarm_small"
using.screen_loc = ui_disarm_small
using.layer = 21
src.intent_small_hud_objects += using
using = new src.h_type( src )
using.name = "grab"
using.icon = 'screen1_alien.dmi'
using.icon_state = "grab_small"
using.screen_loc = ui_grab_small
using.layer = 21
src.intent_small_hud_objects += using
using = new src.h_type( src )
using.name = "harm"
using.icon = 'screen1_alien.dmi'
using.icon_state = "harm_small"
using.screen_loc = ui_harm_small
using.layer = 21
src.intent_small_hud_objects += using
//end intent small hud objects
using = new src.h_type( src )
using.name = "mov_intent"
using.dir = SOUTHWEST
@@ -6,15 +6,6 @@
if(name == "alien")
name = text("alien ([rand(1, 1000)])")
real_name = name
spawn (1)
if(!istype(src, /mob/living/carbon/alien/humanoid/queen))
stand_icon = new /icon('alien.dmi', "alien_s")
lying_icon = new /icon('alien.dmi', "alien_l")
resting_icon = new /icon('alien.dmi', "alienh_sleep")
running_icon = new /icon('alien.dmi', "alienh_running")
icon = stand_icon
update_clothing()
src << "\blue Your icons have been generated!"
..()
/mob/living/carbon/alien/humanoid/proc/mind_initialize(mob/G, alien_caste)
@@ -152,16 +143,22 @@
/mob/living/carbon/alien/humanoid/u_equip(obj/item/W as obj)
if (W == wear_suit)
wear_suit = null
update_inv_wear_suit(0)
else if (W == head)
head = null
update_inv_head(0)
else if (W == r_store)
r_store = null
update_inv_pockets(0)
else if (W == l_store)
l_store = null
update_inv_pockets(0)
else if (W == r_hand)
r_hand = null
update_inv_r_hand(0)
else if (W == l_hand)
l_hand = null
update_inv_l_hand(0)
/mob/living/carbon/alien/humanoid/db_click(text, t1)
var/obj/item/W = equipped()
@@ -179,6 +176,8 @@
if (wear_suit)
if (emptyHand)
wear_suit.DblClick()
// else
// update_inv_wear_suit()
return
/* if (!( istype(W, /obj/item/clothing/suit) ))
return
@@ -190,11 +189,10 @@
if (head)
if (emptyHand)
head.DblClick()
return
if (( istype(W, /obj/effect/alien/head) ))
else if (( istype(W, /obj/effect/alien/head) )) //TODO: figure out wtf this is about ~Carn
u_equip(W)
head = W
return
update_inv_head()
return
/* if (!( istype(W, /obj/item/clothing/head) ))
return
@@ -211,6 +209,7 @@
return
u_equip(W)
l_store = W
update_inv_pockets()
if("storage2")
if (r_store)
if (emptyHand)
@@ -220,7 +219,7 @@
return
u_equip(W)
r_store = W
else
update_inv_pockets()
return
/mob/living/carbon/alien/humanoid/meteorhit(O as obj)
@@ -310,161 +309,6 @@
return
/mob/living/carbon/alien/humanoid/update_clothing()
..()
if (monkeyizing)
return
overlays = null
if(buckled)
if(istype(buckled, /obj/structure/stool/bed/chair))
lying = 0
else
lying = 1
// Automatically drop anything in store / id / belt if you're not wearing a uniform.
if (zone_sel)
zone_sel.overlays = null
zone_sel.overlays += damageicon_standing
zone_sel.overlays += image("icon" = 'zone_sel.dmi', "icon_state" = text("[]", zone_sel.selecting))
if (lying)
if(update_icon)
if(!resting)
icon = lying_icon
else
icon = resting_icon
else if(!lying)
if(update_icon)
if(m_intent == "run")
icon = running_icon
else
icon = stand_icon
overlays += damageicon_lying
if (face_lying)
overlays += face_lying
else
if(update_icon)
icon = stand_icon
overlays += damageicon_standing
if (face_standing)
overlays += face_standing
// Uniform
if (client)
client.screen -= hud_used.other
client.screen -= hud_used.intents
client.screen -= hud_used.mov_int
// ???
if (client && other)
client.screen += hud_used.other
if (client)
if (i_select)
if (intent)
client.screen += hud_used.intents
var/list/L = dd_text2list(intent, ",")
L[1] += ":-11"
i_select.screen_loc = dd_list2text(L,",") //ICONS4, FUCKING SHIT
else
i_select.screen_loc = null
if (m_select)
if (m_int)
client.screen += hud_used.mov_int
var/list/L = dd_text2list(m_int, ",")
L[1] += ":-11"
m_select.screen_loc = dd_list2text(L,",") //ICONS4, FUCKING SHIT
else
m_select.screen_loc = null
if (wear_suit)
var/t1 = wear_suit.item_state
if (!t1)
t1 = wear_suit.icon_state
overlays += image("icon" = 'mob.dmi', "icon_state" = text("[][]", t1, (!( lying ) ? null : "2")), "layer" = SUIT_LAYER)
if (wear_suit.blood_DNA)
if (istype(wear_suit, /obj/item/clothing/suit/armor))
overlays += image("icon" = 'blood.dmi', "icon_state" = "armorblood[!lying ? "" : "2"]", "layer" = B_SUIT_LAYER)
else
overlays += image("icon" = 'blood.dmi', "icon_state" = "suitblood[!lying ? "" : "2"]", "layer" = B_SUIT_LAYER)
wear_suit.screen_loc = ui_alien_oclothing
if (istype(wear_suit, /obj/item/clothing/suit/straight_jacket))
if (handcuffed)
handcuffed.loc = loc
handcuffed.layer = initial(handcuffed.layer)
handcuffed = null
if ((l_hand || r_hand))
var/h = hand
hand = 1
drop_item()
hand = 0
drop_item()
hand = h
// Head
if (head)
var/t1 = head.item_state
if (!t1)
t1 = head.icon_state
overlays += image("icon" = 'mob.dmi', "icon_state" = text("[][]", t1, (!( lying ) ? null : "2")), "layer" = HEAD_LAYER)
if (head.blood_DNA)
overlays += image("icon" = 'blood.dmi', "icon_state" = "helmetblood[!lying ? "" : "2"]", "layer" = B_HEAD_LAYER)
head.screen_loc = ui_alien_head
if (l_store)
l_store.screen_loc = ui_storage1
if (r_store)
r_store.screen_loc = ui_storage2
if (client)
client.screen -= contents
client.screen += contents
if (r_hand)
overlays += image("icon" = 'items_righthand.dmi', "icon_state" = r_hand.item_state ? r_hand.item_state : r_hand.icon_state, "layer" = INHANDS_LAYER)
r_hand.screen_loc = ui_rhand
if (l_hand)
overlays += image("icon" = 'items_lefthand.dmi', "icon_state" = l_hand.item_state ? l_hand.item_state : l_hand.icon_state, "layer" = INHANDS_LAYER)
l_hand.screen_loc = ui_lhand
var/shielded = 0
for (var/obj/item/weapon/cloaking_device/S in src)
if (S.active)
shielded = 2
break
if (shielded == 2 || alien_invis)
invisibility = 2
//New stealth. Hopefully doesn't lag too much. /N
if(istype(loc, /turf))//If they are standing on a turf.
AddCamoOverlay(loc)//Overlay camo.
else
invisibility = 0
for (var/mob/M in viewers(1, src))
if ((M.client && M.machine == src))
spawn (0)
show_inv(M)
return
last_b_state = stat
/mob/living/carbon/alien/humanoid/hand_p(mob/M as mob)
if (!ticker)
@@ -641,8 +485,10 @@
G.assailant = M
if (M.hand)
M.l_hand = G
M.update_inv_l_hand()
else
M.r_hand = G
M.update_inv_r_hand()
G.layer = 20
G.affecting = src
grabbed_by += G
@@ -62,15 +62,19 @@
//Status updates, death etc.
handle_regular_status_updates()
// Update clothing
update_clothing()
//Being buckled to a chair or bed
check_if_buckled()
//Temporary, whilst I finish the regenerate_icons changes ~Carn
if( update_icon ) //forces a full overlay update
update_icon = 0
regenerate_icons()
else if( lying != lying_prev )
update_icons()
if(client)
handle_regular_hud_updates()
//Being buckled to a chair or bed
check_if_buckled()
// Yup.
update_canmove()
@@ -408,8 +412,8 @@
//if (prob(10) && health) emote("snore") //Invalid emote for aliens, but it might be worth making sleep noticeable somehow -Yvarov
src.sleeping--
if(src.resting)
Weaken(5)
// if(src.resting)
// Weaken(5)
if(move_delay_add > 0)
move_delay_add = max(0, move_delay_add - rand(1, 2))
@@ -425,9 +429,11 @@
if(src.stat != 2) src.stat = 1
Paralyse(5)
if (src.stat != 2) //Alive.
if (src.stat != DEAD) //Alive.
if (src.paralysis || src.stunned || src.weakened) //Stunned etc.
if (resting || src.paralysis || src.stunned || src.weakened) //Stunned etc.
if (resting)
src.lying = 1
if (src.stunned > 0)
AdjustStunned(-1)
src.stat = 0
@@ -440,12 +446,10 @@
src.blinded = 1
src.lying = 1
src.stat = 1
var/h = src.hand
src.hand = 0
drop_item()
src.hand = 1
hand = !hand
drop_item()
src.hand = h
hand = !hand
else //Not stunned.
src.lying = 0
@@ -1,12 +1,12 @@
/mob/living/carbon/alien/humanoid/Login()
..()
update_clothing()
update_hud()
if (!isturf(src.loc))
src.client.eye = src.loc
src.client.perspective = EYE_PERSPECTIVE
if (src.stat == 2)
if (src.stat == DEAD)
src.verbs += /mob/proc/ghost
return
@@ -29,7 +29,7 @@
src.rest = new /obj/screen( null )
src.zone_sel = new /obj/screen/zone_sel( null )
update_clothing()
regenerate_icons()
src.mach.dir = NORTH
@@ -6,17 +6,9 @@
// if(src.name == "alien")
// src.name = text("alien ([rand(1, 1000)])")
src.real_name = src.name
spawn (1)
src.verbs += /mob/living/carbon/alien/humanoid/proc/corrode_target
src.verbs += /mob/living/carbon/alien/humanoid/sentinel/verb/spit
src.verbs -= /mob/living/carbon/alien/humanoid/verb/ventcrawl
src.stand_icon = new /icon('alien.dmi', "queen_s")
src.lying_icon = new /icon('alien.dmi', "queen_l")
src.resting_icon = new /icon('alien.dmi', "queen_sleep")
src.running_icon = new /icon('alien.dmi', "queen_running")
src.icon = src.stand_icon
update_clothing()
src << "\blue Your icons have been generated!"
src.verbs += /mob/living/carbon/alien/humanoid/proc/corrode_target
src.verbs += /mob/living/carbon/alien/humanoid/sentinel/verb/spit
src.verbs -= /mob/living/carbon/alien/humanoid/verb/ventcrawl
/mob/living/carbon/alien/humanoid/queen
@@ -0,0 +1,124 @@
/mob/living/carbon/alien/humanoid
var/list/overlays_lying[X_TOTAL_LAYERS]
var/list/overlays_standing[X_TOTAL_LAYERS]
/mob/living/carbon/alien/humanoid/update_icons()
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 to be here
overlays = null
if(lying)
if(resting) icon_state = "alien[caste]_sleep"
else icon_state = "alien[caste]_l"
for(var/image/I in overlays_lying)
overlays += I
else
if(alien_invis)
icon_state = "alienh_cloak" //this is such a crude solution. I'm sorry.
//indstead of all that fancy icon processing, it just replaces our base icon
//Aliens can't wear much anyway :P ~Carn
else
if(m_intent == "run") icon_state = "alien[caste]_running"
else icon_state = "alien[caste]_s"
for(var/image/I in overlays_standing)
overlays += I
/mob/living/carbon/alien/humanoid/regenerate_icons()
..()
if (monkeyizing) return
update_inv_head(0)
update_inv_wear_suit(0)
update_inv_r_hand(0)
update_inv_l_hand(0)
update_inv_pockets(0)
update_hud()
update_icons()
/mob/living/carbon/alien/humanoid/update_hud()
//TODO
if (client)
// if(other) client.screen |= hud_used.other //Not used
// else client.screen -= hud_used.other //Not used
client.screen |= contents
/mob/living/carbon/alien/humanoid/update_inv_wear_suit(var/update_icons=1)
if(wear_suit)
var/t_state = wear_suit.item_state
if(!t_state) t_state = wear_suit.icon_state
var/image/lying = image("icon" = 'mob.dmi', "icon_state" = "[t_state]2")
var/image/standing = image("icon" = 'mob.dmi', "icon_state" = "[t_state]")
if(wear_suit.blood_DNA)
var/t_suit = "suit"
if( istype(wear_suit, /obj/item/clothing/suit/armor) )
t_suit = "armor"
lying.overlays += image("icon" = 'blood.dmi', "icon_state" = "[t_suit]blood2")
standing.overlays += image("icon" = 'blood.dmi', "icon_state" = "[t_suit]blood")
//TODO
wear_suit.screen_loc = ui_alien_oclothing
if (istype(wear_suit, /obj/item/clothing/suit/straight_jacket))
if (handcuffed)
handcuffed.loc = loc
handcuffed.layer = initial(handcuffed.layer)
handcuffed = null
if ((l_hand || r_hand))
drop_item()
hand = !hand
drop_item()
hand = !hand
overlays_lying[X_SUIT_LAYER] = lying
overlays_standing[X_SUIT_LAYER] = standing
else
overlays_lying[X_SUIT_LAYER] = null
overlays_standing[X_SUIT_LAYER] = null
if(update_icons) update_icons()
/mob/living/carbon/alien/humanoid/update_inv_head(var/update_icons=1)
if (head)
var/t_state = head.item_state
if(!t_state) t_state = head.icon_state
var/image/lying = image("icon" = 'mob.dmi', "icon_state" = "[t_state]2")
var/image/standing = image("icon" = 'mob.dmi', "icon_state" = "[t_state]")
if(head.blood_DNA)
lying.overlays += image("icon" = 'blood.dmi', "icon_state" = "helmetblood2")
standing.overlays += image("icon" = 'blood.dmi', "icon_state" = "helmetblood")
head.screen_loc = ui_alien_head
overlays_lying[X_HEAD_LAYER] = lying
overlays_standing[X_HEAD_LAYER] = standing
else
overlays_lying[X_HEAD_LAYER] = null
overlays_standing[X_HEAD_LAYER] = null
if(update_icons) update_icons()
/mob/living/carbon/alien/humanoid/update_inv_pockets(var/update_icons=1)
if(l_store) l_store.screen_loc = ui_storage1
if(r_store) r_store.screen_loc = ui_storage2
if(update_icons) update_icons()
/mob/living/carbon/alien/humanoid/update_inv_r_hand(var/update_icons=1)
if(r_hand)
var/t_state = r_hand.item_state
if(!t_state) t_state = r_hand.icon_state
r_hand.screen_loc = ui_rhand
overlays_standing[X_R_HAND_LAYER] = image("icon" = 'items_righthand.dmi', "icon_state" = t_state)
else
overlays_standing[X_R_HAND_LAYER] = null
if(update_icons) update_icons()
/mob/living/carbon/alien/humanoid/update_inv_l_hand(var/update_icons=1)
if(l_hand)
var/t_state = l_hand.item_state
if(!t_state) t_state = l_hand.icon_state
l_hand.screen_loc = ui_lhand
overlays_standing[X_L_HAND_LAYER] = image("icon" = 'items_lefthand.dmi', "icon_state" = t_state)
else
overlays_standing[X_L_HAND_LAYER] = null
if(update_icons) update_icons()
@@ -4,13 +4,8 @@
src.adding = list( )
src.other = list( )
src.intents = list( )
src.mon_blo = list( )
src.m_ints = list( )
src.mov_int = list( )
src.vimpaired = list( )
src.darkMask = list( )
src.intent_small_hud_objects = list( )
src.g_dither = new src.h_type( src )
src.g_dither.screen_loc = "WEST,SOUTH to EAST,NORTH"
@@ -52,41 +47,6 @@
src.adding += using
action_intent = using
//intent small hud objects
using = new src.h_type( src )
using.name = "help"
using.icon = 'screen1_alien.dmi'
using.icon_state = "help_small"
using.screen_loc = ui_help_small
using.layer = 21
src.intent_small_hud_objects += using
using = new src.h_type( src )
using.name = "disarm"
using.icon = 'screen1_alien.dmi'
using.icon_state = "disarm_small"
using.screen_loc = ui_disarm_small
using.layer = 21
src.intent_small_hud_objects += using
using = new src.h_type( src )
using.name = "grab"
using.icon = 'screen1_alien.dmi'
using.icon_state = "grab_small"
using.screen_loc = ui_grab_small
using.layer = 21
src.intent_small_hud_objects += using
using = new src.h_type( src )
using.name = "harm"
using.icon = 'screen1_alien.dmi'
using.icon_state = "harm_small"
using.screen_loc = ui_harm_small
using.layer = 21
src.intent_small_hud_objects += using
//end intent small hud objects
using = new src.h_type( src )
using.name = "mov_intent"
using.dir = SOUTHWEST
@@ -7,7 +7,7 @@
name = text("alien larva ([rand(1, 1000)])")
real_name = name
spawn (1)
update_clothing()
regenerate_icons()
src << "\blue Your icons have been generated!"
// spawn(1200) grow() Grow after 120 seconds -- TLE Commented out because life.dm has better version -- Urist
..()
@@ -223,46 +223,6 @@
return
/mob/living/carbon/alien/larva/update_clothing()
..()
if (monkeyizing)
return
if (client)
if (i_select)
if (intent)
client.screen += hud_used.intents
var/list/L = dd_text2list(intent, ",")
L[1] += ":-11"
i_select.screen_loc = dd_list2text(L,",") //ICONS4, FUCKING SHIT
else
i_select.screen_loc = null
if (m_select)
if (m_int)
client.screen += hud_used.mov_int
var/list/L = dd_text2list(m_int, ",")
L[1] += ":-11"
m_select.screen_loc = dd_list2text(L,",") //ICONS4, FUCKING SHIT
else
m_select.screen_loc = null
if (alien_invis)
invisibility = 2
if(istype(loc, /turf))//If they are standing on a turf.
AddCamoOverlay(loc)//Overlay camo.
else
invisibility = 0
for (var/mob/M in viewers(1, src))
if ((M.client && M.machine == src))
spawn (0)
show_inv(M)
return
/mob/living/carbon/alien/larva/hand_p(mob/M as mob)
if (!ticker)
@@ -413,8 +373,10 @@
G.assailant = M
if (M.hand)
M.l_hand = G
M.update_inv_l_hand()
else
M.r_hand = G
M.update_inv_r_hand()
G.layer = 20
G.affecting = src
grabbed_by += G
@@ -59,7 +59,7 @@
handle_regular_status_updates()
// Update clothing
update_clothing()
// regenerate_icons()
if(client)
handle_regular_hud_updates()
@@ -1,8 +1,6 @@
/mob/living/carbon/alien/larva/Login()
..()
update_clothing()
if (!isturf(src.loc))
src.client.eye = src.loc
src.client.perspective = EYE_PERSPECTIVE
@@ -0,0 +1 @@
//No special icons processing
+2 -2
View File
@@ -22,8 +22,8 @@
var/organ = H.get_organ("chest")
if (istype(organ, /datum/organ/external))
var/datum/organ/external/temp = organ
temp.take_damage(d, 0)
H.UpdateDamageIcon()
if(temp.take_damage(d, 0))
H.UpdateDamageIcon()
H.updatehealth()
else
src.take_organ_damage(d)
@@ -4,13 +4,8 @@
src.adding = list( )
src.other = list( )
src.intents = list( )
src.mon_blo = list( )
src.m_ints = list( )
src.mov_int = list( )
src.vimpaired = list( )
src.darkMask = list( )
src.intent_small_hud_objects = list( )
src.hotkeybuttons = list( ) //These can be disabled for hotkey usersx
src.g_dither = new src.h_type( src )
@@ -57,41 +52,6 @@
src.adding += using
action_intent = using
//intent small hud objects
using = new src.h_type( src )
using.name = "help"
using.icon = ui_style
using.icon_state = "help_small"
using.screen_loc = ui_help_small
using.layer = 21
src.intent_small_hud_objects += using
using = new src.h_type( src )
using.name = "disarm"
using.icon = ui_style
using.icon_state = "disarm_small"
using.screen_loc = ui_disarm_small
using.layer = 21
src.intent_small_hud_objects += using
using = new src.h_type( src )
using.name = "grab"
using.icon = ui_style
using.icon_state = "grab_small"
using.screen_loc = ui_grab_small
using.layer = 21
src.intent_small_hud_objects += using
using = new src.h_type( src )
using.name = "harm"
using.icon = ui_style
using.icon_state = "harm_small"
using.screen_loc = ui_harm_small
using.layer = 21
src.intent_small_hud_objects += using
//end intent small hud objects
using = new src.h_type( src )
using.name = "mov_intent"
using.dir = SOUTHWEST
File diff suppressed because it is too large Load Diff
@@ -16,8 +16,10 @@
G.assailant = M
if (M.hand)
M.l_hand = G
M.update_inv_l_hand()
else
M.r_hand = G
M.update_inv_r_hand()
G.layer = 20
G.affecting = src
grabbed_by += G
@@ -47,7 +49,6 @@
if (damage >= 25)
visible_message("\red <B>[M] has wounded [src]!</B>")
apply_effect(4, WEAKEN, armor_block)
UpdateDamageIcon()
updatehealth()
if("disarm")
@@ -53,7 +53,6 @@
if(damage >= 9)
visible_message("\red <B>[M] has weakened [src]!</B>")
apply_effect(4, WEAKEN, armor_block)
UpdateDamageIcon()
return
@@ -90,8 +89,10 @@
G.assailant = M
if (M.hand)
M.l_hand = G
M.update_inv_l_hand()
else
M.r_hand = G
M.update_inv_r_hand()
G.layer = 20
G.affecting = src
grabbed_by += G
@@ -169,7 +170,6 @@
if(damage >= 9)
visible_message("\red <B>[M] has weakened [src]!</B>")
apply_effect(4, WEAKEN, armor_block)
UpdateDamageIcon()
if("disarm")
M.attack_log += text("\[[time_stamp()]\] <font color='red'>Disarmed [src.name] ([src.ckey])</font>")
@@ -7,22 +7,6 @@
return 0
return
// new damage icon system
// now constructs damage icon for each organ from mask * damage field
/mob/living/carbon/human/UpdateDamageIcon()
var/icon/standing = new /icon('dam_human.dmi', "00")
var/icon/lying = new /icon('dam_human.dmi', "00-2")
for(var/datum/organ/external/O in organs)
var/icon/DI = new /icon('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('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)
damageicon_standing = new /image("icon" = standing, "layer" = DAMAGE_LAYER)
damageicon_lying = new /image("icon" = lying, "layer" = DAMAGE_LAYER)
/mob/living/carbon/human/proc/get_organ(var/zone)
if(!zone) zone = "chest"
@@ -54,9 +38,10 @@
switch(damagetype)
if(BRUTE)
organ.take_damage(damage, 0)
if(organ.take_damage(damage, 0))
UpdateDamageIcon()
if(BURN)
organ.take_damage(0, damage)
UpdateDamageIcon()
if(organ.take_damage(0, damage))
UpdateDamageIcon()
updatehealth()
return 1
return 1
@@ -128,6 +128,8 @@ emp_act
var/bloody = 0
if(((I.damtype == BRUTE) || (I.damtype == HALLOSS)) && prob(25 + (I.force * 2)))
I.add_blood(src) //Make the weapon bloody, not the person.
// if(user.hand) user.update_inv_l_hand() //updates the attacker's overlay for the (now bloodied) weapon
// else user.update_inv_r_hand() //removed because weapons don't have on-mob blood overlays
if(prob(33))
bloody = 1
var/turf/location = loc
@@ -135,8 +137,12 @@ emp_act
location.add_blood(src)
if(ishuman(user))
var/mob/living/carbon/human/H = user
if(H.wear_suit) H.wear_suit.add_blood(src)
else if(H.w_uniform) H.w_uniform.add_blood(src)
if(H.wear_suit)
H.wear_suit.add_blood(src)
H.update_inv_wear_suit(0) //updates mob overlays to show the new blood (no refresh)
else if(H.w_uniform)
H.w_uniform.add_blood(src)
H.update_inv_w_uniform(0) //updates mob overlays to show the new blood (no refresh)
if (H.gloves)
H.gloves.add_blood(H)
H.gloves:transfer_blood = 2
@@ -145,6 +151,7 @@ emp_act
H.add_blood(H)
H.bloody_hands = 2
H.bloody_hands_mob = H
H.update_inv_gloves() //updates on-mob overlays for bloody hands and/or bloody gloves
switch(hit_area)
if("head")//Harder to score a stun but if you do it lasts a bit longer
@@ -155,9 +162,15 @@ emp_act
ticker.mode.remove_revolutionary(mind)
if(bloody)//Apply blood
if(wear_mask) wear_mask.add_blood(src)
if(head) head.add_blood(src)
if(glasses && prob(33)) glasses.add_blood(src)
if(wear_mask)
wear_mask.add_blood(src)
update_inv_wear_mask(0)
if(head)
head.add_blood(src)
update_inv_head(0)
if(glasses && prob(33))
glasses.add_blood(src)
update_inv_glasses(0)
if("chest")//Easier to score a stun but lasts less time
if(prob((I.force + 10)))
@@ -165,6 +178,10 @@ emp_act
visible_message("\red <B>[src] has been knocked down!</B>")
if(bloody)
if(src.wear_suit) src.wear_suit.add_blood(src)
if(src.w_uniform) src.w_uniform.add_blood(src)
src.UpdateDamageIcon()
if(wear_suit)
wear_suit.add_blood(src)
update_inv_wear_suit(0)
if(w_uniform)
w_uniform.add_blood(src)
update_inv_w_uniform(0)
+51 -45
View File
@@ -14,20 +14,15 @@
set invisibility = 0
set background = 1
if (monkeyizing)
return
if(!loc) // Fixing a null error that occurs when the mob isn't found in the world -- TLE
return
if (monkeyizing) return
if(!loc) return // Fixing a null error that occurs when the mob isn't found in the world -- TLE
..()
//TODO: seperate this out
var/datum/gas_mixture/environment = loc.return_air()
if (stat != 2) //still breathing
if(stat != DEAD) //still breathing
//First, resolve location and get a breath
if(air_master.current_cycle%4==2)
//Only try to take a breath every 4 seconds, unless suffocating
spawn(0) breathe()
@@ -72,26 +67,33 @@
//Status updates, death etc.
UpdateLuminosity()
handle_regular_status_updates()
handle_regular_status_updates() //TODO: optimise ~Carn
// Update clothing
update_clothing()
//Being buckled to chairs/beds/etc
check_if_buckled()
//Temporary, whilst I finish the regenerate_icons changes ~Carn
if( update_icon ) //forces a full overlay update
update_icon = 0
regenerate_icons()
else if( lying != lying_prev )
update_icons()
//Update our name based on whether our face is obscured/disfigured
name = get_visible_name() //TODO: this was broken by the dismemberment revert ~Carn
if(client)
handle_regular_hud_updates()
//Being buckled to a chair or bed
check_if_buckled()
update_canmove() //TODO: check ~Carn
// Yup.
update_canmove()
clamp_values()
clamp_values() //TODO: check that dmage procs aren't outputing bad values outside clamp ranges ~Carn
// Grabbing
for(var/obj/item/weapon/grab/G in src)
G.process()
//TODO: optimise this.
if(isturf(loc) && rand(1,1000) == 1) //0.1% chance of playing a scary sound to someone who's in complete darkness
var/turf/currentTurf = loc
if(!currentTurf.sd_lumcount)
@@ -99,17 +101,18 @@
/mob/living/carbon/human
proc
//I've rewritten this to do what it was intended to do.
//This can probably be removed like Rockdtben suggested, but I'd like to go over the damage procs first just to be safe.
//Perhaps code view-vars to be unable to directly edit the damagevariables without using procs
clamp_values()
SetStunned(min(stunned, 20))
SetParalysis(min(paralysis, 20))
SetWeakened(min(weakened, 20))
sleeping = max(min(sleeping, 20), 0)
adjustBruteLoss(0)
adjustToxLoss(0)
adjustOxyLoss(0)
adjustFireLoss(0)
stunned = max( min(stunned,20), 0 ) // positive and under 20
paralysis = max( min(paralysis,20), 0 ) // positive and under 20
weakened = max( min(weakened,20), 0 ) // positive and under 20
sleeping = max( min(sleeping, 20), 0 ) // positive and under 20
oxyloss = max(oxyloss,0) // positive
toxloss = max(toxloss,0) // positive
bruteloss = max(bruteloss,0) // positive
fireloss = max(fireloss,0) // positive
update_mind()
if(!mind && client)
@@ -233,6 +236,7 @@
if ((HULK in mutations) && health <= 25)
mutations.Remove(HULK)
update_mutations() //update our mutation overlays
src << "\red You suddenly feel very weak."
Weaken(3)
emote("collapse")
@@ -700,14 +704,16 @@
adjustToxLoss(-1)
adjustOxyLoss(-1)
if(overeatduration > 500 && !(FAT in mutations))
src << "\red You suddenly feel blubbery!"
mutations.Add(FAT)
update_body()
if ((overeatduration < 100 && (FAT in mutations)))
src << "\blue You feel fit again!"
mutations.Remove(FAT)
update_body()
if(FAT in mutations)
if(overeatduration < 100)
src << "\blue You feel fit again!"
mutations.Remove(FAT)
update_body()
else
if(overeatduration > 500)
src << "\red You suddenly feel blubbery!"
mutations.Add(FAT)
update_body()
// nutrition decrease
if (nutrition > 0 && stat != 2)
@@ -758,33 +764,33 @@
//if(!rejuv) oxyloss++
if(!reagents.has_reagent("inaprovaline")) adjustOxyLoss(1)
if(stat != 2) stat = 1
if(stat != DEAD) stat = UNCONSCIOUS
Paralyse(5)
if (stat != 2) //Alive.
if (stat != DEAD) //Alive.
if (silent)
silent--
if (resting || sleeping || paralysis || stunned || weakened || (changeling && changeling.changeling_fakedeath)) //Stunned etc.
if (stunned > 0)
AdjustStunned(-1)
stat = 0
stat = CONSCIOUS
if (weakened > 0)
AdjustWeakened(-1)
lying = 1
stat = 0
stat = CONSCIOUS
if (paralysis > 0)
AdjustParalysis(-1)
blinded = 1
lying = 1
stat = 1
stat = UNCONSCIOUS
if (sleeping > 0)
handle_dreams()
adjustHalLoss(-5)
blinded = 1
lying = 1
stat = 1
stat = UNCONSCIOUS
if (prob(10) && health && !hal_crit)
spawn(0)
emote("snore")
@@ -792,7 +798,7 @@
if(resting)
lying = 1
stat = 0
stat = CONSCIOUS
var/h = hand
hand = 0
@@ -803,12 +809,12 @@
else //Not stunned.
lying = 0
stat = 0
stat = CONSCIOUS
else //Dead.
lying = 1
blinded = 1
stat = 2
stat = DEAD
silent = 0
if (stuttering) stuttering--
@@ -1,12 +1,12 @@
/mob/living/carbon/human/Login()
..()
update_clothing()
update_hud()
if (!isturf(src.loc))
src.client.eye = src.loc
src.client.perspective = EYE_PERSPECTIVE
if (src.stat == 2)
if (src.stat == DEAD)
src.verbs += /mob/proc/ghost
return
return
@@ -0,0 +1,603 @@
///////////////////////
//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 setup.dm): Each list for humans is (at the time of writing) of length 19.
This will hopefully be reduced as the system is refined.
var/overlays_lying[19] //For the lying down stance
var/overlays_standing[19] //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).
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...
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_glassed()
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()
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
metroid etc. Instead, it'll just return without doing any work. So no harm in calling it for metroids and such.
> 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)
> 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
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.
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
*/
//TODO: FAT -> disability not a mutation
/mob/living/carbon/human
var/list/overlays_lying[TOTAL_LAYERS]
var/list/overlays_standing[TOTAL_LAYERS]
//UPDATES OVERLAYS FROM OVERLAYS_LYING/OVERLAYS_STANDING
//this proc is messy as I was forced to include some old laggy cloaking code to it so that I don't break cloakers
//I'll work on removing that stuff by rewriting some of the cloaking stuff at a later date.
/mob/living/carbon/human/update_icons()
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 = null
if(lying) //can't be cloaked when lying. (for now)
icon = lying_icon
for(var/image/I in overlays_lying)
overlays += I
else
var/stealth = 0
if(istype(wear_suit, /obj/item/clothing/suit/space/space_ninja) && wear_suit:s_active)
stealth = 1
else
//cloaking devices. //TODO: get rid of this :<
for(var/obj/item/weapon/cloaking_device/S in list(l_hand,r_hand,belt,l_store,r_store))
if(S.active)
stealth = 1
break
if(stealth)
icon = '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
else
icon = stand_icon
for(var/image/I in overlays_standing)
overlays += I
//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" = 'dam_human.dmi', "icon_state" = "blank")
var/image/lying = image("icon" = '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]"
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()
if(stand_icon) del(stand_icon)
if(lying_icon) del(lying_icon)
if(mutantrace) return
var/husk = (HUSK in src.mutations)
var/fat = (FAT in src.mutations)
var/g = "m"
if(gender == FEMALE) g = "f"
//Base mob icon
if(husk)
stand_icon = new /icon('human.dmi', "husk_s")
lying_icon = new /icon('human.dmi', "husk_l")
else if(fat)
stand_icon = new /icon('human.dmi', "fatbody_s")
lying_icon = new /icon('human.dmi', "fatbody_l")
else
stand_icon = new /icon('human.dmi', "body_[g]_s")
lying_icon = new /icon('human.dmi', "body_[g]_l")
//Skin tone
if(s_tone >= 0)
stand_icon.Blend(rgb(s_tone, s_tone, s_tone), ICON_ADD)
lying_icon.Blend(rgb(s_tone, s_tone, s_tone), ICON_ADD)
else
stand_icon.Blend(rgb(-s_tone, -s_tone, -s_tone), ICON_SUBTRACT)
lying_icon.Blend(rgb(-s_tone, -s_tone, -s_tone), ICON_SUBTRACT)
//Eyes
var/icon/eyes_s = new/icon('human_face.dmi', "eyes_s")
var/icon/eyes_l = new/icon('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
stand_icon.Blend(new/icon('human_face.dmi', "mouth_[g]_s"), ICON_OVERLAY)
lying_icon.Blend(new/icon('human_face.dmi', "mouth_[g]_l"), ICON_OVERLAY)
//Underwear
if(underwear < 6 && underwear > 0)
if(!fat)
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
/mob/living/carbon/human/proc/update_hair(var/update_icons=1)
//Reset our hair
overlays_lying[HAIR_LAYER] = null
overlays_standing[HAIR_LAYER] = null
//mutants don't have hair. masks and helmets can obscure our hair too.
if( 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('human_face.dmi',"bald_s")
var/icon/face_lying = new /icon('human_face.dmi',"bald_l")
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(rgb(r_facial, g_facial, b_facial), ICON_ADD)
facial_l.Blend(rgb(r_facial, g_facial, b_facial), ICON_ADD)
face_standing.Blend(facial_s, ICON_OVERLAY)
face_lying.Blend(facial_l, ICON_OVERLAY)
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(rgb(r_hair, g_hair, b_hair), ICON_ADD)
hair_l.Blend(rgb(r_hair, g_hair, b_hair), ICON_ADD)
face_standing.Blend(hair_s, ICON_OVERLAY)
face_lying.Blend(hair_l, ICON_OVERLAY)
overlays_lying[HAIR_LAYER] = image(face_lying)
overlays_standing[HAIR_LAYER] = image(face_standing)
if(update_icons) update_icons()
/mob/living/carbon/human/update_mutations(var/update_icons=1)
var/fat
if( FAT in mutations )
fat = "fat"
if( w_uniform && !(w_uniform&ONESIZEFITSALL) )
src << "\red You burst out of \the [w_uniform]!"
var/obj/item/clothing/c = w_uniform
u_equip(c) //Check
if(client) //
client.screen -= c //
if(c) //
c:loc = loc //
c:dropped(src) //
c:layer = initial(c:layer) //
if( wear_suit && !(wear_suit&ONESIZEFITSALL) )
src << "\red You burst out of \the [wear_suit]!"
var/obj/item/clothing/c = wear_suit
u_equip(c)
if(client)
client.screen -= c
if(c)
c:loc = loc
c:dropped(src)
c:layer = initial(c:layer)
var/image/lying = image("icon" = 'genetics.dmi')
var/image/standing = image("icon" = 'genetics.dmi')
var/add_image = 0
for(var/mut in mutations)
switch(mut)
if(HULK)
lying.underlays += "hulk[fat]_l"
standing.underlays += "hulk[fat]_s"
add_image = 1
if(COLD_RESISTANCE)
lying.underlays += "fire[fat]_l"
standing.underlays += "fire[fat]_s"
add_image = 1
if(TK)
lying.underlays += "telekinesishead[fat]_l"
standing.underlays += "telekinesishead[fat]_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
else
overlays_lying[MUTATIONS_LAYER] = null
overlays_standing[MUTATIONS_LAYER] = null
if(update_icons) update_icons()
/mob/living/carbon/human/proc/update_mutantrace(var/update_icons=1)
var/fat
if( FAT in mutations )
fat = "fat"
switch(mutantrace)
if("lizard","golem","metroid")
overlays_lying[MUTANTRACE_LAYER] = image("icon" = 'genetics.dmi', "icon_state" = "[mutantrace][fat]_l")
overlays_standing[MUTANTRACE_LAYER] = image("icon" = 'genetics.dmi', "icon_state" = "[mutantrace][fat]_s")
if("plant")
if(stat == DEAD) //TODO
overlays_lying[MUTANTRACE_LAYER] = image("icon" = 'genetics.dmi', "icon_state" = "[mutantrace]_d")
else
overlays_lying[MUTANTRACE_LAYER] = image("icon" = 'genetics.dmi', "icon_state" = "[mutantrace][fat]_[gender]_l")
overlays_standing[MUTANTRACE_LAYER] = image("icon" = 'genetics.dmi', "icon_state" = "[mutantrace][fat]_[gender]_s")
else
overlays_lying[MUTANTRACE_LAYER] = null
overlays_standing[MUTANTRACE_LAYER] = null
update_body()
update_hair(0)
if(update_icons) update_icons()
/* --------------------------------------- */
//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_pockets(0)
update_icons()
//Hud Stuff
update_hud()
/* --------------------------------------- */
//vvvvvv UPDATE_INV PROCS vvvvvv
/mob/living/carbon/human/update_inv_w_uniform(var/update_icons=1)
if(w_uniform)
w_uniform.screen_loc = ui_iclothing //what is this?
if( istype(w_uniform, /obj/item/clothing/under) )
var/t_color = w_uniform.color
if(!t_color) t_color = icon_state
var/image/lying = image("icon_state" = "[t_color]_l")
var/image/standing = image("icon_state" = "[t_color]_s")
if( (FAT in mutations) )
lying.icon = 'uniform_fat.dmi'
standing.icon = 'uniform_fat.dmi'
else
lying.icon = 'uniform.dmi'
standing.icon = 'uniform.dmi'
if(w_uniform.blood_DNA)
lying.overlays += image("icon" = 'blood.dmi', "icon_state" = "uniformblood2")
standing.overlays += image("icon" = 'blood.dmi', "icon_state" = "uniformblood")
overlays_lying[UNIFORM_LAYER] = lying
overlays_standing[UNIFORM_LAYER] = standing
else
overlays_lying[UNIFORM_LAYER] = null
overlays_standing[UNIFORM_LAYER] = null
// 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) ) //
if(thing) //
u_equip(thing) //
if (client) //
client.screen -= thing //
//
if (thing) //
thing.loc = loc //
thing.dropped(src) //
thing.layer = initial(thing.layer)
if(update_icons) update_icons()
/mob/living/carbon/human/update_inv_wear_id(var/update_icons=1)
if(wear_id)
overlays_lying[ID_LAYER] = image("icon" = 'mob.dmi', "icon_state" = "id2")
overlays_standing[ID_LAYER] = image("icon" = 'mob.dmi', "icon_state" = "id")
wear_id.screen_loc = ui_id //TODO
else
overlays_lying[ID_LAYER] = null
overlays_standing[ID_LAYER] = null
if(update_icons) update_icons()
/mob/living/carbon/human/update_inv_gloves(var/update_icons=1)
if(gloves)
var/t_state = gloves.item_state
if(!t_state) t_state = gloves.icon_state
var/image/lying = image("icon" = 'hands.dmi', "icon_state" = "[t_state]2")
var/image/standing = image("icon" = 'hands.dmi', "icon_state" = "[t_state]")
if(gloves.blood_DNA)
lying.overlays += image("icon" = 'blood.dmi', "icon_state" = "bloodyhands2")
standing.overlays += image("icon" = 'blood.dmi', "icon_state" = "bloodyhands")
gloves.screen_loc = ui_gloves
overlays_lying[GLOVES_LAYER] = lying
overlays_standing[GLOVES_LAYER] = standing
else
if(blood_DNA)
overlays_lying[GLOVES_LAYER] = image("icon" = 'blood.dmi', "icon_state" = "bloodyhands2")
overlays_standing[GLOVES_LAYER] = image("icon" = 'blood.dmi', "icon_state" = "bloodyhands")
else
overlays_lying[GLOVES_LAYER] = null
overlays_standing[GLOVES_LAYER] = null
if(update_icons) update_icons()
/mob/living/carbon/human/update_inv_glasses(var/update_icons=1)
if(glasses)
overlays_lying[GLASSES_LAYER] = image("icon" = 'eyes.dmi', "icon_state" = "[glasses.icon_state]2")
overlays_standing[GLASSES_LAYER] = image("icon" = 'eyes.dmi', "icon_state" = "[glasses.icon_state]")
else
overlays_lying[GLASSES_LAYER] = null
overlays_standing[GLASSES_LAYER] = null
if(update_icons) update_icons()
/mob/living/carbon/human/update_inv_ears(var/update_icons=1)
if(ears)
overlays_lying[EARS_LAYER] = image("icon" = 'ears.dmi', "icon_state" = "[ears.icon_state]2")
overlays_standing[EARS_LAYER] = image("icon" = 'ears.dmi', "icon_state" = "[ears.icon_state]")
else
overlays_lying[EARS_LAYER] = null
overlays_standing[EARS_LAYER] = null
if(update_icons) update_icons()
/mob/living/carbon/human/update_inv_shoes(var/update_icons=1)
if(shoes)
var/image/lying = image("icon" = 'feet.dmi', "icon_state" = "[shoes.icon_state]2")
var/image/standing = image("icon" = 'feet.dmi', "icon_state" = "[shoes.icon_state]")
if(shoes.blood_DNA)
lying.overlays += image("icon" = 'blood.dmi', "icon_state" = "shoeblood2")
standing.overlays += image("icon" = 'blood.dmi', "icon_state" = "shoeblood")
overlays_lying[SHOES_LAYER] = lying
overlays_standing[SHOES_LAYER] = standing
else
overlays_lying[SHOES_LAYER] = null
overlays_standing[SHOES_LAYER] = null
if(update_icons) update_icons()
/mob/living/carbon/human/update_inv_s_store(var/update_icons=1)
if(s_store)
var/t_state = s_store.item_state
if(!t_state) t_state = s_store.icon_state
overlays_lying[SUIT_STORE_LAYER] = image("icon" = 'belt_mirror.dmi', "icon_state" = "[t_state]2")
overlays_standing[SUIT_STORE_LAYER] = image("icon" = 'belt_mirror.dmi', "icon_state" = "[t_state]")
s_store.screen_loc = ui_sstore1 //TODO
else
overlays_lying[SUIT_STORE_LAYER] = null
overlays_standing[SUIT_STORE_LAYER] = null
if(update_icons) update_icons()
/mob/living/carbon/human/update_inv_head(var/update_icons=1)
if(head)
head.screen_loc = ui_head //TODO
var/image/lying
var/image/standing
if(istype(head,/obj/item/clothing/head/kitty))
lying = image("icon" = head:mob2)
standing = image("icon" = head:mob)
else
lying = image("icon" = 'head.dmi', "icon_state" = "[head.icon_state]2")
standing = image("icon" = 'head.dmi', "icon_state" = "[head.icon_state]")
if(head.blood_DNA)
lying.overlays += image("icon" = 'blood.dmi', "icon_state" = "helmetblood2")
standing.overlays += image("icon" = 'blood.dmi', "icon_state" = "helmetblood")
overlays_lying[HEAD_LAYER] = lying
overlays_standing[HEAD_LAYER] = standing
else
overlays_lying[HEAD_LAYER] = null
overlays_standing[HEAD_LAYER] = null
if(update_icons) update_icons()
/mob/living/carbon/human/update_inv_belt(var/update_icons=1)
if(belt)
belt.screen_loc = ui_belt //TODO
var/t_state = belt.item_state
if(!t_state) t_state = belt.icon_state
overlays_lying[BELT_LAYER] = image("icon" = 'belt.dmi', "icon_state" = "[t_state]2")
overlays_standing[BELT_LAYER] = image("icon" = 'belt.dmi', "icon_state" = "[t_state]")
else
overlays_lying[BELT_LAYER] = null
overlays_standing[BELT_LAYER] = null
if(update_icons) update_icons()
/mob/living/carbon/human/update_inv_wear_suit(var/update_icons=1)
if( wear_suit && istype(wear_suit, /obj/item/clothing/suit) ) //TODO check this
wear_suit.screen_loc = ui_oclothing //TODO
var/image/lying = image("icon" = 'suit.dmi', "icon_state" = "[wear_suit.icon_state]2")
var/image/standing = image("icon" = 'suit.dmi', "icon_state" = "[wear_suit.icon_state]")
if( istype(wear_suit, /obj/item/clothing/suit/straight_jacket) ) //TODO
if (handcuffed) //
handcuffed.loc = loc //
handcuffed.layer = initial(handcuffed.layer) //
handcuffed = null //
if (l_hand || r_hand) //
var/h = hand //
hand = 1 //
drop_item() //
hand = 0 //
drop_item() //
hand = h //
if(wear_suit.blood_DNA)
var/t_state
if( istype(wear_suit, /obj/item/clothing/suit/armor/vest || /obj/item/clothing/suit/wcoat) )
t_state = "armor"
else if( istype(wear_suit, /obj/item/clothing/suit/det_suit || /obj/item/clothing/suit/labcoat) )
t_state = "coat"
else
t_state = "suit"
lying.overlays += image("icon" = 'blood.dmi', "icon_state" = "[t_state]blood2")
standing.overlays += image("icon" = 'blood.dmi', "icon_state" = "[t_state]blood")
overlays_lying[SUIT_LAYER] = lying
overlays_standing[SUIT_LAYER] = standing
else
overlays_lying[SUIT_LAYER] = null
overlays_standing[SUIT_LAYER] = null
if(update_icons) update_icons()
/mob/living/carbon/human/update_inv_pockets(var/update_icons=1)
if(l_store) l_store.screen_loc = ui_storage1 //TODO
if(r_store) r_store.screen_loc = ui_storage2 //TODO
if(update_icons) update_icons()
/mob/living/carbon/human/update_inv_wear_mask(var/update_icons=1)
if( wear_mask && istype(wear_mask, /obj/item/clothing/mask) )
wear_mask.screen_loc = ui_mask //TODO
var/image/lying = image("icon" = 'mask.dmi', "icon_state" = "[wear_mask.icon_state]2")
var/image/standing = image("icon" = 'mask.dmi', "icon_state" = "[wear_mask.icon_state]")
if( !istype(wear_mask, /obj/item/clothing/mask/cigarette) && wear_mask.blood_DNA )
lying.overlays += image("icon" = 'blood.dmi', "icon_state" = "maskblood2")
standing.overlays += image("icon" = 'blood.dmi', "icon_state" = "maskblood")
overlays_lying[FACEMASK_LAYER] = lying
overlays_standing[FACEMASK_LAYER] = standing
else
overlays_lying[FACEMASK_LAYER] = null
overlays_standing[FACEMASK_LAYER] = null
if(update_icons) update_icons()
/mob/living/carbon/human/update_inv_back(var/update_icons=1)
if(back)
back.screen_loc = ui_back //TODO
overlays_lying[BACK_LAYER] = image("icon" = 'back.dmi', "icon_state" = "[back.icon_state]2")
overlays_standing[BACK_LAYER] = image("icon" = 'back.dmi', "icon_state" = "[back.icon_state]")
else
overlays_lying[BACK_LAYER] = null
overlays_standing[BACK_LAYER] = null
if(update_icons) update_icons()
/mob/living/carbon/human/update_hud() //TODO: do away with this if possible
if(client)
client.screen |= contents
hud_used.other_update() //Updates the screenloc of the items on the 'other' inventory bar
/mob/living/carbon/human/update_inv_handcuffed(var/update_icons=1)
if(handcuffed)
pulling = null //TODO: should be handled elsewhere
overlays_lying[HANDCUFF_LAYER] = image("icon" = 'mob.dmi', "icon_state" = "handcuff2")
overlays_standing[HANDCUFF_LAYER] = image("icon" = 'mob.dmi', "icon_state" = "handcuff1")
else
overlays_lying[HANDCUFF_LAYER] = null
overlays_standing[HANDCUFF_LAYER] = null
if(update_icons) update_icons()
/mob/living/carbon/human/update_inv_r_hand(var/update_icons=1)
if(r_hand)
r_hand.screen_loc = ui_rhand //TODO
var/t_state = r_hand.item_state
if(!t_state) t_state = r_hand.icon_state
overlays_standing[R_HAND_LAYER] = image("icon" = 'items_righthand.dmi', "icon_state" = "[t_state]")
else
overlays_standing[R_HAND_LAYER] = null
if(update_icons) update_icons()
/mob/living/carbon/human/update_inv_l_hand(var/update_icons=1)
if(l_hand)
l_hand.screen_loc = ui_lhand //TODO
var/t_state = l_hand.item_state
if(!t_state) t_state = l_hand.icon_state
overlays_standing[L_HAND_LAYER] = image("icon" = 'items_lefthand.dmi', "icon_state" = "[t_state]")
else
overlays_standing[L_HAND_LAYER] = null
if(update_icons) update_icons()
@@ -1,12 +1,12 @@
/mob/living/carbon/metroid/Login()
..()
update_clothing()
update_hud()
if (!isturf(src.loc))
src.client.eye = src.loc
src.client.perspective = EYE_PERSPECTIVE
if (src.stat == 2)
if (src.stat == DEAD)
src.verbs += /mob/proc/ghost
return
return
@@ -9,7 +9,7 @@
real_name = name
spawn (1)
update_clothing()
regenerate_icons()
src << "\blue Your icons have been generated!"
..()
@@ -283,43 +283,6 @@
return
/mob/living/carbon/metroid/update_clothing()
..()
if (monkeyizing)
return
if (client)
if (i_select)
if (intent)
client.screen += hud_used.intents
var/list/L = dd_text2list(intent, ",")
L[1] += ":-11"
i_select.screen_loc = dd_list2text(L,",") //ICONS4, FUCKING SHIT
else
i_select.screen_loc = null
if (m_select)
if (m_int)
client.screen += hud_used.mov_int
var/list/L = dd_text2list(m_int, ",")
L[1] += ":-11"
m_select.screen_loc = dd_list2text(L,",") //ICONS4, FUCKING SHIT
else
m_select.screen_loc = null
for (var/mob/M in viewers(1, src))
if ((M.client && M.machine == src))
spawn (0)
show_inv(M)
return
/mob/living/carbon/metroid/attack_metroid(mob/living/carbon/metroid/M as mob)
if (!ticker)
M << "You cannot attack people before the game has started."
@@ -490,8 +453,10 @@
G.assailant = M
if (M.hand)
M.l_hand = G
M.update_inv_l_hand()
else
M.r_hand = G
M.update_inv_r_hand()
G.layer = 20
G.affecting = src
grabbed_by += G
@@ -594,8 +559,10 @@
G.assailant = M
if (M.hand)
M.l_hand = G
M.update_inv_l_hand()
else
M.r_hand = G
M.update_inv_r_hand()
G.layer = 20
G.affecting = src
grabbed_by += G
@@ -0,0 +1 @@
//no special icon processing
@@ -4,13 +4,8 @@
src.adding = list( )
src.other = list( )
src.intents = list( )
src.mon_blo = list( )
src.m_ints = list( )
src.mov_int = list( )
src.vimpaired = list( )
src.darkMask = list( )
src.intent_small_hud_objects = list( )
//var/icon/blocked = icon(ui_style,"blocked")
@@ -58,41 +53,6 @@
src.adding += using
action_intent = using
//intent small hud objects
using = new src.h_type( src )
using.name = "help"
using.icon = ui_style
using.icon_state = "help_small"
using.screen_loc = ui_help_small
using.layer = 21
src.intent_small_hud_objects += using
using = new src.h_type( src )
using.name = "disarm"
using.icon = ui_style
using.icon_state = "disarm_small"
using.screen_loc = ui_disarm_small
using.layer = 21
src.intent_small_hud_objects += using
using = new src.h_type( src )
using.name = "grab"
using.icon = ui_style
using.icon_state = "grab_small"
using.screen_loc = ui_grab_small
using.layer = 21
src.intent_small_hud_objects += using
using = new src.h_type( src )
using.name = "harm"
using.icon = ui_style
using.icon_state = "harm_small"
using.screen_loc = ui_harm_small
using.layer = 21
src.intent_small_hud_objects += using
//end intent small hud objects
using = new src.h_type( src )
using.name = "mov_intent"
using.dir = SOUTHWEST
+9 -11
View File
@@ -11,24 +11,18 @@
/mob/living/carbon/monkey/Life()
set invisibility = 0
set background = 1
if (src.monkeyizing)
return
if (src.monkeyizing) return
..()
var/datum/gas_mixture/environment // Added to prevent null location errors-- TLE
if(src.loc)
environment = loc.return_air()
if (src.stat != 2) //still breathing
if (src.stat != DEAD) //still breathing
//First, resolve location and get a breath
if(air_master.current_cycle%4==2)
//Only try to take a breath every 4 seconds, unless suffocating
breathe()
else //Still give containing object the chance to interact
if(istype(loc, /obj/))
var/obj/location_as_object = loc
@@ -69,12 +63,16 @@
//Being buckled to a chair or bed
check_if_buckled()
//Temporary, whilst I finish the regenerate_icons changes ~Carn
if( update_icon ) //forces a full overlay update
update_icon = 0
regenerate_icons()
else if( lying != lying_prev )
update_icons()
// Yup.
update_canmove()
// Update clothing
update_clothing()
clamp_values()
// Grabbing
+3 -46
View File
@@ -1,54 +1,11 @@
/mob/living/carbon/monkey/Login()
..()
update_clothing()
/*
if (!( src.primary ))
var/t1 = rand(1000, 1500)
dna_ident += t1
if (dna_ident > 65536.0)
dna_ident = rand(1, 1500)
src.primary = new /datum/dna( null )
src.primary.uni_identity = text("[]", dna_ident)
while(length(src.primary.uni_identity) < 4)
src.primary.uni_identity = text("0[]", src.primary.uni_identity)
var/t2 = text("[]", rand(1, 256))
if (length(t2) < 2)
src.primary.uni_identity = text("[]0[]", src.primary.uni_identity, t2)
else
src.primary.uni_identity = text("[][]", src.primary.uni_identity, t2)
t2 = text("[]", rand(1, 256))
if (length(t2) < 2)
src.primary.uni_identity = text("[]0[]", src.primary.uni_identity, t2)
else
src.primary.uni_identity = text("[][]", src.primary.uni_identity, t2)
t2 = text("[]", rand(1, 256))
if (length(t2) < 2)
src.primary.uni_identity = text("[]0[]", src.primary.uni_identity, t2)
else
src.primary.uni_identity = text("[][]", src.primary.uni_identity, t2)
t2 = text("[]", rand(1, 256))
if (length(t2) < 2)
src.primary.uni_identity = text("[]0[]", src.primary.uni_identity, t2)
else
src.primary.uni_identity = text("[][]", src.primary.uni_identity, t2)
t2 = (src.gender == "male" ? text("[]", rand(1, 124)) : text("[]", rand(127, 250)))
if (length(t2) < 2)
src.primary.uni_identity = text("[]0[]", src.primary.uni_identity, t2)
else
src.primary.uni_identity = text("[][]", src.primary.uni_identity, t2)
src.primary.spec_identity = "2B6696D2B127E5A4"
src.primary.struc_enzymes = "CDEAF5B90AADBC6BA8033DB0A7FD613FA"
src.primary.unique_enzymes = "C8FFFE7EC09D80AEDEDB9A5A0B4085B61"
src.primary.n_chromo = 16
*/
update_hud()
if (!isturf(src.loc))
src.client.eye = src.loc
src.client.perspective = EYE_PERSPECTIVE
if (src.stat == 2)
if (src.stat == DEAD)
src.verbs += /mob/proc/ghost
if(src.name == "monkey")
src.name = text("monkey ([rand(1, 1000)])")
src.real_name = src.name
return
return
@@ -213,8 +213,10 @@
G.assailant = M
if (M.hand)
M.l_hand = G
M.update_inv_l_hand()
else
M.r_hand = G
M.update_inv_r_hand()
G.layer = 20
G.affecting = src
grabbed_by += G
@@ -286,8 +288,10 @@
G.assailant = M
if (M.hand)
M.l_hand = G
M.update_inv_l_hand()
else
M.r_hand = G
M.update_inv_r_hand()
G.layer = 20
G.affecting = src
grabbed_by += G
@@ -399,82 +403,7 @@
stat("Genetic Damage Time", changeling.geneticdamage)
return
/mob/living/carbon/monkey/update_clothing()
if(buckled)
if(istype(buckled, /obj/structure/stool/bed/chair))
lying = 0
else
lying = 1
if(update_icon) // Skie
..()
for(var/i in overlays)
overlays -= i
if (!( lying ))
icon_state = "monkey1"
else
icon_state = "monkey0"
if (wear_mask)
if (istype(wear_mask, /obj/item/clothing/mask))
var/t1 = wear_mask.icon_state
overlays += image("icon" = 'monkey.dmi', "icon_state" = text("[][]", t1, (!( lying ) ? null : "2")), "layer" = layer)
wear_mask.screen_loc = ui_monkey_mask
if (r_hand)
if(update_icon)
overlays += image("icon" = 'items_righthand.dmi', "icon_state" = r_hand.item_state ? r_hand.item_state : r_hand.icon_state, "layer" = layer)
r_hand.screen_loc = ui_rhand
if (l_hand)
if(update_icon)
overlays += image("icon" = 'items_lefthand.dmi', "icon_state" = l_hand.item_state ? l_hand.item_state : l_hand.icon_state, "layer" = layer)
l_hand.screen_loc = ui_lhand
if (back)
var/t1 = back.icon_state //apparently tables make me upset and cause my dreams to shatter
overlays += image("icon" = 'back.dmi', "icon_state" = text("[][]", t1, (!( lying ) ? null : "2")), "layer" = layer)
back.screen_loc = ui_monkey_back
if (handcuffed && update_icon)
pulling = null
if (!( lying ))
overlays += image("icon" = 'monkey.dmi', "icon_state" = "handcuff1", "layer" = layer)
else
overlays += image("icon" = 'monkey.dmi', "icon_state" = "handcuff2", "layer" = layer)
if (client)
client.screen -= contents
client.screen += contents
client.screen -= hud_used.m_ints
client.screen -= hud_used.mov_int
if (i_select)
if (intent)
client.screen += hud_used.m_ints
var/list/L = dd_text2list(intent, ",")
L[1] += ":-11"
i_select.screen_loc = dd_list2text(L,",") //ICONS, FUCKING SHIT//What
else
i_select.screen_loc = null
if (m_select)
if (m_int)
client.screen += hud_used.mov_int
var/list/L = dd_text2list(m_int, ",")
L[1] += ":-11"
m_select.screen_loc = dd_list2text(L,",") //ICONS, FUCKING SHIT//the fuck
else
m_select.screen_loc = null
for(var/mob/M in viewers(1, src))
if ((M.client && M.machine == src))
spawn( 0 )
show_inv(M)
return
return
/mob/living/carbon/monkey/Move()
if ((!( buckled ) || buckled.loc != loc))
@@ -760,8 +689,8 @@
if ((M.client && !( M.blinded )))
M.show_message(text("[] is now running on internals.", target), 1)
else
source.update_clothing()
target.update_clothing()
source.regenerate_icons()
target.regenerate_icons()
del(src)
return
@@ -0,0 +1,89 @@
/mob/living/carbon/monkey
var/list/overlays_lying[M_TOTAL_LAYERS]
var/list/overlays_standing[M_TOTAL_LAYERS]
/mob/living/carbon/monkey/regenerate_icons()
..()
update_inv_wear_mask(0)
update_inv_back(0)
update_inv_r_hand(0)
update_inv_l_hand(0)
update_inv_handcuffed(0)
update_icons()
//Hud Stuff
update_hud()
return
/mob/living/carbon/monkey/update_icons()
update_hud()
lying_prev = lying //so we don't update overlays for lying/standing unless our stance changes again
overlays = null
if(lying)
icon_state = "monkey0"
for(var/image/I in overlays_lying)
overlays += I
else
icon_state = "monkey1"
for(var/image/I in overlays_standing)
overlays += I
////////
/mob/living/carbon/monkey/update_inv_wear_mask(var/update_icons=1)
if( wear_mask && istype(wear_mask, /obj/item/clothing/mask) )
overlays_lying[M_MASK_LAYER] = image("icon" = 'monkey.dmi', "icon_state" = "[wear_mask.icon_state]2")
overlays_standing[M_MASK_LAYER] = image("icon" = 'monkey.dmi', "icon_state" = "[wear_mask.icon_state]")
wear_mask.screen_loc = ui_monkey_mask
else
overlays_lying[M_MASK_LAYER] = null
overlays_standing[M_MASK_LAYER] = null
if(update_icons) update_icons()
/mob/living/carbon/monkey/update_inv_r_hand(var/update_icons=1)
if(r_hand)
var/t_state = r_hand.item_state
if(!t_state) t_state = r_hand.icon_state
overlays_standing[M_R_HAND_LAYER] = image("icon" = 'items_righthand.dmi', "icon_state" = t_state)
r_hand.screen_loc = ui_rhand
else
overlays_standing[M_R_HAND_LAYER] = null
if(update_icons) update_icons()
/mob/living/carbon/monkey/update_inv_l_hand(var/update_icons=1)
if(l_hand)
var/t_state = l_hand.item_state
if(!t_state) t_state = l_hand.icon_state
overlays_standing[M_L_HAND_LAYER] = image("icon" = 'items_lefthand.dmi', "icon_state" = t_state)
l_hand.screen_loc = ui_lhand
else
overlays_standing[M_L_HAND_LAYER] = null
if(update_icons) update_icons()
/mob/living/carbon/monkey/update_inv_back(var/update_icons=1)
if(back)
overlays_lying[M_BACK_LAYER] = image("icon" = 'back.dmi', "icon_state" = "[back.icon_state]2")
overlays_standing[M_BACK_LAYER] = image("icon" = 'back.dmi', "icon_state" = "[back.icon_state]")
back.screen_loc = ui_monkey_back
else
overlays_lying[M_BACK_LAYER] = null
overlays_standing[M_BACK_LAYER] = null
if(update_icons) update_icons()
/mob/living/carbon/monkey/update_inv_handcuffed(var/update_icons=1)
if(handcuffed)
pulling = null
overlays_lying[M_HANDCUFF_LAYER] = image("icon" = 'monkey.dmi', "icon_state" = "handcuff2")
overlays_standing[M_HANDCUFF_LAYER] = image("icon" = 'monkey.dmi', "icon_state" = "handcuff1")
else
overlays_lying[M_HANDCUFF_LAYER] = null
overlays_standing[M_HANDCUFF_LAYER] = null
if(update_icons) update_icons()
/mob/living/carbon/monkey/update_hud()
if (client)
client.screen |= contents
+13 -15
View File
@@ -41,11 +41,8 @@
var/extradam = 0 //added to when organ is at max dam
for(var/datum/organ/external/affecting in H.organs)
if(!affecting) continue
if(affecting.take_damage(0, divided_damage+extradam))
extradam = 0
else
extradam += divided_damage
H.UpdateDamageIcon()
if(affecting.take_damage(0, divided_damage+extradam)) //TODO: fix the extradam stuff. Or, ebtter yet...rewrite this entire proc ~Carn
H.UpdateDamageIcon()
H.updatehealth()
return 1
else if(istype(src, /mob/living/carbon/monkey))
@@ -173,19 +170,20 @@
/mob/living/proc/check_if_buckled()
if (buckled)
if(buckled == /obj/structure/stool/bed || istype(buckled, /obj/machinery/conveyor))
lying = 1
if(lying)
var/h = hand
hand = 0
drop_item()
hand = 1
drop_item()
hand = h
density = 1
if( istype(buckled, /obj/structure/stool/bed/chair) )
lying = 0
else
lying = 1
else
density = !lying
if(lying)
var/h = hand
hand = 0
drop_item()
hand = 1
drop_item()
hand = h
/mob/living/proc/Examine_OOC()
set name = "Examine Meta-Info (OOC)"
+1 -1
View File
@@ -4,7 +4,7 @@
blood.override = 1
client.images += blood
..()
update_clothing()
regenerate_icons()
for(var/S in src.client.screen)
del(S)
src.flash = new /obj/screen( null )
@@ -3,10 +3,6 @@
src.adding = list( )
src.other = list( )
src.intents = list( )
src.mon_blo = list( )
src.m_ints = list( )
src.mov_int = list( )
src.vimpaired = list( )
src.darkMask = list( )
@@ -1,7 +1,7 @@
/mob/living/silicon/robot/Login(var/syndie = 0)
..()
update_clothing()
regenerate_icons()
if (!isturf(src.loc))
src.client.eye = src.loc
@@ -579,8 +579,10 @@
G.assailant = M
if (M.hand)
M.l_hand = G
M.update_inv_l_hand()
else
M.r_hand = G
M.update_inv_r_hand()
G.layer = 20
G.affecting = src
grabbed_by += G
@@ -712,8 +714,10 @@
cell.layer = 20
if (user.hand )
user.l_hand = cell
user.update_inv_l_hand()
else
user.r_hand = cell
user.update_inv_r_hand()
cell.add_fingerprint(user)
cell.updateicon()
+15 -15
View File
@@ -100,14 +100,13 @@
// organStructure.ProcessOrgans()
return
/mob/proc/update_clothing()
return
/mob/proc/restrained()
if (handcuffed)
return 1
return
//Used by monkeys, *chimpers* //TODO: eliminate this convoluted proc it's incredibly shitty. ~Carn
/mob/proc/db_click(text, t1)
var/obj/item/weapon/W = equipped()
switch(text)
@@ -119,6 +118,7 @@
u_equip(W)
wear_mask = W
W.equipped(src, text)
update_inv_wear_mask()
if("back")
if (back)
return
@@ -132,15 +132,8 @@
u_equip(W)
back = W
W.equipped(src, text)
if("back")
if ((back || !( istype(W, /obj/item/weapon) )))
return
if (!( W.flags & 1 ))
return
u_equip(W)
back = W
W.equipped(src, text)
else
update_inv_back()
return
@@ -173,6 +166,7 @@
if (W)
u_equip(W)
update_icons()
if (client)
client.screen -= W
if (W)
@@ -193,7 +187,7 @@
u_equip(item)
//if (client)
// client.screen -= item
//update_clothing()
//regenerate_icons()
return
/mob/proc/get_active_hand()
@@ -213,19 +207,21 @@
I.loc = src
if (hand)
l_hand = I
update_inv_l_hand()
else
r_hand = I
update_inv_r_hand()
I.layer = 20
update_clothing()
/mob/proc/put_in_inactive_hand(var/obj/item/I)
I.loc = src
if (!hand)
l_hand = I
update_inv_l_hand()
else
r_hand = I
update_inv_r_hand()
I.layer = 20
update_clothing()
/mob/proc/reset_view(atom/A)
if (client)
@@ -277,15 +273,19 @@
/mob/proc/u_equip(W as obj)
if (W == r_hand)
r_hand = null
update_inv_r_hand()
else if (W == l_hand)
l_hand = null
update_inv_l_hand()
else if (W == handcuffed)
handcuffed = null
update_inv_handcuffed()
else if (W == back)
back = null
update_inv_back()
else if (W == wear_mask)
wear_mask = null
update_clothing()
update_inv_wear_mask()
return
+16 -15
View File
@@ -73,34 +73,35 @@
var/other_mobs = null
var/memory = ""
var/poll_answer = 0.0
var/sdisabilities = 0//Carbon
var/disabilities = 0//Carbon
var/sdisabilities = 0 //Carbon
var/disabilities = 0 //Carbon
var/atom/movable/pulling = null
var/stat = 0.0
var/next_move = null
var/prev_move = null
var/monkeyizing = null//Carbon
var/monkeyizing = null //Carbon
var/other = 0.0
var/hand = null
var/eye_blind = null//Carbon
var/eye_blurry = null//Carbon
var/ear_deaf = null//Carbon
var/ear_damage = null//Carbon
var/stuttering = null//Carbon
var/eye_blind = null //Carbon
var/eye_blurry = null //Carbon
var/ear_deaf = null //Carbon
var/ear_damage = null //Carbon
var/stuttering = null //Carbon
var/real_name = null
var/original_name = null //Original name is only used in ghost chat! It is not to be edited by anything!
var/blinded = null
var/bhunger = 0//Carbon
var/bhunger = 0 //Carbon
var/ajourn = 0
var/rejuv = null
var/druggy = 0//Carbon
var/confused = 0//Carbon
var/druggy = 0 //Carbon
var/confused = 0 //Carbon
var/antitoxs = null
var/plasma = null
var/sleeping = 0.0//Carbon
var/resting = 0.0//Carbon
var/lying = 0.0
var/canmove = 1.0
var/sleeping = 0 //Carbon
var/resting = 0 //Carbon
var/lying = 0
var/lying_prev = 0
var/canmove = 1
var/eye_stat = null//Living, potentially Carbon
var/lastpuke = 0
var/unacidable = 0
+2
View File
@@ -273,10 +273,12 @@ It's fairly easy to fix if dealing with single letters but not so much with comp
if(!r_hand)
I.loc = src
r_hand = I
update_inv_r_hand()
I.layer = 20
else if(!l_hand)
I.loc = src
l_hand = I
update_inv_l_hand()
I.layer = 20
else
I.loc = get_turf(src)
@@ -754,9 +754,6 @@ datum/preferences
backbag = 1 //Same as above
character.backbag = backbag
character.update_face()
character.update_body()
if(!safety)//To prevent run-time errors due to null datum when using randomize_appearance_for()
spawn(10)
if(character&&character.client)
+22 -27
View File
@@ -22,13 +22,14 @@
var/icon_name = null
var/body_part = null
var/damage_state = "00"
var/brutestate = 0
var/burnstate = 0
var/brute_dam = 0
var/burn_dam = 0
var/bandaged = 0
// var/bandaged = 0
var/max_damage = 0
var/wound_size = 0
var/max_size = 0
// var/wound_size = 0
// var/max_size = 0
proc/take_damage(brute, burn)
@@ -55,8 +56,7 @@
else
return 0
var/result = src.update_icon()
return result
return update_icon()
proc/heal_damage(brute, burn)
@@ -71,40 +71,34 @@
// new damage icon system
// returns just the brute/burn damage code
proc/damage_state_text()
var/tburn = 0
var/tbrute = 0
proc/update_icon()
var/tburn
var/tbrute
if(burn_dam ==0)
tburn =0
else if (src.burn_dam < (src.max_damage * 0.25 / 2))
tburn = 0
else if (src.burn_dam < (src.max_damage * 0.33))
tburn = 1
else if (src.burn_dam < (src.max_damage * 0.75 / 2))
else if (src.burn_dam < (src.max_damage * 0.66))
tburn = 2
else
tburn = 3
if (src.brute_dam == 0)
tbrute = 0
else if (src.brute_dam < (src.max_damage * 0.25 / 2))
else if (src.brute_dam < (src.max_damage * 0.33))
tbrute = 1
else if (src.brute_dam < (src.max_damage * 0.75 / 2))
else if (src.brute_dam < (src.max_damage * 0.66))
tbrute = 2
else
tbrute = 3
return "[tbrute][tburn]"
// new damage icon system
// adjusted to set damage_state to brute/burn code only (without r_name0 as before)
proc/update_icon()
var/n_is = src.damage_state_text()
if (n_is != src.damage_state)
src.damage_state = n_is
if((tbrute != brutestate) || (tburn != burnstate))
brutestate = tbrute
burnstate = tburn
return 1
return 0
proc/getDisplayName()
switch(src.name)
if("l_leg")
@@ -119,9 +113,10 @@
return src.name
/*
/****************************************************
INTERNAL ORGANS
****************************************************/
/datum/organ/internal
name = "internal"
*/
+2 -4
View File
@@ -325,6 +325,7 @@
if("walk")
usr.m_intent = "run"
usr.hud_used.move_intent.icon_state = "running"
if(istype(usr,/mob/living/carbon/alien/humanoid)) usr.update_icons()
if("m_intent")
if (!( usr.m_int ))
switch(usr.m_intent)
@@ -420,22 +421,18 @@
usr.a_intent = "help"
usr.hud_used.action_intent.icon_state = "help"
usr.hud_used.show_intent_icons = 0
usr.client.screen -= usr.hud_used.intent_small_hud_objects
if("harm")
usr.a_intent = "hurt"
usr.hud_used.action_intent.icon_state = "harm"
usr.hud_used.show_intent_icons = 0
usr.client.screen -= usr.hud_used.intent_small_hud_objects
if("grab")
usr.a_intent = "grab"
usr.hud_used.action_intent.icon_state = "grab"
usr.hud_used.show_intent_icons = 0
usr.client.screen -= usr.hud_used.intent_small_hud_objects
if("disarm")
usr.a_intent = "disarm"
usr.hud_used.action_intent.icon_state = "disarm"
usr.hud_used.show_intent_icons = 0
usr.client.screen -= usr.hud_used.intent_small_hud_objects
if("pull")
usr.pulling = null
if("throw")
@@ -541,6 +538,7 @@
usr.resting = !( usr.resting )
usr << "\blue You are now [(usr.resting) ? "resting" : "getting up"]"
/mob/living/verb/resist()
set name = "Resist"
set category = "IC"
+3 -25
View File
@@ -22,31 +22,9 @@
var/obj/item/inventory_head
var/obj/item/inventory_back
/mob/living/simple_animal/corgi/update_clothing()
overlays = list()
if(inventory_head)
var/head_icon_state = inventory_head.icon_state
if(health <= 0)
head_icon_state += "2"
var/icon/head_icon = icon('corgi_head.dmi',head_icon_state)
if(head_icon)
overlays += head_icon
if(inventory_back)
var/back_icon_state = inventory_back.icon_state
if(health <= 0)
back_icon_state += "2"
var/icon/back_icon = icon('corgi_back.dmi',back_icon_state)
if(back_icon)
overlays += back_icon
return
/mob/living/simple_animal/corgi/Life()
..()
update_clothing()
regenerate_icons()
/mob/living/simple_animal/corgi/show_inv(mob/user as mob)
user.machine = src
@@ -179,7 +157,7 @@
usr.drop_item()
item_to_add.loc = src
src.inventory_head = item_to_add
update_clothing()
regenerate_icons()
//Various hats and items (worn on his head) change Ian's behaviour. His attributes are reset when a HAT is removed.
@@ -267,7 +245,7 @@
usr.drop_item()
item_to_add.loc = src
src.inventory_back = item_to_add
update_clothing()
regenerate_icons()
//show_inv(usr) //Commented out because changing Ian's name and then calling up his inventory opens a new inventory...which is annoying.
else
+2
View File
@@ -279,8 +279,10 @@
G.assailant = M
if (M.hand)
M.l_hand = G
M.update_inv_l_hand()
else
M.r_hand = G
M.update_inv_r_hand()
G.layer = 20
G.affecting = src
grabbed_by += G
@@ -0,0 +1,21 @@
/mob/living/simple_animal/corgi/regenerate_icons()
overlays = list()
if(inventory_head)
var/head_icon_state = inventory_head.icon_state
if(health <= 0)
head_icon_state += "2"
var/icon/head_icon = icon('corgi_head.dmi',head_icon_state)
if(head_icon)
overlays += head_icon
if(inventory_back)
var/back_icon_state = inventory_back.icon_state
if(health <= 0)
back_icon_state += "2"
var/icon/back_icon = icon('corgi_back.dmi',back_icon_state)
if(back_icon)
overlays += back_icon
return
+6 -7
View File
@@ -5,7 +5,7 @@
if (W==w_uniform) // will be teared
continue
drop_from_slot(W)
update_clothing()
regenerate_icons()
monkeyizing = 1
canmove = 0
stunned = 1
@@ -64,7 +64,7 @@
return
for(var/obj/item/W in src)
drop_from_slot(W)
update_clothing()
regenerate_icons()
monkeyizing = 1
canmove = 0
icon = null
@@ -152,7 +152,7 @@
return
for(var/obj/item/W in src)
drop_from_slot(W)
update_clothing()
regenerate_icons()
monkeyizing = 1
canmove = 0
icon = null
@@ -163,7 +163,6 @@
//client.screen -= main_hud1.contents
client.screen -= hud_used.contents
client.screen -= hud_used.adding
client.screen -= hud_used.mon_blo
client.screen -= list( oxygen, throw_icon, i_select, m_select, toxin, internals, fire, hands, healths, pullin, blind, flash, rest, sleep, mach )
client.screen -= list( zone_sel, oxygen, throw_icon, i_select, m_select, toxin, internals, fire, hands, healths, pullin, blind, flash, rest, sleep, mach )
var/mob/living/silicon/robot/O = new /mob/living/silicon/robot( loc )
@@ -216,7 +215,7 @@
return
for(var/obj/item/W in src)
drop_from_slot(W)
update_clothing()
regenerate_icons()
monkeyizing = 1
canmove = 0
icon = null
@@ -256,7 +255,7 @@
return
for(var/obj/item/W in src)
drop_from_slot(W)
update_clothing()
regenerate_icons()
monkeyizing = 1
canmove = 0
icon = null
@@ -307,7 +306,7 @@
return
for(var/obj/item/W in src)
drop_from_slot(W)
update_clothing()
regenerate_icons()
monkeyizing = 1
canmove = 0
icon = null
+62
View File
@@ -0,0 +1,62 @@
//Most of these are defined at this level to reduce on checks elsewhere in the code.
//Having them here also makes for a nice reference list of the various overlay-updating procs available
/mob/proc/regenerate_icons() //TODO: phase this out completely if possible
return
/mob/proc/update_icons()
return
/mob/proc/update_hud()
return
/mob/proc/update_inv_handcuffed()
return
/mob/proc/update_inv_back()
return
/mob/proc/update_inv_l_hand()
return
/mob/proc/update_inv_r_hand()
return
/mob/proc/update_inv_wear_mask()
return
/mob/proc/update_inv_wear_suit()
return
/mob/proc/update_inv_w_uniform()
return
/mob/proc/update_inv_belt()
return
/mob/proc/update_inv_head()
return
/mob/proc/update_inv_gloves()
return
/mob/proc/update_mutations()
return
/mob/proc/update_inv_wear_id()
return
/mob/proc/update_inv_shoes()
return
/mob/proc/update_inv_glasses()
return
/mob/proc/update_inv_s_store()
return
/mob/proc/update_inv_pockets()
return
/mob/proc/update_inv_ears()
return
+2 -1
View File
@@ -26,12 +26,13 @@
if(!(M.r_hand))
M.u_equip(src)
M.r_hand = src
M.update_inv_r_hand()
else
if(over_object.name == "l_hand")
if(!(M.l_hand))
M.u_equip(src)
M.l_hand = src
M.update_clothing()
M.update_inv_l_hand()
src.add_fingerprint(usr)
return
+6 -5
View File
@@ -370,7 +370,8 @@
on = has_power()
update()
user.update_clothing()
user.update_inv_l_hand(0)
user.update_inv_r_hand()
if(on && rigged)
explode()
else
@@ -486,10 +487,9 @@
var/datum/organ/external/affecting = H.get_organ("[user.hand ? "l" : "r" ]_arm")
affecting.take_damage( 0, 5 ) // 5 burn damage
if(affecting.take_damage( 0, 5 )) // 5 burn damage
H.UpdateDamageIcon()
H.updatehealth()
H.UpdateDamageIcon()
return // if burned, don't remove the light
// create a light tube/bulb item and put it in the user's hand
@@ -501,8 +501,10 @@
L.layer = 20
if(user.hand)
user.l_hand = L
user.update_inv_l_hand()
else
user.r_hand = L
user.update_inv_r_hand()
// light item inherits the switchcount, then zero it
L.switchcount = switchcount
@@ -514,7 +516,6 @@
status = LIGHT_EMPTY
update()
user.update_clothing()
// break the light and make sparks if was on
@@ -29,7 +29,7 @@
if("monkey")
if (M.monkeyizing)
return
M.update_clothing()
// M.regenerate_icons()
M.monkeyizing = 1
M.canmove = 0
M.icon = null
@@ -48,7 +48,7 @@
if("robot")
if (M.monkeyizing)
return
M.update_clothing()
// M.regenerate_icons()
M.monkeyizing = 1
M.canmove = 0
M.icon = null
@@ -56,7 +56,6 @@
if(M.client)
M.client.screen -= M.hud_used.contents
M.client.screen -= M.hud_used.adding
M.client.screen -= M.hud_used.mon_blo
M.client.screen -= list( M.oxygen, M.throw_icon, M.i_select, M.m_select, M.toxin, M.internals, M.fire, M.hands, M.healths, M.pullin, M.blind, M.flash, M.rest, M.sleep, M.mach )
M.client.screen -= list( M.zone_sel, M.oxygen, M.throw_icon, M.i_select, M.m_select, M.toxin, M.internals, M.fire, M.hands, M.healths, M.pullin, M.blind, M.flash, M.rest, M.sleep, M.mach )
@@ -98,7 +97,7 @@
if("metroid")
if (M.monkeyizing)
return
M.update_clothing()
// M.regenerate_icons()
M.monkeyizing = 1
M.canmove = 0
M.icon = null
@@ -129,7 +128,7 @@
if("alien")
if (M.monkeyizing)
return
M.update_clothing()
// M.regenerate_icons()
M.monkeyizing = 1
M.canmove = 0
M.icon = null
@@ -155,7 +154,7 @@
if("human")
if (M.monkeyizing)
return
M.update_clothing()
// M.regenerate_icons()
M.monkeyizing = 1
M.canmove = 0
M.icon = null