Creates a "Secrets" panel button for debugging cargo orders (#89469)

## About The Pull Request

-Creates a new button in the "Secrets" menu that can override the
cooldown for ordering items from department consoles. It can be used to
make the cooldown longer, shorter or non-existent.
-Creates a new global var to manage this override on every console in
dept_order.dm

## Why It's Good For The Game
This tool assists in finding and fixing bugs related to cargo orders and
cargo crates. The wait time for these cooldowns can be ten minutes or
longer, and this speeds up the process significantly.

It could also be used by admins during play to make the cooldown lower,
or cause absolute mayhem on cargo by setting the cooldown duration to 0.

## Changelog
🆑
add: Added a button in the "Secrets" menu to alter the department
console order delay.
qol: Button makes it easier to find cargo related bugs.
code: Changed code in department_order.dm to allow for overriding the
order cooldown duration.
admin: Created an admin button in the "Secrets" panel.
/🆑

---------

Co-authored-by: Zephyr <12817816+ZephyrTFA@users.noreply.github.com>
This commit is contained in:
GwynCodes
2025-02-15 02:14:04 +01:00
committed by Roxy
parent 4bcdaa063f
commit ced6c0392a
3 changed files with 35 additions and 8 deletions
@@ -1,3 +1,6 @@
/// Stores an override value for the order cooldown to be used by the Dpt. Order Cooldown button in the secrets menu. When null, the override is not active.
GLOBAL_VAR(department_cd_override)
/datum/computer_file/program/department_order
filename = "dept_order"
filedesc = "Departmental Orders"
@@ -253,8 +256,12 @@
/// Calculates the cooldown it will take for this department's free order, based on its credit cost
/datum/computer_file/program/department_order/proc/calculate_cooldown(credits)
var/time_y = DEPARTMENTAL_ORDER_COOLDOWN_COEFFICIENT * (log(10, credits) ** DEPARTMENTAL_ORDER_COOLDOWN_EXPONENT) * (1 SECONDS)
department_cooldowns[linked_department] = world.time + time_y
if(isnull(GLOB.department_cd_override))
var/time_y = DEPARTMENTAL_ORDER_COOLDOWN_COEFFICIENT * (log(10, credits) ** DEPARTMENTAL_ORDER_COOLDOWN_EXPONENT) * (1 SECONDS)
department_cooldowns[linked_department] = world.time + time_y
else
var/time_y = GLOB.department_cd_override SECONDS
department_cooldowns[linked_department] = world.time + time_y
/datum/computer_file/program/department_order/process_tick(seconds_per_tick)
if(!check_cooldown() || alert_silenced || !alert_able)