diff --git a/code/defines/obj/toy.dm b/code/defines/obj/toy.dm index 00ac66c93cc..68746bfc60d 100644 --- a/code/defines/obj/toy.dm +++ b/code/defines/obj/toy.dm @@ -241,12 +241,16 @@ user.Weaken(5) return -/obj/item/toy/crayonbox +/obj/item/weapon/storage/crayonbox name = "box of crayons" - desc = "A box of crayons for all your drawing needs." + desc = "A box of crayons for all your rune drawing needs." icon = 'crayons.dmi' icon_state = "crayonbox" w_class = 2.0 + storage_slots = 6 + can_hold = list( + "/obj/item/toy/crayon" + ) /obj/item/toy/crayon name = "crayon" diff --git a/code/game/machinery/computer/arcade.dm b/code/game/machinery/computer/arcade.dm index 083c12c5378..f01c55134a8 100644 --- a/code/game/machinery/computer/arcade.dm +++ b/code/game/machinery/computer/arcade.dm @@ -143,7 +143,7 @@ new /obj/item/clothing/suit/syndicatefake(src.loc) new /obj/item/clothing/head/syndicatefake(src.loc) if(8) - new /obj/item/toy/crayonbox(src.loc) + new /obj/item/weapon/storage/crayonbox(src.loc) if(9) new /obj/item/toy/spinningtoy(src.loc) // if(10) //Commented out on Urist-chan's orders~ diff --git a/code/game/objects/toys.dm b/code/game/objects/toys.dm index 499d0cb1540..1100fa13a1e 100644 --- a/code/game/objects/toys.dm +++ b/code/game/objects/toys.dm @@ -2,7 +2,7 @@ //CONTAINS CRAYONS --------*/ -/obj/item/toy/crayonbox/New() +/obj/item/weapon/storage/crayonbox/New() ..() new /obj/item/toy/crayon/red(src) new /obj/item/toy/crayon/orange(src) @@ -12,13 +12,13 @@ CRAYONS new /obj/item/toy/crayon/purple(src) updateIcon() -/obj/item/toy/crayonbox/proc/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/toy/crayonbox/attackby(obj/item/W as obj, mob/user as mob) +/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") @@ -27,34 +27,37 @@ CRAYONS if("rainbow") usr << "This crayon is too powerful to be contained in this box." return - else - usr << "You add the crayon to the box." - user.drop_item() - W.loc = src - add_fingerprint(user) - updateIcon() - return - else - ..() + ..() + updateIcon() -/obj/item/toy/crayonbox/attack_hand(mob/user as mob) - if(user.r_hand == src || user.l_hand == src) - if(!contents.len) - user << "\red You're out of crayons!" +/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 + else + if (over_object.name == "l_hand") + if (!( M.l_hand )) + M.u_equip(src) + M.l_hand = src + M.update_clothing() + 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 - else - var/list/crayons = new() - for(var/obj/item/toy/crayon/C in contents) - crayons[C:colourName] = C - var/choice = input(user, "Pick a color:", "Crayon Box") in crayons as text|null - if(choice) - var/obj/crayon = crayons[choice] - user.put_in_hand(crayon) - user << "You take the [crayon:colourName] crayon out of the box." - updateIcon() - else - return ..() - icon_state = "crayonbox[contents.len]" return /obj/item/toy/crayon/red @@ -157,6 +160,14 @@ CRAYONS 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." diff --git a/maps/tgstation.2.0.8.dmm b/maps/tgstation.2.0.8.dmm index 064e2442c39..0f703672598 100755 --- a/maps/tgstation.2.0.8.dmm +++ b/maps/tgstation.2.0.8.dmm @@ -873,7 +873,7 @@ "aqO" = (/obj/item/device/radio/intercom{name = "Station Intercom (General)"; pixel_y = -29},/turf/simulated/floor{icon_state = "carpet"},/area/crew_quarters) "aqP" = (/turf/simulated/floor,/area/crew_quarters) "aqQ" = (/obj/structure/stool{pixel_y = 8},/turf/simulated/floor,/area/crew_quarters) -"aqR" = (/obj/structure/table/woodentable,/obj/item/toy/crayonbox,/turf/simulated/floor,/area/crew_quarters) +"aqR" = (/obj/structure/table/woodentable,/obj/item/weapon/storage/crayonbox,/turf/simulated/floor,/area/crew_quarters) "aqS" = (/obj/structure/table/woodentable,/turf/simulated/floor,/area/crew_quarters) "aqT" = (/obj/structure/table/woodentable,/obj/item/weapon/rag,/turf/simulated/floor,/area/crew_quarters) "aqU" = (/obj/structure/disposalpipe/segment,/obj/machinery/door/firedoor/border_only{dir = 8},/obj/machinery/door/window/northleft{base_state = "right"; dir = 8; icon_state = "right"},/turf/simulated/floor,/area/crew_quarters/fitness) @@ -6388,7 +6388,7 @@ "csR" = (/obj/machinery/door/unpowered/shuttle,/turf/simulated/shuttle/floor{icon_state = "floor3"},/area/shuttle/escape/centcom) "csS" = (/obj{anchored = 1; icon = 'shuttle.dmi'; icon_state = "floor"; layer = 1; name = "floor"},/turf/simulated/shuttle/wall{dir = 3; icon_state = "swall_f10"; layer = 2; tag = "icon-swall_f10"},/area/shuttle/escape/centcom) "csT" = (/obj/structure/closet/emcloset,/turf/simulated/shuttle/floor{icon_state = "floor3"},/area/shuttle/escape/centcom) -"csU" = (/obj/structure/rack,/obj/item/toy/crayonbox,/turf/unsimulated/floor{icon_state = "cafeteria"; dir = 2},/area/centcom/holding) +"csU" = (/obj/structure/rack,/obj/item/weapon/storage/crayonbox,/turf/unsimulated/floor{icon_state = "cafeteria"; dir = 2},/area/centcom/holding) "csV" = (/obj/machinery/vending/coffee,/obj/structure/window/reinforced{dir = 4},/turf/unsimulated/floor{icon_state = "cafeteria"; dir = 2},/area/centcom/holding) "csW" = (/obj/effect/overlay{anchored = 1; icon = 'beach.dmi'; icon_state = "crab"; name = "crab"},/turf/unsimulated/floor{icon = 'icons/misc/beach2.dmi'; icon_state = "sandwater"},/area/centcom/holding) "csX" = (/turf/unsimulated/floor{icon = 'icons/misc/beach2.dmi'; icon_state = "sandwater"},/area/centcom/holding)