From 44578b78324670653d8bb77d891d6b0a939eefbe Mon Sep 17 00:00:00 2001 From: Ccomp5950 Date: Mon, 28 Apr 2014 11:29:35 -0500 Subject: [PATCH] Deadlier supermatter. If you don't add coolant, you will have a bad time. Before: Supermatter would raise the temperature without taking into account how many moles it grabbed in it's "breath" meaning it was better that you had a lower pressure inside your engine chamber so the engine would spit back out it's "breath" and it couldn't heat up the engine room as much. Now: Supermatter will take into account the heat_capacity of the breath it takes and will heat up it up accordingly and proportional to how much energy it has. Gone are the days you could run the supermatter engine without adding coolant. Also: Added a debugverb that setups the engine for you, the verb is based off of baystations map and areas and shouldn't require too much change to bring it in line for other servers. --- code/modules/admin/verbs/debug.dm | 83 +++++++++++++++++++++++++ code/modules/admin/verbs/mapping.dm | 1 + code/modules/supermatter/supermatter.dm | 12 ++-- 3 files changed, 92 insertions(+), 4 deletions(-) diff --git a/code/modules/admin/verbs/debug.dm b/code/modules/admin/verbs/debug.dm index 4131e46411b..72bf9cfb6ef 100644 --- a/code/modules/admin/verbs/debug.dm +++ b/code/modules/admin/verbs/debug.dm @@ -968,6 +968,89 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that if(SMES.anchored) SMES.chargemode = 1 +/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)) return + + var/response = alert("Are you sure? This will start up the engine. Should only be used during debug!",,"Setup Completely","Setup except coolant","No") + + if(response == "No") + return + + var/found_the_pump = 0 + var/obj/machinery/power/supermatter/SM + + for(var/obj/machinery/M in world) + if(!M) + continue + if(!M.loc) + continue + if(!M.loc.loc) + continue + + if(istype(M.loc.loc,/area/engine/engine_room)) + if(istype(M,/obj/machinery/power/rad_collector)) + var/obj/machinery/power/rad_collector/Rad = M + Rad.anchored = 1 + Rad.connect_to_network() + + var/obj/item/weapon/tank/plasma/Plasma = new/obj/item/weapon/tank/plasma(Rad) + + Plasma.air_contents.toxins = 29.1154 //This is a full tank if you filled it from a canister + Rad.P = Plasma + + Plasma.loc = Rad + + if(!Rad.active) + Rad.toggle_power() + Rad.update_icon() + + else if(istype(M,/obj/machinery/atmospherics/binary/pump)) //Turning on every pump. + var/obj/machinery/atmospherics/binary/pump/Pump = M + if(Pump.name == "Engine Feed" && response == "Setup Completely") + found_the_pump = 1 + Pump.air2.nitrogen = 3750 //The contents of 2 canisters. + Pump.air2.temperature = 50 + Pump.air2.update_values() + Pump.on=1 + Pump.target_pressure = 4500 + Pump.update_icon() + + else if(istype(M,/obj/machinery/power/supermatter)) + SM = M + spawn(50) + SM.power = 320 + + else if(istype(M,/obj/machinery/power/smes)) //This is the SMES inside the engine room. We don't need much power. + var/obj/machinery/power/smes/SMES = M + SMES.chargemode = 1 + SMES.chargelevel = 200000 + SMES.output = 75000 + + else if(istype(M.loc.loc,/area/engine/engine_smes)) //Set every SMES to charge and spit out 300,000 power between the 4 of them. + if(istype(M,/obj/machinery/power/smes)) + var/obj/machinery/power/smes/SMES = M + SMES.chargemode = 1 + SMES.chargelevel = 200000 + SMES.output = 75000 + + if(!found_the_pump && response == "Setup Completely") + src << "\red Unable to locate air supply to fill up with coolant, adding some coolant around the supermatter" + var/turf/simulated/T = SM.loc + T.zone.air.nitrogen += 450 + T.zone.air.temperature = 50 + T.zone.air.update_values() + + + log_admin("[key_name(usr)] setup the supermatter engine [response == "Setup except coolant" ? "without coolant" : ""]") + message_admins("\blue [key_name_admin(usr)] setup the supermatter engine [response == "Setup except coolant" ? "without coolant": ""]", 1) + return + + + /client/proc/cmd_debug_mob_lists() set category = "Debug" set name = "Debug Mob Lists" diff --git a/code/modules/admin/verbs/mapping.dm b/code/modules/admin/verbs/mapping.dm index 2e092689c3d..0a7c1fe345e 100644 --- a/code/modules/admin/verbs/mapping.dm +++ b/code/modules/admin/verbs/mapping.dm @@ -161,6 +161,7 @@ var/list/debug_verbs = list ( ,/client/proc/hide_debug_verbs ,/client/proc/testZAScolors ,/client/proc/testZAScolors_remove + ,/client/proc/setup_supermatter_engine ) diff --git a/code/modules/supermatter/supermatter.dm b/code/modules/supermatter/supermatter.dm index f1ca0acc799..3fc7e7d9a75 100644 --- a/code/modules/supermatter/supermatter.dm +++ b/code/modules/supermatter/supermatter.dm @@ -1,8 +1,8 @@ #define NITROGEN_RETARDATION_FACTOR 4 //Higher == N2 slows reaction more -#define THERMAL_RELEASE_MODIFIER 10 //Higher == less heat released during reaction +#define THERMAL_RELEASE_MODIFIER 750 //Higher == more heat released during reaction #define PLASMA_RELEASE_MODIFIER 1500 //Higher == less plasma released by reaction -#define OXYGEN_RELEASE_MODIFIER 750 //Higher == less oxygen released at high temperature/power +#define OXYGEN_RELEASE_MODIFIER 1500 //Higher == less oxygen released at high temperature/power #define REACTION_POWER_MODIFIER 1.1 //Higher == more overall power @@ -167,9 +167,13 @@ //Also keep in mind we are only adding this temperature to (efficiency)% of the one tile the rock //is on. An increase of 4*C @ 25% efficiency here results in an increase of 1*C / (#tilesincore) overall. - removed.temperature += (device_energy / THERMAL_RELEASE_MODIFIER) + + var/thermal_power = THERMAL_RELEASE_MODIFIER + if(removed.total_moles < 35) thermal_power += 750 //If you don't add coolant, you are going to have a bad time. - removed.temperature = max(0, min(removed.temperature, 2500)) + removed.temperature += ((device_energy * thermal_power) / max(1, removed.heat_capacity())) + + removed.temperature = max(0, min(removed.temperature, 10000)) //Calculate how much gas to release removed.toxins += max(device_energy / PLASMA_RELEASE_MODIFIER, 0)