From ea5ec6aec2d54e662f69bf3b332c98b5a89102f2 Mon Sep 17 00:00:00 2001 From: Aranclanos Date: Mon, 3 Mar 2014 01:29:42 -0300 Subject: [PATCH] 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. --- code/LINDA/LINDA_system.dm | 15 ++++----------- code/LINDA/LINDA_turf_tile.dm | 34 ++++++++++++++++++++++------------ 2 files changed, 26 insertions(+), 23 deletions(-) diff --git a/code/LINDA/LINDA_system.dm b/code/LINDA/LINDA_system.dm index 34498dc58cf..3a67701487f 100644 --- a/code/LINDA/LINDA_system.dm +++ b/code/LINDA/LINDA_system.dm @@ -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 diff --git a/code/LINDA/LINDA_turf_tile.dm b/code/LINDA/LINDA_turf_tile.dm index c5a57c9e577..ac1956fe21c 100644 --- a/code/LINDA/LINDA_turf_tile.dm +++ b/code/LINDA/LINDA_turf_tile.dm @@ -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)