Air alarm fixes, final part. Added in area atmos lockdown, proper overrides from the atmos control computer, cycling airlocks, and minor airflow/ZAS tweaks.

This commit is contained in:
SkyMarshal
2012-06-21 02:06:05 -07:00
parent c2163b1f20
commit 5ea83f0abe
17 changed files with 9083 additions and 8874 deletions
+19 -8
View File
@@ -58,12 +58,12 @@ vs_control/var
airflow_medium_pressure = 90
airflow_medium_pressure_NAME = "Airflow - Heavy Movement Threshold %"
airflow_medium_pressure_DESC = "Percent of 1 Atm. at which items with the largest weight classes will move."
airflow_heavy_pressure = 90
airflow_heavy_pressure = 95
airflow_heavy_pressure_NAME = "Airflow - Dense Movement Threshold %"
airflow_heavy_pressure_DESC = "Percent of 1 Atm. at which items with canisters and closets will move."
airflow_heaviest_pressure = 95
airflow_heaviest_pressure_NAME = "Airflow - Human Movement Threshold % (Mob Stunning)"
airflow_heaviest_pressure_DESC = "Percent of 1 Atm. at which mobs will be shifted by airflow. (Mob Stunning)"
airflow_heaviest_pressure = 100
airflow_heaviest_pressure_NAME = "Airflow - Mob Stunning Threshold %"
airflow_heaviest_pressure_DESC = "Percent of 1 Atm. at which mobs will be stunned by airflow."
airflow_stun_cooldown = 60
airflow_stun_cooldown_NAME = "Aiflow Stunning - Cooldown"
airflow_stun_cooldown_DESC = "How long, in tenths of a second, to wait before stunning them again."
@@ -85,6 +85,8 @@ vs_control/var
mob/var/last_airflow_stun = 0
mob/proc/airflow_stun()
if(stat == 2)
return 0
if(last_airflow_stun > world.time - vsc.airflow_stun_cooldown) return 0
if(weakened <= 0) src << "\red The sudden rush of air knocks you over!"
weakened = max(weakened,5)
@@ -244,7 +246,7 @@ proc/AirflowSpace(zone/A)
M.airflow_dest = pick(close_turfs) //Pick a random midpoint to fly towards.
spawn
if(M) M.GotoAirflowDest(n/20)
if(M) M.GotoAirflowDest(n/10)
//Sometimes shit breaks, and M isn't there after the spawn.
atom/movable
@@ -273,7 +275,11 @@ atom/movable
if(src:shoes)
if(src:shoes.type == /obj/item/clothing/shoes/magboots && src:shoes.flags & NOSLIP) return
src << "\red You are sucked away by airflow!"
airflow_speed = min(round(n)/max(get_dist(src,airflow_dest)/2,1),9)
var/airflow_falloff = 9 - ul_FalloffAmount(airflow_dest) //It's a fast falloff calc. Very useful.
if(airflow_falloff < 1)
airflow_dest = null
return
airflow_speed = min(max(n * (9/airflow_falloff),1),9)
var
xo = airflow_dest.x - src.x
yo = airflow_dest.y - src.y
@@ -323,7 +329,11 @@ atom/movable
if(src:shoes)
if(src:shoes.type == /obj/item/clothing/shoes/magboots && src:shoes.flags & NOSLIP) return
src << "\red You are pushed away by airflow!"
airflow_speed = min(round(n)/max(get_dist(src,airflow_dest)/2,1),9)
var/airflow_falloff = 9 - ul_FalloffAmount(airflow_dest) //It's a fast falloff calc. Very useful.
if(airflow_falloff < 1)
airflow_dest = null
return
airflow_speed = min(max(n * (9/airflow_falloff),1),9)
var
xo = -(airflow_dest.x - src.x)
yo = -(airflow_dest.y - src.y)
@@ -413,5 +423,6 @@ zone/proc/movables()
. = list()
for(var/turf/T in contents)
for(var/atom/A in T)
if(istype(A, /mob/aiEye)) continue
if(istype(A, /mob/aiEye) || istype(A, /obj/effect))
continue
. += A
+8 -14
View File
@@ -1,6 +1,8 @@
#define QUANTIZE(variable) (round(variable,0.0001))
var/explosion_halt = 0
var/zone_share_percent = 3.5
vs_control/var/zone_share_percent = 10
vs_control/var/zone_share_percent_NAME = "Zone Share Percent"
vs_control/var/zone_share_percent_DESC = "Percentage of air difference to move per tick"
zone/proc/process()
//Deletes zone if empty.
if(!contents.len)
@@ -93,20 +95,10 @@ zone/proc/process()
//If there is space, air should flow out of the zone.
if(abs(air.return_pressure()) > vsc.airflow_lightest_pressure)
AirflowSpace(src)
ShareSpace(air,total_space*(zone_share_percent/100))
/* if(!(last_update%20)) //every 20 processes.
if(connections)
connections.Remove(null)
if(!connections.len)
del connections
if(connected_zones)
connected_zones.Remove(null)
if(!connected_zones.len)
del connected_zones*/
ShareSpace(air,total_space*(vsc.zone_share_percent/100))
//React the air here.
//air.react(null,0)
air.react(null,0)
//Check the graphic.
@@ -160,7 +152,9 @@ zone/proc/process()
if(abs(air.total_moles - Z.air.total_moles) > 0.1 || abs(air.temperature - Z.air.temperature) > 0.1)
if(abs(Z.air.return_pressure() - air.return_pressure()) > vsc.airflow_lightest_pressure)
Airflow(src,Z)
ShareRatio(air,Z.air,connected_zones[Z]*(zone_share_percent/100))
ShareRatio( air , Z.air , max(connected_zones[Z]*(vsc.zone_share_percent/200)*(space_tiles || Z.space_tiles ? 2 : 1) , 1) )
//Divided by 200 since each zone is processed. Each connection is considered twice
//Space tiles force it to try and move twice as much air.
proc/ShareRatio(datum/gas_mixture/A, datum/gas_mixture/B, ratio)
//Shares a specific ratio of gas between mixtures using simple weighted averages.