[EE] Adds Market Crash Event (#31870)

* Adds Market Crash Event

* Typo

* Bees

Co-authored-by: JimKil3 <47290811+JimKil3@users.noreply.github.com>
Signed-off-by: PollardTheDragon <144391971+PollardTheDragon@users.noreply.github.com>

---------

Signed-off-by: PollardTheDragon <144391971+PollardTheDragon@users.noreply.github.com>
Co-authored-by: JimKil3 <47290811+JimKil3@users.noreply.github.com>
This commit is contained in:
PollardTheDragon
2026-05-07 05:02:49 +00:00
committed by GitHub
co-authored by JimKil3
parent 0495f43b53
commit 85002cca6c
5 changed files with 44 additions and 3 deletions
+2 -2
View File
@@ -337,7 +337,7 @@
* products that the vending machine is to carry without manually populating
* src.product_records.
*/
/obj/machinery/economy/vending/proc/build_inventory(list/productlist, list/recordlist, start_empty = FALSE)
/obj/machinery/economy/vending/proc/build_inventory(list/productlist, list/recordlist, start_empty = FALSE, price_mult = 1)
for(var/typepath in productlist)
var/amount = productlist[typepath]
if(isnull(amount))
@@ -350,7 +350,7 @@
if(!start_empty)
R.amount = amount
R.max_amount = amount
R.price = (typepath in prices) ? prices[typepath] : 0
R.price = (typepath in prices) ? (prices[typepath] * price_mult) : 0
recordlist += R
/**
* Refill a vending machine from a refill canister
+1
View File
@@ -198,6 +198,7 @@ GLOBAL_LIST_EMPTY(event_last_fired)
new /datum/event_meta(EVENT_LEVEL_MODERATE, /datum/event/tourist_arrivals, 40, TRUE, _first_run_time = 35 MINUTES),
new /datum/event_meta(EVENT_LEVEL_MODERATE, /datum/event/shuttle_loan, 50, is_one_shot = TRUE),
new /datum/event_meta(EVENT_LEVEL_MODERATE, /datum/event/anomalous_particulate_event, 60, is_one_shot = TRUE),
new /datum/event_meta(EVENT_LEVEL_MODERATE, /datum/event/market_crash, 20),
new /datum/event_meta(EVENT_LEVEL_MODERATE, /datum/event/cargo_pods, 50),
new /datum/event_meta(EVENT_LEVEL_MODERATE, /datum/event/spawn_floor_cluwne, 3),
)
+1 -1
View File
@@ -23,7 +23,7 @@
/datum/event/tear,
/datum/event/tear/honk,
/datum/event/traders,
/datum/event/vent_clog,
/datum/event/market_crash,
/datum/event/disease_outbreak,
/datum/event/vent_clog,
/datum/event/disposals_clog,
+39
View File
@@ -0,0 +1,39 @@
/datum/event/market_crash
name = "Market Crash"
nominal_severity = EVENT_LEVEL_MODERATE
endWhen = 300
/// Vendor price multiplier
var/price_mult = 3
/datum/event/market_crash/announce(false_alarm)
var/list/possible_reasons = list(
"supply chain shortages",
"[syndicate_name()] operatives attacking a shipment",
"space wizard interference",
"bluespace traffic",
"gravitational anomalies",
"extended trade routes",
"market speculation",
"vox",
"a clown college graduation party",
"a Trans-Solar Federation investigation",
"too many credits being invested in WetSkrell.nt",
"an overabundance of bees",
)
GLOB.minor_announcement.Announce("Due to [pick(possible_reasons)], prices for on-station vendors will be increased for a short period. We apologize for the inconvenience.", "Central Command Finance Division")
/datum/event/market_crash/start()
for(var/obj/machinery/economy/vending/vendor in SSmachines.get_by_type(/obj/machinery/economy/vending))
if(!is_station_level(vendor.z))
continue
vendor.build_inventory(vendor.products, vendor.product_records, FALSE, price_mult)
vendor.build_inventory(vendor.contraband, vendor.hidden_records, FALSE, price_mult)
addtimer(CALLBACK(src, PROC_REF(reset_prices)), rand(5 MINUTES, 10 MINUTES))
/datum/event/market_crash/proc/reset_prices()
for(var/obj/machinery/economy/vending/vendor in SSmachines.get_by_type(/obj/machinery/economy/vending))
if(!is_station_level(vendor.z))
continue
vendor.build_inventory(vendor.products, vendor.product_records, FALSE, 1)
vendor.build_inventory(vendor.contraband, vendor.hidden_records, FALSE, 1)
+1
View File
@@ -2278,6 +2278,7 @@
#include "code\modules\events\infestation.dm"
#include "code\modules\events\ion_storm.dm"
#include "code\modules\events\koi_mirgration.dm"
#include "code\modules\events\market_crash.dm"
#include "code\modules\events\mass_hallucination.dm"
#include "code\modules\events\meaty_gore.dm"
#include "code\modules\events\meaty_ores.dm"