Air alarm fixes, final part. Added in area atmos lockdown, proper overrides from the atmos control computer, cycling airlocks, and minor airflow/ZAS tweaks.

This commit is contained in:
SkyMarshal
2012-06-21 01:39:45 -07:00
parent c2163b1f20
commit 5ea83f0abe
17 changed files with 9083 additions and 8874 deletions
+49 -16
View File
@@ -9,13 +9,18 @@
density = 1
anchored = 1.0
circuit = "/obj/item/weapon/circuitboard/atmoscontrol"
var/obj/machinery/alarm/current = ""
var/obj/machinery/alarm/current
var/overridden = 0 //not set yet, can't think of a good way to do it
req_access = list(access_ce)
/obj/machinery/computer/atmoscontrol/attack_hand(mob/user)
if(..())
return
user.machine = src
if(allowed(user))
overridden = 1
else if(!emagged)
overridden = 0
var/dat = "<a href='?src=\ref[src]&reset=1'>Main Menu</a><hr>"
if(current)
dat += specific()
@@ -32,12 +37,22 @@
dat += "[alarm]</font></a><br/>"
user << browse(dat, "window=atmoscontrol")
/obj/machinery/computer/atmoscontrol/attackby(var/obj/item/I as obj, var/mob/user as mob)
if(istype(I, /obj/item/weapon/card/emag) && !emagged)
user.visible_message("\red \The [user] swipes \a [I] through \the [src], causing the screen to flash!",\
"\red You swipe your [I] through \the [src], the screen flashing as you gain full control.",\
"You hear the swipe of a card through a reader, and an electronic warble.")
emagged = 1
overridden = 1
return
return ..()
/obj/machinery/computer/atmoscontrol/proc/specific()
if(!current)
return ""
var/dat = "<h3>[current.name]</h3><hr>"
dat += current.return_status()
if(current.remote_control || (overridden && current.rcon_setting) )
if(current.remote_control || overridden)
dat += "<hr>[return_controls()]"
return dat
@@ -86,6 +101,34 @@
else
newval = round(newval,0.01)
selected[threshold] = newval
if(threshold == 1)
if(selected[1] > selected[2])
selected[2] = selected[1]
if(selected[1] > selected[3])
selected[3] = selected[1]
if(selected[1] > selected[4])
selected[4] = selected[1]
if(threshold == 2)
if(selected[1] > selected[2])
selected[1] = selected[2]
if(selected[2] > selected[3])
selected[3] = selected[2]
if(selected[2] > selected[4])
selected[4] = selected[2]
if(threshold == 3)
if(selected[1] > selected[3])
selected[1] = selected[3]
if(selected[2] > selected[3])
selected[2] = selected[3]
if(selected[3] > selected[4])
selected[4] = selected[3]
if(threshold == 4)
if(selected[1] > selected[4])
selected[1] = selected[4]
if(selected[2] > selected[4])
selected[2] = selected[4]
if(selected[3] > selected[4])
selected[3] = selected[4]
spawn(1)
updateUsrDialog()
return
@@ -122,16 +165,6 @@
//copypasta from alarm code, changed to work with this without derping hard
//---START COPYPASTA----
#define AALARM_MODE_SCRUBBING 1
#define AALARM_MODE_PANIC 2 //constantly sucks all air
#define AALARM_MODE_REPLACEMENT 3 //sucks off all air, then refill and swithes to scrubbing
#define AALARM_MODE_FILL 4 //emergency fill
#define AALARM_SCREEN_MAIN 1
#define AALARM_SCREEN_VENT 2
#define AALARM_SCREEN_SCRUB 3
#define AALARM_SCREEN_MODE 4
#define AALARM_SCREEN_SENSORS 5
/obj/machinery/computer/atmoscontrol/proc/return_controls()
var/output = ""//"<B>[alarm_zone] Air [name]</B><HR>"
@@ -244,10 +277,10 @@ Nitrous Oxide
<b>Air machinery mode for the area:</b><ul>"}
var/list/modes = list(
AALARM_MODE_SCRUBBING = "Filtering",
AALARM_MODE_REPLACEMENT = "<font color='red'>REPLACE AIR</font>",
AALARM_MODE_PANIC = "<font color='red'>PANIC</font>",
AALARM_MODE_CYCLE = "<font color='red'>CYCLE</font>",
AALARM_MODE_FILL = "<font color='red'>FILL</font>",
AALARM_MODE_REPLACEMENT = "<font color='red'>REPLACE AIR</font>",
)
for (var/m=1,m<=modes.len,m++)
if (current.mode==m)
@@ -283,19 +316,19 @@ table tr:first-child th:first-child { border: none;}
output += "<TR><th>[gases[g]]</th>"
tlv = current.TLV[g]
for (var/i = 1, i <= 4, i++)
output += "<td><A href='?src=\ref[src];alarm=\ref[current];command=set_threshold;env=[g];var=[i]'>[tlv[i]?tlv[i]:"OFF"]</A></td>"
output += "<td><A href='?src=\ref[src];alarm=\ref[current];command=set_threshold;env=[g];var=[i]'>[tlv[i] >= 0?tlv[i]:"OFF"]</A></td>"
output += "</TR>"
tlv = current.TLV["pressure"]
output += "<TR><th>Pressure</th>"
for (var/i = 1, i <= 4, i++)
output += "<td><A href='?src=\ref[src];alarm=\ref[current];command=set_threshold;env=pressure;var=[i]'>[tlv[i]?tlv[i]:"OFF"]</A></td>"
output += "<td><A href='?src=\ref[src];alarm=\ref[current];command=set_threshold;env=pressure;var=[i]'>[tlv[i]>= 0?tlv[i]:"OFF"]</A></td>"
output += "</TR>"
tlv = current.TLV["temperature"]
output += "<TR><th>Temperature</th>"
for (var/i = 1, i <= 4, i++)
output += "<td><A href='?src=\ref[src];alarm=\ref[current];command=set_threshold;env=temperature;var=[i]'>[tlv[i]?tlv[i]:"OFF"]</A></td>"
output += "<td><A href='?src=\ref[src];alarm=\ref[current];command=set_threshold;env=temperature;var=[i]'>[tlv[i]>= 0?tlv[i]:"OFF"]</A></td>"
output += "</TR>"
output += "</table>"
+10 -22
View File
@@ -13,10 +13,10 @@
#define ul_Steps 7
#define ul_FalloffStyle UL_I_FALLOFF_ROUND // Sets the lighting falloff to be either squared or circular.
#define ul_Layer 10
#define ul_TopLuminosity 12 //Maximum brightness an object can have.
var
ul_LightingResolutionSqrt = sqrt(ul_LightingResolution)
ul_TopLuminosity = 0
ul_SuppressLightLevelChanges = 0
list/ul_FastRoot = list(0, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5,
@@ -45,18 +45,18 @@ atom/proc/ul_SetLuminosity(var/Red, var/Green = Red, var/Blue = Red)
return //No point doing all that work if it won't have any effect anyways...
if (ul_Extinguished == UL_I_EXTINGUISHED)
LuminosityRed = Red
LuminosityGreen = Green
LuminosityBlue = Blue
LuminosityRed = min(Red,ul_TopLuminosity)
LuminosityGreen = min(Green,ul_TopLuminosity)
LuminosityBlue = min(Blue,ul_TopLuminosity)
return
if (ul_IsLuminous())
ul_Extinguish()
LuminosityRed = Red
LuminosityGreen = Green
LuminosityBlue = Blue
LuminosityRed = min(Red,ul_TopLuminosity)
LuminosityGreen = min(Green,ul_TopLuminosity)
LuminosityBlue = min(Blue,ul_TopLuminosity)
ul_Extinguished = UL_I_ONZERO
@@ -71,7 +71,6 @@ atom/proc/ul_Illuminate()
ul_Extinguished = UL_I_LIT
ul_UpdateTopLuminosity()
luminosity = ul_Luminosity()
for(var/turf/Affected in view(luminosity, src))
@@ -244,18 +243,6 @@ atom/proc/ul_BlankLocal()
return Blanked
atom/proc/ul_UpdateTopLuminosity()
if (ul_TopLuminosity < LuminosityRed)
ul_TopLuminosity = LuminosityRed
if (ul_TopLuminosity < LuminosityGreen)
ul_TopLuminosity = LuminosityGreen
if (ul_TopLuminosity < LuminosityBlue)
ul_TopLuminosity = LuminosityBlue
return
atom/proc/ul_Luminosity()
return max(LuminosityRed, LuminosityGreen, LuminosityBlue)
@@ -269,7 +256,7 @@ atom/proc/ul_LightLevelChanged()
atom/New()
. = ..()
if(ul_IsLuminous())
spawn(1)
spawn(2)
ul_Illuminate()
atom/Del()
@@ -400,4 +387,5 @@ area/proc/ul_Prep()
#undef ul_LightingResolution
#undef ul_Steps
#undef ul_FalloffStyle
#undef ul_Layer
#undef ul_Layer
#undef ul_TopLuminosity
+19 -8
View File
@@ -58,12 +58,12 @@ vs_control/var
airflow_medium_pressure = 90
airflow_medium_pressure_NAME = "Airflow - Heavy Movement Threshold %"
airflow_medium_pressure_DESC = "Percent of 1 Atm. at which items with the largest weight classes will move."
airflow_heavy_pressure = 90
airflow_heavy_pressure = 95
airflow_heavy_pressure_NAME = "Airflow - Dense Movement Threshold %"
airflow_heavy_pressure_DESC = "Percent of 1 Atm. at which items with canisters and closets will move."
airflow_heaviest_pressure = 95
airflow_heaviest_pressure_NAME = "Airflow - Human Movement Threshold % (Mob Stunning)"
airflow_heaviest_pressure_DESC = "Percent of 1 Atm. at which mobs will be shifted by airflow. (Mob Stunning)"
airflow_heaviest_pressure = 100
airflow_heaviest_pressure_NAME = "Airflow - Mob Stunning Threshold %"
airflow_heaviest_pressure_DESC = "Percent of 1 Atm. at which mobs will be stunned by airflow."
airflow_stun_cooldown = 60
airflow_stun_cooldown_NAME = "Aiflow Stunning - Cooldown"
airflow_stun_cooldown_DESC = "How long, in tenths of a second, to wait before stunning them again."
@@ -85,6 +85,8 @@ vs_control/var
mob/var/last_airflow_stun = 0
mob/proc/airflow_stun()
if(stat == 2)
return 0
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)
@@ -244,7 +246,7 @@ proc/AirflowSpace(zone/A)
M.airflow_dest = pick(close_turfs) //Pick a random midpoint to fly towards.
spawn
if(M) M.GotoAirflowDest(n/20)
if(M) M.GotoAirflowDest(n/10)
//Sometimes shit breaks, and M isn't there after the spawn.
atom/movable
@@ -273,7 +275,11 @@ 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)/max(get_dist(src,airflow_dest)/2,1),9)
var/airflow_falloff = 9 - ul_FalloffAmount(airflow_dest) //It's a fast falloff calc. Very useful.
if(airflow_falloff < 1)
airflow_dest = null
return
airflow_speed = min(max(n * (9/airflow_falloff),1),9)
var
xo = airflow_dest.x - src.x
yo = airflow_dest.y - src.y
@@ -323,7 +329,11 @@ atom/movable
if(src:shoes)
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)/max(get_dist(src,airflow_dest)/2,1),9)
var/airflow_falloff = 9 - ul_FalloffAmount(airflow_dest) //It's a fast falloff calc. Very useful.
if(airflow_falloff < 1)
airflow_dest = null
return
airflow_speed = min(max(n * (9/airflow_falloff),1),9)
var
xo = -(airflow_dest.x - src.x)
yo = -(airflow_dest.y - src.y)
@@ -413,5 +423,6 @@ zone/proc/movables()
. = list()
for(var/turf/T in contents)
for(var/atom/A in T)
if(istype(A, /mob/aiEye)) continue
if(istype(A, /mob/aiEye) || istype(A, /obj/effect))
continue
. += A
+8 -14
View File
@@ -1,6 +1,8 @@
#define QUANTIZE(variable) (round(variable,0.0001))
var/explosion_halt = 0
var/zone_share_percent = 3.5
vs_control/var/zone_share_percent = 10
vs_control/var/zone_share_percent_NAME = "Zone Share Percent"
vs_control/var/zone_share_percent_DESC = "Percentage of air difference to move per tick"
zone/proc/process()
//Deletes zone if empty.
if(!contents.len)
@@ -93,20 +95,10 @@ zone/proc/process()
//If there is space, air should flow out of the zone.
if(abs(air.return_pressure()) > vsc.airflow_lightest_pressure)
AirflowSpace(src)
ShareSpace(air,total_space*(zone_share_percent/100))
/* if(!(last_update%20)) //every 20 processes.
if(connections)
connections.Remove(null)
if(!connections.len)
del connections
if(connected_zones)
connected_zones.Remove(null)
if(!connected_zones.len)
del connected_zones*/
ShareSpace(air,total_space*(vsc.zone_share_percent/100))
//React the air here.
//air.react(null,0)
air.react(null,0)
//Check the graphic.
@@ -160,7 +152,9 @@ zone/proc/process()
if(abs(air.total_moles - Z.air.total_moles) > 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]*(zone_share_percent/100))
ShareRatio( air , Z.air , max(connected_zones[Z]*(vsc.zone_share_percent/200)*(space_tiles || Z.space_tiles ? 2 : 1) , 1) )
//Divided by 200 since each zone is processed. Each connection is considered twice
//Space tiles force it to try and move twice as much air.
proc/ShareRatio(datum/gas_mixture/A, datum/gas_mixture/B, ratio)
//Shares a specific ratio of gas between mixtures using simple weighted averages.
+6 -3
View File
@@ -51,7 +51,7 @@ NOTE: there are two lists of areas in the end of this file: centcom and station
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
var/air_doors_activated = 0
/*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*/
@@ -328,6 +328,7 @@ proc/process_ghost_teleport_locs()
name = "\improper Centcom"
icon_state = "centcom"
requires_power = 0
ul_Lighting = 1
/area/centcom/control
name = "\improper Centcom Control"
@@ -380,6 +381,7 @@ proc/process_ghost_teleport_locs()
name = "\improper Asteroid"
icon_state = "asteroid"
requires_power = 0
ul_Lighting = 1
/area/asteroid/cave // -- TLE
name = "\improper Asteroid - Underground"
@@ -965,8 +967,9 @@ proc/process_ghost_teleport_locs()
/area/solar
requires_power = 0
luminosity = 1
ul_Lighting = 0
luminosity = 0
ul_Lighting = 1
LightLevels = list("Red" = 2, "Green" = 2, "Blue" = 3)
auxport
name = "\improper Port Auxiliary Solar Array"
+9 -7
View File
@@ -17,6 +17,8 @@
var/ul_created = findtext(tag,":UL")
ul_Prep()
if(ul_created)
if(!islist(related))
related = list()
related += src
return
related = list(src)
@@ -41,11 +43,13 @@
luminosity = 1
else
luminosity = 0
area_lights_luminosity = rand(6,7)
area_lights_luminosity = rand(6,8)
if(LightLevels)
ul_Light()
/area/Del()
related -= src
. = ..()
/*spawn(5)
@@ -100,9 +104,7 @@
/area/proc/atmosalert(danger_level)
// if(src.type==/area) //No atmos alarms in space
// return 0 //redudant
if(danger_level != src.atmosalm)
//src.updateicon()
//src.mouse_opacity = 0
if(danger_level != atmosalm)
if (danger_level==2)
var/list/cameras = list()
for(var/area/RA in src.related)
@@ -113,12 +115,12 @@
aiPlayer.triggerAlarm("Atmosphere", src, cameras, src)
for(var/obj/machinery/computer/station_alert/a in world)
a.triggerAlarm("Atmosphere", src, cameras, src)
else if (src.atmosalm == 2)
else if (atmosalm == 2)
for(var/mob/living/silicon/aiPlayer in world)
aiPlayer.cancelAlarm("Atmosphere", src, src)
for(var/obj/machinery/computer/station_alert/a in world)
a.cancelAlarm("Atmosphere", src, src)
src.atmosalm = danger_level
atmosalm = danger_level
return 1
return 0
-34
View File
@@ -103,40 +103,6 @@
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
-1
View File
@@ -1,4 +1,3 @@
/var/const
/var/const/access_security = 1
/var/const/access_brig = 2
/var/const/access_armory = 3
+51 -15
View File
@@ -29,10 +29,10 @@
#define AALARM_WIRE_AALARM 5
#define AALARM_MODE_SCRUBBING 1
#define AALARM_MODE_PANIC 2 //constantly sucks all air
#define AALARM_MODE_REPLACEMENT 5 //like scrubbing, but faster.
#define AALARM_MODE_CYCLE 3 //sucks off all air, then refill and swithes to scrubbing
#define AALARM_MODE_FILL 4 //emergency fill
#define AALARM_MODE_REPLACEMENT 2 //like scrubbing, but faster.
#define AALARM_MODE_PANIC 3 //constantly sucks all air
#define AALARM_MODE_CYCLE 4 //sucks off all air, then refill and swithes to scrubbing
#define AALARM_MODE_FILL 5 //emergency fill
#define AALARM_SCREEN_MAIN 1
#define AALARM_SCREEN_VENT 2
@@ -316,15 +316,15 @@
if(AALARM_MODE_REPLACEMENT)
for(var/device_id in alarm_area.air_scrub_names)
send_signal(device_id, list("power"= 1, "co2_scrub"= 1, "setting"= 2, "scrubbing"= 1, "panic_siphon"= 0) )
send_signal(device_id, list("power"= 1, "co2_scrub"= 1, "setting"= 3, "scrubbing"= 1, "panic_siphon"= 0) )
for(var/device_id in alarm_area.air_vent_names)
send_signal(device_id, list("power"= 1, "checks"= 1, "setting"= 2, "set_external_pressure"= target_pressure) )
send_signal(device_id, list("power"= 1, "checks"= 1, "setting"= 3, "set_external_pressure"= target_pressure) )
if(AALARM_MODE_FILL)
for(var/device_id in alarm_area.air_scrub_names)
send_signal(device_id, list("power"= 0) )
for(var/device_id in alarm_area.air_vent_names)
send_signal(device_id, list("power"= 1, "checks"= 1, "setting"= 2, "set_external_pressure"= target_pressure) )
send_signal(device_id, list("power"= 1, "checks"= 1, "setting"= 3, "set_external_pressure"= target_pressure) )
proc/apply_danger_level(var/new_danger_level)
alarm_area.atmosalm = new_danger_level
@@ -334,7 +334,7 @@
if (!(AA.stat & (NOPOWER|BROKEN)) && !AA.shorted && AA.danger_level != new_danger_level)
AA.update_icon()
if(danger_level > 2)
if(danger_level > 1)
air_doors_close(0)
else
air_doors_open(0)
@@ -647,6 +647,8 @@ Toxins: <span class='dl[plasma_dangerlevel]'>[plasma_percent]</span>%<br>
else
output += {"<span class='dl0'>Optimal</span>"}
output += "<br><br>Atmospheric Lockdown: <a href='?src=\ref[src];atmos_unlock=[alarm_area.air_doors_activated]'>[alarm_area.air_doors_activated ? "<b>ENABLED</b>" : "Disabled"]</a>"
return output
proc/rcon_text()
@@ -772,13 +774,11 @@ Toxins: <span class='dl[plasma_dangerlevel]'>[plasma_percent]</span>%<br>
if (AALARM_SCREEN_MODE)
output += "<a href='?src=\ref[src];screen=[AALARM_SCREEN_MAIN]'>Main menu</a><br><b>Air machinery mode for the area:</b><ul>"
world << "Made it here"
var/list/modes = list(AALARM_MODE_SCRUBBING = "Filtering",\
AALARM_MODE_REPLACEMENT = "<font color='blue'>REPLACE AIR</font>",\
AALARM_MODE_PANIC = "<font color='red'>PANIC</font>",\
AALARM_MODE_CYCLE = "<font color='red'>CYCLE</font>",\
AALARM_MODE_FILL = "<font color='red'>FILL</font>",\
AALARM_MODE_REPLACEMENT = "<font color='blue'>REPLACE AIR</font>")
world << "List created"
AALARM_MODE_FILL = "<font color='red'>FILL</font>",)
for (var/m=1,m<=modes.len,m++)
if (mode==m)
output += "<li><A href='?src=\ref[src];mode=[m]'><b>[modes[m]]</b></A> (selected)</li>"
@@ -814,19 +814,19 @@ table tr:first-child th:first-child { border: none;}
output += "<TR><th>[gases[g]]</th>"
selected = TLV[g]
for(var/i = 1, i <= 4, i++)
output += "<td><A href='?src=\ref[src];command=set_threshold;env=[g];var=[i]'>[selected[i] ? selected[i] :"OFF"]</A></td>"
output += "<td><A href='?src=\ref[src];command=set_threshold;env=[g];var=[i]'>[selected[i] >= 0 ? selected[i] :"OFF"]</A></td>"
output += "</TR>"
selected = TLV["pressure"]
output += " <TR><th>Pressure</th>"
for(var/i = 1, i <= 4, i++)
output += "<td><A href='?src=\ref[src];command=set_threshold;env=pressure;var=[i]'>[selected[i] ? selected[i] :"OFF"]</A></td>"
output += "<td><A href='?src=\ref[src];command=set_threshold;env=pressure;var=[i]'>[selected[i] >= 0 ? selected[i] :"OFF"]</A></td>"
output += "</TR>"
selected = TLV["temperature"]
output += "<TR><th>Temperature</th>"
for(var/i = 1, i <= 4, i++)
output += "<td><A href='?src=\ref[src];command=set_threshold;env=temperature;var=[i]'>[selected[i] ? selected[i] :"OFF"]</A></td>"
output += "<td><A href='?src=\ref[src];command=set_threshold;env=temperature;var=[i]'>[selected[i] >= 0 ? selected[i] :"OFF"]</A></td>"
output += "</TR></table>"
return output
@@ -880,10 +880,46 @@ table tr:first-child th:first-child { border: none;}
else
newval = round(newval,0.01)
selected[threshold] = newval
if(threshold == 1)
if(selected[1] > selected[2])
selected[2] = selected[1]
if(selected[1] > selected[3])
selected[3] = selected[1]
if(selected[1] > selected[4])
selected[4] = selected[1]
if(threshold == 2)
if(selected[1] > selected[2])
selected[1] = selected[2]
if(selected[2] > selected[3])
selected[3] = selected[2]
if(selected[2] > selected[4])
selected[4] = selected[2]
if(threshold == 3)
if(selected[1] > selected[3])
selected[1] = selected[3]
if(selected[2] > selected[3])
selected[2] = selected[3]
if(selected[3] > selected[4])
selected[4] = selected[3]
if(threshold == 4)
if(selected[1] > selected[4])
selected[1] = selected[4]
if(selected[2] > selected[4])
selected[2] = selected[4]
if(selected[3] > selected[4])
selected[3] = selected[4]
apply_mode()
if(href_list["screen"])
screen = text2num(href_list["screen"])
if(href_list["atmos_unlock"])
switch(href_list["atmos_unlock"])
if("0")
air_doors_close(1)
if("1")
air_doors_open(1)
if(href_list["atmos_alarm"])
if (alarm_area.atmosalert(2))
apply_danger_level(2)
+2 -2
View File
@@ -77,7 +77,7 @@ Airlock index -> wire color are { 9, 4, 6, 7, 5, 8, 1, 2, 3 }.
var/spawnPowerRestoreRunning = 0
var/welded = null
var/locked = 0
var/list/air_locked = 0
var/list/air_locked
var/wires = 4095
secondsElectrified = 0 //How many seconds remain until the door is no longer electrified. -1 if it is permanently electrified until someone fixes it.
var/aiDisabledIdScanner = 0
@@ -720,7 +720,7 @@ About the new airlock wires panel:
/obj/machinery/door/airlock/update_icon()
if(overlays) overlays = null
if(density)
if(locked && safetylight)
if(locked && safetylight && !air_locked)
icon_state = "door_locked"
else
icon_state = "door_closed"
+31
View File
@@ -37,6 +37,37 @@
update_nearby_tiles(need_rebuild=1)
else
update_nearby_tiles(need_rebuild=1)
spawn(1)
var/area/A = get_area(src)
if(A.master)
A = A.master
var/turf/north = get_step(src, NORTH)
var/turf/east = get_step(src, EAST)
var/turf/south = get_step(src, SOUTH)
var/turf/west = get_step(src, WEST)
A.all_doors |= src
if(!north.density)
var/area/other_area = get_area(north)
if(other_area.name != A.name)
other_area.master.all_doors |= src
if(!east.density)
var/area/other_area = get_area(east)
if(other_area.name != A.name)
other_area.master.all_doors |= src
if(!south.density)
var/area/other_area = get_area(south)
if(other_area.name != A.name)
other_area.master.all_doors |= src
if(!west.density)
var/area/other_area = get_area(west)
if(other_area.name != A.name)
other_area.master.all_doors |= src
return
@@ -4,6 +4,7 @@
#define AIRLOCK_STATE_CLOSED 0
#define AIRLOCK_STATE_DEPRESSURIZE 1
#define AIRLOCK_STATE_OUTOPEN 2
#define AIRLOCK_STATE_BOTHOPEN 3
datum/computer/file/embedded_program/airlock_controller
var/id_tag
@@ -44,6 +45,10 @@ datum/computer/file/embedded_program/airlock_controller
target_state = AIRLOCK_STATE_OUTOPEN
else
target_state = AIRLOCK_STATE_INOPEN
if("cycle_exterior")
target_state = AIRLOCK_STATE_OUTOPEN
if("cycle_interior")
target_state = AIRLOCK_STATE_INOPEN
receive_user_command(command)
switch(command)
@@ -55,6 +60,42 @@ datum/computer/file/embedded_program/airlock_controller
target_state = AIRLOCK_STATE_INOPEN
if("abort")
target_state = AIRLOCK_STATE_CLOSED
if("cycle_both")
target_state = AIRLOCK_STATE_BOTHOPEN
state = AIRLOCK_STATE_BOTHOPEN
var/datum/signal/signal = new
signal.data["tag"] = interior_door_tag
signal.data["command"] = "secure_open"
post_signal(signal)
signal = new
signal.data["tag"] = exterior_door_tag
signal.data["command"] = "secure_open"
post_signal(signal)
if("force_exterior")
target_state = AIRLOCK_STATE_OUTOPEN
state = AIRLOCK_STATE_OUTOPEN
var/datum/signal/signal = new
signal.data["tag"] = exterior_door_tag
signal.data["command"] = "secure_open"
post_signal(signal)
if("force_interior")
target_state = AIRLOCK_STATE_INOPEN
state = AIRLOCK_STATE_INOPEN
var/datum/signal/signal = new
signal.data["tag"] = interior_door_tag
signal.data["command"] = "secure_open"
post_signal(signal)
if("close")
target_state = AIRLOCK_STATE_CLOSED
state = AIRLOCK_STATE_CLOSED
var/datum/signal/signal = new
signal.data["tag"] = exterior_door_tag
signal.data["command"] = "secure_close"
post_signal(signal)
signal = new
signal.data["tag"] = interior_door_tag
signal.data["command"] = "secure_close"
post_signal(signal)
process()
var/process_again = 1
@@ -260,24 +301,31 @@ obj/machinery/embedded_controller/radio/airlock_controller
switch(state)
if(AIRLOCK_STATE_INOPEN)
state_options = {"<A href='?src=\ref[src];command=cycle_closed'>Close Interior Airlock</A><BR>
<A href='?src=\ref[src];command=cycle_exterior'>Cycle to Exterior Airlock</A><BR>"}
state_options = "<A href='?src=\ref[src];command=cycle_closed'>Close Interior Airlock</A><BR>\
<A href='?src=\ref[src];command=cycle_exterior'>Cycle to Exterior Airlock</A><BR>"
if(AIRLOCK_STATE_PRESSURIZE)
state_options = "<A href='?src=\ref[src];command=abort'>Abort Cycling</A><BR>"
if(AIRLOCK_STATE_CLOSED)
state_options = {"<A href='?src=\ref[src];command=cycle_interior'>Open Interior Airlock</A><BR>
<A href='?src=\ref[src];command=cycle_exterior'>Open Exterior Airlock</A><BR>"}
state_options = "<A href='?src=\ref[src];command=cycle_interior'>Open Interior Airlock</A><BR>\
<A href='?src=\ref[src];command=cycle_exterior'>Open Exterior Airlock</A><BR>"
if(AIRLOCK_STATE_DEPRESSURIZE)
state_options = "<A href='?src=\ref[src];command=abort'>Abort Cycling</A><BR>"
if(AIRLOCK_STATE_OUTOPEN)
state_options = {"<A href='?src=\ref[src];command=cycle_interior'>Cycle to Interior Airlock</A><BR>
<A href='?src=\ref[src];command=cycle_closed'>Close Exterior Airlock</A><BR>"}
state_options = "<A href='?src=\ref[src];command=cycle_interior'>Cycle to Interior Airlock</A><BR>\
<A href='?src=\ref[src];command=cycle_closed'>Close Exterior Airlock</A><BR>"
if(AIRLOCK_STATE_BOTHOPEN)
state_options = "<A href='?src=\ref[src];command=close'>Close Airlocks</A><BR>"
var/output = {"<B>Airlock Control Console</B><HR>
[state_options]<HR>
<B>Chamber Pressure:</B> [sensor_pressure] kPa<BR>
<B>Exterior Door: </B> [exterior_status]<BR>
<B>Interior Door: </B> [interior_status]<BR>
<B>Control Pump: </B> [pump_status]<BR>"}
<B>Control Pump: </B> [pump_status]<BR><br>"}
if(program && program.state == AIRLOCK_STATE_CLOSED)
output += {"<A href='?src=\ref[src];command=cycle_both'>Force Both Airlocks</A><br>
<A href='?src=\ref[src];command=force_interior'>Force Inner Airlock</A><br>
<A href='?src=\ref[src];command=force_exterior'>Force Outer Airlock</A>"}
return output
-2
View File
@@ -102,8 +102,6 @@ datum/controller/game_controller
new /obj/structure/closet/emcloset(loc)
emclosetcount--
setupdooralarms()
world << "\red \b Initializations complete."
+6 -6
View File
@@ -30,9 +30,9 @@
if(MT.armed)
for(var/mob/O in viewers(user, null))
if(O == user)
user.show_message(text("\red <B>You reach into the [src.name], but there was a live mousetrap in there!</B>"), 1)
user.show_message(text("\red <B>You reach into \the [src], but there was a live mousetrap in there!</B>"), 1)
else
user.show_message(text("\red <B>[user] reaches into the [src.name] and sets off a hidden mousetrap!</B>"), 1)
user.show_message(text("\red <B>\The [user] reaches into \the [src] and sets off a hidden mousetrap!</B>"), 1)
MT.loc = user.loc
MT.triggered(user, user.hand ? "l_hand" : "r_hand")
MT.layer = OBJ_LAYER
@@ -116,7 +116,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)
@@ -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 \the [W] into \the [src]."
user << "\blue You put \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 \The [user] puts \the [W] into \the [src]."))
M.show_message(text("\blue \The [user] puts \a [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 \The [user] puts \the [W] into \the [src]."))
M.show_message(text("\blue \The [user] puts \a [W] into \the [src]."))
return
/obj/item/weapon/storage/dropped(mob/user as mob)
+2 -2
View File
@@ -92,7 +92,7 @@
broken(1)
if("bulb")
brightness = rand(BULB_BRIGHT_MIN, BULB_BRIGHT_MAX)
if(prob(15))
if(prob(20))
broken(1)
spawn(1)
update()
@@ -127,7 +127,7 @@
var/oldlum = luminosity
//luminosity = on * brightness
ul_SetLuminosity(on * brightness, on * brightness, ( fitting != "bulb" ? on * brightness : round(on*brightness/2 + 1) ) ) // *DAL*
ul_SetLuminosity(on * brightness, on * brightness, fitting != "bulb" ? on * brightness : max(on * (brightness - 2), 0) ) // *DAL*
// if the state changed, inc the switching counter
if(oldlum != luminosity)
Binary file not shown.

Before

Width:  |  Height:  |  Size: 94 KiB

After

Width:  |  Height:  |  Size: 94 KiB

+8835 -8735
View File
File diff suppressed because it is too large Load Diff