From e1bcb752a5fd368767268f9cf08889ad8b00cec5 Mon Sep 17 00:00:00 2001 From: Drulikar Date: Sun, 18 Feb 2024 22:53:22 -0800 Subject: [PATCH] Flexible ERT argument Fix CMB black market heat call --- code/datums/emergency_calls/emergency_call.dm | 20 ++++++++++++++++--- .../colonialmarines/colonialmarines.dm | 2 +- .../colonialmarines/whiskey_outpost.dm | 2 +- code/game/supplyshuttle.dm | 2 +- .../cm_tech/techs/marine/tier3/cryo_spec.dm | 2 +- .../cm_tech/techs/marine/tier3/cryorine.dm | 2 +- .../chemistry_properties/prop_special.dm | 2 +- 7 files changed, 23 insertions(+), 9 deletions(-) diff --git a/code/datums/emergency_calls/emergency_call.dm b/code/datums/emergency_calls/emergency_call.dm index 7884d93b18bc..fcc7685e3dfc 100644 --- a/code/datums/emergency_calls/emergency_call.dm +++ b/code/datums/emergency_calls/emergency_call.dm @@ -92,12 +92,26 @@ return chosen_call /datum/game_mode/proc/get_specific_call(call_name, quiet_launch = FALSE, announce_incoming = TRUE, info = "") - for(var/datum/emergency_call/E in all_calls) //Loop through all potential candidates - if(E.name == call_name) - var/datum/emergency_call/em_call = new E.type() + if(ispath(call_name, /datum/emergency_call)) + var/datum/emergency_call/em_call = new call_name + em_call.objective_info = info + em_call.activate(quiet_launch, announce_incoming) + return + + var/call_path = text2path(call_name) + if(ispath(call_path, /datum/emergency_call)) + var/datum/emergency_call/em_call = new call_path + em_call.objective_info = info + em_call.activate(quiet_launch, announce_incoming) + return + + for(var/datum/emergency_call/cur_em_call in all_calls) //Loop through all potential candidates + if(cur_em_call.name == call_name) + var/datum/emergency_call/em_call = new cur_em_call.type() em_call.objective_info = info em_call.activate(quiet_launch, announce_incoming) return + error("get_specific_call could not find emergency call '[call_name]'") return diff --git a/code/game/gamemodes/colonialmarines/colonialmarines.dm b/code/game/gamemodes/colonialmarines/colonialmarines.dm index 192277a250cc..ca0f34e64a7b 100644 --- a/code/game/gamemodes/colonialmarines/colonialmarines.dm +++ b/code/game/gamemodes/colonialmarines/colonialmarines.dm @@ -265,7 +265,7 @@ continue if(groundside_humans > (groundside_xenos * GROUNDSIDE_XENO_MULTIPLIER)) - SSticker.mode.get_specific_call("Xenomorphs Groundside (Forsaken)", TRUE, FALSE) + SSticker.mode.get_specific_call(/datum/emergency_call/forsaken_xenos, TRUE, FALSE) // "Xenomorphs Groundside (Forsaken)" TIMER_COOLDOWN_START(src, COOLDOWN_HIJACK_GROUND_CHECK, 1 MINUTES) diff --git a/code/game/gamemodes/colonialmarines/whiskey_outpost.dm b/code/game/gamemodes/colonialmarines/whiskey_outpost.dm index f6fbb5f4f900..d216ba762a3e 100644 --- a/code/game/gamemodes/colonialmarines/whiskey_outpost.dm +++ b/code/game/gamemodes/colonialmarines/whiskey_outpost.dm @@ -194,7 +194,7 @@ announce_xeno_wave(wave) if(xeno_wave == 7) //Wave when Marines get reinforcements! - get_specific_call("Marine Reinforcements (Squad)", FALSE, TRUE) + get_specific_call(/datum/emergency_call/wo, FALSE, TRUE) // "Marine Reinforcements (Squad)" xeno_wave = min(xeno_wave + 1, WO_MAX_WAVE) diff --git a/code/game/supplyshuttle.dm b/code/game/supplyshuttle.dm index 893071c758ed..a059d080e8ee 100644 --- a/code/game/supplyshuttle.dm +++ b/code/game/supplyshuttle.dm @@ -1277,7 +1277,7 @@ GLOBAL_DATUM_INIT(supply_controller, /datum/controller/supply, new()) /datum/controller/supply/proc/black_market_investigation() black_market_heat = -1 - SSticker.mode.get_specific_call("Inspection - Colonial Marshal Ledger Investigation Team", TRUE, TRUE) + SSticker.mode.get_specific_call(/datum/emergency_call/inspection_cmb/black_market, TRUE, TRUE) // "Inspection - Colonial Marshals Ledger Investigation Team" log_game("Black Market Inspection auto-triggered.") /obj/structure/machinery/computer/supplycomp/proc/is_buyable(datum/supply_packs/supply_pack) diff --git a/code/modules/cm_tech/techs/marine/tier3/cryo_spec.dm b/code/modules/cm_tech/techs/marine/tier3/cryo_spec.dm index 16f0f26576a3..acee904af305 100644 --- a/code/modules/cm_tech/techs/marine/tier3/cryo_spec.dm +++ b/code/modules/cm_tech/techs/marine/tier3/cryo_spec.dm @@ -21,4 +21,4 @@ /datum/tech/cryomarine/on_unlock() . = ..() - SSticker.mode.get_specific_call("Marine Cryo Reinforcement (Spec)", TRUE, FALSE) + SSticker.mode.get_specific_call(/datum/emergency_call/cryo_spec, TRUE, FALSE) // "Marine Cryo Reinforcement (Spec)" diff --git a/code/modules/cm_tech/techs/marine/tier3/cryorine.dm b/code/modules/cm_tech/techs/marine/tier3/cryorine.dm index 49b4eea8f525..404fbd07c2ae 100644 --- a/code/modules/cm_tech/techs/marine/tier3/cryorine.dm +++ b/code/modules/cm_tech/techs/marine/tier3/cryorine.dm @@ -23,4 +23,4 @@ /datum/tech/repeatable/cryomarine/on_unlock() . = ..() - SSticker.mode.get_specific_call("Marine Cryo Reinforcements (Tech)", TRUE, FALSE) + SSticker.mode.get_specific_call(/datum/emergency_call/cryo_squad/tech, TRUE, FALSE) // "Marine Cryo Reinforcements (Tech)" diff --git a/code/modules/reagents/chemistry_properties/prop_special.dm b/code/modules/reagents/chemistry_properties/prop_special.dm index 52354f0d6b01..cee75ca58c06 100644 --- a/code/modules/reagents/chemistry_properties/prop_special.dm +++ b/code/modules/reagents/chemistry_properties/prop_special.dm @@ -96,7 +96,7 @@ H.contract_disease(new /datum/disease/xeno_transformation(0),1) //This is the real reason PMCs are being sent to retrieve it. /datum/chem_property/special/DNA_Disintegrating/trigger() - SSticker.mode.get_specific_call("Weyland-Yutani Goon (Chemical Investigation Squad)", TRUE, FALSE, holder.name) + SSticker.mode.get_specific_call(/datum/emergency_call/goon/chem_retrieval, TRUE, FALSE, holder.name) // "Weyland-Yutani Goon (Chemical Investigation Squad)" GLOB.chemical_data.update_credits(10) message_admins("The research department has discovered DNA_Disintegrating in [holder.name] adding 10 bonus tech points.") var/datum/techtree/tree = GET_TREE(TREE_MARINE)