diff --git a/code/datums/components/paintable.dm b/code/datums/components/paintable.dm index f0a7187149a..6450033d9ac 100644 --- a/code/datums/components/paintable.dm +++ b/code/datums/components/paintable.dm @@ -23,7 +23,7 @@ to_chat(user, "There is not enough paint in the can!") return RemoveCurrentCoat() - var/colour = spraycan.colour + var/colour = spraycan.crayon_color current_paint = colour var/atom/A = parent A.add_atom_colour(colour, FIXED_COLOUR_PRIORITY) diff --git a/code/game/objects/items/crayons.dm b/code/game/objects/items/crayons.dm index ce92f86f5e8..aee47d3fb05 100644 --- a/code/game/objects/items/crayons.dm +++ b/code/game/objects/items/crayons.dm @@ -7,13 +7,13 @@ */ /obj/item/toy/crayon name = "crayon" - desc = "A colourful crayon. Looks tasty. Mmmm..." + desc = "A colorful crayon. Looks tasty. Mmmm..." icon = 'icons/obj/crayons.dmi' icon_state = "crayonred" w_class = WEIGHT_CLASS_TINY slot_flags = ITEM_SLOT_BELT | ITEM_SLOT_BOTH_EARS - attack_verb = list("attacked", "coloured") - var/colour = COLOR_RED + attack_verb = list("attacked", "colored") + var/crayon_color = COLOR_RED var/drawtype = "rune" var/list/graffiti = list("body","amyjon","face","matt","revolution","engie","guy","end","dwarf","uboa","up","down","left","right","heart","borgsrogue","voxpox","shitcurity","catbeast","hieroglyphs1","hieroglyphs2","hieroglyphs3","security","syndicate1","syndicate2","nanotrasen","lie","valid","arrowleft","arrowright","arrowup","arrowdown","chicken","hailcrab","brokenheart","peace","scribble","scribble2","scribble3","skrek","squish","tunnelsnake","yip","youaredead") var/list/letters = 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") @@ -126,7 +126,7 @@ to_chat(user, "You start drawing a [temp] on the [target.name].") busy = TRUE if(instant || do_after(user, 50 * toolspeed, target = target)) - var/obj/effect/decal/cleanable/crayon/C = new /obj/effect/decal/cleanable/crayon(target,colour,drawtype,temp) + var/obj/effect/decal/cleanable/crayon/C = new /obj/effect/decal/cleanable/crayon(target, crayon_color, drawtype, temp) C.add_hiddenprint(user) to_chat(user, "You finish drawing [temp].") @@ -176,31 +176,31 @@ /obj/item/toy/crayon/orange name = "orange crayon" icon_state = "crayonorange" - colour = COLOR_ORANGE + crayon_color = COLOR_ORANGE dye_color = DYE_ORANGE /obj/item/toy/crayon/yellow name = "yellow crayon" icon_state = "crayonyellow" - colour = COLOR_YELLOW + crayon_color = COLOR_YELLOW dye_color = DYE_YELLOW /obj/item/toy/crayon/green name = "green crayon" icon_state = "crayongreen" - colour = COLOR_GREEN + crayon_color = COLOR_GREEN dye_color = DYE_GREEN /obj/item/toy/crayon/blue name = "blue crayon" icon_state = "crayonblue" - colour = COLOR_BLUE + crayon_color = COLOR_BLUE dye_color = DYE_BLUE /obj/item/toy/crayon/purple name = "purple crayon" icon_state = "crayonpurple" - colour = COLOR_PURPLE + crayon_color = COLOR_PURPLE dye_color = DYE_PURPLE /obj/item/toy/crayon/random/Initialize(mapload) @@ -209,39 +209,39 @@ switch(icon_state) if("crayonred") name = "red crayon" - colour = COLOR_RED + crayon_color = COLOR_RED dye_color = DYE_RED if("crayonorange") name = "orange crayon" - colour = COLOR_ORANGE + crayon_color = COLOR_ORANGE dye_color = DYE_ORANGE if("crayonyellow") name = "yellow crayon" - colour = COLOR_YELLOW + crayon_color = COLOR_YELLOW dye_color = DYE_YELLOW if("crayongreen") name = "green crayon" - colour = COLOR_GREEN + crayon_color = COLOR_GREEN dye_color = DYE_GREEN if("crayonblue") name = "blue crayon" - colour = COLOR_BLUE + crayon_color = COLOR_BLUE dye_color = DYE_BLUE if("crayonpurple") name = "purple crayon" - colour = COLOR_PURPLE + crayon_color = COLOR_PURPLE dye_color = DYE_PURPLE /obj/item/toy/crayon/black name = "black crayon" icon_state = "crayonblack" - colour = "#000000" + crayon_color = "#000000" dye_color = DYE_BLACK /obj/item/toy/crayon/white name = "white crayon" icon_state = "crayonwhite" - colour = "#FFFFFF" + crayon_color = "#FFFFFF" dye_color = DYE_WHITE /obj/item/toy/crayon/white/chalk @@ -254,22 +254,22 @@ name = "mime crayon" desc = "A very sad-looking crayon." icon_state = "crayonmime" - colour = "#FFFFFF" + crayon_color = "#FFFFFF" dye_color = DYE_MIME uses = 0 -/obj/item/toy/crayon/mime/update_window(mob/living/user as mob) - dat += "
   Change color
" +/obj/item/toy/crayon/mime/update_window(mob/living/user) + dat += "
   Change color
" ..() /obj/item/toy/crayon/mime/Topic(href,href_list) if(!Adjacent(usr) || usr.incapacitated()) return if(href_list["color"]) - if(colour != COLOR_WHITE) - colour = COLOR_WHITE + if(crayon_color != COLOR_WHITE) + crayon_color = COLOR_WHITE else - colour = COLOR_BLACK + crayon_color = COLOR_BLACK update_window(usr) else ..() @@ -277,12 +277,12 @@ /obj/item/toy/crayon/rainbow name = "rainbow crayon" icon_state = "crayonrainbow" - colour = "#FFF000" + crayon_color = "#FFF000" dye_color = DYE_RAINBOW uses = 0 -/obj/item/toy/crayon/rainbow/update_window(mob/living/user as mob) - dat += "
   Change color
" +/obj/item/toy/crayon/rainbow/update_window(mob/living/user) + dat += "
   Change color
" ..() /obj/item/toy/crayon/rainbow/Topic(href,href_list[]) @@ -292,7 +292,7 @@ var/temp = tgui_input_color(usr, "Please select crayon color.", "Crayon color") if(isnull(temp)) return - colour = temp + crayon_color = temp update_window(usr) else ..() @@ -328,8 +328,8 @@ 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)) + crayon_color = tgui_input_color(user,"Please select a paint color.","Spray Can Color") + if(isnull(crayon_color)) return update_icon() @@ -358,7 +358,7 @@ attackee.EyeBlind(2 SECONDS) attackee.lip_style = "spray_face" - attackee.lip_color = colour + attackee.lip_color = crayon_color attackee.update_body() play_spray_sound(user) @@ -372,7 +372,7 @@ /obj/item/toy/crayon/spraycan/update_overlays() . = ..() var/image/I = image('icons/obj/crayons.dmi',icon_state = "[capped ? "spraycan_cap_colors" : "spraycan_colors"]") - I.color = colour + I.color = crayon_color . += I /obj/item/toy/crayon/spraycan/proc/cardborg_recolor(obj/target, mob/user) diff --git a/code/game/objects/items/disks.dm b/code/game/objects/items/disks.dm index ace9e2bdc6b..b26e0b84249 100644 --- a/code/game/objects/items/disks.dm +++ b/code/game/objects/items/disks.dm @@ -71,3 +71,6 @@ /obj/item/storage/box/disks/populate_contents() for(var/i in 1 to 7) new /obj/item/disk/data(src) + +/obj/item/storage/box/disks/empty/populate_contents() + return diff --git a/code/game/objects/items/random_items.dm b/code/game/objects/items/random_items.dm index b5fd094b169..d3fcc301cf3 100644 --- a/code/game/objects/items/random_items.dm +++ b/code/game/objects/items/random_items.dm @@ -102,3 +102,6 @@ for(var/i in 1 to 6) var/nade = pick(grenadelist) new nade(src) + +/obj/item/storage/box/grenades/empty/populate_contents() + return diff --git a/code/game/objects/items/weapons/storage/boxes.dm b/code/game/objects/items/weapons/storage/boxes.dm index 2e78e02d67c..cd8b5b0d1fc 100644 --- a/code/game/objects/items/weapons/storage/boxes.dm +++ b/code/game/objects/items/weapons/storage/boxes.dm @@ -30,6 +30,347 @@ pickup_sound = 'sound/items/handling/cardboardbox_pickup.ogg' foldable = /obj/item/stack/sheet/cardboard foldable_amt = 1 + /// list containing a list of what this box can change into when colored, probably don't want to manually edit this, use `add_to_colorable_lists()` + var/colorable_to + + /// list containing a list of what this box can change into when colored, used in the radial menu popup. Probably don't want to manually edit this, use `add_to_colorable_lists()` + var/colorable_to_radial + + /// state that determines what this can be colored to + var/color_state + +/obj/item/storage/box/red_trim + icon_state = "sec_box" + color_state = "red_trim" + +/obj/item/storage/box/red_trim/empty/populate_contents() + return + +/obj/item/storage/box/red_trim/Initialize(mapload) + . = ..() + if(color_state != "red_trim") + return + + add_to_colorable_lists("red box", COLOR_RED, /obj/item/storage/box/red_full/empty) + + add_to_colorable_lists("prisoner ID box", COLOR_BLACK, /obj/item/storage/box/prisoner/empty) + add_to_colorable_lists("evidence bag box", COLOR_BLACK, /obj/item/storage/box/evidence/empty) + add_to_colorable_lists("holobadge box", COLOR_BLACK, /obj/item/storage/box/holobadge/empty) + add_to_colorable_lists("handcuffs box", COLOR_BLACK, /obj/item/storage/box/handcuffs/empty) + add_to_colorable_lists("ziptie box", COLOR_BLACK, /obj/item/storage/box/zipties/empty) + add_to_colorable_lists("grenade box", COLOR_BLACK, /obj/item/storage/box/grenades/empty) + add_to_colorable_lists("flashbang box", COLOR_BLACK, /obj/item/storage/box/flashbangs/empty) + add_to_colorable_lists("teargas grenade box", COLOR_BLACK, /obj/item/storage/box/teargas/empty) + add_to_colorable_lists("emp grenade box", COLOR_BLACK, /obj/item/storage/box/emps/empty) + add_to_colorable_lists("flashbulb box", COLOR_BLACK, /obj/item/storage/box/flashes/empty) + +/obj/item/storage/box/red_full + icon_state = "red_full" + color_state = "red_full" + +/obj/item/storage/box/red_full/empty/populate_contents() + return + +/obj/item/storage/box/red_full/Initialize(mapload) + . = ..() + if(color_state != "red_full") + return + + add_to_colorable_lists("N2 box", COLOR_RED, /obj/item/storage/box/survival_vox/empty) + + add_to_colorable_lists("monkey cube box", COLOR_BLACK, /obj/item/storage/box/monkeycubes/empty) + add_to_colorable_lists("naera cube box", COLOR_BLACK, /obj/item/storage/box/monkeycubes/neaeracubes/empty) + add_to_colorable_lists("stok cube box", COLOR_BLACK, /obj/item/storage/box/monkeycubes/stokcubes/empty) + add_to_colorable_lists("farwa cube box", COLOR_BLACK, /obj/item/storage/box/monkeycubes/farwacubes/empty) + add_to_colorable_lists("wolpin cube box", COLOR_BLACK, /obj/item/storage/box/monkeycubes/wolpincubes/empty) + add_to_colorable_lists("nian worme cube box", COLOR_BLACK, /obj/item/storage/box/monkeycubes/nian_worme_cubes/empty) + add_to_colorable_lists("suspicious ID box", COLOR_BLACK, /obj/item/storage/box/id_syndie_box/empty) + +/obj/item/storage/box/id_syndie_box + name = "Suspicious ID box" + desc = "A dusty box meant for IDs." + icon_state = "id_syndie_box" + +/obj/item/storage/box/id_syndie_box/empty/populate_contents() + return + +/obj/item/storage/box/blue_trim + icon_state = "med_box" + color_state = "blue_trim" + +/obj/item/storage/box/blue_trim/empty/populate_contents() + return + +/obj/item/storage/box/blue_trim/Initialize(mapload) + . = ..() + if(color_state != "blue_trim") + return + + add_to_colorable_lists("syringe box", COLOR_BLACK, /obj/item/storage/box/syringes/empty) + add_to_colorable_lists("injector box", COLOR_BLACK, /obj/item/storage/box/injectors/empty) + add_to_colorable_lists("mask box", COLOR_BLACK, /obj/item/storage/box/masks/empty) + add_to_colorable_lists("pill bottle box", COLOR_BLACK, /obj/item/storage/box/pillbottles/empty) + add_to_colorable_lists("patch pack box", COLOR_BLACK, /obj/item/storage/box/patch_packs/empty) + add_to_colorable_lists("bodybag box", COLOR_BLACK, /obj/item/storage/box/bodybags/empty) + add_to_colorable_lists("glasses box", COLOR_BLACK, /obj/item/storage/box/rxglasses/empty) + add_to_colorable_lists("latex gloves box", COLOR_BLACK, /obj/item/storage/box/gloves/empty) + add_to_colorable_lists("iv bag box", COLOR_BLACK, /obj/item/storage/box/iv_bags/empty) + add_to_colorable_lists("beaker box", COLOR_BLACK, /obj/item/storage/box/beakers/empty) + add_to_colorable_lists("bluespace beaker box", COLOR_BLACK, /obj/item/storage/box/beakers/bluespace/empty) + + add_to_colorable_lists("blue box", COLOR_BLUE, /obj/item/storage/box/blue_full/empty) + + +/obj/item/storage/box/blue_full + icon_state = "blue_full" + color_state = "blue_full" + +/obj/item/storage/box/blue_full/empty/populate_contents() + return + +/obj/item/storage/box/blue_full/Initialize(mapload) + . = ..() + if(color_state != "blue_full") + return + + add_to_colorable_lists("blue O2 box", COLOR_BLUE, /obj/item/storage/box/survival/empty) + add_to_colorable_lists("yellow O2 box", COLOR_YELLOW, /obj/item/storage/box/engineer/empty) + add_to_colorable_lists("purple O2 box", COLOR_PURPLE, /obj/item/storage/box/survival_mining/empty) + + +/obj/item/storage/box/yellow_full + icon_state = "yellow_full" + color_state = "yellow_full" + +/obj/item/storage/box/yellow_full/empty/populate_contents() + return + +/obj/item/storage/box/yellow_full/Initialize(mapload) + . = ..() + if(color_state != "yellow_full") + return + + add_to_colorable_lists("toy box", COLOR_BLACK, /obj/item/storage/box/characters/empty) + +/obj/item/storage/box/green_full + icon_state = "green_full" + color_state = "green_full" + +/obj/item/storage/box/green_full/empty/populate_contents() + return + +/obj/item/storage/box/green_full/Initialize(mapload) + . = ..() + if(color_state != "green_full") + return + + add_to_colorable_lists("soviet box", COLOR_RED, /obj/item/storage/box/soviet/empty) + + +/obj/item/storage/box/orange_full + icon_state = "orange_full" + color_state = "orange_full" + +/obj/item/storage/box/orange_full/empty/populate_contents() + return + +/obj/item/storage/box/orange_full/Initialize(mapload) + . = ..() + if(color_state != "orange_full") + return + + add_to_colorable_lists("plasma box", COLOR_BLACK, /obj/item/storage/box/survival_plasmaman/empty) + + +/obj/item/storage/box/black_full + icon_state = "black_full" + color_state = "black_full" + +/obj/item/storage/box/black_full/empty/populate_contents() + return + +/obj/item/storage/box/black_full/Initialize(mapload) + . = ..() + if(color_state != "black_full") + return + + add_to_colorable_lists("nanotrasen box", COLOR_BLUE, /obj/item/storage/box/responseteam/empty) + add_to_colorable_lists("cybernetic Implants box", COLOR_BLUE, /obj/item/storage/box/cyber_implants/empty) + + add_to_colorable_lists("suspicious box", COLOR_RED, /obj/item/storage/box/fakesyndiesuit/empty) + add_to_colorable_lists("black O2 box", COLOR_RED, /obj/item/storage/box/survival_syndie/empty) + +/obj/item/storage/box/purple_full + icon_state = "purple_full" + color_state = "purple_full" + +/obj/item/storage/box/purple_full/empty/populate_contents() + return + +/obj/item/storage/box/purple_full/Initialize(mapload) + . = ..() + if(color_state != "purple_full") + return + + add_to_colorable_lists("purple handcuffs box", COLOR_GREEN, /obj/item/storage/box/alienhandcuffs/empty) + add_to_colorable_lists("purple and green box", COLOR_GREEN, /obj/item/storage/box/alien_box/empty) + + add_to_colorable_lists("wizard box", COLOR_YELLOW, /obj/item/storage/box/wizard/empty) + + add_to_colorable_lists("hug box", COLOR_RED, /obj/item/storage/box/hug/empty) + +/obj/item/storage/box/alien_box + icon_state = "alien_box" + color_state = "alien_box" + +/obj/item/storage/box/alien_box/empty/populate_contents() + return + +/obj/item/storage/box/alien_box/Initialize(mapload) + . = ..() + if(color_state != "alien_box") + return + + add_to_colorable_lists("purple handcuffs box", COLOR_GREEN, /obj/item/storage/box/alienhandcuffs/empty) + + +/obj/item/storage/box/AltClick(mob/user, modifiers) + var/active_hand = user.get_active_hand() + if(!istype(active_hand, /obj/item/toy/crayon)) // any other item than a crayon will trigger normal behavior + ..() + return + + if(colorable_to == null) // if the player is holding a crayon, but no available color exists, also trigger normal behaviour + ..() + return + + if(HAS_TRAIT(user, TRAIT_HANDS_BLOCKED)) + return + + if(user.incapacitated()) + return + + var/obj/item/toy/crayon/crayon = active_hand + var/color_list = colorable_to_radial[crayon.crayon_color] + var/new_box + + // if we don't have a fitting color for the box, just open it + if(color_list == null) + . = ..() + return + + // some inventories might be of different sizes or accept different items, + // for consistency, we dissalow painting with items inside + if(length(contents)) + to_chat(usr, "\The [src] is too unstable to be painted, empty it first.") + return + + if(crayon.crayon_color == COLOR_WHITE) //if the box can be recolored, also allow clearing of color + to_chat(usr, "You clear [src] of its color.") + new_box = make_new_box(/obj/item/storage/box) + else + var/selected_icon = show_radial_menu(user, user, color_list) + + if(selected_icon == null) + return + + // check again in case the player moved after selecting the box, or put an item back into the box + if(!in_range(user, src) || user.incapacitated() || length(contents)) + return + + // check if the player dropped their crayon, or swapped to a different one + if(crayon != user.get_active_hand()) + return + + //make a new box from the color table with the selected id + new_box = make_new_box(colorable_to[crayon.crayon_color][selected_icon]) + + if(new_box != null) + var/place_in_hand = (user.get_inactive_hand() == src) //the active hand should have a crayon + + var/obj/item/storage/previous_bag + if(isstorage(src.loc)) + previous_bag = src.loc + + qdel(src) + // add to a bag if it was in one + if(previous_bag != null) + if(previous_bag.can_be_inserted(new_box)) + previous_bag.contents += new_box + // try to equip it in this hand first, without the sound playing + else if(place_in_hand) + if(!user.equip_to_slot_if_possible(new_box, ITEM_SLOT_RIGHT_HAND, 0, 1, 1)) + user.equip_to_slot_if_possible(new_box, ITEM_SLOT_LEFT_HAND, 0, 1, 1) + + // check if the box being deleted is open, if its not update the open inventory (prevents runtime) + if(user.s_active != null && user.s_active != src) + user.s_active.show_to(user) + + // if we don't place it in hand or in a bag, leave the box on the ground + +/obj/item/storage/box/proc/make_new_box(type) + var/turf = get_turf(src) + var/new_box = new type(turf) + return new_box + +/obj/item/storage/box/Initialize(mapload) + . = ..() + if(icon_state != "box") + return + + add_to_colorable_lists("red trimmed box", COLOR_RED, /obj/item/storage/box/red_trim/empty) + add_to_colorable_lists("mousetrap box", COLOR_RED, /obj/item/storage/box/mousetraps/empty) + add_to_colorable_lists("red box", COLOR_RED, /obj/item/storage/box/red_full/empty) + + add_to_colorable_lists("blue trimmed box", COLOR_BLUE, /obj/item/storage/box/blue_trim/empty) + add_to_colorable_lists("blue box", COLOR_BLUE, /obj/item/storage/box/blue_full/empty) + + add_to_colorable_lists("purple box", COLOR_PURPLE, /obj/item/storage/box/purple_full/empty) + + add_to_colorable_lists("yellow box", COLOR_YELLOW, /obj/item/storage/box/yellow_full/empty) + + add_to_colorable_lists("green box", COLOR_GREEN, /obj/item/storage/box/green_full/empty) + + add_to_colorable_lists("orange box", COLOR_ORANGE, /obj/item/storage/box/orange_full/empty) + + add_to_colorable_lists("cup box", COLOR_BLACK, /obj/item/storage/box/cups/empty) + add_to_colorable_lists("tape box", COLOR_BLACK, /obj/item/storage/box/tapes/empty) + add_to_colorable_lists("ID box", COLOR_BLACK, /obj/item/storage/box/ids/empty) + add_to_colorable_lists("pda box", COLOR_BLACK, /obj/item/storage/box/pdas/empty) + add_to_colorable_lists("disk box", COLOR_BLACK, /obj/item/storage/box/disks/empty) + add_to_colorable_lists("circuit box", COLOR_BLACK, /obj/item/storage/box/rndboards/empty) + add_to_colorable_lists("implants box", COLOR_BLACK, /obj/item/storage/box/trackimp/empty) + add_to_colorable_lists("black box", COLOR_BLACK, /obj/item/storage/box/black_full/empty) + +/obj/item/storage/box/examine(mob/user) + . = ..() + if(color_state != null || icon_state == "box") + . += "Alt-Click [src] with an appropriate crayon in hand to color it." + +/// helper function to add to the colors a box can turn into +/// * name - the name of the new box in the radial menu +/// * color - what color of crayon caused the box to change +/// * object - the new item to create when you recolor a box +/obj/item/storage/box/proc/add_to_colorable_lists(name, color, object) + if(colorable_to == null) + colorable_to = list() + + if(colorable_to[color] == null) + colorable_to[color] = list() + + if(colorable_to_radial == null) + colorable_to_radial = list() + + if(colorable_to_radial[color] == null) + colorable_to_radial[color] = list() + + colorable_to[color][name] = object + colorable_to_radial[color][name] = image_from_obj(object) + + +/obj/item/storage/box/proc/image_from_obj(obj/object) + return image(object.icon, object.icon_state) + /obj/item/storage/box/large name = "large box" @@ -57,6 +398,8 @@ new /obj/item/reagent_containers/hypospray/autoinjector/epinephrine(src) new /obj/item/flashlight/flare/glowstick/emergency(src) +/obj/item/storage/box/survival/empty/populate_contents() + return /obj/item/storage/box/survival_vox icon_state = "vox_box" @@ -71,6 +414,9 @@ new /obj/item/reagent_containers/hypospray/autoinjector/epinephrine(src) new /obj/item/flashlight/flare/glowstick/emergency(src) +/obj/item/storage/box/survival_vox/empty/populate_contents() + return + /obj/item/storage/box/survival_plasmaman icon_state = "plasma_box" @@ -84,6 +430,9 @@ new /obj/item/reagent_containers/hypospray/autoinjector/epinephrine(src) new /obj/item/flashlight/flare/glowstick/emergency(src) +/obj/item/storage/box/survival_plasmaman/empty/populate_contents() + return + /obj/item/storage/box/engineer icon_state = "eng_box" @@ -98,6 +447,9 @@ new /obj/item/reagent_containers/hypospray/autoinjector/epinephrine(src) new /obj/item/flashlight/flare/glowstick/emergency(src) +/obj/item/storage/box/engineer/empty/populate_contents() + return + /obj/item/storage/box/survival_mining icon_state = "min_box" @@ -112,6 +464,9 @@ new /obj/item/reagent_containers/hypospray/autoinjector/epinephrine(src) new /obj/item/flashlight/flare/glowstick/emergency(src) +/obj/item/storage/box/survival_mining/empty/populate_contents() + return + /obj/item/storage/box/survival_syndie icon_state = "syndie_box" desc = "A sleek, sturdy box." @@ -124,6 +479,9 @@ new /obj/item/reagent_containers/pill/initropidril(src) new /obj/item/flashlight/flare/glowstick/red(src) +/obj/item/storage/box/survival_syndie/empty/populate_contents() + return + /obj/item/storage/box/survival_syndie/traitor/populate_contents() new /obj/item/clothing/mask/gas/syndicate(src) new /obj/item/tank/internals/emergency_oxygen/engi/syndi(src) @@ -155,6 +513,9 @@ for(var/I in 1 to 6) new /obj/item/tape/random(src) +/obj/item/storage/box/tapes/empty/populate_contents() + return + /obj/item/storage/box/cups name = "box of paper cups" desc = "It has pictures of paper cups on the front." @@ -164,6 +525,9 @@ for(var/I in 1 to 7) new /obj/item/reagent_containers/drinks/sillycup(src) +/obj/item/storage/box/cups/empty/populate_contents() + return + /obj/item/storage/box/drinkingglasses name = "box of drinking glasses" desc = "It has a picture of drinking glasses on it." @@ -172,6 +536,9 @@ for(var/I in 1 to 6) new /obj/item/reagent_containers/drinks/drinkingglass(src) +/obj/item/storage/box/drinkingglasses/empty/populate_contents() + return + /obj/item/storage/box/condimentbottles name = "box of condiment bottles" desc = "It has a large ketchup smear on it." @@ -189,6 +556,9 @@ for(var/I in 1 to 6) new /obj/item/assembly/mousetrap(src) +/obj/item/storage/box/mousetraps/empty/populate_contents() + return + /obj/item/storage/box/ids name = "spare IDs" desc = "Has so many empty IDs." @@ -198,6 +568,9 @@ for(var/I in 1 to 7) new /obj/item/card/id(src) +/obj/item/storage/box/ids/empty/populate_contents() + return + /obj/item/storage/box/lights name = "replacement bulbs" desc = "This box is shaped on the inside so that only light tubes and bulbs fit." @@ -257,6 +630,9 @@ new /obj/item/cartridge/head(src) new newcart(src) +/obj/item/storage/box/pdas/empty/populate_contents() + return + /////////////////// /* Special Boxes */ /////////////////// @@ -334,6 +710,9 @@ new /obj/item/toy/character/cthulhu(src) new /obj/item/toy/character/lich(src) +/obj/item/storage/box/characters/empty/populate_contents() + return + /obj/item/storage/box/large/rnd_parts name = "\improper R&D components box" desc = "A full set of labelled components for assembling an R&D setup with. There are wordless picrographs of how to assemble everything on the back." @@ -403,6 +782,9 @@ for(var/I in 1 to 5) new monkey_cube_type(src) +/obj/item/storage/box/monkeycubes/empty/populate_contents() + return + /obj/item/storage/box/monkeycubes/obj_destruction(damage_flag) if(damage_flag == ACID || damage_flag == FIRE) for(var/obj/item/food/monkeycube/mkc in contents) @@ -419,30 +801,45 @@ icon_state = "farwa_box" monkey_cube_type = /obj/item/food/monkeycube/farwacube +/obj/item/storage/box/monkeycubes/farwacubes/empty/populate_contents() + return + /obj/item/storage/box/monkeycubes/stokcubes name = "stok cube box" desc = "Drymate brand stok cubes. Just add water!" icon_state = "stok_box" monkey_cube_type = /obj/item/food/monkeycube/stokcube +/obj/item/storage/box/monkeycubes/stokcubes/empty/populate_contents() + return + /obj/item/storage/box/monkeycubes/neaeracubes name = "neaera cube box" desc = "Drymate brand neaera cubes. Just add water!" icon_state = "neaera_box" monkey_cube_type = /obj/item/food/monkeycube/neaeracube +/obj/item/storage/box/monkeycubes/neaeracubes/empty/populate_contents() + return + /obj/item/storage/box/monkeycubes/wolpincubes name = "wolpin cube box" desc = "Drymate brand wolpin cubes. Just add water!" icon_state = "wolpin_box" monkey_cube_type = /obj/item/food/monkeycube/wolpincube +/obj/item/storage/box/monkeycubes/wolpincubes/empty/populate_contents() + return + /obj/item/storage/box/monkeycubes/nian_worme_cubes name = "nian worme cube box" desc = "Nian Trade Guild brand worme cubes. Just add water!" icon_state = "nian_worme_box" monkey_cube_type = /obj/item/food/monkeycube/nian_wormecube +/obj/item/storage/box/monkeycubes/nian_worme_cubes/empty/populate_contents() + return + /////////////////// /* Medical Boxes */ /////////////////// @@ -455,6 +852,9 @@ for(var/I in 1 to 7) new /obj/item/clothing/gloves/color/latex(src) +/obj/item/storage/box/gloves/empty/populate_contents() + return + /obj/item/storage/box/masks name = "sterile masks" desc = "This box contains masks of sterility." @@ -464,6 +864,9 @@ for(var/I in 1 to 7) new /obj/item/clothing/mask/surgical(src) +/obj/item/storage/box/masks/empty/populate_contents() + return + /obj/item/storage/box/syringes name = "syringes" desc = "A box full of syringes." @@ -473,6 +876,9 @@ for(var/I in 1 to 7) new /obj/item/reagent_containers/syringe(src) +/obj/item/storage/box/syringes/empty/populate_contents() + return + /obj/item/storage/box/beakers name = "beaker box" icon_state = "beaker_box" @@ -481,6 +887,9 @@ for(var/I in 1 to 7) new /obj/item/reagent_containers/glass/beaker(src) +/obj/item/storage/box/beakers/empty/populate_contents() + return + /obj/item/storage/box/beakers/bluespace name = "box of bluespace beakers" icon_state = "beaker_bs_box" @@ -489,6 +898,9 @@ for(var/I in 1 to 7) new /obj/item/reagent_containers/glass/beaker/bluespace(src) +/obj/item/storage/box/beakers/bluespace/empty/populate_contents() + return + /obj/item/storage/box/iv_bags name = "IV Bags" desc = "A box full of empty IV bags." @@ -498,6 +910,9 @@ for(var/I in 1 to 7) new /obj/item/reagent_containers/iv_bag(src) +/obj/item/storage/box/iv_bags/empty/populate_contents() + return + /obj/item/storage/box/autoinjectors name = "box of injectors" desc = "Contains autoinjectors." @@ -507,6 +922,9 @@ for(var/I in 1 to storage_slots) new /obj/item/reagent_containers/hypospray/autoinjector/epinephrine(src) +/obj/item/storage/box/autoinjectors/empty/populate_contents() + return + /obj/item/storage/box/autoinjectors/utility name = "autoinjector kit" desc = "A box with several utility autoinjectors for the economical miner." @@ -528,6 +946,9 @@ var/obj/item/storage/pill_bottle/P = new /obj/item/storage/pill_bottle(src) P.apply_wrapper_color(I) +/obj/item/storage/box/pillbottles/empty/populate_contents() + return + /obj/item/storage/box/patch_packs name = "box of patch packs" desc = "It has pictures of patch packs on its front." @@ -538,6 +959,9 @@ var/obj/item/storage/pill_bottle/P = new /obj/item/storage/pill_bottle/patch_pack(src) P.apply_wrapper_color(I) +/obj/item/storage/box/patch_packs/empty/populate_contents() + return + /obj/item/storage/box/bodybags name = "body bags" desc = "This box contains body bags." @@ -547,6 +971,9 @@ for(var/I in 1 to 7) new /obj/item/bodybag(src) +/obj/item/storage/box/bodybags/empty/populate_contents() + return + /obj/item/storage/box/rxglasses name = "prescription glasses" desc = "This box contains nerd glasses." @@ -556,6 +983,9 @@ for(var/I in 1 to 7) new /obj/item/clothing/glasses/regular(src) +/obj/item/storage/box/rxglasses/empty/populate_contents() + return + //////////////////// /* Security Boxes */ //////////////////// @@ -568,6 +998,9 @@ for(var/I in 1 to 7) new /obj/item/grenade/flashbang(src) +/obj/item/storage/box/flashbangs/empty/populate_contents() + return + /obj/item/storage/box/stingers name = "box of stinger grenades (WARNING)" desc = "WARNING: These devices are dangerous and can cause significant physical harm with repeated use." @@ -595,6 +1028,9 @@ for(var/I in 1 to 6) new /obj/item/flash(src) +/obj/item/storage/box/flashes/empty/populate_contents() + return + /obj/item/storage/box/teargas name = "box of tear gas grenades (WARNING)" desc = "WARNING: These devices are extremely dangerous and can cause blindness and skin irritation." @@ -604,6 +1040,9 @@ for(var/I in 1 to 7) new /obj/item/grenade/chem_grenade/teargas(src) +/obj/item/storage/box/teargas/empty/populate_contents() + return + /obj/item/storage/box/emps name = "emp grenades" desc = "A box with 5 emp grenades." @@ -613,6 +1052,9 @@ for(var/I in 1 to 5) new /obj/item/grenade/empgrenade(src) +/obj/item/storage/box/emps/empty/populate_contents() + return + /obj/item/storage/box/prisoner name = "prisoner IDs" desc = "Take away their last shred of dignity, their name." @@ -627,6 +1069,9 @@ new /obj/item/card/id/prisoner/six(src) new /obj/item/card/id/prisoner/seven(src) +/obj/item/storage/box/prisoner/empty/populate_contents() + return + /obj/item/storage/box/seccarts name = "spare R.O.B.U.S.T. Cartridges" desc = "A box full of R.O.B.U.S.T. Cartridges, used by Security." @@ -649,6 +1094,9 @@ new /obj/item/clothing/accessory/holobadge/cord(src) new /obj/item/clothing/accessory/holobadge/cord(src) +/obj/item/storage/box/holobadge/empty/populate_contents() + return + /obj/item/storage/box/evidence name = "evidence bag box" desc = "A box claiming to contain evidence bags." @@ -658,6 +1106,9 @@ for(var/I in 1 to 6) new /obj/item/evidencebag(src) +/obj/item/storage/box/evidence/empty/populate_contents() + return + /obj/item/storage/box/handcuffs name = "spare handcuffs" desc = "A box full of handcuffs." @@ -667,6 +1118,9 @@ for(var/I in 1 to 7) new /obj/item/restraints/handcuffs(src) +/obj/item/storage/box/handcuffs/empty/populate_contents() + return + /obj/item/storage/box/zipties name = "box of spare zipties" desc = "A box full of zipties." @@ -676,6 +1130,9 @@ for(var/I in 1 to 7) new /obj/item/restraints/handcuffs/cable/zipties(src) +/obj/item/storage/box/zipties/empty/populate_contents() + return + //////////////////// /* Implants Boxes */ //////////////////// @@ -693,6 +1150,9 @@ new /obj/item/bio_chip_pad(src) new /obj/item/gps/security(src) +/obj/item/storage/box/trackimp/empty/populate_contents() + return + /obj/item/storage/box/minertracker name = "boxed tracking bio-chip kit" desc = "For finding those who have died on the accursed lavaworld." @@ -1041,6 +1501,9 @@ for(var/I in 1 to 7) new /obj/item/restraints/handcuffs/alien(src) +/obj/item/storage/box/alienhandcuffs/empty/populate_contents() + return + /obj/item/storage/box/fakesyndiesuit name = "boxed space suit and helmet" desc = "A sleek, sturdy box used to hold replica spacesuits." @@ -1050,6 +1513,9 @@ new /obj/item/clothing/head/syndicatefake(src) new /obj/item/clothing/suit/syndicatefake(src) +/obj/item/storage/box/fakesyndiesuit/empty/populate_contents() + return + /obj/item/storage/box/enforcer_rubber name = "\improper Enforcer pistol kit (rubber)" desc = "A box marked with pictures of an Enforcer pistol, two ammo clips, and the word 'NON-LETHAL'." @@ -1179,6 +1645,8 @@ for(var/I in 1 to 6) new /obj/item/dnainjector/h2m(src) +/obj/item/storage/box/injectors/empty/populate_contents() + return #define NODESIGN "None" #define NANOTRASEN "NanotrasenStandard" @@ -1297,6 +1765,9 @@ new /obj/item/radio/centcom(src) new /obj/item/reagent_containers/hypospray/autoinjector/survival(src) +/obj/item/storage/box/responseteam/empty/populate_contents() + return + /obj/item/storage/box/deathsquad name = "boxed death kit" icon_state = "doom_box" @@ -1325,6 +1796,9 @@ new /obj/item/reagent_containers/patch/synthflesh(src) new /obj/item/reagent_containers/patch/synthflesh(src) +/obj/item/storage/box/soviet/empty/populate_contents() + return + /obj/item/storage/box/clown name = "clown box" desc = "A colorful cardboard box for the clown." @@ -1350,6 +1824,9 @@ new /obj/item/circuitboard/rdconsole/public(src) new /obj/item/circuitboard/rnd_network_controller(src) +/obj/item/storage/box/rndboards/empty/populate_contents() + return + /obj/item/storage/box/stockparts display_contents_with_number = TRUE @@ -1409,12 +1886,18 @@ playsound(loc, "rustle", 50, TRUE, -5) user.visible_message("[user] hugs \the [src].","You hug \the [src].") +/obj/item/storage/box/hug/empty/populate_contents() + return + /obj/item/storage/box/wizard name = "magical box" desc = "It's just an ordinary magical box." icon_state = "wizard_box" w_class = WEIGHT_CLASS_GIGANTIC +/obj/item/storage/box/wizard/empty/populate_contents() + return + /obj/item/storage/box/wizard/hardsuit name = "battlemage armour bundle" desc = "This box contains a bundle of Battlemage Armour." diff --git a/code/game/objects/structures/stool_bed_chair_nest/chairs.dm b/code/game/objects/structures/stool_bed_chair_nest/chairs.dm index 1523fa3547b..429ab14f3f2 100644 --- a/code/game/objects/structures/stool_bed_chair_nest/chairs.dm +++ b/code/game/objects/structures/stool_bed_chair_nest/chairs.dm @@ -323,7 +323,7 @@ return if(istype(I, /obj/item/toy/crayon)) var/obj/item/toy/crayon/C = I - var/new_color = C.colour + var/new_color = C.crayon_color var/list/hsl = rgb2hsl(hex2num(copytext(new_color, 2, 4)), hex2num(copytext(new_color, 4, 6)), hex2num(copytext(new_color, 6, 8))) hsl[3] = max(hsl[3], 0.4) var/list/rgb = hsl2rgb(arglist(hsl)) @@ -441,7 +441,7 @@ /obj/structure/chair/sofa/bench/item_interaction(mob/living/user, obj/item/I, list/modifiers) if(istype(I, /obj/item/toy/crayon)) var/obj/item/toy/crayon/C = I - set_cover_color(C.colour) + set_cover_color(C.crayon_color) return ITEM_INTERACT_COMPLETE /obj/structure/chair/sofa/bench/proc/set_cover_color(new_color) diff --git a/code/modules/power/lights.dm b/code/modules/power/lights.dm index 9ef6334f372..018ccebce89 100644 --- a/code/modules/power/lights.dm +++ b/code/modules/power/lights.dm @@ -613,7 +613,7 @@ if(spraycan.capped) to_chat(user, "You can't spraypaint [src] with the cap still on!") return ITEM_INTERACT_COMPLETE - var/list/hsl = rgb2hsl(hex2num(copytext(spraycan.colour, 2, 4)), hex2num(copytext(spraycan.colour, 4, 6)), hex2num(copytext(spraycan.colour, 6, 8))) + var/list/hsl = rgb2hsl(hex2num(copytext(spraycan.crayon_color, 2, 4)), hex2num(copytext(spraycan.crayon_color, 4, 6)), hex2num(copytext(spraycan.crayon_color, 6, 8))) hsl[3] = max(hsl[3], 0.4) var/list/rgb = hsl2rgb(arglist(hsl)) var/new_color = "#[num2hex(rgb[1], 2)][num2hex(rgb[2], 2)][num2hex(rgb[3], 2)]" diff --git a/code/modules/surgery/organs/augments_internal.dm b/code/modules/surgery/organs/augments_internal.dm index 5af55a58f4a..6480cafc523 100644 --- a/code/modules/surgery/organs/augments_internal.dm +++ b/code/modules/surgery/organs/augments_internal.dm @@ -1068,3 +1068,6 @@ while(length(contents) <= amount) implant = pick(boxed) new implant(src) + +/obj/item/storage/box/cyber_implants/empty/populate_contents() + return diff --git a/icons/obj/boxes.dmi b/icons/obj/boxes.dmi index 502423c891a..c49136f1b88 100644 Binary files a/icons/obj/boxes.dmi and b/icons/obj/boxes.dmi differ