Skip to content

Commit

Permalink
adds overpressure damage, hydrogen gas miner, and a temporary fuel te…
Browse files Browse the repository at this point in the history
…st canister
  • Loading branch information
Thera-Pissed committed Oct 28, 2023
1 parent b51e1f2 commit 7343b18
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 6 deletions.
35 changes: 29 additions & 6 deletions code/game/machinery/shuttle/shuttle_heater.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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(!..())
Expand Down Expand Up @@ -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]
Expand Down
5 changes: 5 additions & 0 deletions code/modules/atmospherics/machinery/other/miner.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
9 changes: 9 additions & 0 deletions code/modules/atmospherics/machinery/portable/canister.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down

0 comments on commit 7343b18

Please sign in to comment.