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
+2 -2
View File
@@ -151,7 +151,7 @@ var/const/MAX_ACTIVE_TIME = 600
layer = 20
target.wear_mask = src
target.update_clothing()
target.update_inv_wear_mask()
GoIdle() //so it doesn't jump the people that tear it off
@@ -178,7 +178,7 @@ var/const/MAX_ACTIVE_TIME = 600
else
for(var/mob/O in viewers(target,null))
O.show_message("\red \b [src] violates [target]'s face!", 1)
target.update_inv_wear_mask()
return
proc/GoActive()
+2
View File
@@ -53,4 +53,6 @@
/obj/item/weapon/cloaking_device/emp_act(severity)
active = 0
icon_state = "shield0"
if(ismob(loc))
loc:update_icons()
..()
+2
View File
@@ -122,8 +122,10 @@
var/obj/item/candle/W = new /obj/item/candle(user)
if(user.hand)
user.l_hand = W
user.update_inv_l_hand()
else
user.r_hand = W
user.update_inv_r_hand()
W.layer = 20
else
return ..()
+45 -29
View File
@@ -96,9 +96,7 @@ THERMAL GLASSES
src.force = 3
src.damtype = "fire"
src.icon_state = "cake1"
processing_objects.Add(src)
else
src.force = null
src.damtype = "brute"
@@ -176,6 +174,7 @@ THERMAL GLASSES
icon_state = A.icon_state
item_state = A.item_state
color = A.color
usr.update_inv_w_uniform() //so our overlays update.
/obj/item/clothing/under/chameleon/emp_act(severity)
name = "psychedelic"
@@ -208,6 +207,7 @@ THERMAL GLASSES
/obj/item/clothing/under/verb/toggle()
set name = "Toggle Suit Sensors"
set category = "Object"
set src in usr
var/mob/M = usr
if (istype(M, /mob/dead/)) return
if (usr.stat) return
@@ -251,7 +251,9 @@ THERMAL GLASSES
/obj/item/clothing/head/helmet/welding/verb/toggle()
set category = "Object"
set name = "Adjust welding mask"
if(usr.canmove && usr.stat != 2 && !usr.restrained())
set src in usr
if(usr.canmove && !usr.stat && !usr.restrained())
if(src.up)
src.up = !src.up
src.see_face = !src.see_face
@@ -266,6 +268,7 @@ THERMAL GLASSES
flags_inv &= ~(HIDEMASK|HIDEEARS|HIDEEYES)
icon_state = "weldingup"
usr << "You push the mask up out of your face."
usr.update_inv_head() //so our mob-overlays update
/obj/item/clothing/head/cargosoft/dropped()
src.icon_state = "cargosoft"
@@ -275,18 +278,22 @@ THERMAL GLASSES
/obj/item/clothing/head/cargosoft/verb/flip()
set category = "Object"
set name = "Flip cap"
src.flipped = !src.flipped
if(src.flipped)
icon_state = "cargosoft_flipped"
usr << "You flip the hat backwards."
else
icon_state = "cargosoft"
usr << "You flip the hat back in normal position."
set src in usr
if(usr.canmove && !usr.stat && !usr.restrained())
src.flipped = !src.flipped
if(src.flipped)
icon_state = "cargosoft_flipped"
usr << "You flip the hat backwards."
else
icon_state = "cargosoft"
usr << "You flip the hat back in normal position."
usr.update_inv_head() //so our mob-overlays update
/obj/item/clothing/shoes/magboots/verb/toggle()
set name = "Toggle Magboots"
set category = "Object"
set src in usr
if(src.magpulse)
src.flags &= ~NOSLIP
src.slowdown = SHOES_SLOWDOWN
@@ -299,6 +306,7 @@ THERMAL GLASSES
src.magpulse = 1
icon_state = "magboots1"
usr << "You enable the mag-pulse traction system."
usr.update_inv_shoes() //so our mob-overlays update
/obj/item/clothing/shoes/magboots/examine()
set src in view()
@@ -311,6 +319,11 @@ THERMAL GLASSES
/obj/item/clothing/suit/suit/verb/toggle()
set name = "Toggle Jacket Buttons"
set category = "Object"
set src in usr
if(!usr.canmove || usr.stat || usr.restrained())
return 0
if(src.icon_state == "suitjacket_blue_open")
src.icon_state = "suitjacket_blue"
src.item_state = "suitjacket_blue"
@@ -320,62 +333,65 @@ THERMAL GLASSES
src.item_state = "suitjacket_blue_open"
usr << "You unbutton the suit jacket."
else
usr << "Sorry! The suit you're wearing doesn't have buttons!"
usr << "You button-up some imaginary buttons on your [src]."
return
usr.update_inv_wear_suit()
/obj/item/clothing/suit/labcoat/verb/toggle()
set name = "Toggle Labcoat Buttons"
set category = "Object"
set src in usr
if(!usr.canmove || usr.stat || usr.restrained())
return 0
else
if(src.icon_state == "labcoat_open")
switch(icon_state)
if("labcoat_open")
src.icon_state = "labcoat"
usr << "You button up the labcoat."
else if(src.icon_state == "labcoat")
if("labcoat")
src.icon_state = "labcoat_open"
usr << "You unbutton the labcoat."
else if(src.icon_state == "labcoat_cmo_open")
if("labcoat_cmo_open")
src.icon_state = "labcoat_cmo"
usr << "You button up the labcoat."
else if(src.icon_state == "labcoat_cmo")
if("labcoat_cmo")
src.icon_state = "labcoat_cmo_open"
usr << "You unbutton the labcoat."
else if(src.icon_state == "labcoat_gen_open")
if("labcoat_gen_open")
src.icon_state = "labcoat_gen"
usr << "You button up the labcoat."
else if(src.icon_state == "labcoat_gen")
if("labcoat_gen")
src.icon_state = "labcoat_gen_open"
usr << "You unbutton the labcoat."
else if(src.icon_state == "labcoat_chem_open")
if("labcoat_chem_open")
src.icon_state = "labcoat_chem"
usr << "You button up the labcoat."
else if(src.icon_state == "labcoat_chem")
if("labcoat_chem")
src.icon_state = "labcoat_chem_open"
usr << "You unbutton the labcoat."
else if(src.icon_state == "labcoat_vir_open")
if("labcoat_vir_open")
src.icon_state = "labcoat_vir"
usr << "You button up the labcoat."
else if(src.icon_state == "labcoat_vir")
if("labcoat_vir")
src.icon_state = "labcoat_vir_open"
usr << "You unbutton the labcoat."
else if(src.icon_state == "labcoat_tox_open")
if("labcoat_tox_open")
src.icon_state = "labcoat_tox"
usr << "You button up the labcoat."
else if(src.icon_state == "labcoat_tox")
if("labcoat_tox")
src.icon_state = "labcoat_tox_open"
usr << "You unbutton the labcoat."
else if(src.icon_state == "labgreen_open")
if("labgreen_open")
src.icon_state = "labgreen"
usr << "You button up the labcoat."
else if(src.icon_state == "labgreen")
if("labgreen")
src.icon_state = "labgreen_open"
usr << "You unbutton the labcoat."
else
usr << "Sorry! The suit you're wearing doesn't have buttons!"
usr << "You attempt to button-up the velcro on your [src], before promptly realising how retarded you are."
return
usr.update_inv_wear_suit() //so our overlays update
/obj/item/clothing/head/ushanka/attack_self(mob/user as mob)
if(src.icon_state == "ushankadown")
+6 -5
View File
@@ -62,14 +62,14 @@ MONKEY CUBE BOX
P.loc = usr
P.layer = 20
usr.l_hand = P
usr.update_clothing()
usr.update_inv_l_hand()
usr << "You take a donut out of the box."
break
else if (!usr.r_hand)
P.loc = usr
P.layer = 20
usr.r_hand = P
usr.update_clothing()
usr.update_inv_r_hand()
usr << "You take a donut out of the box."
break
else
@@ -138,7 +138,7 @@ MONKEY CUBE BOX
P.layer = 20
usr.l_hand = P
P = null
usr.update_clothing()
usr.update_inv_l_hand()
usr << "You take an egg out of the box."
break
else if (!usr.r_hand)
@@ -146,7 +146,7 @@ MONKEY CUBE BOX
P.layer = 20
usr.r_hand = P
P = null
usr.update_clothing()
usr.update_inv_r_hand()
usr << "You take an egg out of the box."
break
else
@@ -189,11 +189,12 @@ MONKEY CUBE BOX
var/obj/item/weapon/reagent_containers/food/snacks/monkeycube/wrapped/M = new /obj/item/weapon/reagent_containers/food/snacks/monkeycube/wrapped(src)
if (user.hand)
user.l_hand = M
user.update_inv_l_hand()
else
user.r_hand = M
user.update_inv_r_hand()
M.loc = user
M.layer = 20
user.update_clothing()
user << "You take a monkey cube out of the box."
amount--
else
+14 -13
View File
@@ -119,15 +119,15 @@
src.pickup(user)
user.lastDblClick = world.time + 2
user.next_move = world.time + 2
if (user.hand)
user.l_hand = src
else
user.r_hand = src
src.loc = user
src.layer = 20
add_fingerprint(user)
user.update_clothing()
if (user.hand)
user.l_hand = src
user.update_inv_l_hand()
else
user.r_hand = src
user.update_inv_r_hand()
return
@@ -158,14 +158,14 @@
src.pickup(user)
user.lastDblClick = world.time + 2
user.next_move = world.time + 2
if (user.hand)
user.l_hand = src
else
user.r_hand = src
src.loc = user
src.layer = 20
user.update_clothing()
if (user.hand)
user.l_hand = src
user.update_inv_l_hand()
else
user.r_hand = src
user.update_inv_r_hand()
return
/obj/item/attackby(obj/item/weapon/W as obj, mob/user as mob)
@@ -361,7 +361,8 @@
)
if(istype(M, /mob/living/carbon/human))
var/datum/organ/external/affecting = M:get_organ("head")
affecting.take_damage(7)
if(affecting.take_damage(7))
M:UpdateDamageIcon()
else
M.take_organ_damage(7)
M.eye_blurry += rand(3,4)
+3 -1
View File
@@ -33,10 +33,12 @@
user.l_hand = focus
else
user.r_hand = focus
focus.loc = user
focus.layer = 20
add_fingerprint(user)
user.update_clothing()
user.update_inv_l_hand(0)
user.update_inv_r_hand()
spawn(0)
del(src)
return
+2 -1
View File
@@ -17,12 +17,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
if(over_object == usr && in_range(src, usr) || usr.contents.Find(src))
+2 -2
View File
@@ -96,13 +96,13 @@ FINGERPRINT CARD
usr.l_hand = P
P.loc = usr
P.layer = 20
usr.update_clothing()
usr.update_inv_l_hand()
else
if (!( usr.r_hand ))
usr.r_hand = P
P.loc = usr
P.layer = 20
usr.update_clothing()
usr.update_inv_r_hand()
src.add_fingerprint(usr)
P.add_fingerprint(usr)
src.update()
@@ -74,8 +74,10 @@ ZIPPO
var/obj/item/weapon/match/W = new /obj/item/weapon/match(user)
if(user.hand)
user.l_hand = W
user.update_inv_l_hand()
else
user.r_hand = W
user.update_inv_r_hand()
W.layer = 20
else
return ..()
@@ -156,6 +158,11 @@ ZIPPO
var/obj/item/weapon/match/M = W
if(M.lit > 0)
light("\red [user] lights their [name] with their [W].")
//can't think of any other way to update the overlays :<
user.update_inv_wear_mask(0)
user.update_inv_l_hand(0)
user.update_inv_r_hand(1)
return
@@ -202,10 +209,12 @@ ZIPPO
src.smoketime--
if(src.smoketime < 1)
new type_butt(location)
processing_objects.Remove(src)
if(ismob(src.loc))
var/mob/living/M = src.loc
M << "\red Your [src.name] goes out."
processing_objects.Remove(src)
M.u_equip(src) //un-equip it so the overlays can update
M.update_icons()
del(src)
return
if(location)
@@ -423,8 +432,10 @@ ZIPPO
reagents.trans_to(W, reagents.total_volume)
if(user.hand)
user.l_hand = W
user.update_inv_l_hand()
else
user.r_hand = W
user.update_inv_r_hand()
W.layer = 20
else
return ..()
@@ -227,6 +227,7 @@ CRITTER GRENADE
else
if (M.ear_damage >= 5)
M << "\red Your ears start to ring!"
M.update_icons()
prime() // Prime now just handles the two loops that query for people in lockers and people who can see it.
var/turf/T = get_turf(src)
@@ -86,7 +86,8 @@ Craftables (Cob pipes, potato batteries, pumpkinheads)
if(istype(user, /mob/living/carbon/human))
var/organ = ((user.hand ? "l_":"r_") + "arm")
var/datum/organ/external/affecting = user.get_organ(organ)
affecting.take_damage(0,force)
if(affecting.take_damage(0,force))
user.UpdateDamageIcon()
else
user.take_organ_damage(0,force)
@@ -109,7 +110,8 @@ Craftables (Cob pipes, potato batteries, pumpkinheads)
if(istype(user, /mob/living/carbon/human))
var/organ = ((user.hand ? "l_":"r_") + "arm")
var/datum/organ/external/affecting = user.get_organ(organ)
affecting.take_damage(0,force)
if(affecting.take_damage(0,force))
user.UpdateDamageIcon()
else
user.take_organ_damage(0,force)
if(prob(50))
@@ -28,13 +28,16 @@
if ((src.case && (user.l_hand == src || user.r_hand == src)))
if (user.hand)
user.l_hand = src.case
user.update_inv_l_hand()
else
user.r_hand = src.case
user.update_inv_r_hand()
src.case.loc = user
src.case.layer = 20
src.case.add_fingerprint(user)
src.case = null
user.update_clothing()
user.update_inv_l_hand(0)
user.update_inv_r_hand()
src.add_fingerprint(user)
update()
else
@@ -69,7 +69,8 @@ CIRCULAR SAW
user << "\red You mess up!"
if(istype(M, /mob/living/carbon/human))
var/datum/organ/external/affecting = M:get_organ("head")
affecting.take_damage(15)
if(affecting.take_damage(15))
M:UpdateDamageIcon()
M.updatehealth()
else
M.take_organ_damage(15)
@@ -155,7 +156,8 @@ CIRCULAR SAW
user << "\red You mess up!"
if(istype(M, /mob/living/carbon/human))
var/datum/organ/external/affecting = M:get_organ("head")
affecting.take_damage(15)
if(affecting.take_damage(15))
M:UpdateDamageIcon()
M.updatehealth()
else
M.take_organ_damage(15)
@@ -230,7 +232,8 @@ CIRCULAR SAW
user << "\red You mess up!"
if(istype(M, /mob/living/carbon/human))
var/datum/organ/external/affecting = M:get_organ("head")
affecting.take_damage(15)
if(affecting.take_damage(15))
M:UpdateDamageIcon()
M.updatehealth()
else
M.take_organ_damage(15)
@@ -329,7 +332,8 @@ CIRCULAR SAW
user << "\red You mess up!"
if(istype(M, /mob/living/carbon/human))
var/datum/organ/external/affecting = M:get_organ("head")
affecting.take_damage(15)
if(affecting.take_damage(15))
M:UpdateDamageIcon()
else
M.take_organ_damage(15)
@@ -374,7 +378,8 @@ CIRCULAR SAW
user << "\red You nick an artery!"
if(istype(M, /mob/living/carbon/human))
var/datum/organ/external/affecting = M:get_organ("head")
affecting.take_damage(75)
if(affecting.take_damage(75))
M:UpdateDamageIcon()
else
M.take_organ_damage(75)
@@ -429,7 +434,8 @@ CIRCULAR SAW
user << "\red You mess up!"
if(istype(M, /mob/living/carbon/human))
var/datum/organ/external/affecting = M:get_organ("head")
affecting.take_damage(15)
if(affecting.take_damage(15))
M:UpdateDamageIcon()
else
M.take_organ_damage(15)
@@ -498,7 +504,8 @@ CIRCULAR SAW
user << "\red You mess up!"
if(istype(M, /mob/living/carbon/human))
var/datum/organ/external/affecting = M:get_organ("head")
affecting.take_damage(40)
if(affecting.take_damage(40))
M:UpdateDamageIcon()
M.updatehealth()
else
M.take_organ_damage(40)
+1 -1
View File
@@ -380,7 +380,7 @@ WELDINGTOOOL
"You cut \the [M]'s restraints with \the [src]!",\
"You hear cable being cut.")
M.handcuffed = null
M.update_clothing()
M.update_inv_handcuffed()
return
else
..()
@@ -84,8 +84,10 @@ PHOTOGRAPHS
src.gift.loc = user
if (user.hand)
user.l_hand = src.gift
user.update_inv_l_hand()
else
user.r_hand = src.gift
user.update_inv_r_hand()
src.gift.layer = 20
src.gift.add_fingerprint(user)
del(src)
@@ -125,8 +127,10 @@ PHOTOGRAPHS
var/obj/item/device/flash/W = new /obj/item/device/flash( M )
if (M.hand)
M.l_hand = W
M.update_inv_l_hand()
else
M.r_hand = W
M.update_inv_r_hand()
W.layer = 20
W.add_fingerprint(M)
//SN src = null
@@ -136,8 +140,10 @@ PHOTOGRAPHS
var/obj/item/weapon/gun/energy/laser/W = new /obj/item/weapon/gun/energy/laser( M )
if (M.hand)
M.l_hand = W
M.update_inv_l_hand()
else
M.r_hand = W
M.update_inv_r_hand()
W.layer = 20
W.add_fingerprint(M)
//SN src = null
@@ -147,8 +153,10 @@ PHOTOGRAPHS
var/obj/item/weapon/gun/energy/taser/W = new /obj/item/weapon/gun/energy/taser( M )
if (M.hand)
M.l_hand = W
M.update_inv_l_hand()
else
M.r_hand = W
M.update_inv_r_hand()
W.layer = 20
W.add_fingerprint(M)
//SN src = null
@@ -158,8 +166,10 @@ PHOTOGRAPHS
var/obj/item/weapon/melee/energy/sword/W = new /obj/item/weapon/melee/energy/sword( M )
if (M.hand)
M.l_hand = W
M.update_inv_l_hand()
else
M.r_hand = W
M.update_inv_r_hand()
W.layer = 20
W.add_fingerprint(M)
//SN src = null
@@ -169,8 +179,10 @@ PHOTOGRAPHS
var/obj/item/weapon/melee/energy/axe/W = new /obj/item/weapon/melee/energy/axe( M )
if (M.hand)
M.l_hand = W
M.update_inv_l_hand()
else
M.r_hand = W
M.update_inv_r_hand()
W.layer = 20
W.add_fingerprint(M)
//SN src = null
+2
View File
@@ -58,9 +58,11 @@
if (user.r_hand == W)
user.u_equip(W)
user.r_hand = A
user.update_inv_r_hand()
else
user.u_equip(W)
user.l_hand = A
user.update_inv_l_hand()
W.master = A
src.master = A
src.layer = initial(src.layer)
+2
View File
@@ -197,9 +197,11 @@ var/GLOBAL_RADIO_TYPE = 1 // radio type to use
if (usr.r_hand == R)
usr.u_equip(R)
usr.r_hand = T
usr.update_inv_r_hand()
else
usr.u_equip(R)
usr.l_hand = T
usr.update_inv_l_hand()
R.loc = T
T.layer = 20
T.attack_self(usr)
+2 -2
View File
@@ -266,7 +266,7 @@ SHARDS
if(!H.shoes)
var/datum/organ/external/affecting = H.get_organ(pick("l_leg", "r_leg"))
H.Weaken(3)
affecting.take_damage(5, 0)
H.UpdateDamageIcon()
if(affecting.take_damage(5, 0))
H.UpdateDamageIcon()
H.updatehealth()
..()
+3 -2
View File
@@ -100,7 +100,8 @@
/obj/structure/stool/bed/MouseDrop_T(mob/M as mob, mob/user as mob)
if(!istype(M)) return
buckle_mob(M, user)
M.lying = 1
// M.lying = 1
// M.update_icons() //update our icons to reflect our lying/standing status
return
/obj/structure/stool/bed/attack_paw(mob/user as mob)
@@ -136,6 +137,7 @@
/obj/structure/stool/bed/chair/MouseDrop_T(mob/M as mob, mob/user as mob)
if(!istype(M)) return
buckle_mob(M, user)
// M.update_icons() //update our icons to reflect our lying/standing status
return
//roller bed
@@ -156,7 +158,6 @@
if ((!( istype(M, /mob) ) || get_dist(src, user) > 1 || M.loc != src.loc || user.restrained() || usr.stat || M.buckled || istype(usr, /mob/living/silicon/pai)))
return
M.pixel_y = 6
M.update_clothing()
density = 1
icon_state = "up"
..()
+2 -1
View File
@@ -9,12 +9,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
if(over_object == usr && in_range(src, usr) || usr.contents.Find(src))
+2 -1
View File
@@ -27,12 +27,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
+2 -1
View File
@@ -98,12 +98,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
if(over_object == usr && in_range(src, usr) || usr.contents.Find(src))
+3 -1
View File
@@ -163,6 +163,7 @@
return //To prevent the stacking of the same sized items.
user.u_equip(W)
user.update_icons() //update our overlays
W.loc = src
if ((user.client && user.s_active != src))
user.client.screen -= W
@@ -377,12 +378,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
if(over_object == usr && in_range(src, usr) || usr.contents.Find(src))
+2 -1
View File
@@ -45,12 +45,13 @@ CRAYONS
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
if(over_object == usr && in_range(src, usr) || usr.contents.Find(src))
+8 -2
View File
@@ -335,13 +335,14 @@ A list of items and costs is stored under the datum of every game mode, alongsid
item:loc = A
A.r_hand = item
item:layer = 20
A.update_inv_r_hand()
else if(!A.l_hand)
item:loc = A
A.l_hand = item
item:layer = 20
A.update_inv_l_hand()
else
item:loc = get_turf(A)
usr.update_clothing()
// usr.client.onBought("[item:name]") When we have the stats again, uncomment.
/* if(istype(item, /obj/spawner)) // Spawners need to have del called on them to avoid leaving a marker behind
del item*/
@@ -441,10 +442,12 @@ A list of items and costs is stored under the datum of every game mode, alongsid
if(!A.r_hand)
item:loc = A
A.r_hand = item
A.update_inv_r_hand()
item:layer = 20
else if(!A.l_hand)
item:loc = A
A.l_hand = item
A.update_inv_l_hand()
item:layer = 20
else
item:loc = get_turf(A)
@@ -469,10 +472,11 @@ A list of items and costs is stored under the datum of every game mode, alongsid
if (usr.r_hand == R)
usr.u_equip(R)
usr.r_hand = T
// usr.update_inv_r_hand()
else
usr.u_equip(R)
usr.l_hand = T
// usr.update_inv_l_hand()
R.loc = T
T.layer = 20
T.set_frequency(initial(T.frequency))
@@ -532,9 +536,11 @@ A list of items and costs is stored under the datum of every game mode, alongsid
if (L.r_hand == R)
L.u_equip(R)
L.r_hand = T
L.update_inv_r_hand()
else
L.u_equip(R)
L.l_hand = T
L.update_inv_l_hand()
T.layer = 20
T.set_frequency(initial(T.frequency))
return
+10 -4
View File
@@ -200,8 +200,6 @@
/obj/machinery/shower/proc/wash(atom/movable/O as obj|mob)
if(!on) return
O.clean_blood()
if(istype(O, /mob/living/carbon))
var/mob/living/carbon/monkey = O //it's not necessarily a monkey, but >accurate varnames
if(monkey.r_hand)
@@ -210,21 +208,27 @@
monkey.l_hand.clean_blood()
if(monkey.wear_mask)
monkey.wear_mask.clean_blood()
monkey.update_inv_wear_mask(0)
if(istype(O, /mob/living/carbon/human))
var/mob/living/carbon/human/washer = O
if(washer.head)
washer.head.clean_blood()
washer.update_inv_head(0)
if(washer.wear_suit)
washer.wear_suit.clean_blood()
washer.update_inv_wear_suit(0)
else if(washer.w_uniform)
washer.w_uniform.clean_blood()
washer.update_inv_w_uniform(0)
if(washer.shoes)
washer.shoes.clean_blood()
washer.update_inv_shoes(0)
if(washer.gloves)
washer.gloves.clean_blood()
if(washer.head)
washer.head.clean_blood()
// washer.update_inv_gloves(0) //no need for this one since it's located in clean_blood too.
O.clean_blood()
if(loc)
var/turf/tile = get_turf(loc)
@@ -299,8 +303,10 @@
var/mob/living/carbon/human/washer = C
if(washer.gloves) //if they have gloves
washer.gloves.clean_blood() //clean the gloves
washer.update_inv_gloves() //update our overlays
else //and if they don't,
washer.clean_blood() //wash their hands (a mob being bloody means they are 'red handed')
//overlays will be updated in clean_blood()
else
C.clean_blood() //other things that can't wear gloves should just wash the mob.
for(var/mob/V in viewers(src, null))
+2 -2
View File
@@ -138,8 +138,8 @@
affecting = H.get_organ(type)
H.Stun(3)
if(affecting)
affecting.take_damage(1, 0)
H.UpdateDamageIcon()
if(affecting.take_damage(1, 0))
H.UpdateDamageIcon()
H.updatehealth()
playsound(target.loc, 'snap.ogg', 50, 1)
icon_state = "mousetrap"