Files
Paradise/code/game/objects/items/weapons/paint.dm
elly1989@rocketmail.com 48088b79d9 ugh...this was horrible. I'm really sorry if I fucked anything up, I was literally going braindead towards the end.
Replaced every l_hand = and r_hand = and all that if(hand) crap to use standardised procs. This means we can use procs like Dropped() reliably as they will always be called when things are dropped.

Thorough documentation to come. But generally, if you want a mob's icons to update after deleting something in the inventory...use drop_from_inventory(the_thing_you_wanna_drop) just before deleting it. If you wanna put something in a mob's hands use put_in_hands() (or one of the variants). It'll try putting it in active hand first, then inactive, then the floor. They handle layers, overlays, screenlocs calling various procs such as dropped() etc for you. Easy

mob.equipped() is now mob.get_active_hand() because there was another totally unrelated proc named equipped() and stuff was confusing.

Weakening was made instantaneous.

Minor optimisations for human/handle_regular_status_updates(). I'll port these changes over to the other mobs next. Basically it should stop it constantly incrementing every status effect even after death.

umm... bunch of overlays related fixes... I think that's everything. :/

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@3900 316c924e-a436-60f5-8080-3fe189b3f50e
2012-06-23 21:24:45 +00:00

102 lines
2.4 KiB
Plaintext

//NEVER USE THIS IT SUX -PETETHEGOAT
var/global/list/cached_icons = list()
/obj/item/weapon/paint
name = "Paint Can"
desc = "Used to recolor floors and walls. Can not be removed by the janitor."
icon = 'items.dmi'
icon_state = "paint_neutral"
color = "FFFFFF"
item_state = "paintcan"
w_class = 3.0
/obj/item/weapon/paint/red
name = "Red paint"
color = "FF0000"
icon_state = "paint_red"
/obj/item/weapon/paint/green
name = "Green paint"
color = "00FF00"
icon_state = "paint_green"
/obj/item/weapon/paint/blue
name = "Blue paint"
color = "0000FF"
icon_state = "paint_blue"
/obj/item/weapon/paint/yellow
name = "Yellow paint"
color = "FFFF00"
icon_state = "paint_yellow"
/obj/item/weapon/paint/violet //no icon
name = "Violet paint"
color = "FF00FF"
icon_state = "paint_neutral"
/obj/item/weapon/paint/black
name = "Black paint"
color = "333333"
icon_state = "paint_black"
/obj/item/weapon/paint/white
name = "White paint"
color = "FFFFFF"
icon_state = "paint_white"
/obj/item/weapon/paint/anycolor
name = "Any color"
icon_state = "paint_neutral"
attack_self(mob/user as mob)
var/t1 = input(user, "Please select a color:", "Locking Computer", null) in list( "red", "blue", "green", "yellow", "black", "white")
if ((user.get_active_hand() != src || user.stat || user.restrained()))
return
switch(t1)
if("red")
color = "FF0000"
if("blue")
color = "0000FF"
if("green")
color = "00FF00"
if("yellow")
color = "FFFF00"
/*
if("violet")
color = "FF00FF"
*/
if("white")
color = "FFFFFF"
if("black")
color = "333333"
icon_state = "paint_[t1]"
add_fingerprint(user)
return
/obj/item/weapon/paint/afterattack(turf/target, mob/user as mob)
if(!istype(target) || istype(target, /turf/space))
return
var/ind = "[initial(target.icon)][color]"
if(!cached_icons[ind])
var/icon/overlay = new/icon(initial(target.icon))
overlay.Blend("#[color]",ICON_MULTIPLY)
overlay.SetIntensity(1.4)
target.icon = overlay
cached_icons[ind] = target.icon
else
target.icon = cached_icons[ind]
return
/obj/item/weapon/paint/paint_remover
name = "Paint remover"
icon_state = "paint_neutral"
afterattack(turf/target, mob/user as mob)
if(istype(target) && target.icon != initial(target.icon))
target.icon = initial(target.icon)
return