Skip to content

Commit

Permalink
fix: only blackbox maintloot spawners (#26859)
Browse files Browse the repository at this point in the history
  • Loading branch information
warriorstar-orion committed Sep 24, 2024
1 parent d856d5c commit 02f5a24
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/obj/effect/spawner/random/engineering
icon = 'icons/effects/random_spawners.dmi'
icon_state = "wrench"
record_spawn = TRUE

/obj/effect/spawner/random/engineering/tools
name = "Tool spawner"
Expand Down
1 change: 1 addition & 0 deletions code/game/objects/effects/spawners/random/food_spawners.dm
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@

/obj/item/food/stroopwafel = 1,
)
record_spawn = TRUE
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
name = "Maintenance loot spawner"
spawn_loot_chance = 65
spawn_random_offset_max_pixels = 8
record_spawn = TRUE

/obj/effect/spawner/random/maintenance/Initialize(mapload)
loot = GLOB.maintenance_loot_tables
Expand Down
5 changes: 5 additions & 0 deletions code/game/objects/effects/spawners/random/misc_spawners.dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
/obj/item/dice/d10,
/obj/item/dice/d12,
)
record_spawn = TRUE

/obj/effect/spawner/random/dice/Initialize()
. = ..()
Expand All @@ -28,6 +29,7 @@
/obj/item/folder/yellow,
/obj/item/clipboard,
)
record_spawn = TRUE

/obj/effect/spawner/random/book
icon = 'icons/effects/random_spawners.dmi'
Expand Down Expand Up @@ -67,6 +69,7 @@
/obj/item/book/manual/wiki/sop_supply,
/obj/item/book/manual/zombie_manual,
)
record_spawn = TRUE

/obj/effect/spawner/random/book/record_item(type_path_to_make)
SSblackbox.record_feedback("tally", "random_spawners", 1, "[/obj/item/book]")
Expand All @@ -78,6 +81,7 @@
/obj/item/mod/module/balloon = 1,
/obj/item/mod/module/stamp = 1
)
record_spawn = TRUE

/obj/effect/spawner/random/janitor/supplies
icon = 'icons/effects/random_spawners.dmi'
Expand All @@ -89,4 +93,5 @@
/obj/item/storage/box/lights/mixed,
/obj/item/storage/box/lights/bulbs,
)
record_spawn = TRUE

8 changes: 6 additions & 2 deletions code/game/objects/effects/spawners/random/random_spawner.dm
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
var/spawn_random_offset_max_pixels = 16
/// Whether the spawned items should be rotated randomly.
var/spawn_random_angle = FALSE
/// Whether blackbox should record when the spawner spawns.
var/record_spawn = FALSE

// Brief explanation:
// Rather then setting up and then deleting spawners, we block all atomlike setup
Expand Down Expand Up @@ -96,15 +98,17 @@
loot_spawned++

/**
* Makes the actual item related to our spawner.
* Makes the actual item related to our spawner. If `record_spawn` is `TRUE`,
* this is when the items spawned are recorded to blackbox (except for `/obj/effect`s).
*
* spawn_loc - where are we spawning it?
* type_path_to_make - what are we spawning?
**/
/obj/effect/spawner/random/proc/make_item(spawn_loc, type_path_to_make)
var/result = new type_path_to_make(spawn_loc)

record_item(type_path_to_make)
if(record_spawn)
record_item(type_path_to_make)

var/atom/item = result
if(spawn_random_angle && istype(item))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
)

spawn_random_angle = TRUE
record_spawn = TRUE

/obj/effect/spawner/random/food_trash/record_item(type_path_to_make)
SSblackbox.record_feedback("tally", "random_spawners", 1, "[/obj/item/trash]")
Expand Down

0 comments on commit 02f5a24

Please sign in to comment.