diff --git a/code/game/machinery/atmoalter/canister.dm b/code/game/machinery/atmoalter/canister.dm index bf1d950c07e..4d40ed91c6a 100644 --- a/code/game/machinery/atmoalter/canister.dm +++ b/code/game/machinery/atmoalter/canister.dm @@ -36,7 +36,7 @@ icon_state = "red" canister_color = "red" can_label = 0 - + /obj/machinery/portable_atmospherics/canister/nitrogen/prechilled name = "Canister: \[N2 (Cooling)\]" @@ -439,18 +439,18 @@ update_flag // Special types used for engine setup admin verb, they contain double amount of that of normal canister. /obj/machinery/portable_atmospherics/canister/nitrogen/engine_setup/New() ..() - src.air_contents.adjust_gas("nitrogen", MolesForPressure() * 2) + src.air_contents.adjust_gas("nitrogen", MolesForPressure()) src.update_icon() return 1 /obj/machinery/portable_atmospherics/canister/carbon_dioxide/engine_setup/New() ..() - src.air_contents.adjust_gas("carbon_dioxide", MolesForPressure() * 2) + src.air_contents.adjust_gas("carbon_dioxide", MolesForPressure()) src.update_icon() return 1 /obj/machinery/portable_atmospherics/canister/phoron/engine_setup/New() ..() - src.air_contents.adjust_gas("phoron", MolesForPressure() * 2) + src.air_contents.adjust_gas("phoron", MolesForPressure()) src.update_icon() return 1 \ No newline at end of file diff --git a/code/modules/admin/verbs/mapping.dm b/code/modules/admin/verbs/mapping.dm index 29d2b95d88e..6128113e4a2 100644 --- a/code/modules/admin/verbs/mapping.dm +++ b/code/modules/admin/verbs/mapping.dm @@ -160,7 +160,7 @@ var/list/debug_verbs = list ( ,/client/proc/hide_debug_verbs ,/client/proc/testZAScolors ,/client/proc/testZAScolors_remove - ,/client/proc/setup_supermatter_engine + ,/datum/admins/proc/setup_supermatter ,/client/proc/atmos_toggle_debug ,/client/proc/spawn_tanktransferbomb ) diff --git a/code/modules/supermatter/setup_supermatter.dm b/code/modules/supermatter/setup_supermatter.dm index 931e43bd499..eeaaa348a75 100644 --- a/code/modules/supermatter/setup_supermatter.dm +++ b/code/modules/supermatter/setup_supermatter.dm @@ -1,20 +1,23 @@ #define SETUP_OK 1 // All good #define SETUP_WARNING 2 // Something that shouldn't happen happened, but it's not critical so we will continue #define SETUP_ERROR 3 // Something bad happened, and it's important so we won't continue setup. +#define SETUP_DELAYED 4 // Wait for other things first. #define ENERGY_NITROGEN 115 // Roughly 8 emitter shots. #define ENERGY_CARBONDIOXIDE 150 // Roughly 10 emitter shots. #define ENERGY_PHORON 300 // Roughly 20 emitter shots. Phoron can take more but this is enough to max out both SMESs anyway. -// Called by admin command setup-supermatter, this system uses landmarks to set up the engine. -/client/proc/setup_supermatter_engine() - set category = "Debug" - set name = "Setup supermatter" - set desc = "Sets up the supermatter engine" - if(!check_rights(R_DEBUG|R_ADMIN)) - usr << "You do not have access to this command!" +/datum/admins/proc/setup_supermatter() + set category = "Debug" + set name = "Setup Supermatter" + set desc = "Allows you to start the Supermatter engine." + + if (!istype(src,/datum/admins)) + src = usr.client.holder + if (!istype(src,/datum/admins)) + usr << "Error: you are not an admin!" return var/response = input(usr, "Are you sure? This will start up the engine with selected gas as coolant.", "Engine setup") as null|anything in list("N2", "CO2", "PH", "Abort") @@ -25,7 +28,7 @@ var/warnings = 0 var/success = 0 - log_and_message_admins("## SUPERMATTER SETUP - Setup initiated by [src]/[src.ckey] using coolant type [response].") + log_and_message_admins("## SUPERMATTER SETUP - Setup initiated by [usr] using coolant type [response].") // CONFIGURATION PHASE // Coolant canisters, set types according to response. @@ -56,9 +59,10 @@ for(var/obj/effect/engine_setup/filter/F in world) F.coolant = response + var/list/delayed_objects = list() // SETUP PHASE for(var/obj/effect/engine_setup/S in world) - var/result = S.activate() + var/result = S.activate(0) switch(result) if(SETUP_OK) success++ @@ -70,6 +74,24 @@ errors++ log_and_message_admins("## SUPERMATTER SETUP - Error encountered! Aborting.") break + if(SETUP_DELAYED) + delayed_objects.Add(S) + continue + + if(!errors) + for(var/obj/effect/engine_setup/S in delayed_objects) + var/result = S.activate(1) + switch(result) + if(SETUP_OK) + success++ + continue + if(SETUP_WARNING) + warnings++ + continue + if(SETUP_ERROR) + errors++ + log_and_message_admins("## SUPERMATTER SETUP - Error encountered! Aborting.") + break log_and_message_admins("## SUPERMATTER SETUP - Setup completed with [errors] errors, [warnings] warnings and [success] successful steps.") @@ -86,7 +108,7 @@ icon = 'icons/mob/screen1.dmi' icon_state = "x2" -/obj/effect/engine_setup/proc/activate() +/obj/effect/engine_setup/proc/activate(var/last = 0) return 1 @@ -149,7 +171,9 @@ name = "Supermatter Core Marker" var/energy_setting = 0 -/obj/effect/engine_setup/core/activate() +/obj/effect/engine_setup/core/activate(var/last = 0) + if(!last) + return SETUP_DELAYED ..() var/obj/machinery/power/supermatter/SM = locate() in get_turf(src) if(!SM) @@ -221,6 +245,7 @@ #undef SETUP_OK #undef SETUP_WARNING #undef SETUP_ERROR +#undef SETUP_DELAYED #undef ENERGY_NITROGEN #undef ENERGY_CARBONDIOXIDE #undef ENERGY_PHORON