From 7343b18d10008838adc250122edd3511a157f404 Mon Sep 17 00:00:00 2001 From: Thera-Pissed <90987989+Thera-Pissed@users.noreply.github.com> Date: Sat, 28 Oct 2023 15:47:06 -0500 Subject: [PATCH] adds overpressure damage, hydrogen gas miner, and a temporary fuel test canister --- code/game/machinery/shuttle/shuttle_heater.dm | 35 +++++++++++++++---- .../atmospherics/machinery/other/miner.dm | 5 +++ .../machinery/portable/canister.dm | 9 +++++ 3 files changed, 43 insertions(+), 6 deletions(-) diff --git a/code/game/machinery/shuttle/shuttle_heater.dm b/code/game/machinery/shuttle/shuttle_heater.dm index d738272dca04..047bef881dcb 100644 --- a/code/game/machinery/shuttle/shuttle_heater.dm +++ b/code/game/machinery/shuttle/shuttle_heater.dm @@ -191,9 +191,12 @@ icon_state = "heater_pipe" var/icon_state_closed = "heater_pipe" var/icon_state_open = "heater_pipe_open" - var/gas_amount = 0 + var/gas_amount = 0 //amount of gas used in calculations var/fuel = 0 - var/oxy = 0 + var/oxy = 0 //used for debugging + var/safe_limit = 1010 //pressure before Problems hapepen + var/pressure_damage = 0 + var/damage_state = 0 idle_power_usage = 50 // circuit = /obj/item/circuitboard/machine/shuttle/fire_heater @@ -225,7 +228,27 @@ update_adjacent_engines() /obj/machinery/atmospherics/components/unary/shuttle/fire_heater/process_atmos() - update_parents() + var/datum/gas_mixture/air_contents = airs[1] + var/pressure = air_contents.return_pressure() + if(pressure > safe_limit) + pressure_damage += pressure/safe_limit + if(rand(1,48) == 48) + playsound(loc,'sound/effects/creak1.ogg', 60, TRUE, 20, pressure_affected = FALSE) + if(pressure_damage >= 1200) + damage_state += 1 + pressure_damage = 0 + playsound(loc,'sound/effects/bang.ogg', 240, TRUE, 5) + if(damage_state >= 1) + var/loc_air = loc.return_air() + air_contents.temperature_share(loc_air,0.4) + if(damage_state >= 2) + assume_air_ratio(air_contents, 0.01) + if(damage_state >= 3) + var/epicenter = loc + explosion(epicenter, 1, 2, 3, 3, TRUE, TRUE) + update_parents() + +// REMOVEWHENDONE /proc/playsound(atom/source, soundin, vol as num, vary, extrarange as num, falloff_exponent = SOUND_FALLOFF_EXPONENT, frequency = null, channel = 0, pressure_affected = TRUE, ignore_walls = TRUE, falloff_distance = SOUND_DEFAULT_FALLOFF_DISTANCE, use_reverb = TRUE, mono_adj = FALSE) /obj/machinery/atmospherics/components/unary/shuttle/fire_heater/default_change_direction_wrench(mob/user, obj/item/I) if(!..()) @@ -292,9 +315,9 @@ return air_contents.get_moles(gas_type) >= required /** - * Burns a specific amount of one type of gas. Returns how much was actually used. - * * amount - The amount of mols of fuel to burn. - * * gas_type - The gas type to burn. + * consumes a portion of the mols and checks how much could combust to make thrust. + * oxidation_power is the total value of all the oxidizers + * fuel_power is ^ but for fuel */ /obj/machinery/atmospherics/components/unary/shuttle/fire_heater/proc/consume_fuel(gas_consumed) var/datum/gas_mixture/air_contents = airs[1] diff --git a/code/modules/atmospherics/machinery/other/miner.dm b/code/modules/atmospherics/machinery/other/miner.dm index 37045635cf1a..7bc12184a3b2 100644 --- a/code/modules/atmospherics/machinery/other/miner.dm +++ b/code/modules/atmospherics/machinery/other/miner.dm @@ -178,3 +178,8 @@ name = "\improper Water Vapor Gas Miner" overlay_color = "#99928E" spawn_id = GAS_H2O + +/obj/machinery/atmospherics/miner/hydrogen + name = "\improper Hydrogen Gas Miner" + overlay_color = "#ffffffda" + spawn_id = GAS_HYDROGEN diff --git a/code/modules/atmospherics/machinery/portable/canister.dm b/code/modules/atmospherics/machinery/portable/canister.dm index d335e194dc88..b69b324c4de8 100644 --- a/code/modules/atmospherics/machinery/portable/canister.dm +++ b/code/modules/atmospherics/machinery/portable/canister.dm @@ -154,6 +154,15 @@ gas_type = GAS_HYDROGEN filled = 1 +/obj/machinery/portable_atmospherics/canister/fuel_test + name = "hydrogen canister" + desc = "Hydrogen. Used in thruster fuel" + +/obj/machinery/portable_atmospherics/canister/fuel_test/create_gas() + air_contents.set_moles(GAS_O2,500) + air_contents.set_moles(GAS_HYDROGEN,1000) + air_contents.set_temperature(T20C) + /obj/machinery/portable_atmospherics/canister/fusion_test name = "fusion test canister" desc = "Don't be a badmin."