April sync (#360)

* Maps and things no code/icons

* helpers defines globalvars

* Onclick world.dm orphaned_procs

* subsystems

Round vote and shuttle autocall done here too

* datums

* Game folder

* Admin - chatter modules

* clothing - mining

* modular computers - zambies

* client

* mob level 1

* mob stage 2 + simple_animal

* silicons n brains

* mob stage 3 + Alien/Monkey

* human mobs

* icons updated

* some sounds

* emitter y u no commit

* update tgstation.dme

* compile fixes

* travis fixes

Also removes Fast digest mode, because reasons.

* tweaks for travis Mentors are broke again

Also fixes Sizeray guns

* oxygen loss fix for vore code.

* removes unused code

* some code updates

* bulk fixes

* further fixes

* outside things

* whoops.

* Maint bar ported

* GLOBs.
This commit is contained in:
Poojawa
2017-04-13 23:37:00 -05:00
committed by GitHub
parent cdc32c98fa
commit 7e9b96a00f
1322 changed files with 174827 additions and 23888 deletions
@@ -54,7 +54,7 @@
idle_power_usage = 4
active_power_usage = 8
power_channel = ENVIRON
req_access = list(access_atmospherics)
req_access = list(GLOB.access_atmospherics)
obj_integrity = 250
max_integrity = 250
integrity_failure = 80
@@ -158,7 +158,7 @@
return UI_CLOSE
/obj/machinery/airalarm/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, \
datum/tgui/master_ui = null, datum/ui_state/state = default_state)
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
ui = new(user, src, ui_key, "airalarm", name, 440, 650, master_ui, state)
@@ -277,11 +277,11 @@
thresholds[thresholds.len]["settings"] += list(list("env" = "temperature", "val" = "max1", "selected" = selected.max1))
thresholds[thresholds.len]["settings"] += list(list("env" = "temperature", "val" = "max2", "selected" = selected.max2))
for(var/gas_id in meta_gas_info)
for(var/gas_id in GLOB.meta_gas_info)
if(!(gas_id in TLV)) // We're not interested in this gas, it seems.
continue
selected = TLV[gas_id]
thresholds += list(list("name" = meta_gas_info[gas_id][META_GAS_NAME], "settings" = list()))
thresholds += list(list("name" = GLOB.meta_gas_info[gas_id][META_GAS_NAME], "settings" = list()))
thresholds[thresholds.len]["settings"] += list(list("env" = gas_id, "val" = "min2", "selected" = selected.min2))
thresholds[thresholds.len]["settings"] += list(list("env" = gas_id, "val" = "min1", "selected" = selected.min1))
thresholds[thresholds.len]["settings"] += list(list("env" = gas_id, "val" = "max1", "selected" = selected.max1))
@@ -389,7 +389,7 @@
/obj/machinery/airalarm/proc/set_frequency(new_frequency)
SSradio.remove_object(src, frequency)
frequency = new_frequency
radio_connection = SSradio.add_object(src, frequency, RADIO_TO_AIRALARM)
radio_connection = SSradio.add_object(src, frequency, GLOB.RADIO_TO_AIRALARM)
/obj/machinery/airalarm/proc/send_signal(target, list/command)//sends signal 'command' to 'target'. Returns 0 if no radio connection, 1 otherwise
if(!radio_connection)
@@ -403,7 +403,7 @@
signal.data["tag"] = target
signal.data["sigtype"] = "command"
radio_connection.post_signal(src, signal, RADIO_FROM_AIRALARM)
radio_connection.post_signal(src, signal, GLOB.RADIO_FROM_AIRALARM)
// to_chat(world, text("Signal [] Broadcasted to []", command, target))
return 1
@@ -730,3 +730,14 @@
I.obj_integrity = I.max_integrity * 0.5
new /obj/item/stack/cable_coil(loc, 3)
qdel(src)
#undef AALARM_MODE_SCRUBBING
#undef AALARM_MODE_VENTING
#undef AALARM_MODE_PANIC
#undef AALARM_MODE_REPLACEMENT
#undef AALARM_MODE_OFF
#undef AALARM_MODE_FLOOD
#undef AALARM_MODE_SIPHON
#undef AALARM_MODE_CONTAMINATED
#undef AALARM_MODE_REFILL
#undef AALARM_REPORT_TIMEOUT
@@ -67,7 +67,7 @@ Pipelines + Other Objects -> Pipe network
node_connects.len = device_type
for(DEVICE_TYPE_LOOP)
for(var/D in cardinal)
for(var/D in GLOB.cardinal)
if(D & GetInitDirections())
if(D in node_connects)
continue
@@ -170,7 +170,7 @@ Pipelines + Other Objects -> Pipe network
var/fuck_you_dir = get_dir(src, user) // Because fuck you...
if(!fuck_you_dir)
fuck_you_dir = pick(cardinal)
fuck_you_dir = pick(GLOB.cardinal)
var/turf/target = get_edge_target_turf(user, fuck_you_dir)
var/range = pressures/250
var/speed = range/5
@@ -212,7 +212,7 @@ Pipelines + Other Objects -> Pipe network
if(can_unwrench)
add_atom_colour(obj_color, FIXED_COLOUR_PRIORITY)
pipe_color = obj_color
var/turf/T = loc
var/turf/T = get_turf(src)
level = T.intact ? 2 : 1
atmosinit()
var/list/nodes = pipeline_expansion()
@@ -245,7 +245,7 @@ Pipelines + Other Objects -> Pipe network
var/obj/machinery/atmospherics/target_move = findConnecting(direction)
if(target_move)
if(target_move.can_crawl_through())
if(is_type_in_list(target_move, ventcrawl_machinery))
if(is_type_in_list(target_move, GLOB.ventcrawl_machinery))
user.forceMove(target_move.loc) //handle entering and so on.
user.visible_message("<span class='notice'>You hear something squeezing through the ducts...</span>","<span class='notice'>You climb out the ventilation system.")
else
@@ -258,7 +258,7 @@ Pipelines + Other Objects -> Pipe network
user.last_played_vent = world.time
playsound(src, 'sound/machines/ventcrawl.ogg', 50, 1, -3)
else
if((direction & initialize_directions) || is_type_in_list(src, ventcrawl_machinery) && can_crawl_through()) //if we move in a way the pipe can connect, but doesn't - or we're in a vent
if((direction & initialize_directions) || is_type_in_list(src, GLOB.ventcrawl_machinery) && can_crawl_through()) //if we move in a way the pipe can connect, but doesn't - or we're in a vent
user.forceMove(src.loc)
user.visible_message("<span class='notice'>You hear something squeezing through the ducts...</span>","<span class='notice'>You climb out the ventilation system.")
user.canmove = 0
@@ -267,7 +267,7 @@ Pipelines + Other Objects -> Pipe network
/obj/machinery/atmospherics/AltClick(mob/living/L)
if(is_type_in_list(src, ventcrawl_machinery))
if(is_type_in_list(src, GLOB.ventcrawl_machinery))
L.handle_ventcrawl(src)
return
..()
@@ -126,7 +126,7 @@ Acts like a normal vent, but has an input AND output.
SSradio.remove_object(src, frequency)
frequency = new_frequency
if(frequency)
radio_connection = SSradio.add_object(src, frequency, filter = RADIO_ATMOSIA)
radio_connection = SSradio.add_object(src, frequency, filter = GLOB.RADIO_ATMOSIA)
/obj/machinery/atmospherics/components/binary/dp_vent_pump/proc/broadcast_status()
if(!radio_connection)
@@ -147,7 +147,7 @@ Acts like a normal vent, but has an input AND output.
"external" = external_pressure_bound,
"sigtype" = "status"
)
radio_connection.post_signal(src, signal, filter = RADIO_ATMOSIA)
radio_connection.post_signal(src, signal, filter = GLOB.RADIO_ATMOSIA)
return 1
@@ -70,7 +70,7 @@ Passive gate is similar to the regular pump except:
SSradio.remove_object(src, frequency)
frequency = new_frequency
if(frequency)
radio_connection = SSradio.add_object(src, frequency, filter = RADIO_ATMOSIA)
radio_connection = SSradio.add_object(src, frequency, filter = GLOB.RADIO_ATMOSIA)
/obj/machinery/atmospherics/components/binary/passive_gate/proc/broadcast_status()
if(!radio_connection)
@@ -88,12 +88,12 @@ Passive gate is similar to the regular pump except:
"sigtype" = "status"
)
radio_connection.post_signal(src, signal, filter = RADIO_ATMOSIA)
radio_connection.post_signal(src, signal, filter = GLOB.RADIO_ATMOSIA)
return 1
/obj/machinery/atmospherics/components/binary/passive_gate/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, \
datum/tgui/master_ui = null, datum/ui_state/state = default_state)
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
ui = new(user, src, ui_key, "atmos_pump", name, 335, 115, master_ui, state)
@@ -77,7 +77,7 @@ Thus, the two variables affect pump operation are set in New():
SSradio.remove_object(src, frequency)
frequency = new_frequency
if(frequency)
radio_connection = SSradio.add_object(src, frequency, filter = RADIO_ATMOSIA)
radio_connection = SSradio.add_object(src, frequency, filter = GLOB.RADIO_ATMOSIA)
/obj/machinery/atmospherics/components/binary/pump/proc/broadcast_status()
if(!radio_connection)
@@ -95,12 +95,12 @@ Thus, the two variables affect pump operation are set in New():
"sigtype" = "status"
)
radio_connection.post_signal(src, signal, filter = RADIO_ATMOSIA)
radio_connection.post_signal(src, signal, filter = GLOB.RADIO_ATMOSIA)
return 1
/obj/machinery/atmospherics/components/binary/pump/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, \
datum/tgui/master_ui = null, datum/ui_state/state = default_state)
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
ui = new(user, src, ui_key, "atmos_pump", name, 335, 115, master_ui, state)
@@ -95,7 +95,7 @@ Thus, the two variables affect pump operation are set in New():
return 1
/obj/machinery/atmospherics/components/binary/volume_pump/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, \
datum/tgui/master_ui = null, datum/ui_state/state = default_state)
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
ui = new(user, src, ui_key, "atmos_pump", name, 310, 115, master_ui, state)
@@ -31,7 +31,7 @@ Iconnery
/obj/machinery/atmospherics/components/proc/icon_addbroken(var/connected = 0)
var/unconnected = (~connected) & initialize_directions
for(var/direction in cardinal)
for(var/direction in GLOB.cardinal)
if(unconnected & direction)
underlays += getpipeimage('icons/obj/atmospherics/components/binary_devices.dmi', "pipe_exposed", direction)
@@ -17,7 +17,7 @@
SSradio.remove_object(src, frequency)
frequency = new_frequency
if(frequency)
radio_connection = SSradio.add_object(src, frequency, RADIO_ATMOSIA)
radio_connection = SSradio.add_object(src, frequency, GLOB.RADIO_ATMOSIA)
/obj/machinery/atmospherics/components/trinary/filter/Destroy()
if(SSradio)
@@ -26,7 +26,7 @@
/obj/machinery/atmospherics/components/trinary/filter/update_icon()
cut_overlays()
for(var/direction in cardinal)
for(var/direction in GLOB.cardinal)
if(direction & initialize_directions)
var/obj/machinery/atmospherics/node = findConnecting(direction)
if(node)
@@ -113,7 +113,7 @@
return ..()
/obj/machinery/atmospherics/components/trinary/filter/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, \
datum/tgui/master_ui = null, datum/ui_state/state = default_state)
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
ui = new(user, src, ui_key, "atmos_filter", name, 475, 155, master_ui, state)
@@ -154,9 +154,9 @@
filter_type = ""
var/filter_name = "nothing"
var/gas = params["mode"]
if(gas in meta_gas_info)
if(gas in GLOB.meta_gas_info)
filter_type = gas
filter_name = meta_gas_info[gas][META_GAS_NAME]
filter_name = GLOB.meta_gas_info[gas][META_GAS_NAME]
investigate_log("was set to filter [filter_name] by [key_name(usr)]", "atmos")
. = TRUE
update_icon()
@@ -19,7 +19,7 @@
/obj/machinery/atmospherics/components/trinary/mixer/update_icon()
cut_overlays()
for(var/direction in cardinal)
for(var/direction in GLOB.cardinal)
if(direction & initialize_directions)
var/obj/machinery/atmospherics/node = findConnecting(direction)
if(node)
@@ -117,7 +117,7 @@
return TRUE
/obj/machinery/atmospherics/components/trinary/mixer/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, \
datum/tgui/master_ui = null, datum/ui_state/state = default_state)
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
ui = new(user, src, ui_key, "atmos_mixer", name, 370, 165, master_ui, state)
@@ -12,7 +12,7 @@
state_open = FALSE
var/autoeject = FALSE
var/volume = 100
var/running_bob_animation = 0
var/running_bob_animation = FALSE
var/efficiency = 1
var/sleep_factor = 750
@@ -106,7 +106,7 @@
icon_state = "pod1"
var/up = 0 //used to see if we are going up or down, 1 is down, 2 is up
spawn(0) // Without this, the icon update will block. The new thread will die once the occupant leaves.
running_bob_animation = 1
running_bob_animation = TRUE
while(occupant)
overlays -= "lid1" //have to remove the overlays first, to force an update- remove cloning pod overlay
overlays -= pickle //remove mob overlay
@@ -134,7 +134,7 @@
sleep(7) //don't want to jiggle violently, just slowly bob
return
running_bob_animation = 0
running_bob_animation = FALSE
else
icon_state = "pod1"
overlays += "lid0" //have to remove the overlays first, to force an update- remove cloning pod overlay
@@ -160,7 +160,7 @@
playsound(T, 'sound/machines/cryo_warning.ogg', volume, 1) // Bug the doctors.
radio.talk_into(src, "Patient fully restored", radio_channel)
if(autoeject) // Eject if configured.
radio.talk_into(src, "Auto ejecting patient now", radio_channel)
radio.talk_into(src, "Auto ejecting patient now", radio_channel,get_spans(), get_default_language())
open_machine()
return
else if(occupant.stat == DEAD) // We don't bother with dead people.
@@ -280,7 +280,7 @@
return ..()
/obj/machinery/atmospherics/components/unary/cryo_cell/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, \
datum/tgui/master_ui = null, datum/ui_state/state = notcontained_state)
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.notcontained_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
ui = new(user, src, ui_key, "cryo", name, 400, 550, master_ui, state)
@@ -146,7 +146,7 @@
return UI_CLOSE
/obj/machinery/atmospherics/components/unary/thermomachine/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, \
datum/tgui/master_ui = null, datum/ui_state/state = default_state)
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
ui = new(user, src, ui_key, "thermomachine", name, 400, 240, master_ui, state)
@@ -7,7 +7,7 @@
/obj/machinery/atmospherics/components/unary/vent_pump
name = "air vent"
desc = "Has a valve and pump attached to it"
desc = "Has a valve and pump attached to it."
icon_state = "vent_map"
use_power = 1
can_unwrench = 1
@@ -178,8 +178,8 @@
/obj/machinery/atmospherics/components/unary/vent_pump/atmosinit()
//some vents work his own spesial way
radio_filter_in = frequency==1439?(RADIO_FROM_AIRALARM):null
radio_filter_out = frequency==1439?(RADIO_TO_AIRALARM):null
radio_filter_in = frequency==1439?(GLOB.RADIO_FROM_AIRALARM):null
radio_filter_out = frequency==1439?(GLOB.RADIO_TO_AIRALARM):null
if(frequency)
set_frequency(frequency)
broadcast_status()
@@ -3,7 +3,7 @@
/obj/machinery/atmospherics/components/unary/vent_scrubber
name = "air scrubber"
desc = "Has a valve and pump attached to it"
desc = "Has a valve and pump attached to it."
icon_state = "scrub_map"
use_power = 1
idle_power_usage = 10
@@ -142,8 +142,8 @@
return 1
/obj/machinery/atmospherics/components/unary/vent_scrubber/atmosinit()
radio_filter_in = frequency==initial(frequency)?(RADIO_FROM_AIRALARM):null
radio_filter_out = frequency==initial(frequency)?(RADIO_TO_AIRALARM):null
radio_filter_in = frequency==initial(frequency)?(GLOB.RADIO_FROM_AIRALARM):null
radio_filter_out = frequency==initial(frequency)?(GLOB.RADIO_TO_AIRALARM):null
if(frequency)
set_frequency(frequency)
broadcast_status()
@@ -29,8 +29,6 @@
reconcile_air()
update = air.react()
var/pipenetwarnings = 10
/datum/pipeline/proc/build_pipeline(obj/machinery/atmospherics/base)
var/volume = 0
if(istype(base, /obj/machinery/atmospherics/pipe))
@@ -44,7 +42,6 @@ var/pipenetwarnings = 10
addMachineryMember(base)
if(!air)
air = new
air.holder = src
var/list/possible_expansions = list(base)
while(possible_expansions.len>0)
for(var/obj/machinery/atmospherics/borderline in possible_expansions)
@@ -58,6 +55,7 @@ var/pipenetwarnings = 10
if(!members.Find(item))
if(item.parent)
var/static/pipenetwarnings = 10
if(pipenetwarnings > 0)
warning("build_pipeline(): [item.type] added to a pipenet while still having one. (pipes leading to the same spot stacking in one turf) Nearby: ([item.x], [item.y], [item.z])")
pipenetwarnings -= 1
@@ -246,4 +244,3 @@ var/pipenetwarnings = 10
var/list/G_gases = G.gases
for(var/id in G_gases)
G_gases[id][MOLES] *= G.volume/total_gas_mixture.volume
@@ -0,0 +1,182 @@
#define GASMINER_POWER_NONE 0
#define GASMINER_POWER_STATIC 1
#define GASMINER_POWER_MOLES 2 //Scaled from here on down.
#define GASMINER_POWER_KPA 3
#define GASMINER_POWER_FULLSCALE 4
/obj/machinery/atmospherics/miner
name = "gas miner"
desc = "Gasses mined from the gas giant below (above?) flow out through this massive vent."
icon = 'icons/obj/atmospherics/components/miners.dmi'
icon_state = "miner"
anchored = TRUE
density = FALSE
resistance_flags = INDESTRUCTIBLE|ACID_PROOF|FIRE_PROOF
var/spawn_id = null
var/spawn_temp = T20C
var/spawn_mol = MOLES_CELLSTANDARD * 10
var/max_ext_mol = INFINITY
var/max_ext_kpa = 6500
var/overlay_color = "#FFFFFF"
var/active = TRUE
var/power_draw = 0
var/power_draw_static = 2000
var/power_draw_dynamic_mol_coeff = 5 //DO NOT USE DYNAMIC SETTINGS UNTIL SOMEONE MAKES A USER INTERFACE/CONTROLLER FOR THIS!
var/power_draw_dynamic_kpa_coeff = 0.5
var/broken = FALSE
var/broken_message = "ERROR"
idle_power_usage = 150
active_power_usage = 2000
/obj/machinery/atmospherics/miner/examine(mob/user)
..()
if(broken)
to_chat(user, "Its debug output is printing \"[broken_message]\"")
/obj/machinery/atmospherics/miner/proc/check_operation()
if(!active)
return FALSE
var/turf/T = get_turf(src)
if(!isopenturf(T))
broken_message = "<span class='boldnotice'>VENT BLOCKED</span>"
broken = TRUE
return FALSE
var/turf/open/OT = T
if(OT.planetary_atmos)
broken_message = "<span class='boldwarning'>DEVICE NOT ENCLOSED IN A PRESSURIZED ENVIRONMENT</span>"
broken = TRUE
return FALSE
if(isspaceturf(T))
broken_message = "<span class='boldnotice'>AIR VENTING TO SPACE</span>"
broken = TRUE
return FALSE
var/datum/gas_mixture/G = OT.return_air()
if(G.return_pressure() > (max_ext_kpa - ((spawn_mol*spawn_temp*R_IDEAL_GAS_EQUATION)/(CELL_VOLUME))))
broken_message = "<span class='boldwarning'>EXTERNAL PRESSURE OVER THRESHOLD</span>"
broken = TRUE
return FALSE
if(G.total_moles() > max_ext_mol)
broken_message = "<span class='boldwarning'>EXTERNAL AIR CONCENTRATION OVER THRESHOLD</span>"
broken = TRUE
return FALSE
if(broken)
broken = FALSE
broken_message = ""
return TRUE
/obj/machinery/atmospherics/miner/proc/update_power()
if(!active)
active_power_usage = idle_power_usage
var/turf/T = get_turf(src)
var/datum/gas_mixture/G = T.return_air()
var/P = G.return_pressure()
switch(power_draw)
if(GASMINER_POWER_NONE)
active_power_usage = 0
if(GASMINER_POWER_STATIC)
active_power_usage = power_draw_static
if(GASMINER_POWER_MOLES)
active_power_usage = spawn_mol * power_draw_dynamic_mol_coeff
if(GASMINER_POWER_KPA)
active_power_usage = P * power_draw_dynamic_kpa_coeff
if(GASMINER_POWER_FULLSCALE)
active_power_usage = (spawn_mol * power_draw_dynamic_mol_coeff) + (P * power_draw_dynamic_kpa_coeff)
/obj/machinery/atmospherics/miner/proc/do_use_power(amount)
var/turf/T = get_turf(src)
if(T && istype(T))
var/obj/structure/cable/C = T.get_cable_node() //check if we have a node cable on the machine turf, the first found is picked
if(C && C.powernet && (C.powernet.avail > amount))
C.powernet.load += amount
return TRUE
if(powered())
use_power(amount)
return TRUE
return FALSE
/obj/machinery/atmospherics/miner/update_icon()
overlays.Cut()
if(broken)
var/image/A = image(icon, "broken")
add_overlay(A)
else if(active)
var/image/A = image(icon, "on")
A.color = overlay_color
add_overlay(A)
/obj/machinery/atmospherics/miner/process()
update_power()
update_icon()
check_operation()
if(active && !broken)
if(isnull(spawn_id))
return FALSE
if(do_use_power(active_power_usage))
mine_gas()
/obj/machinery/atmospherics/miner/proc/mine_gas()
var/turf/open/O = get_turf(src)
if(!isopenturf(O))
return FALSE
var/datum/gas_mixture/merger = new
merger.assert_gas(spawn_id)
merger.gases[spawn_id][MOLES] = (spawn_mol)
merger.temperature = spawn_temp
O.assume_air(merger)
SSair.add_to_active(O)
/obj/machinery/atmospherics/miner/attack_ai(mob/living/silicon/user)
if(broken)
to_chat(user, "[src] seems to be broken. Its debug interface outputs: [broken_message]")
..()
/obj/machinery/atmospherics/miner/n2o
name = "\improper N2O Gas Miner"
overlay_color = "#FFCCCC"
spawn_id = "n2o"
/obj/machinery/atmospherics/miner/nitrogen
name = "\improper N2 Gas Miner"
overlay_color = "#CCFFCC"
spawn_id = "n2"
/obj/machinery/atmospherics/miner/oxygen
name = "\improper O2 Gas Miner"
overlay_color = "#007FFF"
spawn_id = "o2"
/obj/machinery/atmospherics/miner/toxins
name = "\improper Plasma Gas Miner"
overlay_color = "#FF0000"
spawn_id = "plasma"
/obj/machinery/atmospherics/miner/carbon_dioxide
name = "\improper CO2 Gas Miner"
overlay_color = "#CDCDCD"
spawn_id = "co2"
/obj/machinery/atmospherics/miner/bz
name = "\improper BZ Gas Miner"
overlay_color = "#FAFF00"
spawn_id = "bz"
/obj/machinery/atmospherics/miner/freon
name = "\improper Freon Gas Miner"
overlay_color = "#00FFE5"
spawn_id = "freon"
/obj/machinery/atmospherics/miner/volatile_fuel
name = "\improper Volatile Fuel Gas Miner"
overlay_color = "#564040"
spawn_id = "v_fuel"
/obj/machinery/atmospherics/miner/agent_b
name = "\improper Agent B Gas Miner"
overlay_color = "#E81E24"
spawn_id = "agent_b"
/obj/machinery/atmospherics/miner/water_vapor
name = "\improper Water Vapor Gas Miner"
overlay_color = "#99928E"
spawn_id = "water_vapor"
@@ -10,7 +10,7 @@
device_type = BINARY
/obj/machinery/atmospherics/pipe/heat_exchanging/simple/SetInitDirections()
if(dir in diagonals)
if(dir in GLOB.diagonals)
initialize_directions_he = dir
switch(dir)
if(NORTH,SOUTH)
@@ -8,7 +8,7 @@ The regular pipe you see everywhere, including bent ones.
icon_state = "intact"
name = "pipe"
desc = "A one meter section of regular pipe"
desc = "A one meter section of regular pipe."
dir = SOUTH
initialize_directions = SOUTH|NORTH
@@ -16,7 +16,7 @@ The regular pipe you see everywhere, including bent ones.
device_type = BINARY
/obj/machinery/atmospherics/pipe/simple/SetInitDirections()
if(dir in diagonals)
if(dir in GLOB.diagonals)
initialize_directions = dir
switch(dir)
if(NORTH,SOUTH)
@@ -1,5 +1,3 @@
#define CAN_MAX_RELEASE_PRESSURE (ONE_ATMOSPHERE * 10)
#define CAN_MIN_RELEASE_PRESSURE (ONE_ATMOSPHERE / 10)
#define CAN_DEFAULT_RELEASE_PRESSURE (ONE_ATMOSPHERE)
/obj/machinery/portable_atmospherics/canister
@@ -16,6 +14,8 @@
var/filled = 0.5
var/gas_type = ""
var/release_pressure = ONE_ATMOSPHERE
var/can_max_release_pressure = (ONE_ATMOSPHERE * 10)
var/can_min_release_pressure = (ONE_ATMOSPHERE / 10)
armor = list(melee = 50, bullet = 50, laser = 50, energy = 100, bomb = 10, bio = 100, rad = 100, fire = 80, acid = 50)
obj_integrity = 250
@@ -24,6 +24,16 @@
pressure_resistance = 7 * ONE_ATMOSPHERE
var/temperature_resistance = 1000 + T0C
var/starter_temp
// Prototype vars
var/prototype = FALSE
var/valve_timer = null
var/timer_set = 30
var/default_timer_set = 30
var/minimum_timer_set = 1
var/maximum_timer_set = 300
var/timing = FALSE
var/restricted = FALSE
req_access = list()
var/update = 0
var/static/list/label2types = list(
@@ -39,6 +49,13 @@
"caution" = /obj/machinery/portable_atmospherics/canister,
)
/obj/machinery/portable_atmospherics/canister/interact(mob/user)
if(!allowed(user))
to_chat(user, "<span class='warning'>Error - Unauthorized User</span>")
playsound(src, 'sound/misc/compiler-failure.ogg', 50, 1)
return
..()
/obj/machinery/portable_atmospherics/canister/nitrogen
name = "n2 canister"
desc = "Nitrogen gas. Reportedly useful for something."
@@ -99,6 +116,46 @@
gas_type = "water_vapor"
filled = 1
/obj/machinery/portable_atmospherics/canister/proc/get_time_left()
if(timing)
. = round(max(0, valve_timer - world.time) / 10, 1)
else
. = timer_set
/obj/machinery/portable_atmospherics/canister/proc/set_active()
timing = !timing
if(timing)
valve_timer = world.time + (timer_set * 10)
update_icon()
/obj/machinery/portable_atmospherics/canister/proto
name = "prototype canister"
/obj/machinery/portable_atmospherics/canister/proto/default
name = "prototype canister"
desc = "The best way to fix an atmospheric emergency... or the best way to introduce one."
icon_state = "proto"
icon_state = "proto"
volume = 5000
obj_integrity = 300
max_integrity = 300
temperature_resistance = 2000 + T0C
can_max_release_pressure = (ONE_ATMOSPHERE * 30)
can_min_release_pressure = (ONE_ATMOSPHERE / 30)
prototype = TRUE
/obj/machinery/portable_atmospherics/canister/proto/default/oxygen
name = "prototype canister"
desc = "A prototype canister for a prototype bike, what could go wrong?"
icon_state = "proto"
gas_type = "o2"
filled = 1
release_pressure = ONE_ATMOSPHERE*2
/obj/machinery/portable_atmospherics/canister/New(loc, datum/gas_mixture/existing_mixture)
..()
if(existing_mixture)
@@ -239,6 +296,9 @@
..()
if(stat & BROKEN)
return PROCESS_KILL
if(timing && valve_timer < world.time)
valve_open = !valve_open
timing = FALSE
if(!valve_open)
pump.AIR1 = null
pump.AIR2 = null
@@ -255,7 +315,7 @@
update_icon()
/obj/machinery/portable_atmospherics/canister/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, \
datum/tgui/master_ui = null, datum/ui_state/state = physical_state)
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.physical_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
ui = new(user, src, ui_key, "canister", name, 420, 405, master_ui, state)
@@ -267,10 +327,20 @@
data["tankPressure"] = round(air_contents.return_pressure() ? air_contents.return_pressure() : 0)
data["releasePressure"] = round(release_pressure ? release_pressure : 0)
data["defaultReleasePressure"] = round(CAN_DEFAULT_RELEASE_PRESSURE)
data["minReleasePressure"] = round(CAN_MIN_RELEASE_PRESSURE)
data["maxReleasePressure"] = round(CAN_MAX_RELEASE_PRESSURE)
data["minReleasePressure"] = round(can_min_release_pressure)
data["maxReleasePressure"] = round(can_max_release_pressure)
data["valveOpen"] = valve_open ? 1 : 0
data["isPrototype"] = prototype ? 1 : 0
if (prototype)
data["restricted"] = restricted
data["timing"] = timing
data["time_left"] = get_time_left()
data["timer_set"] = timer_set
data["timer_is_not_default"] = timer_set != default_timer_set
data["timer_is_not_min"] = timer_set != minimum_timer_set
data["timer_is_not_max"] = timer_set != maximum_timer_set
data["hasHoldingTank"] = holding ? 1 : 0
if (holding)
data["holdingTank"] = list()
@@ -287,32 +357,37 @@
if(label && !..())
var/newtype = label2types[label]
if(newtype)
var/obj/machinery/portable_atmospherics/canister/replacement = new newtype(loc, air_contents)
if(connected_port)
replacement.connected_port = connected_port
replacement.connected_port.connected_device = replacement
replacement.interact(usr)
qdel(src)
var/obj/machinery/portable_atmospherics/canister/replacement = newtype
name = initial(replacement.name)
desc = initial(replacement.name)
icon_state = initial(replacement.icon_state)
if("restricted")
restricted = !restricted
if(restricted)
req_access = list(GLOB.access_engine)
else
req_access = list()
. = TRUE
if("pressure")
var/pressure = params["pressure"]
if(pressure == "reset")
pressure = CAN_DEFAULT_RELEASE_PRESSURE
. = TRUE
else if(pressure == "min")
pressure = CAN_MIN_RELEASE_PRESSURE
pressure = can_min_release_pressure
. = TRUE
else if(pressure == "max")
pressure = CAN_MAX_RELEASE_PRESSURE
pressure = can_max_release_pressure
. = TRUE
else if(pressure == "input")
pressure = input("New release pressure ([CAN_MIN_RELEASE_PRESSURE]-[CAN_MAX_RELEASE_PRESSURE] kPa):", name, release_pressure) as num|null
pressure = input("New release pressure ([can_min_release_pressure]-[can_max_release_pressure] kPa):", name, release_pressure) as num|null
if(!isnull(pressure) && !..())
. = TRUE
else if(text2num(pressure) != null)
pressure = text2num(pressure)
. = TRUE
if(.)
release_pressure = Clamp(round(pressure), CAN_MIN_RELEASE_PRESSURE, CAN_MAX_RELEASE_PRESSURE)
release_pressure = Clamp(round(pressure), can_min_release_pressure, can_max_release_pressure)
investigate_log("was set to [release_pressure] kPa by [key_name(usr)].", "atmos")
if("valve")
var/logmsg
@@ -344,11 +419,34 @@
investigate_log(logmsg, "atmos")
release_log += logmsg
. = TRUE
if("timer")
var/change = params["change"]
switch(change)
if("reset")
timer_set = default_timer_set
if("decrease")
timer_set = max(minimum_timer_set, timer_set - 10)
if("increase")
timer_set = min(maximum_timer_set, timer_set + 10)
if("input")
var/user_input = input(usr, "Set time to valve toggle.", name) as null|num
if(!user_input)
return
var/N = text2num(user_input)
if(!N)
return
timer_set = Clamp(N,minimum_timer_set,maximum_timer_set)
log_admin("[key_name(usr)] has activated a prototype valve timer")
. = TRUE
if("toggle_timer")
set_active()
if("eject")
if(holding)
if(valve_open)
investigate_log("[key_name(usr)] removed the [holding], leaving the valve open and transfering into the <span class='boldannounce'>air</span><br>", "atmos")
holding.loc = get_turf(src)
holding.forceMove(get_turf(src))
holding = null
. = TRUE
update_icon()
@@ -22,7 +22,6 @@
air_contents = new
air_contents.volume = volume
air_contents.temperature = T20C
air_contents.holder = src
return 1
@@ -70,7 +70,7 @@
/obj/machinery/portable_atmospherics/pump/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, \
datum/tgui/master_ui = null, datum/ui_state/state = physical_state)
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.physical_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
ui = new(user, src, ui_key, "portable_pump", name, 420, 415, master_ui, state)
@@ -63,7 +63,7 @@
..()
/obj/machinery/portable_atmospherics/scrubber/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, \
datum/tgui/master_ui = null, datum/ui_state/state = physical_state)
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.physical_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
ui = new(user, src, ui_key, "portable_scrubber", name, 420, 335, master_ui, state)