yahar should fix being sucked or blown away from a zone you're nowhere near anymore.

This commit is contained in:
D3athrow
2015-03-09 22:48:26 -05:00
parent 0f9fd315b8
commit 4fad74d811
2 changed files with 81 additions and 68 deletions

View File

@@ -117,7 +117,7 @@ obj/item/check_airflow_movable(n)
//Zones A and B are air zones. n represents the amount of air moved.
proc/Airflow(zone/A, zone/B)
set background = 1
var/n = B.air.return_pressure() - A.air.return_pressure()
//Don't go any further if n is lower than the lowest value needed for airflow.
@@ -139,95 +139,95 @@ proc/Airflow(zone/A, zone/B)
connected_turfs |= C.B
//Get lists of things that can be thrown across the room for each zone (assumes air is moving from zone B to zone A)
var/list/air_sucked = B.movables()
var/list/air_repelled = A.movables()
if(n < 0)
//air is moving from zone A to zone B
var/list/temporary_pplz = air_sucked
air_sucked = air_repelled
air_repelled = temporary_pplz
spawn()
var/list/air_sucked = B.movables()
var/list/air_repelled = A.movables()
if(n < 0)
//air is moving from zone A to zone B
var/list/temporary_pplz = air_sucked
air_sucked = air_repelled
air_repelled = temporary_pplz
if(zas_settings.Get(/datum/ZAS_Setting/airflow_push) || 1) // If enabled
for(var/atom/movable/M in air_sucked)
if(M.last_airflow > world.time - zas_settings.Get(/datum/ZAS_Setting/airflow_delay)) continue
if(zas_settings.Get(/datum/ZAS_Setting/airflow_push) || 1) // If enabled
for(var/atom/movable/M in air_sucked)
if(M.last_airflow > world.time - zas_settings.Get(/datum/ZAS_Setting/airflow_delay)) continue
//Check for knocking people over
if(ismob(M) && n > zas_settings.Get(/datum/ZAS_Setting/airflow_stun_pressure))
if(M:status_flags & GODMODE) continue
M:airflow_stun()
//Check for knocking people over
if(ismob(M) && n > zas_settings.Get(/datum/ZAS_Setting/airflow_stun_pressure))
if(M:status_flags & GODMODE) continue
M:airflow_stun()
if(M.check_airflow_movable(n))
if(M.check_airflow_movable(n))
//Check for things that are in range of the midpoint turfs.
var/list/close_turfs = list()
for(var/turf/U in connected_turfs)
if(M in range(U)) close_turfs += U
if(!close_turfs.len) continue
//Check for things that are in range of the midpoint turfs.
var/list/close_turfs = list()
for(var/turf/U in connected_turfs)
if(M in range(U)) close_turfs += U
if(!close_turfs.len) continue
//If they're already being tossed, don't do it again.
if(!M.airflow_speed)
//If they're already being tossed, don't do it again.
if(!M.airflow_speed)
M.airflow_dest = pick(close_turfs) //Pick a random midpoint to fly towards.
M.airflow_dest = pick(close_turfs) //Pick a random midpoint to fly towards.
spawn M.GotoAirflowDest(abs(n)/5)
M.GotoAirflowDest(abs(n)/5)
//Do it again for the stuff in the other zone, making it fly away.
for(var/atom/movable/M in air_repelled)
//Do it again for the stuff in the other zone, making it fly away.
for(var/atom/movable/M in air_repelled)
if(M.last_airflow > world.time - zas_settings.Get(/datum/ZAS_Setting/airflow_delay)) continue
if(M.last_airflow > world.time - zas_settings.Get(/datum/ZAS_Setting/airflow_delay)) continue
if(ismob(M) && abs(n) > zas_settings.Get(/datum/ZAS_Setting/airflow_medium_pressure))
if(M:status_flags & GODMODE) continue
M:airflow_stun()
if(ismob(M) && abs(n) > zas_settings.Get(/datum/ZAS_Setting/airflow_medium_pressure))
if(M:status_flags & GODMODE) continue
M:airflow_stun()
if(M.check_airflow_movable(abs(n)))
if(M.check_airflow_movable(abs(n)))
var/list/close_turfs = list()
for(var/turf/U in connected_turfs)
if(M in range(U)) close_turfs += U
if(!close_turfs.len) continue
var/list/close_turfs = list()
for(var/turf/U in connected_turfs)
if(M in range(U)) close_turfs += U
if(!close_turfs.len) continue
//If they're already being tossed, don't do it again.
if(!M.airflow_speed)
//If they're already being tossed, don't do it again.
if(!M.airflow_speed)
M.airflow_dest = pick(close_turfs) //Pick a random midpoint to fly towards.
M.airflow_dest = pick(close_turfs) //Pick a random midpoint to fly towards.
spawn M.RepelAirflowDest(abs(n)/5)
spawn M.RepelAirflowDest(abs(n)/5)
proc/AirflowSpace(zone/A)
spawn()
//The space version of the Airflow(A,B,n) proc.
//The space version of the Airflow(A,B,n) proc.
var/n = A.air.return_pressure()
//Here, n is determined by only the pressure in the room.
var/n = A.air.return_pressure()
//Here, n is determined by only the pressure in the room.
if(n < zas_settings.Get(/datum/ZAS_Setting/airflow_lightest_pressure)) return
if(n < zas_settings.Get(/datum/ZAS_Setting/airflow_lightest_pressure)) return
var/list/connected_turfs = A.unsimulated_tiles //The midpoints are now all the space connections.
var/list/pplz = A.movables() //We only need to worry about things in the zone, not things in space.
var/list/connected_turfs = A.unsimulated_tiles //The midpoints are now all the space connections.
var/list/pplz = A.movables() //We only need to worry about things in the zone, not things in space.
if(zas_settings.Get(/datum/ZAS_Setting/airflow_push) || 1) // If enabled
for(var/atom/movable/M in pplz)
if(M.last_airflow > world.time - zas_settings.Get(/datum/ZAS_Setting/airflow_delay)) continue
if(zas_settings.Get(/datum/ZAS_Setting/airflow_push) || 1) // If enabled
for(var/atom/movable/M in pplz)
if(M.last_airflow > world.time - zas_settings.Get(/datum/ZAS_Setting/airflow_delay)) continue
if(ismob(M) && n > zas_settings.Get(/datum/ZAS_Setting/airflow_stun_pressure))
var/mob/O = M
if(O.status_flags & GODMODE) continue
O.airflow_stun()
if(ismob(M) && n > zas_settings.Get(/datum/ZAS_Setting/airflow_stun_pressure))
var/mob/O = M
if(O.status_flags & GODMODE) continue
O.airflow_stun()
if(M.check_airflow_movable(n))
if(M.check_airflow_movable(n))
var/list/close_turfs = list()
for(var/turf/U in connected_turfs)
if(M in range(U)) close_turfs += U
if(!close_turfs.len) continue
var/list/close_turfs = list()
for(var/turf/U in connected_turfs)
if(M in range(U)) close_turfs += U
if(!close_turfs.len) continue
//If they're already being tossed, don't do it again.
if(!M.airflow_speed)
//If they're already being tossed, don't do it again.
if(!M.airflow_speed)
M.airflow_dest = pick(close_turfs) //Pick a random midpoint to fly towards.
spawn
if(M) M.GotoAirflowDest(n/10)
M.airflow_dest = pick(close_turfs) //Pick a random midpoint to fly towards.
M.GotoAirflowDest(n/10)
//Sometimes shit breaks, and M isn't there after the spawn.
*/