ZAS fixes, adds Atmos Lockdown which replaces all door accesses with engineering OR atmos access. (And a shitty temporary icon)

This commit is contained in:
SkyMarshal
2012-06-07 20:50:15 -07:00
parent 36a32c9fef
commit a1a2302199
16 changed files with 7099 additions and 6944 deletions

View File

@@ -189,6 +189,14 @@ connection
if(!A.zone || !B.zone)
del src
if(A.zone == zone_B && B.zone == zone_A)
var/turf/Temp = B
B = A
A = Temp
zone_B = B.zone
zone_A = A.zone
return
if(zone_A)
if(zone_A.connections)
zone_A.connections.Remove(src)

View File

@@ -70,13 +70,13 @@ turf/proc/ZCanPass(turf/T)
for(var/obj/obstacle in src)
if(istype(obstacle,/obj/machinery/door) && !istype(obstacle,/obj/machinery/door/window))
continue
if(!obstacle.CanPass(0, T, 0, 1))
if(!obstacle.CanPass(0, T, 1.5, 1))
return 0
for(var/obj/obstacle in T)
if(istype(obstacle,/obj/machinery/door) && !istype(obstacle,/obj/machinery/door/window))
continue
if(!obstacle.CanPass(0, src, 0, 1))
if(!obstacle.CanPass(0, src, 1.5, 1))
return 0
return 1

View File

@@ -136,10 +136,11 @@ datum
for(var/turf/simulated/S in world)
if(S.z < 5)
if(!S.blocks_air && !S.zone && S.z < 5) // Added last check to force skipping asteroid z-levels -- TLE
new/zone(S)
if(!S.zone && !S.blocks_air && S.z < 5) // Added last check to force skipping asteroid z-levels -- TLE
if(S.CanPass(null, S, 0, 0))
new/zone(S)
S.update_air_properties()
tiles_to_update |= S
world << "\red \b Geometry processed in [time2text(world.timeofday-start_time, "mm:ss")] minutes!"
spawn start()
@@ -151,6 +152,7 @@ datum
//Outputs: None.
set background = 1
while(1)
if(!kill_air)
current_cycle++

View File

@@ -205,9 +205,6 @@ turf
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) && !T.CanPass(null, src, 0, 0)) //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.
@@ -218,4 +215,5 @@ turf
for(var/direction2 in cardinal - reverse_direction(direction)) //Check all other directions for air that might be connected.
var/turf/simulated/NT = get_step(T, direction2)
if(NT && NT.zone && NT.zone == zone)
zone.rebuild = 1
zone.rebuild = 1
T.check_connections()

View File

@@ -42,8 +42,8 @@
/turf/proc/check_connections()
//Checks for new connections that can be made.
for(var/d in cardinal)
var/turf/T = get_step(src,d)
if(!T || !T.zone || !T.CanPass(0,src,0,0))
var/turf/simulated/T = get_step(src,d)
if(!istype(T) || !T.zone || !T.CanPass(0,src,0,0))
continue
if(T.zone != zone)
ZConnect(src,T)
@@ -90,9 +90,12 @@ proc/ZMerge(zone/A,zone/B)
A.contents = new_contents
//Set all the zone vars.
for(var/turf/T in B.contents)
for(var/turf/simulated/T in B.contents)
T.zone = A
for(var/connection/C in A.connections)
C.Cleanup()
del B
proc/ZConnect(turf/A,turf/B)
@@ -116,8 +119,9 @@ proc/ZConnect(turf/A,turf/B)
return ZMerge(A.zone, B.zone)
//Ensure the connection isn't already made.
for(var/connection/C in A.zone.connections)
if((C.A == A && C.B == B) || (C.A == B && C.B == A))
for(var/connection/C in air_master.tiles_with_connections[A])
C.Cleanup()
if(C.B == B || C.A == B)
return
var/connection/C = new(A,B)

View File

@@ -33,6 +33,7 @@ zone/proc/process()
for(var/turf/T in contents)
if(!(T in new_contents))
problem = 1
break
if(problem)
//Build some new zones for stuff that wasn't included.

View File

@@ -51,6 +51,9 @@ NOTE: there are two lists of areas in the end of this file: centcom and station
var/list/related // the other areas of the same type as this
var/list/lights // list of all lights on this area
var/list/all_doors = list() //Added by Strumpetplaya - Alarm Change - Contains a list of doors adjacent to this area
var/air_doors_activated
/*Adding a wizard area teleport list because motherfucking lag -- Urist*/
/*I am far too lazy to make it a proper list of areas so I'll just make it run the usual telepot routine at the start of the game*/
var/list/teleportlocs = list()

View File

@@ -124,10 +124,32 @@
/area/proc/firealert()
if(src.name == "Space") //no fire alarms in space
return
if (!( src.fire ))
src.fire = 1
src.updateicon()
src.mouse_opacity = 0
if (!fire)
fire = 1
updateicon()
mouse_opacity = 0
for(var/obj/machinery/door/airlock/E in master.all_doors)
if(!E.air_locked)
if((!E.arePowerSystemsOn()) || (E.stat & NOPOWER)) continue
if(!E.density)
spawn(0)
E.close()
sleep(10)
if(E.density)
E.air_locked = E.req_access
E.req_access = list(access_engine, access_atmospherics)
E.update_icon()
if(E.operating)
spawn(10)
E.close()
if(E.density)
E.air_locked = E.req_access
E.req_access = list(access_engine, access_atmospherics)
E.update_icon()
else if(!E:locked) //Don't lock already bolted doors.
E.air_locked = E.req_access
E.req_access = list(access_engine, access_atmospherics)
E.update_icon()
for(var/obj/machinery/door/firedoor/D in src)
if(!D.blocked)
if(D.operating)
@@ -145,10 +167,17 @@
return
/area/proc/firereset()
if (src.fire)
src.fire = 0
src.mouse_opacity = 0
src.updateicon()
if (fire)
fire = 0
mouse_opacity = 0
updateicon()
for(var/obj/machinery/door/airlock/E in master.all_doors)
if((!E.arePowerSystemsOn()) || (E.stat & NOPOWER)) continue
if(E.air_locked) //Don't mess with doors locked for other reasons.
if(E.density)
E.req_access = E.air_locked
E.air_locked = null
E.update_icon()
for(var/obj/machinery/door/firedoor/D in src)
if(!D.blocked)
if(D.operating)

View File

@@ -103,6 +103,42 @@
global_mutations += mut// add to global mutations list!
*/
//setupdooralarms() goes through every door in the world before the game starts, checks all the squares
//adjacent to them, and if the adjacent square does not contain a dense turf and is not in the same
//area as the door, then the door is added to that adjacent area's auxdoor list to be used later on for
//atmos and fire alarms.
proc/setupdooralarms() //Strumpetplaya added 11/09/10 Automated Secondary Alarms on Doors
world << "\red <B>Setting up atmospheric lockdown areas...</b>"
for(var/obj/machinery/door/D in world)
var/turf/source = get_turf(D)
var/area/A = get_area(source)
var/turf/north = get_step(source, NORTH)
var/turf/east = get_step(source, EAST)
var/turf/south = get_step(source, SOUTH)
var/turf/west = get_step(source, WEST)
A.all_doors |= D
if(!north.density)
var/area/other_area = get_area(north)
if(other_area.name != A.name)
other_area.master.all_doors |= D
if(!east.density)
var/area/other_area = get_area(east)
if(other_area.name != A.name)
other_area.master.all_doors |= D
if(!south.density)
var/area/other_area = get_area(south)
if(other_area.name != A.name)
other_area.master.all_doors |= D
if(!west.density)
var/area/other_area = get_area(west)
if(other_area.name != A.name)
other_area.master.all_doors |= D
/proc/setupfactions()

View File

@@ -1012,8 +1012,73 @@ table tr:first-child th:first-child { border: none;}
new_area_danger_level = max(new_area_danger_level,AA.danger_level)
if (alarm_area.atmosalert(new_area_danger_level)) //if area was in normal state or if area was in alert state
post_alert(new_area_danger_level)
if(danger_level > 1)
air_doors_close(0)
else
air_doors_open(0)
update_icon()
/obj/machinery/alarm
proc/air_doors_close(manual)
var/area/A = get_area(src)
if(!A.master.air_doors_activated)
A.master.air_doors_activated = 1
for(var/obj/machinery/door/E in A.master.all_doors)
if(istype(E,/obj/machinery/door/firedoor))
if(!E:blocked)
if(E.operating)
E:nextstate = CLOSED
else if(!E.density)
spawn(0)
E.close()
continue
if(istype(E, /obj/machinery/door/airlock))
if((!E:arePowerSystemsOn()) || (E.stat & NOPOWER)) continue
if(!E.density)
spawn(0)
E.close()
sleep(10)
if(E.density)
E:air_locked = E.req_access
E:req_access = list(access_engine, access_atmospherics)
E.update_icon()
if(E.operating)
spawn(10)
E.close()
if(E.density)
E:air_locked = E.req_access
E:req_access = list(access_engine, access_atmospherics)
E.update_icon()
else if(!E:locked) //Don't lock already bolted doors.
E:air_locked = E.req_access
E:req_access = list(access_engine, access_atmospherics)
E.update_icon()
proc/air_doors_open(manual)
var/area/A = get_area(loc)
if(A.master.air_doors_activated)
A.master.air_doors_activated = 0
for(var/obj/machinery/door/E in A.master.all_doors)
if(istype(E, /obj/machinery/door/firedoor))
if(!E:blocked)
if(E.operating)
E:nextstate = OPEN
else if(E.density)
spawn(0)
E.open()
continue
if(istype(E, /obj/machinery/door/airlock))
if((!E:arePowerSystemsOn()) || (E.stat & NOPOWER)) continue
if(E:air_locked) //Don't mess with doors locked for other reasons.
if(E.density)
E:req_access = E:air_locked
E:air_locked = null
E.update_icon()
/obj/machinery/alarm/attackby(obj/item/W as obj, mob/user as mob)
/* if (istype(W, /obj/item/weapon/wirecutters))
stat ^= BROKEN
@@ -1186,12 +1251,9 @@ table tr:first-child th:first-child { border: none;}
return
/obj/machinery/firealarm/proc/reset()
if (!( src.working ))
return
var/area/A = src.loc
A = A.loc
if (!( istype(A, /area) ))
if (!working)
return
var/area/A = get_area(src)
if(network)
for(var/obj/machinery/door/firedoor/D in world)
if(!D.blocked && D.net_id == src.network)

View File

@@ -78,6 +78,7 @@ Airlock index -> wire color are { 9, 4, 6, 7, 5, 8, 1, 2, 3 }.
spawnPowerRestoreRunning = 0
welded = null
locked = 0
list/air_locked = 0
wires = 4095
aiDisabledIdScanner = 0
aiHacking = 0
@@ -342,14 +343,16 @@ Airlock index -> wire color are { 9, 4, 6, 7, 5, 8, 1, 2, 3 }.
icon_state = "door_locked"
else
icon_state = "door_closed"
if(p_open || welded)
overlays = list()
if(p_open)
overlays += image(icon, "panel_open")
if(welded)
overlays += image(icon, "welded")
else
icon_state = "door_open"
if(p_open || welded || air_locked)
overlays = list()
if(p_open)
overlays += image(icon, "panel_open")
if(welded)
overlays += image(icon, "welded")
if(air_locked)
overlays += image('Door1.dmi', "air")
return

View File

@@ -342,7 +342,7 @@
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)

View File

@@ -59,6 +59,8 @@ datum/controller/game_controller
setupgenetics()
setupdooralarms()
// for(var/i = 0, i < max_secret_rooms, i++)
// make_mining_asteroid_secret()
// Because energy cutlasses, facehuggers, and empty rooms are silly. FOR NOW. - Erthilo

View File

@@ -322,6 +322,8 @@
/turf/proc/ReplaceWithWall()
var/old_icon = icon_state
if(zone)
zone.RemoveTurf(src)
var/turf/simulated/wall/S = new /turf/simulated/wall( locate(src.x, src.y, src.z) )
S.icon_old = old_icon
S.opacity = 0
@@ -342,6 +344,8 @@
/turf/proc/ReplaceWithRWall()
var/old_icon = icon_state
if(zone)
zone.RemoveTurf(src)
var/turf/simulated/wall/r_wall/S = new /turf/simulated/wall/r_wall( locate(src.x, src.y, src.z) )
S.icon_old = old_icon
S.opacity = 0

Binary file not shown.

Before

Width:  |  Height:  |  Size: 73 KiB

After

Width:  |  Height:  |  Size: 94 KiB

File diff suppressed because it is too large Load Diff