From 9aed4725314a142973bcd2ed5e47a5734e7dcc37 Mon Sep 17 00:00:00 2001 From: mwerezak Date: Thu, 5 Mar 2015 11:04:52 -0500 Subject: [PATCH] Minor storage cleanup Demotes folding to storage/box, makes doughnut boxes a subtype of box. Removes a couple of istype() hacks from storage. --- code/game/machinery/vending.dm | 2 +- .../items/stacks/sheets/sheet_types.dm | 2 +- .../objects/items/weapons/storage/backpack.dm | 6 ++++ .../objects/items/weapons/storage/boxes.dm | 26 +++++++++++++- .../objects/items/weapons/storage/misc.dm | 8 ++--- .../objects/items/weapons/storage/storage.dm | 36 +++---------------- maps/exodus-1.dmm | 10 +++--- maps/exodus-2.dmm | 4 +-- 8 files changed, 49 insertions(+), 45 deletions(-) diff --git a/code/game/machinery/vending.dm b/code/game/machinery/vending.dm index 10a939fd49..6f941674f2 100644 --- a/code/game/machinery/vending.dm +++ b/code/game/machinery/vending.dm @@ -837,7 +837,7 @@ req_access = list(access_security) products = list(/obj/item/weapon/handcuffs = 8,/obj/item/weapon/grenade/flashbang = 4,/obj/item/device/flash = 5, /obj/item/weapon/reagent_containers/food/snacks/donut/normal = 12,/obj/item/weapon/storage/box/evidence = 6) - contraband = list(/obj/item/clothing/glasses/sunglasses = 2,/obj/item/weapon/storage/donut_box = 2) + contraband = list(/obj/item/clothing/glasses/sunglasses = 2,/obj/item/weapon/storage/box/donut = 2) /obj/machinery/vending/hydronutrients name = "NutriMax" diff --git a/code/game/objects/items/stacks/sheets/sheet_types.dm b/code/game/objects/items/stacks/sheets/sheet_types.dm index 47c812a99e..f6ceca6d20 100644 --- a/code/game/objects/items/stacks/sheets/sheet_types.dm +++ b/code/game/objects/items/stacks/sheets/sheet_types.dm @@ -187,7 +187,7 @@ var/global/list/datum/stack_recipe/wood_recipes = list ( \ */ var/global/list/datum/stack_recipe/cardboard_recipes = list ( \ new/datum/stack_recipe("box", /obj/item/weapon/storage/box), \ - new/datum/stack_recipe("donut box", /obj/item/weapon/storage/donut_box/empty), \ + new/datum/stack_recipe("donut box", /obj/item/weapon/storage/box/donut/empty), \ new/datum/stack_recipe("egg box", /obj/item/weapon/storage/fancy/egg_box), \ new/datum/stack_recipe("light tubes", /obj/item/weapon/storage/box/lights/tubes), \ new/datum/stack_recipe("light bulbs", /obj/item/weapon/storage/box/lights/bulbs), \ diff --git a/code/game/objects/items/weapons/storage/backpack.dm b/code/game/objects/items/weapons/storage/backpack.dm index d76f594a2a..40937ea61c 100644 --- a/code/game/objects/items/weapons/storage/backpack.dm +++ b/code/game/objects/items/weapons/storage/backpack.dm @@ -67,6 +67,12 @@ return */ ..() + + //Please don't clutter the parent storage item with stupid hacks. + can_be_inserted(obj/item/W as obj, stop_messages = 0) + if(istype(W, /obj/item/weapon/storage/backpack/holding)) + return 1 + return ..() proc/failcheck(mob/user as mob) if (prob(src.reliability)) return 1 //No failure diff --git a/code/game/objects/items/weapons/storage/boxes.dm b/code/game/objects/items/weapons/storage/boxes.dm index ca4227dd91..4c0c58a05a 100644 --- a/code/game/objects/items/weapons/storage/boxes.dm +++ b/code/game/objects/items/weapons/storage/boxes.dm @@ -24,7 +24,31 @@ desc = "It's just an ordinary box." icon_state = "box" item_state = "syringe_kit" - foldable = /obj/item/stack/sheet/cardboard //BubbleWrap + var/foldable = null // BubbleWrap - if set, can be folded (when empty) into a sheet of cardboard + +// BubbleWrap - A box can be folded up to make card +/obj/item/weapon/storage/box/attack_self(mob/user as mob) + if(..()) return + + //try to fold it. + if ( contents.len ) + return + + if ( !ispath(src.foldable) ) + return + var/found = 0 + // Close any open UI windows first + for(var/mob/M in range(1)) + if (M.s_active == src) + src.close(M) + if ( M == user ) + found = 1 + if ( !found ) // User is too far away + return + // Now make the cardboard + user << "You fold [src] flat." + new src.foldable(get_turf(src)) + del(src) /obj/item/weapon/storage/box/survival/ New() diff --git a/code/game/objects/items/weapons/storage/misc.dm b/code/game/objects/items/weapons/storage/misc.dm index ab40f02839..814ee3b12c 100644 --- a/code/game/objects/items/weapons/storage/misc.dm +++ b/code/game/objects/items/weapons/storage/misc.dm @@ -11,7 +11,7 @@ * Donut Box */ -/obj/item/weapon/storage/donut_box +/obj/item/weapon/storage/box/donut icon = 'icons/obj/food.dmi' icon_state = "donutbox" name = "donut box" @@ -20,14 +20,14 @@ can_hold = list(/obj/item/weapon/reagent_containers/food/snacks/donut) foldable = /obj/item/stack/sheet/cardboard -/obj/item/weapon/storage/donut_box/New() +/obj/item/weapon/storage/box/donut/New() ..() for(var/i=1; i <= startswith; i++) new /obj/item/weapon/reagent_containers/food/snacks/donut/normal(src) update_icon() return -/obj/item/weapon/storage/donut_box/update_icon() +/obj/item/weapon/storage/box/donut/update_icon() overlays.Cut() var/i = 0 for(var/obj/item/weapon/reagent_containers/food/snacks/donut/D in contents) @@ -36,6 +36,6 @@ overlays += img i++ -/obj/item/weapon/storage/donut_box/empty +/obj/item/weapon/storage/box/donut/empty icon_state = "donutbox0" startswith = 0 diff --git a/code/game/objects/items/weapons/storage/storage.dm b/code/game/objects/items/weapons/storage/storage.dm index 14501aa343..912ea4651b 100644 --- a/code/game/objects/items/weapons/storage/storage.dm +++ b/code/game/objects/items/weapons/storage/storage.dm @@ -21,7 +21,6 @@ var/allow_quick_empty //Set this variable to allow the object to have the 'empty' verb, which dumps all the contents on the floor. var/allow_quick_gather //Set this variable to allow the object to have the 'toggle mode' verb, which quickly collects all items from a tile. var/collection_mode = 1; //0 = pick one at a time, 1 = pick all on tile - var/foldable = null // BubbleWrap - if set, can be folded (when empty) into a sheet of cardboard var/use_sound = "rustle" //sound played when used. null for no sound. /obj/item/weapon/storage/MouseDrop(obj/over_object as obj) @@ -236,11 +235,9 @@ return 0 if(W.w_class >= src.w_class && (istype(W, /obj/item/weapon/storage))) - //TODO: remove hack - if(!istype(src, /obj/item/weapon/storage/backpack/holding)) //bohs should be able to hold backpacks again. The override for putting a boh in a boh is in backpack.dm. - if(!stop_messages) - usr << "[src] cannot hold [W] as it's a storage item of the same size." - return 0 //To prevent the stacking of same sized storage items. + if(!stop_messages) + usr << "[src] cannot hold [W] as it's a storage item of the same size." + return 0 //To prevent the stacking of same sized storage items. return 1 @@ -260,7 +257,7 @@ W.dropped(usr) add_fingerprint(usr) - if(!prevent_warning && !istype(W, /obj/item/weapon/gun/energy/crossbow)) + if(!prevent_warning) for(var/mob/M in viewers(usr, null)) if (M == usr) usr << "You put \the [W] into [src]." @@ -416,35 +413,12 @@ O.emp_act(severity) ..() -// BubbleWrap - A box can be folded up to make card /obj/item/weapon/storage/attack_self(mob/user as mob) - //Clicking on itself will empty it, if it has the verb to do that. if(user.get_active_hand() == src) if(src.verbs.Find(/obj/item/weapon/storage/verb/quick_empty)) src.quick_empty() - return - - //Otherwise we'll try to fold it. - if ( contents.len ) - return - - if ( !ispath(src.foldable) ) - return - var/found = 0 - // Close any open UI windows first - for(var/mob/M in range(1)) - if (M.s_active == src) - src.close(M) - if ( M == user ) - found = 1 - if ( !found ) // User is too far away - return - // Now make the cardboard - user << "You fold [src] flat." - new src.foldable(get_turf(src)) - del(src) -//BubbleWrap END + return 1 /obj/item/weapon/storage/hear_talk(mob/M as mob, text, verb, datum/language/speaking) for (var/atom/A in src) diff --git a/maps/exodus-1.dmm b/maps/exodus-1.dmm index c9ee7c1e5f..ff4ad68c67 100644 --- a/maps/exodus-1.dmm +++ b/maps/exodus-1.dmm @@ -262,7 +262,7 @@ "afb" = (/obj/structure/disposalpipe/segment{dir = 4},/turf/simulated/floor{icon_state = "red"},/area/security/main) "afc" = (/obj/structure/disposalpipe/sortjunction/flipped{dir = 1; name = "Security"; sortType = "Security"},/turf/simulated/floor{icon_state = "red"},/area/security/main) "afd" = (/turf/simulated/floor{icon_state = "red"},/area/security/main) -"afe" = (/obj/structure/table,/obj/machinery/light{icon_state = "tube1"; dir = 4},/obj/item/weapon/storage/donut_box,/turf/simulated/floor{dir = 2; icon_state = "redcorner"},/area/security/main) +"afe" = (/obj/structure/table,/obj/machinery/light{icon_state = "tube1"; dir = 4},/obj/item/weapon/storage/box/donut,/turf/simulated/floor{dir = 2; icon_state = "redcorner"},/area/security/main) "aff" = (/obj/structure/grille,/obj/structure/window/reinforced{dir = 4},/obj/structure/window/reinforced{dir = 8},/obj/structure/cable/green,/obj/structure/cable/green{d2 = 2; icon_state = "0-2"},/turf/simulated/floor/plating,/area/security/main) "afg" = (/obj/machinery/photocopier,/turf/simulated/floor{dir = 8; icon_state = "redcorner"},/area/security/main) "afh" = (/obj/structure/cable/green{d1 = 1; d2 = 2; icon_state = "1-2"},/obj/machinery/atmospherics/pipe/simple/hidden/supply,/obj/machinery/atmospherics/pipe/simple/hidden/scrubbers,/turf/simulated/floor,/area/security/main) @@ -2319,7 +2319,7 @@ "aSE" = (/obj/machinery/flasher{pixel_x = 0; pixel_y = 24; id = "AI"},/obj/structure/cable/cyan{d2 = 4; icon_state = "0-4"},/obj/structure/cable/cyan{d2 = 2; icon_state = "0-2"},/obj/machinery/power/sensor{name = "Powernet Sensor - AI Subgrid"; name_tag = "AI Subgrid"},/turf/simulated/floor/bluegrid,/area/turret_protected/ai) "aSF" = (/obj/structure/grille,/obj/structure/window/reinforced{dir = 4},/obj/structure/window/reinforced{dir = 8},/obj/machinery/door/firedoor/border_only,/obj/machinery/door/blast/shutters{dir = 8; id = "office_shutter"; layer = 3.1; name = "Office Shutters"},/turf/simulated/floor/plating,/area/hallway/secondary/entry/aft) "aSG" = (/obj/structure/table/reinforced,/obj/machinery/door/firedoor/border_only,/obj/machinery/door/blast/shutters{dir = 2; id = "kitchen"; layer = 3.3; name = "Kitchen Shutters"},/turf/simulated/floor{icon_state = "cafeteria"; dir = 5},/area/hallway/primary/starboard) -"aSH" = (/obj/structure/table/reinforced,/obj/item/weapon/storage/donut_box,/obj/machinery/door/firedoor/border_only,/obj/machinery/door/blast/shutters{dir = 2; id = "kitchen"; layer = 3.3; name = "Kitchen Shutters"},/obj/structure/cable/green{d1 = 1; d2 = 2; icon_state = "1-2"},/turf/simulated/floor{icon_state = "cafeteria"; dir = 5},/area/hallway/primary/starboard) +"aSH" = (/obj/structure/table/reinforced,/obj/item/weapon/storage/box/donut,/obj/machinery/door/firedoor/border_only,/obj/machinery/door/blast/shutters{dir = 2; id = "kitchen"; layer = 3.3; name = "Kitchen Shutters"},/obj/structure/cable/green{d1 = 1; d2 = 2; icon_state = "1-2"},/turf/simulated/floor{icon_state = "cafeteria"; dir = 5},/area/hallway/primary/starboard) "aSI" = (/obj/structure/grille,/obj/structure/window/reinforced{dir = 4},/obj/structure/window/reinforced{dir = 8},/obj/machinery/door/blast/shutters{density = 0; dir = 2; icon_state = "shutter0"; id = "heads_meeting"; name = "Meeting Room Window Shutters"; opacity = 0},/obj/structure/cable/green{d2 = 2; icon_state = "0-2"},/obj/structure/cable/green,/obj/structure/cable/green{d2 = 4; icon_state = "0-4"},/turf/simulated/floor/plating,/area/hallway/primary/central_one) "aSJ" = (/obj/structure/grille,/obj/structure/window/reinforced,/obj/structure/window/reinforced{dir = 1},/obj/structure/window/reinforced{dir = 8},/obj/machinery/door/firedoor/border_only{dir = 2},/turf/simulated/floor/plating,/area/hallway/primary/central_two) "aSK" = (/obj/structure/grille,/obj/structure/window/reinforced,/obj/structure/window/reinforced{dir = 1},/obj/machinery/door/firedoor/border_only{dir = 2},/turf/simulated/floor/plating,/area/hallway/primary/central_two) @@ -2580,7 +2580,7 @@ "aXF" = (/turf/simulated/floor{icon_state = "blue"; dir = 8},/area/bridge) "aXG" = (/obj/structure/cable/green{d1 = 1; d2 = 2; icon_state = "1-2"},/turf/simulated/floor,/area/bridge) "aXH" = (/turf/simulated/floor{dir = 4; icon_state = "escapecorner"},/area/bridge) -"aXI" = (/obj/structure/table,/obj/machinery/camera{c_tag = "Bridge East"; dir = 2},/obj/item/weapon/storage/donut_box,/obj/structure/noticeboard{pixel_y = 27},/turf/simulated/floor{icon_state = "whitehall"; dir = 1},/area/bridge) +"aXI" = (/obj/structure/table,/obj/machinery/camera{c_tag = "Bridge East"; dir = 2},/obj/item/weapon/storage/box/donut,/obj/structure/noticeboard{pixel_y = 27},/turf/simulated/floor{icon_state = "whitehall"; dir = 1},/area/bridge) "aXJ" = (/obj/machinery/computer/med_data,/turf/simulated/floor{icon_state = "whitehall"; dir = 1},/area/bridge) "aXK" = (/turf/simulated/wall,/area/maintenance/substation/medical) "aXL" = (/obj/structure/grille,/obj/structure/window/reinforced{dir = 1},/obj/structure/window/reinforced,/obj/structure/window/reinforced{dir = 8},/obj/machinery/door/firedoor/border_only{dir = 2},/turf/simulated/floor/plating,/area/hallway/primary/central_two) @@ -3070,7 +3070,7 @@ "bhb" = (/obj/structure/cable/green{d1 = 1; d2 = 4; icon_state = "1-4"},/obj/machinery/atmospherics/pipe/simple/hidden/scrubbers,/obj/machinery/atmospherics/pipe/simple/hidden/supply,/turf/simulated/floor/wood,/area/crew_quarters/captain) "bhc" = (/obj/structure/cable/green{d1 = 4; d2 = 8; icon_state = "4-8"},/turf/simulated/floor/wood,/area/crew_quarters/captain) "bhd" = (/obj/structure/bed/chair/comfy/brown{dir = 4},/obj/structure/cable/green{d1 = 4; d2 = 8; icon_state = "4-8"},/turf/simulated/floor/carpet,/area/crew_quarters/captain) -"bhe" = (/obj/structure/table/woodentable,/obj/item/weapon/storage/donut_box,/obj/structure/cable/green{d1 = 4; d2 = 8; icon_state = "4-8"},/turf/simulated/floor/carpet,/area/crew_quarters/captain) +"bhe" = (/obj/structure/table/woodentable,/obj/item/weapon/storage/box/donut,/obj/structure/cable/green{d1 = 4; d2 = 8; icon_state = "4-8"},/turf/simulated/floor/carpet,/area/crew_quarters/captain) "bhf" = (/obj/structure/bed/chair/comfy/brown{dir = 8},/obj/structure/cable/green{d1 = 4; d2 = 8; icon_state = "4-8"},/turf/simulated/floor/carpet,/area/crew_quarters/captain) "bhg" = (/obj/structure/cable/green{d1 = 2; d2 = 8; icon_state = "2-8"},/obj/structure/cable/green{d1 = 1; d2 = 8; icon_state = "1-8"},/turf/simulated/floor/wood,/area/crew_quarters/captain) "bhh" = (/obj/structure/flora/pottedplant{tag = "icon-plant-10"; icon_state = "plant-10"},/turf/simulated/floor/wood,/area/crew_quarters/captain) @@ -3202,7 +3202,7 @@ "bjD" = (/obj/structure/filingcabinet/filingcabinet,/turf/simulated/floor{icon_state = "arrival"; dir = 4},/area/quartermaster/office) "bjE" = (/obj/machinery/alarm{dir = 4; icon_state = "alarm0"; pixel_x = -22},/turf/simulated/floor{dir = 8; icon_state = "browncorner"},/area/hallway/primary/central_one) "bjF" = (/obj/machinery/door/blast/regular{id = "chapelgun"; name = "Chapel Launcher Door"},/turf/simulated/floor/plating,/area/chapel/main) -"bjG" = (/obj/item/weapon/storage/donut_box,/obj/structure/table/woodentable,/turf/simulated/floor/wood,/area/bridge/meeting_room) +"bjG" = (/obj/item/weapon/storage/box/donut,/obj/structure/table/woodentable,/turf/simulated/floor/wood,/area/bridge/meeting_room) "bjH" = (/obj/structure/bed/chair/comfy/black{dir = 4},/turf/simulated/floor/carpet,/area/bridge/meeting_room) "bjI" = (/obj/item/weapon/paper_bin{pixel_x = -3; pixel_y = 7},/obj/item/weapon/pen,/obj/structure/table/woodentable,/turf/simulated/floor/carpet,/area/bridge/meeting_room) "bjJ" = (/obj/item/weapon/folder/blue,/obj/structure/table/woodentable,/turf/simulated/floor/carpet,/area/bridge/meeting_room) diff --git a/maps/exodus-2.dmm b/maps/exodus-2.dmm index 91d0a55379..be4103f780 100644 --- a/maps/exodus-2.dmm +++ b/maps/exodus-2.dmm @@ -1250,7 +1250,7 @@ "yb" = (/obj/machinery/door/airlock/centcom{name = "Special Operations Mechbay "; opacity = 1; req_access = list(103)},/turf/unsimulated/floor{icon_state = "vault"; dir = 8},/area/centcom) "yc" = (/obj/machinery/autolathe{desc = "Your typical Autolathe. It appears to have much more options than your regular one, however..."; hacked = 1; name = "Unlocked Autolathe"},/turf/unsimulated/floor{icon_state = "vault"; dir = 8},/area/centcom) "yd" = (/obj/structure/bed/chair{dir = 4},/turf/unsimulated/floor{icon_state = "dark"},/area/centcom) -"ye" = (/obj/structure/table/reinforced,/obj/item/weapon/storage/donut_box,/turf/unsimulated/floor{icon_state = "dark"},/area/centcom) +"ye" = (/obj/structure/table/reinforced,/obj/item/weapon/storage/box/donut,/turf/unsimulated/floor{icon_state = "dark"},/area/centcom) "yf" = (/obj/structure/table/reinforced,/turf/unsimulated/floor{icon_state = "dark"},/area/centcom) "yg" = (/obj/structure/bed/chair{dir = 8},/turf/unsimulated/floor{icon_state = "dark"},/area/centcom) "yh" = (/turf/unsimulated/wall,/area/centcom/creed) @@ -1851,7 +1851,7 @@ "JE" = (/obj/machinery/door/airlock/medical{name = "Operating Theatre"; req_access = list(45)},/turf/unsimulated/floor{icon_state = "white"},/area/centcom/holding) "JF" = (/obj/structure/sink{dir = 4; icon_state = "sink"; pixel_x = 11; pixel_y = 0},/obj/machinery/vending/wallmed1{name = "Emergency NanoMed"; pixel_x = 28},/turf/unsimulated/floor{tag = "icon-whitecorner (NORTH)"; icon_state = "whitecorner"; dir = 1},/area/centcom/holding) "JG" = (/obj/structure/table/woodentable,/obj/item/device/megaphone,/turf/unsimulated/floor{dir = 8; icon_state = "wood"},/area/wizard_station) -"JH" = (/obj/structure/table/woodentable,/obj/item/weapon/storage/donut_box,/turf/unsimulated/floor{dir = 8; icon_state = "wood"},/area/wizard_station) +"JH" = (/obj/structure/table/woodentable,/obj/item/weapon/storage/box/donut,/turf/unsimulated/floor{dir = 8; icon_state = "wood"},/area/wizard_station) "JI" = (/obj/machinery/atmospherics/unary/vent_pump/high_volume{frequency = 1331; id_tag = "vox_west_vent"},/turf/simulated/shuttle/plating/vox,/area/shuttle/vox/station) "JJ" = (/obj/machinery/airlock_sensor{frequency = 1331; id_tag = "vox_west_sensor"; pixel_x = 25},/turf/simulated/shuttle/plating/vox,/area/shuttle/vox/station) "JK" = (/obj/structure/grille,/obj/structure/window/reinforced{dir = 4},/obj/structure/window/reinforced{dir = 1},/obj/structure/window/reinforced{dir = 8},/obj/machinery/door/blast/regular{id = "skipjack"; name = "Skipjack Blast Shielding"},/turf/simulated/shuttle/plating/vox,/area/shuttle/vox/station)