monstermos wow
This commit is contained in:
@@ -6,7 +6,7 @@ SUBSYSTEM_DEF(air)
|
||||
flags = SS_BACKGROUND
|
||||
runlevels = RUNLEVEL_GAME | RUNLEVEL_POSTGAME
|
||||
|
||||
var/cost_turf_reactions = 0
|
||||
var/cost_turfs = 0
|
||||
var/cost_groups = 0
|
||||
var/cost_highpressure = 0
|
||||
var/cost_hotspots = 0
|
||||
@@ -14,10 +14,9 @@ SUBSYSTEM_DEF(air)
|
||||
var/cost_pipenets = 0
|
||||
var/cost_rebuilds = 0
|
||||
var/cost_atmos_machinery = 0
|
||||
var/cost_equalize = 0
|
||||
|
||||
var/list/excited_groups = list()
|
||||
var/list/active_turfs = list()
|
||||
var/list/turf_react_queue = list()
|
||||
var/list/hotspots = list()
|
||||
var/list/networks = list()
|
||||
var/list/pipenets_needing_rebuilt = list()
|
||||
@@ -38,20 +37,21 @@ SUBSYSTEM_DEF(air)
|
||||
var/map_loading = TRUE
|
||||
var/list/queued_for_activation
|
||||
|
||||
var/log_explosive_decompression = TRUE // If things get spammy, admemes can turn this off.
|
||||
|
||||
/datum/controller/subsystem/air/stat_entry(msg)
|
||||
msg += "C:{"
|
||||
msg += "RQ:[round(cost_turf_reactions,1)]|"
|
||||
msg += "EQ:[round(cost_equalize,1)]|"
|
||||
msg += "AT:[round(cost_turfs,1)]|"
|
||||
msg += "EG:[round(cost_groups,1)]|"
|
||||
msg += "HP:[round(cost_highpressure,1)]|"
|
||||
msg += "HS:[round(cost_hotspots,1)]|"
|
||||
msg += "SC:[round(cost_superconductivity,1)]|"
|
||||
msg += "PN:[round(cost_pipenets,1)]|"
|
||||
msg += "RB:[round(cost_rebuilds,1)]|"
|
||||
msg += "AM:[round(cost_atmos_machinery,1)]"
|
||||
msg += "} "
|
||||
msg += "AT:[active_turfs.len]|"
|
||||
msg += "RQ:[turf_react_queue.len]|"
|
||||
msg += "EG:[excited_groups.len]|"
|
||||
msg += "EG:[get_amt_excited_groups()]|"
|
||||
msg += "HS:[hotspots.len]|"
|
||||
msg += "PN:[networks.len]|"
|
||||
msg += "HP:[high_pressure_delta.len]|"
|
||||
@@ -59,8 +59,8 @@ SUBSYSTEM_DEF(air)
|
||||
msg += "AT/MS:[round((cost ? active_turfs.len/cost : 0),0.1)]"
|
||||
..(msg)
|
||||
|
||||
|
||||
/datum/controller/subsystem/air/Initialize(timeofday)
|
||||
extools_update_ssair()
|
||||
map_loading = FALSE
|
||||
setup_allturfs()
|
||||
setup_atmos_machinery()
|
||||
@@ -68,6 +68,7 @@ SUBSYSTEM_DEF(air)
|
||||
gas_reactions = init_gas_reactions()
|
||||
return ..()
|
||||
|
||||
/datum/controller/subsystem/air/proc/extools_update_ssair()
|
||||
|
||||
/datum/controller/subsystem/air/fire(resumed = 0)
|
||||
var/timer = TICK_USAGE_REAL
|
||||
@@ -99,12 +100,21 @@ SUBSYSTEM_DEF(air)
|
||||
if(state != SS_RUNNING)
|
||||
return
|
||||
resumed = 0
|
||||
currentpart = SSAIR_REACTQUEUE
|
||||
currentpart = SSAIR_ACTIVETURFS // set this to EQUALIZE for monstermos
|
||||
|
||||
if(currentpart == SSAIR_REACTQUEUE)
|
||||
if(currentpart == SSAIR_EQUALIZE)
|
||||
timer = TICK_USAGE_REAL
|
||||
process_react_queue(resumed)
|
||||
cost_turf_reactions = MC_AVERAGE(cost_turf_reactions, TICK_DELTA_TO_MS(TICK_USAGE_REAL - timer))
|
||||
process_turf_equalize(resumed)
|
||||
cost_equalize = MC_AVERAGE(cost_equalize, TICK_DELTA_TO_MS(TICK_USAGE_REAL - timer))
|
||||
if(state != SS_RUNNING)
|
||||
return
|
||||
resumed = 0
|
||||
currentpart = SSAIR_ACTIVETURFS
|
||||
|
||||
if(currentpart == SSAIR_ACTIVETURFS)
|
||||
timer = TICK_USAGE_REAL
|
||||
process_active_turfs(resumed)
|
||||
cost_turfs = MC_AVERAGE(cost_turfs, TICK_DELTA_TO_MS(TICK_USAGE_REAL - timer))
|
||||
if(state != SS_RUNNING)
|
||||
return
|
||||
resumed = 0
|
||||
@@ -146,6 +156,8 @@ SUBSYSTEM_DEF(air)
|
||||
resumed = 0
|
||||
currentpart = SSAIR_REBUILD_PIPENETS
|
||||
|
||||
|
||||
|
||||
/datum/controller/subsystem/air/proc/process_pipenets(resumed = 0)
|
||||
if (!resumed)
|
||||
src.currentrun = networks.Copy()
|
||||
@@ -180,19 +192,6 @@ SUBSYSTEM_DEF(air)
|
||||
return
|
||||
|
||||
|
||||
/datum/controller/subsystem/air/proc/process_react_queue(resumed = 0)
|
||||
if(!resumed)
|
||||
src.currentrun = turf_react_queue.Copy()
|
||||
var/list/currentrun = src.currentrun
|
||||
while(currentrun.len)
|
||||
var/turf/open/T = currentrun[currentrun.len]
|
||||
currentrun.len--
|
||||
if(T)
|
||||
T.process_cell_reaction()
|
||||
if(MC_TICK_CHECK)
|
||||
return
|
||||
|
||||
|
||||
/datum/controller/subsystem/air/proc/process_super_conductivity(resumed = 0)
|
||||
if (!resumed)
|
||||
src.currentrun = active_super_conductivity.Copy()
|
||||
@@ -227,10 +226,45 @@ SUBSYSTEM_DEF(air)
|
||||
high_pressure_delta.len--
|
||||
T.high_pressure_movements()
|
||||
T.pressure_difference = 0
|
||||
T.pressure_specific_target = null
|
||||
if(MC_TICK_CHECK)
|
||||
return
|
||||
|
||||
/datum/controller/subsystem/air/proc/process_turf_equalize(resumed = 0)
|
||||
//cache for sanic speed
|
||||
var/fire_count = times_fired
|
||||
if (!resumed)
|
||||
src.currentrun = active_turfs.Copy()
|
||||
//cache for sanic speed (lists are references anyways)
|
||||
var/list/currentrun = src.currentrun
|
||||
while(currentrun.len)
|
||||
var/turf/open/T = currentrun[currentrun.len]
|
||||
currentrun.len--
|
||||
if (T)
|
||||
T.equalize_pressure_in_zone(fire_count)
|
||||
//equalize_pressure_in_zone(T, fire_count)
|
||||
if (MC_TICK_CHECK)
|
||||
return
|
||||
|
||||
/datum/controller/subsystem/air/proc/process_active_turfs(resumed = 0)
|
||||
//cache for sanic speed
|
||||
var/fire_count = times_fired
|
||||
if (!resumed)
|
||||
src.currentrun = active_turfs.Copy()
|
||||
//cache for sanic speed (lists are references anyways)
|
||||
var/list/currentrun = src.currentrun
|
||||
while(currentrun.len)
|
||||
var/turf/open/T = currentrun[currentrun.len]
|
||||
currentrun.len--
|
||||
if (T)
|
||||
T.process_cell(fire_count)
|
||||
if (MC_TICK_CHECK)
|
||||
return
|
||||
|
||||
/datum/controller/subsystem/air/proc/process_excited_groups(resumed = 0)
|
||||
if(process_excited_groups_extools(resumed, (Master.current_ticklimit - TICK_USAGE) * 0.01 * world.tick_lag))
|
||||
sleep()
|
||||
/*
|
||||
if (!resumed)
|
||||
src.currentrun = excited_groups.Copy()
|
||||
//cache for sanic speed (lists are references anyways)
|
||||
@@ -246,29 +280,33 @@ SUBSYSTEM_DEF(air)
|
||||
EG.dismantle()
|
||||
if (MC_TICK_CHECK)
|
||||
return
|
||||
*/
|
||||
|
||||
/datum/controller/subsystem/air/proc/process_excited_groups_extools()
|
||||
/datum/controller/subsystem/air/proc/get_amt_excited_groups()
|
||||
|
||||
/datum/controller/subsystem/air/proc/remove_from_active(turf/open/T)
|
||||
active_turfs -= T
|
||||
SSair_turfs.currentrun -= T
|
||||
if(currentpart == SSAIR_ACTIVETURFS)
|
||||
currentrun -= T
|
||||
#ifdef VISUALIZE_ACTIVE_TURFS
|
||||
T.remove_atom_colour(TEMPORARY_COLOUR_PRIORITY, "#00ff00")
|
||||
#endif
|
||||
if(istype(T))
|
||||
T.excited = 0
|
||||
if(T.excited_group)
|
||||
T.excited_group.garbage_collect()
|
||||
remove_from_react_queue(T)
|
||||
T.set_excited(FALSE)
|
||||
T.eg_garbage_collect()
|
||||
|
||||
/datum/controller/subsystem/air/proc/add_to_active(turf/open/T, blockchanges = 1)
|
||||
if(istype(T) && T.air)
|
||||
#ifdef VISUALIZE_ACTIVE_TURFS
|
||||
T.add_atom_colour("#00ff00", TEMPORARY_COLOUR_PRIORITY)
|
||||
#endif
|
||||
T.excited = TRUE
|
||||
active_turfs[T] = SSair_turfs.currentrun[T] = TRUE
|
||||
if(blockchanges && T.excited_group)
|
||||
T.excited_group.garbage_collect()
|
||||
add_to_react_queue(T)
|
||||
T.set_excited(TRUE)
|
||||
active_turfs |= T
|
||||
if(currentpart == SSAIR_ACTIVETURFS)
|
||||
currentrun |= T
|
||||
if(blockchanges)
|
||||
T.eg_garbage_collect()
|
||||
else if(T.flags_1 & INITIALIZED_1)
|
||||
for(var/turf/S in T.atmos_adjacent_turfs)
|
||||
add_to_active(S)
|
||||
@@ -279,17 +317,6 @@ SUBSYSTEM_DEF(air)
|
||||
else
|
||||
T.requires_activation = TRUE
|
||||
|
||||
/datum/controller/subsystem/air/proc/add_to_react_queue(turf/open/T)
|
||||
if(istype(T) && T.air)
|
||||
turf_react_queue[T] = TRUE
|
||||
if(currentpart == SSAIR_REACTQUEUE)
|
||||
currentrun[T] = TRUE
|
||||
|
||||
/datum/controller/subsystem/air/proc/remove_from_react_queue(turf/open/T)
|
||||
turf_react_queue -= T
|
||||
if(currentpart == SSAIR_REACTQUEUE)
|
||||
currentrun -= T
|
||||
|
||||
/datum/controller/subsystem/air/StartLoadingMap()
|
||||
LAZYINITLIST(queued_for_activation)
|
||||
map_loading = TRUE
|
||||
@@ -337,11 +364,11 @@ SUBSYSTEM_DEF(air)
|
||||
|
||||
while (turfs_to_check.len)
|
||||
var/ending_ats = active_turfs.len
|
||||
for(var/thing in excited_groups)
|
||||
/*for(var/thing in excited_groups)
|
||||
var/datum/excited_group/EG = thing
|
||||
EG.self_breakdown(space_is_all_consuming = 1)
|
||||
EG.dismantle()
|
||||
CHECK_TICK
|
||||
//EG.self_breakdown(space_is_all_consuming = 1)
|
||||
//EG.dismantle()
|
||||
CHECK_TICK*/
|
||||
|
||||
var/msg = "HEY! LISTEN! [DisplayTimeText(world.timeofday - timer)] were wasted processing [starting_ats] turf(s) (connected to [ending_ats] other turfs) with atmos differences at round start."
|
||||
to_chat(world, "<span class='boldannounce'>[msg]</span>")
|
||||
@@ -349,6 +376,7 @@ SUBSYSTEM_DEF(air)
|
||||
|
||||
/turf/open/proc/resolve_active_graph()
|
||||
. = list()
|
||||
/*
|
||||
var/datum/excited_group/EG = excited_group
|
||||
if (blocks_air || !air)
|
||||
return
|
||||
@@ -369,7 +397,8 @@ SUBSYSTEM_DEF(air)
|
||||
EG.add_turf(ET)
|
||||
if (!ET.excited)
|
||||
ET.excited = 1
|
||||
. += ET
|
||||
. += ET*/
|
||||
|
||||
/turf/open/space/resolve_active_graph()
|
||||
return list()
|
||||
|
||||
@@ -387,9 +416,8 @@ SUBSYSTEM_DEF(air)
|
||||
CHECK_TICK
|
||||
|
||||
/datum/controller/subsystem/air/proc/setup_template_machinery(list/atmos_machines)
|
||||
if(!initialized)
|
||||
return
|
||||
|
||||
if(!initialized) // yogs - fixes randomized bars
|
||||
return // yogs
|
||||
for(var/A in atmos_machines)
|
||||
var/obj/machinery/atmospherics/AM = A
|
||||
AM.atmosinit()
|
||||
@@ -413,6 +441,7 @@ SUBSYSTEM_DEF(air)
|
||||
|
||||
#undef SSAIR_PIPENETS
|
||||
#undef SSAIR_ATMOSMACHINERY
|
||||
#undef SSAIR_ACTIVETURFS
|
||||
#undef SSAIR_EXCITEDGROUPS
|
||||
#undef SSAIR_HIGHPRESSURE
|
||||
#undef SSAIR_HOTSPOTS
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//WHAT IF WE TAKE THE ACTIVE TURF PROCESSING AND PUSH IT SOMEWHERE ELSE!!!
|
||||
|
||||
/*
|
||||
SUBSYSTEM_DEF(air_turfs)
|
||||
name = "Atmospherics - Turfs"
|
||||
init_order = INIT_ORDER_AIR_TURFS
|
||||
@@ -24,3 +24,4 @@ SUBSYSTEM_DEF(air_turfs)
|
||||
return
|
||||
resumed = 0
|
||||
return
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user