Files
Bubberstation/modular_zubbers/code/modules/admin/verbs/debug.dm
BurgerLUA 0ea9182569 [Ready] The Second Maintenance Loot Overhaul (#1607)
## About The Pull Request

Arcade loot is much more diverse and contains more possible toy spawns.
This was introduced in a previous PR but it had to be disabled because
of an upstream change with arcade machines.

Abandoned Crate loot now uses the rare/oddity loot table instead of its
own custom and extremely outdated loot table. It also has some extra...
consequences sometimes.

Adds a bunch of missing maintenance loot, and shifts a lot of it around
based on personal experience.

Makes common maint loot more common.

Reduces the amount of trash that trash piles create.

Fixes a funny issue when you use trash piles with TK at a distance.

Fixes the "Debug Maintenance Loot" verb not existing due to an upstream
change.

Adds a new category called "one of a kind" loot that contains the absurd
type of maint loot that can only be spawned once (of each type). They
can be found rarely in abandoned crates, or very rarely in trash piles.
(Buff?)

## Why It's Good For The Game

Abandoned crate loot had too small of a loot pool, and was pretty low
risk high reward considering there are auto-solvers that you can use to
automatically cheese your way through the puzzle.

Some maint loot was missing/outdated, and did not have some things that
existed in /tg/'s "vanilla" maintenance loot pool. This needed to
change.

On some maps that only had trash piles (Voidraptor), maintenance was a
hellscape of clutter. This should make it less worse.

## Proof Of Testing

Draft because untested. And also I'm tired.

## Changelog

🆑 BurgerBB
add: Overhauls loot that can spawn in abandoned crates, maintenance, and
trash piles.
/🆑

---------

Co-authored-by: projectkepler-RU <99981766+projectkepler-ru@users.noreply.github.com>
Co-authored-by: Waterpig <49160555+Majkl-J@users.noreply.github.com>
2024-07-04 21:00:56 -04:00

57 lines
2.5 KiB
Plaintext

ADMIN_VERB(debug_maintenance_loot, R_DEBUG, "Debug Maintenance Loot", "List all items in the game that are not in maintenance loot", ADMIN_CATEGORY_DEBUG)
var/confirm = input(user,"Are you sure you wish to debug maintenance loot? This process takes up a lot of the server's resources.","Debug Maintenance Loot","Cancel") as null|anything in list("Yes","No","Cancel")
if(confirm != "Yes")
return
log_admin("[key_name(user)] has started debugging maintenance loot.")
var/list/every_single_maintenance_item = list()
for(var/loot_list in GLOB.maintenance_loot)
for(var/loot_object in loot_list)
if(islist(loot_object))
for(var/k in loot_object)
every_single_maintenance_item[k] = TRUE
else
every_single_maintenance_item[loot_object] = TRUE
var/returning_data = "<h1>List of items not present in maintenance loot tables:</h1><br>"
for(var/k in subtypesof(/obj/item/))
if(!every_single_maintenance_item[k])
returning_data = "[returning_data]<br>[k]"
user << browse(returning_data, "window=maintenace_report")
ADMIN_VERB(simulate_maintenance_loot, R_DEBUG, "Simulate Maintenance Loot", "Simulate 100 maintenance loot spawns. Special trait modifiers NOT applied.", ADMIN_CATEGORY_DEBUG)
var/confirm = input(user,"Are you sure you wish to simulate maintenance loot? This process takes up a lot of the server's resources.","Simulate Maintenance Loot","Cancel") as null|anything in list("Yes","No","Cancel")
if(confirm != "Yes")
return
var/list/current_loot_counts = list() //Assoc list. path = count
var/missing_count = 0
for(var/i=1,i<=500,i++)
var/atom/movable/M = pick_weight_recursive(GLOB.maintenance_loot)
if(!M) //wat
missing_count++
continue
if(!current_loot_counts[M])
current_loot_counts[M] = 1
else
current_loot_counts[M] += 1
sortTim(current_loot_counts, cmp=/proc/cmp_numeric_dsc, associative = TRUE)
var/returning_data = "<h1>List of 500 simulated maintenance spawns:</h1><br>"
var/confirmation_count = 0
var/different_path_count = 0
for(var/atom_path in current_loot_counts)
returning_data = "[returning_data]<br>[atom_path]: [current_loot_counts[atom_path]] ([round(current_loot_counts[atom_path]/5,0.01)]%)"
confirmation_count += current_loot_counts[atom_path]
different_path_count += 1
returning_data = "[returning_data]<br>Listed [different_path_count] different types of objects, with [confirmation_count] total objects and [missing_count] missing objects."
user << browse(returning_data, "window=maintenace_report")