Made air alarms non-retarded again. If you readd the Central Atmos Control thing again, it should work instantly. Also made firedoors deploy during atmos alarms, and made it so people need to actually answer a dialog box to open if they are powered and the area is locked down.

This commit is contained in:
SkyMarshal
2013-01-04 22:00:47 -07:00
parent 16d13c084c
commit fb6df3a698
6 changed files with 1072 additions and 979 deletions
-1
View File
@@ -324,7 +324,6 @@
#include "code\game\machinery\turrets.dm"
#include "code\game\machinery\vending.dm"
#include "code\game\machinery\washing_machine.dm"
#include "code\game\machinery\wishgranter.dm"
#include "code\game\machinery\atmoalter\area_atmos_computer.dm"
#include "code\game\machinery\atmoalter\canister.dm"
#include "code\game\machinery\atmoalter\meter.dm"
+2
View File
@@ -49,6 +49,8 @@ NOTE: there are two lists of areas in the end of this file: centcom and station
// (original area before splitting due to sd_DAL)
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 = 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*/
+32 -34
View File
@@ -10,7 +10,7 @@
/area/New()
icon_state = ""
layer = 10
master = src //moved outside the spawn(1) to avoid runtimes in lighting.dm when it references src.loc.loc.master ~Carn
master = src //moved outside the spawn(1) to avoid runtimes in lighting.dm when it references loc.loc.master ~Carn
uid = ++global_uid
related = list(src)
@@ -62,44 +62,44 @@
return
/area/proc/atmosalert(danger_level)
// if(src.type==/area) //No atmos alarms in space
// if(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)
//updateicon()
//mouse_opacity = 0
if (danger_level==2)
var/list/cameras = list()
for(var/area/RA in src.related)
//src.updateicon()
for(var/area/RA in related)
//updateicon()
for(var/obj/machinery/camera/C in RA)
cameras += C
for(var/mob/living/silicon/aiPlayer in player_list)
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 player_list)
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
/area/proc/firealert()
if(src.name == "Space") //no fire alarms in space
if(name == "Space") //no fire alarms in space
return
if (!( src.fire ))
src.fire = 1
src.updateicon()
src.mouse_opacity = 0
for(var/obj/machinery/door/firedoor/D in src)
if( !fire )
fire = 1
updateicon()
mouse_opacity = 0
for(var/obj/machinery/door/firedoor/D in all_doors)
if(!D.blocked)
if(D.operating)
D.nextstate = CLOSED
else if(!D.density)
spawn(0)
D.close()
spawn()
D.close()
var/list/cameras = list()
for (var/obj/machinery/camera/C in src)
cameras += C
@@ -107,14 +107,13 @@
aiPlayer.triggerAlarm("Fire", src, cameras, src)
for (var/obj/machinery/computer/station_alert/a in world)
a.triggerAlarm("Fire", src, cameras, src)
return
/area/proc/firereset()
if (src.fire)
src.fire = 0
src.mouse_opacity = 0
src.updateicon()
for(var/obj/machinery/door/firedoor/D in src)
if (fire)
fire = 0
mouse_opacity = 0
updateicon()
for(var/obj/machinery/door/firedoor/D in all_doors)
if(!D.blocked)
if(D.operating)
D.nextstate = OPEN
@@ -125,7 +124,6 @@
aiPlayer.cancelAlarm("Fire", src, src)
for (var/obj/machinery/computer/station_alert/a in world)
a.cancelAlarm("Fire", src, src)
return
/area/proc/readyalert()
if(name == "Space")
@@ -142,19 +140,19 @@
return
/area/proc/partyalert()
if(src.name == "Space") //no parties in space!!!
if(name == "Space") //no parties in space!!!
return
if (!( src.party ))
src.party = 1
src.updateicon()
src.mouse_opacity = 0
if (!( party ))
party = 1
updateicon()
mouse_opacity = 0
return
/area/proc/partyreset()
if (src.party)
src.party = 0
src.mouse_opacity = 0
src.updateicon()
if (party)
party = 0
mouse_opacity = 0
updateicon()
for(var/obj/machinery/door/firedoor/D in src)
if(!D.blocked)
if(D.operating)
@@ -273,7 +271,7 @@
A:client:ambience_playing = 1
A << sound('sound/ambience/shipambience.ogg', repeat = 1, wait = 0, volume = 35, channel = 2)
switch(src.name)
switch(name)
if ("Chapel") sound = pick('sound/ambience/ambicha1.ogg','sound/ambience/ambicha2.ogg','sound/ambience/ambicha3.ogg','sound/ambience/ambicha4.ogg')
if ("Morgue") sound = pick('sound/ambience/ambimo1.ogg','sound/ambience/ambimo2.ogg','sound/music/title2.ogg')
if ("Space") sound = pick('sound/ambience/ambispace.ogg','sound/music/title2.ogg',)
File diff suppressed because it is too large Load Diff
+127 -20
View File
@@ -1,26 +1,62 @@
/var/const/OPEN = 1
/var/const/CLOSED = 2
/obj/machinery/door/firedoor
name = "Firelock"
desc = "Apply crowbar"
icon = 'icons/obj/doors/Doorfire.dmi'
name = "\improper Emergency Shutter"
desc = "Emergency air-tight shutter, capable of sealing off breached areas."
icon = 'DoorHazard.dmi'
icon_state = "door_open"
req_access = list(access_atmospherics, access_engine_equip)
opacity = 0
density = 0
power_channel = ENVIRON
var/blocked = 0
var/nextstate = null
var/net_id
var/list/areas_added
var/list/users_to_open
New()
. = ..()
var/area/A = get_area(src)
ASSERT(istype(A))
A.all_doors.Add(src)
areas_added = list(A)
for(var/direction in cardinal)
A = get_area(get_step(src,direction))
if(istype(A) && !(A in areas_added))
A.all_doors.Add(src)
areas_added += A
Del()
for(var/area/A in areas_added)
A.all_doors.Remove(src)
. = ..()
examine()
set src in view()
. = ..()
if( islist(users_to_open) && users_to_open.len)
var/users_to_open_string = users_to_open[1]
if(users_to_open.len >= 2)
for(var/i = 2 to users_to_open.len)
users_to_open_string += ", [users_to_open[i]]"
usr << "These people have opened \the [src] during an alert: [users_to_open_string]."
Bumped(atom/AM)
if(p_open || operating) return
if(!density) return ..()
if(p_open || operating)
return
if(!density)
return ..()
return 0
power_change()
if(powered(power_channel))
if(powered(ENVIRON))
stat &= ~NOPOWER
else
stat |= NOPOWER
@@ -29,24 +65,95 @@
attackby(obj/item/weapon/C as obj, mob/user as mob)
add_fingerprint(user)
if(operating) return//Already doing something.
if(operating)
return//Already doing something.
if(istype(C, /obj/item/weapon/weldingtool))
var/obj/item/weapon/weldingtool/W = C
if(W.remove_fuel(0, user))
blocked = !blocked
user << text("\red You [blocked?"welded":"unwelded"] the [src]")
user.visible_message("\red \The [user] [blocked ? "welds" : "unwelds"] \the [src] with \a [W].",\
"You [blocked ? "weld" : "unweld"] \the [src] with \the [W].",\
"You hear something being welded.")
update_icon()
return
if(istype(C, /obj/item/weapon/crowbar) || (istype(C,/obj/item/weapon/twohanded/fireaxe) && C:wielded == 1))
if(blocked || operating) return
var/area/A = get_area(src)
ASSERT(istype(A))
if(A.master)
A = A.master
var/alarmed = A.air_doors_activated || A.fire
if( istype(C, /obj/item/weapon/crowbar) || ( istype(C,/obj/item/weapon/twohanded/fireaxe) && C:wielded == 1 ) )
if(operating)
return
if( blocked && istype(C, /obj/item/weapon/crowbar) )
user.visible_message("\red \The [user] pries at \the [src] with \a [C], but \the [src] is welded in place!",\
"You try to pry \the [src] [density ? "open" : "closed"], but it is welded in place!",\
"You hear someone struggle and metal straining.")
return
if( istype(C, /obj/item/weapon/crowbar) )
if( stat & (BROKEN|NOPOWER) || !density || !alarmed )
user.visible_message("\red \The [user] forces \the [src] [density ? "open" : "closed"] with \a [C]!",\
"You force \the [src] [density ? "open" : "closed"] with \the [C]!",\
"You hear metal strain, and a door [density ? "open" : "close"].")
else if( allowed(user) )
user.visible_message("\blue \The [user] lifts \the [src] with \a [C].",\
"\The [src] scans your ID, and obediently opens as you apply your [C].",\
"You hear metal move, and a door [density ? "open" : "close"].")
else
user.visible_message("\blue \The [user] pries at \the [src] with \a [C], but \the [src] resists being opened.",\
"\red You pry at \the [src], but it actively resists your efforts. Maybe use your ID, perhaps?",\
"You hear someone struggling and metal straining")
return
else
user.visible_message("\red \The [user] forces \the [ blocked ? "welded" : "" ] [src] [density ? "open" : "closed"] with \a [C]!",\
"You force \the [ blocked ? "welded" : "" ] [src] [density ? "open" : "closed"] with \the [C]!",\
"You hear metal strain and groan, and a door [density ? "open" : "close"].")
if(density)
spawn(0)
open()
else
spawn(0)
close()
if( !stat && ( istype(C, /obj/item/weapon/card/id) || istype(C, /obj/item/device/pda) ) )
var/obj/item/weapon/card/id/ID = C
if( istype(C, /obj/item/device/pda) )
var/obj/item/device/pda/pda = C
ID = pda.id
if(!istype(ID))
ID = null
var/answer = alert(user, "Would you like to [density ? "open" : "close"] this [src.name]?[ alarmed && density && !check_access(ID) ? "\nNote that by doing this, you acknowledge any damages from opening this [src.name]\nas being your own fault, and you will be held accountable under the law." : ""]",\
"\The [src]", "Yes, [density ? "open" : "close"]", "No")
if(answer == "No")
return
if(user.stat || !user.canmove || user.stunned || user.weakened || user.paralysis || get_dist(src, user) > 1)
user << "Sorry, you must remain able bodied and close to \the [src] in order to use it."
return
if(alarmed && density && !check_access(ID) && ( ID && !( ID.registered_name in users_to_open ) ) )
user.visible_message("\red \The [src] opens for \the [user], but only after they acknowledged responsibility for the consequences.",\
"\The [src] opens after you acknowledge the consequences.",\
"You hear a beep, and a door opening.")
if(ID && ID.registered_name)
if(!users_to_open)
users_to_open = list()
users_to_open += ID.registered_name
else
user.visible_message("\blue \The [src] [density ? "open" : "close"]s for \the [user].",\
"\The [src] [density ? "open" : "close"]s.",\
"You hear a beep, and a door opening.")
if(density)
open()
return
else //close it up again //fucking 10/10 commenting here einstein
else
close()
return
return
if(alarmed && !density)
spawn(100)
nextstate = CLOSED
process()
@@ -54,9 +161,11 @@
return
switch(nextstate)
if(OPEN)
open()
spawn()
open()
if(CLOSED)
close()
spawn()
close()
nextstate = null
return
@@ -83,6 +192,4 @@
return
//border_only fire doors are special when it comes to air groups
/obj/machinery/door/firedoor/border_only
+2 -1
View File
@@ -4,7 +4,8 @@
Bumped(atom/AM)
if(src.locked) return
if(src.locked)
return
..()
return