diff --git a/code/game/objects/effects/spawners/random/bureaucracy.dm b/code/game/objects/effects/spawners/random/bureaucracy.dm index 7a6b62618e6..583d3ad95a1 100644 --- a/code/game/objects/effects/spawners/random/bureaucracy.dm +++ b/code/game/objects/effects/spawners/random/bureaucracy.dm @@ -42,6 +42,7 @@ icon_state = "paper" loot = list( /obj/item/paper = 20, + /obj/item/paperplane = 2, /obj/item/paper/crumpled = 2, /obj/item/paper/crumpled/bloody = 2, /obj/item/paper/crumpled/muddy = 2, diff --git a/code/game/objects/effects/spawners/random/trash.dm b/code/game/objects/effects/spawners/random/trash.dm index 8ae1de04e9e..86de8afca29 100644 --- a/code/game/objects/effects/spawners/random/trash.dm +++ b/code/game/objects/effects/spawners/random/trash.dm @@ -7,24 +7,30 @@ name = "garbage spawner" loot = list( /obj/effect/spawner/random/trash/food_packaging = 20, - /obj/item/trash/can = 15, + /obj/effect/spawner/random/trash/crushed_can = 15, /obj/item/shard = 10, /obj/effect/spawner/random/trash/cigbutt = 10, + /obj/effect/spawner/random/trash/cigpack = 5, /obj/effect/spawner/random/trash/bacteria = 5, /obj/effect/spawner/random/trash/botanical_waste = 5, - /obj/item/reagent_containers/cup/glass/drinkingglass = 5, /obj/item/broken_bottle = 5, /obj/item/light/tube/broken = 5, /obj/item/light/bulb/broken = 5, - /obj/item/assembly/mousetrap/armed = 5, - /obj/item/stack/cable_coil = 5, - /obj/item/food/deadmouse = 1, + /obj/effect/spawner/random/bureaucracy/paper = 5, + /obj/item/assembly/mousetrap = 3, + /obj/item/assembly/mousetrap/armed = 3, + /obj/item/stack/cable_coil = 3, + /obj/item/stack/cable_coil/cut = 3, + /obj/item/reagent_containers/syringe = 3, + /obj/item/reagent_containers/cup/glass/drinkingglass = 2, + /obj/item/food/deadmouse = 2, + /obj/item/c_tube = 2, + /obj/item/plate_shard = 2, + /obj/item/lighter/greyscale/empty = 2, + /obj/item/lighter/empty = 1, /obj/item/trash/candle = 1, - /obj/item/rag = 1, /obj/item/trash/flare = 1, - /obj/item/popsicle_stick = 1, - /obj/item/reagent_containers/syringe = 1, - /obj/item/reagent_containers/cup/glass/sillycup = 1, + /obj/item/rag = 1, /obj/item/shard/plasma = 1, ) @@ -48,7 +54,7 @@ /mob/living/basic/snail = 1, /obj/item/food/grown/cannabis = 1, /obj/item/rag = 1, - /obj/effect/spawner/random/entertainment/drugs= 1, + /obj/effect/spawner/random/entertainment/drugs = 1, /obj/item/modular_computer/pda = 1, /obj/item/reagent_containers/syringe = 1, /obj/effect/spawner/random/entertainment/cigar = 1, @@ -62,6 +68,29 @@ loot -= /mob/living/basic/snail return ..() +/obj/effect/spawner/random/trash/cigpack + name = "empty cigarette pack spawner" + loot = list( + /obj/item/storage/fancy/cigarettes/empty = 5, + /obj/item/storage/fancy/cigarettes/cigpack_uplift/empty = 5, + /obj/item/storage/fancy/cigarettes/cigpack_robust/empty = 5, + /obj/item/storage/fancy/cigarettes/cigpack_robustgold/empty = 5, + /obj/item/storage/fancy/cigarettes/cigpack_carp/empty = 5, + /obj/item/storage/fancy/cigarettes/cigpack_midori/empty = 5, + /obj/item/storage/fancy/rollingpapers/empty = 3, + /obj/item/storage/fancy/cigarettes/cigars/empty = 3, + /obj/item/storage/fancy/cigarettes/cigars/cohiba/empty = 3, + /obj/item/storage/fancy/cigarettes/cigars/havana/empty = 3, + /obj/item/storage/fancy/cigarettes/cigpack_greytide/empty = 3, + /obj/item/storage/fancy/cigarettes/dromedaryco/empty = 2, + /obj/item/storage/fancy/cigarettes/cigpack_shadyjims/empty = 2, + /obj/item/storage/fancy/cigarettes/cigpack_xeno/empty = 2, + /obj/item/storage/fancy/cigarettes/cigpack_candy/empty = 2, + /obj/item/storage/fancy/cigarettes/cigpack_cannabis/empty = 1, + /obj/item/storage/fancy/cigarettes/cigpack_mindbreaker/empty = 1, + /obj/item/storage/fancy/cigarettes/cigpack_syndicate/empty = 1, + ) + /obj/effect/spawner/random/trash/cigbutt name = "cigarette butt spawner" loot = list( @@ -83,20 +112,45 @@ /obj/item/trash/sosjerky = 2, /obj/item/trash/pistachios = 2, /obj/item/trash/peanuts = 2, + /obj/item/reagent_containers/cup/glass/sillycup = 2, /obj/item/trash/boritos = 1, /obj/item/trash/boritos/green = 1, /obj/item/trash/boritos/purple = 1, /obj/item/trash/boritos/red = 1, /obj/item/trash/can/food/beans = 1, /obj/item/trash/can/food/peaches = 1, - /obj/item/trash/can/food/envirochow = 1, - /obj/item/trash/popcorn = 1, - /obj/item/trash/energybar = 1, /obj/item/trash/can/food/peaches/maint = 1, + /obj/item/trash/can/food/tomatoes = 1, + /obj/item/trash/can/food/envirochow = 1, + /obj/item/trash/can/food/squid_ink = 1, + /obj/item/trash/can/food/chap = 1, + /obj/item/trash/can/food/jellyfish = 1, + /obj/item/trash/can/food/desert_snails = 1, + /obj/item/trash/can/food/larvae = 1, + /obj/item/trash/can/food/pine_nuts = 1, + /obj/item/trash/popcorn = 1, + /obj/item/trash/popcorn/salty = 1, + /obj/item/trash/energybar = 1, /obj/item/trash/semki = 1, + /obj/item/trash/semki/healthy = 1, /obj/item/trash/cnds = 1, /obj/item/trash/syndi_cakes = 1, /obj/item/trash/shrimp_chips = 1, + /obj/item/trash/hot_shots = 1, + /obj/item/trash/sticko = 1, + /obj/item/trash/sticko/matcha = 1, + /obj/item/trash/sticko/nutty = 1, + /obj/item/trash/sticko/pineapple = 1, + /obj/item/trash/sticko/yuyake = 1, + /obj/item/trash/shok_roks = 1, + /obj/item/trash/shok_roks/citrus = 1, + /obj/item/trash/shok_roks/berry = 1, + /obj/item/trash/shok_roks/tropical = 1, + /obj/item/trash/shok_roks/lanternfruit = 1, + /obj/item/trash/fleet_ration = 1, + /obj/item/trash/spacers_sidekick = 1, + /obj/item/popsicle_stick = 1, + /obj/item/trash/ready_donk = 1, /obj/item/trash/tray = 1, ) diff --git a/code/game/objects/items/lighter.dm b/code/game/objects/items/lighter.dm index 650405f467f..d7151ffd368 100644 --- a/code/game/objects/items/lighter.dm +++ b/code/game/objects/items/lighter.dm @@ -37,11 +37,14 @@ "thirteen", "snake", ) + /// Whether the lighter starts with fuel + var/spawns_with_reagent = TRUE /obj/item/lighter/Initialize(mapload) . = ..() create_reagents(maximum_fuel, REFILLABLE | DRAINABLE) - reagents.add_reagent(/datum/reagent/fuel, maximum_fuel) + if(spawns_with_reagent) + reagents.add_reagent(/datum/reagent/fuel, maximum_fuel) if(!overlay_state) overlay_state = pick(overlay_list) AddComponent(\ @@ -367,3 +370,9 @@ /obj/item/lighter/mime, /obj/item/lighter/bright, ) + +/obj/item/lighter/empty + spawns_with_reagent = FALSE + +/obj/item/lighter/greyscale/empty + spawns_with_reagent = FALSE diff --git a/code/game/objects/items/storage/fancy.dm b/code/game/objects/items/storage/fancy.dm index 8470c084136..14c5c626fe7 100644 --- a/code/game/objects/items/storage/fancy.dm +++ b/code/game/objects/items/storage/fancy.dm @@ -231,6 +231,8 @@ . = ..() register_context() + if(!spawn_count) + update_appearance() /obj/item/storage/fancy/cigarettes/interact_with_atom(atom/interacting_with, mob/living/user, list/modifiers) . = ..() @@ -294,6 +296,11 @@ . += "[use_icon_state]_[cig_position]" cig_position++ +/obj/item/storage/fancy/cigarettes/empty + spawn_count = 0 + spawn_coupon = FALSE + open_status = FANCY_CONTAINER_OPEN + /obj/item/storage/fancy/cigarettes/dromedaryco name = "\improper DromedaryCo packet" desc = "A packet of six imported DromedaryCo cancer sticks. A label on the packaging reads, \"Wouldn't a slow death make a change?\"" @@ -301,6 +308,11 @@ base_icon_state = "dromedary" spawn_type = /obj/item/cigarette/dromedary +/obj/item/storage/fancy/cigarettes/dromedaryco/empty + spawn_count = 0 + spawn_coupon = FALSE + open_status = FANCY_CONTAINER_OPEN + /obj/item/storage/fancy/cigarettes/cigpack_uplift name = "\improper Uplift Smooth packet" desc = "Your favorite brand, now menthol flavored." @@ -308,6 +320,11 @@ base_icon_state = "uplift" spawn_type = /obj/item/cigarette/uplift +/obj/item/storage/fancy/cigarettes/cigpack_uplift/empty + spawn_count = 0 + spawn_coupon = FALSE + open_status = FANCY_CONTAINER_OPEN + /obj/item/storage/fancy/cigarettes/cigpack_robust name = "\improper Robust packet" desc = "Smoked by the robust." @@ -315,6 +332,11 @@ base_icon_state = "robust" spawn_type = /obj/item/cigarette/robust +/obj/item/storage/fancy/cigarettes/cigpack_robust/empty + spawn_count = 0 + spawn_coupon = FALSE + open_status = FANCY_CONTAINER_OPEN + /obj/item/storage/fancy/cigarettes/cigpack_robustgold name = "\improper Robust Gold packet" desc = "Smoked by the truly robust." @@ -322,6 +344,11 @@ base_icon_state = "robustg" spawn_type = /obj/item/cigarette/robustgold +/obj/item/storage/fancy/cigarettes/cigpack_robustgold/empty + spawn_count = 0 + spawn_coupon = FALSE + open_status = FANCY_CONTAINER_OPEN + /obj/item/storage/fancy/cigarettes/cigpack_greytide name = "\improper Mainthol Grey packet" desc = "The thin grey line." @@ -329,6 +356,11 @@ base_icon_state = "greytide" spawn_type = /obj/item/cigarette/greytide +/obj/item/storage/fancy/cigarettes/cigpack_greytide/empty + spawn_count = 0 + spawn_coupon = FALSE + open_status = FANCY_CONTAINER_OPEN + /obj/item/storage/fancy/cigarettes/cigpack_carp name = "\improper Carp Classic packet" desc = "Since 2313." @@ -336,6 +368,11 @@ base_icon_state = "carp" spawn_type = /obj/item/cigarette/carp +/obj/item/storage/fancy/cigarettes/cigpack_carp/empty + spawn_count = 0 + spawn_coupon = FALSE + open_status = FANCY_CONTAINER_OPEN + /obj/item/storage/fancy/cigarettes/cigpack_syndicate name = "cigarette packet" desc = "An obscure brand of cigarettes." @@ -343,6 +380,11 @@ base_icon_state = "syndie" spawn_type = /obj/item/cigarette/syndicate +/obj/item/storage/fancy/cigarettes/cigpack_syndicate/empty + spawn_count = 0 + spawn_coupon = FALSE + open_status = FANCY_CONTAINER_OPEN + /obj/item/storage/fancy/cigarettes/cigpack_midori name = "\improper Midori Tabako packet" desc = "You can't understand the runes, but the packet smells funny." @@ -350,6 +392,11 @@ base_icon_state = "midori" spawn_type = /obj/item/cigarette/rollie/nicotine +/obj/item/storage/fancy/cigarettes/cigpack_midori/empty + spawn_count = 0 + spawn_coupon = FALSE + open_status = FANCY_CONTAINER_OPEN + /obj/item/storage/fancy/cigarettes/cigpack_candy name = "\improper Timmy's First Candy Smokes packet" desc = "Unsure about smoking? Want to bring your children safely into the family tradition? Look no more with this special packet! Includes 100%* Nicotine-Free candy cigarettes." @@ -365,6 +412,11 @@ if(prob(7)) spawn_type = /obj/item/cigarette/candy/nicotine //uh oh! +/obj/item/storage/fancy/cigarettes/cigpack_candy/empty + spawn_count = 0 + spawn_coupon = FALSE + open_status = FANCY_CONTAINER_OPEN + /obj/item/storage/fancy/cigarettes/cigpack_shadyjims name = "\improper Shady Jim's Super Slims packet" desc = "Is your weight slowing you down? Having trouble running away from gravitational singularities? Can't stop stuffing your mouth? Smoke Shady Jim's Super Slims and watch all that fat burn away. Guaranteed results!" @@ -372,6 +424,11 @@ base_icon_state = "shadyjim" spawn_type = /obj/item/cigarette/shadyjims +/obj/item/storage/fancy/cigarettes/cigpack_shadyjims/empty + spawn_count = 0 + spawn_coupon = FALSE + open_status = FANCY_CONTAINER_OPEN + /obj/item/storage/fancy/cigarettes/cigpack_xeno name = "\improper Xeno Filtered packet" desc = "Loaded with 100% pure slime. And also nicotine." @@ -379,6 +436,11 @@ base_icon_state = "slime" spawn_type = /obj/item/cigarette/xeno +/obj/item/storage/fancy/cigarettes/cigpack_xeno/empty + spawn_count = 0 + spawn_coupon = FALSE + open_status = FANCY_CONTAINER_OPEN + /obj/item/storage/fancy/cigarettes/cigpack_cannabis name = "\improper Freak Brothers' Special packet" desc = "A label on the packaging reads, \"Endorsed by Phineas, Freddy and Franklin.\"" @@ -386,6 +448,11 @@ base_icon_state = "midori" spawn_type = /obj/item/cigarette/rollie/cannabis +/obj/item/storage/fancy/cigarettes/cigpack_cannabis/empty + spawn_count = 0 + spawn_coupon = FALSE + open_status = FANCY_CONTAINER_OPEN + /obj/item/storage/fancy/cigarettes/cigpack_mindbreaker name = "\improper Leary's Delight packet" desc = "Banned in over 36 galaxies." @@ -393,6 +460,11 @@ base_icon_state = "shadyjim" spawn_type = /obj/item/cigarette/rollie/mindbreaker +/obj/item/storage/fancy/cigarettes/cigpack_mindbreaker/empty + spawn_count = 0 + spawn_coupon = FALSE + open_status = FANCY_CONTAINER_OPEN + /obj/item/storage/fancy/rollingpapers name = "rolling paper pack" desc = "A pack of Nanotrasen brand rolling papers." @@ -407,11 +479,20 @@ has_open_closed_states = FALSE storage_type = /datum/storage/rolling_paper_pack +/obj/item/storage/fancy/rollingpapers/Initialize(mapload) + . = ..() + + if(!spawn_count) + update_appearance() + /obj/item/storage/fancy/rollingpapers/update_overlays() . = ..() if(!contents.len) . += "[base_icon_state]_empty" +/obj/item/storage/fancy/rollingpapers/empty + spawn_count = 0 + ///////////// //CIGAR BOX// ///////////// @@ -435,6 +516,10 @@ //reset any changes the parent call may have made icon_state = base_icon_state +/obj/item/storage/fancy/cigarettes/cigars/empty + spawn_count = 0 + open_status = FANCY_CONTAINER_OPEN + /obj/item/storage/fancy/cigarettes/cigars/update_overlays() . = ..() if(!open_status) @@ -451,6 +536,10 @@ base_icon_state = "cohibacase" spawn_type = /obj/item/cigarette/cigar/cohiba +/obj/item/storage/fancy/cigarettes/cigars/cohiba/empty + spawn_count = 0 + open_status = FANCY_CONTAINER_OPEN + /obj/item/storage/fancy/cigarettes/cigars/havana name = "\improper premium Havanian cigar case" desc = "A case of classy Havanian cigars." @@ -458,6 +547,10 @@ base_icon_state = "cohibacase" spawn_type = /obj/item/cigarette/cigar/havana +/obj/item/storage/fancy/cigarettes/cigars/havana/empty + spawn_count = 0 + open_status = FANCY_CONTAINER_OPEN + /* * Heart Shaped Box w/ Chocolates */ diff --git a/code/modules/unit_tests/_unit_tests.dm b/code/modules/unit_tests/_unit_tests.dm index 304dcb66a44..b09a5ccdba5 100644 --- a/code/modules/unit_tests/_unit_tests.dm +++ b/code/modules/unit_tests/_unit_tests.dm @@ -314,6 +314,7 @@ #include "trait_addition_and_removal.dm" #include "traitor.dm" #include "traitor_mail_content_check.dm" +#include "trash_food.dm" #include "trauma_granting.dm" #include "turf_icons.dm" #include "tutorial_sanity.dm" diff --git a/code/modules/unit_tests/trash_food.dm b/code/modules/unit_tests/trash_food.dm new file mode 100644 index 00000000000..570531c187d --- /dev/null +++ b/code/modules/unit_tests/trash_food.dm @@ -0,0 +1,34 @@ +/// Checks to make sure all food trash is included in /obj/effect/spawner/random/trash/food_packaging +/datum/unit_test/trash_food + +/datum/unit_test/trash_food/Run() + var/list/food_trash = /obj/effect/spawner/random/trash/food_packaging::loot + // list of pieces of trash we never want to include because they are special or rare (usually mutated botany plants) + var/list/food_trash_blacklist = list( + // already added to botanical_waste spawner or too exotic + /obj/item/grown/bananapeel, + /obj/item/grown/bananapeel/bombanana, + /obj/item/grown/bananapeel/mimanapeel, + /obj/item/grown/bananapeel/bluespace, + /obj/item/food/grown/bungopit, + /obj/item/food/egg, + /obj/item/gun/ballistic/revolver/peashooter, + /obj/item/grown/corncob, + /obj/item/grown/corncob/pepper, + // misc waste products that don't belong in trash spawner + /obj/item/reagent_containers/cup/bowl, + /obj/item/plate, + /obj/item/stack/rods, // kebab + /obj/item/paper/paperslip/fortune, // fortune cookie + /obj/item/dice/fudge, // /obj/item/food/fudgedice + ) + + for(var/path in subtypesof(/obj/item/food)) + var/obj/item/food/food = path + var/trash = food::trash_type + if(!trash) + continue + if(trash in food_trash_blacklist) + continue + + TEST_ASSERT(food_trash[trash], "[food] must include its trash_type for loot table /obj/effect/spawner/random/trash/food_packaging or be added to this unit tests food_trash_blacklist")