Skip to content

Commit

Permalink
Fixes spray can double menu (#27944)
Browse files Browse the repository at this point in the history
* override attack_self on subtype

* whoops

* New to Initialize

* linter?

---------

Co-authored-by: Toastical <toast@toaster.com>
  • Loading branch information
Toastical and Toastical authored Jan 22, 2025
1 parent 28b41d9 commit f748079
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions code/game/objects/items/crayons.dm
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@
user.visible_message("<span class='suicide'>[user] is jamming the [name] up [user.p_their()] nose and into [user.p_their()] brain. It looks like [user.p_theyre()] trying to commit suicide!</span>")
return BRUTELOSS|OXYLOSS

/obj/item/toy/crayon/New()
..()
/obj/item/toy/crayon/Initialize(mapload)
. = ..()
drawtype = pick(pick(graffiti), pick(letters), "rune[rand(1, 8)]")

/obj/item/toy/crayon/activate_self(mob/user)
Expand Down Expand Up @@ -207,7 +207,8 @@
colour = COLOR_PURPLE
dye_color = DYE_PURPLE

/obj/item/toy/crayon/random/New()
/obj/item/toy/crayon/random/Initialize(mapload)
. = ..()
icon_state = pick("crayonred", "crayonorange", "crayonyellow", "crayongreen", "crayonblue", "crayonpurple")
switch(icon_state)
if("crayonred")
Expand All @@ -234,7 +235,6 @@
name = "purple crayon"
colour = COLOR_PURPLE
dye_color = DYE_PURPLE
..()

/obj/item/toy/crayon/black
name = "black crayon"
Expand Down Expand Up @@ -315,8 +315,9 @@
dye_color = null // not technically a crayon, so we're not gonna have it dye stuff in the laundry machine
consumable = FALSE // To stop you from eating spraycans. It's TOO SILLY!

/obj/item/toy/crayon/spraycan/New()
..()
/obj/item/toy/crayon/spraycan/Initialize(mapload)
. = ..()
RegisterSignal(src, COMSIG_ACTIVATE_SELF, TYPE_PROC_REF(/datum, signal_cancel_activate_self))
update_icon()

/obj/item/toy/crayon/spraycan/activate_self(mob/user)
Expand All @@ -329,7 +330,7 @@
capped = !capped
update_icon()
if("Change Drawing")
..()
update_window(user)
if("Change Color")
colour = tgui_input_color(user,"Please select a paint color.","Spray Can Color")
if(isnull(colour))
Expand Down

0 comments on commit f748079

Please sign in to comment.