Atmo updates

This commit is contained in:
ZomgPonies
2013-10-14 01:28:18 -04:00
parent 29a73ce80e
commit 74eab5cd98
12 changed files with 296 additions and 211 deletions
+1 -1
View File
@@ -151,7 +151,7 @@ var/global/ZAS_Settings/zas_settings = new
// N3X15 - Ice is disabled by default, per Pomf's request.
/datum/ZAS_Setting/ice_formation
name="Airflow - Enable Ice Formation"
value = 0
value = 1
desc="1=yes, 0=no - Slippin' and slidin' when pressure > 10kPa and temperature < 273K"
valtype=ZAS_TYPE_BOOLEAN
+12 -9
View File
@@ -369,12 +369,19 @@ Max Output Pressure: [output_pressure] kPa<BR>"}
Rate: [volume_rate] L/sec<BR>"}
if(automation)
output += "Automated Fuel Injection: <A href='?src=\ref[src];toggle_automation=1'>Engaged</A><BR>"
output += "Injector Controls Locked Out<BR>"
else
output += "Automated Fuel Injection: <A href='?src=\ref[src];toggle_automation=1'>Disengaged</A><BR>"
output += "Injector: <A href='?src=\ref[src];toggle_injector=1'>Toggle Power</A> <A href='?src=\ref[src];injection=1'>Inject (1 Cycle)</A><BR>"
// AUTOFIXED BY fix_string_idiocy.py
// C:\Users\Rob\Documents\Projects\vgstation13\code\game\machinery\atmo_control.dm:372: output += "Automated Fuel Injection: <A href='?src=\ref[src];toggle_automation=1'>Engaged</A><BR>"
output += {"Automated Fuel Injection: <A href='?src=\ref[src];toggle_automation=1'>Engaged</A><BR>
Injector Controls Locked Out<BR>"}
// END AUTOFIX
else
// AUTOFIXED BY fix_string_idiocy.py
// C:\Users\Rob\Documents\Projects\vgstation13\code\game\machinery\atmo_control.dm:375: output += "Automated Fuel Injection: <A href='?src=\ref[src];toggle_automation=1'>Disengaged</A><BR>"
output += {"Automated Fuel Injection: <A href='?src=\ref[src];toggle_automation=1'>Disengaged</A><BR>
Injector: <A href='?src=\ref[src];toggle_injector=1'>Toggle Power</A> <A href='?src=\ref[src];injection=1'>Inject (1 Cycle)</A><BR>"}
// END AUTOFIX
else
output += "<FONT color='red'>ERROR: Can not find device</FONT> <A href='?src=\ref[src];refresh_status=1'>Search</A><BR>"
@@ -442,7 +449,3 @@ Rate: [volume_rate] L/sec<BR>"}
)
radio_connection.post_signal(src, signal, filter = RADIO_ATMOSIA)
@@ -19,6 +19,7 @@
scanscrubbers()
attack_ai(var/mob/user as mob)
src.add_hiddenprint(user)
return src.attack_hand(user)
attack_paw(var/mob/user as mob)
+49 -6
View File
@@ -17,6 +17,17 @@
volume = 1000
use_power = 0
var/release_log = ""
var/busy = 0
/* m_amt=10*CC_PER_SHEET_METAL
// Need to redefine /obj/item's recyk method
/obj/machinery/portable_atmospherics/canister/recycle(var/obj/machinery/mineral/processing_unit/recycle/rec)
if (src.m_amt == 0 && src.g_amt == 0)
return 0
rec.iron += src.m_amt/CC_PER_SHEET_METAL
rec.glass += src.g_amt/CC_PER_SHEET_GLASS
return 1
*/
/obj/machinery/portable_atmospherics/canister/sleeping_agent
name = "Canister: \[N2O\]"
@@ -174,6 +185,14 @@
return
/obj/machinery/portable_atmospherics/canister/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
if(iswelder(W) && src.destroyed)
if(weld(W, user))
user << "\blue You salvage whats left of \the [src]"
var/obj/item/stack/sheet/metal/M = new /obj/item/stack/sheet/metal(src.loc)
M.amount = 3
del src
return
if(!istype(W, /obj/item/weapon/wrench) && !istype(W, /obj/item/weapon/tank) && !istype(W, /obj/item/device/analyzer) && !istype(W, /obj/item/device/pda))
visible_message("\red [user] hits the [src] with a [W]!")
src.health -= W.force
@@ -196,6 +215,7 @@
..()
/obj/machinery/portable_atmospherics/canister/attack_ai(var/mob/user as mob)
src.add_hiddenprint(user)
return src.attack_hand(user)
/obj/machinery/portable_atmospherics/canister/attack_paw(var/mob/user as mob)
@@ -243,17 +263,18 @@ Release Pressure: <A href='?src=\ref[src];pressure_adj=-1000'>-</A> <A href='?sr
if(href_list["toggle"])
if (valve_open)
if (holding)
release_log += "Valve was <b>closed</b> by [usr], stopping the transfer into the [holding]<br>"
release_log += "Valve was <b>closed</b> by [usr]([ckey(usr.key)]), stopping the transfer into the [holding]<br>"
else
release_log += "Valve was <b>closed</b> by [usr], stopping the transfer into the <font color='red'><b>air</b></font><br>"
release_log += "Valve was <b>closed</b> by [usr]([ckey(usr.key)]), stopping the transfer into the <font color='red'><b>air</b></font><br>"
else
if (holding)
release_log += "Valve was <b>opened</b> by [usr], starting the transfer into the [holding]<br>"
release_log += "Valve was <b>opened</b> by [usr]([ckey(usr.key)]), starting the transfer into the [holding]<br>"
else
if(src.air_contents.toxins > 0 || (locate(/datum/gas/sleeping_agent) in src.air_contents.trace_gases))
message_admins("[usr]([ckey(usr.key)]) opened a canister that contains plasma at [loc.x], [loc.y], [loc.z]")
var/datum/gas/sleeping_agent/S = locate() in src.air_contents.trace_gases
if(src.air_contents.toxins > 0 || (istype(S)))
message_admins("[usr.real_name] ([formatPlayerPanel(usr,usr.ckey)]) opened a canister that contains \[[src.air_contents.toxins > 0 ? "Toxins " : ""] [istype(S) ? "N2O" : ""]\] at [formatJumpTo(loc)]!")
log_admin("[usr]([ckey(usr.key)]) opened a canister that contains plasma at [loc.x], [loc.y], [loc.z]")
release_log += "Valve was <b>opened</b> by [usr], starting the transfer into the <font color='red'><b>air</b></font><br>"
release_log += "Valve was <b>opened</b> by [usr]([ckey(usr.key)]), starting the transfer into the <font color='red'><b>air</b></font><br>"
valve_open = !valve_open
if (href_list["remove_tank"])
@@ -323,6 +344,7 @@ Release Pressure: <A href='?src=\ref[src];pressure_adj=-1000'>-</A> <A href='?sr
src.update_icon()
return 1
//Dirty way to fill room with gas. However it is a bit easier to do than creating some floor/engine/n2o -rastaf0
/obj/machinery/portable_atmospherics/canister/sleeping_agent/roomfiller/New()
..()
@@ -337,6 +359,7 @@ Release Pressure: <A href='?src=\ref[src];pressure_adj=-1000'>-</A> <A href='?sr
air_contents = new
return 1
/obj/machinery/portable_atmospherics/canister/nitrogen/New()
..()
@@ -366,3 +389,23 @@ Release Pressure: <A href='?src=\ref[src];pressure_adj=-1000'>-</A> <A href='?sr
src.update_icon()
return 1
/obj/machinery/portable_atmospherics/canister/proc/weld(var/obj/item/weapon/weldingtool/WT, var/mob/user)
if(busy)
return 0
if(!WT.isOn())
return 0
// Do after stuff here
user << "<span class='notice'>You start to slice away at \the [src]...</span>"
playsound(src.loc, 'sound/items/Welder.ogg', 50, 1)
WT.eyecheck(user)
busy = 1
if(do_after(user, 50))
busy = 0
if(!WT.isOn())
return 0
return 1
busy = 0
return 0
+7 -1
View File
@@ -24,6 +24,9 @@
/obj/machinery/meter/process()
if(!target)
icon_state = "meterX"
// Pop the meter off when the pipe we're attached to croaks.
new /obj/item/pipe_meter(src.loc)
spawn(0) del(src)
return 0
if(stat & (BROKEN|NOPOWER))
@@ -35,6 +38,9 @@
var/datum/gas_mixture/environment = target.return_air()
if(!environment)
icon_state = "meterX"
// Pop the meter off when the environment we're attached to croaks.
new /obj/item/pipe_meter(src.loc)
spawn(0) del(src)
return 0
var/env_pressure = environment.return_pressure()
@@ -130,4 +136,4 @@
src.target = loc
/obj/machinery/meter/turf/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
return
return
+1
View File
@@ -91,6 +91,7 @@
return air_contents
/obj/machinery/portable_atmospherics/pump/attack_ai(var/mob/user as mob)
src.add_hiddenprint(user)
return src.attack_hand(user)
/obj/machinery/portable_atmospherics/pump/attack_paw(var/mob/user as mob)
@@ -147,6 +147,7 @@
return air_contents
/obj/machinery/portable_atmospherics/scrubber/attack_ai(var/mob/user as mob)
src.add_hiddenprint(user)
return src.attack_hand(user)
/obj/machinery/portable_atmospherics/scrubber/attack_paw(var/mob/user as mob)
+156 -186
View File
@@ -15,117 +15,147 @@
var/list/areas_added
var/list/users_to_open
New()
. = ..()
for(var/obj/machinery/door/firedoor/F in loc)
if(F != src)
spawn(1)
del src
return .
var/area/A = get_area(src)
ASSERT(istype(A))
/obj/machinery/door/firedoor/New()
. = ..()
for(var/obj/machinery/door/firedoor/F in loc)
if(F != src)
spawn(1)
del src
return .
var/area/A = get_area(src)
ASSERT(istype(A))
A.all_doors.Add(src)
areas_added = list(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
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)
. = ..()
/obj/machinery/door/firedoor/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]."
/obj/machinery/door/firedoor/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)
/obj/machinery/door/firedoor/Bumped(atom/AM)
if(p_open || operating)
return
if(!density)
return ..()
if(istype(AM, /obj/mecha))
var/obj/mecha/mecha = AM
if (mecha.occupant)
var/mob/M = mecha.occupant
if(world.time - M.last_bumped <= 10) return //Can bump-open one airlock per second. This is to prevent popup message spam.
M.last_bumped = world.time
attack_hand(M)
return 0
/obj/machinery/door/firedoor/power_change()
if(powered(ENVIRON))
stat &= ~NOPOWER
else
stat |= NOPOWER
return
/obj/machinery/door/firedoor/attack_hand(mob/user as mob)
add_fingerprint(user)
if(operating)
return//Already doing something.
if(blocked)
user << "<span class='warning'>\The [src] is welded solid!</span>"
return
if(!allowed(user))
user << "<span class='warning'>Access denied.</span>"
return
var/area/A = get_area(src)
ASSERT(istype(A))
if(A.master)
A = A.master
var/alarmed = A.air_doors_activated || A.fire
var/answer = alert(user, "Would you like to [density ? "open" : "close"] this [src.name]?[ alarmed && density ? "\nNote that by doing so, you acknowledge any damages from opening this\n[src.name] as 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
var/needs_to_close = 0
if(density)
if(alarmed)
needs_to_close = 1
spawn()
open()
else
spawn()
close()
if(needs_to_close)
spawn(50)
if(alarmed)
nextstate = CLOSED
/obj/machinery/door/firedoor/attackby(obj/item/weapon/C as obj, mob/user as mob)
add_fingerprint(user)
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.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(!density)
return ..()
if(istype(AM, /obj/mecha))
var/obj/mecha/mecha = AM
if (mecha.occupant)
var/mob/M = mecha.occupant
if(world.time - M.last_bumped <= 10) return //Can bump-open one airlock per second. This is to prevent popup message spam.
M.last_bumped = world.time
attack_hand(M)
return 0
power_change()
if(powered(ENVIRON))
stat &= ~NOPOWER
latetoggle()
else
stat |= NOPOWER
if(blocked)
user << "\red \The [src] is welded solid!"
return
attack_hand(mob/user as mob)
return attackby(null, user)
attackby(obj/item/weapon/C as obj, mob/user as mob)
add_fingerprint(user)
if( istype(C, /obj/item/weapon/crowbar) || ( istype(C,/obj/item/weapon/twohanded/fireaxe) && C:wielded == 1 ) )
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.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(blocked)
user << "\red \The [src] is welded solid!"
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( 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) || ( 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
user.visible_message("\red \The [user] starts to force \the [src] [density ? "open" : "closed"] with \a [C]!",\
"You start forcing \the [src] [density ? "open" : "closed"] with \the [C]!",\
"You hear metal strain.")
if(do_after(user,30))
if( istype(C, /obj/item/weapon/crowbar) )
if( stat & (BROKEN|NOPOWER) || !density || !alarmed )
if( stat & (BROKEN|NOPOWER) || !density)
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]!",\
@@ -137,110 +167,50 @@
spawn(0)
close()
return
var/access_granted = 0
var/users_name
if(!istype(C, /obj)) //If someone hit it with their hand. We need to see if they are allowed.
if(allowed(user))
access_granted = 1
if(ishuman(user))
users_name = FindNameFromID(user)
else
users_name = "Unknown"
if( ishuman(user) && !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
if(ID)
users_name = ID.registered_name
if(check_access(ID))
access_granted = 1
var/answer = alert(user, "Would you like to [density ? "open" : "close"] this [src.name]?[ alarmed && density && !access_granted ? "\nNote that by doing so, you acknowledge any damages from opening this\n[src.name] as 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 && !access_granted && !( users_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(!users_to_open)
users_to_open = list()
users_to_open += users_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.")
var/needs_to_close = 0
if(density)
if(alarmed)
needs_to_close = 1
spawn()
open()
else
spawn()
close()
if(needs_to_close)
spawn(50)
if(alarmed)
nextstate = CLOSED
proc/latetoggle()
if(operating || stat & NOPOWER || !nextstate)
return
switch(nextstate)
if(OPEN)
nextstate = null
open()
if(CLOSED)
nextstate = null
close()
/obj/machinery/door/firedoor/proc/latetoggle()
if(operating || stat & NOPOWER || !nextstate)
return
switch(nextstate)
if(OPEN)
nextstate = null
open()
if(CLOSED)
nextstate = null
close()
return
open()
..()
latetoggle()
return
/obj/machinery/door/firedoor/close()
latetoggle()
return ..()
close()
..()
latetoggle()
return
/obj/machinery/door/firedoor/open()
latetoggle()
return ..()
door_animate(animation)
switch(animation)
if("opening")
flick("door_opening", src)
if("closing")
flick("door_closing", src)
return
/obj/machinery/door/firedoor/door_animate(animation)
switch(animation)
if("opening")
flick("door_opening", src)
if("closing")
flick("door_closing", src)
return
update_icon()
overlays.Cut()
if(density)
icon_state = "door_closed"
if(blocked)
overlays += "welded"
else
icon_state = "door_open"
if(blocked)
overlays += "welded_open"
return
/obj/machinery/door/firedoor/update_icon()
overlays.Cut()
if(density)
icon_state = "door_closed"
if(blocked)
overlays += "welded"
else
icon_state = "door_open"
if(blocked)
overlays += "welded_open"
return
@@ -286,4 +256,4 @@
/obj/machinery/door/firedoor/multi_tile
icon = 'icons/obj/doors/DoorHazard2x1.dmi'
width = 2
width = 2
@@ -0,0 +1,36 @@
/obj/item/weapon/implant/deadman
name = "deadman switch implant"
desc = "Activates a signal on death."
var/obj/item/device/assembly/signaler/signaler
icon_state = "implant_evil"
get_data()
var/dat = {"
<b>Implant Specifications:</b><BR>
<b>Name:</b> Robust Corp RX-79 Deadman Switch Implant<BR>
<b>Life:</b> Activates upon death.<BR>
<b>Important Notes:</b> Sends triggering signal<BR>
<HR>
<b>Implant Details:</b><BR>
<b>Function:</b> Contains a compact, electric signaller that activates upon host death.<BR>
<b>Integrity:</b> Implant will occasionally be degraded by the body's immune system and thus will occasionally malfunction."}
return dat
implanted(mob/source as mob)
signaler = new /obj/item/device/assembly/signaler(src)
signaler.interact(source)
usr.mind.store_memory("Deadman switch will broadcast signal on <B>[signaler.frequency]</B> using encryption <B>[signaler.code]</B>.", 0, 0)
usr << "Deadman switch will broadcast signal on <B>[signaler.frequency]</B> using encryption <B>[signaler.code]</B>."
trigger(emote, source as mob)
if(emote == "deathgasp")
src.activate("death")
return
activate(var/cause)
if((!cause) || (!src.imp_in)) return 0
signaler.signal()
islegal()
return 0
+23
View File
@@ -1143,3 +1143,26 @@ proc/move_alien_ship()
else
alien_ship_location = 1
return
proc/formatJumpTo(var/location,var/where="")
var/turf/loc
if(istype(location,/turf/))
loc = location
else
loc = get_turf(location)
if(where=="")
where=formatLocation(loc)
return "<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[loc.x];Y=[loc.y];Z=[loc.z]'>[where]</a>"
proc/formatLocation(var/location)
var/turf/loc
if(istype(location,/turf/))
loc = location
else
loc = get_turf(location)
var/area/A = get_area(location)
return "[A.name] - [loc.x],[loc.y],[loc.z]"
proc/formatPlayerPanel(var/mob/U,var/text="PP")
return "<A HREF='?_src_=holder;adminplayeropts=\ref[U]'>[text]</A>"