mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-22 19:47:47 +01:00
integrate XGM into the code
New turf proc: assume_gas(). Maps to air.adjust_gas_temp(). Lots of optimizations to processing, fire, lighting, HasEntered() and more. Zones now process all fire data and existance in one go, fire objects only handle spreading. Most code has been ported straight so some of it mightn't be ideally structured for the new gas_mixtures. Signed-off-by: Mloc-Argent <colmohici@gmail.com>
This commit is contained in:
@@ -323,12 +323,7 @@
|
||||
var/datum/gas_mixture/gas = (..())
|
||||
if(!gas) return null
|
||||
var/datum/gas_mixture/newgas = new/datum/gas_mixture()
|
||||
newgas.oxygen = gas.oxygen
|
||||
newgas.carbon_dioxide = gas.carbon_dioxide
|
||||
newgas.nitrogen = gas.nitrogen
|
||||
newgas.phoron = gas.phoron
|
||||
newgas.volume = gas.volume
|
||||
newgas.temperature = gas.temperature
|
||||
newgas.copy_from(gas)
|
||||
if(newgas.temperature <= target_temp) return
|
||||
|
||||
if((newgas.temperature - cooling_power) > target_temp)
|
||||
|
||||
@@ -206,15 +206,9 @@
|
||||
|
||||
proc/TemperatureAct(temperature)
|
||||
for(var/turf/simulated/floor/target_tile in range(2,loc))
|
||||
|
||||
var/datum/gas_mixture/napalm = new
|
||||
|
||||
var/phoronToDeduce = temperature/10
|
||||
target_tile.assume_gas("phoron", phoronToDeduce, 200+T0C)
|
||||
|
||||
napalm.phoron = phoronToDeduce
|
||||
napalm.temperature = 200+T0C
|
||||
|
||||
target_tile.assume_air(napalm)
|
||||
spawn (0) target_tile.hotspot_expose(temperature, 400)
|
||||
|
||||
hardness -= phoronToDeduce/100
|
||||
|
||||
@@ -81,8 +81,7 @@ obj/structure/ex_act(severity)
|
||||
/obj/structure/transit_tube_pod/New(loc)
|
||||
..(loc)
|
||||
|
||||
air_contents.oxygen = MOLES_O2STANDARD * 2
|
||||
air_contents.nitrogen = MOLES_N2STANDARD
|
||||
air_contents.adjust_multi("oxygen", MOLES_O2STANDARD * 2, "nitrogen", MOLES_N2STANDARD)
|
||||
air_contents.temperature = T20C
|
||||
|
||||
// Give auto tubes time to align before trying to start moving
|
||||
@@ -123,8 +122,8 @@ obj/structure/ex_act(severity)
|
||||
else if(!pod.moving && pod.dir in directions())
|
||||
AM.loc = pod
|
||||
return
|
||||
|
||||
|
||||
|
||||
|
||||
/obj/structure/transit_tube/station/attack_hand(mob/user as mob)
|
||||
if(!pod_moving)
|
||||
for(var/obj/structure/transit_tube_pod/pod in loc)
|
||||
@@ -359,11 +358,7 @@ obj/structure/ex_act(severity)
|
||||
// datum, there might be problems if I don't...
|
||||
/obj/structure/transit_tube_pod/return_air()
|
||||
var/datum/gas_mixture/GM = new()
|
||||
GM.oxygen = air_contents.oxygen
|
||||
GM.carbon_dioxide = air_contents.carbon_dioxide
|
||||
GM.nitrogen = air_contents.nitrogen
|
||||
GM.phoron = air_contents.phoron
|
||||
GM.temperature = air_contents.temperature
|
||||
GM.copy_from(air_contents)
|
||||
return GM
|
||||
|
||||
// For now, copying what I found in an unused FEA file (and almost identical in a
|
||||
@@ -398,8 +393,8 @@ obj/structure/ex_act(severity)
|
||||
var/transfer_in = max(0.1, 0.5 * (env_pressure - int_pressure) / total_pressure)
|
||||
var/transfer_out = max(0.1, 0.3 * (int_pressure - env_pressure) / total_pressure)
|
||||
|
||||
var/datum/gas_mixture/from_env = loc.remove_air(environment.total_moles() * transfer_in)
|
||||
var/datum/gas_mixture/from_int = air_contents.remove(air_contents.total_moles() * transfer_out)
|
||||
var/datum/gas_mixture/from_env = loc.remove_air(environment.total_moles * transfer_in)
|
||||
var/datum/gas_mixture/from_int = air_contents.remove(air_contents.total_moles * transfer_out)
|
||||
|
||||
loc.assume_air(from_int)
|
||||
air_contents.merge(from_env)
|
||||
|
||||
@@ -190,7 +190,7 @@
|
||||
del(mymist)
|
||||
ismist = 0
|
||||
|
||||
/obj/machinery/shower/HasEntered(atom/movable/O)
|
||||
/obj/machinery/shower/Crossed(atom/movable/O)
|
||||
..()
|
||||
wash(O)
|
||||
if(ismob(O))
|
||||
|
||||
Reference in New Issue
Block a user