Merge pull request #1335 from SkyMarshal/BugFixes

Air Alarms, ZAS fixes, Cycling Airlocks, UltraLight fixes
This commit is contained in:
SkyMarshal
2012-06-21 02:06:58 -07:00
23 changed files with 9955 additions and 9927 deletions
+49 -58
View File
@@ -7,11 +7,12 @@
level = 1
var/area_uid
var/id_tag = null
var/id_tag
power_channel = ENVIRON
var/on = 0
var/pump_direction = 1 //0 = siphoning, 1 = releasing
var/pump_speed = 1 //Used to adjust speed for siphons
var/external_pressure_bound = ONE_ATMOSPHERE
var/internal_pressure_bound = 0
@@ -38,17 +39,19 @@
assign_uid()
id_tag = num2text(uid)
if(ticker && ticker.current_state == 3)//if the game is running
src.initialize()
src.broadcast_status()
initialize()
broadcast_status()
..()
high_volume
name = "Large Air Vent"
power_channel = EQUIP
New()
..()
air_contents.volume = 1000
update_icon()
if(welded)
icon_state = "[level == 1 && istype(loc, /turf/simulated) ? "h" : "" ]weld"
@@ -65,11 +68,12 @@
process()
..()
// broadcast_status()
if(stat & (NOPOWER|BROKEN))
return
if (!node)
on = 0
//broadcast_status() // from now air alarm/control computer should request update purposely --rastaf0
if(!on)
return 0
@@ -89,7 +93,7 @@
if(pressure_delta > 0)
if(air_contents.temperature > 0)
var/transfer_moles = pressure_delta*environment.volume/(air_contents.temperature * R_IDEAL_GAS_EQUATION)
var/transfer_moles = pressure_delta*environment.volume*environment.group_multiplier*pump_speed/(air_contents.temperature * R_IDEAL_GAS_EQUATION)
var/datum/gas_mixture/removed = air_contents.remove(transfer_moles)
@@ -107,7 +111,7 @@
if(pressure_delta > 0)
if(environment.temperature > 0)
var/transfer_moles = pressure_delta*air_contents.volume/(environment.temperature * R_IDEAL_GAS_EQUATION)
var/transfer_moles = pressure_delta*air_contents.volume*air_contents.group_multiplier*pump_speed/(environment.temperature * R_IDEAL_GAS_EQUATION)
var/datum/gas_mixture/removed = loc.remove_air(transfer_moles)
if (isnull(removed)) //in space
@@ -120,39 +124,42 @@
return 1
//Radio remote control
proc
set_frequency(new_frequency)
radio_controller.remove_object(src, frequency)
frequency = new_frequency
if(frequency)
radio_connection = radio_controller.add_object(src, frequency,radio_filter_in)
proc/set_frequency(new_frequency)
radio_controller.remove_object(src, frequency)
frequency = new_frequency
if(frequency)
radio_connection = radio_controller.add_object(src, frequency,radio_filter_in)
broadcast_status()
if(!radio_connection)
return 0
proc/broadcast_status()
if(!radio_connection)
return 0
var/datum/signal/signal = new
signal.transmission_method = 1 //radio signal
signal.source = src
var/datum/signal/signal = new
signal.transmission_method = 1 //radio signal
signal.source = src
signal.data = list(
"area" = src.area_uid,
"tag" = src.id_tag,
"device" = "AVP",
"power" = on,
"direction" = pump_direction?("release"):("siphon"),
"checks" = pressure_checks,
"internal" = internal_pressure_bound,
"external" = external_pressure_bound,
"timestamp" = world.time,
"sigtype" = "status"
)
signal.data = list(
"area" = src.area_uid,
"tag" = src.id_tag,
"device" = "AVP",
"power" = on,
"direction" = pump_direction?("release"):("siphon"),
"checks" = pressure_checks,
"internal" = internal_pressure_bound,
"external" = external_pressure_bound,
"timestamp" = world.time,
"sigtype" = "status",
"setting" = pump_speed
)
radio_connection.post_signal(src, signal, radio_filter_out)
radio_connection.post_signal(src, signal, radio_filter_out)
return 1
return 1
initialize()
@@ -164,6 +171,7 @@
if(frequency)
set_frequency(frequency)
receive_signal(datum/signal/signal)
if(stat & (NOPOWER|BROKEN))
return
@@ -191,47 +199,29 @@
if("checks_toggle" in signal.data)
pressure_checks = (pressure_checks?0:3)
if("direction" in signal.data)
if("direction" in signal)
pump_direction = text2num(signal.data["direction"])
if("set_internal_pressure" in signal.data)
internal_pressure_bound = between(
0,
text2num(signal.data["set_internal_pressure"]),
ONE_ATMOSPHERE*50
)
internal_pressure_bound = between(0, text2num(signal.data["set_internal_pressure"]), ONE_ATMOSPHERE*50)
if("set_external_pressure" in signal.data)
external_pressure_bound = between(
0,
text2num(signal.data["set_external_pressure"]),
ONE_ATMOSPHERE*50
)
external_pressure_bound = between(0, text2num(signal.data["set_external_pressure"]), ONE_ATMOSPHERE*50)
if("adjust_internal_pressure" in signal.data)
internal_pressure_bound = between(
0,
internal_pressure_bound + text2num(signal.data["adjust_internal_pressure"]),
ONE_ATMOSPHERE*50
)
internal_pressure_bound = between(0, text2num(signal.data["adjust_internal_pressure"]), ONE_ATMOSPHERE*50)
if("adjust_external_pressure" in signal.data)
external_pressure_bound = between(
0,
external_pressure_bound + text2num(signal.data["adjust_external_pressure"]),
ONE_ATMOSPHERE*50
)
external_pressure_bound = between(0, text2num(signal.data["adjust_external_pressure"]), ONE_ATMOSPHERE*50)
if("init" in signal.data)
name = signal.data["init"]
return
if("status" in signal.data)
spawn(2)
broadcast_status()
return //do not update_icon
if("setting" in signal.data)
pump_speed = text2num(signal.data["setting"])
//log_admin("DEBUG \[[world.timeofday]\]: vent_pump/receive_signal: unknown command \"[signal.data["command"]]\"\n[signal.debug_print()]")
//log_admin("DEBUG \[[world.timeofday]\]: vent_pump/receive_signal: unknown command \"[signal["command"]]\"\n[signal.debug_print()]")
spawn(2)
broadcast_status()
update_icon()
@@ -272,6 +262,7 @@
else
user << "\blue You need more welding fuel to complete this task."
return 1
examine()
set src in oview(1)
..()
@@ -8,21 +8,24 @@
level = 1
var/id_tag = null
var/frequency = 1439
var/datum/radio_frequency/radio_connection
var/on = 0
var/scrubbing = 1 //0 = siphoning, 1 = scrubbing
var/scrub_CO2 = 1
var/scrub_Toxins = 0
var/scrub_N2O = 0
var/scrub_rate = 1
var/volume_rate = 120
var/panic = 0 //is this scrubber panicked?
var/area_uid
var/frequency = 1439
var/datum/radio_frequency/radio_connection
var/radio_filter_out
var/radio_filter_in
New()
var/area/A = get_area(loc)
if (A.master)
@@ -32,8 +35,8 @@
assign_uid()
id_tag = num2text(uid)
if(ticker && ticker.current_state == 3)//if the game is running
src.initialize()
src.broadcast_status()
initialize()
broadcast_status()
..()
update_icon()
@@ -85,20 +88,20 @@
process()
..()
// broadcast_status()
if(stat & (NOPOWER|BROKEN))
return
if (!node)
on = 0
//broadcast_status()
if(!on)
return 0
var/datum/gas_mixture/environment = loc.return_air()
if(scrubbing)
if((environment.toxins>0) || (environment.carbon_dioxide>0) || (environment.trace_gases.len>0))
var/transfer_moles = min(1, volume_rate/environment.volume)*environment.total_moles
var/transfer_moles = min(1, volume_rate*scrub_rate/environment.volume)*environment.total_moles
//Take a gas sample
var/datum/gas_mixture/removed = loc.remove_air(transfer_moles)
@@ -136,7 +139,7 @@
if (air_contents.return_pressure()>=50*ONE_ATMOSPHERE)
return
var/transfer_moles = environment.total_moles*(volume_rate/environment.volume)
var/transfer_moles = environment.total_moles*(volume_rate*scrub_rate/environment.volume)
var/datum/gas_mixture/removed = loc.remove_air(transfer_moles)
@@ -218,6 +221,9 @@
broadcast_status()
return //do not update_icon
if("setting" in signal.data)
scrub_rate = text2num(signal.data["setting"])
// log_admin("DEBUG \[[world.timeofday]\]: vent_scrubber/receive_signal: unknown command \"[signal.data["command"]]\"\n[signal.debug_print()]")
spawn(2)
broadcast_status()
+83 -73
View File
@@ -1,24 +1,29 @@
/obj/item/weapon/circuitboard/atmoscontrol
name = "Central Atmospherics Computer Circuitboard"
name = "\improper Central Atmospherics Computer Circuitboard"
build_path = "/obj/machinery/computer/security/atmoscontrol"
/obj/machinery/computer/atmoscontrol
name = "Central Atmospherics Computer"
name = "\improper Central Atmospherics Computer"
icon = 'computer.dmi'
icon_state = "computer_generic"
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 += src.specific()
dat += specific()
else
for(var/obj/machinery/alarm/alarm in world)
dat += "<a href='?src=\ref[src]&alarm=\ref[alarm]'>"
@@ -32,13 +37,23 @@
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)
dat += "<hr>[src.return_controls()]"
if(current.remote_control || overridden)
dat += "<hr>[return_controls()]"
return dat
//a bunch of this is copied from atmos alarms
@@ -69,24 +84,53 @@
//if("adjust_threshold") //was a good idea but required very wide window
if("set_threshold")
var/env = href_list["env"]
var/varname = href_list["var"]
var/datum/tlv/tlv = current.TLV[env]
var/newval = input("Enter [varname] for env", "Alarm triggers", tlv.vars[varname]) as num|null
var/threshold = text2num(href_list["var"])
var/list/selected = current.TLV[env]
var/list/thresholds = list("lower bound", "low warning", "high warning", "upper bound")
var/newval = input("Enter [thresholds[threshold]] for [env]", "Alarm triggers", selected[threshold]) as num|null
if (isnull(newval) || ..() || (current.locked && issilicon(usr)))
return
if (newval<0)
tlv.vars[varname] = -1.0
selected[threshold] = -1.0
else if (env=="temperature" && newval>5000)
tlv.vars[varname] = 5000
selected[threshold] = 5000
else if (env=="pressure" && newval>50*ONE_ATMOSPHERE)
tlv.vars[varname] = 50*ONE_ATMOSPHERE
selected[threshold] = 50*ONE_ATMOSPHERE
else if (env!="temperature" && env!="pressure" && newval>200)
tlv.vars[varname] = 200
selected[threshold] = 200
else
newval = round(newval,0.01)
tlv.vars[varname] = newval
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)
src.updateUsrDialog()
updateUsrDialog()
return
if(href_list["screen"])
@@ -98,14 +142,14 @@
if(href_list["atmos_alarm"])
if (current.alarm_area.atmosalert(2))
current.post_alert(2)
current.apply_danger_level(2)
spawn(1)
src.updateUsrDialog()
current.update_icon()
return
if(href_list["atmos_reset"])
if (current.alarm_area.atmosalert(0))
current.post_alert(0)
current.apply_danger_level(0)
spawn(1)
src.updateUsrDialog()
current.update_icon()
@@ -121,17 +165,6 @@
//copypasta from alarm code, changed to work with this without derping hard
//---START COPYPASTA----
#define AALARM_MODE_SCRUBBING 1
#define AALARM_MODE_VENTING 2 //makes draught
#define AALARM_MODE_PANIC 3 //constantly sucks all air
#define AALARM_MODE_REPLACEMENT 4 //sucks off all air, then refill and swithes to scrubbing
#define AALARM_MODE_OFF 5
#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>"
@@ -151,7 +184,7 @@
<HR>
"}
if (current.mode==AALARM_MODE_PANIC)
output += "<font color='red'><B>PANIC SYPHON ACTIVE</B></font><br><A href='?src=\ref[src];alarm=\ref[current];mode=[AALARM_MODE_OFF]'>turn syphoning off</A>"
output += "<font color='red'><B>PANIC SYPHON ACTIVE</B></font><br><A href='?src=\ref[src];alarm=\ref[current];mode=[AALARM_MODE_SCRUBBING]'>turn syphoning off</A>"
else
output += "<A href='?src=\ref[src];alarm=\ref[current];mode=[AALARM_MODE_PANIC]'><font color='red'><B>ACTIVATE PANIC SYPHON IN AREA</B></font></A>"
if (AALARM_SCREEN_VENT)
@@ -243,11 +276,11 @@ Nitrous Oxide
<a href='?src=\ref[src];alarm=\ref[current];screen=[AALARM_SCREEN_MAIN]'>Main menu</a><br>
<b>Air machinery mode for the area:</b><ul>"}
var/list/modes = list(
AALARM_MODE_SCRUBBING = "Filtering",
AALARM_MODE_VENTING = "Draught",
AALARM_MODE_PANIC = "<font color='red'>PANIC</font>",
AALARM_MODE_REPLACEMENT = "<font color='red'>REPLACE AIR</font>",
AALARM_MODE_OFF = "Off",
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>",
)
for (var/m=1,m<=modes.len,m++)
if (current.mode==m)
@@ -278,49 +311,26 @@ table tr:first-child th:first-child { border: none;}
"plasma" = "Toxin",
"other" = "Other",
)
var/list/thresholds = list("min2", "min1", "max1", "max2")
var/datum/tlv/tlv
var/list/tlv
for (var/g in gases)
output += {"
<TR><th>[gases[g]]</th>
"}
output += "<TR><th>[gases[g]]</th>"
tlv = current.TLV[g]
for (var/v in thresholds)
output += {"
<td>
<A href='?src=\ref[src];alarm=\ref[current];command=set_threshold;env=[g];var=[v]'>[tlv.vars[v]>=0?tlv.vars[v]:"OFF"]</A>
</td>
"}
output += {"
</TR>
"}
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] >= 0?tlv[i]:"OFF"]</A></td>"
output += "</TR>"
tlv = current.TLV["pressure"]
output += {"
<TR><th>Pressure</th>
"}
for (var/v in thresholds)
output += {"
<td>
<A href='?src=\ref[src];alarm=\ref[current];command=set_threshold;env=pressure;var=[v]'>[tlv.vars[v]>=0?tlv.vars[v]:"OFF"]</A>
</td>
"}
output += {"
</TR>
"}
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]>= 0?tlv[i]:"OFF"]</A></td>"
output += "</TR>"
tlv = current.TLV["temperature"]
output += {"
<TR><th>Temperature</th>
"}
for (var/v in thresholds)
output += {"
<td>
<A href='?src=\ref[src];alarm=\ref[current];command=set_threshold;env=temperature;var=[v]'>[tlv.vars[v]>=0?tlv.vars[v]:"OFF"]</A>
</td>
"}
output += {"
</TR>
"}
output += {"</table>"}
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]>= 0?tlv[i]:"OFF"]</A></td>"
output += "</TR>"
output += "</table>"
return output
//---END COPYPASTA----
+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
+2
View File
@@ -197,6 +197,8 @@ connection
del src
if(A.HasDoor(B) || B.HasDoor(A))
indirect = 1
else
indirect = 0
proc/Sanitize()
//If the zones change on connected turfs, update it.
+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
File diff suppressed because it is too large Load Diff
+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
+1 -1
View File
@@ -204,7 +204,7 @@
network = newnet
screen = 0
machines = list()
servers = list()
temp = "<font color = #336699>- NEW NETWORK TAG SET IN ADDRESS \[[network]\] -</font color>"
updateUsrDialog()
+3 -3
View File
@@ -12,7 +12,7 @@
icon_state = "comm_monitor"
var/screen = 0 // the screen number:
var/list/machines = list() // the machines located by the computer
var/list/t_machines = list() // the machines located by the computer
var/obj/machinery/telecomms/SelectedMachine
var/network = "NULL" // the network to probe
@@ -83,7 +83,7 @@
switch(href_list["operation"])
if("release")
machines = list()
t_machines = list()
screen = 0
if("mainmenu")
@@ -116,7 +116,7 @@
else
network = newnet
screen = 0
machines = list()
t_machines = list()
temp = "<font color = #336699>- NEW NETWORK TAG SET IN ADDRESS \[[network]\] -</font color>"
updateUsrDialog()
@@ -200,7 +200,7 @@
network = newnet
screen = 0
machines = list()
servers = list()
temp = "<font color = #336699>- NEW NETWORK TAG SET IN ADDRESS \[[network]\] -</font color>"
updateUsrDialog()
-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