Well, that works
This commit is contained in:
BIN
Binary file not shown.
BIN
Binary file not shown.
@@ -1,7 +1,11 @@
|
||||
/// Percentage of tick to leave for master controller to run
|
||||
#define MAPTICK_MC_MIN_RESERVE 70
|
||||
/// internal_tick_usage is updated every tick by extools
|
||||
#if DM_VERSION > 513
|
||||
#define MAPTICK_LAST_INTERNAL_TICK_USAGE world.map_cpu
|
||||
#else
|
||||
#define MAPTICK_LAST_INTERNAL_TICK_USAGE 50
|
||||
#endif
|
||||
/// Tick limit while running normally
|
||||
#define TICK_BYOND_RESERVE 2
|
||||
#define TICK_LIMIT_RUNNING (max(100 - TICK_BYOND_RESERVE - MAPTICK_LAST_INTERNAL_TICK_USAGE, MAPTICK_MC_MIN_RESERVE))
|
||||
|
||||
@@ -17,6 +17,8 @@ SUBSYSTEM_DEF(air)
|
||||
var/cost_rebuilds = 0
|
||||
var/cost_atmos_machinery = 0
|
||||
var/cost_equalize = 0
|
||||
var/thread_wait_ticks = 0
|
||||
var/cur_thread_wait_ticks = 0
|
||||
|
||||
var/list/hotspots = list()
|
||||
var/list/networks = list()
|
||||
@@ -57,7 +59,7 @@ SUBSYSTEM_DEF(air)
|
||||
/datum/controller/subsystem/air/stat_entry(msg)
|
||||
msg += "C:{"
|
||||
msg += "AT:[round(cost_turfs,1)]|"
|
||||
msg += "TH:[round(turf_process_time(),1)]|"
|
||||
msg += "TH:[round(turf_process_time(),1)],[thread_wait_ticks]|"
|
||||
msg += "EG:[round(cost_groups,1)]|"
|
||||
msg += "EQ:[round(cost_equalize,1)]|"
|
||||
msg += "PO:[round(cost_post_process,1)]|"
|
||||
@@ -71,7 +73,7 @@ SUBSYSTEM_DEF(air)
|
||||
msg += "HS:[hotspots.len]|"
|
||||
msg += "PN:[networks.len]|"
|
||||
msg += "HP:[high_pressure_delta.len]|"
|
||||
msg += "DF:[max_deferred_airs]"
|
||||
msg += "DF:[max_deferred_airs]|"
|
||||
msg += "GA:[get_amt_gas_mixes()]|"
|
||||
msg += "MG:[get_max_gas_mixes()]|"
|
||||
return ..()
|
||||
@@ -142,8 +144,11 @@ SUBSYSTEM_DEF(air)
|
||||
if(currentpart == SSAIR_FINALIZE_TURFS)
|
||||
finish_turf_processing(resumed)
|
||||
if(state != SS_RUNNING)
|
||||
cur_thread_wait_ticks++
|
||||
return
|
||||
resumed = 0
|
||||
thread_wait_ticks = MC_AVERAGE(thread_wait_ticks, cur_thread_wait_ticks)
|
||||
cur_thread_wait_ticks = 0
|
||||
currentpart = SSAIR_DEFERRED_AIRS
|
||||
if(currentpart == SSAIR_DEFERRED_AIRS)
|
||||
timer = TICK_USAGE_REAL
|
||||
|
||||
@@ -4,11 +4,11 @@ SUBSYSTEM_DEF(callbacks)
|
||||
wait = 1
|
||||
priority = FIRE_PRIORITY_CALLBACKS
|
||||
|
||||
/proc/process_callbacks()
|
||||
/proc/process_atmos_callbacks()
|
||||
SScallbacks.can_fire = 0
|
||||
SScallbacks.flags |= SS_NO_FIRE
|
||||
CRASH("Auxtools not found! Callback subsystem shutting itself off.")
|
||||
|
||||
/datum/controller/subsystem/callbacks/fire()
|
||||
if(process_callbacks(null,MC_TICK_REMAINING_MS))
|
||||
if(process_atmos_callbacks(MC_TICK_REMAINING_MS))
|
||||
pause()
|
||||
|
||||
+1
-1
@@ -356,7 +356,7 @@ GLOBAL_LIST(topic_status_cache)
|
||||
SSidlenpcpool.MaxZChanged()
|
||||
world.refresh_atmos_grid()
|
||||
|
||||
/// Extools atmos
|
||||
/// Auxtools atmos
|
||||
/world/proc/refresh_atmos_grid()
|
||||
|
||||
/world/proc/change_fps(new_value = 20)
|
||||
|
||||
@@ -58,11 +58,11 @@
|
||||
if (T.atmos_adjacent_turfs)
|
||||
T.atmos_adjacent_turfs -= src
|
||||
UNSETEMPTY(T.atmos_adjacent_turfs)
|
||||
T.set_sleeping(!length(T.atmos_adjacent_turfs))
|
||||
T.set_sleeping(T.blocks_air)
|
||||
T.__update_auxtools_turf_adjacency_info(isspaceturf(T.get_z_base_turf()), -1)
|
||||
UNSETEMPTY(atmos_adjacent_turfs)
|
||||
src.atmos_adjacent_turfs = atmos_adjacent_turfs
|
||||
set_sleeping(!length(atmos_adjacent_turfs))
|
||||
set_sleeping(blocks_air)
|
||||
__update_auxtools_turf_adjacency_info(isspaceturf(get_z_base_turf()))
|
||||
|
||||
/turf/proc/set_sleeping(should_sleep)
|
||||
|
||||
@@ -332,6 +332,11 @@ GLOBAL_LIST_INIT(auxtools_atmos_initialized,FALSE)
|
||||
/datum/gas_mixture/proc/get_true_breath_pressure(partial_pressure)
|
||||
return (partial_pressure * BREATH_VOLUME) / (R_IDEAL_GAS_EQUATION * return_temperature())
|
||||
|
||||
/datum/gas_mixture/proc/set_analyzer_results(instability)
|
||||
if(!analyzer_results)
|
||||
analyzer_results = new
|
||||
analyzer_results["fusion"] = instability
|
||||
|
||||
//Mathematical proofs:
|
||||
/*
|
||||
get_breath_partial_pressure(gas_pp) --> gas_pp/total_moles()*breath_pp = pp
|
||||
|
||||
@@ -88,6 +88,18 @@
|
||||
/datum/gas/oxygen = MINIMUM_MOLE_COUNT
|
||||
)
|
||||
|
||||
/proc/fire_expose(turf/open/location, datum/gas_mixture/air, temperature)
|
||||
if(istype(location) && temperature > FIRE_MINIMUM_TEMPERATURE_TO_EXIST)
|
||||
location.hotspot_expose(temperature, CELL_VOLUME)
|
||||
for(var/I in location)
|
||||
var/atom/movable/item = I
|
||||
item.temperature_expose(air, temperature, CELL_VOLUME)
|
||||
location.temperature_expose(air, temperature, CELL_VOLUME)
|
||||
|
||||
/proc/radiation_burn(turf/open/location, energy_released)
|
||||
if(location && prob(10))
|
||||
radiation_pulse(location, energy_released/TRITIUM_BURN_RADIOACTIVITY_FACTOR)
|
||||
|
||||
/datum/gas_reaction/tritfire/react(datum/gas_mixture/air, datum/holder)
|
||||
var/energy_released = 0
|
||||
var/old_heat_capacity = air.heat_capacity()
|
||||
@@ -241,6 +253,20 @@
|
||||
//Fusion Rework Counter: Please increment this if you make a major overhaul to this system again.
|
||||
//6 reworks
|
||||
|
||||
/proc/fusion_ball(datum/holder, reaction_energy, instability)
|
||||
var/turf/open/location
|
||||
if (istype(holder,/datum/pipeline)) //Find the tile the reaction is occuring on, or a random part of the network if it's a pipenet.
|
||||
var/datum/pipeline/fusion_pipenet = holder
|
||||
location = get_turf(pick(fusion_pipenet.members))
|
||||
else
|
||||
location = get_turf(holder)
|
||||
if(location)
|
||||
var/particle_chance = ((PARTICLE_CHANCE_CONSTANT)/(reaction_energy-PARTICLE_CHANCE_CONSTANT)) + 1//Asymptopically approaches 100% as the energy of the reaction goes up.
|
||||
if(prob(PERCENT(particle_chance)))
|
||||
location.fire_nuclear_particle()
|
||||
var/rad_power = max((FUSION_RAD_COEFFICIENT/instability) + FUSION_RAD_MAX,0)
|
||||
radiation_pulse(location,rad_power)
|
||||
|
||||
/datum/gas_reaction/fusion
|
||||
exclude = FALSE
|
||||
priority = 2
|
||||
|
||||
+1
-1
@@ -312,8 +312,8 @@
|
||||
#include "code\controllers\subsystem\augury.dm"
|
||||
#include "code\controllers\subsystem\autotransfer.dm"
|
||||
#include "code\controllers\subsystem\blackbox.dm"
|
||||
#include "code\controllers\subsystem\callback.dm"
|
||||
#include "code\controllers\subsystem\blackmarket.dm"
|
||||
#include "code\controllers\subsystem\callback.dm"
|
||||
#include "code\controllers\subsystem\chat.dm"
|
||||
#include "code\controllers\subsystem\communications.dm"
|
||||
#include "code\controllers\subsystem\dbcore.dm"
|
||||
|
||||
Reference in New Issue
Block a user