mirror of
https://github.com/yogstation13/Yogstation.git
synced 2025-02-26 09:04:50 +00:00
Merge pull request #5241 from yogstation13/upstream-merge-43447
[MIRROR] Atmos adjacency subsystem revival
This commit is contained in:
@@ -285,6 +285,12 @@
|
||||
for(var/total_moles_id in cached_gases){\
|
||||
out_var += cached_gases[total_moles_id][MOLES];\
|
||||
}
|
||||
#ifdef TESTING
|
||||
GLOBAL_LIST_INIT(atmos_adjacent_savings, list(0,0))
|
||||
#define CALCULATE_ADJACENT_TURFS(T) if (SSadjacent_air.queue[T]) { GLOB.atmos_adjacent_savings[1] += 1 } else { GLOB.atmos_adjacent_savings[2] += 1; SSadjacent_air.queue[T] = 1 }
|
||||
#else
|
||||
#define CALCULATE_ADJACENT_TURFS(T) SSadjacent_air.queue[T] = 1
|
||||
#endif
|
||||
|
||||
GLOBAL_LIST_INIT(pipe_paint_colors, list(
|
||||
"amethyst" = rgb(130,43,255), //supplymain
|
||||
|
||||
@@ -25,10 +25,6 @@
|
||||
|
||||
#define TIMER_ID_NULL -1
|
||||
|
||||
//For servers that can't do with any additional lag, set this to none in flightpacks.dm in subsystem/processing.
|
||||
#define FLIGHTSUIT_PROCESSING_NONE 0
|
||||
#define FLIGHTSUIT_PROCESSING_FULL 1
|
||||
|
||||
#define INITIALIZATION_INSSATOMS 0 //New should not call Initialize
|
||||
#define INITIALIZATION_INNEW_MAPLOAD 2 //New should call Initialize(TRUE)
|
||||
#define INITIALIZATION_INNEW_REGULAR 1 //New should call Initialize(FALSE)
|
||||
@@ -107,10 +103,10 @@
|
||||
#define FIRE_PRIOTITY_BURNING 40
|
||||
#define FIRE_PRIORITY_DEFAULT 50
|
||||
#define FIRE_PRIORITY_PARALLAX 65
|
||||
#define FIRE_PRIORITY_FLIGHTPACKS 80
|
||||
#define FIRE_PRIORITY_MOBS 100
|
||||
#define FIRE_PRIORITY_TGUI 110
|
||||
#define FIRE_PRIORITY_TICKER 200
|
||||
#define FIRE_PRIORITY_ATMOS_ADJACENCY 300
|
||||
#define FIRE_PRIORITY_OVERLAYS 500
|
||||
#define FIRE_PRIORITY_INPUT 1000 // This must always always be the max highest priority. Player input must never be lost.
|
||||
|
||||
|
||||
@@ -3,3 +3,4 @@
|
||||
#define CHANGETURF_FORCEOP 4
|
||||
#define CHANGETURF_SKIP 8 // A flag for PlaceOnTop to just instance the new turf instead of calling ChangeTurf. Used for uninitialized turfs NOTHING ELSE
|
||||
#define CHANGETURF_INHERIT_AIR 16 // Inherit air from previous turf. Implies CHANGETURF_IGNORE_AIR
|
||||
#define CHANGETURF_RECALC_ADJACENT 32 //Immediately recalc adjacent atmos turfs instead of queuing.
|
||||
|
||||
35
code/controllers/subsystem/adjacent_air.dm
Normal file
35
code/controllers/subsystem/adjacent_air.dm
Normal file
@@ -0,0 +1,35 @@
|
||||
SUBSYSTEM_DEF(adjacent_air)
|
||||
name = "Atmos Adjacency"
|
||||
flags = SS_BACKGROUND
|
||||
runlevels = RUNLEVEL_GAME | RUNLEVEL_POSTGAME
|
||||
wait = 10
|
||||
priority = FIRE_PRIORITY_ATMOS_ADJACENCY
|
||||
var/list/queue = list()
|
||||
|
||||
/datum/controller/subsystem/adjacent_air/stat_entry()
|
||||
#ifdef TESTING
|
||||
..("P:[length(queue)], S:[GLOB.atmos_adjacent_savings[1]], T:[GLOB.atmos_adjacent_savings[2]]")
|
||||
#else
|
||||
..("P:[length(queue)]")
|
||||
#endif
|
||||
|
||||
/datum/controller/subsystem/adjacent_air/Initialize()
|
||||
while(length(queue))
|
||||
fire(mc_check = FALSE)
|
||||
return ..()
|
||||
|
||||
/datum/controller/subsystem/adjacent_air/fire(resumed = FALSE, mc_check = TRUE)
|
||||
|
||||
var/list/queue = src.queue
|
||||
|
||||
while (length(queue))
|
||||
var/turf/currT = queue[1]
|
||||
queue.Cut(1,2)
|
||||
|
||||
currT.ImmediateCalculateAdjacentTurfs()
|
||||
|
||||
if(mc_check)
|
||||
if(MC_TICK_CHECK)
|
||||
break
|
||||
else
|
||||
CHECK_TICK
|
||||
@@ -335,7 +335,7 @@
|
||||
T.visible_message("<span class='danger'>[T] smacks into [src] and rapidly flashes to ash.</span>",\
|
||||
"<span class='italics'>You hear a loud crack as you are washed with a wave of heat.</span>")
|
||||
shard.Consume()
|
||||
T.CalculateAdjacentTurfs()
|
||||
CALCULATE_ADJACENT_TURFS(T)
|
||||
|
||||
/obj/item/melee/supermatter_sword/add_blood_DNA(list/blood_dna)
|
||||
return FALSE
|
||||
|
||||
@@ -16,7 +16,7 @@ GLOBAL_LIST_INIT(blacklisted_automated_baseturfs, typecacheof(list(
|
||||
if(turf_type)
|
||||
var/turf/newT = ChangeTurf(turf_type, baseturf_type, flags)
|
||||
SSair.remove_from_active(newT)
|
||||
newT.CalculateAdjacentTurfs()
|
||||
CALCULATE_ADJACENT_TURFS(newT)
|
||||
SSair.add_to_active(newT,1)
|
||||
|
||||
/turf/proc/copyTurf(turf/T)
|
||||
@@ -150,6 +150,8 @@ GLOBAL_LIST_INIT(blacklisted_automated_baseturfs, typecacheof(list(
|
||||
newTurf.air = stashed_air
|
||||
SSair.add_to_active(newTurf)
|
||||
else
|
||||
if(ispath(path,/turf/closed))
|
||||
flags |= CHANGETURF_RECALC_ADJACENT
|
||||
return ..()
|
||||
|
||||
// Take off the top layer turf and replace it with the next baseturf down
|
||||
@@ -273,7 +275,10 @@ GLOBAL_LIST_INIT(blacklisted_automated_baseturfs, typecacheof(list(
|
||||
//If you modify this function, ensure it works correctly with lateloaded map templates.
|
||||
/turf/proc/AfterChange(flags) //called after a turf has been replaced in ChangeTurf()
|
||||
levelupdate()
|
||||
CalculateAdjacentTurfs()
|
||||
if(flags & CHANGETURF_RECALC_ADJACENT)
|
||||
ImmediateCalculateAdjacentTurfs()
|
||||
else
|
||||
CALCULATE_ADJACENT_TURFS(src)
|
||||
|
||||
//update firedoor adjacency
|
||||
var/list/turfs_to_check = get_adjacent_open_turfs(src) | src
|
||||
|
||||
@@ -173,7 +173,7 @@
|
||||
update_visuals()
|
||||
|
||||
current_cycle = times_fired
|
||||
CalculateAdjacentTurfs()
|
||||
ImmediateCalculateAdjacentTurfs()
|
||||
for(var/i in atmos_adjacent_turfs)
|
||||
var/turf/open/enemy_tile = i
|
||||
var/datum/gas_mixture/enemy_air = enemy_tile.return_air()
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
add_overlay(/obj/effect/fullbright)
|
||||
|
||||
if(requires_activation)
|
||||
CalculateAdjacentTurfs()
|
||||
CALCULATE_ADJACENT_TURFS(src)
|
||||
SSair.add_to_active(src)
|
||||
|
||||
if (light_power && light_range)
|
||||
@@ -85,7 +85,7 @@
|
||||
return INITIALIZE_HINT_NORMAL
|
||||
|
||||
/turf/proc/Initalize_Atmos(times_fired)
|
||||
CalculateAdjacentTurfs()
|
||||
CALCULATE_ADJACENT_TURFS(src)
|
||||
|
||||
/turf/Destroy(force)
|
||||
. = QDEL_HINT_IWILLGC
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
/atom/movable/proc/BlockSuperconductivity() // objects that block air and don't let superconductivity act. Only firelocks atm.
|
||||
return FALSE
|
||||
|
||||
/turf/proc/CalculateAdjacentTurfs()
|
||||
/turf/proc/ImmediateCalculateAdjacentTurfs()
|
||||
var/canpass = CANATMOSPASS(src, src)
|
||||
var/canvpass = CANVERTICALATMOSPASS(src, src)
|
||||
for(var/direction in GLOB.cardinals_multiz)
|
||||
@@ -107,7 +107,7 @@
|
||||
|
||||
/turf/air_update_turf(command = 0)
|
||||
if(command)
|
||||
CalculateAdjacentTurfs()
|
||||
ImmediateCalculateAdjacentTurfs()
|
||||
SSair.add_to_active(src,command)
|
||||
|
||||
/atom/movable/proc/move_update_air(turf/T)
|
||||
|
||||
@@ -130,7 +130,7 @@ GLOBAL_LIST_INIT(duplicate_forbidden_vars,list(
|
||||
|
||||
if(toupdate.len)
|
||||
for(var/turf/T1 in toupdate)
|
||||
T1.CalculateAdjacentTurfs()
|
||||
CALCULATE_ADJACENT_TURFS(T1)
|
||||
SSair.add_to_active(T1,1)
|
||||
|
||||
|
||||
|
||||
@@ -217,6 +217,7 @@
|
||||
#include "code\controllers\configuration\entries\game_options.dm"
|
||||
#include "code\controllers\configuration\entries\general.dm"
|
||||
#include "code\controllers\subsystem\acid.dm"
|
||||
#include "code\controllers\subsystem\adjacent_air.dm"
|
||||
#include "code\controllers\subsystem\air.dm"
|
||||
#include "code\controllers\subsystem\assets.dm"
|
||||
#include "code\controllers\subsystem\atoms.dm"
|
||||
|
||||
Reference in New Issue
Block a user