Skip to content

Commit

Permalink
[MIRROR] Adds loot blacklist, creates a maintenance spawner with deca…
Browse files Browse the repository at this point in the history
…ls 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 <[email protected]>
Co-authored-by: Bloop <[email protected]>
  • Loading branch information
3 people authored Feb 24, 2024
1 parent 0b9689d commit e5b9072
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 3 deletions.
5 changes: 3 additions & 2 deletions _maps/RandomZLevels/museum.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -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" = (
Expand Down Expand Up @@ -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" = (
Expand Down Expand Up @@ -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,
Expand Down
4 changes: 4 additions & 0 deletions code/game/objects/effects/misc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
35 changes: 35 additions & 0 deletions code/game/objects/effects/spawners/random/maintenance.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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()].")
Expand Down Expand Up @@ -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
3 changes: 3 additions & 0 deletions code/game/objects/effects/spawners/random/random.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
2 changes: 1 addition & 1 deletion modular_nova/modules/GAGS/greyscale_configs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit e5b9072

Please sign in to comment.