Finally fixed those clean_blood() calls so they update mob-overlays properly. Resolves issue 681. Fixes space-cleaner grenades/splashing/spraying, Soap (work-around), Showers (again) and Janitor-borgs.

Fixed putting ammo in RCDs, resolves issue 696. Removed a little spam-text from RCDs too.
Removed some dyslexia from spesscash.
added an undef for LEGCUFF_LAYER


git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4209 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
elly1989@rocketmail.com
2012-07-29 04:04:24 +00:00
parent 070c956e25
commit 919677e2d5
9 changed files with 126 additions and 134 deletions
+1 -1
View File
@@ -196,7 +196,7 @@
/obj/item/weapon/spacecash/c1000
icon_state = "spacecash1000"
access = access_crate_cash
desc = "It's worth 1000 credits. El oh dee ess of ee em oh en ee! What's that spell? LOADSAMONEY, probly!"
desc = "It's worth 1000 credits."
/obj/item/device/mass_spectrometer
desc = "A hand-held mass spectrometer which identifies trace chemicals in a blood sample."
+25 -24
View File
@@ -285,20 +285,34 @@
/atom/proc/clean_blood()
if (!( src.flags ) & FPRINT)
return
if (blood_DNA)
if(istype(fingerprints, /list))
//Smudge up dem prints some
for(var/P in fingerprints)
var/test_print = stars(fingerprints[P], rand(10,20))
if(stringpercent(test_print) == 32) //She's full of stars! (No actual print left)
fingerprints.Remove(P)
else
fingerprints[P] = test_print
if(!fingerprints.len)
del(fingerprints)
if(istype(blood_DNA, /list))
//Cleaning blood off of mobs
if (istype (src, /mob/living/carbon))
if(istype(src, /mob/living/carbon))
var/mob/living/carbon/M = src
del(M.blood_DNA)
if(ishuman(src))
var/mob/living/carbon/human/H = src
H.bloody_hands = 0
if(ishuman(M))
var/mob/living/carbon/human/H = M
if(H.gloves)
H.gloves.clean_blood()
// H.update_inv_gloves(0) //Needs to be called even if we aren't wearing gloves.
else
H.bloody_hands = 0
H.update_inv_gloves(0) //because it handles bloody hands too
M.update_icons() //apply the now updated overlays to the mob
//Cleaning blood off of items
else if (istype (src, /obj/item))
else if(istype(src, /obj/item))
var/obj/item/O = src
del(O.blood_DNA)
if(O.blood_overlay)
@@ -309,7 +323,7 @@
G.transfer_blood = 0
//Cleaning blood off of turfs
else if (istype(src, /turf/simulated))
else if(istype(src, /turf/simulated))
var/turf/simulated/T = src
del(T.blood_DNA)
if(T.icon_old)
@@ -318,21 +332,8 @@
else
T.icon = initial(icon)
if(blood_DNA && istype(blood_DNA, /list) && !blood_DNA.len)
del(blood_DNA)
if(fingerprints && fingerprints.len)
//Smudge up dem prints some
for(var/P in fingerprints)
var/test_print = stars(fingerprints[P], rand(10,20))
if(stringpercent(test_print) == 32) //She's full of stars! (No actual print left)
fingerprints.Remove(P)
else
fingerprints[P] = test_print
if(fingerprints && !fingerprints.len)
del(fingerprints)
if(istype(src, /mob/living/carbon/human))
var/mob/living/carbon/human/M = src
M.update_inv_gloves() //handles bloody hands too
else if(!blood_DNA.len)
del(blood_DNA)
return
/atom/MouseDrop(atom/over_object as mob|obj|turf|area)
+19 -25
View File
@@ -39,12 +39,13 @@ RCD
..()
if(istype(W, /obj/item/weapon/rcd_ammo))
if((matter + 10) > 30)
user << "The RCD cant hold any more matter."
user << "<span class='notice'>The RCD cant hold any more matter-units.</span>"
return
user.drop_item()
del(W)
matter += 10
playsound(src.loc, 'click.ogg', 50, 1)
user << "The RCD now holds [matter]/30 matter-units."
user << "<span class='notice'>The RCD now holds [matter]/30 matter-units.</span>"
desc = "A RCD. It currently holds [matter]/30 matter-units."
return
@@ -52,21 +53,22 @@ RCD
attack_self(mob/user as mob)
//Change the mode
playsound(src.loc, 'pop.ogg', 50, 0)
if(mode == 1)
mode = 2
user << "Changed mode to 'Airlock'"
src.spark_system.start()
return
if(mode == 2)
mode = 3
user << "Changed mode to 'Deconstruct'"
src.spark_system.start()
return
if(mode == 3)
mode = 1
user << "Changed mode to 'Floor & Walls'"
src.spark_system.start()
return
switch(mode)
if(1)
mode = 2
user << "<span class='notice'>Changed mode to 'Airlock'</span>"
src.spark_system.start()
return
if(2)
mode = 3
user << "<span class='notice'>Changed mode to 'Deconstruct'</span>"
src.spark_system.start()
return
if(3)
mode = 1
user << "<span class='notice'>Changed mode to 'Floor & Walls'</span>"
src.spark_system.start()
return
afterattack(atom/A, mob/user as mob)
@@ -79,18 +81,15 @@ RCD
if(istype(A, /turf) && mode == 1)
if(istype(A, /turf/space) && matter >= 1)
user << "Building Floor (1)..."
if(!disabled && matter >= 1)
playsound(src.loc, 'Deconstruct.ogg', 50, 1)
spark_system.set_up(5, 0, src)
src.spark_system.start()
A:ReplaceWithPlating()
matter--
user << "The RCD now holds [matter]/30 matter-units."
desc = "A RCD. It currently holds [matter]/30 matter-units."
return
if(istype(A, /turf/simulated/floor) && matter >= 3)
user << "Building Wall (3)..."
playsound(src.loc, 'click.ogg', 50, 1)
if(do_after(user, 20))
if(!disabled && matter >= 3)
@@ -99,7 +98,6 @@ RCD
A:ReplaceWithWall()
playsound(src.loc, 'Deconstruct.ogg', 50, 1)
matter -= 3
user << "The RCD now holds [matter]/30 matter-units."
desc = "A RCD. It currently holds [matter]/30 matter-units."
return
else if(istype(A, /turf/simulated/floor) && mode == 2 && matter >= 10)
@@ -118,7 +116,6 @@ RCD
playsound(src.loc, 'Deconstruct.ogg', 50, 1)
playsound(src.loc, 'sparks2.ogg', 50, 1)
matter -= 10
user << "The RCD now holds [matter]/30 matter-units."
desc = "A RCD. It currently holds [matter]/30 matter-units."
return
else if(mode == 3 && (istype(A, /turf) || istype(A, /obj/machinery/door/airlock) ) )
@@ -132,7 +129,6 @@ RCD
A:ReplaceWithPlating()
playsound(src.loc, 'Deconstruct.ogg', 50, 1)
matter -= 4
user << "The RCD now holds [matter]/30 matter-units."
desc = "A RCD. It currently holds [matter]/30 matter-units."
return
if(istype(A, /turf/simulated/wall/r_wall))
@@ -147,7 +143,6 @@ RCD
A:ReplaceWithSpace()
playsound(src.loc, 'Deconstruct.ogg', 50, 1)
matter -= 5
user << "The RCD now holds [matter]/30 matter-units."
desc = "A RCD. It currently holds [matter]/30 matter-units."
return
if(istype(A, /obj/machinery/door/airlock) && matter >= 10)
@@ -160,6 +155,5 @@ RCD
del(A)
playsound(src.loc, 'Deconstruct.ogg', 50, 1)
matter -= 10
user << "The RCD now holds [matter]/30 matter-units."
desc = "A RCD. It currently holds [matter]/30 matter-units."
return
@@ -44,11 +44,15 @@ BIKE HORN
M.Weaken(2)
/obj/item/weapon/soap/afterattack(atom/target, mob/user as mob)
if(istype(target,/obj/effect/decal/cleanable))
user << "\blue You scrub \the [target.name] out."
//I couldn't feasibly fix the overlay bugs caused by cleaning items we are wearing.
//So this is a workaround. This also makes more sense from an IC standpoint. ~Carn
if(user.client && (target in user.client.screen))
user << "<span class='notice'>You need to take that [target.name] off before cleaning it.</span>"
else if(istype(target,/obj/effect/decal/cleanable))
user << "<span class='notice'>You scrub \the [target.name] out.</span>"
del(target)
else
user << "\blue You clean \the [target.name]."
user << "<span class='notice'>You clean \the [target.name].</span>"
target.clean_blood()
return
@@ -361,12 +361,9 @@
obj/item/weapon/mop/proc/clean(turf/simulated/A as turf)
src.reagents.reaction(A,1,10)
A.clean_blood()
for(var/obj/effect/rune/R in A)
del(R)
for(var/obj/effect/decal/cleanable/R in A)
del(R)
for(var/obj/effect/overlay/R in A)
del(R)
for(var/obj/effect/O in A)
if( istype(O,/obj/effect/rune) || istype(O,/obj/effect/decal/cleanable) || istype(O,/obj/effect/overlay) )
del(O)
/obj/effect/attackby(obj/item/weapon/W as obj, mob/user as mob)
+29 -47
View File
@@ -201,45 +201,38 @@
/obj/machinery/shower/proc/wash(atom/movable/O as obj|mob)
if(!on) return
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)
monkey.r_hand.clean_blood()
if(monkey.l_hand)
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()
// washer.update_inv_gloves(0) //no need for this one since it's located in clean_blood too.
if(iscarbon(O))
var/mob/living/carbon/M = O
if(M.r_hand)
M.r_hand.clean_blood()
if(M.l_hand)
M.l_hand.clean_blood()
if(M.wear_mask)
M.wear_mask.clean_blood()
M.update_inv_wear_mask(0)
if(ishuman(M))
var/mob/living/carbon/human/H = M
if(H.head)
H.head.clean_blood()
H.update_inv_head(0)
if(H.wear_suit)
H.wear_suit.clean_blood()
H.update_inv_wear_suit(0)
else if(H.w_uniform)
H.w_uniform.clean_blood()
H.update_inv_w_uniform(0)
if(H.shoes)
H.shoes.clean_blood()
H.update_inv_shoes(0)
O.clean_blood()
if(loc)
var/turf/tile = get_turf(loc)
if(isturf(loc))
var/turf/tile = loc
loc.clean_blood()
for(var/obj/effect/rune/R in tile)
del(R)
for(var/obj/effect/decal/cleanable/R in tile)
del(R)
for(var/obj/effect/overlay/R in tile)
del(R)
for(var/obj/effect/E in tile)
if(istype(E,/obj/effect/rune) || istype(E,/obj/effect/decal/cleanable) || istype(E,/obj/effect/overlay))
del(E)
/obj/machinery/shower/process()
if(!on || !mobpresent) return
@@ -298,18 +291,7 @@
if(M.loc != location) return //Person has moved away from the sink
if(istype(M, /mob/living/carbon))
var/mob/living/carbon/C = M
if(istype(M, /mob/living/carbon/human))
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.
M.clean_blood()
for(var/mob/V in viewers(src, null))
V.show_message("\blue [M] washes their hands using \the [src].")
+14 -12
View File
@@ -983,7 +983,7 @@ datum
if(istype(O,/obj/effect/decal/cleanable))
del(O)
else
if (O)
if(O)
O.clean_blood()
reaction_turf(var/turf/T, var/volume)
T.overlays = null
@@ -994,8 +994,7 @@ datum
for(var/mob/living/carbon/metroid/M in T)
M.adjustToxLoss(rand(5,10))
reaction_mob(var/mob/M, var/method=TOUCH, var/volume) //TODO: CARN
M.clean_blood()
reaction_mob(var/mob/M, var/method=TOUCH, var/volume)
if(iscarbon(M))
var/mob/living/carbon/C = M
if(C.r_hand)
@@ -1004,19 +1003,22 @@ datum
C.l_hand.clean_blood()
if(C.wear_mask)
C.wear_mask.clean_blood()
C.update_inv_wear_mask(0)
if(ishuman(M))
var/mob/living/carbon/human/H = C
if(H.w_uniform)
H.w_uniform.clean_blood()
if(H.wear_suit)
H.wear_suit.clean_blood()
if(H.shoes)
H.shoes.clean_blood()
if(H.gloves)
H.gloves.clean_blood()
if(H.head)
H.head.clean_blood()
H.update_inv_head(0)
if(H.wear_suit)
H.wear_suit.clean_blood()
H.update_inv_wear_suit(0)
else if(H.w_uniform)
H.w_uniform.clean_blood()
H.update_inv_w_uniform(0)
if(H.shoes)
H.shoes.clean_blood()
H.update_inv_shoes(0)
M.clean_blood()
plantbgone
name = "Plant-B-Gone"
@@ -648,6 +648,7 @@ Please contact me on #coderbus IRC. ~Carn x
#undef HAIR_LAYER
#undef HEAD_LAYER
#undef HANDCUFF_LAYER
#undef LEGCUFF_LAYER
#undef L_HAND_LAYER
#undef R_HAND_LAYER
#undef TOTAL_LAYERS
+27 -16
View File
@@ -944,22 +944,33 @@ Frequency:
if(module)
if(module.type == /obj/item/weapon/robot_module/janitor) //you'd think checking the module would work
var/turf/tile = get_turf(loc)
tile.clean_blood()
for(var/obj/effect/R in tile)
if(istype(R, /obj/effect/rune) || istype(R, /obj/effect/decal/cleanable) || istype(R, /obj/effect/overlay))
del(R)
for(var/obj/item/cleaned_item in tile)
cleaned_item.clean_blood()
for(var/mob/living/carbon/human/cleaned_human in tile) //HUE HUE I CLEAN U
if(cleaned_human.lying)
cleaned_human.clean_blood()
cleaned_human << "\red [src] cleans your face!"
for(var/obj/item/carried_item in cleaned_human.contents)
carried_item.clean_blood()
var/turf/tile = loc
if(isturf(tile))
tile.clean_blood()
for(var/A in tile)
if(istype(A, /obj/effect))
if(istype(A, /obj/effect/rune) || istype(A, /obj/effect/decal/cleanable) || istype(A, /obj/effect/overlay))
del(A)
else if(istype(A, /obj/item))
var/obj/item/cleaned_item = A
cleaned_item.clean_blood()
else if(istype(A, /mob/living/carbon/human))
var/mob/living/carbon/human/cleaned_human = A
if(cleaned_human.lying)
if(cleaned_human.head)
cleaned_human.head.clean_blood()
cleaned_human.update_inv_head(0)
if(cleaned_human.wear_suit)
cleaned_human.wear_suit.clean_blood()
cleaned_human.update_inv_wear_suit(0)
else if(cleaned_human.w_uniform)
cleaned_human.w_uniform.clean_blood()
cleaned_human.update_inv_w_uniform(0)
if(cleaned_human.shoes)
cleaned_human.shoes.clean_blood()
cleaned_human.update_inv_shoes(0)
cleaned_human.clean_blood()
cleaned_human << "\red [src] cleans your face!"
return
/mob/living/silicon/robot/proc/self_destruct()