mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-01-11 18:11:35 +00:00
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
206 lines
5.5 KiB
Plaintext
206 lines
5.5 KiB
Plaintext
/*--------
|
|
//CONTAINS
|
|
CRAYONS
|
|
--------*/
|
|
/obj/item/weapon/storage/crayonbox/New()
|
|
..()
|
|
new /obj/item/toy/crayon/red(src)
|
|
new /obj/item/toy/crayon/orange(src)
|
|
new /obj/item/toy/crayon/yellow(src)
|
|
new /obj/item/toy/crayon/green(src)
|
|
new /obj/item/toy/crayon/blue(src)
|
|
new /obj/item/toy/crayon/purple(src)
|
|
updateIcon()
|
|
|
|
/obj/item/weapon/storage/crayonbox/proc/updateIcon()
|
|
overlays = list() //resets list
|
|
overlays += image('crayons.dmi',"crayonbox")
|
|
for(var/obj/item/toy/crayon/crayon in contents)
|
|
overlays += image('crayons.dmi',crayon.colourName)
|
|
|
|
/obj/item/weapon/storage/crayonbox/attackby(obj/item/W as obj, mob/user as mob)
|
|
if(istype(W,/obj/item/toy/crayon))
|
|
switch(W:colourName)
|
|
if("mime")
|
|
usr << "This crayon is too sad to be contained in this box."
|
|
return
|
|
if("rainbow")
|
|
usr << "This crayon is too powerful to be contained in this box."
|
|
return
|
|
..()
|
|
updateIcon()
|
|
|
|
/obj/item/weapon/storage/crayonbox/attack_hand(mob/user as mob)
|
|
updateIcon()
|
|
..()
|
|
|
|
/obj/item/weapon/storage/crayonbox/MouseDrop(obj/over_object as obj)
|
|
|
|
if (ishuman(usr) || ismonkey(usr))
|
|
var/mob/M = usr
|
|
if (!( istype(over_object, /obj/screen) ))
|
|
return ..()
|
|
if ((!( M.restrained() ) && !( M.stat )))
|
|
if (over_object.name == "r_hand")
|
|
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_inv_l_hand()
|
|
src.add_fingerprint(usr)
|
|
return
|
|
if(over_object == usr && in_range(src, usr) || usr.contents.Find(src))
|
|
if (usr.s_active)
|
|
usr.s_active.close(usr)
|
|
src.show_to(usr)
|
|
return
|
|
return
|
|
|
|
/obj/item/toy/crayon/red
|
|
icon_state = "crayonred"
|
|
colour = "#DA0000"
|
|
shadeColour = "#810C0C"
|
|
colourName = "red"
|
|
|
|
/obj/item/toy/crayon/orange
|
|
icon_state = "crayonorange"
|
|
colour = "#FF9300"
|
|
shadeColour = "#A55403"
|
|
colourName = "orange"
|
|
|
|
/obj/item/toy/crayon/yellow
|
|
icon_state = "crayonyellow"
|
|
colour = "#FFF200"
|
|
shadeColour = "#886422"
|
|
colourName = "yellow"
|
|
|
|
/obj/item/toy/crayon/green
|
|
icon_state = "crayongreen"
|
|
colour = "#A8E61D"
|
|
shadeColour = "#61840F"
|
|
colourName = "green"
|
|
|
|
/obj/item/toy/crayon/blue
|
|
icon_state = "crayonblue"
|
|
colour = "#00B7EF"
|
|
shadeColour = "#0082A8"
|
|
colourName = "blue"
|
|
|
|
/obj/item/toy/crayon/purple
|
|
icon_state = "crayonpurple"
|
|
colour = "#DA00FF"
|
|
shadeColour = "#810CFF"
|
|
colourName = "purple"
|
|
|
|
/obj/item/toy/crayon/mime
|
|
icon_state = "crayonmime"
|
|
desc = "A very sad-looking crayon."
|
|
colour = "#FFFFFF"
|
|
shadeColour = "#000000"
|
|
colourName = "mime"
|
|
uses = 0
|
|
|
|
/obj/item/toy/crayon/mime/attack_self(mob/living/user as mob) //inversion
|
|
if(colour != "#FFFFFF" && shadeColour != "#000000")
|
|
colour = "#FFFFFF"
|
|
shadeColour = "#000000"
|
|
user << "You will now draw in white and black with this crayon."
|
|
else
|
|
colour = "#000000"
|
|
shadeColour = "#FFFFFF"
|
|
user << "You will now draw in black and white with this crayon."
|
|
return
|
|
|
|
/obj/item/toy/crayon/rainbow
|
|
icon_state = "crayonrainbow"
|
|
colour = "#FFF000"
|
|
shadeColour = "#000FFF"
|
|
colourName = "rainbow"
|
|
uses = 0
|
|
|
|
/obj/item/toy/crayon/rainbow/attack_self(mob/living/user as mob)
|
|
colour = input(user, "Please select the main colour.", "Crayon colour") as color
|
|
shadeColour = input(user, "Please select the shade colour.", "Crayon colour") as color
|
|
return
|
|
|
|
/obj/item/toy/crayon/afterattack(atom/target, mob/user as mob)
|
|
if(istype(target,/turf/simulated/floor))
|
|
var/drawtype = input("Choose what you'd like to draw.", "Crayon scribbles") in list("graffiti","rune","letter")
|
|
switch(drawtype)
|
|
if("letter")
|
|
drawtype = input("Choose the letter.", "Crayon scribbles") in list("a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z")
|
|
user << "You start drawing a letter on the [target.name]."
|
|
if("graffiti")
|
|
user << "You start drawing graffiti on the [target.name]."
|
|
if("rune")
|
|
user << "You start drawing a rune on the [target.name]."
|
|
if(instant || do_after(user, 50))
|
|
new /obj/effect/decal/cleanable/crayon(target,colour,shadeColour,drawtype)
|
|
user << "You finish drawing."
|
|
if(uses)
|
|
uses--
|
|
if(!uses)
|
|
user << "\red You used up your crayon!"
|
|
del(src)
|
|
return
|
|
|
|
/obj/item/toy/crayon/attack(mob/M as mob, mob/user as mob)
|
|
if(M == user)
|
|
user << "You take a bite of the crayon. Delicious!"
|
|
user.nutrition += 5
|
|
if(uses)
|
|
uses -= 5
|
|
if(uses <= 0)
|
|
user << "\red You ate your crayon!"
|
|
del(src)
|
|
else
|
|
..()
|
|
|
|
/obj/item/toy/crayon/attack_hand(mob/user as mob)
|
|
var/obj/item/weapon/storage/crayonbox/CB
|
|
if(istype(src.loc, /obj/item/weapon/storage/crayonbox))
|
|
CB = src.loc
|
|
..()
|
|
if(CB)
|
|
CB.updateIcon()
|
|
|
|
/obj/effect/decal/cleanable/crayon
|
|
name = "rune"
|
|
desc = "A rune drawn in crayon."
|
|
icon = 'rune.dmi'
|
|
layer = 2.1
|
|
anchored = 1
|
|
|
|
|
|
examine()
|
|
set src in view(2)
|
|
..()
|
|
return
|
|
|
|
|
|
New(location,main = "#FFFFFF",shade = "#000000",var/type = "rune")
|
|
..()
|
|
loc = location
|
|
|
|
name = type
|
|
desc = "A [type] drawn in crayon."
|
|
|
|
switch(type)
|
|
if("rune")
|
|
type = "rune[rand(1,6)]"
|
|
if("graffiti")
|
|
type = pick("amyjon","face","matt","revolution","engie","guy","end","dwarf","uboa")
|
|
|
|
var/icon/mainOverlay = new/icon('crayondecal.dmi',"[type]",2.1)
|
|
var/icon/shadeOverlay = new/icon('crayondecal.dmi',"[type]s",2.1)
|
|
|
|
mainOverlay.Blend(main,ICON_ADD)
|
|
shadeOverlay.Blend(shade,ICON_ADD)
|
|
|
|
overlays += mainOverlay
|
|
overlays += shadeOverlay |