From e5b9072fe848eac668db69029709a890f5bce126 Mon Sep 17 00:00:00 2001 From: Iajret Creature <122297233+Steals-The-PRs@users.noreply.github.com> Date: Sun, 25 Feb 2024 01:55:52 +0300 Subject: [PATCH] [MIRROR] Adds loot blacklist, creates a maintenance spawner with decals blacklisted (#2108) * Adds loot blacklist, creates a maintenance spawner with decals blacklisted (#81611) * Adds loot blacklist, creates a maintenance spawner with decals blacklisted * Why is this here --------- Co-authored-by: NovaBot <154629622+NovaBot13@users.noreply.github.com> Co-authored-by: Bloop <13398309+vinylspiders@users.noreply.github.com> --- _maps/RandomZLevels/museum.dmm | 5 +-- code/game/objects/effects/misc.dm | 4 +++ .../effects/spawners/random/maintenance.dm | 35 +++++++++++++++++++ .../objects/effects/spawners/random/random.dm | 3 ++ .../modules/GAGS/greyscale_configs.dm | 2 +- 5 files changed, 46 insertions(+), 3 deletions(-) diff --git a/_maps/RandomZLevels/museum.dmm b/_maps/RandomZLevels/museum.dmm index 7429c0b4538..f40ecc09015 100644 --- a/_maps/RandomZLevels/museum.dmm +++ b/_maps/RandomZLevels/museum.dmm @@ -3147,6 +3147,7 @@ /obj/structure/transport/linear/tram/slow, /obj/structure/thermoplastic, /obj/effect/spawner/random/structure/closet_empty/crate/with_loot, +/obj/effect/spawner/random/maintenance/no_decals/five, /turf/open/chasm/true/no_smooth, /area/awaymission/museum) "Cc" = ( @@ -4988,7 +4989,7 @@ /obj/machinery/door/window/elevator/right/directional/south{ transport_linked_id = "museum_cargo" }, -/obj/effect/spawner/random/maintenance/seven, +/obj/effect/spawner/random/maintenance/no_decals/seven, /turf/open/chasm/true/no_smooth, /area/awaymission/museum) "Um" = ( @@ -5343,7 +5344,7 @@ "WJ" = ( /obj/structure/transport/linear/tram/slow, /obj/structure/thermoplastic, -/obj/effect/spawner/random/maintenance/seven, +/obj/effect/spawner/random/maintenance/no_decals/seven, /obj/item/storage/pill_bottle/maintenance_pill/full, /obj/effect/spawner/random/structure/closet_empty/crate/with_loot, /turf/open/chasm/true/no_smooth, diff --git a/code/game/objects/effects/misc.dm b/code/game/objects/effects/misc.dm index 2b8abcb1728..075e927d653 100644 --- a/code/game/objects/effects/misc.dm +++ b/code/game/objects/effects/misc.dm @@ -43,6 +43,10 @@ stack_trace("Warning: something tried to forceMove() a qdeleted [src]([type]) to non-null destination [destination]([destination.type])!") return ..() +/// Override to define loot blacklist behavior +/obj/effect/spawner/proc/can_spawn(atom/loot) + return TRUE + /obj/effect/list_container name = "list container" diff --git a/code/game/objects/effects/spawners/random/maintenance.dm b/code/game/objects/effects/spawners/random/maintenance.dm index 242613e403d..234b69e8571 100644 --- a/code/game/objects/effects/spawners/random/maintenance.dm +++ b/code/game/objects/effects/spawners/random/maintenance.dm @@ -4,6 +4,13 @@ icon_state = "loot" // see code/_globalvars/lists/maintenance_loot.dm for loot table +/// A subtype of maintenance loot spawner that does not spawn any decals, for when you want to place them on chasm turfs and such +/// decals such as ashes will cause NeverShouldHaveComeHere() to fail on such turfs, which creates annoying rng based CI failures +/obj/effect/spawner/random/maintenance/no_decals + +/obj/effect/spawner/random/maintenance/no_decals/can_spawn(atom/loot) + return !istype(loot, /obj/effect/decal) + /obj/effect/spawner/random/maintenance/examine(mob/user) . = ..() . += span_info("This spawner has an effective loot count of [get_effective_lootcount()].") @@ -64,3 +71,31 @@ /obj/effect/spawner/random/maintenance/eight name = "8 x maintenance loot spawner" spawn_loot_count = 8 + +/obj/effect/spawner/random/maintenance/no_decals/two + name = "2 x maintenance loot spawner" + spawn_loot_count = 2 + +/obj/effect/spawner/random/maintenance/no_decals/three + name = "3 x maintenance loot spawner" + spawn_loot_count = 3 + +/obj/effect/spawner/random/maintenance/no_decals/four + name = "4 x maintenance loot spawner" + spawn_loot_count = 4 + +/obj/effect/spawner/random/maintenance/no_decals/five + name = "5 x maintenance loot spawner" + spawn_loot_count = 5 + +/obj/effect/spawner/random/maintenance/no_decals/six + name = "6 x maintenance loot spawner" + spawn_loot_count = 6 + +/obj/effect/spawner/random/maintenance/no_decals/seven + name = "7 x maintenance loot spawner" + spawn_loot_count = 7 + +/obj/effect/spawner/random/maintenance/no_decals/eight + name = "8 x maintenance loot spawner" + spawn_loot_count = 8 diff --git a/code/game/objects/effects/spawners/random/random.dm b/code/game/objects/effects/spawners/random/random.dm index e8653a30cfb..e518b9ad471 100644 --- a/code/game/objects/effects/spawners/random/random.dm +++ b/code/game/objects/effects/spawners/random/random.dm @@ -57,6 +57,9 @@ var/pixel_divider = FLOOR(16 / spawn_loot_split_pixel_offsets, 1) // 16 pixels offsets is max that should be allowed in any direction while((spawn_loot_count-loot_spawned) && loot.len) var/lootspawn = pick_weight_recursive(loot) + if(!can_spawn(lootspawn)) + loot.Remove(lootspawn) + continue if(!spawn_loot_double) loot.Remove(lootspawn) if(lootspawn && (spawn_scatter_radius == 0 || spawn_locations.len)) diff --git a/modular_nova/modules/GAGS/greyscale_configs.dm b/modular_nova/modules/GAGS/greyscale_configs.dm index a2e421afcf8..ca86a8d502b 100644 --- a/modular_nova/modules/GAGS/greyscale_configs.dm +++ b/modular_nova/modules/GAGS/greyscale_configs.dm @@ -1406,7 +1406,7 @@ TREK /datum/greyscale_config/sneakers/worn/teshari name = "Sneakers (Worn, Teshari)" icon_file = 'modular_nova/modules/GAGS/icons/sneakers_teshari.dmi' -digi + /datum/greyscale_config/sneakers_orange/worn/teshari name = "Orange Sneakers (Worn, Teshari)" icon_file = 'modular_nova/modules/GAGS/icons/sneakers_teshari.dmi'