mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-23 03:57:13 +01:00
Debugged ZAS. Removed another duplicate proc. Made sure turf changes are added to the air_master to be updated. Fixed errors on the map causing problems. Added different sized packages. Airflow readded.
This commit is contained in:
@@ -1220,6 +1220,7 @@
|
||||
#include "code\WorkInProgress\virus2\monkeydispensor.dm"
|
||||
#include "code\WorkInProgress\virus2\Prob.dm"
|
||||
#include "code\WorkInProgress\Wrongnumber\weldbackpack.dm"
|
||||
#include "code\ZAS\Airflow.dm"
|
||||
#include "code\ZAS\Connection.dm"
|
||||
#include "code\ZAS\Creation.dm"
|
||||
#include "code\ZAS\Definition.dm"
|
||||
|
||||
+37
-39
@@ -59,6 +59,9 @@ vs_control/var
|
||||
airflow_damage = 0.3
|
||||
airflow_stun = 0.15
|
||||
airflow_speed_decay = 1
|
||||
airflow_delay = 25 //Time in deciseconds before they can be moved by airflow again.
|
||||
airflow_mob_slowdown = 3 //Time in tenths of a second to add as a delay to each movement by a mob.\
|
||||
Only active if they are fighting the pull of the airflow.
|
||||
|
||||
mob/proc/airflow_stun()
|
||||
if(weakened <= 0) src << "\red The sudden rush of air knocks you over!"
|
||||
@@ -77,7 +80,7 @@ mob/living/carbon/human/airflow_stun()
|
||||
if(shoes)
|
||||
if(shoes.flags & NOSLIP) return 0
|
||||
if(weakened <= 0) src << "\red The sudden rush of air knocks you over!"
|
||||
weakened = max(weakened,2)
|
||||
weakened = max(weakened,rand(1,2))
|
||||
|
||||
atom/movable/proc/check_airflow_movable(n)
|
||||
|
||||
@@ -109,21 +112,31 @@ obj/item/check_airflow_movable(n)
|
||||
|
||||
proc/Airflow(zone/A,zone/B)
|
||||
|
||||
var/n = B.air.pressure - A.air.pressure
|
||||
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.
|
||||
if(abs(n) < vsc.airflow_lightest_pressure) return
|
||||
|
||||
//These turfs are the midway point between A and B, and will be the destination point for thrown objects.
|
||||
var/list/connected_turfs = A.connections[B]
|
||||
var/list/connection/connections_A = A.connections
|
||||
var/list/turf/connected_turfs = list()
|
||||
for(var/connection/C in connections_A)
|
||||
if( ( A == C.A.zone || A == C.zone_A ) && ( B == C.B.zone || B == C.zone_B ) )
|
||||
connected_turfs |= C.A
|
||||
else if( ( A == C.B.zone || A == C.zone_B ) && ( B == C.A.zone || B == C.zone_A ) )
|
||||
connected_turfs |= C.B
|
||||
|
||||
//Get lists of things that can be thrown across the room for each zone.
|
||||
var/list/pplz = A.movable_objects
|
||||
var/list/otherpplz = B.movable_objects
|
||||
var/list/pplz = B.movables()
|
||||
var/list/otherpplz = A.movables()
|
||||
if(n < 0)
|
||||
var/list/temporary_pplz = pplz
|
||||
pplz = otherpplz
|
||||
otherpplz = temporary_pplz
|
||||
|
||||
for(var/atom/movable/M in pplz)
|
||||
|
||||
if(M.last_airflow > world.time - 150) continue
|
||||
if(M.last_airflow > world.time - vsc.airflow_delay) continue
|
||||
|
||||
//Check for knocking people over
|
||||
if(ismob(M) && n > vsc.airflow_medium_pressure)
|
||||
@@ -148,7 +161,7 @@ proc/Airflow(zone/A,zone/B)
|
||||
//Do it again for the stuff in the other zone, making it fly away.
|
||||
for(var/atom/movable/M in otherpplz)
|
||||
|
||||
if(M.last_airflow > world.time - 150) continue
|
||||
if(M.last_airflow > world.time - vsc.airflow_delay) continue
|
||||
|
||||
if(ismob(M) && abs(n) > vsc.airflow_medium_pressure)
|
||||
if(M:nodamage) continue
|
||||
@@ -172,17 +185,17 @@ proc/AirflowSpace(zone/A)
|
||||
|
||||
//The space version of the Airflow(A,B,n) proc.
|
||||
|
||||
var/n = A.air.pressure
|
||||
var/n = A.air.return_pressure()
|
||||
//Here, n is determined by only the pressure in the room.
|
||||
|
||||
if(n < vsc.airflow_lightest_pressure) return
|
||||
|
||||
var/list/connected_turfs = A.space_tiles //The midpoints are now all the space connections.
|
||||
var/list/pplz = A.movable_objects //We only need to worry about things in the zone, not things in space.
|
||||
var/list/pplz = A.movables() //We only need to worry about things in the zone, not things in space.
|
||||
|
||||
for(var/atom/movable/M in pplz)
|
||||
|
||||
if(M.last_airflow > world.time - 150) continue
|
||||
if(M.last_airflow > world.time - vsc.airflow_delay) continue
|
||||
|
||||
if(ismob(M) && n > vsc.airflow_medium_pressure)
|
||||
if(M:nodamage) continue
|
||||
@@ -212,7 +225,7 @@ atom/movable
|
||||
proc/GotoAirflowDest(n)
|
||||
if(!airflow_dest) return
|
||||
if(airflow_speed < 0) return
|
||||
if(last_airflow > world.time - 150) return
|
||||
if(last_airflow > world.time - vsc.airflow_delay) return
|
||||
if(airflow_speed)
|
||||
airflow_speed = n/max(get_dist(src,airflow_dest),1)
|
||||
return
|
||||
@@ -229,7 +242,7 @@ 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),9)
|
||||
airflow_speed = min(round(n)/max(sqrt(get_dist(src,airflow_dest)),1),9)
|
||||
var
|
||||
xo = airflow_dest.x - src.x
|
||||
yo = airflow_dest.y - src.y
|
||||
@@ -252,16 +265,17 @@ atom/movable
|
||||
if ((src.x == 1 || src.x == world.maxx || src.y == 1 || src.y == world.maxy))
|
||||
return
|
||||
step_towards(src, src.airflow_dest)
|
||||
if(ismob(src) && src:client) src:client:move_delay = world.time + 10
|
||||
if(ismob(src) && src:client) src:client:move_delay = world.time + vsc.airflow_mob_slowdown
|
||||
airflow_dest = null
|
||||
airflow_speed = 0
|
||||
airflow_time = 0
|
||||
if(od)
|
||||
density = 0
|
||||
|
||||
proc/RepelAirflowDest(n)
|
||||
if(!airflow_dest) return
|
||||
if(airflow_speed < 0) return
|
||||
if(last_airflow > world.time - 150) return
|
||||
if(last_airflow > world.time - vsc.airflow_delay) return
|
||||
if(airflow_speed)
|
||||
airflow_speed = n/max(get_dist(src,airflow_dest),1)
|
||||
return
|
||||
@@ -276,9 +290,9 @@ atom/movable
|
||||
if(src:wear_suit)
|
||||
if(src:wear_suit.flags & SUITSPACE) return
|
||||
if(src:shoes)
|
||||
if(src:shoes.type == /obj/item/clothing/shoes/magboots) return
|
||||
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),9)
|
||||
airflow_speed = min(round(n)/max(sqrt(get_dist(src,airflow_dest)),1),9)
|
||||
var
|
||||
xo = -(airflow_dest.x - src.x)
|
||||
yo = -(airflow_dest.y - src.y)
|
||||
@@ -301,9 +315,10 @@ atom/movable
|
||||
if ((src.x == 1 || src.x == world.maxx || src.y == 1 || src.y == world.maxy))
|
||||
return
|
||||
step_towards(src, src.airflow_dest)
|
||||
if(ismob(src) && src:client) src:client:move_delay = world.time + 10
|
||||
if(ismob(src) && src:client) src:client:move_delay = world.time + vsc.airflow_mob_slowdown
|
||||
airflow_dest = null
|
||||
airflow_speed = 0
|
||||
airflow_time = 0
|
||||
if(od)
|
||||
density = 0
|
||||
|
||||
@@ -361,25 +376,8 @@ mob/living/carbon/human/airflow_hit(atom/A)
|
||||
stunned += round(airflow_speed * vsc.airflow_stun/2)
|
||||
. = ..()
|
||||
|
||||
turf/simulated/Entered(atom/A)
|
||||
. = ..()
|
||||
if(istype(A,/atom/movable) && zone)
|
||||
zone.movable_objects += A
|
||||
|
||||
turf/simulated/Exited(atom/A)
|
||||
. = ..()
|
||||
if(istype(A,/atom/movable) && zone)
|
||||
zone.movable_objects -= A
|
||||
|
||||
atom/movable/New(turf/simulated/T)
|
||||
. = ..()
|
||||
if(istype(T))
|
||||
if(T.zone)
|
||||
T.zone.movable_objects += src
|
||||
|
||||
atom/movable/Del()
|
||||
var/turf/simulated/T = loc
|
||||
if(istype(T))
|
||||
if(T.zone)
|
||||
T.zone.movable_objects -= src
|
||||
. = ..()
|
||||
zone/proc/movables()
|
||||
. = list()
|
||||
for(var/turf/T in contents)
|
||||
for(var/atom/A in T)
|
||||
. += A
|
||||
+61
-27
@@ -17,15 +17,32 @@ connection
|
||||
New(turf/T,turf/O)
|
||||
A = T
|
||||
B = O
|
||||
if(A.zone)
|
||||
if(!A.zone.connections) A.zone.connections = new()
|
||||
if(A.zone && B.zone)
|
||||
if(!A.zone.connections) A.zone.connections = list()
|
||||
A.zone.connections += src
|
||||
zone_A = A.zone
|
||||
if(B.zone)
|
||||
if(!B.zone.connections) B.zone.connections = new()
|
||||
|
||||
if(!B.zone.connections) B.zone.connections = list()
|
||||
B.zone.connections += src
|
||||
zone_B = B.zone
|
||||
if(A.zone && B.zone)
|
||||
|
||||
if(!air_master.tiles_with_connections)
|
||||
air_master.tiles_with_connections = list()
|
||||
|
||||
if(air_master.tiles_with_connections[A])
|
||||
var/list/A_connections = air_master.tiles_with_connections[A]
|
||||
A_connections |= src
|
||||
else
|
||||
var/list/A_connections = list(src)
|
||||
air_master.tiles_with_connections[A] = A_connections
|
||||
|
||||
if(air_master.tiles_with_connections[B])
|
||||
var/list/B_connections = air_master.tiles_with_connections[B]
|
||||
B_connections |= src
|
||||
else
|
||||
var/list/B_connections = list(src)
|
||||
air_master.tiles_with_connections[B] = B_connections
|
||||
|
||||
if(!A.zone.connected_zones)
|
||||
A.zone.connected_zones = list()
|
||||
if(!B.zone.connected_zones)
|
||||
@@ -44,26 +61,43 @@ connection
|
||||
B.zone.connected_zones[A.zone]++
|
||||
else
|
||||
world.log << "Attempted to create connection object for non-zone tiles: [T] -> [O]"
|
||||
del(src)
|
||||
Del()
|
||||
if(A.zone && A.zone.connections)
|
||||
A.zone.connections.Remove(src)
|
||||
if(!A.zone.connections.len)
|
||||
del A.zone.connections
|
||||
if(B.zone && B.zone.connections)
|
||||
B.zone.connections.Remove(src)
|
||||
if(!B.zone.connections.len)
|
||||
del B.zone.connections
|
||||
if(zone_A && zone_A.connections)
|
||||
zone_A.connections.Remove(src)
|
||||
if(!zone_A.connections.len)
|
||||
del zone_A.connections
|
||||
if(zone_B && zone_B.connections)
|
||||
zone_B.connections.Remove(src)
|
||||
if(!zone_B.connections.len)
|
||||
del zone_B.connections
|
||||
if(A)
|
||||
if(A.zone && A.zone.connections)
|
||||
A.zone.connections.Remove(src)
|
||||
if(!A.zone.connections.len)
|
||||
del A.zone.connections
|
||||
if(A in air_master.tiles_with_connections)
|
||||
var/list/A_connections = air_master.tiles_with_connections[A]
|
||||
A_connections -= src
|
||||
if(A_connections && !A_connections.len)
|
||||
del A_connections
|
||||
air_master.tiles_with_connections.Remove(A)
|
||||
if(B)
|
||||
if(B.zone && B.zone.connections)
|
||||
B.zone.connections.Remove(src)
|
||||
if(!B.zone.connections.len)
|
||||
del B.zone.connections
|
||||
if(B in air_master.tiles_with_connections)
|
||||
var/list/B_connections = air_master.tiles_with_connections[B]
|
||||
B_connections -= src
|
||||
if(B_connections && !B_connections.len)
|
||||
del B_connections
|
||||
air_master.tiles_with_connections.Remove(B)
|
||||
if(zone_A)
|
||||
if(zone_A && zone_A.connections)
|
||||
zone_A.connections.Remove(src)
|
||||
if(!zone_A.connections.len)
|
||||
del zone_A.connections
|
||||
if(zone_B)
|
||||
if(zone_B && zone_B.connections)
|
||||
zone_B.connections.Remove(src)
|
||||
if(!zone_B.connections.len)
|
||||
del zone_B.connections
|
||||
|
||||
if(A.zone)
|
||||
if(B.zone)
|
||||
if(A && A.zone)
|
||||
if(B && B.zone)
|
||||
if(B.zone in A.zone.connected_zones)
|
||||
if(A.zone.connected_zones[B.zone] > 1)
|
||||
A.zone.connected_zones[B.zone]--
|
||||
@@ -80,7 +114,7 @@ connection
|
||||
if(A.zone.connected_zones && !A.zone.connected_zones.len)
|
||||
A.zone.connected_zones = null
|
||||
if(zone_A && (!A.zone || zone_A != A.zone))
|
||||
if(B.zone)
|
||||
if(B && B.zone)
|
||||
if(B.zone in zone_A.connected_zones)
|
||||
if(zone_A.connected_zones[B.zone] > 1)
|
||||
zone_A.connected_zones[B.zone]--
|
||||
@@ -96,8 +130,8 @@ connection
|
||||
zone_A.connected_zones -= zone_B
|
||||
if(zone_A.connected_zones && !zone_A.connected_zones.len)
|
||||
zone_A.connected_zones = null
|
||||
if(B.zone)
|
||||
if(A.zone)
|
||||
if(B && B.zone)
|
||||
if(A && A.zone)
|
||||
if(A.zone in B.zone.connected_zones)
|
||||
if(B.zone.connected_zones[A.zone] > 1)
|
||||
B.zone.connected_zones[A.zone]--
|
||||
@@ -114,7 +148,7 @@ connection
|
||||
if(B.zone.connected_zones && !B.zone.connected_zones.len)
|
||||
B.zone.connected_zones = null
|
||||
if(zone_B && (!B.zone || zone_B != B.zone))
|
||||
if(A.zone)
|
||||
if(A && A.zone)
|
||||
if(A.zone in zone_B.connected_zones)
|
||||
if(zone_B.connected_zones[A.zone] > 1)
|
||||
zone_B.connected_zones[A.zone]--
|
||||
|
||||
@@ -30,6 +30,8 @@ zone
|
||||
|
||||
Del()
|
||||
//Ensuring the zone list doesn't get clogged with null values.
|
||||
for(var/connection/C in connections)
|
||||
del(C)
|
||||
zones -= src
|
||||
. = ..()
|
||||
|
||||
|
||||
@@ -12,6 +12,4 @@ zone
|
||||
list/connected_zones //Parallels connections, but lists zones to which this one is connected and the number
|
||||
//of points they're connected at.
|
||||
list/space_tiles // Any space tiles in this list will cause air to flow out.
|
||||
last_update = 0
|
||||
|
||||
list/movable_objects = list() //All the things that can be tossed by airflow.
|
||||
last_update = 0
|
||||
@@ -25,7 +25,6 @@ datum
|
||||
nitrogen = 0
|
||||
toxins = 0
|
||||
total_moles = 0 //Updated when a reaction occurs.
|
||||
pressure = 0
|
||||
|
||||
volume = CELL_VOLUME
|
||||
|
||||
@@ -150,10 +149,6 @@ datum
|
||||
for(var/datum/gas/trace_gas in trace_gases)
|
||||
total_moles += trace_gas.moles
|
||||
|
||||
if(volume)
|
||||
pressure = total_moles*R_IDEAL_GAS_EQUATION*temperature/volume
|
||||
else
|
||||
pressure = 0
|
||||
return
|
||||
|
||||
////////////////////////////////////////////
|
||||
|
||||
+12
-8
@@ -78,9 +78,10 @@ turf
|
||||
for(var/obj/obstacle in src)
|
||||
if(!obstacle.CanPass(mover, target, height, air_group))
|
||||
return 0
|
||||
for(var/obj/obstacle in target)
|
||||
if(!obstacle.CanPass(mover, src, height, air_group))
|
||||
return 0
|
||||
if(target != src)
|
||||
for(var/obj/obstacle in target)
|
||||
if(!obstacle.CanPass(mover, src, height, air_group))
|
||||
return 0
|
||||
|
||||
return 1
|
||||
|
||||
@@ -91,15 +92,16 @@ datum
|
||||
controller
|
||||
air_system
|
||||
//Geoemetry lists
|
||||
var/list/turf/simulated/active_singletons = list()
|
||||
// var/list/turf/simulated/active_singletons = list()
|
||||
|
||||
//Special functions lists
|
||||
var/list/turf/simulated/active_super_conductivity = list()
|
||||
var/list/turf/simulated/high_pressure_delta = list()
|
||||
// var/list/turf/simulated/active_super_conductivity = list()
|
||||
// var/list/turf/simulated/high_pressure_delta = list()
|
||||
|
||||
//Geometry updates lists
|
||||
var/list/turf/simulated/tiles_to_update = list()
|
||||
var/list/turf/simulated/groups_to_rebuild = list()
|
||||
var/list/turf/simulated/tiles_with_connections = list()
|
||||
// var/list/turf/simulated/groups_to_rebuild = list()
|
||||
|
||||
var/current_cycle = 0
|
||||
var/update_delay = 5 //How long between check should it try to process atmos again.
|
||||
@@ -164,7 +166,9 @@ datum
|
||||
|
||||
if(tiles_to_update.len > 0) //If there are tiles to update, do so.
|
||||
for(var/turf/simulated/T in tiles_to_update)
|
||||
spawn T.update_air_properties()
|
||||
spawn
|
||||
if(istype(T))
|
||||
T.update_air_properties()
|
||||
tiles_to_update = list()
|
||||
|
||||
for(var/zone/Z in zones)
|
||||
|
||||
+39
-18
@@ -102,8 +102,6 @@ turf
|
||||
if(air_master)
|
||||
air_master.tiles_to_update.Add(src)
|
||||
|
||||
find_zone()
|
||||
|
||||
// air.parent = src //TODO DEBUG REMOVE
|
||||
|
||||
else
|
||||
@@ -176,30 +174,53 @@ turf
|
||||
if(CanPass(null, get_step(src,direction), 0, 0))
|
||||
air_check_directions |= direction
|
||||
|
||||
if(zone)
|
||||
for(var/direction in cardinal)
|
||||
var/turf/simulated/T = get_step(src,direction)
|
||||
if(istype(T))
|
||||
if(CanPass(null, src, 1.5, 0))
|
||||
if(CanPass(null, src, 0, 0))
|
||||
ZConnect(src,T)
|
||||
else
|
||||
ZDisconnect(src,T)
|
||||
else
|
||||
zone.rebuild = 1
|
||||
if(T.zone)
|
||||
T.zone.rebuild = 1
|
||||
else
|
||||
if(!zone && !density) //No zone and not a wall, lets add ourself to a zone.
|
||||
for(var/direction in cardinal)
|
||||
if(air_check_directions&direction)
|
||||
var/turf/simulated/T = get_step(src,direction)
|
||||
if(T.zone)
|
||||
T.zone.AddTurf(src)
|
||||
break
|
||||
if(!zone)
|
||||
if(!zone) //No zone found, new zone!
|
||||
new/zone(src)
|
||||
|
||||
if(!CanPass(null, src, 0, 0)) //Can't pass, and was updated. Delete zone connections involving this turf.
|
||||
if(air_master.tiles_with_connections[src])
|
||||
for(var/connection/C in air_master.tiles_with_connections[src])
|
||||
del C
|
||||
|
||||
update_zone_properties() //Update self zone and adjacent zones.
|
||||
|
||||
if(air_check_directions)
|
||||
processing = 1
|
||||
else
|
||||
processing = 0
|
||||
processing = 0
|
||||
|
||||
|
||||
proc/update_zone_properties()
|
||||
for(var/direction in cardinal)
|
||||
var/turf/simulated/T = get_step(src,direction)
|
||||
if(air_check_directions&direction) //I can connect air in this direction
|
||||
if(!istype(T)) //Space
|
||||
if(zone)
|
||||
zone.rebuild = 1
|
||||
continue
|
||||
else if(!CanPass(null, src, 1.5, 1) && CanPass(null, src, 0, 0)) //I normally block air, but am permitting it.
|
||||
if(zone) //Either open or no doors, air can flow.
|
||||
ZConnect(src,T) //Connect 'em.
|
||||
else if(!CanPass(null, src, 1.5, 1)) //If I block air, we must look to see if the adjacent turfs need rebuilt.
|
||||
if(T.zone && !T.zone.rebuild)
|
||||
for(var/direction2 in cardinal - direction) //Check all other directions for air that might be connected.
|
||||
var/turf/simulated/NT = get_step(src, direction2)
|
||||
if(NT.zone && NT.zone == T.zone)
|
||||
if(direction == reverse_direction(direction2)) //If it is opposite, then rebuild anyways.
|
||||
T.zone.rebuild = 1
|
||||
break
|
||||
else
|
||||
var/turf/simulated/LT = get_step(src, direction2|direction) //Is there a diagonal for the air to path around?
|
||||
if(!LT || !LT.zone || LT.zone != T.zone) //Either it does not exist or the zone does not match, rebuild
|
||||
T.zone.rebuild = 1
|
||||
break
|
||||
else if(!LT.CanPass(null, LT, 0, 0) || !NT.CanPass(null, NT, 0, 0)) //It exist, zone matches, see if it can transfer air. Otherwise, rebuild.
|
||||
T.zone.rebuild = 1
|
||||
break
|
||||
+25
-27
@@ -39,27 +39,6 @@
|
||||
else
|
||||
return 1
|
||||
|
||||
/turf/proc/find_zone()
|
||||
//Allows newly generated turfs to join up with a nearby zone.
|
||||
if(world.time < 10) return
|
||||
if(density)
|
||||
for(var/d in cardinal)
|
||||
var/turf/T = get_step(src,d)
|
||||
if(!T || !T.zone || !T.ZCanPass(src))
|
||||
continue
|
||||
T.zone.rebuild = 1
|
||||
|
||||
else
|
||||
for(var/d in cardinal)
|
||||
var/turf/T = get_step(src,d)
|
||||
if(!T || !T.zone || !T.ZCanPass(src))
|
||||
continue
|
||||
if(!zone)
|
||||
zone = T.zone
|
||||
zone.AddTurf(src)
|
||||
else if(T.zone != zone)
|
||||
ZConnect(src,T)
|
||||
|
||||
/turf/proc/check_connections()
|
||||
//Checks for new connections that can be made.
|
||||
for(var/d in cardinal)
|
||||
@@ -144,6 +123,7 @@ proc/ZConnect(turf/A,turf/B)
|
||||
//Ensure zones separated by doors do not merge.
|
||||
if(A.HasDoor(B) || B.HasDoor(A)) C.indirect = 1
|
||||
|
||||
/*
|
||||
proc/ZDisconnect(turf/A,turf/B)
|
||||
//Removes a zone connection. Can split zones in the case of a permanent barrier.
|
||||
|
||||
@@ -154,6 +134,8 @@ proc/ZDisconnect(turf/A,turf/B)
|
||||
for(var/connection/C in A.zone.connections)
|
||||
if((C.A == A && C.B == B) || (C.A == B && C.B == A))
|
||||
del C
|
||||
if(C)
|
||||
C.Cleanup()
|
||||
//If they're the same, split the zone at this line.
|
||||
else
|
||||
//Preliminary checks to prevent stupidity.
|
||||
@@ -171,9 +153,10 @@ proc/ZDisconnect(turf/A,turf/B)
|
||||
|
||||
//Add connections from the old zone.
|
||||
for(var/connection/C in oldzone.connections)
|
||||
if((A in Z.contents) || (B in Z.contents))
|
||||
if((C.A in Z.contents) || (C.B in Z.contents))
|
||||
if(!Z.connections) Z.connections = list()
|
||||
Z.connections += C
|
||||
C.Cleanup()
|
||||
|
||||
//Check for space.
|
||||
for(var/turf/T in test)
|
||||
@@ -187,9 +170,10 @@ proc/ZDisconnect(turf/A,turf/B)
|
||||
|
||||
//Add relevant connections from old zone.
|
||||
for(var/connection/C in oldzone.connections)
|
||||
if((A in Y.contents) || (B in Y.contents))
|
||||
if((C.A in Y.contents) || (C.B in Y.contents))
|
||||
if(!Y.connections) Y.connections = list()
|
||||
Y.connections += C
|
||||
C.Cleanup()
|
||||
|
||||
//Add the remaining space tiles to this zone.
|
||||
for(var/turf/space/T in oldzone.space_tiles)
|
||||
@@ -199,7 +183,21 @@ proc/ZDisconnect(turf/A,turf/B)
|
||||
oldzone.air = null
|
||||
del oldzone
|
||||
else
|
||||
if(istype(A,/turf/space) && B.zone)
|
||||
B.zone.RemoveSpace(A)
|
||||
else if(istype(B,/turf/space) && A.zone)
|
||||
A.zone.RemoveSpace(B)
|
||||
if(B.zone)
|
||||
if(istype(A,/turf/space))
|
||||
B.zone.RemoveSpace(A)
|
||||
else
|
||||
for(var/connection/C in B.zone.connections)
|
||||
if((C.A == A && C.B == B) || (C.A == B && C.B == A))
|
||||
del C
|
||||
if(C)
|
||||
C.Cleanup()
|
||||
if(A.zone)
|
||||
if(istype(B,/turf/space))
|
||||
A.zone.RemoveSpace(B)
|
||||
else
|
||||
for(var/connection/C in A.zone.connections)
|
||||
if((C.A == A && C.B == B) || (C.A == B && C.B == A))
|
||||
del C
|
||||
if(C)
|
||||
C.Cleanup()*/
|
||||
+18
-4
@@ -15,12 +15,20 @@ zone/proc/process()
|
||||
list/new_contents
|
||||
problem = 0
|
||||
|
||||
if(space_tiles)
|
||||
del(space_tiles)
|
||||
|
||||
contents.Remove(null) //I can't believe this is needed.
|
||||
do
|
||||
sample = pick(contents) //Nor this.
|
||||
while(!istype(sample))
|
||||
new_contents = FloodFill(sample)
|
||||
|
||||
for(var/turf/space/S in new_contents)
|
||||
if(!space_tiles)
|
||||
space_tiles = list()
|
||||
space_tiles |= S
|
||||
|
||||
//If something isn't carried over, there was a complication.
|
||||
for(var/turf/T in contents)
|
||||
if(!(T in new_contents))
|
||||
@@ -37,6 +45,10 @@ zone/proc/process()
|
||||
if(!T.zone)
|
||||
var/zone/Z = new /zone(T)
|
||||
Z.air.copy_from(air)
|
||||
if(istype(T,/turf/space))
|
||||
if(!T.zone.space_tiles)
|
||||
T.zone.space_tiles = list()
|
||||
T.zone.space_tiles |= T
|
||||
rebuild = 0
|
||||
|
||||
//Sometimes explosions will cause the air to be deleted for some reason.
|
||||
@@ -54,12 +66,14 @@ zone/proc/process()
|
||||
space_tiles -= T
|
||||
continue
|
||||
total_space++
|
||||
if(space_tiles && !space_tiles.len)
|
||||
del space_tiles
|
||||
|
||||
//Add checks to ensure that we're not sucking air out of an empty room.
|
||||
if(total_space && air.total_moles > 0.1 && air.temperature > TCMB+0.5)
|
||||
//If there is space, air should flow out of the zone.
|
||||
//if(abs(air.pressure) > vsc.airflow_lightest_pressure)
|
||||
// AirflowSpace(src)
|
||||
if(abs(air.return_pressure()) > vsc.airflow_lightest_pressure)
|
||||
AirflowSpace(src)
|
||||
ShareSpace(air,total_space*(zone_share_percent/100))
|
||||
|
||||
//React the air here.
|
||||
@@ -115,8 +129,8 @@ zone/proc/process()
|
||||
for(var/zone/Z in connected_zones)
|
||||
//Ensure we're not doing pointless calculations on equilibrium zones.
|
||||
if(abs(air.total_moles - Z.air.total_moles) > 0.1 || abs(air.temperature - Z.air.temperature) > 0.1)
|
||||
//if(abs(Z.air.pressure - air.pressure) > vsc.airflow_lightest_pressure)
|
||||
// Airflow(src,Z)
|
||||
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))
|
||||
|
||||
proc/ShareRatio(datum/gas_mixture/A, datum/gas_mixture/B, ratio)
|
||||
|
||||
@@ -1164,11 +1164,6 @@ proc/isemptylist(list/list)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
proc/clearlist(list/list)
|
||||
if(istype(list))
|
||||
list.len = 0
|
||||
return
|
||||
|
||||
proc/listclearnulls(list/list)
|
||||
if(istype(list))
|
||||
while(null in list)
|
||||
@@ -1763,24 +1758,6 @@ proc/oview_or_orange(distance = world.view , center = usr , type)
|
||||
if("range")
|
||||
. = orange(distance,center)
|
||||
return
|
||||
proc/get_opposite(var/checkdir)
|
||||
switch(checkdir)
|
||||
if(NORTH)
|
||||
return SOUTH
|
||||
if(SOUTH)
|
||||
return NORTH
|
||||
if(EAST)
|
||||
return WEST
|
||||
if(WEST)
|
||||
return EAST
|
||||
if(NORTHEAST)
|
||||
return SOUTHWEST
|
||||
if(NORTHWEST)
|
||||
return SOUTHEAST
|
||||
if(SOUTHEAST)
|
||||
return NORTHWEST
|
||||
if(SOUTHWEST)
|
||||
return NORTHEAST
|
||||
|
||||
/proc/stringsplit(txt, character)
|
||||
var/cur_text = txt
|
||||
|
||||
@@ -344,11 +344,11 @@
|
||||
var/turf/simulated/east = get_step(source,EAST)
|
||||
var/turf/simulated/west = get_step(source,WEST)
|
||||
|
||||
if(istype(source)) air_master.tiles_to_update += source
|
||||
if(istype(north)) air_master.tiles_to_update += north
|
||||
if(istype(south)) air_master.tiles_to_update += south
|
||||
if(istype(east)) air_master.tiles_to_update += east
|
||||
if(istype(west)) air_master.tiles_to_update += west
|
||||
if(istype(source)) air_master.tiles_to_update |= source
|
||||
if(istype(north)) air_master.tiles_to_update |= north
|
||||
if(istype(south)) air_master.tiles_to_update |= south
|
||||
if(istype(east)) air_master.tiles_to_update |= east
|
||||
if(istype(west)) air_master.tiles_to_update |= west
|
||||
return 1
|
||||
|
||||
|
||||
|
||||
@@ -102,8 +102,7 @@
|
||||
if(src.throwing == 1)
|
||||
src.throwing = 0
|
||||
if(isobj(A))
|
||||
if(A.density && !A.CanPass(src,target)) // **TODO: Better behaviour for windows
|
||||
// which are dense, but shouldn't always stop movement
|
||||
if(A.density && !A.CanPass(src,target))
|
||||
src.throw_impact(A)
|
||||
src.throwing = 0
|
||||
|
||||
@@ -152,6 +151,7 @@
|
||||
if(src.throwing)
|
||||
src.throw_impact(O)
|
||||
src.throwing = 0
|
||||
airflow_speed = 0
|
||||
..()
|
||||
|
||||
/atom/movable/proc/throw_at(atom/target, range, speed)
|
||||
|
||||
+77
-7
@@ -165,7 +165,17 @@
|
||||
W.sd_SetOpacity(0)
|
||||
//This is probably gonna make lighting go a bit wonky in bombed areas, but sd_SetOpacity was the primary reason bombs have been so laggy. --NEO
|
||||
W.levelupdate()
|
||||
air_master.tiles_to_update += W
|
||||
air_master.tiles_to_update |= W
|
||||
|
||||
var/turf/simulated/north = get_step(W,NORTH)
|
||||
var/turf/simulated/south = get_step(W,SOUTH)
|
||||
var/turf/simulated/east = get_step(W,EAST)
|
||||
var/turf/simulated/west = get_step(W,WEST)
|
||||
|
||||
if(istype(north)) air_master.tiles_to_update |= north
|
||||
if(istype(south)) air_master.tiles_to_update |= south
|
||||
if(istype(east)) air_master.tiles_to_update |= east
|
||||
if(istype(west)) air_master.tiles_to_update |= west
|
||||
return W
|
||||
|
||||
/turf/proc/ReplaceWithPlating()
|
||||
@@ -183,7 +193,17 @@
|
||||
W.opacity = 1
|
||||
W.sd_SetOpacity(0)
|
||||
W.levelupdate()
|
||||
air_master.tiles_to_update += W
|
||||
air_master.tiles_to_update |= W
|
||||
|
||||
var/turf/simulated/north = get_step(W,NORTH)
|
||||
var/turf/simulated/south = get_step(W,SOUTH)
|
||||
var/turf/simulated/east = get_step(W,EAST)
|
||||
var/turf/simulated/west = get_step(W,WEST)
|
||||
|
||||
if(istype(north)) air_master.tiles_to_update |= north
|
||||
if(istype(south)) air_master.tiles_to_update |= south
|
||||
if(istype(east)) air_master.tiles_to_update |= east
|
||||
if(istype(west)) air_master.tiles_to_update |= west
|
||||
return W
|
||||
|
||||
/turf/proc/ReplaceWithEngineFloor()
|
||||
@@ -196,7 +216,17 @@
|
||||
E.dir = old_dir
|
||||
E.icon_state = "engine"
|
||||
E.levelupdate()
|
||||
air_master.tiles_to_update += E
|
||||
air_master.tiles_to_update |= E
|
||||
|
||||
var/turf/simulated/north = get_step(E,NORTH)
|
||||
var/turf/simulated/south = get_step(E,SOUTH)
|
||||
var/turf/simulated/east = get_step(E,EAST)
|
||||
var/turf/simulated/west = get_step(E,WEST)
|
||||
|
||||
if(istype(north)) air_master.tiles_to_update |= north
|
||||
if(istype(south)) air_master.tiles_to_update |= south
|
||||
if(istype(east)) air_master.tiles_to_update |= east
|
||||
if(istype(west)) air_master.tiles_to_update |= west
|
||||
return E
|
||||
|
||||
/turf/simulated/Entered(atom/A, atom/OL)
|
||||
@@ -259,7 +289,17 @@
|
||||
var/old_dir = dir
|
||||
var/turf/space/S = new /turf/space( locate(src.x, src.y, src.z) )
|
||||
S.dir = old_dir
|
||||
air_master.tiles_to_update += S
|
||||
air_master.tiles_to_update |= S
|
||||
|
||||
var/turf/simulated/north = get_step(S,NORTH)
|
||||
var/turf/simulated/south = get_step(S,SOUTH)
|
||||
var/turf/simulated/east = get_step(S,EAST)
|
||||
var/turf/simulated/west = get_step(S,WEST)
|
||||
|
||||
if(istype(north)) air_master.tiles_to_update |= north
|
||||
if(istype(south)) air_master.tiles_to_update |= south
|
||||
if(istype(east)) air_master.tiles_to_update |= east
|
||||
if(istype(west)) air_master.tiles_to_update |= west
|
||||
return S
|
||||
|
||||
/turf/proc/ReplaceWithLattice()
|
||||
@@ -267,7 +307,17 @@
|
||||
var/turf/space/S = new /turf/space( locate(src.x, src.y, src.z) )
|
||||
S.dir = old_dir
|
||||
new /obj/structure/lattice( locate(src.x, src.y, src.z) )
|
||||
air_master.tiles_to_update += S
|
||||
air_master.tiles_to_update |= S
|
||||
|
||||
var/turf/simulated/north = get_step(S,NORTH)
|
||||
var/turf/simulated/south = get_step(S,SOUTH)
|
||||
var/turf/simulated/east = get_step(S,EAST)
|
||||
var/turf/simulated/west = get_step(S,WEST)
|
||||
|
||||
if(istype(north)) air_master.tiles_to_update |= north
|
||||
if(istype(south)) air_master.tiles_to_update |= south
|
||||
if(istype(east)) air_master.tiles_to_update |= east
|
||||
if(istype(west)) air_master.tiles_to_update |= west
|
||||
return S
|
||||
|
||||
/turf/proc/ReplaceWithWall()
|
||||
@@ -277,7 +327,17 @@
|
||||
S.opacity = 0
|
||||
S.sd_NewOpacity(1)
|
||||
levelupdate()
|
||||
air_master.tiles_to_update += S
|
||||
air_master.tiles_to_update |= S
|
||||
|
||||
var/turf/simulated/north = get_step(S,NORTH)
|
||||
var/turf/simulated/south = get_step(S,SOUTH)
|
||||
var/turf/simulated/east = get_step(S,EAST)
|
||||
var/turf/simulated/west = get_step(S,WEST)
|
||||
|
||||
if(istype(north)) air_master.tiles_to_update |= north
|
||||
if(istype(south)) air_master.tiles_to_update |= south
|
||||
if(istype(east)) air_master.tiles_to_update |= east
|
||||
if(istype(west)) air_master.tiles_to_update |= west
|
||||
return S
|
||||
|
||||
/turf/proc/ReplaceWithRWall()
|
||||
@@ -287,7 +347,17 @@
|
||||
S.opacity = 0
|
||||
S.sd_NewOpacity(1)
|
||||
levelupdate()
|
||||
air_master.tiles_to_update += S
|
||||
air_master.tiles_to_update |= S
|
||||
|
||||
var/turf/simulated/north = get_step(S,NORTH)
|
||||
var/turf/simulated/south = get_step(S,SOUTH)
|
||||
var/turf/simulated/east = get_step(S,EAST)
|
||||
var/turf/simulated/west = get_step(S,WEST)
|
||||
|
||||
if(istype(north)) air_master.tiles_to_update |= north
|
||||
if(istype(south)) air_master.tiles_to_update |= south
|
||||
if(istype(east)) air_master.tiles_to_update |= east
|
||||
if(istype(west)) air_master.tiles_to_update |= west
|
||||
return S
|
||||
|
||||
//turf/simulated/wall/New()
|
||||
|
||||
@@ -111,7 +111,7 @@
|
||||
desc = "A small wrapped package."
|
||||
name = "small parcel"
|
||||
icon = 'storage.dmi'
|
||||
icon_state = "deliverycrateSmall1"
|
||||
icon_state = "deliverycrate1"
|
||||
var/tmp/obj/item/wrapped = null
|
||||
var/sortTag = null
|
||||
flags = FPRINT
|
||||
@@ -219,7 +219,20 @@
|
||||
O.loc = P
|
||||
amount -= 1
|
||||
P.w_class = O.w_class
|
||||
P.icon_state = "deliverycrateSmall[P.w_class]"
|
||||
P.icon_state = "deliverycrate[P.w_class]"
|
||||
var/t
|
||||
switch(P.w_class)
|
||||
if(1.0)
|
||||
t = "tiny"
|
||||
if(2.0)
|
||||
t = "small"
|
||||
if(3.0)
|
||||
t = "normal-sized"
|
||||
if(4.0)
|
||||
t = "bulky"
|
||||
if(5.0)
|
||||
t = "huge"
|
||||
P.name = "[t] package"
|
||||
user.visible_message("\The [user] wraps \a [target] with \a [src], producing \a [P].",\
|
||||
"\blue You wrap \the [target], leaving [amount] units of paper on your [src].",\
|
||||
"You hear someone taping paper around a small object.")
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 51 KiB |
+8412
-8414
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user