Merge branch 'master' of github.com:Baystation12/Baystation12 into TGUpdates

Conflicts:
	maps/tgstation.2.0.8.dmm
This commit is contained in:
Erthilo
2012-06-07 19:58:21 +01:00
29 changed files with 8820 additions and 8647 deletions
+1
View File
@@ -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"
+43 -39
View File
@@ -59,10 +59,17 @@ vs_control/var
airflow_damage = 0.3
airflow_stun = 0.15
airflow_speed_decay = 1
airflow_delay = 35 //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.
airflow_stun_cooldown = 10 //How long, in tenths of a second, to wait before stunning them again.
mob/var/last_airflow_stun = 0
mob/proc/airflow_stun()
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)
last_airflow_stun = world.time
mob/living/silicon/airflow_stun()
return
@@ -71,13 +78,15 @@ mob/living/carbon/metroid/airflow_stun()
return
mob/living/carbon/human/airflow_stun()
if(last_airflow_stun > world.time - vsc.airflow_stun_cooldown) return 0
if(buckled) return 0
if(wear_suit)
if(wear_suit.flags & SUITSPACE) return 0
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))
last_airflow_stun = world.time
atom/movable/proc/check_airflow_movable(n)
@@ -109,21 +118,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 +167,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 +191,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 +231,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 +248,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 +271,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 +296,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 +321,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 +382,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
+65 -31
View File
@@ -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]--
@@ -71,7 +105,7 @@ connection
A.zone.connected_zones -= B.zone
if(A.zone.connected_zones && !A.zone.connected_zones.len)
A.zone.connected_zones = null
if( zone_B && (!B.zone && zone_B != B.zone) )
if( zone_B && (!B.zone || zone_B != B.zone) )
if(zone_B in A.zone.connected_zones)
if(A.zone.connected_zones[zone_B] > 1)
A.zone.connected_zones[zone_B]--
@@ -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]--
@@ -88,7 +122,7 @@ connection
zone_A.connected_zones -= B.zone
if(zone_A.connected_zones && !zone_A.connected_zones.len)
zone_A.connected_zones = null
if( zone_B && (!B.zone && zone_B != B.zone) )
if( zone_B && (!B.zone || zone_B != B.zone) )
if(zone_B in zone_A.connected_zones)
if(zone_A.connected_zones[zone_B] > 1)
zone_A.connected_zones[zone_B]--
@@ -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]--
@@ -105,7 +139,7 @@ connection
B.zone.connected_zones -= A.zone
if(B.zone.connected_zones && !B.zone.connected_zones.len)
B.zone.connected_zones = null
if( zone_A && (!A.zone && zone_A != A.zone) )
if( zone_A && (!A.zone || zone_A != A.zone) )
if(zone_A in B.zone.connected_zones)
if(B.zone.connected_zones[zone_A] > 1)
B.zone.connected_zones[zone_A]--
@@ -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]--
@@ -122,7 +156,7 @@ connection
zone_B.connected_zones -= A.zone
if(zone_B.connected_zones && !zone_B.connected_zones.len)
zone_B.connected_zones = null
if( zone_A && (!A.zone && zone_A != A.zone) )
if( zone_A && (!A.zone || zone_A != A.zone) )
if(zone_A in zone_B.connected_zones)
if(zone_B.connected_zones[zone_A] > 1)
zone_B.connected_zones[zone_A]--
+2
View File
@@ -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
. = ..()
+1 -3
View File
@@ -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
-5
View File
@@ -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
View File
@@ -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
View File
@@ -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(!(T.CanPass(null, src, 1.5, 1) && CanPass(null, T, 1.5, 1)) && (CanPass(null, T, 0, 0) || T.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(!(T.CanPass(null, src, 1.5, 1) && CanPass(null, T, 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
View File
@@ -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
View File
@@ -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)
+2 -25
View File
@@ -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)
@@ -1557,13 +1552,13 @@ proc/listclearnulls(list/list)
for(var/turf/simulated/T1 in toupdate)
for(var/obj/machinery/door/D2 in T1)
doors += D2
air_master.tiles_to_update += T1
air_master.tiles_to_update |= T1
if(fromupdate.len)
for(var/turf/simulated/T2 in fromupdate)
for(var/obj/machinery/door/D2 in T2)
doors += D2
air_master.tiles_to_update += T2
air_master.tiles_to_update |= T2
for(var/obj/O in doors)
O:update_nearby_tiles(1)
@@ -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
+10 -6
View File
@@ -32,7 +32,11 @@
layer = 3.1 //Above most items if closed
else
layer = 2.7 //Under all objects if opened. 2.7 due to tables being at 2.6
update_nearby_tiles(need_rebuild=1)
if(world.time < 10)
spawn(10)
update_nearby_tiles(need_rebuild=1)
else
update_nearby_tiles(need_rebuild=1)
return
@@ -344,11 +348,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
+20 -6
View File
@@ -91,15 +91,29 @@
//border_only fire doors are special when it comes to air groups
/obj/machinery/door/firedoor/border_only
New()
..()
var/turf/simulated/source = get_turf(src)
var/turf/simulated/T = get_step(source,dir)
if(!source.CanPass(null, T, 0, 0) || !locate(/obj/machinery/door/firedoor/border_only) in T)
var/obj/machinery/door/firedoor/F = new(source)
F.name = name
F.desc = desc
F.dir = dir
spawn(0)
del src
CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
if(air_group)
var/direction = get_dir(src,target)
return (dir != direction)
if(direction)
return (dir != direction)
return 1 //It will break the zone when it actually drops, otherwise let it work normally.
else if(density)
if(!height)
var/direction = get_dir(src,target)
return (dir != direction)
else
if(direction)
return (dir != direction)
return 0
return 1
@@ -107,9 +121,9 @@
update_nearby_tiles(need_rebuild)
if(!air_master) return 0
var/turf/simulated/source = loc
var/turf/simulated/source = get_turf(src)
var/turf/simulated/destination = get_step(source,dir)
if(istype(source)) air_master.tiles_to_update += source
if(istype(destination)) air_master.tiles_to_update += destination
if(istype(source)) air_master.tiles_to_update |= source
if(istype(destination)) air_master.tiles_to_update |= destination
return 1
+3 -3
View File
@@ -14,11 +14,11 @@
/obj/machinery/door/window/update_nearby_tiles(need_rebuild)
if(!air_master) return 0
var/turf/simulated/source = loc
var/turf/simulated/source = get_turf(src)
var/turf/simulated/target = get_step(source,dir)
if(istype(source)) air_master.tiles_to_update += source
if(istype(target)) air_master.tiles_to_update += target
if(istype(source)) air_master.tiles_to_update |= source
if(istype(target)) air_master.tiles_to_update |= target
return 1
+6 -6
View File
@@ -1044,17 +1044,17 @@ steam.start() -- spawns the effect
proc/update_nearby_tiles(need_rebuild)
if(!air_master) return 0
var/turf/simulated/source = loc
var/turf/simulated/source = get_turf(src)
var/turf/simulated/north = get_step(source,NORTH)
var/turf/simulated/south = get_step(source,SOUTH)
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
+6 -6
View File
@@ -112,7 +112,7 @@
return //Means the item is already in the storage item
if(contents.len >= storage_slots)
user << "\red The [src] is full, make some space."
user << "\red \The [src] is full, make some space."
return //Storage item is full
if(can_hold.len)
@@ -122,16 +122,16 @@
ok = 1
break
if(!ok)
user << "\red This [src] cannot hold [W]."
user << "\red \The [src] cannot hold \the [W]."
return
for(var/A in cant_hold) //Check for specific items which this container can't hold.
if(istype(W, text2path(A) ))
user << "\red This [src] cannot hold [W]."
user << "\red \The [src] cannot hold \the [W]."
return
if (W.w_class > max_w_class)
user << "\red This [W] is too big for \the [src]"
user << "\red \The [W] is too big for \the [src]"
return
var/sum_w_class = W.w_class
@@ -139,12 +139,12 @@
sum_w_class += I.w_class //Adds up the combined w_classes which will be in the storage item if the item is added to it.
if(sum_w_class > max_combined_w_class)
user << "\red The [src] is full, make some space."
user << "\red \The [src] is full, make some space."
return
if(W.w_class >= src.w_class && (istype(W, /obj/item/weapon/storage)))
if(!istype(src, /obj/item/weapon/storage/backpack/holding)) //bohs should be able to hold backpacks again. The override for putting a boh in a boh is in backpack.dm.
user << "\red The [src] cannot hold [W] as it's a storage item of the same size."
user << "\red \The [src] cannot hold \the [W] as it's a storage item of the same size."
return //To prevent the stacking of the same sized items.
user.u_equip(W)
+10 -10
View File
@@ -126,23 +126,23 @@
ok = 1
break
if(!ok)
user << "\red This [src] cannot hold [W]."
user << "\red \The [src] cannot hold \the [W]."
return
for(var/A in cant_hold) //Check for specific items which this container can't hold.
if(istype(W, text2path(A) ))
user << "\red This [src] cannot hold [W]."
user << "\red \The [src] cannot hold \the [W]."
return
if (W.w_class > max_w_class)
user << "\red This [W] is too big for \the [src]"
user << "\red \The [W] is too big for \the [src]"
return
if(istype(W, /obj/item/weapon/tray))
var/obj/item/weapon/tray/T = W
if(T.calc_carry() > 0)
if(prob(85))
user << "\red The tray won't fit in [src]."
user << "\red The tray won't fit in \the [src]."
return
else
@@ -157,12 +157,12 @@
sum_w_class += I.w_class //Adds up the combined w_classes which will be in the storage item if the item is added to it.
if(sum_w_class > max_combined_w_class)
user << "\red The [src] is full, make some space."
user << "\red \The [src] is full, make some space."
return
if(W.w_class >= src.w_class && (istype(W, /obj/item/weapon/storage)))
if(!istype(src, /obj/item/weapon/storage/backpack/holding)) //bohs should be able to hold backpacks again. The override for putting a boh in a boh is in backpack.dm.
user << "\red The [src] cannot hold [W] as it's a storage item of the same size."
user << "\red \The [src] cannot hold \the [W] as it's a storage item of the same size."
return //To prevent the stacking of the same sized items.
user.u_equip(W)
@@ -184,11 +184,11 @@
if (istype(W, /obj/item/weapon/gun/energy/crossbow)) return //STEALTHY
for(var/mob/M in viewers(user, null))
if (M == user)
user << "\blue You put the [W] into [src]."
user << "\blue You put the \the [W] into \the [src]."
else if (M in range(1)) //If someone is standing close enough, they can tell what it is...
M.show_message(text("\blue [user] puts [W] into [src]."))
M.show_message(text("\blue \The [user] puts \the [W] into \the [src]."))
else if (W.w_class >= 3.0) //Otherwise they can only see large or normal items from a distance...
M.show_message(text("\blue [user] puts [W] into [src]."))
M.show_message(text("\blue \The [user] puts \the [W] into \the [src]."))
return
/obj/item/weapon/storage/dropped(mob/user as mob)
@@ -271,7 +271,7 @@
if ( !found ) // User is too far away
return
// Now make the cardboard
user << "\blue You fold [src] flat."
user << "\blue You fold \the [src] flat."
new src.foldable(get_turf(src))
del(src)
//BubbleWrap END
+4 -12
View File
@@ -69,18 +69,10 @@ var/list/supply_groups = new()
name = "\improper Airtight plastic flaps"
desc = "Heavy duty, airtight, plastic flaps."
New() //set the turf below the flaps to block air
var/turf/T = get_turf(src.loc)
if(T)
T.blocks_air = 1
..()
Del() //lazy hack to set the turf to allow air to pass if it's a simulated floor
var/turf/T = get_turf(src.loc)
if(T)
if(istype(T, /turf/simulated/floor))
T.blocks_air = 0
..()
CanPass(atom/A, turf/T, height = 0, air_group = 0)
if(!istype(A))
return 0
return ..()
/area/supplyshuttle
name = "Supply Shuttle"
+2 -2
View File
@@ -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
View File
@@ -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()
+1 -1
View File
@@ -49,7 +49,7 @@
////////////
var/next_allowed_topic_time = 10
// comment out the line below when debugging locally to enable the options & messages menu
control_freak = 1
//control_freak = 1
@@ -34,6 +34,11 @@
var/t_has = proper_forms["has"]
var/t_is = proper_forms["is"]
if(mutantrace == "lizard")
examine_text = "one of those lizard-like Soghuns"
if(mutantrace == "skrell")
examine_text = "one of those gelatinous Skrells"
var/msg = "<span class='info'>*---------*\nThis is "
if(icon)
msg += "\icon[icon] " //fucking BYOND: this should stop dreamseeker crashing if we -somehow- examine somebody before their icon is generated
@@ -293,6 +293,11 @@
if (bodytemperature < 283.222)
tally += (283.222 - bodytemperature) / 10 * 1.75
if(mutantrace == "lizard") //Soghun are more affected by the cold
tally += 1
if(istajaran()) //But Tajarans are slightly resistant
if(tally != 0)
tally -= tally*0.1
if (stuttering < 10)
stuttering = 10
@@ -1250,7 +1255,7 @@
// Should be called only when something about the clothing itself changed
// which is not handled by the equip code.
rebuild_appearance()
update_face() //Fixes hair not coming back after using a BLOCKHAIR mask/helmet
return
// TODO: once I have replaced the udpate_clothing() calls with update_lying() or
+17 -6
View File
@@ -712,11 +712,17 @@
increments = difference/10
var/change = increments*boost // Get the amount to change by (x per increment)
var/temp_change
if(current < loc_temp)
temperature = min(loc_temp, temperature+change)
else if(current > loc_temp)
temperature = max(loc_temp, temperature-change)
temp_change = (temperature - current)
if(current < loc_temp) //If your body temp is less than loc, then try to heat up
if(istajaran(src)) //If Tajaran, you heat up faster
change = change*4
temperature = min(loc_temp, temperature+change) //Pick the minimum of these two
else if(current > loc_temp) //If your body temp is more than loc, then try to cool down
if(istajaran(src)) //If Tajaran, you cool down slower
change = change*0.5
if(mutantrace == "lizard") //If Soghun, you cool down faster
change = change*3
temperature = max(loc_temp, temperature-change) //Pick the max of these two
temp_change = (temperature - current) //Work out the actual change of temp
return temp_change
get_thermal_protection()
@@ -835,7 +841,12 @@
if (nutrition > 0 && stat != 2)
// sleeping slows the metabolism, hunger increases more slowly
if(stat == 1)
nutrition = max (0, nutrition - HUNGER_FACTOR)
if(istajaran(src)) //Tajarans get hungry slightly faster
nutrition = max (0, nutrition - HUNGER_FACTOR*1.25)
if(mutantrace == "lizard") //Soghuns get hungry much slower
nutrition = max (0, nutrition - HUNGER_FACTOR*0.5)
else
nutrition = max (0, nutrition - HUNGER_FACTOR)
else
nutrition = max (0, nutrition - HUNGER_FACTOR / 4)
+15 -2
View File
@@ -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.")
+7 -5
View File
@@ -1,8 +1,10 @@
forsamori - Tajaran
searif - Soghun
searif - Tajaran
galenus - Soghun
botanistpower - Tajaran
fenrisian - Tajaran
forsamori - Tajaran
forsamori - Soghun
forsamori - Soghun
galenus - Soghun
searif - Soghun
searif - Tajaran
searif - Skrell
+11
View File
@@ -57,10 +57,21 @@ Stuff which is in development and not yet visible to players or just code relate
should be listed in the changelog upon commit though. Thanks. -->
<!-- To take advantage of the pretty new format (well it was new when I wrote this anyway), open the "add-to-changelog.html" file in any browser and add the stuff and then generate the html code and paste it here -->
<div class="commit sansserif">
<h2 class="date">07 June 2012</h2>
<h3 class="author">SkyMarshal updated:</h3>
<ul class="changes bgimages16">
<li class="bugfix">ZAS now works properly. No perpetually leaking doors, no walls that hold air like a seive.</li>
<li class="experiment"><font color='red'><b>ZAS airflow is now enabled</b>, and will move objects (AND PEOPLE!) when air moves with enough force. <b>AIRLOCKS ARE NOW DEADLY DANGEROUS!<b></font></li>
<li class="rscadd">Packages will now reflect the size of what they contain</li>
</ul>
</div>
<div class="commit sansserif">
<h2 class="date">06 June 2012</h2>
<h3 class="author">Erthilo updated:</h3>
<ul class="changes bgimages16">
<li class="tweak">Tajaran's are more vulnerable to high temperatures and get hungry faster, but deal well with colder temperatures. Soghun's are more susceptible to cold temperatures, but get hungry much slower.</li>
<li class="rscadd">Skrell update! Adds Skrell as a whitelisted race. They have their own language which can be used by typing :k</li>
<li class="rscadd">Soghun get their own language by typing :o</li>
<li class="rscadd">Skintone and eye colour of most species can now be changed, The preview picture should be a fairly accurate representation of what you'll get in-game.</li>
Binary file not shown.

Before

Width:  |  Height:  |  Size: 50 KiB

After

Width:  |  Height:  |  Size: 51 KiB

+8412 -8414
View File
File diff suppressed because it is too large Load Diff