mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-29 16:18:01 +01:00
Some changes to Linda, self_compare() removed and added N2O to the air group merge.
Once the air group gets to the 20 ticks with no big changes, it will dismantle itself with no compares. At the 10 ticks the group will still merge itself.
This commit is contained in:
@@ -110,19 +110,12 @@ datum/controller/air_system
|
||||
|
||||
/datum/controller/air_system/proc/process_excited_groups()
|
||||
for(var/datum/excited_group/EG in excited_groups)
|
||||
if(EG.breakdown)
|
||||
EG.breakdown_cooldown ++
|
||||
else
|
||||
EG.breakdown_cooldown = 0
|
||||
|
||||
if(EG.breakdown_cooldown > 10)
|
||||
if(EG.self_compare())
|
||||
EG.dismantle()
|
||||
EG.breakdown_cooldown ++
|
||||
if(EG.breakdown_cooldown == 10)
|
||||
if(!EG.self_compare())
|
||||
EG.reset_cooldowns()
|
||||
EG.self_breakdown()
|
||||
EG.breakdown = 1
|
||||
return
|
||||
if(EG.breakdown_cooldown > 20)
|
||||
EG.dismantle()
|
||||
|
||||
/turf/proc/CanAtmosPass(var/turf/T)
|
||||
if(!istype(T)) return 0
|
||||
|
||||
@@ -261,7 +261,7 @@ turf/simulated/proc/share_temperature_mutual_solid(turf/simulated/sharer, conduc
|
||||
|
||||
/turf/simulated/proc/last_share_check()
|
||||
if(air.last_share > MINIMUM_AIR_TO_SUSPEND)
|
||||
excited_group.breakdown = 0
|
||||
excited_group.reset_cooldowns()
|
||||
|
||||
/turf/proc/high_pressure_movements()
|
||||
for(var/atom/movable/M in src)
|
||||
@@ -317,36 +317,46 @@ atom/movable/proc/experience_pressure_difference(pressure_difference, direction)
|
||||
/datum/excited_group/proc/reset_cooldowns()
|
||||
breakdown_cooldown = 0
|
||||
|
||||
/datum/excited_group/proc/self_compare()
|
||||
var/restore = 1
|
||||
var/turf/simulated/sample = pick(turf_list)
|
||||
for(var/turf/simulated/T in turf_list)
|
||||
if(!T.air.compare(sample.air))
|
||||
restore = 0
|
||||
break
|
||||
if(restore)
|
||||
return 1
|
||||
|
||||
/datum/excited_group/proc/self_breakdown()
|
||||
var/datum/gas_mixture/A = new
|
||||
var/datum/gas/sleeping_agent/S = new
|
||||
A.trace_gases += S
|
||||
for(var/turf/simulated/T in turf_list)
|
||||
A.oxygen += T.air.oxygen
|
||||
A.carbon_dioxide+= T.air.carbon_dioxide
|
||||
A.nitrogen += T.air.nitrogen
|
||||
A.toxins += T.air.toxins
|
||||
|
||||
if(T.air.trace_gases.len)
|
||||
for(var/datum/gas/N in T.air.trace_gases)
|
||||
S.moles += N.moles
|
||||
|
||||
for(var/turf/simulated/T in turf_list)
|
||||
T.air.oxygen = A.oxygen/turf_list.len
|
||||
T.air.carbon_dioxide= A.carbon_dioxide/turf_list.len
|
||||
T.air.nitrogen = A.nitrogen/turf_list.len
|
||||
T.air.toxins = A.toxins/turf_list.len
|
||||
|
||||
if(S.moles > 0)
|
||||
if(T.air.trace_gases.len)
|
||||
for(var/datum/gas/G in T.air.trace_gases)
|
||||
G.moles = S.moles/turf_list.len
|
||||
else
|
||||
var/datum/gas/sleeping_agent/G = new
|
||||
G.moles = S.moles/turf_list.len
|
||||
T.air.trace_gases += G
|
||||
|
||||
if(T.air.check_tile_graphic())
|
||||
T.update_visuals(T.air)
|
||||
|
||||
|
||||
/datum/excited_group/proc/dismantle()
|
||||
for(var/turf/simulated/T in turf_list)
|
||||
T.excited = 0
|
||||
T.recently_active = 0
|
||||
T.excited_group = null
|
||||
air_master.active_turfs -= T
|
||||
air_master.excited_groups -= src
|
||||
garbage_collect()
|
||||
|
||||
/datum/excited_group/proc/garbage_collect()
|
||||
for(var/turf/simulated/T in turf_list)
|
||||
|
||||
Reference in New Issue
Block a user