Merge branch 'bleeding-edge-freeze' of https://github.com/Baystation12/Baystation12

This commit is contained in:
meyar
2013-05-24 06:52:03 -04:00
41 changed files with 802 additions and 12545 deletions
+175 -180
View File
@@ -130,207 +130,202 @@
desc = "a mysterious and ancient piece of machinery"
var/list/animal_spawners = list()
New()
..()
Initialise()
/obj/machinery/jungle_controller/proc/Initialise()
set background = 1
spawn(0)
world << "\red \b Setting up jungle, this may take a moment..."
/obj/machinery/jungle_controller/initialize()
world << "\red \b Setting up jungle, this may take a bleeding eternity..."
//crash dat shuttle
var/area/start_location = locate(/area/jungle/crash_ship_source)
var/area/clean_location = locate(/area/jungle/crash_ship_clean)
var/list/ship_locations = list(/area/jungle/crash_ship_one, /area/jungle/crash_ship_two, /area/jungle/crash_ship_three, /area/jungle/crash_ship_four)
var/area/end_location = locate( pick(ship_locations) )
ship_locations -= end_location.type
//crash dat shuttle
var/area/start_location = locate(/area/jungle/crash_ship_source)
var/area/clean_location = locate(/area/jungle/crash_ship_clean)
var/list/ship_locations = list(/area/jungle/crash_ship_one, /area/jungle/crash_ship_two, /area/jungle/crash_ship_three, /area/jungle/crash_ship_four)
var/area/end_location = locate( pick(ship_locations) )
ship_locations -= end_location.type
start_location.move_contents_to(end_location)
for(var/area_type in ship_locations)
var/area/cur_location = locate(area_type)
clean_location.copy_turfs_to(cur_location)
start_location.move_contents_to(end_location)
for(var/area_type in ship_locations)
var/area/cur_location = locate(area_type)
clean_location.copy_turfs_to(cur_location)
//drop some random river nodes
var/list/river_nodes = list()
var/max = rand(1,3)
var/num_spawned = 0
while(num_spawned < max)
var/turf/unsimulated/jungle/J = locate(rand(RANDOM_LOWER_X, RANDOM_UPPER_X), rand(RANDOM_LOWER_Y, RANDOM_UPPER_Y), src.z)
if(!istype(J))
continue
if(!J.bushes_spawn)
continue
river_nodes.Add(new /obj/effect/landmark/river_waypoint(J))
num_spawned++
//drop some random river nodes
var/list/river_nodes = list()
var/max = rand(1,3)
var/num_spawned = 0
while(num_spawned < max)
var/turf/unsimulated/jungle/J = locate(rand(RANDOM_LOWER_X, RANDOM_UPPER_X), rand(RANDOM_LOWER_Y, RANDOM_UPPER_Y), src.z)
if(!istype(J))
continue
if(!J.bushes_spawn)
continue
river_nodes.Add(new /obj/effect/landmark/river_waypoint(J))
num_spawned++
//make some randomly pathing rivers
for(var/obj/effect/landmark/river_waypoint/W in world)
if (W.z != src.z || W.connected)
continue
//make some randomly pathing rivers
for(var/obj/effect/landmark/river_waypoint/W in world)
if (W.z != src.z || W.connected)
continue
W.connected = 1
var/turf/cur_turf = new /turf/unsimulated/jungle/water(get_turf(W))
var/turf/target_turf = get_turf(pick(river_nodes))
W.connected = 1
var/turf/cur_turf = new /turf/unsimulated/jungle/water(get_turf(W))
var/turf/target_turf = get_turf(pick(river_nodes))
var/detouring = 0
var/cur_dir = get_dir(cur_turf, target_turf)
//
while(cur_turf != target_turf)
//randomly snake around a bit
if(detouring)
if(prob(20))
detouring = 0
cur_dir = get_dir(cur_turf, target_turf)
else if(prob(20))
detouring = 1
if(prob(50))
cur_dir = turn(cur_dir, 45)
else
cur_dir = turn(cur_dir, -45)
else
cur_dir = get_dir(cur_turf, target_turf)
cur_turf = get_step(cur_turf, cur_dir)
var/skip = 0
if(!istype(cur_turf, /turf/unsimulated/jungle) || istype(cur_turf, /turf/unsimulated/jungle/rock))
var/detouring = 0
var/cur_dir = get_dir(cur_turf, target_turf)
//
while(cur_turf != target_turf)
//randomly snake around a bit
if(detouring)
if(prob(20))
detouring = 0
cur_dir = get_dir(cur_turf, target_turf)
cur_turf = get_step(cur_turf, cur_dir)
continue
if(!skip)
var/turf/unsimulated/jungle/water/water_turf = new(cur_turf)
water_turf.Spread(75, rand(65, 25))
var/list/path_nodes = list()
//place some ladders leading down to pre-generated temples
max = rand(2,5)
num_spawned = 0
while(num_spawned < max)
var/turf/unsimulated/jungle/J = locate(rand(RANDOM_LOWER_X, RANDOM_UPPER_X), rand(RANDOM_LOWER_Y, RANDOM_UPPER_Y), src.z)
if(!J || !J.bushes_spawn)
continue
new /obj/effect/landmark/temple(J)
path_nodes.Add(new /obj/effect/landmark/path_waypoint(J))
num_spawned++
//put a native tribe somewhere
num_spawned = 0
while(num_spawned < 1)
var/turf/unsimulated/jungle/J = locate(rand(RANDOM_LOWER_X, RANDOM_UPPER_X), rand(RANDOM_LOWER_Y, RANDOM_UPPER_Y), src.z)
if(!J || !J.bushes_spawn)
continue
new /obj/effect/jungle_tribe_spawn(J)
path_nodes.Add(new /obj/effect/landmark/path_waypoint(J))
num_spawned++
//place some random path waypoints to confuse players
max = rand(1,3)
num_spawned = 0
while(num_spawned < max)
var/turf/unsimulated/jungle/J = locate(rand(RANDOM_LOWER_X, RANDOM_UPPER_X), rand(RANDOM_LOWER_Y, RANDOM_UPPER_Y), src.z)
if(!J || !J.bushes_spawn)
continue
path_nodes.Add(new /obj/effect/landmark/path_waypoint(J))
num_spawned++
//get any path nodes placed on the map
for(var/obj/effect/landmark/path_waypoint/W in world)
if (W.z == src.z)
path_nodes.Add(W)
//make random, connecting paths
for(var/obj/effect/landmark/path_waypoint/W in path_nodes)
if (W.connected)
continue
W.connected = 1
var/turf/cur_turf = get_turf(W)
path_nodes.Remove(W)
var/turf/target_turf = get_turf(pick(path_nodes))
path_nodes.Add(W)
//
cur_turf = new /turf/unsimulated/jungle/path(cur_turf)
var/detouring = 0
var/cur_dir = get_dir(cur_turf, target_turf)
//
while(cur_turf != target_turf)
//randomly snake around a bit
if(detouring)
if(prob(20) || get_dist(cur_turf, target_turf) < 5)
detouring = 0
cur_dir = get_dir(cur_turf, target_turf)
else if(prob(20) && get_dist(cur_turf, target_turf) > 5)
detouring = 1
if(prob(50))
cur_dir = turn(cur_dir, 45)
else
cur_dir = turn(cur_dir, -45)
else if(prob(20))
detouring = 1
if(prob(50))
cur_dir = turn(cur_dir, 45)
else
cur_dir = get_dir(cur_turf, target_turf)
cur_dir = turn(cur_dir, -45)
else
cur_dir = get_dir(cur_turf, target_turf)
//move a step forward
cur_turf = get_step(cur_turf, cur_dir)
var/skip = 0
if(!istype(cur_turf, /turf/unsimulated/jungle) || istype(cur_turf, /turf/unsimulated/jungle/rock))
detouring = 0
cur_dir = get_dir(cur_turf, target_turf)
cur_turf = get_step(cur_turf, cur_dir)
continue
//if we're not a jungle turf, get back to what we were doing
if(!istype(cur_turf, /turf/unsimulated/jungle/))
if(!skip)
var/turf/unsimulated/jungle/water/water_turf = new(cur_turf)
water_turf.Spread(75, rand(65, 25))
var/list/path_nodes = list()
//place some ladders leading down to pre-generated temples
max = rand(2,5)
num_spawned = 0
while(num_spawned < max)
var/turf/unsimulated/jungle/J = locate(rand(RANDOM_LOWER_X, RANDOM_UPPER_X), rand(RANDOM_LOWER_Y, RANDOM_UPPER_Y), src.z)
if(!J || !J.bushes_spawn)
continue
new /obj/effect/landmark/temple(J)
path_nodes.Add(new /obj/effect/landmark/path_waypoint(J))
num_spawned++
//put a native tribe somewhere
num_spawned = 0
while(num_spawned < 1)
var/turf/unsimulated/jungle/J = locate(rand(RANDOM_LOWER_X, RANDOM_UPPER_X), rand(RANDOM_LOWER_Y, RANDOM_UPPER_Y), src.z)
if(!J || !J.bushes_spawn)
continue
new /obj/effect/jungle_tribe_spawn(J)
path_nodes.Add(new /obj/effect/landmark/path_waypoint(J))
num_spawned++
//place some random path waypoints to confuse players
max = rand(1,3)
num_spawned = 0
while(num_spawned < max)
var/turf/unsimulated/jungle/J = locate(rand(RANDOM_LOWER_X, RANDOM_UPPER_X), rand(RANDOM_LOWER_Y, RANDOM_UPPER_Y), src.z)
if(!J || !J.bushes_spawn)
continue
path_nodes.Add(new /obj/effect/landmark/path_waypoint(J))
num_spawned++
//get any path nodes placed on the map
for(var/obj/effect/landmark/path_waypoint/W in world)
if (W.z == src.z)
path_nodes.Add(W)
//make random, connecting paths
for(var/obj/effect/landmark/path_waypoint/W in path_nodes)
if (W.connected)
continue
W.connected = 1
var/turf/cur_turf = get_turf(W)
path_nodes.Remove(W)
var/turf/target_turf = get_turf(pick(path_nodes))
path_nodes.Add(W)
//
cur_turf = new /turf/unsimulated/jungle/path(cur_turf)
var/detouring = 0
var/cur_dir = get_dir(cur_turf, target_turf)
//
while(cur_turf != target_turf)
//randomly snake around a bit
if(detouring)
if(prob(20) || get_dist(cur_turf, target_turf) < 5)
detouring = 0
cur_dir = get_dir(cur_turf, target_turf)
cur_turf = get_step(cur_turf, cur_dir)
continue
else if(prob(20) && get_dist(cur_turf, target_turf) > 5)
detouring = 1
if(prob(50))
cur_dir = turn(cur_dir, 45)
else
cur_dir = turn(cur_dir, -45)
else
cur_dir = get_dir(cur_turf, target_turf)
var/turf/unsimulated/jungle/J = cur_turf
if(istype(J, /turf/unsimulated/jungle/impenetrable) || istype(J, /turf/unsimulated/jungle/water/deep))
cur_dir = get_dir(cur_turf, target_turf)
cur_turf = get_step(cur_turf, cur_dir)
continue
//move a step forward
cur_turf = get_step(cur_turf, cur_dir)
if(!istype(J, /turf/unsimulated/jungle/water))
J = new /turf/unsimulated/jungle/path(cur_turf)
J.Spread(PATH_SPREAD_CHANCE_START, rand(PATH_SPREAD_CHANCE_LOSS_UPPER, PATH_SPREAD_CHANCE_LOSS_LOWER))
//create monkey spawners
num_spawned = 0
max = rand(3,6)
while(num_spawned < max)
var/turf/unsimulated/jungle/J = locate(rand(RANDOM_LOWER_X, RANDOM_UPPER_X), rand(RANDOM_LOWER_Y, RANDOM_UPPER_Y), src.z)
if(!J || !J.bushes_spawn)
//if we're not a jungle turf, get back to what we were doing
if(!istype(cur_turf, /turf/unsimulated/jungle/))
cur_dir = get_dir(cur_turf, target_turf)
cur_turf = get_step(cur_turf, cur_dir)
continue
animal_spawners.Add(new /obj/effect/landmark/animal_spawner/monkey(J))
num_spawned++
//create panther spawners
num_spawned = 0
max = rand(6,12)
while(num_spawned < max)
var/turf/unsimulated/jungle/J = locate(rand(RANDOM_LOWER_X, RANDOM_UPPER_X), rand(RANDOM_LOWER_Y, RANDOM_UPPER_Y), src.z)
if(!J || !istype(J) || !J.bushes_spawn)
var/turf/unsimulated/jungle/J = cur_turf
if(istype(J, /turf/unsimulated/jungle/impenetrable) || istype(J, /turf/unsimulated/jungle/water/deep))
cur_dir = get_dir(cur_turf, target_turf)
cur_turf = get_step(cur_turf, cur_dir)
continue
animal_spawners.Add(new /obj/effect/landmark/animal_spawner/panther(J))
num_spawned++
//create snake spawners
num_spawned = 0
max = rand(6,12)
while(num_spawned < max)
var/turf/unsimulated/jungle/J = locate(rand(RANDOM_LOWER_X, RANDOM_UPPER_X), rand(RANDOM_LOWER_Y, RANDOM_UPPER_Y), src.z)
if(!J || !istype(J) || !J.bushes_spawn)
continue
animal_spawners.Add(new /obj/effect/landmark/animal_spawner/snake(J))
num_spawned++
if(!istype(J, /turf/unsimulated/jungle/water))
J = new /turf/unsimulated/jungle/path(cur_turf)
J.Spread(PATH_SPREAD_CHANCE_START, rand(PATH_SPREAD_CHANCE_LOSS_UPPER, PATH_SPREAD_CHANCE_LOSS_LOWER))
//create parrot spawners
num_spawned = 0
max = rand(3,6)
while(num_spawned < max)
var/turf/unsimulated/jungle/J = locate(rand(RANDOM_LOWER_X, RANDOM_UPPER_X), rand(RANDOM_LOWER_Y, RANDOM_UPPER_Y), src.z)
if(!J || !istype(J) || !J.bushes_spawn)
continue
animal_spawners.Add(new /obj/effect/landmark/animal_spawner/parrot(J))
num_spawned++
//create monkey spawners
num_spawned = 0
max = rand(3,6)
while(num_spawned < max)
var/turf/unsimulated/jungle/J = locate(rand(RANDOM_LOWER_X, RANDOM_UPPER_X), rand(RANDOM_LOWER_Y, RANDOM_UPPER_Y), src.z)
if(!J || !J.bushes_spawn)
continue
animal_spawners.Add(new /obj/effect/landmark/animal_spawner/monkey(J))
num_spawned++
//create panther spawners
num_spawned = 0
max = rand(6,12)
while(num_spawned < max)
var/turf/unsimulated/jungle/J = locate(rand(RANDOM_LOWER_X, RANDOM_UPPER_X), rand(RANDOM_LOWER_Y, RANDOM_UPPER_Y), src.z)
if(!J || !istype(J) || !J.bushes_spawn)
continue
animal_spawners.Add(new /obj/effect/landmark/animal_spawner/panther(J))
num_spawned++
//create snake spawners
num_spawned = 0
max = rand(6,12)
while(num_spawned < max)
var/turf/unsimulated/jungle/J = locate(rand(RANDOM_LOWER_X, RANDOM_UPPER_X), rand(RANDOM_LOWER_Y, RANDOM_UPPER_Y), src.z)
if(!J || !istype(J) || !J.bushes_spawn)
continue
animal_spawners.Add(new /obj/effect/landmark/animal_spawner/snake(J))
num_spawned++
//create parrot spawners
num_spawned = 0
max = rand(3,6)
while(num_spawned < max)
var/turf/unsimulated/jungle/J = locate(rand(RANDOM_LOWER_X, RANDOM_UPPER_X), rand(RANDOM_LOWER_Y, RANDOM_UPPER_Y), src.z)
if(!J || !istype(J) || !J.bushes_spawn)
continue
animal_spawners.Add(new /obj/effect/landmark/animal_spawner/parrot(J))
num_spawned++
#undef PATH_SPREAD_CHANCE_START
#undef PATH_SPREAD_CHANCE_LOSS_UPPER
+209 -419
View File
@@ -21,6 +21,7 @@ connection
last_updated //The tick at which this was last updated.
no_zone_count = 0
New(turf/T,turf/O)
A = T
B = O
@@ -49,51 +50,23 @@ connection
if(A.CanPass(null, B, 0, 0))
if(!A.zone.connected_zones)
A.zone.connected_zones = list()
if(!B.zone.connected_zones)
B.zone.connected_zones = list()
if(B.zone in A.zone.connected_zones)
A.zone.connected_zones[B.zone]++
else
A.zone.connected_zones += B.zone
A.zone.connected_zones[B.zone] = 1
if(A.zone in B.zone.connected_zones)
B.zone.connected_zones[A.zone]++
else
B.zone.connected_zones += A.zone
B.zone.connected_zones[A.zone] = 1
ConnectZones(A.zone, B.zone, 1)
if(A.HasDoor(B) || B.HasDoor(A))
indirect = CONNECTION_INDIRECT
else
ConnectZones(A.zone, B.zone)
indirect = CONNECTION_CLOSED
if(!A.zone.closed_connection_zones)
A.zone.closed_connection_zones = list()
if(B.zone in A.zone.closed_connection_zones)
A.zone.closed_connection_zones[B.zone]++
else
A.zone.closed_connection_zones += B.zone
A.zone.closed_connection_zones[B.zone] = 1
if(!B.zone.closed_connection_zones)
B.zone.closed_connection_zones = list()
if(A.zone in B.zone.closed_connection_zones)
B.zone.closed_connection_zones[A.zone]++
else
B.zone.closed_connection_zones += A.zone
B.zone.closed_connection_zones[A.zone] = 1
else
world.log << "Attempted to create connection object for non-zone tiles: [T] -> [O]"
world.log << "Attempted to create connection object for non-zone tiles: [T] ([T.x],[T.y],[T.z]) -> [O] ([O.x],[O.y],[O.z])"
del(src)
Del()
//remove connections from master lists.
if(ref_B in air_master.turfs_with_connections)
var/list/connections = air_master.turfs_with_connections[ref_B]
connections.Remove(src)
@@ -102,279 +75,203 @@ connection
var/list/connections = air_master.turfs_with_connections[ref_A]
connections.Remove(src)
//Ensure we delete the right values by sanity checkign right before deletion.
Sanitize()
//Remove connection from current zones.
if(A)
if(A.zone && A.zone.connections)
A.zone.connections.Remove(src)
if(!A.zone.connections.len)
del A.zone.connections
A.zone.connections = null
if(B)
if(B.zone && B.zone.connections)
B.zone.connections.Remove(src)
if(!B.zone.connections.len)
del B.zone.connections
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
B.zone.connections = null
if(indirect != CONNECTION_CLOSED)
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]--
else
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 in A.zone.connected_zones)
if(A.zone.connected_zones[zone_B] > 1)
A.zone.connected_zones[zone_B]--
else
A.zone.connected_zones -= zone_B
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 && B.zone)
if(B.zone in zone_A.connected_zones)
if(zone_A.connected_zones[B.zone] > 1)
zone_A.connected_zones[B.zone]--
else
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 in zone_A.connected_zones)
if(zone_A.connected_zones[zone_B] > 1)
zone_A.connected_zones[zone_B]--
else
zone_A.connected_zones -= zone_B
if(zone_A.connected_zones && !zone_A.connected_zones.len)
zone_A.connected_zones = null
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]--
else
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 in B.zone.connected_zones)
if(B.zone.connected_zones[zone_A] > 1)
B.zone.connected_zones[zone_A]--
else
B.zone.connected_zones -= zone_A
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 && A.zone)
if(A.zone in zone_B.connected_zones)
if(zone_B.connected_zones[A.zone] > 1)
zone_B.connected_zones[A.zone]--
else
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 in zone_B.connected_zones)
if(zone_B.connected_zones[zone_A] > 1)
zone_B.connected_zones[zone_A]--
else
zone_B.connected_zones -= zone_A
if(zone_B.connected_zones && !zone_B.connected_zones.len)
zone_B.connected_zones = null
else
if(A && A.zone)
if(B && B.zone)
if(B.zone in A.zone.closed_connection_zones)
if(A.zone.closed_connection_zones[B.zone] > 1)
A.zone.closed_connection_zones[B.zone]--
else
A.zone.closed_connection_zones -= B.zone
if(A.zone.closed_connection_zones && !A.zone.closed_connection_zones.len)
A.zone.closed_connection_zones = null
if( zone_B && (!B.zone || zone_B != B.zone) )
if(zone_B in A.zone.closed_connection_zones)
if(A.zone.closed_connection_zones[zone_B] > 1)
A.zone.closed_connection_zones[zone_B]--
else
A.zone.closed_connection_zones -= zone_B
if(A.zone.closed_connection_zones && !A.zone.closed_connection_zones.len)
A.zone.closed_connection_zones = null
if(zone_A && (!A.zone || zone_A != A.zone))
if(B && B.zone)
if(B.zone in zone_A.closed_connection_zones)
if(zone_A.closed_connection_zones[B.zone] > 1)
zone_A.closed_connection_zones[B.zone]--
else
zone_A.closed_connection_zones -= B.zone
if(zone_A.closed_connection_zones && !zone_A.closed_connection_zones.len)
zone_A.closed_connection_zones = null
if( zone_B && (!B.zone || zone_B != B.zone) )
if(zone_B in zone_A.closed_connection_zones)
if(zone_A.closed_connection_zones[zone_B] > 1)
zone_A.closed_connection_zones[zone_B]--
else
zone_A.closed_connection_zones -= zone_B
if(zone_A.closed_connection_zones && !zone_A.closed_connection_zones.len)
zone_A.closed_connection_zones = null
if(B && B.zone)
if(A && A.zone)
if(A.zone in B.zone.closed_connection_zones)
if(B.zone.closed_connection_zones[A.zone] > 1)
B.zone.closed_connection_zones[A.zone]--
else
B.zone.closed_connection_zones -= A.zone
if(B.zone.closed_connection_zones && !B.zone.closed_connection_zones.len)
B.zone.closed_connection_zones = null
if( zone_A && (!A.zone || zone_A != A.zone) )
if(zone_A in B.zone.closed_connection_zones)
if(B.zone.closed_connection_zones[zone_A] > 1)
B.zone.closed_connection_zones[zone_A]--
else
B.zone.closed_connection_zones -= zone_A
if(B.zone.closed_connection_zones && !B.zone.closed_connection_zones.len)
B.zone.closed_connection_zones = null
if(zone_B && (!B.zone || zone_B != B.zone))
if(A && A.zone)
if(A.zone in zone_B.closed_connection_zones)
if(zone_B.closed_connection_zones[A.zone] > 1)
zone_B.closed_connection_zones[A.zone]--
else
zone_B.closed_connection_zones -= A.zone
if(zone_B.closed_connection_zones && !zone_B.closed_connection_zones.len)
zone_B.closed_connection_zones = null
if( zone_A && (!A.zone || zone_A != A.zone) )
if(zone_A in zone_B.closed_connection_zones)
if(zone_B.closed_connection_zones[zone_A] > 1)
zone_B.closed_connection_zones[zone_A]--
else
zone_B.closed_connection_zones -= zone_A
if(zone_B.closed_connection_zones && !zone_B.closed_connection_zones.len)
zone_B.closed_connection_zones = null
//Disconnect zones while handling unusual conditions.
// e.g. loss of a zone on a turf
if(A && A.zone && B && B.zone)
DisconnectZones(A.zone, B.zone)
//Finally, preform actual deletion.
. = ..()
proc/ConnectZones(var/zone/zone_1, var/zone/zone_2, open = 0)
//Sanity checking
if(!istype(zone_1) || !istype(zone_2))
return
//Handle zones connecting indirectly/directly.
if(open)
//Create the lists if necessary.
if(!zone_1.connected_zones)
zone_1.connected_zones = list()
if(!zone_2.connected_zones)
zone_2.connected_zones = list()
//Increase the number of connections between zones.
if(zone_2 in zone_1.connected_zones)
zone_1.connected_zones[zone_2]++
else
zone_1.connected_zones += zone_2
zone_1.connected_zones[zone_2] = 1
if(zone_1 in zone_2.connected_zones)
zone_2.connected_zones[zone_1]++
else
zone_2.connected_zones += zone_1
zone_2.connected_zones[zone_1] = 1
//Handle closed connections.
else
//Create the lists
if(!zone_1.closed_connection_zones)
zone_1.closed_connection_zones = list()
if(!zone_2.closed_connection_zones)
zone_2.closed_connection_zones = list()
//Increment the connections.
if(zone_2 in zone_1.closed_connection_zones)
zone_1.closed_connection_zones[zone_2]++
else
zone_1.closed_connection_zones += zone_2
zone_1.closed_connection_zones[zone_2] = 1
if(zone_1 in zone_2.closed_connection_zones)
zone_2.closed_connection_zones[zone_1]++
else
zone_2.closed_connection_zones += zone_1
zone_2.closed_connection_zones[zone_1] = 1
proc/DisconnectZones(var/zone/zone_1, var/zone/zone_2)
//Sanity checking
if(!istype(zone_1) || !istype(zone_2))
return
//Handle disconnection of indirectly or directly connected zones.
if( (zone_1 in zone_2.connected_zones) || (zone_2 in zone_1.connected_zones) )
//If there are more than one connection, decrement the number of connections
//Otherwise, remove all connections between the zones.
if(zone_1.connected_zones[zone_2] > 1)
zone_1.connected_zones[zone_2]--
else
zone_1.connected_zones -= zone_2
//remove the list if it is empty
if(!zone_1.connected_zones.len)
zone_1.connected_zones = null
//Then do the same for the other zone.
if(zone_2.connected_zones[zone_1] > 1)
zone_2.connected_zones[zone_1]--
else
zone_2.connected_zones -= zone_1
if(!zone_2.connected_zones.len)
zone_2.connected_zones = null
//Handle disconnection of closed zones.
if( (zone_1 in zone_2.closed_connection_zones) || (zone_2 in zone_1.closed_connection_zones) )
//If there are more than one connection, decrement the number of connections
//Otherwise, remove all connections between the zones.
if(zone_1.closed_connection_zones[zone_2] > 1)
zone_1.closed_connection_zones[zone_2]--
else
zone_1.closed_connection_zones -= zone_2
//remove the list if it is empty
if(!zone_1.closed_connection_zones.len)
zone_1.closed_connection_zones = null
//Then do the same for the other zone.
if(zone_2.closed_connection_zones[zone_1] > 1)
zone_2.closed_connection_zones[zone_1]--
else
zone_2.closed_connection_zones -= zone_1
if(!zone_2.closed_connection_zones.len)
zone_2.closed_connection_zones = null
proc/Cleanup()
//Check sanity: existance of turfs
if(!A || !B)
//world.log << "Connection removed: [A] or [B] missing entirely."
del src
//Check sanity: zones are different
if(A.zone == B.zone)
//world.log << "Connection removed: Zones now merged."
del src
//Check sanity: same turfs as before.
if(ref_A != "\ref[A]" || ref_B != "\ref[B]")
del src
//Handle zones changing on a turf.
if((A.zone && A.zone != zone_A) || (B.zone && B.zone != zone_B))
Sanitize()
//Manage sudden loss of a turfs zone. (e.g. a wall being built)
if(!A.zone || !B.zone)
no_zone_count++
if(no_zone_count >= 5)
//world.log << "Connection removed: [A] or [B] missing a zone."
del src
return 0
return 1
proc/CheckPassSanity()
//Sanity check, first.
Cleanup()
if(A.zone && B.zone)
//If no walls are blocking us...
if(A.ZAirPass(B))
//...we check to see if there is a door in the way...
var/door_pass = A.CanPass(null,B,1.5,1)
//...and if it is opened.
if(door_pass || A.CanPass(null,B,0,0))
//Make and remove connections to let air pass.
if(indirect == CONNECTION_CLOSED)
//ADJUST FOR CAN CONNECT
if(!A.zone.connected_zones)
A.zone.connected_zones = list()
if(B.zone in A.zone.connected_zones)
A.zone.connected_zones[B.zone]++
else
A.zone.connected_zones += B.zone
A.zone.connected_zones[B.zone] = 1
if(!B.zone.connected_zones)
B.zone.connected_zones = list()
if(A.zone in B.zone.connected_zones)
B.zone.connected_zones[A.zone]++
else
B.zone.connected_zones += A.zone
B.zone.connected_zones[A.zone] = 1
if(A.zone.closed_connection_zones)
if(A.zone.closed_connection_zones[B.zone] > 1)
A.zone.closed_connection_zones[B.zone]--
else
A.zone.closed_connection_zones.Remove(B.zone)
if(A.zone.closed_connection_zones && !A.zone.closed_connection_zones.len)
A.zone.closed_connection_zones = null
if(B.zone.closed_connection_zones)
if(B.zone.closed_connection_zones[A.zone] > 1)
B.zone.closed_connection_zones[A.zone]--
else
B.zone.closed_connection_zones.Remove(A.zone)
if(B.zone.closed_connection_zones && !B.zone.closed_connection_zones.len)
B.zone.closed_connection_zones = null
DisconnectZones(A.zone, B.zone)
ConnectZones(A.zone, B.zone, 1)
if(door_pass)
indirect = CONNECTION_DIRECT
else if(!door_pass)
indirect = CONNECTION_INDIRECT
//The door is instead closed.
else if(indirect > CONNECTION_CLOSED)
indirect = CONNECTION_CLOSED
//ADJUST FOR CANNOT CONNECT
if(A.zone.connected_zones)
if(A.zone.connected_zones[B.zone] > 1)
A.zone.connected_zones[B.zone]--
else
A.zone.connected_zones.Remove(B.zone)
if(A.zone.connected_zones && !A.zone.connected_zones.len)
A.zone.connected_zones = null
DisconnectZones(A.zone, B.zone)
ConnectZones(A.zone, B.zone)
if(B.zone.connected_zones)
if(B.zone.connected_zones[A.zone] > 1)
B.zone.connected_zones[A.zone]--
else
B.zone.connected_zones.Remove(A.zone)
if(B.zone.connected_zones && !B.zone.connected_zones.len)
B.zone.connected_zones = null
//Add to the closed connections list(s)
if(!A.zone.closed_connection_zones)
A.zone.closed_connection_zones = list()
if(B.zone in A.zone.closed_connection_zones)
A.zone.closed_connection_zones[B.zone]++
else
A.zone.closed_connection_zones += B.zone
A.zone.closed_connection_zones[B.zone] = 1
if(!B.zone.closed_connection_zones)
B.zone.closed_connection_zones = list()
if(A.zone in B.zone.closed_connection_zones)
B.zone.closed_connection_zones[A.zone]++
else
B.zone.closed_connection_zones += A.zone
B.zone.closed_connection_zones[A.zone] = 1
else //If I can no longer pass air, better delete
//If I can no longer pass air, better delete
else
del src
proc/Sanitize()
//If the zones change on connected turfs, update it.
if(A.zone && A.zone != zone_A && B.zone && B.zone != zone_B)
if(!A.zone || !B.zone)
del src
//Both zones changed (wat)
if(A.zone && A.zone != zone_A && B.zone && B.zone != zone_B)
//If the zones have gotten swapped
// (do not ask me how, I am just being anal retentive about sanity)
if(A.zone == zone_B && B.zone == zone_A)
var/turf/temp = B
B = A
@@ -386,208 +283,101 @@ connection
ref_B = temp_ref
return
if(zone_A)
if(zone_A.connections)
zone_A.connections.Remove(src)
if(!zone_A.connections.len)
del zone_A.connections
//Handle removal of connections from archived zones.
if(zone_A && zone_A.connections)
zone_A.connections.Remove(src)
if(!zone_A.connections.len)
zone_A.connections = null
if(indirect != CONNECTION_CLOSED)
if(zone_A.connected_zones)
if(zone_A.connected_zones[zone_B] > 1)
zone_A.connected_zones[zone_B]--
else
zone_A.connected_zones.Remove(zone_B)
if(zone_A.connected_zones && !zone_A.connected_zones.len)
zone_A.connected_zones = null
if(zone_B && zone_B.connections)
zone_B.connections.Remove(src)
if(!zone_B.connections.len)
zone_B.connections = null
else
if(zone_A.closed_connection_zones)
if(zone_A.closed_connection_zones[zone_B] > 1)
zone_A.closed_connection_zones[zone_B]--
else
zone_A.closed_connection_zones.Remove(zone_B)
if(zone_A.closed_connection_zones && !zone_A.closed_connection_zones.len)
zone_A.closed_connection_zones = null
if(zone_B)
if(zone_B.connections)
zone_B.connections.Remove(src)
if(!zone_B.connections.len)
del zone_B.connections
if(indirect != CONNECTION_CLOSED)
if(zone_B.connected_zones)
if(zone_B.connected_zones[zone_A] > 1)
zone_B.connected_zones[zone_A]--
else
zone_B.connected_zones.Remove(zone_A)
if(zone_B.connected_zones && !zone_B.connected_zones.len)
zone_B.connected_zones = null
else
if(zone_B.closed_connection_zones)
if(zone_B.closed_connection_zones[zone_A] > 1)
zone_B.closed_connection_zones[zone_A]--
else
zone_B.closed_connection_zones.Remove(zone_A)
if(zone_B.closed_connection_zones && !zone_B.closed_connection_zones.len)
zone_B.closed_connection_zones = null
if(indirect != CONNECTION_CLOSED)
if(A.zone)
if(!A.zone.connections)
A.zone.connections = list()
A.zone.connections |= src
if(B.zone)
if(!B.zone.connections)
B.zone.connections = list()
B.zone.connections |= src
if(!A.zone.connected_zones)
A.zone.connected_zones = list()
if(B.zone in A.zone.connected_zones)
A.zone.connected_zones[B.zone]++
else
A.zone.connected_zones += B.zone
A.zone.connected_zones[B.zone] = 1
//If either zone is null, we disconnect the archived ones after cleaning up the connections.
if(!A.zone || !B.zone)
if(zone_A && zone_B)
DisconnectZones(zone_B, zone_A)
if(!B.zone.connected_zones)
B.zone.connected_zones = list()
if(A.zone in B.zone.connected_zones)
B.zone.connected_zones[A.zone]++
else
B.zone.connected_zones += A.zone
B.zone.connected_zones[A.zone] = 1
if(!A.zone)
zone_A = A.zone
else
if(!B.zone)
zone_B = B.zone
return
if(!A.zone.connections)
A.zone.connections = list()
A.zone.connections |= src
if(!B.zone.connections)
B.zone.connections = list()
B.zone.connections |= src
if(!A.zone.closed_connection_zones)
A.zone.closed_connection_zones = list()
if(B.zone in A.zone.closed_connection_zones)
A.zone.closed_connection_zones[B.zone]++
else
A.zone.closed_connection_zones += B.zone
A.zone.closed_connection_zones[B.zone] = 1
if(!B.zone.closed_connection_zones)
B.zone.closed_connection_zones = list()
if(A.zone in B.zone.closed_connection_zones)
B.zone.closed_connection_zones[A.zone]++
else
B.zone.closed_connection_zones += A.zone
B.zone.closed_connection_zones[A.zone] = 1
//Handle diconnection and reconnection of zones.
if(zone_A && zone_B)
DisconnectZones(zone_A, zone_B)
ConnectZones(A.zone, B.zone, indirect)
//resetting values of archived values.
zone_B = B.zone
zone_A = A.zone
//The "A" zone changed.
else if(A.zone && A.zone != zone_A)
if(zone_A)
//Handle connection cleanup
if(zone_A)
if(zone_A.connections)
zone_A.connections.Remove(src)
if(!zone_A.connections.len)
del zone_A.connections
zone_A.connections = null
if(A.zone)
if(!A.zone.connections)
A.zone.connections = list()
A.zone.connections |= src
if(indirect != CONNECTION_CLOSED)
if(zone_A.connected_zones)
if(zone_A.connected_zones[zone_B] > 1)
zone_A.connected_zones[zone_B]--
else
zone_A.connected_zones.Remove(zone_B)
if(zone_A.connected_zones && !zone_A.connected_zones.len)
zone_A.connected_zones = null
if(!A.zone.connected_zones)
A.zone.connected_zones = list()
if(!(zone_B in A.zone.connected_zones))
A.zone.connected_zones += zone_B
A.zone.connected_zones[zone_B] = 1
else
A.zone.connected_zones[zone_B]++
else
if(zone_A.closed_connection_zones)
if(zone_A.closed_connection_zones[zone_B] > 1)
zone_A.closed_connection_zones[zone_B]--
else
zone_A.closed_connection_zones.Remove(zone_B)
if(zone_A.closed_connection_zones && !zone_A.closed_connection_zones.len)
zone_A.closed_connection_zones = null
if(!A.zone.closed_connection_zones)
A.zone.closed_connection_zones = list()
if(!(zone_B in A.zone.closed_connection_zones))
A.zone.closed_connection_zones += zone_B
A.zone.closed_connection_zones[zone_B] = 1
else
A.zone.closed_connection_zones[zone_B]++
//If the "A" zone is null, we disconnect the archived ones after cleaning up the connections.
if(!A.zone)
if(zone_A && zone_B)
DisconnectZones(zone_A, zone_B)
zone_A = A.zone
return
else
del src
//Handle diconnection and reconnection of zones.
if(zone_A && zone_B)
DisconnectZones(zone_A, zone_B)
ConnectZones(A.zone, B.zone, indirect)
//The "B" zone changed.
else if(B.zone && B.zone != zone_B)
if(zone_B)
//Handle connection cleanup
if(zone_B)
if(zone_B.connections)
zone_B.connections.Remove(src)
if(!zone_B.connections.len)
del zone_B.connections
zone_B.connections = null
if(B.zone)
if(!B.zone.connections)
B.zone.connections = list()
B.zone.connections |= src
if(indirect != CONNECTION_CLOSED)
if(zone_B.connected_zones)
if(zone_B.connected_zones[zone_A] > 1)
zone_B.connected_zones[zone_A]--
else
zone_B.connected_zones.Remove(zone_A)
if(zone_B.connected_zones && !zone_B.connected_zones.len)
zone_B.connected_zones = null
if(!B.zone.connected_zones)
B.zone.connected_zones = list()
if(!(zone_A in B.zone.connected_zones))
B.zone.connected_zones += zone_A
B.zone.connected_zones[zone_A] = 1
else
B.zone.connected_zones[zone_A]++
else
if(zone_B.closed_connection_zones)
if(zone_B.closed_connection_zones[zone_A] > 1)
zone_B.closed_connection_zones[zone_A]--
else
zone_B.closed_connection_zones.Remove(zone_A)
if(zone_B.closed_connection_zones && !zone_B.closed_connection_zones.len)
zone_B.closed_connection_zones = null
if(!B.zone.closed_connection_zones)
B.zone.closed_connection_zones = list()
if(!(zone_A in B.zone.closed_connection_zones))
B.zone.closed_connection_zones += zone_A
B.zone.closed_connection_zones[zone_A] = 1
else
B.zone.closed_connection_zones[zone_A]++
//If the "B" zone is null, we disconnect the archived ones after cleaning up the connections.
if(!B.zone)
if(zone_A && zone_B)
DisconnectZones(zone_A, zone_B)
zone_B = B.zone
return
else
del src
//Handle diconnection and reconnection of zones.
if(zone_A && zone_B)
DisconnectZones(zone_A, zone_B)
ConnectZones(A.zone, B.zone, indirect)
#undef CONNECTION_DIRECT
+2 -5
View File
@@ -40,7 +40,7 @@ client/proc/Test_ZAS_Connection(var/turf/simulated/T as turf)
if(!istype(other_turf))
return
var/pass_directions = T.CanPass(null, other_turf, 0, 0) + 2*other_turf.CanPass(null, T, 0, 0)
var/pass_directions = T.CanPass(null, other_turf, 0, 0) + 2 * other_turf.CanPass(null, T, 0, 0)
switch(pass_directions)
if(0)
@@ -80,12 +80,9 @@ zone/proc
M << "<u>Connections: [length(connections)]</u>"
for(var/connection/C in connections)
M << "[C.A] --> [C.B] [(C.indirect?"Indirect":"Direct")]"
M << "[C.A] --> [C.B] [(C.indirect?"Open":"Closed")]"
C.A.overlays += 'debug_connect.dmi'
C.B.overlays += 'debug_connect.dmi'
spawn(50)
C.A.overlays -= 'debug_connect.dmi'
C.B.overlays -= 'debug_connect.dmi'
for(var/C in connections)
if(!istype(C,/connection))
M << "[C] (Not Connection!)"
+18 -178
View File
@@ -101,12 +101,10 @@ datum
//Geometry updates lists
var/list/tiles_to_update = list()
var/list/connections_to_check = list()
var/list/rebuilds_to_consider = list()
var/current_cycle = 0
var/update_delay = 5 //How long between check should it try to process atmos again.
var/failed_ticks = 0 //How many ticks have runtimed?
var/next_stat_check = 10
var/tick_progress = 0
@@ -137,7 +135,10 @@ datum
var/start_time = world.timeofday
var/simulated_turf_count = 0
for(var/turf/simulated/S in world)
simulated_turf_count++
if(!S.zone && !S.blocks_air)
if(S.CanPass(null, S, 0, 0))
new/zone(S)
@@ -145,8 +146,12 @@ datum
for(var/turf/simulated/S in world)
S.update_air_properties()
world << "\red \b Geometry processed in [time2text(world.timeofday-start_time, "mm:ss")] minutes!"
// spawn start()
world << {"<font color='red'><b>Geometry initialized in [round(0.1*(world.timeofday-start_time),0.1)] seconds.</b>
Total Simulated Turfs: [simulated_turf_count]
Total Zones: [zones.len]
Total Unsimulated Turfs: [world.maxx*world.maxy*world.maxz - simulated_turf_count]</font>"}
/*
spawn start()
proc/start()
//Purpose: This is kicked off by the master controller, and controls the processing of all atmosphere.
@@ -154,7 +159,7 @@ datum
//Inputs: None.
//Outputs: None.
/*
set background = 1
while(1)
@@ -172,55 +177,30 @@ datum
proc/tick()
. = 1 //Set the default return value, for runtime detection.
tick_progress = "next_stat_check (atmos statistics)"
if(current_cycle >= next_stat_check)
var/zone/z = pick(zones)
var/log_file = file("[time2text(world.timeofday, "statistics/DD-MM-YYYY-air.txt")]")
log_file << "\"\The [get_area(pick(z.contents))]\",[z.air.oxygen],[z.air.nitrogen],[z.air.carbon_dioxide],[z.air.toxins],[z.air.temperature],[z.air.group_multiplier * z.air.volume]"
next_stat_check = current_cycle + (rand(5,7)*60)
tick_progress = "update_air_properties"
if(tiles_to_update.len) //If there are tiles to update, do so.
for(var/turf/simulated/T in tiles_to_update)
var/output = T.update_air_properties()
if(. && T && !output)
if(. && T && !T.update_air_properties())
. = 0 //If a runtime occured, make sure we can sense it.
//message_admins("ZASALERT: Unable run turf/simualted/update_air_properties()")
tiles_to_update = list()
tick_progress = "reconsider_zones"
if(rebuilds_to_consider.len)
for(var/turf/T in rebuilds_to_consider)
if(istype(T, /turf/simulated) && T.zone && !T.zone.rebuild)
var/turf/simulated/other_turf = rebuilds_to_consider[T]
if(istype(other_turf))
ConsiderRebuild(T,other_turf)
else if(istype(other_turf, /list))
var/list/temp_turfs = other_turf
for(var/turf/NT in temp_turfs)
ConsiderRebuild(T,NT)
else if (istype(T))
var/turf/simulated/other_turf = rebuilds_to_consider[T]
if(istype(other_turf))
ConsiderRebuild(other_turf,T)
else if(istype(other_turf, /list))
var/list/temp_turfs = other_turf
for(var/turf/simulated/NT in temp_turfs)
ConsiderRebuild(NT,T)
rebuilds_to_consider = list()
//Check sanity on connection objects.
tick_progress = "connections_to_check"
if(connections_to_check.len)
for(var/connection/C in connections_to_check)
C.CheckPassSanity()
connections_to_check = list()
//Ensure tiles still have zones.
tick_progress = "tiles_to_reconsider_zones"
if(tiles_to_reconsider_zones.len)
for(var/turf/simulated/T in tiles_to_reconsider_zones)
if(!T.zone)
new /zone(T)
tiles_to_reconsider_zones = list()
//Process zones.
tick_progress = "zone/process()"
for(var/zone/Z in zones)
if(Z.last_update < current_cycle)
@@ -229,150 +209,10 @@ datum
Z.last_update = current_cycle
if(. && Z && !output)
. = 0
log_admin("ZASALERT: unable run zone/process(), [Z.progress]")
message_admins("ZASALERT. ZASALERT: unable run zone/proc/process(), [Z.progress], tell someone about this!")
//Process fires.
tick_progress = "active_hotspots (fire)"
for(var/obj/fire/F in active_hotspots)
var/output = F.process()
if(. && F && !output)
if(. && F && !F.process())
. = 0
//message_admins("ZASALERT: Unable run obj/fire/process()")
tick_progress = "success"
proc/AddToConsiderRebuild(var/turf/simulated/T, var/turf/NT)
var/turf/existing_test = rebuilds_to_consider[T]
var/turf/existing_test_alternate = rebuilds_to_consider[NT]
if(existing_test)
if(NT == existing_test)
return
else if(islist(existing_test) && existing_test[NT])
return
else if(existing_test_alternate)
if(T == existing_test_alternate)
return
else if(islist(existing_test_alternate) && existing_test_alternate[T])
return
if(istype(T))
if(istype(existing_test))
var/list/temp_list = list(NT = 1, existing_test = 1)
rebuilds_to_consider[T] = temp_list
else if(istype(existing_test, /list))
existing_test[NT] = 1
else
rebuilds_to_consider[T] = NT
else if(istype(NT, /turf/simulated))
if(istype(existing_test_alternate))
var/list/temp_list = list(T = 1, existing_test_alternate = 1)
rebuilds_to_consider[NT] = temp_list
else if(istype(existing_test_alternate, /list))
existing_test_alternate[T] = 1
else
rebuilds_to_consider[NT] = T
proc/ConsiderRebuild(var/turf/simulated/T, var/turf/NT)
if(!istype(T)) return
//zones should naturally spread to these tiles eventually
if(!T.zone || !NT.zone)
return
if(istype(NT, /turf/simulated) && NT.zone != T.zone)
T.zone.RemoveTurf(NT)
if(NT.zone)
NT.zone.RemoveTurf(T)
return
if(T.zone.rebuild)
return
var/zone/zone = T.zone
var/target_dir = get_dir(T, NT)
if(target_dir in list(NORTHEAST, NORTHWEST, SOUTHEAST, SOUTHWEST))
T.zone.rebuild = 1
return
var/test_dir = turn(target_dir, 90)
var/turf/simulated/current = T
var/turf/simulated/next
var/stepped_back = 0
if( !(T.air_check_directions&test_dir || T.air_check_directions&turn(target_dir, 270)) )
//Step back, then try to connect.
if(!(T.air_check_directions&get_dir(NT, T)))
zone.rebuild = 1
return
current = get_step(T, get_dir(NT, T))
if(!istype(current) || !(current.air_check_directions&test_dir || current.air_check_directions&turn(target_dir, 270)) )
zone.rebuild = 1
return
stepped_back = 1
if ( !(current.air_check_directions&test_dir) && current.air_check_directions&turn(target_dir, 270) )
//Try to connect to the right hand side.
var/flipped = 0
test_dir = turn(target_dir, 270)
for(var/i = 1, i <= 10, i++)
if(get_dir(current, NT) in cardinal)
target_dir = get_dir(current, NT)
if(!istype(current) || !(current.air_check_directions&target_dir || current.air_check_directions&test_dir))
if(flipped)
zone.rebuild = 1
return
current = T
test_dir = turn(target_dir, 180)
i = 0
target_dir = get_dir(current, NT)
flipped = 1
continue
if(current.air_check_directions&target_dir && !stepped_back)
next = get_step(current, target_dir)
if(!next.HasDoor())
current = next
if(current.air_check_directions&test_dir && current != next)
next = get_step(current, test_dir)
if(!next.HasDoor())
current = next
if(current == NT)
return //We made it, yaaay~
stepped_back = 0
zone.rebuild = 1
else if ( current.air_check_directions&test_dir )
//Try to connect to the left hand side.
for(var/i = 1, i <= 10, i++)
if(get_dir(current, NT) in cardinal)
target_dir = get_dir(current, NT)
if(!istype(current) || !(current.air_check_directions&target_dir || current.air_check_directions&test_dir))
zone.rebuild = 1
return
if(current.air_check_directions&target_dir && !stepped_back)
next = get_step(current, target_dir)
if(!next.HasDoor())
current = next
if(current.air_check_directions&test_dir && current != next)
next = get_step(current, test_dir)
if(!next.HasDoor())
current = next
if(current == NT)
return //We made it, yaaay~
stepped_back = 0
zone.rebuild = 1
else
//FUCK IT
zone.rebuild = 1
tick_progress = "success"
+38 -108
View File
@@ -1,35 +1,44 @@
//Global Functions
//Contents: FloodFill, ZMerge, ZConnect
//Floods outward from an initial turf to fill everywhere it's zone would reach.
proc/FloodFill(turf/simulated/start)
if(!istype(start))
return list()
var
list
open = list(start)
closed = list()
//The list of tiles waiting to be evaulated.
var/list/open = list(start)
//The list of tiles which have been evaulated.
var/list/closed = list()
//Loop through the turfs in the open list in order to find which adjacent turfs should be added to the zone.
while(open.len)
var/turf/simulated/T = pick(open)
//sanity!
if(!istype(T))
open -= T
continue
//Check all cardinal directions
for(var/d in cardinal)
var/turf/simulated/O = get_step(T,d)
//Ensure the turf is of proper type, that it is not in either list, and that air can reach it.
if(istype(O) && !(O in open) && !(O in closed) && O.ZCanPass(T))
//Handle connections from a tile with a door.
if(T.HasDoor())
//If they both have doors, then they are nto able to connect period.
//If they both have doors, then they are not able to connect period.
if(O.HasDoor())
continue
//connect first to north and west
//Connect first to north and west
if(d == NORTH || d == WEST)
open += O
//If that fails, and north/west cannot be connected to, see if west or south can be connected instead.
else
var/turf/simulated/W = get_step(O, WEST)
var/turf/simulated/N = get_step(O, NORTH)
@@ -38,9 +47,11 @@ proc/FloodFill(turf/simulated/start)
//If it cannot connect either to the north or west, connect it!
open += O
//If no doors are involved, add it immediately.
else if(!O.HasDoor())
open += O
//Handle connecting to a tile with a door.
else
if(d == SOUTH || d == EAST)
//doors prefer connecting to zones to the north or west
@@ -56,23 +67,25 @@ proc/FloodFill(turf/simulated/start)
//If it cannot connect either to the north or west, connect it!
closed += O
//This tile is now evaluated, and can be moved to the list of evaluated tiles.
open -= T
closed += T
return closed
//Procedure to merge two zones together.
proc/ZMerge(zone/A,zone/B)
//Sanity~
if(!istype(A) || !istype(B))
return
//Merges two zones so that they are one.
var
a_size = A.air.group_multiplier
b_size = B.air.group_multiplier
c_size = a_size + b_size
new_contents = A.contents + B.contents
var/a_size = A.air.group_multiplier
var/b_size = B.air.group_multiplier
var/c_size = a_size + b_size
var/new_contents = A.contents + B.contents
//Set air multipliers to one so air represents gas per tile.
A.air.group_multiplier = 1
@@ -86,33 +99,28 @@ proc/ZMerge(zone/A,zone/B)
A.air.merge(B.air)
A.air.group_multiplier = c_size
//Check for connections to merge into the new zone.
for(var/connection/C in B.connections)
if((C.A in new_contents) && (C.B in new_contents))
del C
continue
if(!A.connections) A.connections = list()
A.connections += C
//Add space tiles.
A.unsimulated_tiles += B.unsimulated_tiles
//Add contents.
A.contents = new_contents
//Set all the zone vars.
for(var/turf/simulated/T in B.contents)
T.zone = A
for(var/connection/C in A.connections)
//Check for connections to merge into the new zone.
for(var/connection/C in B.connections)
//The Cleanup proc will delete the connection if the zones are the same.
// It will also set the zone variables correctly.
C.Cleanup()
//Add space tiles.
A.unsimulated_tiles |= B.unsimulated_tiles
//Add contents.
A.contents = new_contents
//Remove the "B" zone, finally.
B.SoftDelete()
//Connects two zones by forming a connection object representing turfs A and B.
proc/ZConnect(turf/simulated/A,turf/simulated/B)
//Connects two zones by forming a connection object representing turfs A and B.
//Make sure that if it's space, it gets added to unsimulated_tiles instead.
if(!istype(B))
@@ -141,83 +149,5 @@ proc/ZConnect(turf/simulated/A,turf/simulated/B)
if(C && (C.B == B || C.A == B))
return
new /connection(A,B)
/*
proc/ZDisconnect(turf/A,turf/B)
//Removes a zone connection. Can split zones in the case of a permanent barrier.
//If one of them doesn't have a zone, it might be space, so check for that.
if(A.zone && B.zone)
//If the two zones are different, just remove a connection.
if(A.zone != B.zone)
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.
if(A == B) return
if(A.CanPass(0,B,0,0)) return
if(A.HasDoor(B) || B.HasDoor(A)) return
//Do a test fill. If turf B is still in the floodfill, then the zone isn't really split.
var/zone/oldzone = A.zone
var/list/test = FloodFill(A)
if(B in test) return
else
var/zone/Z = new(test,oldzone.air) //Create a new zone based on the old air and the test fill.
//Add connections from the old zone.
for(var/connection/C in oldzone.connections)
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)
T.check_for_space()
//Make a new, identical air mixture for the other zone.
var/datum/gas_mixture/Y_Air = new
Y_Air.copy_from(oldzone.air)
var/zone/Y = new(B,Y_Air) //Make a new zone starting at B and using Y_Air.
//Add relevant connections from old zone.
for(var/connection/C in oldzone.connections)
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.unsimulated_tiles)
if(!(T in Z.unsimulated_tiles))
Y.AddSpace(T)
oldzone.air = null
del oldzone
else
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()*/
//Make the connection.
new /connection(A,B)
+3 -2
View File
@@ -68,8 +68,9 @@ obj/item/proc
if(!pl_head_protected())
if(prob(1)) suit_contamination() //Plasma can sometimes get through such an open suit.
if(istype(back,/obj/item/weapon/storage/backpack))
back.contaminate()
//Cannot wash backpacks currently.
// if(istype(back,/obj/item/weapon/storage/backpack))
// back.contaminate()
/mob/proc/pl_effects()
+59 -29
View File
@@ -165,27 +165,32 @@ turf
if(!zone) //Still no zone, the floodfill determined it is not part of a larger zone. Force a zone on it.
new/zone(list(src))
if("\ref[src]" in air_master.turfs_with_connections) //Check pass sanity of the connections.
//Check pass sanity of the connections.
if("\ref[src]" in air_master.turfs_with_connections)
for(var/connection/C in air_master.turfs_with_connections["\ref[src]"])
if(!(C in air_master.connections_to_check))
air_master.connections_to_check += C
air_master.connections_to_check |= C
if(zone && !zone.rebuild)
for(var/direction in cardinal)
if(zone.rebuild)
break
var/turf/T = get_step(src,direction)
if(!istype(T))
continue
// var/list/zone/adjacent_zones = list()
if(air_check_directions&direction) //I can connect air in this direction
if(!CanPass(null, T, 0, 0)) //If either block air, we must look to see if the adjacent turfs need rebuilt.
if(!T.CanPass(null, T, 0, 0)) //Target blocks air
//I can connect to air in this direction
if(air_check_directions&direction)
//If either block air, we must look to see if the adjacent turfs need rebuilt.
if(!CanPass(null, T, 0, 0))
//Target blocks air
if(!T.CanPass(null, T, 0, 0))
var/turf/NT = get_step(T, direction)
//If that turf is in my zone still, rebuild.
if(istype(NT,/turf/simulated) && NT in zone.contents)
air_master.AddToConsiderRebuild(src,NT)
zone.rebuild = 1
//If that is an unsimulated tile in my zone, see if we need to rebuild or just remove.
else if(istype(NT) && NT in zone.unsimulated_tiles)
var/consider_rebuild = 0
for(var/d in cardinal)
@@ -194,17 +199,22 @@ turf
consider_rebuild = 1
break
if(consider_rebuild)
air_master.AddToConsiderRebuild(src,NT) //Gotta check if we need to rebuild, dammit
zone.rebuild = 1 //Gotta check if we need to rebuild, dammit
else
zone.RemoveTurf(NT) //Not adjacent to anything, and unsimulated. Goodbye~
//To make a closed connection through closed door.
ZConnect(T, src)
if(T.zone && !T.zone.rebuild) //I block air.
//If I block air.
else if(T.zone && !T.zone.rebuild)
var/turf/NT = get_step(src, reverse_direction(direction))
//If I am splitting a zone, rebuild.
if(istype(NT,/turf/simulated) && (NT in T.zone.contents || (NT.zone && T in NT.zone.contents)))
air_master.AddToConsiderRebuild(T,NT)
T.zone.rebuild = 1
//If NT is unsimulated, parse if I should remove it or rebuild.
else if(istype(NT) && NT in T.zone.unsimulated_tiles)
var/consider_rebuild = 0
for(var/d in cardinal)
@@ -212,30 +222,48 @@ turf
if(istype(UT, /turf/simulated) && UT.zone == T.zone && UT.CanPass(null, NT, 0, 0)) //If we find a neighboring tile that is in the same zone, check if we need to rebuild
consider_rebuild = 1
break
//Needs rebuilt.
if(consider_rebuild)
air_master.AddToConsiderRebuild(T,NT) //Gotta check if we need to rebuild, dammit
T.zone.rebuild = 1
//Not adjacent to anything, and unsimulated. Goodbye~
else
T.zone.RemoveTurf(NT) //Not adjacent to anything, and unsimulated. Goodbye~
T.zone.RemoveTurf(NT)
else
//Produce connection through open door.
ZConnect(src,T)
else if(air_directions_archived&direction) //Something like a wall was built, changing the geometry.
//Something like a wall was built, changing the geometry.
else if(air_directions_archived&direction)
var/turf/NT = get_step(T, direction)
if(istype(NT,/turf/simulated) && NT in zone.contents)
air_master.AddToConsiderRebuild(src,NT)
else if(istype(NT) && NT in zone.unsimulated_tiles) //Parse if we need to remove the tile, or rebuild the zone.
//If the tile is in our own zone, and we cannot connect to it, better rebuild.
if(istype(NT,/turf/simulated) && NT in zone.contents)
zone.rebuild = 1
//Parse if we need to remove the tile, or rebuild the zone.
else if(istype(NT) && NT in zone.unsimulated_tiles)
var/consider_rebuild = 0
//Loop through all neighboring turfs to see if we should remove the turf or just rebuild.
for(var/d in cardinal)
var/turf/UT = get_step(NT,d)
if(istype(UT, /turf/simulated) && UT.zone == zone && UT.CanPass(null, NT, 0, 0)) //If we find a neighboring tile that is in the same zone, check if we need to rebuild
//If we find a neighboring tile that is in the same zone, rebuild
if(istype(UT, /turf/simulated) && UT.zone == zone && UT.CanPass(null, NT, 0, 0))
consider_rebuild = 1
break
//The unsimulated turf is adjacent to another one of our zone's turfs,
// better rebuild to be sure we didn't get cut in twain
if(consider_rebuild)
air_master.AddToConsiderRebuild(src,NT) //Gotta check if we need to rebuild, dammit
NT.zone.rebuild = 1
//Not adjacent to anything, and unsimulated. Goodbye~
else
zone.RemoveTurf(NT) //Not adjacent to anything, and unsimulated. Goodbye~
zone.RemoveTurf(NT)
if(air_check_directions)
processing = 1
@@ -254,8 +282,10 @@ turf
if(isnum(O) && O)
if(!D.density) continue
if(istype(D,/obj/machinery/door/window))
if(!O) continue
if(D.dir == get_dir(D,O)) return 1
if(!istype(O))
continue
if(D.dir == get_dir(D,O))
return 1
else
return 1
@@ -271,13 +301,13 @@ turf/proc/ZCanPass(turf/simulated/T, var/include_space = 0)
return 0
for(var/obj/obstacle in src)
if(istype(obstacle,/obj/machinery/door) && !istype(obstacle,/obj/machinery/door/window))
if(istype(obstacle, /obj/machinery/door) && !obstacle:air_properties_vary_with_direction)
continue
if(!obstacle.CanPass(null, T, 1.5, 1))
return 0
for(var/obj/obstacle in T)
if(istype(obstacle,/obj/machinery/door) && !istype(obstacle,/obj/machinery/door/window))
if(istype(obstacle, /obj/machinery/door) && !obstacle:air_properties_vary_with_direction)
continue
if(!obstacle.CanPass(null, src, 1.5, 1))
return 0
@@ -293,13 +323,13 @@ turf/proc/ZAirPass(turf/T)
return 0
for(var/obj/obstacle in src)
if(istype(obstacle,/obj/machinery/door) && !istype(obstacle,/obj/machinery/door/window))
if(istype(obstacle, /obj/machinery/door) && !obstacle:air_properties_vary_with_direction)
continue
if(!obstacle.CanPass(null, T, 0, 0))
return 0
for(var/obj/obstacle in T)
if(istype(obstacle,/obj/machinery/door) && !istype(obstacle,/obj/machinery/door/window))
if(istype(obstacle, /obj/machinery/door) && !obstacle:air_properties_vary_with_direction)
continue
if(!obstacle.CanPass(null, src, 0, 0))
return 0
+15 -5
View File
@@ -20,6 +20,7 @@ zone
// To make sure you're not spammed to death by airflow sound effects
tmp/playsound_cooldown = 0
//CREATION AND DELETION
New(turf/start)
. = ..()
@@ -53,6 +54,7 @@ zone
//Add this zone to the global list.
zones.Add(src)
//LEGACY, DO NOT USE. Use the SoftDelete proc.
Del()
//Ensuring the zone list doesn't get clogged with null values.
@@ -68,25 +70,27 @@ zone
air = null
. = ..()
//Handles deletion via garbage collection.
proc/SoftDelete()
zones.Remove(src)
air = null
//Ensuring the zone list doesn't get clogged with null values.
for(var/turf/simulated/T in contents)
RemoveTurf(T)
air_master.tiles_to_reconsider_zones += T
//Removing zone connections and scheduling connection cleanup
for(var/zone/Z in connected_zones)
if(src in Z.connected_zones)
Z.connected_zones.Remove(src)
for(var/connection/C in connections)
if(C.zone_A == src)
C.zone_A = null
if(C.zone_B == src)
C.zone_B = null
air_master.connections_to_check += C
return 1
//ZONE MANAGEMENT FUNCTIONS
proc/AddTurf(turf/T)
//Adds the turf to contents, increases the size of the zone, and sets the zone var.
@@ -270,7 +274,13 @@ zone/proc/process()
if(moles_delta > 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] )
var/unsimulated_boost = 0
if(unsimulated_tiles)
unsimulated_boost += unsimulated_tiles.len
if(Z.unsimulated_tiles)
unsimulated_boost += Z.unsimulated_tiles.len
unsimulated_boost = min(3, unsimulated_boost)
ShareRatio( air , Z.air , connected_zones[Z] + unsimulated_boost)
for(var/zone/Z in closed_connection_zones)
if(air && Z.air)
+1
View File
@@ -1329,6 +1329,7 @@ proc/is_hot(obj/item/W as obj)
/proc/is_sharp(obj/item/W as obj) // For the record, WHAT THE HELL IS THIS METHOD OF DOING IT?
if(W.sharp) return 1
return ( \
W.sharp || \
istype(W, /obj/item/weapon/screwdriver) || \
istype(W, /obj/item/weapon/pen) || \
istype(W, /obj/item/weapon/weldingtool) || \
+3 -2
View File
@@ -133,11 +133,12 @@ datum/controller/game_controller/proc/process()
air_master.current_cycle++
var/success = air_master.tick() //Changed so that a runtime does not crash the ticker.
if(!success) //Runtimed.
log_adminwarn("ZASALERT: air_system/tick() failed: [air_master.tick_progress]")
air_master.failed_ticks++
if(air_master.failed_ticks > 5)
world << "<font color='red'><b>RUNTIMES IN ATMOS TICKER. Killing air simulation!</font></b>"
kill_air = 1
message_admins("ZASALERT: unable run [air_master.tick_progress], tell someone about this!")
log_admin("ZASALERT: unable run zone/process() -- [air_master.tick_progress]")
air_processing_killed = 1
air_master.failed_ticks = 0
air_cost = (world.timeofday - timer) / 10
+5 -1
View File
@@ -696,7 +696,11 @@ var/using_new_click_proc = 0 //TODO ERRORAGE (This is temporary, while the DblCl
if (in_range)
if (!( human.restrained() || human.lying ))
if (W)
attackby(W,human)
var/was_used = 0
if(W)
was_used = W.is_used_on(src, human)
if(!was_used)
attackby(W,human)
if (W)
W.afterattack(src, human)
else
+16 -5
View File
@@ -217,13 +217,24 @@ Implants;
man.client.prefs.nanotrasen_relation == "Skeptical" && prob(20))
suspects += man
// Antags
else if(special_role == "traitor" && prob(20) || \
special_role == "Changeling" && prob(40) || \
special_role == "Cultist" && prob(10) || \
special_role == "Head Revolutionary" && prob(10))
else if(special_role == "traitor" && prob(40) || \
special_role == "Changeling" && prob(50) || \
special_role == "Cultist" && prob(30) || \
special_role == "Head Revolutionary" && prob(30))
suspects += man
// If they're a traitor or likewise, give them extra TC in exchange.
var/obj/item/device/uplink/hidden/suplink = man.mind.find_syndicate_uplink()
if(suplink)
var/extra = 4
suplink.uses += extra
man << "\red We have received notice that enemy intelligence suspects you to be linked with us. We have thus invested significant resources to increase your uplink's capacity."
else
// Give them a warning!
man << "\red They are on to you!"
// Some poor people who were just in the wrong place at the wrong time..
else if(prob(5))
else if(prob(10))
suspects += man
for(var/mob/M in suspects)
switch(rand(1, 100))
@@ -8,6 +8,9 @@
required_enemies = 3
recommended_enemies = 3
uplink_welcome = "Revolutionary Uplink Console:"
uplink_uses = 5
newscaster_announcements = /datum/news_announcement/revolution_inciting_event
var/last_command_report = 0
@@ -68,6 +71,8 @@
for(var/datum/mind/rev_mind in head_revolutionaries)
greet_revolutionary(rev_mind)
rev_mind.current.verbs += /mob/living/carbon/human/proc/RevConvert
equip_traitor(rev_mind.current, 1) //changing how revs get assigned their uplink so they can get PDA uplinks. --NEO
modePlayer += head_revolutionaries
spawn (rand(waittime_l, waittime_h))
send_intercept()
@@ -212,18 +217,28 @@
message_admins("Unable to add new heads of revolution.")
tried_to_add_revheads = world.time + 6000 // wait 10 minutes
if(last_command_report == 0 && world.time >= 60 * 10)
command_alert("We are regrettably announcing that your performance has been disappointing, and we are thus forced to cut down on financial support to your station. To achieve this, the pay of all personnal, except the Heads of Staff, has been halved.")
if(last_command_report == 0 && world.time >= 10 * 60 * 10)
src.command_report("We are regrettably announcing that your performance has been disappointing, and we are thus forced to cut down on financial support to your station. To achieve this, the pay of all personnal, except the Heads of Staff, has been halved.")
last_command_report = 1
else if(last_command_report == 1 && world.time >= 60 * 30)
command_alert("Statistics hint that a high amount of leisure time, and associated activities, are responsible for the poor performance of many of our stations. You are to bolt and close down any leisure facilities, such as the holodeck, the theatre and the bar. Food can be distributed through vendors and the kitchen.")
else if(last_command_report == 1 && world.time >= 10 * 60 * 30)
src.command_report("Statistics hint that a high amount of leisure time, and associated activities, are responsible for the poor performance of many of our stations. You are to bolt and close down any leisure facilities, such as the holodeck, the theatre and the bar. Food can be distributed through vendors and the kitchen.")
last_command_report = 2
else if(last_command_report == 2 && world.time >= 60 * 60)
command_alert("It is reported that merely closing down leisure facilities has not been successful. You and your Heads of Staff are to ensure that all crew are working hard, and not wasting time or energy. Any crew caught off duty without leave from their Head of Staff are to be warned, and on repeated offence, to be brigged until the next transfer shuttle arrives, which will take them to facilities where they can be of more use.")
else if(last_command_report == 2 && world.time >= 10 * 60 * 60)
src.command_report("It is reported that merely closing down leisure facilities has not been successful. You and your Heads of Staff are to ensure that all crew are working hard, and not wasting time or energy. Any crew caught off duty without leave from their Head of Staff are to be warned, and on repeated offence, to be brigged until the next transfer shuttle arrives, which will take them to facilities where they can be of more use.")
last_command_report = 3
return ..()
/datum/game_mode/revolution/rp_revolution/proc/command_report(message)
for (var/obj/machinery/computer/communications/comm in world)
if (!(comm.stat & (BROKEN | NOPOWER)) && comm.prints_intercept)
var/obj/item/weapon/paper/intercept = new /obj/item/weapon/paper( comm.loc )
intercept.name = "paper- 'Cent. Com. Announcement'"
intercept.info = message
comm.messagetitle.Add("Cent. Com. Announcement")
comm.messagetext.Add(message)
world << sound('commandreport.ogg')
/datum/game_mode/revolution/rp_revolution/latespawn(mob/M)
if(M.mind.assigned_role in command_positions)
@@ -234,6 +249,6 @@
var/datum/objective/mutiny/rp/rev_obj = new
rev_obj.owner = rev_mind
rev_obj.target = M.mind
rev_obj.explanation_text = "Assassinate, convert or capture [M.name], the [M.mind.assigned_role]."
rev_obj.explanation_text = "Assassinate, convert or capture [M.real_name], the [M.mind.assigned_role]."
rev_mind.objectives += rev_obj
rev_mind.current << "\red A new Head of Staff, [M.name], the [M.mind.assigned_role] has appeared. Your objectives have been updated."
rev_mind.current << "\red A new Head of Staff, [M.real_name], the [M.mind.assigned_role] has appeared. Your objectives have been updated."
+1 -1
View File
@@ -115,7 +115,7 @@
steal_objective.find_target()
traitor.objectives += steal_objective
switch(rand(1,100))
if(1 to 90)
if(1 to 100)
if (!(locate(/datum/objective/escape) in traitor.objectives))
var/datum/objective/escape/escape_objective = new
escape_objective.owner = traitor
+1 -1
View File
@@ -87,7 +87,7 @@
escape_objective.owner = wizard
wizard.objectives += escape_objective
if(61 to 85)
if(61 to 100)
var/datum/objective/assassinate/kill_objective = new
kill_objective.owner = wizard
kill_objective.find_target()
+2 -2
View File
@@ -62,7 +62,7 @@
switch(H.mind.role_alt_title)
if("Emergency Physician")
H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/medical(H), slot_w_uniform)
H.equip_to_slot_or_del(new /obj/item/clothing/suit/fr_jacket(H), slot_wear_suit)
H.equip_to_slot_or_del(new /obj/item/clothing/suit/storage/fr_jacket(H), slot_wear_suit)
if("Surgeon")
H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/medical/blue(H), slot_w_uniform)
H.equip_to_slot_or_del(new /obj/item/clothing/suit/storage/labcoat(H), slot_wear_suit)
@@ -215,4 +215,4 @@
H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(H), slot_r_hand)
else
H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(H.back), slot_in_backpack)
return 1
return 1
+1 -1
View File
@@ -67,7 +67,7 @@
idle_power_usage = 4
active_power_usage = 8
power_channel = ENVIRON
req_access = list(access_atmospherics, access_engine_equip)
req_one_access = list(access_atmospherics, access_engine_equip)
var/frequency = 1439
//var/skipprocess = 0 //Experimenting
var/alarm_frequency = 1437
@@ -18,6 +18,14 @@
use_power = 0
var/release_log = ""
/obj/machinery/portable_atmospherics/initialize()
. = ..()
spawn()
var/obj/machinery/atmospherics/portables_connector/connector = locate() in loc
if(connector)
connected_port = connector
update_icon()
/obj/machinery/portable_atmospherics/canister/sleeping_agent
name = "Canister: \[N2O\]"
icon_state = "redws"
+5 -2
View File
@@ -1169,7 +1169,7 @@ About the new airlock wires panel:
return
src.add_fingerprint(user)
if((istype(C, /obj/item/weapon/weldingtool) && !( src.operating ) && src.density))
if((istype(C, /obj/item/weapon/weldingtool) && !( src.operating > 0 ) && src.density))
var/obj/item/weapon/weldingtool/W = C
if(W.remove_fuel(0,user))
if(!src.welded)
@@ -1198,7 +1198,7 @@ About the new airlock wires panel:
beingcrowbarred = 1 //derp, Agouri
else
beingcrowbarred = 0
if( beingcrowbarred && (density && welded && !operating && src.p_open && (!src.arePowerSystemsOn() || stat & NOPOWER) && !src.locked) )
if( beingcrowbarred && (operating == -1 || density && welded && operating != 1 && src.p_open && (!src.arePowerSystemsOn() || stat & NOPOWER) && !src.locked) )
playsound(src.loc, 'sound/items/Crowbar.ogg', 100, 1)
user.visible_message("[user] removes the electronics from the airlock assembly.", "You start to remove electronics from the airlock assembly.")
if(do_after(user,40))
@@ -1243,6 +1243,9 @@ About the new airlock wires panel:
ae = electronics
electronics = null
ae.loc = src.loc
if(operating == -1)
ae.icon_state = "door_electronics_smoked"
operating = 0
del(src)
return
+2 -1
View File
@@ -18,6 +18,7 @@
var/glass = 0
var/normalspeed = 1
var/heat_proof = 0 // For glass airlocks/opacity firedoors
var/air_properties_vary_with_direction = 0
/obj/machinery/door/New()
..()
@@ -218,7 +219,7 @@
/obj/machinery/door/proc/close()
if(density) return 1
if(operating) return
if(operating > 0) return
operating = 1
animate("closing")
+1
View File
@@ -234,6 +234,7 @@
glass = 1 //There is a glass window so you can see through the door
//This is needed due to BYOND limitations in controlling visibility
heat_proof = 1
air_properties_vary_with_direction = 1
CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
if(istype(mover) && mover.checkpass(PASSGLASS))
+1
View File
@@ -11,6 +11,7 @@
opacity = 0
var/obj/item/weapon/airlock_electronics/electronics = null
explosion_resistance = 5
air_properties_vary_with_direction = 1
/obj/machinery/door/window/update_nearby_tiles(need_rebuild)
@@ -0,0 +1,45 @@
/**
* Multitool -- A multitool is used for hacking electronic devices.
* TO-DO -- Using it as a power measurement tool for cables etc. Nannek.
*
*/
/obj/item/device/debugger
icon = 'icons/obj/hacktool.dmi'
name = "debugger"
desc = "Used to debug electronic equipment."
icon_state = "hacktool-g"
flags = FPRINT | TABLEPASS| CONDUCT
force = 5.0
w_class = 2.0
throwforce = 5.0
throw_range = 15
throw_speed = 3
desc = "You can use this on airlocks or APCs to try to hack them without cutting wires."
m_amt = 50
g_amt = 20
origin_tech = "magnets=1;engineering=1"
var/obj/machinery/telecomms/buffer // simple machine buffer for device linkage
/obj/item/device/debugger/is_used_on(obj/O, mob/user)
if(istype(O, /obj/machinery/power/apc))
var/obj/machinery/power/apc/A = O
if(A.emagged || A.malfhack)
user << "\red There is a software error with the device."
else
user << "\blue The device's software appears to be fine."
return 1
if(istype(O, /obj/machinery/door))
var/obj/machinery/door/D = O
if(D.operating == -1)
user << "\red There is a software error with the device."
else
user << "\blue The device's software appears to be fine."
return 1
else if(istype(O, /obj/machinery))
var/obj/machinery/A = O
if(A.emagged)
user << "\red There is a software error with the device."
else
user << "\blue The device's software appears to be fine."
return 1
+3 -3
View File
@@ -76,9 +76,9 @@
M.updatehealth()
/obj/item/stack/medical/bruise_pack
name = "bruise pack"
singular_name = "bruise pack"
desc = "A pack designed to treat blunt-force trauma."
name = "roll of gauze"
singular_name = "gauze length"
desc = "Some sterile gauze to wrap around bloody stumps."
icon_state = "brutepack"
heal_brute = 60
origin_tech = "biotech=1"
+2
View File
@@ -16,6 +16,8 @@
var/damtype = "brute"
var/force = 0
/obj/item/proc/is_used_on(obj/O, mob/user)
/obj/proc/process()
processing_objects.Remove(src)
return 0
@@ -94,7 +94,7 @@
new /obj/item/clothing/under/rank/nurse(src)
new /obj/item/clothing/under/rank/orderly(src)
new /obj/item/clothing/suit/storage/labcoat(src)
new /obj/item/clothing/suit/fr_jacket(src)
new /obj/item/clothing/suit/storage/fr_jacket(src)
new /obj/item/clothing/shoes/white(src)
// new /obj/item/weapon/cartridge/medical(src)
new /obj/item/device/radio/headset/headset_med(src)
@@ -349,7 +349,7 @@ obj/structure/door_assembly
src.state = 0
src.name = "Secured Airlock Assembly"
else if(istype(W, /obj/item/weapon/airlock_electronics) && state == 1 )
else if(istype(W, /obj/item/weapon/airlock_electronics) && state == 1 && W:icon_state != "door_electronics_smoked")
playsound(src.loc, 'sound/items/Screwdriver.ogg', 100, 1)
user.visible_message("[user] installs the electronics into the airlock assembly.", "You start to install electronics into the airlock assembly.")
user.drop_item()
+2 -2
View File
@@ -2,7 +2,7 @@ datum/event/organ_failure
var/severity = 1
datum/event/organ_failure/setup()
announceWhen = rand(0, 3000)
announceWhen = rand(0, 300)
endWhen = announceWhen + 1
severity = rand(1, 3)
@@ -13,7 +13,7 @@ datum/event/organ_failure/announce()
datum/event/organ_failure/start()
var/list/candidates = list() //list of candidate keys
for(var/mob/living/carbon/human/G in player_list)
if(!(G.mind && G.mind.current && G.mind.current.stat != DEAD && G.health > 70))
if(G.mind && G.mind.current && G.mind.current.stat != DEAD && G.health > 70)
candidates += G
if(!candidates.len) return
candidates = shuffle(candidates)//Incorporating Donkie's list shuffle
+2 -2
View File
@@ -12,7 +12,7 @@
sleep(200)
command_alert("The station has entered the radiation belt. Please report to medbay if you experience any unusual symptoms.", "Anomaly Alert")
command_alert("The station has entered the radiation belt. Please remain in a sheltered area until we have passed the radiation belt.", "Anomaly Alert")
for(var/i = 0, i < 10, i++)
for(var/mob/living/carbon/human/H in living_mob_list)
var/turf/T = get_turf(H)
@@ -42,4 +42,4 @@
sleep(50)
command_alert("The station has passed the radiation belt", "Anomaly Alert")
command_alert("The station has passed the radiation belt. Please report to medbay if you experience any unusual symptoms.", "Anomaly Alert")
+1 -1
View File
@@ -5,7 +5,7 @@ datum/event/wallrot
var/severity = 1
datum/event/wallrot/setup()
announceWhen = rand(0, 3000)
announceWhen = rand(0, 300)
endWhen = announceWhen + 1
severity = rand(5, 10)
+2 -1
View File
@@ -6,7 +6,8 @@ mob/living/carbon/proc/dream()
"light","a scientist","a monkey","a catastrophe","a loved one","a gun","warmth","freezing","the sun",
"a hat","the Luna","a ruined station","a planet","plasma","air","the medical bay","the bridge","blinking lights",
"a blue light","an abandoned laboratory","Nanotrasen","The Syndicate","blood","healing","power","respect",
"riches","space","a crash","happiness","pride","a fall","water","flames","ice","melons","flying","the eggs"
"riches","space","a crash","happiness","pride","a fall","water","flames","ice","melons","flying","the eggs","money",
"a beach","the holodeck","a smokey room","a voice","the cold","a mouse","an operating table","the bar","the rain"
)
spawn(0)
for(var/i = rand(1,4),i > 0, i--)
@@ -138,7 +138,7 @@ emp_act
if(armor >= 2) return 0
if(!I.force) return 0
apply_damage(I.force, I.damtype, affecting, armor , I.sharp, I.name)
apply_damage(I.force, I.damtype, affecting, armor , is_sharp(I), I.name)
var/bloody = 0
if(((I.damtype == BRUTE) || (I.damtype == HALLOSS)) && prob(25 + (I.force * 2)))
+1 -4
View File
@@ -187,10 +187,7 @@
else
icon_state = basestate
else if (opened == 2)
if ((stat & BROKEN) || malfhack )
icon_state = "[basestate]-b-nocover"
else /* if (emagged)*/
icon_state = "[basestate]-nocover"
icon_state = "[basestate]-nocover"
else if (stat & BROKEN)
icon_state = "apc-b"
else if(emagged || malfai)
@@ -7,7 +7,7 @@
#define XENOARCH_MAX_ENERGY_TRANSFER 4000
//How many joules of electrical energy produce how many joules of heat energy?
#define XENOARCH_HEAT_COEFFICIENT 10
#define XENOARCH_HEAT_COEFFICIENT 3
/obj/machinery/anomaly
@@ -29,6 +29,7 @@
var/temperature = 273 //measured in kelvin, if this exceeds 1200, the machine is damaged and requires repairs
//if this exceeds 600 and safety is enabled it will shutdown
//temp greater than 600 also requires a safety prompt to initiate scanning
var/max_temp = 450
/obj/machinery/anomaly/New()
..()
@@ -66,35 +67,37 @@
auto_use_power()
//Add 200 joules when idle, or 3000 when active. This is about 0.6 degrees per tick.
//Add 3000 joules when active. This is about 0.6 degrees per tick.
//May need adjustment
var/heat_added = ( use_power == 1 ? active_power_usage : idle_power_usage )*XENOARCH_HEAT_COEFFICIENT
if(use_power == 1)
var/heat_added = active_power_usage *XENOARCH_HEAT_COEFFICIENT
temperature += heat_added/XENOARCH_HEAT_CAPACITY
if(temperature < max_temp)
temperature += heat_added/XENOARCH_HEAT_CAPACITY
var/temperature_difference = abs(environmental_temp-temperature)
var/datum/gas_mixture/removed = loc.remove_air(env.total_moles*0.25)
var/heat_capacity = removed.heat_capacity()
var/temperature_difference = abs(environmental_temp-temperature)
var/datum/gas_mixture/removed = loc.remove_air(env.total_moles*0.25)
var/heat_capacity = removed.heat_capacity()
heat_added = max(temperature_difference*heat_capacity, XENOARCH_MAX_ENERGY_TRANSFER)
heat_added = max(temperature_difference*heat_capacity, XENOARCH_MAX_ENERGY_TRANSFER)
if(temperature > environmental_temp)
//cool down to match the air
temperature = max(TCMB, temperature - heat_added/XENOARCH_HEAT_CAPACITY)
removed.temperature = max(TCMB, removed.temperature + heat_added/heat_capacity)
if(temperature > environmental_temp)
//cool down to match the air
temperature = max(TCMB, temperature - heat_added/XENOARCH_HEAT_CAPACITY)
removed.temperature = max(TCMB, removed.temperature + heat_added/heat_capacity)
if(temperature_difference > 10 && prob(5))
src.visible_message("\blue \icon[src] hisses softly.", 2)
if(temperature_difference > 10 && prob(5))
src.visible_message("\blue \icon[src] hisses softly.", 2)
else
//heat up to match the air
temperature = max(TCMB, temperature + heat_added/XENOARCH_HEAT_CAPACITY)
removed.temperature = max(TCMB, removed.temperature - heat_added/heat_capacity)
else
//heat up to match the air
temperature = max(TCMB, temperature + heat_added/XENOARCH_HEAT_CAPACITY)
removed.temperature = max(TCMB, removed.temperature - heat_added/heat_capacity)
if(temperature_difference > 10 && prob(5))
src.visible_message("\blue \icon[src] plinks quietly.", 2)
if(temperature_difference > 10 && prob(5))
src.visible_message("\blue \icon[src] plinks quietly.", 2)
env.merge(removed)
env.merge(removed)
//this proc should be overriden by each individual machine
@@ -22,4 +22,6 @@
"/obj/item/weapon/folder",
"/obj/item/weapon/clipboard",
"/obj/item/weapon/anodevice",
"/obj/item/clothing/glasses",
"/obj/item/weapon/wrench",
"/obj/item/weapon/anobattery")