mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-29 23:17:02 +01:00
@@ -12,5 +12,6 @@
|
||||
#ignore other, specific files and folers
|
||||
data/
|
||||
/maps/backup/*
|
||||
/maps/RandomZLevels/backup/*
|
||||
/maps/cyberiad.dmm.backup
|
||||
/nano/debug.html
|
||||
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
#pretending we're C because otherwise ruby will initialize, even with "language: dm".
|
||||
language: c
|
||||
|
||||
env:
|
||||
BYOND_MAJOR="503"
|
||||
BYOND_MINOR="1224"
|
||||
|
||||
before_install:
|
||||
- sudo apt-get update -qq
|
||||
- sudo apt-get install libc6:i386 libgcc1:i386 libstdc++6:i386 -qq
|
||||
|
||||
install:
|
||||
- curl "http://www.byond.com/download/build/${BYOND_MAJOR}/${BYOND_MAJOR}.${BYOND_MINOR}_byond_linux.zip" -o byond.zip
|
||||
- unzip byond.zip
|
||||
- cd byond
|
||||
- sudo make install
|
||||
- cd ..
|
||||
|
||||
script:
|
||||
- shopt -s globstar
|
||||
- (! grep 'step_[xy]' maps/**/*.dmm)
|
||||
- DreamMaker paradise.dme
|
||||
@@ -0,0 +1,283 @@
|
||||
//--------------------------------------------
|
||||
// Pipe colors
|
||||
//
|
||||
// Add them here and to the pipe_colors list
|
||||
// to automatically add them to all relevant
|
||||
// atmospherics devices.
|
||||
//--------------------------------------------
|
||||
|
||||
#define PIPE_COLOR_GREY "#ffffff" //yes white is grey
|
||||
#define PIPE_COLOR_RED "#ff0000"
|
||||
#define PIPE_COLOR_BLUE "#0000ff"
|
||||
#define PIPE_COLOR_CYAN "#00ffff"
|
||||
#define PIPE_COLOR_GREEN "#00ff00"
|
||||
#define PIPE_COLOR_YELLOW "#ffcc00"
|
||||
#define PIPE_COLOR_PURPLE "#5c1ec0"
|
||||
|
||||
var/global/list/pipe_colors = list("grey" = PIPE_COLOR_GREY, "red" = PIPE_COLOR_RED, "blue" = PIPE_COLOR_BLUE, "cyan" = PIPE_COLOR_CYAN, "green" = PIPE_COLOR_GREEN, "yellow" = PIPE_COLOR_YELLOW, "purple" = PIPE_COLOR_PURPLE)
|
||||
|
||||
/proc/pipe_color_lookup(var/color)
|
||||
for(var/C in pipe_colors)
|
||||
if(color == pipe_colors[C])
|
||||
return "[C]"
|
||||
|
||||
/proc/pipe_color_check(var/color)
|
||||
if(!color)
|
||||
return 1
|
||||
for(var/C in pipe_colors)
|
||||
if(color == pipe_colors[C])
|
||||
return 1
|
||||
return 0
|
||||
|
||||
//--------------------------------------------
|
||||
// Icon cache generation
|
||||
//--------------------------------------------
|
||||
|
||||
/datum/pipe_icon_manager
|
||||
var/list/pipe_icons[]
|
||||
var/list/manifold_icons[]
|
||||
var/list/device_icons[]
|
||||
var/list/underlays[]
|
||||
//var/list/underlays_down[]
|
||||
//var/list/underlays_exposed[]
|
||||
//var/list/underlays_intact[]
|
||||
//var/list/pipe_underlays_exposed[]
|
||||
//var/list/pipe_underlays_intact[]
|
||||
var/list/omni_icons[]
|
||||
|
||||
/datum/pipe_icon_manager/New()
|
||||
check_icons()
|
||||
|
||||
/datum/pipe_icon_manager/proc/get_atmos_icon(var/device, var/dir, var/color, var/state)
|
||||
check_icons()
|
||||
|
||||
device = "[device]"
|
||||
state = "[state]"
|
||||
color = "[color]"
|
||||
dir = "[dir]"
|
||||
|
||||
switch(device)
|
||||
if("pipe")
|
||||
return pipe_icons[state + color]
|
||||
if("manifold")
|
||||
return manifold_icons[state + color]
|
||||
if("device")
|
||||
return device_icons[state]
|
||||
if("omni")
|
||||
return omni_icons[state]
|
||||
if("underlay")
|
||||
return underlays[state + dir + color]
|
||||
//if("underlay_intact")
|
||||
// return underlays_intact[state + dir + color]
|
||||
// if("underlay_exposed")
|
||||
// return underlays_exposed[state + dir + color]
|
||||
// if("underlay_down")
|
||||
// return underlays_down[state + dir + color]
|
||||
// if("pipe_underlay_exposed")
|
||||
// return pipe_underlays_exposed[state + dir + color]
|
||||
// if("pipe_underlay_intact")
|
||||
// return pipe_underlays_intact[state + dir + color]
|
||||
|
||||
/datum/pipe_icon_manager/proc/check_icons()
|
||||
if(!pipe_icons)
|
||||
gen_pipe_icons()
|
||||
if(!manifold_icons)
|
||||
gen_manifold_icons()
|
||||
if(!device_icons)
|
||||
gen_device_icons()
|
||||
if(!omni_icons)
|
||||
gen_omni_icons()
|
||||
//if(!underlays_intact || !underlays_down || !underlays_exposed || !pipe_underlays_exposed || !pipe_underlays_intact)
|
||||
if(!underlays)
|
||||
gen_underlay_icons()
|
||||
|
||||
/datum/pipe_icon_manager/proc/gen_pipe_icons()
|
||||
if(!pipe_icons)
|
||||
pipe_icons = new()
|
||||
|
||||
var/icon/pipe = new('icons/atmos/pipes.dmi')
|
||||
|
||||
for(var/state in pipe.IconStates())
|
||||
if(!state || findtext(state, "map"))
|
||||
continue
|
||||
|
||||
var/cache_name = state
|
||||
var/image/I = image('icons/atmos/pipes.dmi', icon_state = state)
|
||||
pipe_icons[cache_name] = I
|
||||
|
||||
for(var/pipe_color in pipe_colors)
|
||||
I = image('icons/atmos/pipes.dmi', icon_state = state)
|
||||
I.color = pipe_colors[pipe_color]
|
||||
pipe_icons[state + "[pipe_colors[pipe_color]]"] = I
|
||||
|
||||
pipe = new ('icons/atmos/heat.dmi')
|
||||
for(var/state in pipe.IconStates())
|
||||
if(!state || findtext(state, "map"))
|
||||
continue
|
||||
pipe_icons["hepipe" + state] = image('icons/atmos/heat.dmi', icon_state = state)
|
||||
|
||||
pipe = new ('icons/atmos/junction.dmi')
|
||||
for(var/state in pipe.IconStates())
|
||||
if(!state || findtext(state, "map"))
|
||||
continue
|
||||
pipe_icons["hejunction" + state] = image('icons/atmos/junction.dmi', icon_state = state)
|
||||
|
||||
/datum/pipe_icon_manager/proc/gen_manifold_icons()
|
||||
if(!manifold_icons)
|
||||
manifold_icons = new()
|
||||
|
||||
var/icon/pipe = new('icons/atmos/manifold.dmi')
|
||||
|
||||
for(var/state in pipe.IconStates())
|
||||
if(findtext(state, "clamps"))
|
||||
var/image/I = image('icons/atmos/manifold.dmi', icon_state = state)
|
||||
manifold_icons[state] = I
|
||||
continue
|
||||
|
||||
if(findtext(state, "core") || findtext(state, "4way"))
|
||||
var/image/I = image('icons/atmos/manifold.dmi', icon_state = state)
|
||||
manifold_icons[state] = I
|
||||
for(var/pipe_color in pipe_colors)
|
||||
I = image('icons/atmos/manifold.dmi', icon_state = state)
|
||||
I.color = pipe_colors[pipe_color]
|
||||
manifold_icons[state + pipe_colors[pipe_color]] = I
|
||||
|
||||
/datum/pipe_icon_manager/proc/gen_device_icons()
|
||||
if(!device_icons)
|
||||
device_icons = new()
|
||||
|
||||
var/icon/device
|
||||
|
||||
device = new('icons/atmos/vent_pump.dmi')
|
||||
for(var/state in device.IconStates())
|
||||
if(!state || findtext(state, "map"))
|
||||
continue
|
||||
device_icons["vent" + state] = image('icons/atmos/vent_pump.dmi', icon_state = state)
|
||||
|
||||
device = new('icons/atmos/vent_scrubber.dmi')
|
||||
for(var/state in device.IconStates())
|
||||
if(!state || findtext(state, "map"))
|
||||
continue
|
||||
device_icons["scrubber" + state] = image('icons/atmos/vent_scrubber.dmi', icon_state = state)
|
||||
|
||||
/datum/pipe_icon_manager/proc/gen_omni_icons()
|
||||
if(!omni_icons)
|
||||
omni_icons = new()
|
||||
|
||||
var/icon/omni = new('icons/atmos/omni_devices.dmi')
|
||||
|
||||
for(var/state in omni.IconStates())
|
||||
if(!state || findtext(state, "map"))
|
||||
continue
|
||||
omni_icons[state] = image('icons/atmos/omni_devices.dmi', icon_state = state)
|
||||
|
||||
|
||||
/datum/pipe_icon_manager/proc/gen_underlay_icons()
|
||||
|
||||
if(!underlays)
|
||||
underlays = new()
|
||||
|
||||
var/icon/pipe = new('icons/atmos/pipe_underlays.dmi')
|
||||
|
||||
for(var/state in pipe.IconStates())
|
||||
if(state == "")
|
||||
continue
|
||||
|
||||
var/cache_name = state
|
||||
|
||||
for(var/D in cardinal)
|
||||
var/image/I = image('icons/atmos/pipe_underlays.dmi', icon_state = state, dir = D)
|
||||
underlays[cache_name + "[D]"] = I
|
||||
for(var/pipe_color in pipe_colors)
|
||||
I = image('icons/atmos/pipe_underlays.dmi', icon_state = state, dir = D)
|
||||
I.color = pipe_colors[pipe_color]
|
||||
underlays[state + "[D]" + "[pipe_colors[pipe_color]]"] = I
|
||||
|
||||
/*
|
||||
/datum/pipe_icon_manager/proc/gen_underlay_icons()
|
||||
if(!underlays_intact)
|
||||
underlays_intact = new()
|
||||
if(!underlays_exposed)
|
||||
underlays_exposed = new()
|
||||
if(!underlays_down)
|
||||
underlays_down = new()
|
||||
if(!pipe_underlays_exposed)
|
||||
pipe_underlays_exposed = new()
|
||||
if(!pipe_underlays_intact)
|
||||
pipe_underlays_intact = new()
|
||||
|
||||
var/icon/pipe = new('icons/atmos/pipe_underlays.dmi')
|
||||
|
||||
for(var/state in pipe.IconStates())
|
||||
if(state == "")
|
||||
continue
|
||||
|
||||
for(var/D in cardinal)
|
||||
var/image/I = image('icons/atmos/pipe_underlays.dmi', icon_state = state, dir = D)
|
||||
switch(state)
|
||||
if("intact")
|
||||
underlays_intact["[D]"] = I
|
||||
if("exposed")
|
||||
underlays_exposed["[D]"] = I
|
||||
if("down")
|
||||
underlays_down["[D]"] = I
|
||||
if("pipe_exposed")
|
||||
pipe_underlays_exposed["[D]"] = I
|
||||
if("pipe_intact")
|
||||
pipe_underlays_intact["[D]"] = I
|
||||
if("intact-supply")
|
||||
underlays_intact["[D]"] = I
|
||||
if("exposed-supply")
|
||||
underlays_exposed["[D]"] = I
|
||||
if("down-supply")
|
||||
underlays_down["[D]"] = I
|
||||
if("pipe_exposed-supply")
|
||||
pipe_underlays_exposed["[D]"] = I
|
||||
if("pipe_intact-supply")
|
||||
pipe_underlays_intact["[D]"] = I
|
||||
if("intact-scrubbers")
|
||||
underlays_intact["[D]"] = I
|
||||
if("exposed-scrubbers")
|
||||
underlays_exposed["[D]"] = I
|
||||
if("down-scrubbers")
|
||||
underlays_down["[D]"] = I
|
||||
if("pipe_exposed-scrubbers")
|
||||
pipe_underlays_exposed["[D]"] = I
|
||||
if("pipe_intact-scrubbers")
|
||||
pipe_underlays_intact["[D]"] = I
|
||||
for(var/pipe_color in pipe_colors)
|
||||
I = image('icons/atmos/pipe_underlays.dmi', icon_state = state, dir = D)
|
||||
I.color = pipe_colors[pipe_color]
|
||||
switch(state)
|
||||
if("intact")
|
||||
underlays_intact["[D]" + pipe_colors[pipe_color]] = I
|
||||
if("exposed")
|
||||
underlays_exposed["[D]" + pipe_colors[pipe_color]] = I
|
||||
if("down")
|
||||
underlays_down["[D]" + pipe_colors[pipe_color]] = I
|
||||
if("pipe_exposed")
|
||||
pipe_underlays_exposed["[D]" + pipe_colors[pipe_color]] = I
|
||||
if("pipe_intact")
|
||||
pipe_underlays_intact["[D]" + pipe_colors[pipe_color]] = I
|
||||
if("intact-supply")
|
||||
underlays_intact["[D]" + pipe_colors[pipe_color]] = I
|
||||
if("exposed-supply")
|
||||
underlays_exposed["[D]" + pipe_colors[pipe_color]] = I
|
||||
if("down-supply")
|
||||
underlays_down["[D]" + pipe_colors[pipe_color]] = I
|
||||
if("pipe_exposed-supply")
|
||||
pipe_underlays_exposed["[D]" + pipe_colors[pipe_color]] = I
|
||||
if("pipe_intact-supply")
|
||||
pipe_underlays_intact["[D]" + pipe_colors[pipe_color]] = I
|
||||
if("intact-scrubbers")
|
||||
underlays_intact["[D]" + pipe_colors[pipe_color]] = I
|
||||
if("exposed-scrubbers")
|
||||
underlays_exposed["[D]" + pipe_colors[pipe_color]] = I
|
||||
if("down-scrubbers")
|
||||
underlays_down["[D]" + pipe_colors[pipe_color]] = I
|
||||
if("pipe_exposed-scrubbers")
|
||||
pipe_underlays_exposed["[D]" + pipe_colors[pipe_color]] = I
|
||||
if("pipe_intact-scrubbers")
|
||||
pipe_underlays_intact["[D]" + pipe_colors[pipe_color]] = I
|
||||
|
||||
*/
|
||||
@@ -9,49 +9,129 @@ Pipes -> Pipelines
|
||||
Pipelines + Other Objects -> Pipe network
|
||||
|
||||
*/
|
||||
|
||||
obj/machinery/atmospherics
|
||||
/obj/machinery/atmospherics
|
||||
anchored = 1
|
||||
idle_power_usage = 0
|
||||
active_power_usage = 0
|
||||
power_channel = ENVIRON
|
||||
var/nodealert = 0
|
||||
|
||||
layer = 2.4 //under wires with their 2.44
|
||||
|
||||
var/connect_types[] = list(1) //1=regular, 2=supply, 3=scrubber
|
||||
var/connected_to = 1 //same as above, currently not used for anything
|
||||
var/icon_connect_type = "" //"-supply" or "-scrubbers"
|
||||
|
||||
var/initialize_directions = 0
|
||||
var/pipe_color
|
||||
|
||||
var/global/datum/pipe_icon_manager/icon_manager
|
||||
|
||||
/obj/machinery/atmospherics/New()
|
||||
if(!icon_manager)
|
||||
icon_manager = new()
|
||||
|
||||
if(!pipe_color)
|
||||
pipe_color = color
|
||||
color = null
|
||||
|
||||
if(!pipe_color_check(pipe_color))
|
||||
pipe_color = null
|
||||
..()
|
||||
|
||||
obj/machinery/atmospherics/var/initialize_directions = 0
|
||||
obj/machinery/atmospherics/var/_color
|
||||
/obj/machinery/atmospherics/attackby(atom/A, mob/user as mob)
|
||||
if(istype(A, /obj/item/device/pipe_painter))
|
||||
return
|
||||
..()
|
||||
|
||||
obj/machinery/atmospherics/process()
|
||||
/obj/machinery/atmospherics/proc/add_underlay(var/turf/T, var/obj/machinery/atmospherics/node, var/direction, var/icon_connect_type)
|
||||
if(node)
|
||||
if(T.intact && node.level == 1 && istype(node, /obj/machinery/atmospherics/pipe))
|
||||
//underlays += icon_manager.get_atmos_icon("underlay_down", direction, color_cache_name(node))
|
||||
underlays += icon_manager.get_atmos_icon("underlay", direction, color_cache_name(node), "down" + icon_connect_type)
|
||||
else
|
||||
//underlays += icon_manager.get_atmos_icon("underlay_intact", direction, color_cache_name(node))
|
||||
underlays += icon_manager.get_atmos_icon("underlay", direction, color_cache_name(node), "intact" + icon_connect_type)
|
||||
else
|
||||
//underlays += icon_manager.get_atmos_icon("underlay_exposed", direction, pipe_color)
|
||||
underlays += icon_manager.get_atmos_icon("underlay", direction, color_cache_name(node), "exposed" + icon_connect_type)
|
||||
|
||||
/obj/machinery/atmospherics/proc/update_underlays()
|
||||
if(check_icon_cache())
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
|
||||
obj/machinery/atmospherics/proc/check_connect_types(obj/machinery/atmospherics/atmos1, obj/machinery/atmospherics/atmos2)
|
||||
var/i
|
||||
var/list1[] = atmos1.connect_types
|
||||
var/list2[] = atmos2.connect_types
|
||||
for(i=1,i<=list1.len,i++)
|
||||
var/j
|
||||
for(j=1,j<=list2.len,j++)
|
||||
if(list1[i] == list2[j])
|
||||
var/n = list1[i]
|
||||
return n
|
||||
return 0
|
||||
|
||||
obj/machinery/atmospherics/proc/check_connect_types_construction(obj/machinery/atmospherics/atmos1, obj/item/pipe/pipe2)
|
||||
var/i
|
||||
var/list1[] = atmos1.connect_types
|
||||
var/list2[] = pipe2.connect_types
|
||||
for(i=1,i<=list1.len,i++)
|
||||
var/j
|
||||
for(j=1,j<=list2.len,j++)
|
||||
if(list1[i] == list2[j])
|
||||
var/n = list1[i]
|
||||
return n
|
||||
return 0
|
||||
|
||||
/obj/machinery/atmospherics/proc/check_icon_cache(var/safety = 0)
|
||||
if(!istype(icon_manager))
|
||||
if(!safety) //to prevent infinite loops
|
||||
icon_manager = new()
|
||||
check_icon_cache(1)
|
||||
return 0
|
||||
|
||||
return 1
|
||||
|
||||
/obj/machinery/atmospherics/proc/color_cache_name(var/obj/machinery/atmospherics/node)
|
||||
//Don't use this for standard pipes
|
||||
if(!istype(node))
|
||||
return null
|
||||
|
||||
return node.pipe_color
|
||||
|
||||
/obj/machinery/atmospherics/process()
|
||||
build_network()
|
||||
|
||||
obj/machinery/atmospherics/proc/network_expand(datum/pipe_network/new_network, obj/machinery/atmospherics/pipe/reference)
|
||||
/obj/machinery/atmospherics/proc/network_expand(datum/pipe_network/new_network, obj/machinery/atmospherics/pipe/reference)
|
||||
// Check to see if should be added to network. Add self if so and adjust variables appropriately.
|
||||
// Note don't forget to have neighbors look as well!
|
||||
|
||||
return null
|
||||
|
||||
obj/machinery/atmospherics/proc/build_network()
|
||||
/obj/machinery/atmospherics/proc/build_network()
|
||||
// Called to build a network from this node
|
||||
|
||||
return null
|
||||
|
||||
obj/machinery/atmospherics/proc/return_network(obj/machinery/atmospherics/reference)
|
||||
/obj/machinery/atmospherics/proc/return_network(obj/machinery/atmospherics/reference)
|
||||
// Returns pipe_network associated with connection to reference
|
||||
// Notes: should create network if necessary
|
||||
// Should never return null
|
||||
|
||||
return null
|
||||
|
||||
obj/machinery/atmospherics/proc/reassign_network(datum/pipe_network/old_network, datum/pipe_network/new_network)
|
||||
/obj/machinery/atmospherics/proc/reassign_network(datum/pipe_network/old_network, datum/pipe_network/new_network)
|
||||
// Used when two pipe_networks are combining
|
||||
|
||||
obj/machinery/atmospherics/proc/return_network_air(datum/network/reference)
|
||||
/obj/machinery/atmospherics/proc/return_network_air(datum/network/reference)
|
||||
// Return a list of gas_mixture(s) in the object
|
||||
// associated with reference pipe_network for use in rebuilding the networks gases list
|
||||
// Is permitted to return null
|
||||
|
||||
obj/machinery/atmospherics/proc/disconnect(obj/machinery/atmospherics/reference)
|
||||
/obj/machinery/atmospherics/proc/disconnect(obj/machinery/atmospherics/reference)
|
||||
|
||||
obj/machinery/atmospherics/update_icon()
|
||||
/obj/machinery/atmospherics/update_icon()
|
||||
return null
|
||||
@@ -67,16 +67,25 @@ obj/machinery/atmospherics/binary
|
||||
|
||||
for(var/obj/machinery/atmospherics/target in get_step(src,node1_connect))
|
||||
if(target.initialize_directions & get_dir(target,src))
|
||||
node1 = target
|
||||
break
|
||||
var/c = check_connect_types(target,src)
|
||||
if (c)
|
||||
target.connected_to = c
|
||||
src.connected_to = c
|
||||
node1 = target
|
||||
break
|
||||
|
||||
for(var/obj/machinery/atmospherics/target in get_step(src,node2_connect))
|
||||
if(target.initialize_directions & get_dir(target,src))
|
||||
node2 = target
|
||||
break
|
||||
var/c = check_connect_types(target,src)
|
||||
if (c)
|
||||
target.connected_to = c
|
||||
src.connected_to = c
|
||||
node2 = target
|
||||
break
|
||||
|
||||
update_icon()
|
||||
|
||||
update_underlays()
|
||||
|
||||
build_network()
|
||||
if(!network1 && node1)
|
||||
network1 = new /datum/pipe_network()
|
||||
@@ -126,5 +135,8 @@ obj/machinery/atmospherics/binary
|
||||
else if(reference==node2)
|
||||
del(network2)
|
||||
node2 = null
|
||||
|
||||
update_icon()
|
||||
update_underlays()
|
||||
|
||||
return null
|
||||
@@ -1,6 +1,6 @@
|
||||
/obj/machinery/atmospherics/binary/dp_vent_pump
|
||||
icon = 'icons/obj/atmospherics/dp_vent_pump.dmi'
|
||||
icon_state = "off"
|
||||
icon = 'icons/atmos/vent_pump.dmi'
|
||||
icon_state = "map_dp_vent"
|
||||
|
||||
//node2 is output port
|
||||
//node1 is input port
|
||||
@@ -10,15 +10,6 @@
|
||||
|
||||
level = 1
|
||||
|
||||
high_volume
|
||||
name = "Large Dual Port Air Vent"
|
||||
|
||||
New()
|
||||
..()
|
||||
|
||||
air1.volume = 1000
|
||||
air2.volume = 1000
|
||||
|
||||
var/on = 0
|
||||
var/pump_direction = 1 //0 = siphoning, 1 = releasing
|
||||
|
||||
@@ -26,174 +17,199 @@
|
||||
var/input_pressure_min = 0
|
||||
var/output_pressure_max = 0
|
||||
|
||||
var/frequency = 0
|
||||
var/id = null
|
||||
var/datum/radio_frequency/radio_connection
|
||||
|
||||
var/pressure_checks = 1
|
||||
//1: Do not pass external_pressure_bound
|
||||
//2: Do not pass input_pressure_min
|
||||
//4: Do not pass output_pressure_max
|
||||
|
||||
/obj/machinery/atmospherics/binary/dp_vent_pump/New()
|
||||
..()
|
||||
icon = null
|
||||
|
||||
/obj/machinery/atmospherics/binary/dp_vent_pump/high_volume
|
||||
name = "Large Dual Port Air Vent"
|
||||
|
||||
/obj/machinery/atmospherics/binary/dp_vent_pump/high_volume/New()
|
||||
..()
|
||||
air1.volume = 1000
|
||||
air2.volume = 1000
|
||||
|
||||
/obj/machinery/atmospherics/binary/dp_vent_pump/update_icon(var/safety = 0)
|
||||
if(!check_icon_cache())
|
||||
return
|
||||
|
||||
overlays.Cut()
|
||||
|
||||
var/vent_icon = "vent"
|
||||
|
||||
var/turf/T = get_turf(src)
|
||||
if(!istype(T))
|
||||
return
|
||||
|
||||
if(T.intact && node1 && node2 && node1.level == 1 && node2.level == 1 && istype(node1, /obj/machinery/atmospherics/pipe) && istype(node2, /obj/machinery/atmospherics/pipe))
|
||||
vent_icon += "h"
|
||||
|
||||
if(!powered())
|
||||
vent_icon += "off"
|
||||
else
|
||||
vent_icon += "[on ? "[pump_direction ? "out" : "in"]" : "off"]"
|
||||
|
||||
overlays += icon_manager.get_atmos_icon("device", , , vent_icon)
|
||||
|
||||
/obj/machinery/atmospherics/binary/dp_vent_pump/update_underlays()
|
||||
if(..())
|
||||
underlays.Cut()
|
||||
var/turf/T = get_turf(src)
|
||||
if(!istype(T))
|
||||
return
|
||||
if(T.intact && node1 && node2 && node1.level == 1 && node2.level == 1 && istype(node1, /obj/machinery/atmospherics/pipe) && istype(node2, /obj/machinery/atmospherics/pipe))
|
||||
return
|
||||
else
|
||||
add_underlay(T, node1, turn(dir, -180))
|
||||
add_underlay(T, node2, dir)
|
||||
|
||||
/obj/machinery/atmospherics/binary/dp_vent_pump/hide(var/i)
|
||||
update_icon()
|
||||
if(on)
|
||||
if(pump_direction)
|
||||
icon_state = "[level == 1 && istype(loc, /turf/simulated) ? "h" : "" ]out"
|
||||
else
|
||||
icon_state = "[level == 1 && istype(loc, /turf/simulated) ? "h" : "" ]in"
|
||||
else
|
||||
icon_state = "[level == 1 && istype(loc, /turf/simulated) ? "h" : "" ]off"
|
||||
on = 0
|
||||
update_underlays()
|
||||
|
||||
return
|
||||
/obj/machinery/atmospherics/binary/dp_vent_pump/process()
|
||||
..()
|
||||
|
||||
hide(var/i) //to make the little pipe section invisible, the icon changes.
|
||||
if(on)
|
||||
if(pump_direction)
|
||||
icon_state = "[i == 1 && istype(loc, /turf/simulated) ? "h" : "" ]out"
|
||||
else
|
||||
icon_state = "[i == 1 && istype(loc, /turf/simulated) ? "h" : "" ]in"
|
||||
else
|
||||
icon_state = "[i == 1 && istype(loc, /turf/simulated) ? "h" : "" ]off"
|
||||
on = 0
|
||||
return
|
||||
if(!on)
|
||||
return 0
|
||||
|
||||
process()
|
||||
..()
|
||||
var/datum/gas_mixture/environment = loc.return_air()
|
||||
var/environment_pressure = environment.return_pressure()
|
||||
|
||||
if(!on)
|
||||
return 0
|
||||
if(pump_direction) //input -> external
|
||||
var/pressure_delta = 10000
|
||||
|
||||
var/datum/gas_mixture/environment = loc.return_air()
|
||||
var/environment_pressure = environment.return_pressure()
|
||||
if(pressure_checks&1)
|
||||
pressure_delta = min(pressure_delta, (external_pressure_bound - environment_pressure))
|
||||
if(pressure_checks&2)
|
||||
pressure_delta = min(pressure_delta, (air1.return_pressure() - input_pressure_min))
|
||||
|
||||
if(pump_direction) //input -> external
|
||||
var/pressure_delta = 10000
|
||||
if(pressure_delta > 0)
|
||||
if(air1.temperature > 0)
|
||||
var/transfer_moles = pressure_delta*environment.volume/(air1.temperature * R_IDEAL_GAS_EQUATION)
|
||||
|
||||
if(pressure_checks&1)
|
||||
pressure_delta = min(pressure_delta, (external_pressure_bound - environment_pressure))
|
||||
if(pressure_checks&2)
|
||||
pressure_delta = min(pressure_delta, (air1.return_pressure() - input_pressure_min))
|
||||
var/datum/gas_mixture/removed = air1.remove(transfer_moles)
|
||||
|
||||
if(pressure_delta > 0)
|
||||
if(air1.temperature > 0)
|
||||
var/transfer_moles = pressure_delta*environment.volume/(air1.temperature * R_IDEAL_GAS_EQUATION)
|
||||
loc.assume_air(removed)
|
||||
|
||||
var/datum/gas_mixture/removed = air1.remove(transfer_moles)
|
||||
if(network1)
|
||||
network1.update = 1
|
||||
|
||||
loc.assume_air(removed)
|
||||
else //external -> output
|
||||
var/pressure_delta = 10000
|
||||
|
||||
if(network1)
|
||||
network1.update = 1
|
||||
if(pressure_checks&1)
|
||||
pressure_delta = min(pressure_delta, (environment_pressure - external_pressure_bound))
|
||||
if(pressure_checks&4)
|
||||
pressure_delta = min(pressure_delta, (output_pressure_max - air2.return_pressure()))
|
||||
|
||||
else //external -> output
|
||||
var/pressure_delta = 10000
|
||||
if(pressure_delta > 0)
|
||||
if(environment.temperature > 0)
|
||||
var/transfer_moles = pressure_delta*air2.volume/(environment.temperature * R_IDEAL_GAS_EQUATION)
|
||||
|
||||
if(pressure_checks&1)
|
||||
pressure_delta = min(pressure_delta, (environment_pressure - external_pressure_bound))
|
||||
if(pressure_checks&4)
|
||||
pressure_delta = min(pressure_delta, (output_pressure_max - air2.return_pressure()))
|
||||
var/datum/gas_mixture/removed = loc.remove_air(transfer_moles)
|
||||
|
||||
if(pressure_delta > 0)
|
||||
if(environment.temperature > 0)
|
||||
var/transfer_moles = pressure_delta*air2.volume/(environment.temperature * R_IDEAL_GAS_EQUATION)
|
||||
air2.merge(removed)
|
||||
|
||||
var/datum/gas_mixture/removed = loc.remove_air(transfer_moles)
|
||||
if(network2)
|
||||
network2.update = 1
|
||||
|
||||
air2.merge(removed)
|
||||
|
||||
if(network2)
|
||||
network2.update = 1
|
||||
|
||||
return 1
|
||||
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, filter = RADIO_ATMOSIA)
|
||||
/obj/machinery/atmospherics/binary/dp_vent_pump/proc/set_frequency(new_frequency)
|
||||
radio_controller.remove_object(src, frequency)
|
||||
frequency = new_frequency
|
||||
if(frequency)
|
||||
radio_connection = radio_controller.add_object(src, frequency, filter = RADIO_ATMOSIA)
|
||||
|
||||
broadcast_status()
|
||||
if(!radio_connection)
|
||||
return 0
|
||||
/obj/machinery/atmospherics/binary/dp_vent_pump/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(
|
||||
"tag" = id,
|
||||
"device" = "ADVP",
|
||||
"power" = on,
|
||||
"direction" = pump_direction?("release"):("siphon"),
|
||||
"checks" = pressure_checks,
|
||||
"input" = input_pressure_min,
|
||||
"output" = output_pressure_max,
|
||||
"external" = external_pressure_bound,
|
||||
"sigtype" = "status"
|
||||
)
|
||||
radio_connection.post_signal(src, signal, filter = RADIO_ATMOSIA)
|
||||
signal.data = list(
|
||||
"tag" = id,
|
||||
"device" = "ADVP",
|
||||
"power" = on,
|
||||
"direction" = pump_direction?("release"):("siphon"),
|
||||
"checks" = pressure_checks,
|
||||
"input" = input_pressure_min,
|
||||
"output" = output_pressure_max,
|
||||
"external" = external_pressure_bound,
|
||||
"sigtype" = "status"
|
||||
)
|
||||
radio_connection.post_signal(src, signal, filter = RADIO_ATMOSIA)
|
||||
|
||||
return 1
|
||||
return 1
|
||||
|
||||
var/frequency = 0
|
||||
var/id = null
|
||||
var/datum/radio_frequency/radio_connection
|
||||
/obj/machinery/atmospherics/binary/dp_vent_pump/initialize()
|
||||
..()
|
||||
if(frequency)
|
||||
set_frequency(frequency)
|
||||
|
||||
initialize()
|
||||
..()
|
||||
if(frequency)
|
||||
set_frequency(frequency)
|
||||
/obj/machinery/atmospherics/binary/dp_vent_pump/receive_signal(datum/signal/signal)
|
||||
if(!signal.data["tag"] || (signal.data["tag"] != id) || (signal.data["sigtype"]!="command"))
|
||||
return 0
|
||||
if(signal.data["power"])
|
||||
on = text2num(signal.data["power"])
|
||||
|
||||
receive_signal(datum/signal/signal)
|
||||
if(signal.data["power_toggle"])
|
||||
on = !on
|
||||
|
||||
if(!signal.data["tag"] || (signal.data["tag"] != id) || (signal.data["sigtype"]!="command"))
|
||||
return 0
|
||||
if("power" in signal.data)
|
||||
on = text2num(signal.data["power"])
|
||||
if(signal.data["direction"])
|
||||
pump_direction = text2num(signal.data["direction"])
|
||||
|
||||
if("power_toggle" in signal.data)
|
||||
on = !on
|
||||
if(signal.data["checks"])
|
||||
pressure_checks = text2num(signal.data["checks"])
|
||||
|
||||
if("set_direction" in signal.data)
|
||||
pump_direction = text2num(signal.data["set_direction"])
|
||||
if(signal.data["purge"])
|
||||
pressure_checks &= ~1
|
||||
pump_direction = 0
|
||||
|
||||
if("checks" in signal.data)
|
||||
pressure_checks = text2num(signal.data["checks"])
|
||||
if(signal.data["stabalize"])
|
||||
pressure_checks |= 1
|
||||
pump_direction = 1
|
||||
|
||||
if("purge" in signal.data)
|
||||
pressure_checks &= ~1
|
||||
pump_direction = 0
|
||||
if(signal.data["set_input_pressure"])
|
||||
input_pressure_min = between(
|
||||
0,
|
||||
text2num(signal.data["set_input_pressure"]),
|
||||
ONE_ATMOSPHERE*50
|
||||
)
|
||||
|
||||
if("stabalize" in signal.data)
|
||||
pressure_checks |= 1
|
||||
pump_direction = 1
|
||||
if(signal.data["set_output_pressure"])
|
||||
output_pressure_max = between(
|
||||
0,
|
||||
text2num(signal.data["set_output_pressure"]),
|
||||
ONE_ATMOSPHERE*50
|
||||
)
|
||||
|
||||
if("set_input_pressure" in signal.data)
|
||||
input_pressure_min = between(
|
||||
0,
|
||||
text2num(signal.data["set_input_pressure"]),
|
||||
ONE_ATMOSPHERE*50
|
||||
)
|
||||
if(signal.data["set_external_pressure"])
|
||||
external_pressure_bound = between(
|
||||
0,
|
||||
text2num(signal.data["set_external_pressure"]),
|
||||
ONE_ATMOSPHERE*50
|
||||
)
|
||||
|
||||
if("set_output_pressure" in signal.data)
|
||||
output_pressure_max = between(
|
||||
0,
|
||||
text2num(signal.data["set_output_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
|
||||
)
|
||||
|
||||
if("status" in signal.data)
|
||||
spawn(2)
|
||||
broadcast_status()
|
||||
return //do not update_icon
|
||||
//if(signal.data["tag"])
|
||||
if(signal.data["status"])
|
||||
spawn(2)
|
||||
broadcast_status()
|
||||
update_icon()
|
||||
return //do not update_icon
|
||||
|
||||
spawn(2)
|
||||
broadcast_status()
|
||||
update_icon()
|
||||
@@ -1,8 +1,9 @@
|
||||
obj/machinery/atmospherics/binary/passive_gate
|
||||
/obj/machinery/atmospherics/binary/passive_gate
|
||||
//Tries to achieve target pressure at output (like a normal pump) except
|
||||
// Uses no power but can not transfer gases from a low pressure area to a high pressure area
|
||||
icon = 'icons/obj/atmospherics/passive_gate.dmi'
|
||||
icon_state = "intact_off"
|
||||
icon = 'icons/atmos/passive_gate.dmi'
|
||||
icon_state = "map"
|
||||
level = 1
|
||||
|
||||
name = "Passive gate"
|
||||
desc = "A one-way air valve that does not require power"
|
||||
@@ -14,175 +15,161 @@ obj/machinery/atmospherics/binary/passive_gate
|
||||
var/id = null
|
||||
var/datum/radio_frequency/radio_connection
|
||||
|
||||
update_icon()
|
||||
if(stat & NOPOWER)
|
||||
icon_state = "intact_off"
|
||||
else if(node1 && node2)
|
||||
icon_state = "intact_[on?("on"):("off")]"
|
||||
else
|
||||
if(node1)
|
||||
icon_state = "exposed_1_off"
|
||||
else if(node2)
|
||||
icon_state = "exposed_2_off"
|
||||
else
|
||||
icon_state = "exposed_3_off"
|
||||
return
|
||||
/obj/machinery/atmospherics/binary/passive_gate/update_icon()
|
||||
icon_state = "[on ? "on" : "off"]"
|
||||
|
||||
process()
|
||||
..()
|
||||
if(!on)
|
||||
return 0
|
||||
/obj/machinery/atmospherics/binary/passive_gate/update_underlays()
|
||||
if(..())
|
||||
underlays.Cut()
|
||||
var/turf/T = get_turf(src)
|
||||
if(!istype(T))
|
||||
return
|
||||
add_underlay(T, node1, turn(dir, 180))
|
||||
add_underlay(T, node2, dir)
|
||||
|
||||
var/output_starting_pressure = air2.return_pressure()
|
||||
var/input_starting_pressure = air1.return_pressure()
|
||||
/obj/machinery/atmospherics/binary/passive_gate/hide(var/i)
|
||||
update_underlays()
|
||||
|
||||
if(output_starting_pressure >= min(target_pressure,input_starting_pressure-10))
|
||||
//No need to pump gas if target is already reached or input pressure is too low
|
||||
//Need at least 10 KPa difference to overcome friction in the mechanism
|
||||
return 1
|
||||
/obj/machinery/atmospherics/binary/passive_gate/process()
|
||||
..()
|
||||
if(!on)
|
||||
return 0
|
||||
|
||||
//Calculate necessary moles to transfer using PV = nRT
|
||||
if((air1.total_moles() > 0) && (air1.temperature>0))
|
||||
var/pressure_delta = min(target_pressure - output_starting_pressure, (input_starting_pressure - output_starting_pressure)/2)
|
||||
//Can not have a pressure delta that would cause output_pressure > input_pressure
|
||||
var/output_starting_pressure = air2.return_pressure()
|
||||
var/input_starting_pressure = air1.return_pressure()
|
||||
|
||||
var/transfer_moles = pressure_delta*air2.volume/(air1.temperature * R_IDEAL_GAS_EQUATION)
|
||||
if(output_starting_pressure >= min(target_pressure,input_starting_pressure-10))
|
||||
//No need to pump gas if target is already reached or input pressure is too low
|
||||
//Need at least 10 KPa difference to overcome friction in the mechanism
|
||||
return 1
|
||||
|
||||
//Actually transfer the gas
|
||||
var/datum/gas_mixture/removed = air1.remove(transfer_moles)
|
||||
air2.merge(removed)
|
||||
//Calculate necessary moles to transfer using PV = nRT
|
||||
if((air1.total_moles() > 0) && (air1.temperature>0))
|
||||
var/pressure_delta = min(target_pressure - output_starting_pressure, (input_starting_pressure - output_starting_pressure)/2)
|
||||
//Can not have a pressure delta that would cause output_pressure > input_pressure
|
||||
|
||||
if(network1)
|
||||
network1.update = 1
|
||||
var/transfer_moles = pressure_delta*air2.volume/(air1.temperature * R_IDEAL_GAS_EQUATION)
|
||||
|
||||
if(network2)
|
||||
network2.update = 1
|
||||
//Actually transfer the gas
|
||||
var/datum/gas_mixture/removed = air1.remove(transfer_moles)
|
||||
air2.merge(removed)
|
||||
|
||||
if(network1)
|
||||
network1.update = 1
|
||||
|
||||
//Radio remote control
|
||||
if(network2)
|
||||
network2.update = 1
|
||||
|
||||
proc
|
||||
set_frequency(new_frequency)
|
||||
radio_controller.remove_object(src, frequency)
|
||||
frequency = new_frequency
|
||||
if(frequency)
|
||||
radio_connection = radio_controller.add_object(src, frequency, filter = RADIO_ATMOSIA)
|
||||
//Radio remote control
|
||||
|
||||
broadcast_status()
|
||||
if(!radio_connection)
|
||||
return 0
|
||||
/obj/machinery/atmospherics/binary/passive_gate/proc/set_frequency(new_frequency)
|
||||
radio_controller.remove_object(src, frequency)
|
||||
frequency = new_frequency
|
||||
if(frequency)
|
||||
radio_connection = radio_controller.add_object(src, frequency, filter = RADIO_ATMOSIA)
|
||||
|
||||
var/datum/signal/signal = new
|
||||
signal.transmission_method = 1 //radio signal
|
||||
signal.source = src
|
||||
/obj/machinery/atmospherics/binary/passive_gate/proc/broadcast_status()
|
||||
if(!radio_connection)
|
||||
return 0
|
||||
|
||||
signal.data = list(
|
||||
"tag" = id,
|
||||
"device" = "AGP",
|
||||
"power" = on,
|
||||
"target_output" = target_pressure,
|
||||
"sigtype" = "status"
|
||||
)
|
||||
var/datum/signal/signal = new
|
||||
signal.transmission_method = 1 //radio signal
|
||||
signal.source = src
|
||||
|
||||
radio_connection.post_signal(src, signal, filter = RADIO_ATMOSIA)
|
||||
signal.data = list(
|
||||
"tag" = id,
|
||||
"device" = "AGP",
|
||||
"power" = on,
|
||||
"target_output" = target_pressure,
|
||||
"sigtype" = "status"
|
||||
)
|
||||
|
||||
return 1
|
||||
radio_connection.post_signal(src, signal, filter = RADIO_ATMOSIA)
|
||||
|
||||
interact(mob/user as mob)
|
||||
var/dat = {"<b>Power: </b><a href='?src=\ref[src];power=1'>[on?"On":"Off"]</a><br>
|
||||
<b>Desirable output pressure: </b>
|
||||
[round(target_pressure,0.1)]kPa | <a href='?src=\ref[src];set_press=1'>Change</a>
|
||||
"}
|
||||
return 1
|
||||
|
||||
user << browse("<HEAD><TITLE>[src.name] control</TITLE></HEAD><TT>[dat]</TT>", "window=atmo_pump")
|
||||
onclose(user, "atmo_pump")
|
||||
/obj/machinery/atmospherics/binary/passive_gate/interact(mob/user as mob)
|
||||
var/dat = {"<b>Power: </b><a href='?src=\ref[src];power=1'>[on?"On":"Off"]</a><br>
|
||||
<b>Desirable output pressure: </b>
|
||||
[round(target_pressure,0.1)]kPa | <a href='?src=\ref[src];set_press=1'>Change</a>
|
||||
"}
|
||||
|
||||
initialize()
|
||||
..()
|
||||
if(frequency)
|
||||
set_frequency(frequency)
|
||||
user << browse("<HEAD><TITLE>[src.name] control</TITLE></HEAD><TT>[dat]</TT>", "window=atmo_pump")
|
||||
onclose(user, "atmo_pump")
|
||||
|
||||
receive_signal(datum/signal/signal)
|
||||
if(!signal.data["tag"] || (signal.data["tag"] != id) || (signal.data["sigtype"]!="command"))
|
||||
return 0
|
||||
/obj/machinery/atmospherics/binary/passive_gate/initialize()
|
||||
..()
|
||||
if(frequency)
|
||||
set_frequency(frequency)
|
||||
|
||||
if("power" in signal.data)
|
||||
on = text2num(signal.data["power"])
|
||||
/obj/machinery/atmospherics/binary/passive_gate/receive_signal(datum/signal/signal)
|
||||
if(!signal.data["tag"] || (signal.data["tag"] != id) || (signal.data["sigtype"]!="command"))
|
||||
return 0
|
||||
|
||||
if("power_toggle" in signal.data)
|
||||
on = !on
|
||||
if("power" in signal.data)
|
||||
on = text2num(signal.data["power"])
|
||||
|
||||
if("set_output_pressure" in signal.data)
|
||||
target_pressure = between(
|
||||
0,
|
||||
text2num(signal.data["set_output_pressure"]),
|
||||
ONE_ATMOSPHERE*50
|
||||
)
|
||||
if("power_toggle" in signal.data)
|
||||
on = !on
|
||||
|
||||
if("status" in signal.data)
|
||||
spawn(2)
|
||||
broadcast_status()
|
||||
return //do not update_icon
|
||||
if("set_output_pressure" in signal.data)
|
||||
target_pressure = between(
|
||||
0,
|
||||
text2num(signal.data["set_output_pressure"]),
|
||||
ONE_ATMOSPHERE*50
|
||||
)
|
||||
|
||||
if("status" in signal.data)
|
||||
spawn(2)
|
||||
broadcast_status()
|
||||
update_icon()
|
||||
return //do not update_icon
|
||||
|
||||
spawn(2)
|
||||
broadcast_status()
|
||||
update_icon()
|
||||
return
|
||||
|
||||
/obj/machinery/atmospherics/binary/passive_gate/attack_hand(user as mob)
|
||||
if(..())
|
||||
return
|
||||
|
||||
|
||||
|
||||
attack_hand(user as mob)
|
||||
if(..())
|
||||
return
|
||||
src.add_fingerprint(usr)
|
||||
if(!src.allowed(user))
|
||||
user << "\red Access denied."
|
||||
return
|
||||
usr.set_machine(src)
|
||||
interact(user)
|
||||
src.add_fingerprint(usr)
|
||||
if(!src.allowed(user))
|
||||
user << "\red Access denied."
|
||||
return
|
||||
usr.set_machine(src)
|
||||
interact(user)
|
||||
return
|
||||
|
||||
Topic(href,href_list)
|
||||
if(..()) return
|
||||
if(href_list["power"])
|
||||
on = !on
|
||||
if(href_list["set_press"])
|
||||
var/new_pressure = input(usr,"Enter new output pressure (0-4500kPa)","Pressure control",src.target_pressure) as num
|
||||
src.target_pressure = max(0, min(4500, new_pressure))
|
||||
usr.set_machine(src)
|
||||
src.update_icon()
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
power_change()
|
||||
..()
|
||||
update_icon()
|
||||
|
||||
|
||||
|
||||
attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
|
||||
if (!istype(W, /obj/item/weapon/wrench))
|
||||
return ..()
|
||||
if (on)
|
||||
user << "\red You cannot unwrench this [src], turn it off first."
|
||||
return 1
|
||||
var/turf/T = src.loc
|
||||
if (level==1 && isturf(T) && T.intact)
|
||||
user << "\red You must remove the plating first."
|
||||
return 1
|
||||
var/datum/gas_mixture/int_air = return_air()
|
||||
var/datum/gas_mixture/env_air = loc.return_air()
|
||||
if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE)
|
||||
user << "\red You cannot unwrench this [src], it too exerted due to internal pressure."
|
||||
add_fingerprint(user)
|
||||
return 1
|
||||
playsound(get_turf(src), 'sound/items/Ratchet.ogg', 50, 1)
|
||||
user << "\blue You begin to unfasten \the [src]..."
|
||||
if (do_after(user, 40))
|
||||
user.visible_message( \
|
||||
"[user] unfastens \the [src].", \
|
||||
"\blue You have unfastened \the [src].", \
|
||||
"You hear ratchet.")
|
||||
new /obj/item/pipe(loc, make_from=src)
|
||||
del(src)
|
||||
/obj/machinery/atmospherics/binary/passive_gate/Topic(href,href_list)
|
||||
if(..()) return
|
||||
if(href_list["power"])
|
||||
on = !on
|
||||
if(href_list["set_press"])
|
||||
var/new_pressure = input(usr,"Enter new output pressure (0-4500kPa)","Pressure control",src.target_pressure) as num
|
||||
src.target_pressure = max(0, min(4500, new_pressure))
|
||||
usr.set_machine(src)
|
||||
src.update_icon()
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
/obj/machinery/atmospherics/binary/passive_gate/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
|
||||
if (!istype(W, /obj/item/weapon/wrench))
|
||||
return ..()
|
||||
if (on)
|
||||
user << "\red You cannot unwrench this [src], turn it off first."
|
||||
return 1
|
||||
var/datum/gas_mixture/int_air = return_air()
|
||||
var/datum/gas_mixture/env_air = loc.return_air()
|
||||
if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE)
|
||||
user << "\red You cannot unwrench this [src], it too exerted due to internal pressure."
|
||||
add_fingerprint(user)
|
||||
return 1
|
||||
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
|
||||
user << "\blue You begin to unfasten \the [src]..."
|
||||
if (do_after(user, 40))
|
||||
user.visible_message( \
|
||||
"[user] unfastens \the [src].", \
|
||||
"\blue You have unfastened \the [src].", \
|
||||
"You hear ratchet.")
|
||||
new /obj/item/pipe(loc, make_from=src)
|
||||
del(src)
|
||||
@@ -12,9 +12,10 @@ Thus, the two variables affect pump operation are set in New():
|
||||
but overall network volume is also increased as this increases...
|
||||
*/
|
||||
|
||||
obj/machinery/atmospherics/binary/pump
|
||||
icon = 'icons/obj/atmospherics/pump.dmi'
|
||||
icon_state = "intact_off"
|
||||
/obj/machinery/atmospherics/binary/pump
|
||||
icon = 'icons/atmos/pump.dmi'
|
||||
icon_state = "map_off"
|
||||
level = 1
|
||||
|
||||
name = "Gas pump"
|
||||
desc = "A pump"
|
||||
@@ -26,180 +27,181 @@ obj/machinery/atmospherics/binary/pump
|
||||
var/id = null
|
||||
var/datum/radio_frequency/radio_connection
|
||||
|
||||
highcap
|
||||
name = "High capacity gas pump"
|
||||
desc = "A high capacity pump"
|
||||
/obj/machinery/atmospherics/binary/pump/highcap
|
||||
name = "High capacity gas pump"
|
||||
desc = "A high capacity pump"
|
||||
|
||||
target_pressure = 15000000
|
||||
target_pressure = 15000000
|
||||
|
||||
on
|
||||
on = 1
|
||||
icon_state = "intact_on"
|
||||
/obj/machinery/atmospherics/binary/pump/on
|
||||
icon_state = "map_on"
|
||||
on = 1
|
||||
|
||||
update_icon()
|
||||
if(stat & NOPOWER)
|
||||
icon_state = "intact_off"
|
||||
else if(node1 && node2)
|
||||
icon_state = "intact_[on?("on"):("off")]"
|
||||
else
|
||||
if(node1)
|
||||
icon_state = "exposed_1_off"
|
||||
else if(node2)
|
||||
icon_state = "exposed_2_off"
|
||||
else
|
||||
icon_state = "exposed_3_off"
|
||||
return
|
||||
/obj/machinery/atmospherics/binary/pump/update_icon()
|
||||
if(!powered())
|
||||
icon_state = "off"
|
||||
else
|
||||
icon_state = "[on ? "on" : "off"]"
|
||||
|
||||
process()
|
||||
// ..()
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
/obj/machinery/atmospherics/binary/pump/update_underlays()
|
||||
if(..())
|
||||
underlays.Cut()
|
||||
var/turf/T = get_turf(src)
|
||||
if(!istype(T))
|
||||
return
|
||||
if(!on)
|
||||
return 0
|
||||
add_underlay(T, node1, turn(dir, -180))
|
||||
add_underlay(T, node2, dir)
|
||||
|
||||
var/output_starting_pressure = air2.return_pressure()
|
||||
/obj/machinery/atmospherics/binary/pump/hide(var/i)
|
||||
update_underlays()
|
||||
|
||||
if( (target_pressure - output_starting_pressure) < 0.01)
|
||||
//No need to pump gas if target is already reached!
|
||||
return 1
|
||||
/obj/machinery/atmospherics/binary/pump/process()
|
||||
// ..()
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
if(!on)
|
||||
return 0
|
||||
|
||||
//Calculate necessary moles to transfer using PV=nRT
|
||||
if((air1.total_moles() > 0) && (air1.temperature>0))
|
||||
var/pressure_delta = target_pressure - output_starting_pressure
|
||||
var/transfer_moles = pressure_delta*air2.volume/(air1.temperature * R_IDEAL_GAS_EQUATION)
|
||||
|
||||
//Actually transfer the gas
|
||||
var/datum/gas_mixture/removed = air1.remove(transfer_moles)
|
||||
air2.merge(removed)
|
||||
|
||||
if(network1)
|
||||
network1.update = 1
|
||||
|
||||
if(network2)
|
||||
network2.update = 1
|
||||
var/output_starting_pressure = air2.return_pressure()
|
||||
|
||||
if( (target_pressure - output_starting_pressure) < 0.01)
|
||||
//No need to pump gas if target is already reached!
|
||||
return 1
|
||||
|
||||
//Radio remote control
|
||||
//Calculate necessary moles to transfer using PV=nRT
|
||||
if((air1.total_moles() > 0) && (air1.temperature>0))
|
||||
var/pressure_delta = target_pressure - output_starting_pressure
|
||||
var/transfer_moles = pressure_delta*air2.volume/(air1.temperature * R_IDEAL_GAS_EQUATION)
|
||||
|
||||
proc
|
||||
set_frequency(new_frequency)
|
||||
radio_controller.remove_object(src, frequency)
|
||||
frequency = new_frequency
|
||||
if(frequency)
|
||||
radio_connection = radio_controller.add_object(src, frequency, filter = RADIO_ATMOSIA)
|
||||
//Actually transfer the gas
|
||||
var/datum/gas_mixture/removed = air1.remove(transfer_moles)
|
||||
air2.merge(removed)
|
||||
|
||||
broadcast_status()
|
||||
if(!radio_connection)
|
||||
return 0
|
||||
if(network1)
|
||||
network1.update = 1
|
||||
|
||||
var/datum/signal/signal = new
|
||||
signal.transmission_method = 1 //radio signal
|
||||
signal.source = src
|
||||
if(network2)
|
||||
network2.update = 1
|
||||
|
||||
signal.data = list(
|
||||
"tag" = id,
|
||||
"device" = "AGP",
|
||||
"power" = on,
|
||||
"target_output" = target_pressure,
|
||||
"sigtype" = "status"
|
||||
)
|
||||
return 1
|
||||
|
||||
radio_connection.post_signal(src, signal, filter = RADIO_ATMOSIA)
|
||||
//Radio remote control
|
||||
|
||||
return 1
|
||||
/obj/machinery/atmospherics/binary/pump/proc/set_frequency(new_frequency)
|
||||
radio_controller.remove_object(src, frequency)
|
||||
frequency = new_frequency
|
||||
if(frequency)
|
||||
radio_connection = radio_controller.add_object(src, frequency, filter = RADIO_ATMOSIA)
|
||||
|
||||
interact(mob/user as mob)
|
||||
var/dat = {"<b>Power: </b><a href='?src=\ref[src];power=1'>[on?"On":"Off"]</a><br>
|
||||
<b>Desirable output pressure: </b>
|
||||
[round(target_pressure,0.1)]kPa | <a href='?src=\ref[src];set_press=1'>Change</a>
|
||||
"}
|
||||
/obj/machinery/atmospherics/binary/pump/proc/broadcast_status()
|
||||
if(!radio_connection)
|
||||
return 0
|
||||
|
||||
user << browse("<HEAD><TITLE>[src.name] control</TITLE></HEAD><TT>[dat]</TT>", "window=atmo_pump")
|
||||
onclose(user, "atmo_pump")
|
||||
var/datum/signal/signal = new
|
||||
signal.transmission_method = 1 //radio signal
|
||||
signal.source = src
|
||||
|
||||
initialize()
|
||||
..()
|
||||
if(frequency)
|
||||
set_frequency(frequency)
|
||||
signal.data = list(
|
||||
"tag" = id,
|
||||
"device" = "AGP",
|
||||
"power" = on,
|
||||
"target_output" = target_pressure,
|
||||
"sigtype" = "status"
|
||||
)
|
||||
|
||||
receive_signal(datum/signal/signal)
|
||||
if(!signal.data["tag"] || (signal.data["tag"] != id) || (signal.data["sigtype"]!="command"))
|
||||
return 0
|
||||
radio_connection.post_signal(src, signal, filter = RADIO_ATMOSIA)
|
||||
|
||||
if("power" in signal.data)
|
||||
on = text2num(signal.data["power"])
|
||||
return 1
|
||||
|
||||
if("power_toggle" in signal.data)
|
||||
on = !on
|
||||
/obj/machinery/atmospherics/binary/pump/interact(mob/user as mob)
|
||||
var/dat = {"<b>Power: </b><a href='?src=\ref[src];power=1'>[on?"On":"Off"]</a><br>
|
||||
<b>Desirable output pressure: </b>
|
||||
[round(target_pressure,0.1)]kPa | <a href='?src=\ref[src];set_press=1'>Change</a>
|
||||
"}
|
||||
|
||||
if("set_output_pressure" in signal.data)
|
||||
target_pressure = between(
|
||||
0,
|
||||
text2num(signal.data["set_output_pressure"]),
|
||||
ONE_ATMOSPHERE*50
|
||||
)
|
||||
user << browse("<HEAD><TITLE>[src.name] control</TITLE></HEAD><TT>[dat]</TT>", "window=atmo_pump")
|
||||
onclose(user, "atmo_pump")
|
||||
|
||||
if("status" in signal.data)
|
||||
spawn(2)
|
||||
broadcast_status()
|
||||
return //do not update_icon
|
||||
/obj/machinery/atmospherics/binary/pump/initialize()
|
||||
..()
|
||||
if(frequency)
|
||||
set_frequency(frequency)
|
||||
|
||||
/obj/machinery/atmospherics/binary/pump/receive_signal(datum/signal/signal)
|
||||
if(!signal.data["tag"] || (signal.data["tag"] != id) || (signal.data["sigtype"]!="command"))
|
||||
return 0
|
||||
|
||||
if(signal.data["power"])
|
||||
on = text2num(signal.data["power"])
|
||||
|
||||
if(signal.data["power_toggle"])
|
||||
on = !on
|
||||
|
||||
if(signal.data["set_output_pressure"])
|
||||
target_pressure = between(
|
||||
0,
|
||||
text2num(signal.data["set_output_pressure"]),
|
||||
ONE_ATMOSPHERE*50
|
||||
)
|
||||
|
||||
if(signal.data["status"])
|
||||
spawn(2)
|
||||
broadcast_status()
|
||||
update_icon()
|
||||
return //do not update_icon
|
||||
|
||||
spawn(2)
|
||||
broadcast_status()
|
||||
update_icon()
|
||||
return
|
||||
|
||||
|
||||
/obj/machinery/atmospherics/binary/pump/attack_hand(user as mob)
|
||||
if(..())
|
||||
return
|
||||
|
||||
|
||||
attack_hand(user as mob)
|
||||
if(..())
|
||||
return
|
||||
src.add_fingerprint(usr)
|
||||
if(!src.allowed(user))
|
||||
user << "\red Access denied."
|
||||
return
|
||||
usr.set_machine(src)
|
||||
interact(user)
|
||||
src.add_fingerprint(usr)
|
||||
if(!src.allowed(user))
|
||||
user << "\red Access denied."
|
||||
return
|
||||
usr.set_machine(src)
|
||||
interact(user)
|
||||
return
|
||||
|
||||
Topic(href,href_list)
|
||||
if(..()) return
|
||||
if(href_list["power"])
|
||||
on = !on
|
||||
if(href_list["set_press"])
|
||||
var/new_pressure = input(usr,"Enter new output pressure (0-4500kPa)","Pressure control",src.target_pressure) as num
|
||||
src.target_pressure = max(0, min(4500, new_pressure))
|
||||
usr.set_machine(src)
|
||||
src.update_icon()
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
/obj/machinery/atmospherics/binary/pump/Topic(href,href_list)
|
||||
if(..()) return
|
||||
if(href_list["power"])
|
||||
on = !on
|
||||
if(href_list["set_press"])
|
||||
var/new_pressure = input(usr,"Enter new output pressure (0-4500kPa)","Pressure control",src.target_pressure) as num
|
||||
src.target_pressure = max(0, min(4500, new_pressure))
|
||||
usr.set_machine(src)
|
||||
src.update_icon()
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
power_change()
|
||||
..()
|
||||
/obj/machinery/atmospherics/binary/pump/power_change()
|
||||
var/old_stat = stat
|
||||
..()
|
||||
if(old_stat != stat)
|
||||
update_icon()
|
||||
|
||||
attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
|
||||
if (!istype(W, /obj/item/weapon/wrench))
|
||||
return ..()
|
||||
if (!(stat & NOPOWER) && on)
|
||||
user << "\red You cannot unwrench this [src], turn it off first."
|
||||
return 1
|
||||
var/turf/T = src.loc
|
||||
if (level==1 && isturf(T) && T.intact)
|
||||
user << "\red You must remove the plating first."
|
||||
return 1
|
||||
var/datum/gas_mixture/int_air = return_air()
|
||||
var/datum/gas_mixture/env_air = loc.return_air()
|
||||
if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE)
|
||||
user << "\red You cannot unwrench this [src], it too exerted due to internal pressure."
|
||||
add_fingerprint(user)
|
||||
return 1
|
||||
playsound(get_turf(src), 'sound/items/Ratchet.ogg', 50, 1)
|
||||
user << "\blue You begin to unfasten \the [src]..."
|
||||
if (do_after(user, 40))
|
||||
user.visible_message( \
|
||||
"[user] unfastens \the [src].", \
|
||||
"\blue You have unfastened \the [src].", \
|
||||
"You hear ratchet.")
|
||||
new /obj/item/pipe(loc, make_from=src)
|
||||
del(src)
|
||||
/obj/machinery/atmospherics/binary/pump/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
|
||||
if (!istype(W, /obj/item/weapon/wrench))
|
||||
return ..()
|
||||
if (!(stat & NOPOWER) && on)
|
||||
user << "\red You cannot unwrench this [src], turn it off first."
|
||||
return 1
|
||||
var/datum/gas_mixture/int_air = return_air()
|
||||
var/datum/gas_mixture/env_air = loc.return_air()
|
||||
if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE)
|
||||
user << "\red You cannot unwrench this [src], it too exerted due to internal pressure."
|
||||
add_fingerprint(user)
|
||||
return 1
|
||||
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
|
||||
user << "\blue You begin to unfasten \the [src]..."
|
||||
if (do_after(user, 40))
|
||||
user.visible_message( \
|
||||
"[user] unfastens \the [src].", \
|
||||
"\blue You have unfastened \the [src].", \
|
||||
"You hear ratchet.")
|
||||
new /obj/item/pipe(loc, make_from=src)
|
||||
del(src)
|
||||
@@ -12,9 +12,10 @@ Thus, the two variables affect pump operation are set in New():
|
||||
but overall network volume is also increased as this increases...
|
||||
*/
|
||||
|
||||
obj/machinery/atmospherics/binary/volume_pump
|
||||
icon = 'icons/obj/atmospherics/volume_pump.dmi'
|
||||
icon_state = "intact_off"
|
||||
/obj/machinery/atmospherics/binary/volume_pump
|
||||
icon = 'icons/atmos/volume_pump.dmi'
|
||||
icon_state = "map_off"
|
||||
level = 1
|
||||
|
||||
name = "Volumetric gas pump"
|
||||
desc = "A volumetric pump"
|
||||
@@ -26,174 +27,168 @@ obj/machinery/atmospherics/binary/volume_pump
|
||||
var/id = null
|
||||
var/datum/radio_frequency/radio_connection
|
||||
|
||||
on
|
||||
on = 1
|
||||
icon_state = "intact_on"
|
||||
/obj/machinery/atmospherics/binary/volume_pump/on
|
||||
on = 1
|
||||
icon_state = "map_on"
|
||||
|
||||
update_icon()
|
||||
if(stat & NOPOWER)
|
||||
icon_state = "intact_off"
|
||||
else if(node1 && node2)
|
||||
icon_state = "intact_[on?("on"):("off")]"
|
||||
else
|
||||
if(node1)
|
||||
icon_state = "exposed_1_off"
|
||||
else if(node2)
|
||||
icon_state = "exposed_2_off"
|
||||
else
|
||||
icon_state = "exposed_3_off"
|
||||
return
|
||||
/obj/machinery/atmospherics/binary/volume_pump/update_icon()
|
||||
if(!powered())
|
||||
icon_state = "off"
|
||||
else
|
||||
icon_state = "[on ? "on" : "off"]"
|
||||
|
||||
process()
|
||||
// ..()
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
/obj/machinery/atmospherics/binary/volume_pump/update_underlays()
|
||||
if(..())
|
||||
underlays.Cut()
|
||||
var/turf/T = get_turf(src)
|
||||
if(!istype(T))
|
||||
return
|
||||
if(!on || transfer_rate < 1)
|
||||
return 0
|
||||
add_underlay(T, node1, turn(dir, -180))
|
||||
add_underlay(T, node2, dir)
|
||||
|
||||
/obj/machinery/atmospherics/binary/volume_pump/hide(var/i)
|
||||
update_underlays()
|
||||
|
||||
/obj/machinery/atmospherics/binary/volume_pump/process()
|
||||
// ..()
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
if(!on)
|
||||
return 0
|
||||
|
||||
// Pump mechanism just won't do anything if the pressure is too high/too low
|
||||
|
||||
var/input_starting_pressure = air1.return_pressure()
|
||||
var/output_starting_pressure = air2.return_pressure()
|
||||
|
||||
if((input_starting_pressure < 0.01) || (output_starting_pressure > 9000))
|
||||
return 1
|
||||
|
||||
var/transfer_ratio = max(1, transfer_rate/air1.volume)
|
||||
|
||||
var/datum/gas_mixture/removed = air1.remove_ratio(transfer_ratio)
|
||||
|
||||
air2.merge(removed)
|
||||
|
||||
if(network1)
|
||||
network1.update = 1
|
||||
|
||||
if(network2)
|
||||
network2.update = 1
|
||||
var/input_starting_pressure = air1.return_pressure()
|
||||
var/output_starting_pressure = air2.return_pressure()
|
||||
|
||||
if((input_starting_pressure < 0.01) || (output_starting_pressure > 9000))
|
||||
return 1
|
||||
|
||||
proc
|
||||
set_frequency(new_frequency)
|
||||
radio_controller.remove_object(src, frequency)
|
||||
frequency = new_frequency
|
||||
if(frequency)
|
||||
radio_connection = radio_controller.add_object(src, frequency)
|
||||
var/transfer_ratio = max(1, transfer_rate/air1.volume)
|
||||
|
||||
broadcast_status()
|
||||
if(!radio_connection)
|
||||
return 0
|
||||
var/datum/gas_mixture/removed = air1.remove_ratio(transfer_ratio)
|
||||
|
||||
var/datum/signal/signal = new
|
||||
signal.transmission_method = 1 //radio signal
|
||||
signal.source = src
|
||||
air2.merge(removed)
|
||||
|
||||
signal.data = list(
|
||||
"tag" = id,
|
||||
"device" = "APV",
|
||||
"power" = on,
|
||||
"transfer_rate" = transfer_rate,
|
||||
"sigtype" = "status"
|
||||
)
|
||||
radio_connection.post_signal(src, signal)
|
||||
if(network1)
|
||||
network1.update = 1
|
||||
|
||||
return 1
|
||||
if(network2)
|
||||
network2.update = 1
|
||||
|
||||
interact(mob/user as mob)
|
||||
var/dat = {"<b>Power: </b><a href='?src=\ref[src];power=1'>[on?"On":"Off"]</a><br>
|
||||
<b>Desirable output flow: </b>
|
||||
[round(transfer_rate,1)]l/s | <a href='?src=\ref[src];set_transfer_rate=1'>Change</a>
|
||||
"}
|
||||
return 1
|
||||
|
||||
user << browse("<HEAD><TITLE>[src.name] control</TITLE></HEAD><TT>[dat]</TT>", "window=atmo_pump")
|
||||
onclose(user, "atmo_pump")
|
||||
/obj/machinery/atmospherics/binary/volume_pump/proc/set_frequency(new_frequency)
|
||||
radio_controller.remove_object(src, frequency)
|
||||
frequency = new_frequency
|
||||
if(frequency)
|
||||
radio_connection = radio_controller.add_object(src, frequency)
|
||||
|
||||
/obj/machinery/atmospherics/binary/volume_pump/proc/broadcast_status()
|
||||
if(!radio_connection)
|
||||
return 0
|
||||
|
||||
var/datum/signal/signal = new
|
||||
signal.transmission_method = 1 //radio signal
|
||||
signal.source = src
|
||||
|
||||
initialize()
|
||||
..()
|
||||
signal.data = list(
|
||||
"tag" = id,
|
||||
"device" = "APV",
|
||||
"power" = on,
|
||||
"transfer_rate" = transfer_rate,
|
||||
"sigtype" = "status"
|
||||
)
|
||||
radio_connection.post_signal(src, signal)
|
||||
|
||||
set_frequency(frequency)
|
||||
return 1
|
||||
|
||||
receive_signal(datum/signal/signal)
|
||||
if(!signal.data["tag"] || (signal.data["tag"] != id) || (signal.data["sigtype"]!="command"))
|
||||
return 0
|
||||
/obj/machinery/atmospherics/binary/volume_pump/interact(mob/user as mob)
|
||||
var/dat = {"<b>Power: </b><a href='?src=\ref[src];power=1'>[on?"On":"Off"]</a><br>
|
||||
<b>Desirable output flow: </b>
|
||||
[round(transfer_rate,1)]l/s | <a href='?src=\ref[src];set_transfer_rate=1'>Change</a>
|
||||
"}
|
||||
|
||||
if("power" in signal.data)
|
||||
on = text2num(signal.data["power"])
|
||||
user << browse("<HEAD><TITLE>[src.name] control</TITLE></HEAD><TT>[dat]</TT>", "window=atmo_pump")
|
||||
onclose(user, "atmo_pump")
|
||||
|
||||
if("power_toggle" in signal.data)
|
||||
on = !on
|
||||
/obj/machinery/atmospherics/binary/volume_pump/initialize()
|
||||
..()
|
||||
set_frequency(frequency)
|
||||
|
||||
if("set_transfer_rate" in signal.data)
|
||||
transfer_rate = between(
|
||||
0,
|
||||
text2num(signal.data["set_transfer_rate"]),
|
||||
air1.volume
|
||||
)
|
||||
/obj/machinery/atmospherics/binary/volume_pump/receive_signal(datum/signal/signal)
|
||||
if(!signal.data["tag"] || (signal.data["tag"] != id) || (signal.data["sigtype"]!="command"))
|
||||
return 0
|
||||
|
||||
if("status" in signal.data)
|
||||
spawn(2)
|
||||
broadcast_status()
|
||||
return //do not update_icon
|
||||
if(signal.data["power"])
|
||||
on = text2num(signal.data["power"])
|
||||
|
||||
if(signal.data["power_toggle"])
|
||||
on = !on
|
||||
|
||||
if(signal.data["set_transfer_rate"])
|
||||
transfer_rate = between(
|
||||
0,
|
||||
text2num(signal.data["set_transfer_rate"]),
|
||||
air1.volume
|
||||
)
|
||||
|
||||
if(signal.data["status"])
|
||||
spawn(2)
|
||||
broadcast_status()
|
||||
return //do not update_icon
|
||||
|
||||
spawn(2)
|
||||
broadcast_status()
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/atmospherics/binary/volume_pump/attack_hand(user as mob)
|
||||
if(..())
|
||||
return
|
||||
src.add_fingerprint(usr)
|
||||
if(!src.allowed(user))
|
||||
user << "\red Access denied."
|
||||
return
|
||||
usr.set_machine(src)
|
||||
interact(user)
|
||||
return
|
||||
|
||||
/obj/machinery/atmospherics/binary/volume_pump/Topic(href,href_list)
|
||||
if(..()) return
|
||||
if(href_list["power"])
|
||||
on = !on
|
||||
if(href_list["set_transfer_rate"])
|
||||
var/new_transfer_rate = input(usr,"Enter new output volume (0-200l/s)","Flow control",src.transfer_rate) as num
|
||||
src.transfer_rate = max(0, min(200, new_transfer_rate))
|
||||
usr.set_machine(src)
|
||||
src.update_icon()
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
/obj/machinery/atmospherics/binary/volume_pump/power_change()
|
||||
var/old_stat = stat
|
||||
..()
|
||||
if(old_stat != stat)
|
||||
update_icon()
|
||||
|
||||
|
||||
attack_hand(user as mob)
|
||||
if(..())
|
||||
return
|
||||
src.add_fingerprint(usr)
|
||||
if(!src.allowed(user))
|
||||
user << "\red Access denied."
|
||||
return
|
||||
usr.set_machine(src)
|
||||
interact(user)
|
||||
return
|
||||
|
||||
Topic(href,href_list)
|
||||
if(..()) return
|
||||
if(href_list["power"])
|
||||
on = !on
|
||||
if(href_list["set_transfer_rate"])
|
||||
var/new_transfer_rate = input(usr,"Enter new output volume (0-200l/s)","Flow control",src.transfer_rate) as num
|
||||
src.transfer_rate = max(0, min(200, new_transfer_rate))
|
||||
usr.set_machine(src)
|
||||
src.update_icon()
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
power_change()
|
||||
..()
|
||||
update_icon()
|
||||
|
||||
|
||||
|
||||
attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
|
||||
if (!istype(W, /obj/item/weapon/wrench))
|
||||
return ..()
|
||||
if (!(stat & NOPOWER) && on)
|
||||
user << "\red You cannot unwrench this [src], turn it off first."
|
||||
return 1
|
||||
var/turf/T = src.loc
|
||||
if (level==1 && isturf(T) && T.intact)
|
||||
user << "\red You must remove the plating first."
|
||||
return 1
|
||||
var/datum/gas_mixture/int_air = return_air()
|
||||
var/datum/gas_mixture/env_air = loc.return_air()
|
||||
if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE)
|
||||
user << "\red You cannot unwrench this [src], it too exerted due to internal pressure."
|
||||
add_fingerprint(user)
|
||||
return 1
|
||||
playsound(get_turf(src), 'sound/items/Ratchet.ogg', 50, 1)
|
||||
user << "\blue You begin to unfasten \the [src]..."
|
||||
if (do_after(user, 40))
|
||||
user.visible_message( \
|
||||
"[user] unfastens \the [src].", \
|
||||
"\blue You have unfastened \the [src].", \
|
||||
"You hear ratchet.")
|
||||
new /obj/item/pipe(loc, make_from=src)
|
||||
del(src)
|
||||
|
||||
/obj/machinery/atmospherics/binary/volume_pump/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
|
||||
if (!istype(W, /obj/item/weapon/wrench))
|
||||
return ..()
|
||||
if (!(stat & NOPOWER) && on)
|
||||
user << "\red You cannot unwrench this [src], turn it off first."
|
||||
return 1
|
||||
var/datum/gas_mixture/int_air = return_air()
|
||||
var/datum/gas_mixture/env_air = loc.return_air()
|
||||
if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE)
|
||||
user << "\red You cannot unwrench this [src], it too exerted due to internal pressure."
|
||||
add_fingerprint(user)
|
||||
return 1
|
||||
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
|
||||
user << "\blue You begin to unfasten \the [src]..."
|
||||
if (do_after(user, 40))
|
||||
user.visible_message( \
|
||||
"[user] unfastens \the [src].", \
|
||||
"\blue You have unfastened \the [src].", \
|
||||
"You hear ratchet.")
|
||||
new /obj/item/pipe(loc, make_from=src)
|
||||
del(src)
|
||||
@@ -0,0 +1,93 @@
|
||||
//--------------------------------------------
|
||||
// Omni device port types
|
||||
//--------------------------------------------
|
||||
#define ATM_NONE 0
|
||||
#define ATM_INPUT 1
|
||||
#define ATM_OUTPUT 2
|
||||
|
||||
#define ATM_O2 3
|
||||
#define ATM_N2 4
|
||||
#define ATM_CO2 5
|
||||
#define ATM_P 6 //Phoron
|
||||
#define ATM_N2O 7
|
||||
|
||||
//--------------------------------------------
|
||||
// Omni port datum
|
||||
//
|
||||
// Used by omni devices to manage connections
|
||||
// to other atmospheric objects.
|
||||
//--------------------------------------------
|
||||
/datum/omni_port
|
||||
var/obj/machinery/atmospherics/omni/master
|
||||
var/dir
|
||||
var/update = 1
|
||||
var/mode = 0
|
||||
var/concentration = 0
|
||||
var/con_lock = 0
|
||||
var/transfer_moles = 0
|
||||
var/datum/gas_mixture/air
|
||||
var/obj/machinery/atmospherics/node
|
||||
var/datum/pipe_network/network
|
||||
|
||||
/datum/omni_port/New(var/obj/machinery/atmospherics/omni/M, var/direction = NORTH)
|
||||
..()
|
||||
dir = direction
|
||||
if(istype(M))
|
||||
master = M
|
||||
air = new
|
||||
air.volume = 200
|
||||
|
||||
/datum/omni_port/proc/connect()
|
||||
if(node)
|
||||
return
|
||||
master.initialize()
|
||||
master.build_network()
|
||||
if(node)
|
||||
node.initialize()
|
||||
node.build_network()
|
||||
|
||||
/datum/omni_port/proc/disconnect()
|
||||
if(node)
|
||||
node.disconnect(master)
|
||||
master.disconnect(node)
|
||||
|
||||
|
||||
//--------------------------------------------
|
||||
// Need to find somewhere else for these
|
||||
//--------------------------------------------
|
||||
|
||||
//returns a text string based on the direction flag input
|
||||
// if capitalize is true, it will return the string capitalized
|
||||
// otherwise it will return the direction string in lower case
|
||||
/proc/dir_name(var/dir, var/capitalize = 0)
|
||||
var/string = null
|
||||
switch(dir)
|
||||
if(NORTH)
|
||||
string = "North"
|
||||
if(SOUTH)
|
||||
string = "South"
|
||||
if(EAST)
|
||||
string = "East"
|
||||
if(WEST)
|
||||
string = "West"
|
||||
|
||||
if(!capitalize && string)
|
||||
string = lowertext(string)
|
||||
|
||||
return string
|
||||
|
||||
//returns a direction flag based on the string passed to it
|
||||
// case insensitive
|
||||
/proc/dir_flag(var/dir)
|
||||
dir = lowertext(dir)
|
||||
switch(dir)
|
||||
if("north")
|
||||
return NORTH
|
||||
if("south")
|
||||
return SOUTH
|
||||
if("east")
|
||||
return EAST
|
||||
if("west")
|
||||
return WEST
|
||||
else
|
||||
return 0
|
||||
@@ -87,8 +87,8 @@
|
||||
filtered_out.carbon_dioxide = removed.carbon_dioxide
|
||||
removed.carbon_dioxide = 0
|
||||
if(ATM_P)
|
||||
filtered_out.phoron = removed.phoron
|
||||
removed.phoron = 0
|
||||
filtered_out.toxins = removed.toxins
|
||||
removed.toxins = 0
|
||||
if(ATM_N2O)
|
||||
if(removed.trace_gases.len>0)
|
||||
for(var/datum/gas/sleeping_agent/trace_gas in removed.trace_gases)
|
||||
@@ -112,14 +112,14 @@
|
||||
|
||||
return
|
||||
|
||||
/obj/machinery/atmospherics/omni/filter/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
|
||||
/obj/machinery/atmospherics/omni/filter/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null)
|
||||
usr.set_machine(src)
|
||||
|
||||
var/list/data = new()
|
||||
|
||||
data = build_uidata()
|
||||
|
||||
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
|
||||
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data)
|
||||
|
||||
if (!ui)
|
||||
ui = new(user, src, ui_key, "omni_filter.tmpl", "Omni Filter Control", 330, 330)
|
||||
@@ -174,7 +174,7 @@
|
||||
if(ATM_CO2)
|
||||
return "Carbon Dioxide"
|
||||
if(ATM_P)
|
||||
return "Phoron" //*cough* Plasma *cough*
|
||||
return "Plasma" //*cough* Plasma *cough*
|
||||
if(ATM_N2O)
|
||||
return "Nitrous Oxide"
|
||||
else
|
||||
@@ -202,7 +202,7 @@
|
||||
if("switch_mode")
|
||||
switch_mode(dir_flag(href_list["dir"]), mode_return_switch(href_list["mode"]))
|
||||
if("switch_filter")
|
||||
var/new_filter = input(usr,"Select filter mode:","Change filter",href_list["mode"]) in list("None", "Oxygen", "Nitrogen", "Carbon Dioxide", "Phoron", "Nitrous Oxide")
|
||||
var/new_filter = input(usr,"Select filter mode:","Change filter",href_list["mode"]) in list("None", "Oxygen", "Nitrogen", "Carbon Dioxide", "Plasma", "Nitrous Oxide")
|
||||
switch_filter(dir_flag(href_list["dir"]), mode_return_switch(new_filter))
|
||||
|
||||
update_icon()
|
||||
@@ -217,7 +217,7 @@
|
||||
return ATM_N2
|
||||
if("Carbon Dioxide")
|
||||
return ATM_CO2
|
||||
if("Phoron")
|
||||
if("Plasma")
|
||||
return ATM_P
|
||||
if("Nitrous Oxide")
|
||||
return ATM_N2O
|
||||
|
||||
@@ -137,14 +137,14 @@
|
||||
|
||||
return 1
|
||||
|
||||
/obj/machinery/atmospherics/omni/mixer/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
|
||||
/obj/machinery/atmospherics/omni/mixer/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null)
|
||||
usr.set_machine(src)
|
||||
|
||||
var/list/data = new()
|
||||
|
||||
data = build_uidata()
|
||||
|
||||
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
|
||||
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data)
|
||||
|
||||
if (!ui)
|
||||
ui = new(user, src, ui_key, "omni_mixer.tmpl", "Omni Mixer Control", 360, 330)
|
||||
|
||||
@@ -0,0 +1,291 @@
|
||||
//--------------------------------------------
|
||||
// Base omni device
|
||||
//--------------------------------------------
|
||||
/obj/machinery/atmospherics/omni
|
||||
name = "omni device"
|
||||
icon = 'icons/atmos/omni_devices.dmi'
|
||||
icon_state = "base"
|
||||
use_power = 1
|
||||
initialize_directions = 0
|
||||
level = 1
|
||||
|
||||
var/on = 0
|
||||
var/configuring = 0
|
||||
var/target_pressure = ONE_ATMOSPHERE
|
||||
|
||||
var/tag_north = ATM_NONE
|
||||
var/tag_south = ATM_NONE
|
||||
var/tag_east = ATM_NONE
|
||||
var/tag_west = ATM_NONE
|
||||
|
||||
var/overlays_on[5]
|
||||
var/overlays_off[5]
|
||||
var/overlays_error[2]
|
||||
var/underlays_current[4]
|
||||
|
||||
var/list/ports = new()
|
||||
|
||||
/obj/machinery/atmospherics/omni/New()
|
||||
..()
|
||||
icon_state = "base"
|
||||
|
||||
ports = new()
|
||||
for(var/d in cardinal)
|
||||
var/datum/omni_port/new_port = new(src, d)
|
||||
switch(d)
|
||||
if(NORTH)
|
||||
new_port.mode = tag_north
|
||||
if(SOUTH)
|
||||
new_port.mode = tag_south
|
||||
if(EAST)
|
||||
new_port.mode = tag_east
|
||||
if(WEST)
|
||||
new_port.mode = tag_west
|
||||
if(new_port.mode > 0)
|
||||
initialize_directions |= d
|
||||
ports += new_port
|
||||
|
||||
build_icons()
|
||||
|
||||
/obj/machinery/atmospherics/omni/update_icon()
|
||||
if(stat & NOPOWER)
|
||||
overlays = overlays_off
|
||||
on = 0
|
||||
else if(error_check())
|
||||
overlays = overlays_error
|
||||
on = 0
|
||||
else
|
||||
overlays = on ? (overlays_on) : (overlays_off)
|
||||
|
||||
underlays = underlays_current
|
||||
|
||||
return
|
||||
|
||||
/obj/machinery/atmospherics/omni/proc/error_check()
|
||||
return
|
||||
|
||||
/obj/machinery/atmospherics/omni/power_change()
|
||||
var/old_stat = stat
|
||||
..()
|
||||
if(old_stat != stat)
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/atmospherics/omni/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
|
||||
if(!istype(W, /obj/item/weapon/wrench))
|
||||
return ..()
|
||||
|
||||
var/int_pressure = 0
|
||||
for(var/datum/omni_port/P in ports)
|
||||
int_pressure += P.air.return_pressure()
|
||||
var/datum/gas_mixture/env_air = loc.return_air()
|
||||
if ((int_pressure - env_air.return_pressure()) > 2*ONE_ATMOSPHERE)
|
||||
user << "<span class='warning'>You cannot unwrench [src], it is too exerted due to internal pressure.</span>"
|
||||
add_fingerprint(user)
|
||||
return 1
|
||||
user << "\blue You begin to unfasten \the [src]..."
|
||||
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
|
||||
if(do_after(user, 40))
|
||||
user.visible_message( \
|
||||
"[user] unfastens \the [src].", \
|
||||
"\blue You have unfastened \the [src].", \
|
||||
"You hear a ratchet.")
|
||||
new /obj/item/pipe(loc, make_from=src)
|
||||
del(src)
|
||||
|
||||
/obj/machinery/atmospherics/omni/attack_hand(user as mob)
|
||||
if(..())
|
||||
return
|
||||
|
||||
src.add_fingerprint(usr)
|
||||
ui_interact(user)
|
||||
return
|
||||
|
||||
/obj/machinery/atmospherics/omni/proc/build_icons()
|
||||
if(!check_icon_cache())
|
||||
return
|
||||
|
||||
var/core_icon = null
|
||||
if(istype(src, /obj/machinery/atmospherics/omni/mixer))
|
||||
core_icon = "mixer"
|
||||
else if(istype(src, /obj/machinery/atmospherics/omni/filter))
|
||||
core_icon = "filter"
|
||||
else
|
||||
return
|
||||
|
||||
//directional icons are layers 1-4, with the core icon on layer 5
|
||||
if(core_icon)
|
||||
overlays_off[5] = icon_manager.get_atmos_icon("omni", , , core_icon)
|
||||
overlays_on[5] = icon_manager.get_atmos_icon("omni", , , core_icon + "_glow")
|
||||
|
||||
overlays_error[1] = icon_manager.get_atmos_icon("omni", , , core_icon)
|
||||
overlays_error[2] = icon_manager.get_atmos_icon("omni", , , "error")
|
||||
|
||||
/obj/machinery/atmospherics/omni/proc/update_port_icons()
|
||||
if(!check_icon_cache())
|
||||
return
|
||||
|
||||
for(var/datum/omni_port/P in ports)
|
||||
if(P.update)
|
||||
var/ref_layer = 0
|
||||
switch(P.dir)
|
||||
if(NORTH)
|
||||
ref_layer = 1
|
||||
if(SOUTH)
|
||||
ref_layer = 2
|
||||
if(EAST)
|
||||
ref_layer = 3
|
||||
if(WEST)
|
||||
ref_layer = 4
|
||||
|
||||
if(!ref_layer)
|
||||
continue
|
||||
|
||||
var/list/port_icons = select_port_icons(P)
|
||||
if(port_icons)
|
||||
if(P.node)
|
||||
underlays_current[ref_layer] = port_icons["pipe_icon"]
|
||||
else
|
||||
underlays_current[ref_layer] = null
|
||||
overlays_off[ref_layer] = port_icons["off_icon"]
|
||||
overlays_on[ref_layer] = port_icons["on_icon"]
|
||||
else
|
||||
underlays_current[ref_layer] = null
|
||||
overlays_off[ref_layer] = null
|
||||
overlays_on[ref_layer] = null
|
||||
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/atmospherics/omni/proc/select_port_icons(var/datum/omni_port/P)
|
||||
if(!istype(P))
|
||||
return
|
||||
|
||||
if(P.mode > 0)
|
||||
var/ic_dir = dir_name(P.dir)
|
||||
var/ic_on = ic_dir
|
||||
var/ic_off = ic_dir
|
||||
switch(P.mode)
|
||||
if(ATM_INPUT)
|
||||
ic_on += "_in_glow"
|
||||
ic_off += "_in"
|
||||
if(ATM_OUTPUT)
|
||||
ic_on += "_out_glow"
|
||||
ic_off += "_out"
|
||||
if(ATM_O2 to ATM_N2O)
|
||||
ic_on += "_filter"
|
||||
ic_off += "_out"
|
||||
|
||||
ic_on = icon_manager.get_atmos_icon("omni", , , ic_on)
|
||||
ic_off = icon_manager.get_atmos_icon("omni", , , ic_off)
|
||||
|
||||
var/pipe_state
|
||||
var/turf/T = get_turf(src)
|
||||
if(!istype(T))
|
||||
return
|
||||
if(T.intact && istype(P.node, /obj/machinery/atmospherics/pipe) && P.node.level == 1 )
|
||||
pipe_state = icon_manager.get_atmos_icon("underlay_down", P.dir, color_cache_name(P.node))
|
||||
else
|
||||
pipe_state = icon_manager.get_atmos_icon("underlay_intact", P.dir, color_cache_name(P.node))
|
||||
|
||||
return list("on_icon" = ic_on, "off_icon" = ic_off, "pipe_icon" = pipe_state)
|
||||
|
||||
/obj/machinery/atmospherics/omni/update_underlays()
|
||||
for(var/datum/omni_port/P in ports)
|
||||
P.update = 1
|
||||
update_ports()
|
||||
|
||||
/obj/machinery/atmospherics/omni/hide(var/i)
|
||||
update_underlays()
|
||||
|
||||
/obj/machinery/atmospherics/omni/proc/update_ports()
|
||||
sort_ports()
|
||||
update_port_icons()
|
||||
for(var/datum/omni_port/P in ports)
|
||||
P.update = 0
|
||||
|
||||
/obj/machinery/atmospherics/omni/proc/sort_ports()
|
||||
return
|
||||
|
||||
|
||||
// Housekeeping and pipe network stuff below
|
||||
|
||||
/obj/machinery/atmospherics/omni/network_expand(datum/pipe_network/new_network, obj/machinery/atmospherics/pipe/reference)
|
||||
for(var/datum/omni_port/P in ports)
|
||||
if(reference == P.node)
|
||||
P.network = new_network
|
||||
break
|
||||
|
||||
if(new_network.normal_members.Find(src))
|
||||
return 0
|
||||
|
||||
new_network.normal_members += src
|
||||
|
||||
return null
|
||||
|
||||
/obj/machinery/atmospherics/omni/Del()
|
||||
loc = null
|
||||
|
||||
for(var/datum/omni_port/P in ports)
|
||||
if(P.node)
|
||||
P.node.disconnect(src)
|
||||
del(P.network)
|
||||
P.node = null
|
||||
|
||||
..()
|
||||
|
||||
/obj/machinery/atmospherics/omni/initialize()
|
||||
for(var/datum/omni_port/P in ports)
|
||||
if(P.node || P.mode == 0)
|
||||
continue
|
||||
for(var/obj/machinery/atmospherics/target in get_step(src, P.dir))
|
||||
if(target.initialize_directions & get_dir(target,src))
|
||||
P.node = target
|
||||
break
|
||||
|
||||
for(var/datum/omni_port/P in ports)
|
||||
P.update = 1
|
||||
|
||||
update_ports()
|
||||
|
||||
/obj/machinery/atmospherics/omni/build_network()
|
||||
for(var/datum/omni_port/P in ports)
|
||||
if(!P.network && P.node)
|
||||
P.network = new /datum/pipe_network()
|
||||
P.network.normal_members += src
|
||||
P.network.build_network(P.node, src)
|
||||
|
||||
/obj/machinery/atmospherics/omni/return_network(obj/machinery/atmospherics/reference)
|
||||
build_network()
|
||||
|
||||
for(var/datum/omni_port/P in ports)
|
||||
if(reference == P.node)
|
||||
return P.network
|
||||
|
||||
return null
|
||||
|
||||
/obj/machinery/atmospherics/omni/reassign_network(datum/pipe_network/old_network, datum/pipe_network/new_network)
|
||||
for(var/datum/omni_port/P in ports)
|
||||
if(P.network == old_network)
|
||||
P.network = new_network
|
||||
|
||||
return 1
|
||||
|
||||
/obj/machinery/atmospherics/omni/return_network_air(datum/pipe_network/reference)
|
||||
var/list/results = list()
|
||||
|
||||
for(var/datum/omni_port/P in ports)
|
||||
if(P.network == reference)
|
||||
results += P.air
|
||||
|
||||
return results
|
||||
|
||||
/obj/machinery/atmospherics/omni/disconnect(obj/machinery/atmospherics/reference)
|
||||
for(var/datum/omni_port/P in ports)
|
||||
if(reference == P.node)
|
||||
del(P.network)
|
||||
P.node = null
|
||||
P.update = 1
|
||||
break
|
||||
|
||||
update_ports()
|
||||
|
||||
return null
|
||||
@@ -1,6 +1,6 @@
|
||||
/obj/machinery/atmospherics/portables_connector
|
||||
icon = 'icons/obj/atmospherics/portables_connector.dmi'
|
||||
icon_state = "intact"
|
||||
icon = 'icons/atmos/connector.dmi'
|
||||
icon_state = "map_connector"
|
||||
|
||||
name = "Connector Port"
|
||||
desc = "For connecting portables devices related to atmospherics control."
|
||||
@@ -16,142 +16,143 @@
|
||||
|
||||
var/on = 0
|
||||
use_power = 0
|
||||
level = 0
|
||||
level = 1
|
||||
|
||||
|
||||
New()
|
||||
initialize_directions = dir
|
||||
..()
|
||||
/obj/machinery/atmospherics/portables_connector/New()
|
||||
initialize_directions = dir
|
||||
..()
|
||||
|
||||
update_icon()
|
||||
if(node)
|
||||
icon_state = "[level == 1 && istype(loc, /turf/simulated) ? "h" : "" ]intact"
|
||||
dir = get_dir(src, node)
|
||||
else
|
||||
icon_state = "exposed"
|
||||
/obj/machinery/atmospherics/portables_connector/update_icon()
|
||||
icon_state = "connector"
|
||||
|
||||
/obj/machinery/atmospherics/portables_connector/update_underlays()
|
||||
if(..())
|
||||
underlays.Cut()
|
||||
var/turf/T = get_turf(src)
|
||||
if(!istype(T))
|
||||
return
|
||||
add_underlay(T, node, dir)
|
||||
|
||||
/obj/machinery/atmospherics/portables_connector/hide(var/i)
|
||||
update_underlays()
|
||||
|
||||
/obj/machinery/atmospherics/portables_connector/process()
|
||||
..()
|
||||
if(!on)
|
||||
return
|
||||
|
||||
hide(var/i) //to make the little pipe section invisible, the icon changes.
|
||||
if(node)
|
||||
icon_state = "[i == 1 && istype(loc, /turf/simulated) ? "h" : "" ]intact"
|
||||
dir = get_dir(src, node)
|
||||
else
|
||||
icon_state = "exposed"
|
||||
|
||||
process()
|
||||
..()
|
||||
if(!on)
|
||||
return
|
||||
if(!connected_device)
|
||||
on = 0
|
||||
return
|
||||
if(network)
|
||||
network.update = 1
|
||||
return 1
|
||||
if(!connected_device)
|
||||
on = 0
|
||||
return
|
||||
if(network)
|
||||
network.update = 1
|
||||
return 1
|
||||
|
||||
// Housekeeping and pipe network stuff below
|
||||
network_expand(datum/pipe_network/new_network, obj/machinery/atmospherics/pipe/reference)
|
||||
if(reference == node)
|
||||
network = new_network
|
||||
/obj/machinery/atmospherics/portables_connector/network_expand(datum/pipe_network/new_network, obj/machinery/atmospherics/pipe/reference)
|
||||
if(reference == node)
|
||||
network = new_network
|
||||
|
||||
if(new_network.normal_members.Find(src))
|
||||
return 0
|
||||
if(new_network.normal_members.Find(src))
|
||||
return 0
|
||||
|
||||
new_network.normal_members += src
|
||||
new_network.normal_members += src
|
||||
|
||||
return null
|
||||
return null
|
||||
|
||||
Destroy()
|
||||
loc = null
|
||||
/obj/machinery/atmospherics/portables_connector/Del()
|
||||
loc = null
|
||||
|
||||
if(connected_device)
|
||||
connected_device.disconnect()
|
||||
if(connected_device)
|
||||
connected_device.disconnect()
|
||||
|
||||
if(node)
|
||||
node.disconnect(src)
|
||||
del(network)
|
||||
if(node)
|
||||
node.disconnect(src)
|
||||
del(network)
|
||||
|
||||
node = null
|
||||
node = null
|
||||
|
||||
..()
|
||||
..()
|
||||
|
||||
initialize()
|
||||
if(node) return
|
||||
/obj/machinery/atmospherics/portables_connector/initialize()
|
||||
if(node) return
|
||||
|
||||
var/node_connect = dir
|
||||
var/node_connect = dir
|
||||
|
||||
for(var/obj/machinery/atmospherics/target in get_step(src,node_connect))
|
||||
if(target.initialize_directions & get_dir(target,src))
|
||||
for(var/obj/machinery/atmospherics/target in get_step(src,node_connect))
|
||||
if(target.initialize_directions & get_dir(target,src))
|
||||
var/c = check_connect_types(target,src)
|
||||
if (c)
|
||||
target.connected_to = c
|
||||
src.connected_to = c
|
||||
node = target
|
||||
break
|
||||
|
||||
update_icon()
|
||||
update_icon()
|
||||
update_underlays()
|
||||
|
||||
/obj/machinery/atmospherics/portables_connector/build_network()
|
||||
if(!network && node)
|
||||
network = new /datum/pipe_network()
|
||||
network.normal_members += src
|
||||
network.build_network(node, src)
|
||||
|
||||
|
||||
/obj/machinery/atmospherics/portables_connector/return_network(obj/machinery/atmospherics/reference)
|
||||
build_network()
|
||||
if(!network && node)
|
||||
network = new /datum/pipe_network()
|
||||
network.normal_members += src
|
||||
network.build_network(node, src)
|
||||
|
||||
if(reference==node)
|
||||
return network
|
||||
|
||||
if(reference==connected_device)
|
||||
return network
|
||||
|
||||
return null
|
||||
|
||||
/obj/machinery/atmospherics/portables_connector/reassign_network(datum/pipe_network/old_network, datum/pipe_network/new_network)
|
||||
if(network == old_network)
|
||||
network = new_network
|
||||
|
||||
return 1
|
||||
|
||||
/obj/machinery/atmospherics/portables_connector/return_network_air(datum/pipe_network/reference)
|
||||
var/list/results = list()
|
||||
|
||||
if(connected_device)
|
||||
results += connected_device.air_contents
|
||||
|
||||
return results
|
||||
|
||||
/obj/machinery/atmospherics/portables_connector/disconnect(obj/machinery/atmospherics/reference)
|
||||
if(reference==node)
|
||||
del(network)
|
||||
node = null
|
||||
|
||||
update_underlays()
|
||||
|
||||
return null
|
||||
|
||||
|
||||
return_network(obj/machinery/atmospherics/reference)
|
||||
build_network()
|
||||
|
||||
if(reference==node)
|
||||
return network
|
||||
|
||||
if(reference==connected_device)
|
||||
return network
|
||||
|
||||
return null
|
||||
|
||||
reassign_network(datum/pipe_network/old_network, datum/pipe_network/new_network)
|
||||
if(network == old_network)
|
||||
network = new_network
|
||||
|
||||
/obj/machinery/atmospherics/portables_connector/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
|
||||
if (!istype(W, /obj/item/weapon/wrench))
|
||||
return ..()
|
||||
if (connected_device)
|
||||
user << "\red You cannot unwrench this [src], dettach [connected_device] first."
|
||||
return 1
|
||||
|
||||
return_network_air(datum/pipe_network/reference)
|
||||
var/list/results = list()
|
||||
|
||||
if(connected_device)
|
||||
results += connected_device.air_contents
|
||||
|
||||
return results
|
||||
|
||||
disconnect(obj/machinery/atmospherics/reference)
|
||||
if(reference==node)
|
||||
del(network)
|
||||
node = null
|
||||
|
||||
return null
|
||||
|
||||
|
||||
attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
|
||||
if (!istype(W, /obj/item/weapon/wrench))
|
||||
return ..()
|
||||
if (connected_device)
|
||||
user << "\red You cannot unwrench this [src], dettach [connected_device] first."
|
||||
return 1
|
||||
if (locate(/obj/machinery/portable_atmospherics, src.loc))
|
||||
return 1
|
||||
var/turf/T = src.loc
|
||||
if (level==1 && isturf(T) && T.intact)
|
||||
user << "\red You must remove the plating first."
|
||||
return 1
|
||||
var/datum/gas_mixture/int_air = return_air()
|
||||
var/datum/gas_mixture/env_air = loc.return_air()
|
||||
if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE)
|
||||
user << "\red You cannot unwrench this [src], it too exerted due to internal pressure."
|
||||
add_fingerprint(user)
|
||||
return 1
|
||||
playsound(get_turf(src), 'sound/items/Ratchet.ogg', 50, 1)
|
||||
user << "\blue You begin to unfasten \the [src]..."
|
||||
if (do_after(user, 40))
|
||||
user.visible_message( \
|
||||
"[user] unfastens \the [src].", \
|
||||
"\blue You have unfastened \the [src].", \
|
||||
"You hear ratchet.")
|
||||
new /obj/item/pipe(loc, make_from=src)
|
||||
qdel(src)
|
||||
if (locate(/obj/machinery/portable_atmospherics, src.loc))
|
||||
return 1
|
||||
var/datum/gas_mixture/int_air = return_air()
|
||||
var/datum/gas_mixture/env_air = loc.return_air()
|
||||
if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE)
|
||||
user << "\red You cannot unwrench this [src], it too exerted due to internal pressure."
|
||||
add_fingerprint(user)
|
||||
return 1
|
||||
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
|
||||
user << "\blue You begin to unfasten \the [src]..."
|
||||
if (do_after(user, 40))
|
||||
user.visible_message( \
|
||||
"[user] unfastens \the [src].", \
|
||||
"\blue You have unfastened \the [src].", \
|
||||
"You hear ratchet.")
|
||||
new /obj/item/pipe(loc, make_from=src)
|
||||
del(src)
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
obj/machinery/atmospherics/trinary/filter
|
||||
icon = 'icons/obj/atmospherics/filter.dmi'
|
||||
icon_state = "intact_off"
|
||||
/obj/machinery/atmospherics/trinary/filter
|
||||
icon = 'icons/atmos/filter.dmi'
|
||||
icon_state = "map"
|
||||
density = 0
|
||||
level = 1
|
||||
|
||||
name = "Gas filter"
|
||||
|
||||
req_access = list(access_atmospherics)
|
||||
|
||||
var/on = 0
|
||||
var/temp = null // -- TLE
|
||||
|
||||
var/target_pressure = ONE_ATMOSPHERE
|
||||
@@ -16,7 +14,7 @@ obj/machinery/atmospherics/trinary/filter
|
||||
/*
|
||||
Filter types:
|
||||
-1: Nothing
|
||||
0: Carbon Molecules: Plasma Toxin, Oxygen Agent B
|
||||
0: Toxins: Toxins, Oxygen Agent B
|
||||
1: Oxygen: Oxygen ONLY
|
||||
2: Nitrogen: Nitrogen ONLY
|
||||
3: Carbon Dioxide: Carbon Dioxide ONLY
|
||||
@@ -26,141 +24,159 @@ Filter types:
|
||||
var/frequency = 0
|
||||
var/datum/radio_frequency/radio_connection
|
||||
|
||||
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_ATMOSIA)
|
||||
/obj/machinery/atmospherics/trinary/filter/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_ATMOSIA)
|
||||
|
||||
New()
|
||||
if(radio_controller)
|
||||
initialize()
|
||||
..()
|
||||
/* I don't know why this is here, but it's ugly, so I'm disabling it
|
||||
/obj/machinery/atmospherics/trinary/filter/New()
|
||||
..()
|
||||
if(radio_controller)
|
||||
initialize()
|
||||
*/
|
||||
/obj/machinery/atmospherics/trinary/filter/update_icon()
|
||||
if(istype(src, /obj/machinery/atmospherics/trinary/filter/m_filter))
|
||||
icon_state = "m"
|
||||
else
|
||||
icon_state = ""
|
||||
|
||||
if(!powered())
|
||||
icon_state += "off"
|
||||
else if(node2 && node3 && node1)
|
||||
icon_state += on ? "on" : "off"
|
||||
else
|
||||
icon_state += "off"
|
||||
on = 0
|
||||
|
||||
update_icon()
|
||||
if(stat & NOPOWER)
|
||||
icon_state = "intact_off"
|
||||
else if(node2 && node3 && node1)
|
||||
icon_state = "intact_[on?("on"):("off")]"
|
||||
/obj/machinery/atmospherics/trinary/filter/update_underlays()
|
||||
if(..())
|
||||
underlays.Cut()
|
||||
var/turf/T = get_turf(src)
|
||||
if(!istype(T))
|
||||
return
|
||||
|
||||
add_underlay(T, node1, turn(dir, -180))
|
||||
|
||||
if(istype(src, /obj/machinery/atmospherics/trinary/filter/m_filter))
|
||||
add_underlay(T, node2, turn(dir, 90))
|
||||
else
|
||||
icon_state = "intact_off"
|
||||
on = 0
|
||||
add_underlay(T, node2, turn(dir, -90))
|
||||
|
||||
return
|
||||
add_underlay(T, node3, dir)
|
||||
|
||||
power_change()
|
||||
var/old_stat = stat
|
||||
..()
|
||||
if(old_stat != stat)
|
||||
update_icon()
|
||||
/obj/machinery/atmospherics/trinary/filter/hide(var/i)
|
||||
update_underlays()
|
||||
|
||||
process()
|
||||
..()
|
||||
if(!on)
|
||||
return 0
|
||||
/obj/machinery/atmospherics/trinary/filter/power_change()
|
||||
var/old_stat = stat
|
||||
..()
|
||||
if(old_stat != stat)
|
||||
update_icon()
|
||||
|
||||
var/output_starting_pressure = air3.return_pressure()
|
||||
/obj/machinery/atmospherics/trinary/filter/process()
|
||||
..()
|
||||
if(!on)
|
||||
return 0
|
||||
|
||||
if(output_starting_pressure >= target_pressure || air2.return_pressure() >= target_pressure )
|
||||
//No need to mix if target is already full!
|
||||
return 1
|
||||
|
||||
//Calculate necessary moles to transfer using PV=nRT
|
||||
|
||||
var/pressure_delta = target_pressure - output_starting_pressure
|
||||
var/transfer_moles
|
||||
|
||||
if(air1.temperature > 0)
|
||||
transfer_moles = pressure_delta*air3.volume/(air1.temperature * R_IDEAL_GAS_EQUATION)
|
||||
|
||||
//Actually transfer the gas
|
||||
|
||||
if(transfer_moles > 0)
|
||||
var/datum/gas_mixture/removed = air1.remove(transfer_moles)
|
||||
|
||||
if(!removed)
|
||||
return
|
||||
var/datum/gas_mixture/filtered_out = new
|
||||
filtered_out.temperature = removed.temperature
|
||||
|
||||
switch(filter_type)
|
||||
if(0) //removing hydrocarbons
|
||||
filtered_out.toxins = removed.toxins
|
||||
removed.toxins = 0
|
||||
|
||||
if(removed.trace_gases.len>0)
|
||||
for(var/datum/gas/trace_gas in removed.trace_gases)
|
||||
if(istype(trace_gas, /datum/gas/oxygen_agent_b))
|
||||
removed.trace_gases -= trace_gas
|
||||
filtered_out.trace_gases += trace_gas
|
||||
|
||||
if(1) //removing O2
|
||||
filtered_out.oxygen = removed.oxygen
|
||||
removed.oxygen = 0
|
||||
|
||||
if(2) //removing N2
|
||||
filtered_out.nitrogen = removed.nitrogen
|
||||
removed.nitrogen = 0
|
||||
|
||||
if(3) //removing CO2
|
||||
filtered_out.carbon_dioxide = removed.carbon_dioxide
|
||||
removed.carbon_dioxide = 0
|
||||
|
||||
if(4)//removing N2O
|
||||
if(removed.trace_gases.len>0)
|
||||
for(var/datum/gas/trace_gas in removed.trace_gases)
|
||||
if(istype(trace_gas, /datum/gas/sleeping_agent))
|
||||
removed.trace_gases -= trace_gas
|
||||
filtered_out.trace_gases += trace_gas
|
||||
|
||||
else
|
||||
filtered_out = null
|
||||
|
||||
|
||||
air2.merge(filtered_out)
|
||||
air3.merge(removed)
|
||||
|
||||
if(network2)
|
||||
network2.update = 1
|
||||
|
||||
if(network3)
|
||||
network3.update = 1
|
||||
|
||||
if(network1)
|
||||
network1.update = 1
|
||||
var/output_starting_pressure = air3.return_pressure()
|
||||
|
||||
if(output_starting_pressure >= target_pressure || air2.return_pressure() >= target_pressure )
|
||||
//No need to mix if target is already full!
|
||||
return 1
|
||||
|
||||
initialize()
|
||||
set_frequency(frequency)
|
||||
..()
|
||||
//Calculate necessary moles to transfer using PV=nRT
|
||||
|
||||
attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
|
||||
if (!istype(W, /obj/item/weapon/wrench))
|
||||
return ..()
|
||||
var/turf/T = src.loc
|
||||
if (level==1 && isturf(T) && T.intact)
|
||||
user << "\red You must remove the plating first."
|
||||
return 1
|
||||
var/datum/gas_mixture/int_air = return_air()
|
||||
var/datum/gas_mixture/env_air = loc.return_air()
|
||||
if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE)
|
||||
user << "\red You cannot unwrench this [src], it too exerted due to internal pressure."
|
||||
add_fingerprint(user)
|
||||
return 1
|
||||
playsound(get_turf(src), 'sound/items/Ratchet.ogg', 50, 1)
|
||||
user << "\blue You begin to unfasten \the [src]..."
|
||||
if (do_after(user, 40))
|
||||
user.visible_message( \
|
||||
"[user] unfastens \the [src].", \
|
||||
"\blue You have unfastened \the [src].", \
|
||||
"You hear ratchet.")
|
||||
new /obj/item/pipe(loc, make_from=src)
|
||||
del(src)
|
||||
var/pressure_delta = target_pressure - output_starting_pressure
|
||||
var/transfer_moles
|
||||
|
||||
if(air1.temperature > 0)
|
||||
transfer_moles = pressure_delta*air3.volume/(air1.temperature * R_IDEAL_GAS_EQUATION)
|
||||
|
||||
//Actually transfer the gas
|
||||
|
||||
if(transfer_moles > 0)
|
||||
var/datum/gas_mixture/removed = air1.remove(transfer_moles)
|
||||
|
||||
if(!removed)
|
||||
return
|
||||
var/datum/gas_mixture/filtered_out = new
|
||||
filtered_out.temperature = removed.temperature
|
||||
|
||||
switch(filter_type)
|
||||
if(0) //removing hydrocarbons
|
||||
filtered_out.toxins = removed.toxins
|
||||
removed.toxins = 0
|
||||
|
||||
if(removed.trace_gases.len>0)
|
||||
for(var/datum/gas/trace_gas in removed.trace_gases)
|
||||
if(istype(trace_gas, /datum/gas/oxygen_agent_b))
|
||||
removed.trace_gases -= trace_gas
|
||||
filtered_out.trace_gases += trace_gas
|
||||
|
||||
if(1) //removing O2
|
||||
filtered_out.oxygen = removed.oxygen
|
||||
removed.oxygen = 0
|
||||
|
||||
if(2) //removing N2
|
||||
filtered_out.nitrogen = removed.nitrogen
|
||||
removed.nitrogen = 0
|
||||
|
||||
if(3) //removing CO2
|
||||
filtered_out.carbon_dioxide = removed.carbon_dioxide
|
||||
removed.carbon_dioxide = 0
|
||||
|
||||
if(4)//removing N2O
|
||||
if(removed.trace_gases.len>0)
|
||||
for(var/datum/gas/trace_gas in removed.trace_gases)
|
||||
if(istype(trace_gas, /datum/gas/sleeping_agent))
|
||||
removed.trace_gases -= trace_gas
|
||||
filtered_out.trace_gases += trace_gas
|
||||
|
||||
else
|
||||
filtered_out = null
|
||||
|
||||
|
||||
obj/machinery/atmospherics/trinary/filter/attack_hand(user as mob) // -- TLE
|
||||
air2.merge(filtered_out)
|
||||
air3.merge(removed)
|
||||
|
||||
if(network2)
|
||||
network2.update = 1
|
||||
|
||||
if(network3)
|
||||
network3.update = 1
|
||||
|
||||
if(network1)
|
||||
network1.update = 1
|
||||
|
||||
return 1
|
||||
|
||||
/obj/machinery/atmospherics/trinary/filter/initialize()
|
||||
set_frequency(frequency)
|
||||
..()
|
||||
|
||||
/obj/machinery/atmospherics/trinary/filter/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
|
||||
if (!istype(W, /obj/item/weapon/wrench))
|
||||
return ..()
|
||||
var/datum/gas_mixture/int_air = return_air()
|
||||
var/datum/gas_mixture/env_air = loc.return_air()
|
||||
if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE)
|
||||
user << "\red You cannot unwrench this [src], it too exerted due to internal pressure."
|
||||
add_fingerprint(user)
|
||||
return 1
|
||||
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
|
||||
user << "\blue You begin to unfasten \the [src]..."
|
||||
if (do_after(user, 40))
|
||||
user.visible_message( \
|
||||
"[user] unfastens \the [src].", \
|
||||
"\blue You have unfastened \the [src].", \
|
||||
"You hear ratchet.")
|
||||
new /obj/item/pipe(loc, make_from=src)
|
||||
del(src)
|
||||
|
||||
|
||||
/obj/machinery/atmospherics/trinary/filter/attack_hand(user as mob) // -- TLE
|
||||
if(..())
|
||||
return
|
||||
|
||||
@@ -172,7 +188,7 @@ obj/machinery/atmospherics/trinary/filter/attack_hand(user as mob) // -- TLE
|
||||
var/current_filter_type
|
||||
switch(filter_type)
|
||||
if(0)
|
||||
current_filter_type = "Carbon Molecules"
|
||||
current_filter_type = "Toxins"
|
||||
if(1)
|
||||
current_filter_type = "Oxygen"
|
||||
if(2)
|
||||
@@ -190,7 +206,7 @@ obj/machinery/atmospherics/trinary/filter/attack_hand(user as mob) // -- TLE
|
||||
<b>Power: </b><a href='?src=\ref[src];power=1'>[on?"On":"Off"]</a><br>
|
||||
<b>Filtering: </b>[current_filter_type]<br><HR>
|
||||
<h4>Set Filter Type:</h4>
|
||||
<A href='?src=\ref[src];filterset=0'>Carbon Molecules</A><BR>
|
||||
<A href='?src=\ref[src];filterset=0'>Toxins</A><BR>
|
||||
<A href='?src=\ref[src];filterset=1'>Oxygen</A><BR>
|
||||
<A href='?src=\ref[src];filterset=2'>Nitrogen</A><BR>
|
||||
<A href='?src=\ref[src];filterset=3'>Carbon Dioxide</A><BR>
|
||||
@@ -213,7 +229,7 @@ obj/machinery/atmospherics/trinary/filter/attack_hand(user as mob) // -- TLE
|
||||
onclose(user, "atmo_filter")
|
||||
return
|
||||
|
||||
obj/machinery/atmospherics/trinary/filter/Topic(href, href_list) // -- TLE
|
||||
/obj/machinery/atmospherics/trinary/filter/Topic(href, href_list) // -- TLE
|
||||
if(..())
|
||||
return
|
||||
usr.set_machine(src)
|
||||
@@ -236,4 +252,47 @@ obj/machinery/atmospherics/trinary/filter/Topic(href, href_list) // -- TLE
|
||||
*/
|
||||
return
|
||||
|
||||
/obj/machinery/atmospherics/trinary/filter/m_filter
|
||||
icon_state = "mmap"
|
||||
|
||||
dir = SOUTH
|
||||
initialize_directions = SOUTH|NORTH|EAST
|
||||
|
||||
obj/machinery/atmospherics/trinary/filter/m_filter/New()
|
||||
..()
|
||||
switch(dir)
|
||||
if(NORTH)
|
||||
initialize_directions = WEST|NORTH|SOUTH
|
||||
if(SOUTH)
|
||||
initialize_directions = SOUTH|EAST|NORTH
|
||||
if(EAST)
|
||||
initialize_directions = EAST|WEST|NORTH
|
||||
if(WEST)
|
||||
initialize_directions = WEST|SOUTH|EAST
|
||||
|
||||
/obj/machinery/atmospherics/trinary/filter/m_filter/initialize()
|
||||
set_frequency(frequency)
|
||||
|
||||
if(node1 && node2 && node3) return
|
||||
|
||||
var/node1_connect = turn(dir, -180)
|
||||
var/node2_connect = turn(dir, 90)
|
||||
var/node3_connect = dir
|
||||
|
||||
for(var/obj/machinery/atmospherics/target in get_step(src,node1_connect))
|
||||
if(target.initialize_directions & get_dir(target,src))
|
||||
node1 = target
|
||||
break
|
||||
|
||||
for(var/obj/machinery/atmospherics/target in get_step(src,node2_connect))
|
||||
if(target.initialize_directions & get_dir(target,src))
|
||||
node2 = target
|
||||
break
|
||||
|
||||
for(var/obj/machinery/atmospherics/target in get_step(src,node3_connect))
|
||||
if(target.initialize_directions & get_dir(target,src))
|
||||
node3 = target
|
||||
break
|
||||
|
||||
update_icon()
|
||||
update_underlays()
|
||||
@@ -1,164 +1,274 @@
|
||||
obj/machinery/atmospherics/trinary/mixer
|
||||
icon = 'icons/obj/atmospherics/mixer.dmi'
|
||||
icon_state = "intact_off"
|
||||
/obj/machinery/atmospherics/trinary/mixer
|
||||
icon = 'icons/atmos/mixer.dmi'
|
||||
icon_state = "map"
|
||||
density = 0
|
||||
level = 1
|
||||
|
||||
name = "Gas mixer"
|
||||
|
||||
req_access = list(access_atmospherics)
|
||||
|
||||
var/on = 0
|
||||
|
||||
var/target_pressure = ONE_ATMOSPHERE
|
||||
var/node1_concentration = 0.5
|
||||
var/node2_concentration = 0.5
|
||||
|
||||
//node 3 is the outlet, nodes 1 & 2 are intakes
|
||||
|
||||
update_icon()
|
||||
if(stat & NOPOWER)
|
||||
icon_state = "intact_off"
|
||||
else if(node2 && node3 && node1)
|
||||
icon_state = "intact_[on?("on"):("off")]"
|
||||
/obj/machinery/atmospherics/trinary/mixer/update_icon(var/safety = 0)
|
||||
if(istype(src, /obj/machinery/atmospherics/trinary/mixer/m_mixer))
|
||||
icon_state = "m"
|
||||
else if(istype(src, /obj/machinery/atmospherics/trinary/mixer/t_mixer))
|
||||
icon_state = "t"
|
||||
else
|
||||
icon_state = ""
|
||||
|
||||
if(!powered())
|
||||
icon_state += "off"
|
||||
else if(node2 && node3 && node1)
|
||||
icon_state += on ? "on" : "off"
|
||||
else
|
||||
icon_state += "off"
|
||||
on = 0
|
||||
|
||||
/obj/machinery/atmospherics/trinary/mixer/update_underlays()
|
||||
if(..())
|
||||
underlays.Cut()
|
||||
var/turf/T = get_turf(src)
|
||||
if(!istype(T))
|
||||
return
|
||||
|
||||
if(istype(src, /obj/machinery/atmospherics/trinary/mixer/t_mixer))
|
||||
add_underlay(T, node1, turn(dir, -90))
|
||||
else
|
||||
icon_state = "intact_off"
|
||||
on = 0
|
||||
add_underlay(T, node1, turn(dir, -180))
|
||||
|
||||
return
|
||||
if(istype(src, /obj/machinery/atmospherics/trinary/mixer/m_mixer) || istype(src, /obj/machinery/atmospherics/trinary/mixer/t_mixer))
|
||||
add_underlay(T, node2, turn(dir, 90))
|
||||
else
|
||||
add_underlay(T, node2, turn(dir, -90))
|
||||
|
||||
power_change()
|
||||
var/old_stat = stat
|
||||
..()
|
||||
if(old_stat != stat)
|
||||
update_icon()
|
||||
add_underlay(T, node3, dir)
|
||||
|
||||
New()
|
||||
..()
|
||||
air3.volume = 300
|
||||
/obj/machinery/atmospherics/trinary/mixer/hide(var/i)
|
||||
update_underlays()
|
||||
|
||||
process()
|
||||
..()
|
||||
if(!on)
|
||||
return 0
|
||||
/obj/machinery/atmospherics/trinary/mixer/power_change()
|
||||
var/old_stat = stat
|
||||
..()
|
||||
if(old_stat != stat)
|
||||
update_icon()
|
||||
|
||||
var/output_starting_pressure = air3.return_pressure()
|
||||
/obj/machinery/atmospherics/trinary/mixer/New()
|
||||
..()
|
||||
air3.volume = 300
|
||||
|
||||
if(output_starting_pressure >= target_pressure)
|
||||
//No need to mix if target is already full!
|
||||
return 1
|
||||
/obj/machinery/atmospherics/trinary/mixer/process()
|
||||
..()
|
||||
if(!on)
|
||||
return 0
|
||||
|
||||
//Calculate necessary moles to transfer using PV=nRT
|
||||
|
||||
var/pressure_delta = target_pressure - output_starting_pressure
|
||||
var/transfer_moles1 = 0
|
||||
var/transfer_moles2 = 0
|
||||
|
||||
if(air1.temperature > 0)
|
||||
transfer_moles1 = (node1_concentration*pressure_delta)*air3.volume/(air1.temperature * R_IDEAL_GAS_EQUATION)
|
||||
|
||||
if(air2.temperature > 0)
|
||||
transfer_moles2 = (node2_concentration*pressure_delta)*air3.volume/(air2.temperature * R_IDEAL_GAS_EQUATION)
|
||||
|
||||
var/air1_moles = air1.total_moles()
|
||||
var/air2_moles = air2.total_moles()
|
||||
|
||||
if((air1_moles < transfer_moles1) || (air2_moles < transfer_moles2))
|
||||
if(!transfer_moles1 || !transfer_moles2) return
|
||||
var/ratio = min(air1_moles/transfer_moles1, air2_moles/transfer_moles2)
|
||||
|
||||
transfer_moles1 *= ratio
|
||||
transfer_moles2 *= ratio
|
||||
|
||||
//Actually transfer the gas
|
||||
|
||||
if(transfer_moles1 > 0)
|
||||
var/datum/gas_mixture/removed1 = air1.remove(transfer_moles1)
|
||||
air3.merge(removed1)
|
||||
|
||||
if(transfer_moles2 > 0)
|
||||
var/datum/gas_mixture/removed2 = air2.remove(transfer_moles2)
|
||||
air3.merge(removed2)
|
||||
|
||||
if(network1 && transfer_moles1)
|
||||
network1.update = 1
|
||||
|
||||
if(network2 && transfer_moles2)
|
||||
network2.update = 1
|
||||
|
||||
if(network3)
|
||||
network3.update = 1
|
||||
var/output_starting_pressure = air3.return_pressure()
|
||||
|
||||
if(output_starting_pressure >= target_pressure)
|
||||
//No need to mix if target is already full!
|
||||
return 1
|
||||
|
||||
attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
|
||||
if (!istype(W, /obj/item/weapon/wrench))
|
||||
return ..()
|
||||
var/turf/T = src.loc
|
||||
if (level==1 && isturf(T) && T.intact)
|
||||
user << "\red You must remove the plating first."
|
||||
return 1
|
||||
var/datum/gas_mixture/int_air = return_air()
|
||||
var/datum/gas_mixture/env_air = loc.return_air()
|
||||
if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE)
|
||||
user << "\red You cannot unwrench this [src], it too exerted due to internal pressure."
|
||||
add_fingerprint(user)
|
||||
return 1
|
||||
playsound(get_turf(src), 'sound/items/Ratchet.ogg', 50, 1)
|
||||
user << "\blue You begin to unfasten \the [src]..."
|
||||
if (do_after(user, 40))
|
||||
user.visible_message( \
|
||||
"[user] unfastens \the [src].", \
|
||||
"\blue You have unfastened \the [src].", \
|
||||
"You hear ratchet.")
|
||||
new /obj/item/pipe(loc, make_from=src)
|
||||
del(src)
|
||||
//Calculate necessary moles to transfer using PV=nRT
|
||||
|
||||
attack_hand(user as mob)
|
||||
if(..())
|
||||
return
|
||||
src.add_fingerprint(usr)
|
||||
if(!src.allowed(user))
|
||||
user << "\red Access denied."
|
||||
return
|
||||
usr.set_machine(src)
|
||||
var/dat = {"<b>Power: </b><a href='?src=\ref[src];power=1'>[on?"On":"Off"]</a><br>
|
||||
<b>Desirable output pressure: </b>
|
||||
[target_pressure]kPa | <a href='?src=\ref[src];set_press=1'>Change</a>
|
||||
<br>
|
||||
<b>Node 1 Concentration:</b>
|
||||
<a href='?src=\ref[src];node1_c=-0.1'><b>-</b></a>
|
||||
<a href='?src=\ref[src];node1_c=-0.01'>-</a>
|
||||
[node1_concentration]([node1_concentration*100]%)
|
||||
<a href='?src=\ref[src];node1_c=0.01'><b>+</b></a>
|
||||
<a href='?src=\ref[src];node1_c=0.1'>+</a>
|
||||
<br>
|
||||
<b>Node 2 Concentration:</b>
|
||||
<a href='?src=\ref[src];node2_c=-0.1'><b>-</b></a>
|
||||
<a href='?src=\ref[src];node2_c=-0.01'>-</a>
|
||||
[node2_concentration]([node2_concentration*100]%)
|
||||
<a href='?src=\ref[src];node2_c=0.01'><b>+</b></a>
|
||||
<a href='?src=\ref[src];node2_c=0.1'>+</a>
|
||||
"}
|
||||
var/pressure_delta = target_pressure - output_starting_pressure
|
||||
var/transfer_moles1 = 0
|
||||
var/transfer_moles2 = 0
|
||||
|
||||
user << browse("<HEAD><TITLE>[src.name] control</TITLE></HEAD><TT>[dat]</TT>", "window=atmo_mixer")
|
||||
onclose(user, "atmo_mixer")
|
||||
if(air1.temperature > 0)
|
||||
transfer_moles1 = (node1_concentration*pressure_delta)*air3.volume/(air1.temperature * R_IDEAL_GAS_EQUATION)
|
||||
|
||||
if(air2.temperature > 0)
|
||||
transfer_moles2 = (node2_concentration*pressure_delta)*air3.volume/(air2.temperature * R_IDEAL_GAS_EQUATION)
|
||||
|
||||
var/air1_moles = air1.total_moles()
|
||||
var/air2_moles = air2.total_moles()
|
||||
|
||||
if((air1_moles < transfer_moles1) || (air2_moles < transfer_moles2))
|
||||
if(!transfer_moles1 || !transfer_moles2) return
|
||||
var/ratio = min(air1_moles/transfer_moles1, air2_moles/transfer_moles2)
|
||||
|
||||
transfer_moles1 *= ratio
|
||||
transfer_moles2 *= ratio
|
||||
|
||||
//Actually transfer the gas
|
||||
|
||||
if(transfer_moles1 > 0)
|
||||
var/datum/gas_mixture/removed1 = air1.remove(transfer_moles1)
|
||||
air3.merge(removed1)
|
||||
|
||||
if(transfer_moles2 > 0)
|
||||
var/datum/gas_mixture/removed2 = air2.remove(transfer_moles2)
|
||||
air3.merge(removed2)
|
||||
|
||||
if(network1 && transfer_moles1)
|
||||
network1.update = 1
|
||||
|
||||
if(network2 && transfer_moles2)
|
||||
network2.update = 1
|
||||
|
||||
if(network3)
|
||||
network3.update = 1
|
||||
|
||||
return 1
|
||||
|
||||
/obj/machinery/atmospherics/trinary/mixer/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
|
||||
if (!istype(W, /obj/item/weapon/wrench))
|
||||
return ..()
|
||||
var/datum/gas_mixture/int_air = return_air()
|
||||
var/datum/gas_mixture/env_air = loc.return_air()
|
||||
if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE)
|
||||
user << "\red You cannot unwrench this [src], it too exerted due to internal pressure."
|
||||
add_fingerprint(user)
|
||||
return 1
|
||||
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
|
||||
user << "\blue You begin to unfasten \the [src]..."
|
||||
if (do_after(user, 40))
|
||||
user.visible_message( \
|
||||
"[user] unfastens \the [src].", \
|
||||
"\blue You have unfastened \the [src].", \
|
||||
"You hear ratchet.")
|
||||
new /obj/item/pipe(loc, make_from=src)
|
||||
del(src)
|
||||
|
||||
/obj/machinery/atmospherics/trinary/mixer/attack_hand(user as mob)
|
||||
if(..())
|
||||
return
|
||||
|
||||
Topic(href,href_list)
|
||||
if(..()) return
|
||||
if(href_list["power"])
|
||||
on = !on
|
||||
if(href_list["set_press"])
|
||||
var/new_pressure = input(usr,"Enter new output pressure (0-4500kPa)","Pressure control",src.target_pressure) as num
|
||||
src.target_pressure = max(0, min(4500, new_pressure))
|
||||
if(href_list["node1_c"])
|
||||
var/value = text2num(href_list["node1_c"])
|
||||
src.node1_concentration = max(0, min(1, src.node1_concentration + value))
|
||||
src.node2_concentration = max(0, min(1, src.node2_concentration - value))
|
||||
if(href_list["node2_c"])
|
||||
var/value = text2num(href_list["node2_c"])
|
||||
src.node2_concentration = max(0, min(1, src.node2_concentration + value))
|
||||
src.node1_concentration = max(0, min(1, src.node1_concentration - value))
|
||||
src.update_icon()
|
||||
src.updateUsrDialog()
|
||||
src.add_fingerprint(usr)
|
||||
if(!src.allowed(user))
|
||||
user << "\red Access denied."
|
||||
return
|
||||
usr.set_machine(src)
|
||||
var/dat = {"<b>Power: </b><a href='?src=\ref[src];power=1'>[on?"On":"Off"]</a><br>
|
||||
<b>Desirable output pressure: </b>
|
||||
[target_pressure]kPa | <a href='?src=\ref[src];set_press=1'>Change</a>
|
||||
<br>
|
||||
<b>Node 1 Concentration:</b>
|
||||
<a href='?src=\ref[src];node1_c=-0.1'><b>-</b></a>
|
||||
<a href='?src=\ref[src];node1_c=-0.01'>-</a>
|
||||
[node1_concentration]([node1_concentration*100]%)
|
||||
<a href='?src=\ref[src];node1_c=0.01'><b>+</b></a>
|
||||
<a href='?src=\ref[src];node1_c=0.1'>+</a>
|
||||
<br>
|
||||
<b>Node 2 Concentration:</b>
|
||||
<a href='?src=\ref[src];node2_c=-0.1'><b>-</b></a>
|
||||
<a href='?src=\ref[src];node2_c=-0.01'>-</a>
|
||||
[node2_concentration]([node2_concentration*100]%)
|
||||
<a href='?src=\ref[src];node2_c=0.01'><b>+</b></a>
|
||||
<a href='?src=\ref[src];node2_c=0.1'>+</a>
|
||||
"}
|
||||
|
||||
user << browse("<HEAD><TITLE>[src.name] control</TITLE></HEAD><TT>[dat]</TT>", "window=atmo_mixer")
|
||||
onclose(user, "atmo_mixer")
|
||||
return
|
||||
|
||||
/obj/machinery/atmospherics/trinary/mixer/Topic(href,href_list)
|
||||
if(..()) return
|
||||
if(href_list["power"])
|
||||
on = !on
|
||||
if(href_list["set_press"])
|
||||
var/new_pressure = input(usr,"Enter new output pressure (0-4500kPa)","Pressure control",src.target_pressure) as num
|
||||
src.target_pressure = max(0, min(4500, new_pressure))
|
||||
if(href_list["node1_c"])
|
||||
var/value = text2num(href_list["node1_c"])
|
||||
src.node1_concentration = max(0, min(1, src.node1_concentration + value))
|
||||
src.node2_concentration = max(0, min(1, src.node2_concentration - value))
|
||||
if(href_list["node2_c"])
|
||||
var/value = text2num(href_list["node2_c"])
|
||||
src.node2_concentration = max(0, min(1, src.node2_concentration + value))
|
||||
src.node1_concentration = max(0, min(1, src.node1_concentration - value))
|
||||
src.update_icon()
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
obj/machinery/atmospherics/trinary/mixer/t_mixer
|
||||
icon_state = "tmap"
|
||||
|
||||
dir = SOUTH
|
||||
initialize_directions = SOUTH|EAST|WEST
|
||||
|
||||
//node 3 is the outlet, nodes 1 & 2 are intakes
|
||||
|
||||
obj/machinery/atmospherics/trinary/mixer/t_mixer/New()
|
||||
..()
|
||||
switch(dir)
|
||||
if(NORTH)
|
||||
initialize_directions = EAST|NORTH|WEST
|
||||
if(SOUTH)
|
||||
initialize_directions = SOUTH|WEST|EAST
|
||||
if(EAST)
|
||||
initialize_directions = EAST|NORTH|SOUTH
|
||||
if(WEST)
|
||||
initialize_directions = WEST|NORTH|SOUTH
|
||||
|
||||
obj/machinery/atmospherics/trinary/mixer/t_mixer/initialize()
|
||||
if(node1 && node2 && node3) return
|
||||
|
||||
var/node1_connect = turn(dir, -90)
|
||||
var/node2_connect = turn(dir, 90)
|
||||
var/node3_connect = dir
|
||||
|
||||
for(var/obj/machinery/atmospherics/target in get_step(src,node1_connect))
|
||||
if(target.initialize_directions & get_dir(target,src))
|
||||
node1 = target
|
||||
break
|
||||
|
||||
for(var/obj/machinery/atmospherics/target in get_step(src,node2_connect))
|
||||
if(target.initialize_directions & get_dir(target,src))
|
||||
node2 = target
|
||||
break
|
||||
|
||||
for(var/obj/machinery/atmospherics/target in get_step(src,node3_connect))
|
||||
if(target.initialize_directions & get_dir(target,src))
|
||||
node3 = target
|
||||
break
|
||||
|
||||
update_icon()
|
||||
update_underlays()
|
||||
|
||||
obj/machinery/atmospherics/trinary/mixer/m_mixer
|
||||
icon_state = "mmap"
|
||||
|
||||
dir = SOUTH
|
||||
initialize_directions = SOUTH|NORTH|EAST
|
||||
|
||||
//node 3 is the outlet, nodes 1 & 2 are intakes
|
||||
|
||||
obj/machinery/atmospherics/trinary/mixer/m_mixer/New()
|
||||
..()
|
||||
switch(dir)
|
||||
if(NORTH)
|
||||
initialize_directions = WEST|NORTH|SOUTH
|
||||
if(SOUTH)
|
||||
initialize_directions = SOUTH|EAST|NORTH
|
||||
if(EAST)
|
||||
initialize_directions = EAST|WEST|NORTH
|
||||
if(WEST)
|
||||
initialize_directions = WEST|SOUTH|EAST
|
||||
|
||||
obj/machinery/atmospherics/trinary/mixer/m_mixer/initialize()
|
||||
if(node1 && node2 && node3) return
|
||||
|
||||
var/node1_connect = turn(dir, -180)
|
||||
var/node2_connect = turn(dir, 90)
|
||||
var/node3_connect = dir
|
||||
|
||||
for(var/obj/machinery/atmospherics/target in get_step(src,node1_connect))
|
||||
if(target.initialize_directions & get_dir(target,src))
|
||||
node1 = target
|
||||
break
|
||||
|
||||
for(var/obj/machinery/atmospherics/target in get_step(src,node2_connect))
|
||||
if(target.initialize_directions & get_dir(target,src))
|
||||
node2 = target
|
||||
break
|
||||
|
||||
for(var/obj/machinery/atmospherics/target in get_step(src,node3_connect))
|
||||
if(target.initialize_directions & get_dir(target,src))
|
||||
node3 = target
|
||||
break
|
||||
|
||||
update_icon()
|
||||
update_underlays()
|
||||
@@ -2,6 +2,8 @@ obj/machinery/atmospherics/trinary
|
||||
dir = SOUTH
|
||||
initialize_directions = SOUTH|NORTH|WEST
|
||||
use_power = 1
|
||||
|
||||
var/on = 0
|
||||
|
||||
var/datum/gas_mixture/air1
|
||||
var/datum/gas_mixture/air2
|
||||
@@ -52,7 +54,7 @@ obj/machinery/atmospherics/trinary
|
||||
|
||||
return null
|
||||
|
||||
Destroy()
|
||||
Del()
|
||||
loc = null
|
||||
|
||||
if(node1)
|
||||
@@ -94,6 +96,7 @@ obj/machinery/atmospherics/trinary
|
||||
break
|
||||
|
||||
update_icon()
|
||||
update_underlays()
|
||||
|
||||
build_network()
|
||||
if(!network1 && node1)
|
||||
@@ -160,5 +163,7 @@ obj/machinery/atmospherics/trinary
|
||||
else if(reference==node3)
|
||||
del(network3)
|
||||
node3 = null
|
||||
|
||||
update_underlays()
|
||||
|
||||
return null
|
||||
@@ -1,10 +1,11 @@
|
||||
obj/machinery/atmospherics/tvalve
|
||||
icon = 'icons/obj/atmospherics/valve.dmi'
|
||||
icon_state = "tvalve0"
|
||||
/obj/machinery/atmospherics/tvalve
|
||||
icon = 'icons/atmos/tvalve.dmi'
|
||||
icon_state = "map_tvalve0"
|
||||
|
||||
name = "manual switching valve"
|
||||
desc = "A pipe valve"
|
||||
|
||||
level = 1
|
||||
dir = SOUTH
|
||||
initialize_directions = SOUTH|NORTH|WEST
|
||||
|
||||
@@ -19,417 +20,478 @@ obj/machinery/atmospherics/tvalve
|
||||
var/datum/pipe_network/network_node2
|
||||
var/datum/pipe_network/network_node3
|
||||
|
||||
update_icon(animation)
|
||||
if(animation)
|
||||
flick("tvalve[src.state][!src.state]",src)
|
||||
/obj/machinery/atmospherics/tvalve/bypass
|
||||
icon_state = "map_tvalve1"
|
||||
state = 1
|
||||
|
||||
/obj/machinery/atmospherics/tvalve/update_icon(animation)
|
||||
if(animation)
|
||||
flick("tvalve[src.state][!src.state]",src)
|
||||
else
|
||||
icon_state = "tvalve[state]"
|
||||
|
||||
/obj/machinery/atmospherics/tvalve/update_underlays()
|
||||
if(..())
|
||||
underlays.Cut()
|
||||
var/turf/T = get_turf(src)
|
||||
if(!istype(T))
|
||||
return
|
||||
add_underlay(T, node1, turn(dir, -180))
|
||||
|
||||
if(istype(src, /obj/machinery/atmospherics/tvalve/mirrored))
|
||||
add_underlay(T, node2, turn(dir, 90))
|
||||
else
|
||||
icon_state = "tvalve[state]"
|
||||
add_underlay(T, node2, turn(dir, -90))
|
||||
|
||||
add_underlay(T, node3, dir)
|
||||
|
||||
New()
|
||||
initialize_directions()
|
||||
..()
|
||||
|
||||
proc/initialize_directions()
|
||||
switch(dir)
|
||||
if(NORTH)
|
||||
initialize_directions = SOUTH|NORTH|EAST
|
||||
if(SOUTH)
|
||||
initialize_directions = NORTH|SOUTH|WEST
|
||||
if(EAST)
|
||||
initialize_directions = WEST|EAST|SOUTH
|
||||
if(WEST)
|
||||
initialize_directions = EAST|WEST|NORTH
|
||||
|
||||
network_expand(datum/pipe_network/new_network, obj/machinery/atmospherics/pipe/reference)
|
||||
if(reference == node1)
|
||||
network_node1 = new_network
|
||||
if(state)
|
||||
network_node2 = new_network
|
||||
else
|
||||
network_node3 = new_network
|
||||
else if(reference == node2)
|
||||
network_node2 = new_network
|
||||
if(state)
|
||||
network_node1 = new_network
|
||||
else if(reference == node3)
|
||||
network_node3 = new_network
|
||||
if(!state)
|
||||
network_node1 = new_network
|
||||
|
||||
if(new_network.normal_members.Find(src))
|
||||
return 0
|
||||
|
||||
new_network.normal_members += src
|
||||
|
||||
if(state)
|
||||
if(reference == node1)
|
||||
if(node2)
|
||||
return node2.network_expand(new_network, src)
|
||||
else if(reference == node2)
|
||||
if(node1)
|
||||
return node1.network_expand(new_network, src)
|
||||
else
|
||||
if(reference == node1)
|
||||
if(node3)
|
||||
return node3.network_expand(new_network, src)
|
||||
else if(reference == node3)
|
||||
if(node1)
|
||||
return node1.network_expand(new_network, src)
|
||||
|
||||
return null
|
||||
|
||||
Destroy()
|
||||
loc = null
|
||||
|
||||
if(node1)
|
||||
node1.disconnect(src)
|
||||
del(network_node1)
|
||||
if(node2)
|
||||
node2.disconnect(src)
|
||||
del(network_node2)
|
||||
if(node3)
|
||||
node3.disconnect(src)
|
||||
del(network_node3)
|
||||
|
||||
node1 = null
|
||||
node2 = null
|
||||
node3 = null
|
||||
|
||||
..()
|
||||
|
||||
proc/go_to_side()
|
||||
|
||||
if(state) return 0
|
||||
|
||||
state = 1
|
||||
update_icon()
|
||||
|
||||
if(network_node1)
|
||||
del(network_node1)
|
||||
if(network_node3)
|
||||
del(network_node3)
|
||||
build_network()
|
||||
|
||||
if(network_node1&&network_node2)
|
||||
network_node1.merge(network_node2)
|
||||
network_node2 = network_node1
|
||||
|
||||
if(network_node1)
|
||||
network_node1.update = 1
|
||||
else if(network_node2)
|
||||
network_node2.update = 1
|
||||
|
||||
return 1
|
||||
|
||||
proc/go_straight()
|
||||
|
||||
if(!state)
|
||||
return 0
|
||||
|
||||
state = 0
|
||||
update_icon()
|
||||
|
||||
if(network_node1)
|
||||
del(network_node1)
|
||||
if(network_node2)
|
||||
del(network_node2)
|
||||
build_network()
|
||||
|
||||
if(network_node1&&network_node3)
|
||||
network_node1.merge(network_node3)
|
||||
network_node3 = network_node1
|
||||
|
||||
if(network_node1)
|
||||
network_node1.update = 1
|
||||
else if(network_node3)
|
||||
network_node3.update = 1
|
||||
|
||||
return 1
|
||||
|
||||
attack_ai(mob/user as mob)
|
||||
return
|
||||
|
||||
attack_paw(mob/user as mob)
|
||||
return attack_hand(user)
|
||||
|
||||
attack_hand(mob/user as mob)
|
||||
src.add_fingerprint(usr)
|
||||
update_icon(1)
|
||||
sleep(10)
|
||||
if (src.state)
|
||||
src.go_straight()
|
||||
else
|
||||
src.go_to_side()
|
||||
|
||||
process()
|
||||
..()
|
||||
machines.Remove(src)
|
||||
|
||||
/* if(open && (!node1 || !node2))
|
||||
close()
|
||||
if(!node1)
|
||||
if(!nodealert)
|
||||
//world << "Missing node from [src] at [src.x],[src.y],[src.z]"
|
||||
nodealert = 1
|
||||
else if (!node2)
|
||||
if(!nodealert)
|
||||
//world << "Missing node from [src] at [src.x],[src.y],[src.z]"
|
||||
nodealert = 1
|
||||
else if (nodealert)
|
||||
nodealert = 0
|
||||
*/
|
||||
|
||||
return
|
||||
|
||||
initialize()
|
||||
var/node1_dir
|
||||
var/node2_dir
|
||||
var/node3_dir
|
||||
|
||||
node1_dir = turn(dir, 180)
|
||||
node2_dir = turn(dir, -90)
|
||||
node3_dir = dir
|
||||
|
||||
for(var/obj/machinery/atmospherics/target in get_step(src,node1_dir))
|
||||
if(target.initialize_directions & get_dir(target,src))
|
||||
node1 = target
|
||||
break
|
||||
for(var/obj/machinery/atmospherics/target in get_step(src,node2_dir))
|
||||
if(target.initialize_directions & get_dir(target,src))
|
||||
node2 = target
|
||||
break
|
||||
for(var/obj/machinery/atmospherics/target in get_step(src,node3_dir))
|
||||
if(target.initialize_directions & get_dir(target,src))
|
||||
node3 = target
|
||||
break
|
||||
|
||||
build_network()
|
||||
if(!network_node1 && node1)
|
||||
network_node1 = new /datum/pipe_network()
|
||||
network_node1.normal_members += src
|
||||
network_node1.build_network(node1, src)
|
||||
|
||||
if(!network_node2 && node2)
|
||||
network_node2 = new /datum/pipe_network()
|
||||
network_node2.normal_members += src
|
||||
network_node2.build_network(node2, src)
|
||||
|
||||
if(!network_node3 && node3)
|
||||
network_node3 = new /datum/pipe_network()
|
||||
network_node3.normal_members += src
|
||||
network_node3.build_network(node3, src)
|
||||
|
||||
|
||||
return_network(obj/machinery/atmospherics/reference)
|
||||
build_network()
|
||||
|
||||
if(reference==node1)
|
||||
return network_node1
|
||||
|
||||
if(reference==node2)
|
||||
return network_node2
|
||||
|
||||
if(reference==node3)
|
||||
return network_node3
|
||||
|
||||
return null
|
||||
|
||||
reassign_network(datum/pipe_network/old_network, datum/pipe_network/new_network)
|
||||
if(network_node1 == old_network)
|
||||
network_node1 = new_network
|
||||
if(network_node2 == old_network)
|
||||
network_node2 = new_network
|
||||
if(network_node3 == old_network)
|
||||
network_node3 = new_network
|
||||
|
||||
return 1
|
||||
|
||||
return_network_air(datum/network/reference)
|
||||
return null
|
||||
|
||||
disconnect(obj/machinery/atmospherics/reference)
|
||||
if(reference==node1)
|
||||
del(network_node1)
|
||||
node1 = null
|
||||
|
||||
else if(reference==node2)
|
||||
del(network_node2)
|
||||
node2 = null
|
||||
|
||||
else if(reference==node3)
|
||||
del(network_node3)
|
||||
node2 = null
|
||||
|
||||
return null
|
||||
|
||||
digital // can be controlled by AI
|
||||
name = "digital switching valve"
|
||||
desc = "A digitally controlled valve."
|
||||
icon = 'icons/obj/atmospherics/digital_valve.dmi'
|
||||
|
||||
attack_ai(mob/user as mob)
|
||||
src.add_hiddenprint(user)
|
||||
return src.attack_hand(user)
|
||||
|
||||
attack_hand(mob/user as mob)
|
||||
if(!src.allowed(user))
|
||||
user << "\red Access denied."
|
||||
return
|
||||
..()
|
||||
|
||||
//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_ATMOSIA)
|
||||
|
||||
var/frequency = 0
|
||||
var/id = null
|
||||
var/datum/radio_frequency/radio_connection
|
||||
|
||||
initialize()
|
||||
..()
|
||||
if(frequency)
|
||||
set_frequency(frequency)
|
||||
|
||||
receive_signal(datum/signal/signal)
|
||||
if(!signal.data["tag"] || (signal.data["tag"] != id))
|
||||
return 0
|
||||
|
||||
switch(signal.data["command"])
|
||||
if("valve_open")
|
||||
if(!state)
|
||||
go_to_side()
|
||||
|
||||
if("valve_close")
|
||||
if(state)
|
||||
go_straight()
|
||||
|
||||
if("valve_toggle")
|
||||
if(state)
|
||||
go_straight()
|
||||
else
|
||||
go_to_side()
|
||||
|
||||
attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
|
||||
if (!istype(W, /obj/item/weapon/wrench))
|
||||
return ..()
|
||||
if (istype(src, /obj/machinery/atmospherics/tvalve/digital))
|
||||
user << "\red You cannot unwrench this [src], it's too complicated."
|
||||
return 1
|
||||
var/turf/T = src.loc
|
||||
if (level==1 && isturf(T) && T.intact)
|
||||
user << "\red You must remove the plating first."
|
||||
return 1
|
||||
var/datum/gas_mixture/int_air = return_air()
|
||||
var/datum/gas_mixture/env_air = loc.return_air()
|
||||
if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE)
|
||||
user << "\red You cannot unwrench this [src], it too exerted due to internal pressure."
|
||||
add_fingerprint(user)
|
||||
return 1
|
||||
playsound(get_turf(src), 'sound/items/Ratchet.ogg', 50, 1)
|
||||
user << "\blue You begin to unfasten \the [src]..."
|
||||
if (do_after(user, 40))
|
||||
user.visible_message( \
|
||||
"[user] unfastens \the [src].", \
|
||||
"\blue You have unfastened \the [src].", \
|
||||
"You hear ratchet.")
|
||||
new /obj/item/pipe(loc, make_from=src)
|
||||
del(src)
|
||||
|
||||
obj/machinery/atmospherics/tvalve/mirrored
|
||||
icon_state = "tvalvem0"
|
||||
/obj/machinery/atmospherics/tvalve/hide(var/i)
|
||||
update_underlays()
|
||||
|
||||
/obj/machinery/atmospherics/tvalve/New()
|
||||
initialize_directions()
|
||||
switch(dir)
|
||||
if(NORTH)
|
||||
initialize_directions = SOUTH|NORTH|WEST
|
||||
if(SOUTH)
|
||||
initialize_directions = NORTH|SOUTH|EAST
|
||||
if(EAST)
|
||||
initialize_directions = WEST|EAST|NORTH
|
||||
if(WEST)
|
||||
initialize_directions = EAST|WEST|SOUTH
|
||||
..()
|
||||
|
||||
initialize()
|
||||
var/node1_dir
|
||||
var/node2_dir
|
||||
var/node3_dir
|
||||
/obj/machinery/atmospherics/tvalve/proc/initialize_directions()
|
||||
switch(dir)
|
||||
if(NORTH)
|
||||
initialize_directions = SOUTH|NORTH|EAST
|
||||
if(SOUTH)
|
||||
initialize_directions = NORTH|SOUTH|WEST
|
||||
if(EAST)
|
||||
initialize_directions = WEST|EAST|SOUTH
|
||||
if(WEST)
|
||||
initialize_directions = EAST|WEST|NORTH
|
||||
|
||||
node1_dir = turn(dir, 180)
|
||||
node2_dir = turn(dir, 90)
|
||||
node3_dir = dir
|
||||
/obj/machinery/atmospherics/tvalve/network_expand(datum/pipe_network/new_network, obj/machinery/atmospherics/pipe/reference)
|
||||
if(reference == node1)
|
||||
network_node1 = new_network
|
||||
if(state)
|
||||
network_node2 = new_network
|
||||
else
|
||||
network_node3 = new_network
|
||||
else if(reference == node2)
|
||||
network_node2 = new_network
|
||||
if(state)
|
||||
network_node1 = new_network
|
||||
else if(reference == node3)
|
||||
network_node3 = new_network
|
||||
if(!state)
|
||||
network_node1 = new_network
|
||||
|
||||
for(var/obj/machinery/atmospherics/target in get_step(src,node1_dir))
|
||||
if(target.initialize_directions & get_dir(target,src))
|
||||
if(new_network.normal_members.Find(src))
|
||||
return 0
|
||||
|
||||
new_network.normal_members += src
|
||||
|
||||
if(state)
|
||||
if(reference == node1)
|
||||
if(node2)
|
||||
return node2.network_expand(new_network, src)
|
||||
else if(reference == node2)
|
||||
if(node1)
|
||||
return node1.network_expand(new_network, src)
|
||||
else
|
||||
if(reference == node1)
|
||||
if(node3)
|
||||
return node3.network_expand(new_network, src)
|
||||
else if(reference == node3)
|
||||
if(node1)
|
||||
return node1.network_expand(new_network, src)
|
||||
|
||||
return null
|
||||
|
||||
/obj/machinery/atmospherics/tvalve/Del()
|
||||
loc = null
|
||||
|
||||
if(node1)
|
||||
node1.disconnect(src)
|
||||
del(network_node1)
|
||||
if(node2)
|
||||
node2.disconnect(src)
|
||||
del(network_node2)
|
||||
if(node3)
|
||||
node3.disconnect(src)
|
||||
del(network_node3)
|
||||
|
||||
node1 = null
|
||||
node2 = null
|
||||
node3 = null
|
||||
|
||||
..()
|
||||
|
||||
/obj/machinery/atmospherics/tvalve/proc/go_to_side()
|
||||
|
||||
if(state) return 0
|
||||
|
||||
state = 1
|
||||
update_icon()
|
||||
|
||||
if(network_node1)
|
||||
del(network_node1)
|
||||
if(network_node3)
|
||||
del(network_node3)
|
||||
build_network()
|
||||
|
||||
if(network_node1&&network_node2)
|
||||
network_node1.merge(network_node2)
|
||||
network_node2 = network_node1
|
||||
|
||||
if(network_node1)
|
||||
network_node1.update = 1
|
||||
else if(network_node2)
|
||||
network_node2.update = 1
|
||||
|
||||
return 1
|
||||
|
||||
/obj/machinery/atmospherics/tvalve/proc/go_straight()
|
||||
|
||||
if(!state)
|
||||
return 0
|
||||
|
||||
state = 0
|
||||
update_icon()
|
||||
|
||||
if(network_node1)
|
||||
del(network_node1)
|
||||
if(network_node2)
|
||||
del(network_node2)
|
||||
build_network()
|
||||
|
||||
if(network_node1&&network_node3)
|
||||
network_node1.merge(network_node3)
|
||||
network_node3 = network_node1
|
||||
|
||||
if(network_node1)
|
||||
network_node1.update = 1
|
||||
else if(network_node3)
|
||||
network_node3.update = 1
|
||||
|
||||
return 1
|
||||
|
||||
/obj/machinery/atmospherics/tvalve/attack_ai(mob/user as mob)
|
||||
return
|
||||
|
||||
/obj/machinery/atmospherics/tvalve/attack_paw(mob/user as mob)
|
||||
return attack_hand(user)
|
||||
|
||||
/obj/machinery/atmospherics/tvalve/attack_hand(mob/user as mob)
|
||||
src.add_fingerprint(usr)
|
||||
update_icon(1)
|
||||
sleep(10)
|
||||
if (src.state)
|
||||
src.go_straight()
|
||||
else
|
||||
src.go_to_side()
|
||||
|
||||
/obj/machinery/atmospherics/tvalve/process()
|
||||
..()
|
||||
. = PROCESS_KILL
|
||||
//machines.Remove(src)
|
||||
|
||||
return
|
||||
|
||||
/obj/machinery/atmospherics/tvalve/initialize()
|
||||
var/node1_dir
|
||||
var/node2_dir
|
||||
var/node3_dir
|
||||
|
||||
node1_dir = turn(dir, 180)
|
||||
node2_dir = turn(dir, -90)
|
||||
node3_dir = dir
|
||||
|
||||
for(var/obj/machinery/atmospherics/target in get_step(src,node1_dir))
|
||||
if(target.initialize_directions & get_dir(target,src))
|
||||
var/c = check_connect_types(target,src)
|
||||
if (c)
|
||||
target.connected_to = c
|
||||
src.connected_to = c
|
||||
node1 = target
|
||||
break
|
||||
for(var/obj/machinery/atmospherics/target in get_step(src,node2_dir))
|
||||
if(target.initialize_directions & get_dir(target,src))
|
||||
for(var/obj/machinery/atmospherics/target in get_step(src,node2_dir))
|
||||
if(target.initialize_directions & get_dir(target,src))
|
||||
var/c = check_connect_types(target,src)
|
||||
if (c)
|
||||
target.connected_to = c
|
||||
src.connected_to = c
|
||||
node2 = target
|
||||
break
|
||||
for(var/obj/machinery/atmospherics/target in get_step(src,node3_dir))
|
||||
if(target.initialize_directions & get_dir(target,src))
|
||||
for(var/obj/machinery/atmospherics/target in get_step(src,node3_dir))
|
||||
if(target.initialize_directions & get_dir(target,src))
|
||||
var/c = check_connect_types(target,src)
|
||||
if (c)
|
||||
target.connected_to = c
|
||||
src.connected_to = c
|
||||
node3 = target
|
||||
break
|
||||
|
||||
update_icon()
|
||||
update_underlays()
|
||||
|
||||
update_icon(animation)
|
||||
if(animation)
|
||||
flick("tvalvem[src.state][!src.state]",src)
|
||||
else
|
||||
icon_state = "tvalvem[state]"
|
||||
/obj/machinery/atmospherics/tvalve/build_network()
|
||||
if(!network_node1 && node1)
|
||||
network_node1 = new /datum/pipe_network()
|
||||
network_node1.normal_members += src
|
||||
network_node1.build_network(node1, src)
|
||||
|
||||
digital // can be controlled by AI
|
||||
name = "digital switching valve"
|
||||
desc = "A digitally controlled valve."
|
||||
icon = 'icons/obj/atmospherics/digital_valve.dmi'
|
||||
if(!network_node2 && node2)
|
||||
network_node2 = new /datum/pipe_network()
|
||||
network_node2.normal_members += src
|
||||
network_node2.build_network(node2, src)
|
||||
|
||||
attack_ai(mob/user as mob)
|
||||
src.add_hiddenprint(user)
|
||||
return src.attack_hand(user)
|
||||
if(!network_node3 && node3)
|
||||
network_node3 = new /datum/pipe_network()
|
||||
network_node3.normal_members += src
|
||||
network_node3.build_network(node3, src)
|
||||
|
||||
attack_hand(mob/user as mob)
|
||||
if(!src.allowed(user))
|
||||
user << "\red Access denied."
|
||||
return
|
||||
..()
|
||||
|
||||
//Radio remote control -eh?
|
||||
/obj/machinery/atmospherics/tvalve/return_network(obj/machinery/atmospherics/reference)
|
||||
build_network()
|
||||
|
||||
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_ATMOSIA)
|
||||
if(reference==node1)
|
||||
return network_node1
|
||||
|
||||
var/frequency = 0
|
||||
var/id = null
|
||||
var/datum/radio_frequency/radio_connection
|
||||
if(reference==node2)
|
||||
return network_node2
|
||||
|
||||
initialize()
|
||||
..()
|
||||
if(frequency)
|
||||
set_frequency(frequency)
|
||||
if(reference==node3)
|
||||
return network_node3
|
||||
|
||||
receive_signal(datum/signal/signal)
|
||||
if(!signal.data["tag"] || (signal.data["tag"] != id))
|
||||
return 0
|
||||
return null
|
||||
|
||||
switch(signal.data["command"])
|
||||
if("valve_open")
|
||||
if(!state)
|
||||
go_to_side()
|
||||
/obj/machinery/atmospherics/tvalve/reassign_network(datum/pipe_network/old_network, datum/pipe_network/new_network)
|
||||
if(network_node1 == old_network)
|
||||
network_node1 = new_network
|
||||
if(network_node2 == old_network)
|
||||
network_node2 = new_network
|
||||
if(network_node3 == old_network)
|
||||
network_node3 = new_network
|
||||
|
||||
if("valve_close")
|
||||
if(state)
|
||||
go_straight()
|
||||
return 1
|
||||
|
||||
if("valve_toggle")
|
||||
if(state)
|
||||
go_straight()
|
||||
else
|
||||
go_to_side()
|
||||
/obj/machinery/atmospherics/tvalve/return_network_air(datum/network/reference)
|
||||
return null
|
||||
|
||||
/obj/machinery/atmospherics/tvalve/disconnect(obj/machinery/atmospherics/reference)
|
||||
if(reference==node1)
|
||||
del(network_node1)
|
||||
node1 = null
|
||||
|
||||
else if(reference==node2)
|
||||
del(network_node2)
|
||||
node2 = null
|
||||
|
||||
else if(reference==node3)
|
||||
del(network_node3)
|
||||
node2 = null
|
||||
|
||||
update_underlays()
|
||||
|
||||
return null
|
||||
|
||||
/obj/machinery/atmospherics/tvalve/digital // can be controlled by AI
|
||||
name = "digital switching valve"
|
||||
desc = "A digitally controlled valve."
|
||||
icon = 'icons/atmos/digital_tvalve.dmi'
|
||||
|
||||
var/frequency = 0
|
||||
var/id = null
|
||||
var/datum/radio_frequency/radio_connection
|
||||
|
||||
/obj/machinery/atmospherics/tvalve/digital/bypass
|
||||
icon_state = "map_tvalve1"
|
||||
state = 1
|
||||
|
||||
/obj/machinery/atmospherics/tvalve/digital/power_change()
|
||||
var/old_stat = stat
|
||||
..()
|
||||
if(old_stat != stat)
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/atmospherics/tvalve/digital/update_icon()
|
||||
..()
|
||||
if(!powered())
|
||||
icon_state = "tvalvenopower"
|
||||
|
||||
/obj/machinery/atmospherics/tvalve/digital/attack_ai(mob/user as mob)
|
||||
return src.attack_hand(user)
|
||||
|
||||
/obj/machinery/atmospherics/tvalve/digital/attack_hand(mob/user as mob)
|
||||
if(!powered())
|
||||
return
|
||||
if(!src.allowed(user))
|
||||
user << "\red Access denied."
|
||||
return
|
||||
..()
|
||||
|
||||
//Radio remote control
|
||||
|
||||
/obj/machinery/atmospherics/tvalve/digital/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_ATMOSIA)
|
||||
|
||||
|
||||
|
||||
/obj/machinery/atmospherics/tvalve/digital/initialize()
|
||||
..()
|
||||
if(frequency)
|
||||
set_frequency(frequency)
|
||||
|
||||
/obj/machinery/atmospherics/tvalve/digital/receive_signal(datum/signal/signal)
|
||||
if(!signal.data["tag"] || (signal.data["tag"] != id))
|
||||
return 0
|
||||
|
||||
switch(signal.data["command"])
|
||||
if("valve_open")
|
||||
if(!state)
|
||||
go_to_side()
|
||||
|
||||
if("valve_close")
|
||||
if(state)
|
||||
go_straight()
|
||||
|
||||
if("valve_toggle")
|
||||
if(state)
|
||||
go_straight()
|
||||
else
|
||||
go_to_side()
|
||||
|
||||
/obj/machinery/atmospherics/tvalve/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
|
||||
if (!istype(W, /obj/item/weapon/wrench))
|
||||
return ..()
|
||||
if (istype(src, /obj/machinery/atmospherics/tvalve/digital))
|
||||
user << "\red You cannot unwrench this [src], it's too complicated."
|
||||
return 1
|
||||
var/datum/gas_mixture/int_air = return_air()
|
||||
var/datum/gas_mixture/env_air = loc.return_air()
|
||||
if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE)
|
||||
user << "\red You cannot unwrench this [src], it too exerted due to internal pressure."
|
||||
add_fingerprint(user)
|
||||
return 1
|
||||
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
|
||||
user << "\blue You begin to unfasten \the [src]..."
|
||||
if (do_after(user, 40))
|
||||
user.visible_message( \
|
||||
"[user] unfastens \the [src].", \
|
||||
"\blue You have unfastened \the [src].", \
|
||||
"You hear ratchet.")
|
||||
new /obj/item/pipe(loc, make_from=src)
|
||||
del(src)
|
||||
|
||||
/obj/machinery/atmospherics/tvalve/mirrored
|
||||
icon_state = "map_tvalvem0"
|
||||
|
||||
/obj/machinery/atmospherics/tvalve/mirrored/bypass
|
||||
icon_state = "map_tvalvem1"
|
||||
state = 1
|
||||
|
||||
/obj/machinery/atmospherics/tvalve/mirrored/initialize_directions()
|
||||
switch(dir)
|
||||
if(NORTH)
|
||||
initialize_directions = SOUTH|NORTH|WEST
|
||||
if(SOUTH)
|
||||
initialize_directions = NORTH|SOUTH|EAST
|
||||
if(EAST)
|
||||
initialize_directions = WEST|EAST|NORTH
|
||||
if(WEST)
|
||||
initialize_directions = EAST|WEST|SOUTH
|
||||
|
||||
/obj/machinery/atmospherics/tvalve/mirrored/initialize()
|
||||
var/node1_dir
|
||||
var/node2_dir
|
||||
var/node3_dir
|
||||
|
||||
node1_dir = turn(dir, 180)
|
||||
node2_dir = turn(dir, 90)
|
||||
node3_dir = dir
|
||||
|
||||
for(var/obj/machinery/atmospherics/target in get_step(src,node1_dir))
|
||||
if(target.initialize_directions & get_dir(target,src))
|
||||
node1 = target
|
||||
break
|
||||
for(var/obj/machinery/atmospherics/target in get_step(src,node2_dir))
|
||||
if(target.initialize_directions & get_dir(target,src))
|
||||
node2 = target
|
||||
break
|
||||
for(var/obj/machinery/atmospherics/target in get_step(src,node3_dir))
|
||||
if(target.initialize_directions & get_dir(target,src))
|
||||
node3 = target
|
||||
break
|
||||
|
||||
update_icon()
|
||||
update_underlays()
|
||||
|
||||
/obj/machinery/atmospherics/tvalve/mirrored/update_icon(animation)
|
||||
if(animation)
|
||||
flick("tvalvem[src.state][!src.state]",src)
|
||||
else
|
||||
icon_state = "tvalvem[state]"
|
||||
|
||||
/obj/machinery/atmospherics/tvalve/mirrored/digital // can be controlled by AI
|
||||
name = "digital switching valve"
|
||||
desc = "A digitally controlled valve."
|
||||
icon = 'icons/atmos/digital_tvalve.dmi'
|
||||
|
||||
var/frequency = 0
|
||||
var/id = null
|
||||
var/datum/radio_frequency/radio_connection
|
||||
|
||||
/obj/machinery/atmospherics/tvalve/mirrored/digital/bypass
|
||||
icon_state = "map_tvalvem1"
|
||||
state = 1
|
||||
|
||||
/obj/machinery/atmospherics/tvalve/mirrored/digital/power_change()
|
||||
var/old_stat = stat
|
||||
..()
|
||||
if(old_stat != stat)
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/atmospherics/tvalve/mirrored/digital/update_icon()
|
||||
..()
|
||||
if(!powered())
|
||||
icon_state = "tvalvemnopower"
|
||||
|
||||
/obj/machinery/atmospherics/tvalve/mirrored/digital/attack_ai(mob/user as mob)
|
||||
return src.attack_hand(user)
|
||||
|
||||
/obj/machinery/atmospherics/tvalve/mirrored/digital/attack_hand(mob/user as mob)
|
||||
if(!powered())
|
||||
return
|
||||
if(!src.allowed(user))
|
||||
user << "\red Access denied."
|
||||
return
|
||||
..()
|
||||
|
||||
//Radio remote control -eh?
|
||||
|
||||
/obj/machinery/atmospherics/tvalve/mirrored/digital/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_ATMOSIA)
|
||||
|
||||
/obj/machinery/atmospherics/tvalve/mirrored/digital/initialize()
|
||||
..()
|
||||
if(frequency)
|
||||
set_frequency(frequency)
|
||||
|
||||
/obj/machinery/atmospherics/tvalve/mirrored/digital/receive_signal(datum/signal/signal)
|
||||
if(!signal.data["tag"] || (signal.data["tag"] != id))
|
||||
return 0
|
||||
|
||||
switch(signal.data["command"])
|
||||
if("valve_open")
|
||||
if(!state)
|
||||
go_to_side()
|
||||
|
||||
if("valve_close")
|
||||
if(state)
|
||||
go_straight()
|
||||
|
||||
if("valve_toggle")
|
||||
if(state)
|
||||
go_straight()
|
||||
else
|
||||
go_to_side()
|
||||
@@ -1,7 +1,8 @@
|
||||
/obj/machinery/atmospherics/unary/outlet_injector
|
||||
icon = 'icons/obj/atmospherics/outlet_injector.dmi'
|
||||
icon_state = "off"
|
||||
icon = 'icons/atmos/injector.dmi'
|
||||
icon_state = "map_injector"
|
||||
use_power = 1
|
||||
layer = 3
|
||||
|
||||
name = "Air Injector"
|
||||
desc = "Has a valve and pump attached to it"
|
||||
@@ -17,131 +18,122 @@
|
||||
|
||||
level = 1
|
||||
|
||||
update_icon()
|
||||
if(node)
|
||||
if(on && !(stat & NOPOWER))
|
||||
icon_state = "[level == 1 && istype(loc, /turf/simulated) ? "h" : "" ]on"
|
||||
else
|
||||
icon_state = "[level == 1 && istype(loc, /turf/simulated) ? "h" : "" ]off"
|
||||
else
|
||||
icon_state = "exposed"
|
||||
on = 0
|
||||
/obj/machinery/atmospherics/unary/outlet_injector/update_icon()
|
||||
if(!powered())
|
||||
icon_state = "off"
|
||||
else
|
||||
icon_state = "[on ? "on" : "off"]"
|
||||
|
||||
return
|
||||
|
||||
power_change()
|
||||
var/old_stat = stat
|
||||
..()
|
||||
if(old_stat != stat)
|
||||
update_icon()
|
||||
|
||||
|
||||
process()
|
||||
..()
|
||||
injecting = 0
|
||||
|
||||
if(!on || stat & NOPOWER)
|
||||
return 0
|
||||
|
||||
if(air_contents.temperature > 0)
|
||||
var/transfer_moles = (air_contents.return_pressure())*volume_rate/(air_contents.temperature * R_IDEAL_GAS_EQUATION)
|
||||
|
||||
var/datum/gas_mixture/removed = air_contents.remove(transfer_moles)
|
||||
|
||||
loc.assume_air(removed)
|
||||
|
||||
if(network)
|
||||
network.update = 1
|
||||
|
||||
return 1
|
||||
|
||||
proc/inject()
|
||||
if(on || injecting)
|
||||
return 0
|
||||
|
||||
injecting = 1
|
||||
|
||||
if(air_contents.temperature > 0)
|
||||
var/transfer_moles = (air_contents.return_pressure())*volume_rate/(air_contents.temperature * R_IDEAL_GAS_EQUATION)
|
||||
|
||||
var/datum/gas_mixture/removed = air_contents.remove(transfer_moles)
|
||||
|
||||
loc.assume_air(removed)
|
||||
|
||||
if(network)
|
||||
network.update = 1
|
||||
|
||||
flick("inject", src)
|
||||
|
||||
proc
|
||||
set_frequency(new_frequency)
|
||||
radio_controller.remove_object(src, frequency)
|
||||
frequency = new_frequency
|
||||
if(frequency)
|
||||
radio_connection = radio_controller.add_object(src, frequency)
|
||||
|
||||
broadcast_status()
|
||||
if(!radio_connection)
|
||||
return 0
|
||||
|
||||
var/datum/signal/signal = new
|
||||
signal.transmission_method = 1 //radio signal
|
||||
signal.source = src
|
||||
|
||||
signal.data = list(
|
||||
"tag" = id,
|
||||
"device" = "AO",
|
||||
"power" = on,
|
||||
"volume_rate" = volume_rate,
|
||||
//"timestamp" = world.time,
|
||||
"sigtype" = "status"
|
||||
)
|
||||
|
||||
radio_connection.post_signal(src, signal)
|
||||
|
||||
return 1
|
||||
|
||||
initialize()
|
||||
..()
|
||||
|
||||
set_frequency(frequency)
|
||||
|
||||
receive_signal(datum/signal/signal)
|
||||
if(!signal.data["tag"] || (signal.data["tag"] != id) || (signal.data["sigtype"]!="command"))
|
||||
return 0
|
||||
|
||||
if("power" in signal.data)
|
||||
on = text2num(signal.data["power"])
|
||||
|
||||
if("power_toggle" in signal.data)
|
||||
on = !on
|
||||
|
||||
if("inject" in signal.data)
|
||||
spawn inject()
|
||||
/obj/machinery/atmospherics/unary/outlet_injector/update_underlays()
|
||||
if(..())
|
||||
underlays.Cut()
|
||||
var/turf/T = get_turf(src)
|
||||
if(!istype(T))
|
||||
return
|
||||
add_underlay(T, node, dir)
|
||||
|
||||
if("set_volume_rate" in signal.data)
|
||||
var/number = text2num(signal.data["set_volume_rate"])
|
||||
volume_rate = between(0, number, air_contents.volume)
|
||||
|
||||
if("status" in signal.data)
|
||||
spawn(2)
|
||||
broadcast_status()
|
||||
return //do not update_icon
|
||||
|
||||
//log_admin("DEBUG \[[world.timeofday]\]: outlet_injector/receive_signal: unknown command \"[signal.data["command"]]\"\n[signal.debug_print()]")
|
||||
//return
|
||||
spawn(2)
|
||||
broadcast_status()
|
||||
/obj/machinery/atmospherics/unary/outlet_injector/power_change()
|
||||
var/old_stat = stat
|
||||
..()
|
||||
if(old_stat != stat)
|
||||
update_icon()
|
||||
|
||||
hide(var/i) //to make the little pipe section invisible, the icon changes.
|
||||
if(node)
|
||||
if(on)
|
||||
icon_state = "[i == 1 && istype(loc, /turf/simulated) ? "h" : "" ]on"
|
||||
else
|
||||
icon_state = "[i == 1 && istype(loc, /turf/simulated) ? "h" : "" ]off"
|
||||
else
|
||||
icon_state = "[i == 1 && istype(loc, /turf/simulated) ? "h" : "" ]exposed"
|
||||
on = 0
|
||||
return
|
||||
/obj/machinery/atmospherics/unary/outlet_injector/process()
|
||||
..()
|
||||
injecting = 0
|
||||
|
||||
if(!on || stat & NOPOWER)
|
||||
return 0
|
||||
|
||||
if(air_contents.temperature > 0)
|
||||
var/transfer_moles = (air_contents.return_pressure())*volume_rate/(air_contents.temperature * R_IDEAL_GAS_EQUATION)
|
||||
|
||||
var/datum/gas_mixture/removed = air_contents.remove(transfer_moles)
|
||||
|
||||
loc.assume_air(removed)
|
||||
|
||||
if(network)
|
||||
network.update = 1
|
||||
|
||||
return 1
|
||||
|
||||
/obj/machinery/atmospherics/unary/outlet_injector/proc/inject()
|
||||
if(on || injecting)
|
||||
return 0
|
||||
|
||||
injecting = 1
|
||||
|
||||
if(air_contents.temperature > 0)
|
||||
var/transfer_moles = (air_contents.return_pressure())*volume_rate/(air_contents.temperature * R_IDEAL_GAS_EQUATION)
|
||||
|
||||
var/datum/gas_mixture/removed = air_contents.remove(transfer_moles)
|
||||
|
||||
loc.assume_air(removed)
|
||||
|
||||
if(network)
|
||||
network.update = 1
|
||||
|
||||
flick("inject", src)
|
||||
|
||||
/obj/machinery/atmospherics/unary/outlet_injector/proc/set_frequency(new_frequency)
|
||||
radio_controller.remove_object(src, frequency)
|
||||
frequency = new_frequency
|
||||
if(frequency)
|
||||
radio_connection = radio_controller.add_object(src, frequency)
|
||||
|
||||
/obj/machinery/atmospherics/unary/outlet_injector/proc/broadcast_status()
|
||||
if(!radio_connection)
|
||||
return 0
|
||||
|
||||
var/datum/signal/signal = new
|
||||
signal.transmission_method = 1 //radio signal
|
||||
signal.source = src
|
||||
|
||||
signal.data = list(
|
||||
"tag" = id,
|
||||
"device" = "AO",
|
||||
"power" = on,
|
||||
"volume_rate" = volume_rate,
|
||||
"sigtype" = "status"
|
||||
)
|
||||
|
||||
radio_connection.post_signal(src, signal)
|
||||
|
||||
return 1
|
||||
|
||||
/obj/machinery/atmospherics/unary/outlet_injector/initialize()
|
||||
..()
|
||||
|
||||
set_frequency(frequency)
|
||||
|
||||
/obj/machinery/atmospherics/unary/outlet_injector/receive_signal(datum/signal/signal)
|
||||
if(!signal.data["tag"] || (signal.data["tag"] != id) || (signal.data["sigtype"]!="command"))
|
||||
return 0
|
||||
|
||||
if(signal.data["power"])
|
||||
on = text2num(signal.data["power"])
|
||||
|
||||
if(signal.data["power_toggle"])
|
||||
on = !on
|
||||
|
||||
if(signal.data["inject"])
|
||||
spawn inject()
|
||||
return
|
||||
|
||||
if(signal.data["set_volume_rate"])
|
||||
var/number = text2num(signal.data["set_volume_rate"])
|
||||
volume_rate = between(0, number, air_contents.volume)
|
||||
|
||||
if(signal.data["status"])
|
||||
spawn(2)
|
||||
broadcast_status()
|
||||
return //do not update_icon
|
||||
|
||||
//log_admin("DEBUG \[[world.timeofday]\]: outlet_injector/receive_signal: unknown command \"[signal.data["command"]]\"\n[signal.debug_print()]")
|
||||
//return
|
||||
spawn(2)
|
||||
broadcast_status()
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/atmospherics/unary/outlet_injector/hide(var/i)
|
||||
update_underlays()
|
||||
@@ -46,10 +46,15 @@
|
||||
|
||||
for(var/obj/machinery/atmospherics/target in get_step(src,node_connect))
|
||||
if(target.initialize_directions & get_dir(target,src))
|
||||
node = target
|
||||
break
|
||||
var/c = check_connect_types(target,src)
|
||||
if (c)
|
||||
target.connected_to = c
|
||||
src.connected_to = c
|
||||
node = target
|
||||
break
|
||||
|
||||
update_icon()
|
||||
update_underlays()
|
||||
|
||||
build_network()
|
||||
if(!network && node)
|
||||
@@ -84,5 +89,8 @@
|
||||
if(reference==node)
|
||||
del(network)
|
||||
node = null
|
||||
|
||||
update_icon()
|
||||
update_underlays()
|
||||
|
||||
return null
|
||||
@@ -1,6 +1,11 @@
|
||||
#define EXTERNAL_PRESSURE_BOUND ONE_ATMOSPHERE
|
||||
#define INTERNAL_PRESSURE_BOUND 0
|
||||
#define PRESSURE_CHECKS 1
|
||||
#undefine
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent_pump
|
||||
icon = 'icons/obj/atmospherics/vent_pump.dmi'
|
||||
icon_state = "off"
|
||||
icon = 'icons/atmos/vent_pump.dmi'
|
||||
icon_state = "map_vent"
|
||||
|
||||
name = "Air Vent"
|
||||
desc = "Has a valve and pump attached to it"
|
||||
@@ -14,329 +19,372 @@
|
||||
var/on = 0
|
||||
var/pump_direction = 1 //0 = siphoning, 1 = releasing
|
||||
|
||||
var/external_pressure_bound = ONE_ATMOSPHERE
|
||||
var/internal_pressure_bound = 0
|
||||
var/external_pressure_bound = EXTERNAL_PRESSURE_BOUND
|
||||
var/internal_pressure_bound = INTERNAL_PRESSURE_BOUND
|
||||
|
||||
var/pressure_checks = 1
|
||||
var/pressure_checks = PRESSURE_CHECKS
|
||||
//1: Do not pass external_pressure_bound
|
||||
//2: Do not pass internal_pressure_bound
|
||||
//3: Do not pass either
|
||||
|
||||
// Used when handling incoming radio signals requesting default settings
|
||||
var/external_pressure_bound_default = EXTERNAL_PRESSURE_BOUND
|
||||
var/internal_pressure_bound_default = INTERNAL_PRESSURE_BOUND
|
||||
var/pressure_checks_default = PRESSURE_CHECKS
|
||||
|
||||
var/welded = 0 // Added for aliens -- TLE
|
||||
var/canSpawnMice = 1 // Set to 0 to prevent spawning of mice.
|
||||
|
||||
var/frequency = 1439
|
||||
var/datum/radio_frequency/radio_connection
|
||||
|
||||
var/radio_filter_out
|
||||
var/radio_filter_in
|
||||
|
||||
connect_types = list(1,2) //connects to regular and supply pipes
|
||||
|
||||
on
|
||||
on = 1
|
||||
icon_state = "out"
|
||||
/obj/machinery/atmospherics/unary/vent_pump/on
|
||||
on = 1
|
||||
icon_state = "map_vent_out"
|
||||
|
||||
siphon
|
||||
pump_direction = 0
|
||||
icon_state = "off"
|
||||
/obj/machinery/atmospherics/unary/vent_pump/siphon
|
||||
pump_direction = 0
|
||||
|
||||
on
|
||||
on = 1
|
||||
icon_state = "in"
|
||||
/obj/machinery/atmospherics/unary/vent_pump/siphon/on
|
||||
on = 1
|
||||
icon_state = "map_vent_in"
|
||||
|
||||
New()
|
||||
initial_loc = get_area(loc)
|
||||
if (initial_loc.master)
|
||||
initial_loc = initial_loc.master
|
||||
area_uid = initial_loc.uid
|
||||
if (!id_tag)
|
||||
assign_uid()
|
||||
id_tag = num2text(uid)
|
||||
if(ticker && ticker.current_state == 3)//if the game is running
|
||||
src.initialize()
|
||||
src.broadcast_status()
|
||||
..()
|
||||
/obj/machinery/atmospherics/unary/vent_pump/New()
|
||||
icon = null
|
||||
initial_loc = get_area(loc)
|
||||
if (initial_loc.master)
|
||||
initial_loc = initial_loc.master
|
||||
area_uid = initial_loc.uid
|
||||
if (!id_tag)
|
||||
assign_uid()
|
||||
id_tag = num2text(uid)
|
||||
if(ticker && ticker.current_state == 3)//if the game is running
|
||||
src.initialize()
|
||||
src.broadcast_status()
|
||||
..()
|
||||
|
||||
high_volume
|
||||
name = "Large Air Vent"
|
||||
power_channel = EQUIP
|
||||
New()
|
||||
..()
|
||||
air_contents.volume = 1000
|
||||
/obj/machinery/atmospherics/unary/vent_pump/high_volume
|
||||
name = "Large Air Vent"
|
||||
power_channel = EQUIP
|
||||
|
||||
update_icon()
|
||||
if(welded)
|
||||
icon_state = "[level == 1 && istype(loc, /turf/simulated) ? "h" : "" ]weld"
|
||||
return
|
||||
if(on && !(stat & (NOPOWER|BROKEN)))
|
||||
if(pump_direction)
|
||||
icon_state = "[level == 1 && istype(loc, /turf/simulated) ? "h" : "" ]out"
|
||||
else
|
||||
icon_state = "[level == 1 && istype(loc, /turf/simulated) ? "h" : "" ]in"
|
||||
else
|
||||
icon_state = "[level == 1 && istype(loc, /turf/simulated) ? "h" : "" ]off"
|
||||
/obj/machinery/atmospherics/unary/vent_pump/high_volume/New()
|
||||
..()
|
||||
air_contents.volume = 1000
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent_pump/update_icon(var/safety = 0)
|
||||
if(!check_icon_cache())
|
||||
return
|
||||
|
||||
process()
|
||||
..()
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
overlays.Cut()
|
||||
|
||||
var/vent_icon = "vent"
|
||||
|
||||
var/turf/T = get_turf(src)
|
||||
if(!istype(T))
|
||||
return
|
||||
|
||||
if(T.intact && node && node.level == 1 && istype(node, /obj/machinery/atmospherics/pipe))
|
||||
vent_icon += "h"
|
||||
|
||||
if(welded)
|
||||
vent_icon += "weld"
|
||||
else if(!powered())
|
||||
vent_icon += "off"
|
||||
else
|
||||
vent_icon += "[on ? "[pump_direction ? "out" : "in"]" : "off"]"
|
||||
|
||||
overlays += icon_manager.get_atmos_icon("device", , , vent_icon)
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent_pump/update_underlays()
|
||||
if(..())
|
||||
underlays.Cut()
|
||||
var/turf/T = get_turf(src)
|
||||
if(!istype(T))
|
||||
return
|
||||
if (!node)
|
||||
on = 0
|
||||
//broadcast_status() // from now air alarm/control computer should request update purposely --rastaf0
|
||||
if(!on)
|
||||
return 0
|
||||
|
||||
if(welded)
|
||||
return 0
|
||||
|
||||
// New GC does this sometimes
|
||||
if(!loc) return
|
||||
|
||||
var/datum/gas_mixture/environment = loc.return_air()
|
||||
var/environment_pressure = environment.return_pressure()
|
||||
|
||||
if(pump_direction) //internal -> external
|
||||
var/pressure_delta = 10000
|
||||
|
||||
if(pressure_checks&1)
|
||||
pressure_delta = min(pressure_delta, (external_pressure_bound - environment_pressure))
|
||||
if(pressure_checks&2)
|
||||
pressure_delta = min(pressure_delta, (air_contents.return_pressure() - internal_pressure_bound))
|
||||
|
||||
if(pressure_delta > 0.5)
|
||||
if(air_contents.temperature > 0)
|
||||
var/transfer_moles = pressure_delta*environment.volume/(air_contents.temperature * R_IDEAL_GAS_EQUATION)
|
||||
|
||||
var/datum/gas_mixture/removed = air_contents.remove(transfer_moles)
|
||||
|
||||
loc.assume_air(removed)
|
||||
|
||||
if(network)
|
||||
network.update = 1
|
||||
|
||||
else //external -> internal
|
||||
var/pressure_delta = 10000
|
||||
if(pressure_checks&1)
|
||||
pressure_delta = min(pressure_delta, (environment_pressure - external_pressure_bound))
|
||||
if(pressure_checks&2)
|
||||
pressure_delta = min(pressure_delta, (internal_pressure_bound - air_contents.return_pressure()))
|
||||
|
||||
if(pressure_delta > 0.5)
|
||||
if(environment.temperature > 0)
|
||||
var/transfer_moles = pressure_delta*air_contents.volume/(environment.temperature * R_IDEAL_GAS_EQUATION)
|
||||
|
||||
var/datum/gas_mixture/removed = loc.remove_air(transfer_moles)
|
||||
if (isnull(removed)) //in space
|
||||
return
|
||||
|
||||
air_contents.merge(removed)
|
||||
|
||||
if(network)
|
||||
network.update = 1
|
||||
|
||||
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)
|
||||
|
||||
broadcast_status()
|
||||
if(!radio_connection)
|
||||
return 0
|
||||
|
||||
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"
|
||||
)
|
||||
|
||||
if(!initial_loc.air_vent_names[id_tag])
|
||||
var/new_name = "[initial_loc.name] Vent Pump #[initial_loc.air_vent_names.len+1]"
|
||||
initial_loc.air_vent_names[id_tag] = new_name
|
||||
src.name = new_name
|
||||
initial_loc.air_vent_info[id_tag] = signal.data
|
||||
|
||||
radio_connection.post_signal(src, signal, radio_filter_out)
|
||||
|
||||
return 1
|
||||
|
||||
|
||||
initialize()
|
||||
..()
|
||||
|
||||
//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
|
||||
if(frequency)
|
||||
set_frequency(frequency)
|
||||
|
||||
receive_signal(datum/signal/signal)
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
if(T.intact && node && node.level == 1 && istype(node, /obj/machinery/atmospherics/pipe))
|
||||
return
|
||||
//log_admin("DEBUG \[[world.timeofday]\]: /obj/machinery/atmospherics/unary/vent_pump/receive_signal([signal.debug_print()])")
|
||||
if(!signal.data["tag"] || (signal.data["tag"] != id_tag) || (signal.data["sigtype"]!="command"))
|
||||
return 0
|
||||
else
|
||||
if(node)
|
||||
add_underlay(T, node, dir, node.icon_connect_type)
|
||||
else
|
||||
add_underlay(T,, dir)
|
||||
|
||||
if(signal.data["purge"] != null)
|
||||
pressure_checks &= ~1
|
||||
pump_direction = 0
|
||||
/obj/machinery/atmospherics/unary/vent_pump/hide()
|
||||
update_icon()
|
||||
update_underlays()
|
||||
|
||||
if(signal.data["stabalize"] != null)
|
||||
pressure_checks |= 1
|
||||
pump_direction = 1
|
||||
/obj/machinery/atmospherics/unary/vent_pump/process()
|
||||
..()
|
||||
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
|
||||
|
||||
if(signal.data["power"] != null)
|
||||
on = text2num(signal.data["power"])
|
||||
if(welded)
|
||||
return 0
|
||||
|
||||
if(signal.data["power_toggle"] != null)
|
||||
on = !on
|
||||
var/datum/gas_mixture/environment = loc.return_air()
|
||||
var/environment_pressure = environment.return_pressure()
|
||||
|
||||
if(signal.data["checks"] != null)
|
||||
if(pump_direction) //internal -> external
|
||||
var/pressure_delta = 10000
|
||||
|
||||
if(pressure_checks&1)
|
||||
pressure_delta = min(pressure_delta, (external_pressure_bound - environment_pressure))
|
||||
if(pressure_checks&2)
|
||||
pressure_delta = min(pressure_delta, (air_contents.return_pressure() - internal_pressure_bound))
|
||||
|
||||
if(pressure_delta > 0.5)
|
||||
if(air_contents.temperature > 0)
|
||||
var/transfer_moles = pressure_delta*environment.volume/(air_contents.temperature * R_IDEAL_GAS_EQUATION)
|
||||
|
||||
var/datum/gas_mixture/removed = air_contents.remove(transfer_moles)
|
||||
|
||||
loc.assume_air(removed)
|
||||
|
||||
if(network)
|
||||
network.update = 1
|
||||
|
||||
else //external -> internal
|
||||
var/pressure_delta = 10000
|
||||
if(pressure_checks&1)
|
||||
pressure_delta = min(pressure_delta, (environment_pressure - external_pressure_bound))
|
||||
if(pressure_checks&2)
|
||||
pressure_delta = min(pressure_delta, (internal_pressure_bound - air_contents.return_pressure()))
|
||||
|
||||
if(pressure_delta > 0.5)
|
||||
if(environment.temperature > 0)
|
||||
var/transfer_moles = pressure_delta*air_contents.volume/(environment.temperature * R_IDEAL_GAS_EQUATION)
|
||||
|
||||
var/datum/gas_mixture/removed = loc.remove_air(transfer_moles)
|
||||
if (isnull(removed)) //in space
|
||||
return
|
||||
|
||||
air_contents.merge(removed)
|
||||
|
||||
if(network)
|
||||
network.update = 1
|
||||
|
||||
return 1
|
||||
|
||||
//Radio remote control
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent_pump/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)
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent_pump/proc/broadcast_status()
|
||||
if(!radio_connection)
|
||||
return 0
|
||||
|
||||
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"
|
||||
)
|
||||
|
||||
if(!initial_loc.air_vent_names[id_tag])
|
||||
var/new_name = "[initial_loc.name] Vent Pump #[initial_loc.air_vent_names.len+1]"
|
||||
initial_loc.air_vent_names[id_tag] = new_name
|
||||
src.name = new_name
|
||||
initial_loc.air_vent_info[id_tag] = signal.data
|
||||
|
||||
radio_connection.post_signal(src, signal, radio_filter_out)
|
||||
|
||||
return 1
|
||||
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent_pump/initialize()
|
||||
..()
|
||||
|
||||
//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
|
||||
if(frequency)
|
||||
set_frequency(frequency)
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent_pump/receive_signal(datum/signal/signal)
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
//log_admin("DEBUG \[[world.timeofday]\]: /obj/machinery/atmospherics/unary/vent_pump/receive_signal([signal.debug_print()])")
|
||||
if(!signal.data["tag"] || (signal.data["tag"] != id_tag) || (signal.data["sigtype"]!="command"))
|
||||
return 0
|
||||
|
||||
if(signal.data["purge"] != null)
|
||||
pressure_checks &= ~1
|
||||
pump_direction = 0
|
||||
|
||||
if(signal.data["stabalize"] != null)
|
||||
pressure_checks |= 1
|
||||
pump_direction = 1
|
||||
|
||||
if(signal.data["power"] != null)
|
||||
on = text2num(signal.data["power"])
|
||||
|
||||
if(signal.data["power_toggle"] != null)
|
||||
on = !on
|
||||
|
||||
if(signal.data["checks"] != null)
|
||||
if (signal.data["checks"] == "default")
|
||||
pressure_checks = pressure_checks_default
|
||||
else
|
||||
pressure_checks = text2num(signal.data["checks"])
|
||||
|
||||
if(signal.data["checks_toggle"] != null)
|
||||
pressure_checks = (pressure_checks?0:3)
|
||||
if(signal.data["checks_toggle"] != null)
|
||||
pressure_checks = (pressure_checks?0:3)
|
||||
|
||||
if(signal.data["direction"] != null)
|
||||
pump_direction = text2num(signal.data["direction"])
|
||||
if(signal.data["direction"] != null)
|
||||
pump_direction = text2num(signal.data["direction"])
|
||||
|
||||
if(signal.data["set_internal_pressure"] != null)
|
||||
if(signal.data["set_internal_pressure"] != null)
|
||||
if (signal.data["set_internal_pressure"] == "default")
|
||||
internal_pressure_bound = internal_pressure_bound_default
|
||||
else
|
||||
internal_pressure_bound = between(
|
||||
0,
|
||||
text2num(signal.data["set_internal_pressure"]),
|
||||
ONE_ATMOSPHERE*50
|
||||
)
|
||||
|
||||
if(signal.data["set_external_pressure"] != null)
|
||||
if(signal.data["set_external_pressure"] != null)
|
||||
if (signal.data["set_external_pressure"] == "default")
|
||||
external_pressure_bound = external_pressure_bound_default
|
||||
else
|
||||
external_pressure_bound = between(
|
||||
0,
|
||||
text2num(signal.data["set_external_pressure"]),
|
||||
ONE_ATMOSPHERE*50
|
||||
)
|
||||
|
||||
if(signal.data["adjust_internal_pressure"] != null)
|
||||
internal_pressure_bound = between(
|
||||
0,
|
||||
internal_pressure_bound + text2num(signal.data["adjust_internal_pressure"]),
|
||||
ONE_ATMOSPHERE*50
|
||||
)
|
||||
if(signal.data["adjust_internal_pressure"] != null)
|
||||
internal_pressure_bound = between(
|
||||
0,
|
||||
internal_pressure_bound + text2num(signal.data["adjust_internal_pressure"]),
|
||||
ONE_ATMOSPHERE*50
|
||||
)
|
||||
|
||||
if(signal.data["adjust_external_pressure"] != null)
|
||||
external_pressure_bound = between(
|
||||
0,
|
||||
external_pressure_bound + text2num(signal.data["adjust_external_pressure"]),
|
||||
ONE_ATMOSPHERE*50
|
||||
)
|
||||
if(signal.data["adjust_external_pressure"] != null)
|
||||
|
||||
if(signal.data["init"] != null)
|
||||
name = signal.data["init"]
|
||||
return
|
||||
|
||||
if(signal.data["status"] != null)
|
||||
spawn(2)
|
||||
broadcast_status()
|
||||
return //do not update_icon
|
||||
external_pressure_bound = between(
|
||||
0,
|
||||
external_pressure_bound + text2num(signal.data["adjust_external_pressure"]),
|
||||
ONE_ATMOSPHERE*50
|
||||
)
|
||||
|
||||
//log_admin("DEBUG \[[world.timeofday]\]: vent_pump/receive_signal: unknown command \"[signal.data["command"]]\"\n[signal.debug_print()]")
|
||||
if(signal.data["init"] != null)
|
||||
name = signal.data["init"]
|
||||
return
|
||||
|
||||
if(signal.data["status"] != null)
|
||||
spawn(2)
|
||||
broadcast_status()
|
||||
update_icon()
|
||||
return
|
||||
return //do not update_icon
|
||||
|
||||
hide(var/i) //to make the little pipe section invisible, the icon changes.
|
||||
if(welded)
|
||||
icon_state = "[i == 1 && istype(loc, /turf/simulated) ? "h" : "" ]weld"
|
||||
return
|
||||
if(on&&node)
|
||||
if(pump_direction)
|
||||
icon_state = "[i == 1 && istype(loc, /turf/simulated) ? "h" : "" ]out"
|
||||
else
|
||||
icon_state = "[i == 1 && istype(loc, /turf/simulated) ? "h" : "" ]in"
|
||||
else
|
||||
icon_state = "[i == 1 && istype(loc, /turf/simulated) ? "h" : "" ]off"
|
||||
on = 0
|
||||
return
|
||||
//log_admin("DEBUG \[[world.timeofday]\]: vent_pump/receive_signal: unknown command \"[signal.data["command"]]\"\n[signal.debug_print()]")
|
||||
spawn(2)
|
||||
broadcast_status()
|
||||
update_icon()
|
||||
return
|
||||
|
||||
attackby(obj/item/W, mob/user)
|
||||
if(istype(W, /obj/item/weapon/weldingtool))
|
||||
var/obj/item/weapon/weldingtool/WT = W
|
||||
if (WT.remove_fuel(0,user))
|
||||
user << "\blue Now welding the vent."
|
||||
if(do_after(user, 20))
|
||||
if(!src || !WT.isOn()) return
|
||||
playsound(get_turf(src), 'sound/items/Welder2.ogg', 50, 1)
|
||||
if(!welded)
|
||||
user.visible_message("[user] welds the vent shut.", "You weld the vent shut.", "You hear welding.")
|
||||
welded = 1
|
||||
update_icon()
|
||||
else
|
||||
user.visible_message("[user] unwelds the vent.", "You unweld the vent.", "You hear welding.")
|
||||
welded = 0
|
||||
update_icon()
|
||||
/obj/machinery/atmospherics/unary/vent_pump/attackby(obj/item/W, mob/user)
|
||||
if(istype(W, /obj/item/weapon/weldingtool))
|
||||
var/obj/item/weapon/weldingtool/WT = W
|
||||
if (WT.remove_fuel(0,user))
|
||||
user << "\blue Now welding the vent."
|
||||
if(do_after(user, 20))
|
||||
if(!src || !WT.isOn()) return
|
||||
playsound(src.loc, 'sound/items/Welder2.ogg', 50, 1)
|
||||
if(!welded)
|
||||
user.visible_message("[user] welds the vent shut.", "You weld the vent shut.", "You hear welding.")
|
||||
welded = 1
|
||||
update_icon()
|
||||
else
|
||||
user << "\blue The welding tool needs to be on to start this task."
|
||||
user.visible_message("[user] unwelds the vent.", "You unweld the vent.", "You hear welding.")
|
||||
welded = 0
|
||||
update_icon()
|
||||
else
|
||||
user << "\blue You need more welding fuel to complete this task."
|
||||
return 1
|
||||
examine()
|
||||
set src in oview(1)
|
||||
..()
|
||||
if(welded)
|
||||
usr << "It seems welded shut."
|
||||
|
||||
power_change()
|
||||
if(powered(power_channel))
|
||||
stat &= ~NOPOWER
|
||||
user << "\blue The welding tool needs to be on to start this task."
|
||||
else
|
||||
stat |= NOPOWER
|
||||
user << "\blue You need more welding fuel to complete this task."
|
||||
return 1
|
||||
else
|
||||
..()
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent_pump/examine()
|
||||
set src in oview(1)
|
||||
..()
|
||||
if(welded)
|
||||
usr << "It seems welded shut."
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent_pump/power_change()
|
||||
var/old_stat = stat
|
||||
..()
|
||||
if(old_stat != stat)
|
||||
update_icon()
|
||||
|
||||
attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
|
||||
if (!istype(W, /obj/item/weapon/wrench))
|
||||
return ..()
|
||||
if (!(stat & NOPOWER) && on)
|
||||
user << "\red You cannot unwrench this [src], turn it off first."
|
||||
return 1
|
||||
var/turf/T = src.loc
|
||||
if (level==1 && isturf(T) && T.intact)
|
||||
user << "\red You must remove the plating first."
|
||||
return 1
|
||||
var/datum/gas_mixture/int_air = return_air()
|
||||
var/datum/gas_mixture/env_air = loc.return_air()
|
||||
if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE)
|
||||
user << "\red You cannot unwrench this [src], it too exerted due to internal pressure."
|
||||
add_fingerprint(user)
|
||||
return 1
|
||||
playsound(get_turf(src), 'sound/items/Ratchet.ogg', 50, 1)
|
||||
user << "\blue You begin to unfasten \the [src]..."
|
||||
if (do_after(user, 40))
|
||||
user.visible_message( \
|
||||
"[user] unfastens \the [src].", \
|
||||
"\blue You have unfastened \the [src].", \
|
||||
"You hear ratchet.")
|
||||
new /obj/item/pipe(loc, make_from=src)
|
||||
del(src)
|
||||
/obj/machinery/atmospherics/unary/vent_pump/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
|
||||
if (!istype(W, /obj/item/weapon/wrench))
|
||||
return ..()
|
||||
if (!(stat & NOPOWER) && on)
|
||||
user << "\red You cannot unwrench this [src], turn it off first."
|
||||
return 1
|
||||
var/turf/T = src.loc
|
||||
if (node && node.level==1 && isturf(T) && T.intact)
|
||||
user << "\red You must remove the plating first."
|
||||
return 1
|
||||
var/datum/gas_mixture/int_air = return_air()
|
||||
var/datum/gas_mixture/env_air = loc.return_air()
|
||||
if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE)
|
||||
user << "\red You cannot unwrench this [src], it too exerted due to internal pressure."
|
||||
add_fingerprint(user)
|
||||
return 1
|
||||
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
|
||||
user << "\blue You begin to unfasten \the [src]..."
|
||||
if (do_after(user, 40))
|
||||
user.visible_message( \
|
||||
"[user] unfastens \the [src].", \
|
||||
"\blue You have unfastened \the [src].", \
|
||||
"You hear ratchet.")
|
||||
new /obj/item/pipe(loc, make_from=src)
|
||||
del(src)
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent_pump/Destroy()
|
||||
/obj/machinery/atmospherics/unary/vent_pump/Del()
|
||||
if(initial_loc)
|
||||
initial_loc.air_vent_info -= id_tag
|
||||
initial_loc.air_vent_names -= id_tag
|
||||
..()
|
||||
return
|
||||
|
||||
/*
|
||||
Alt-click to ventcrawl - Monkeys, aliens, slimes and mice.
|
||||
This is a little buggy but somehow that just seems to plague ventcrawl.
|
||||
I am sorry, I don't know why.
|
||||
*/
|
||||
/obj/machinery/atmospherics/unary/vent_pump/AltClick(var/mob/living/ML)
|
||||
if(istype(ML))
|
||||
var/list/ventcrawl_verbs = list(/mob/living/carbon/monkey/verb/ventcrawl, /mob/living/carbon/alien/verb/alien_ventcrawl, /mob/living/carbon/slime/verb/ventcrawl,/mob/living/simple_animal/mouse/verb/ventcrawl)
|
||||
if(length(ML.verbs & ventcrawl_verbs)) // alien queens have this removed, an istype would be complicated
|
||||
ML.handle_ventcrawl(src)
|
||||
return
|
||||
..()
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/obj/machinery/atmospherics/unary/vent_scrubber
|
||||
icon = 'icons/obj/atmospherics/vent_scrubber.dmi'
|
||||
icon_state = "off"
|
||||
icon = 'icons/atmos/vent_scrubber.dmi'
|
||||
icon_state = "map_scrubber"
|
||||
|
||||
name = "Air Scrubber"
|
||||
desc = "Has a valve and pump attached to it"
|
||||
@@ -18,7 +18,6 @@
|
||||
var/scrub_CO2 = 1
|
||||
var/scrub_Toxins = 0
|
||||
var/scrub_N2O = 0
|
||||
var/scrub_O2 = 0
|
||||
|
||||
var/volume_rate = 120
|
||||
var/panic = 0 //is this scrubber panicked?
|
||||
@@ -26,272 +25,264 @@
|
||||
var/area_uid
|
||||
var/radio_filter_out
|
||||
var/radio_filter_in
|
||||
New()
|
||||
initial_loc = get_area(loc)
|
||||
if (initial_loc.master)
|
||||
initial_loc = initial_loc.master
|
||||
area_uid = initial_loc.uid
|
||||
if (!id_tag)
|
||||
assign_uid()
|
||||
id_tag = num2text(uid)
|
||||
if(ticker && ticker.current_state == 3)//if the game is running
|
||||
src.initialize()
|
||||
src.broadcast_status()
|
||||
..()
|
||||
|
||||
update_icon()
|
||||
var/hidden=""
|
||||
if(level == 1 && istype(loc, /turf/simulated))
|
||||
hidden="h"
|
||||
var/suffix=""
|
||||
if(scrub_O2)
|
||||
suffix="1"
|
||||
if(node && on && !(stat & (NOPOWER|BROKEN)))
|
||||
if(scrubbing)
|
||||
icon_state = "[hidden]on[suffix]"
|
||||
else
|
||||
icon_state = "[hidden]in"
|
||||
else
|
||||
icon_state = "[hidden]off"
|
||||
connect_types = list(1,3) //connects to regular and scrubber pipes
|
||||
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent_scrubber/New()
|
||||
icon = null
|
||||
initial_loc = get_area(loc)
|
||||
if (initial_loc.master)
|
||||
initial_loc = initial_loc.master
|
||||
area_uid = initial_loc.uid
|
||||
if (!id_tag)
|
||||
assign_uid()
|
||||
id_tag = num2text(uid)
|
||||
if(ticker && ticker.current_state == 3)//if the game is running
|
||||
src.initialize()
|
||||
src.broadcast_status()
|
||||
..()
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent_scrubber/update_icon(var/safety = 0)
|
||||
if(!check_icon_cache())
|
||||
return
|
||||
|
||||
proc
|
||||
set_frequency(new_frequency)
|
||||
radio_controller.remove_object(src, frequency)
|
||||
frequency = new_frequency
|
||||
radio_connection = radio_controller.add_object(src, frequency, radio_filter_in)
|
||||
overlays.Cut()
|
||||
|
||||
var/scrubber_icon = "scrubber"
|
||||
|
||||
broadcast_status()
|
||||
if(!radio_connection)
|
||||
return 0
|
||||
var/turf/T = get_turf(src)
|
||||
if(!istype(T))
|
||||
return
|
||||
|
||||
var/datum/signal/signal = new
|
||||
signal.transmission_method = 1 //radio signal
|
||||
signal.source = src
|
||||
signal.data = list(
|
||||
"area" = area_uid,
|
||||
"tag" = id_tag,
|
||||
"device" = "AScr",
|
||||
"timestamp" = world.time,
|
||||
"power" = on,
|
||||
"scrubbing" = scrubbing,
|
||||
"panic" = panic,
|
||||
"filter_co2" = scrub_CO2,
|
||||
"filter_tox" = scrub_Toxins,
|
||||
"filter_n2o" = scrub_N2O,
|
||||
"filter_o2" = scrub_O2,
|
||||
"sigtype" = "status"
|
||||
)
|
||||
if(!initial_loc.air_scrub_names[id_tag])
|
||||
var/new_name = "[initial_loc.name] Air Scrubber #[initial_loc.air_scrub_names.len+1]"
|
||||
initial_loc.air_scrub_names[id_tag] = new_name
|
||||
src.name = new_name
|
||||
initial_loc.air_scrub_info[id_tag] = signal.data
|
||||
radio_connection.post_signal(src, signal, radio_filter_out)
|
||||
if(!powered())
|
||||
scrubber_icon += "off"
|
||||
else
|
||||
scrubber_icon += "[on ? "[scrubbing ? "on" : "in"]" : "off"]"
|
||||
|
||||
return 1
|
||||
overlays += icon_manager.get_atmos_icon("device", , , scrubber_icon)
|
||||
|
||||
initialize()
|
||||
..()
|
||||
radio_filter_in = frequency==initial(frequency)?(RADIO_FROM_AIRALARM):null
|
||||
radio_filter_out = frequency==initial(frequency)?(RADIO_TO_AIRALARM):null
|
||||
if (frequency)
|
||||
set_frequency(frequency)
|
||||
|
||||
process()
|
||||
..()
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
/obj/machinery/atmospherics/unary/vent_scrubber/update_underlays()
|
||||
if(..())
|
||||
underlays.Cut()
|
||||
var/turf/T = get_turf(src)
|
||||
if(!istype(T))
|
||||
return
|
||||
if (!node)
|
||||
on = 0
|
||||
//broadcast_status()
|
||||
if(!on)
|
||||
return 0
|
||||
// New GC does this sometimes
|
||||
if(!loc) return
|
||||
if(T.intact && node && node.level == 1 && istype(node, /obj/machinery/atmospherics/pipe))
|
||||
return
|
||||
else
|
||||
if(node)
|
||||
add_underlay(T, node, dir, node.icon_connect_type)
|
||||
else
|
||||
add_underlay(T,, dir)
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent_scrubber/proc/set_frequency(new_frequency)
|
||||
radio_controller.remove_object(src, frequency)
|
||||
frequency = new_frequency
|
||||
radio_connection = radio_controller.add_object(src, frequency, radio_filter_in)
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent_scrubber/proc/broadcast_status()
|
||||
if(!radio_connection)
|
||||
return 0
|
||||
|
||||
var/datum/signal/signal = new
|
||||
signal.transmission_method = 1 //radio signal
|
||||
signal.source = src
|
||||
signal.data = list(
|
||||
"area" = area_uid,
|
||||
"tag" = id_tag,
|
||||
"device" = "AScr",
|
||||
"timestamp" = world.time,
|
||||
"power" = on,
|
||||
"scrubbing" = scrubbing,
|
||||
"panic" = panic,
|
||||
"filter_co2" = scrub_CO2,
|
||||
"filter_toxins" = scrub_Toxins,
|
||||
"filter_n2o" = scrub_N2O,
|
||||
"sigtype" = "status"
|
||||
)
|
||||
if(!initial_loc.air_scrub_names[id_tag])
|
||||
var/new_name = "[initial_loc.name] Air Scrubber #[initial_loc.air_scrub_names.len+1]"
|
||||
initial_loc.air_scrub_names[id_tag] = new_name
|
||||
src.name = new_name
|
||||
initial_loc.air_scrub_info[id_tag] = signal.data
|
||||
radio_connection.post_signal(src, signal, radio_filter_out)
|
||||
|
||||
return 1
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent_scrubber/initialize()
|
||||
..()
|
||||
radio_filter_in = frequency==initial(frequency)?(RADIO_FROM_AIRALARM):null
|
||||
radio_filter_out = frequency==initial(frequency)?(RADIO_TO_AIRALARM):null
|
||||
if (frequency)
|
||||
set_frequency(frequency)
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent_scrubber/process()
|
||||
..()
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
if (!node)
|
||||
on = 0
|
||||
//broadcast_status()
|
||||
if(!on)
|
||||
return 0
|
||||
|
||||
|
||||
var/datum/gas_mixture/environment = loc.return_air()
|
||||
var/datum/gas_mixture/environment = loc.return_air()
|
||||
|
||||
if(scrubbing)
|
||||
// Are we scrubbing gasses that are present?
|
||||
if(\
|
||||
(scrub_Toxins && environment.toxins > 0.001) ||\
|
||||
(scrub_CO2 && environment.carbon_dioxide > 0.001) ||\
|
||||
(scrub_N2O && environment.trace_gases.len > 0) ||\
|
||||
(scrub_O2 && environment.oxygen > 0.001))
|
||||
var/transfer_moles = min(1, volume_rate/environment.volume)*environment.total_moles()
|
||||
if(scrubbing)
|
||||
if((environment.toxins>0.001) || (environment.carbon_dioxide>0.001) || (environment.trace_gases.len>0))
|
||||
var/transfer_moles = min(1, volume_rate/environment.volume)*environment.total_moles()
|
||||
|
||||
//Take a gas sample
|
||||
var/datum/gas_mixture/removed = loc.remove_air(transfer_moles)
|
||||
if (isnull(removed)) //in space
|
||||
return
|
||||
|
||||
//Filter it
|
||||
var/datum/gas_mixture/filtered_out = new
|
||||
filtered_out.temperature = removed.temperature
|
||||
|
||||
if(scrub_Toxins)
|
||||
filtered_out.toxins = removed.toxins
|
||||
removed.toxins = 0
|
||||
|
||||
if(scrub_CO2)
|
||||
filtered_out.carbon_dioxide = removed.carbon_dioxide
|
||||
removed.carbon_dioxide = 0
|
||||
|
||||
if(scrub_O2)
|
||||
filtered_out.oxygen = removed.oxygen
|
||||
removed.oxygen = 0
|
||||
|
||||
if(removed.trace_gases.len>0)
|
||||
for(var/datum/gas/trace_gas in removed.trace_gases)
|
||||
if(istype(trace_gas, /datum/gas/oxygen_agent_b))
|
||||
removed.trace_gases -= trace_gas
|
||||
filtered_out.trace_gases += trace_gas
|
||||
else if(istype(trace_gas, /datum/gas/sleeping_agent) && scrub_N2O)
|
||||
removed.trace_gases -= trace_gas
|
||||
filtered_out.trace_gases += trace_gas
|
||||
|
||||
|
||||
//Remix the resulting gases
|
||||
air_contents.merge(filtered_out)
|
||||
|
||||
loc.assume_air(removed)
|
||||
|
||||
if(network)
|
||||
network.update = 1
|
||||
|
||||
else //Just siphoning all air
|
||||
if (air_contents.return_pressure()>=50*ONE_ATMOSPHERE)
|
||||
//Take a gas sample
|
||||
var/datum/gas_mixture/removed = loc.remove_air(transfer_moles)
|
||||
if (isnull(removed)) //in space
|
||||
return
|
||||
|
||||
var/transfer_moles = environment.total_moles()*(volume_rate/environment.volume)
|
||||
//Filter it
|
||||
var/datum/gas_mixture/filtered_out = new
|
||||
filtered_out.temperature = removed.temperature
|
||||
if(scrub_Toxins)
|
||||
filtered_out.toxins = removed.toxins
|
||||
removed.toxins = 0
|
||||
if(scrub_CO2)
|
||||
filtered_out.carbon_dioxide = removed.carbon_dioxide
|
||||
removed.carbon_dioxide = 0
|
||||
|
||||
var/datum/gas_mixture/removed = loc.remove_air(transfer_moles)
|
||||
if(removed.trace_gases.len>0)
|
||||
for(var/datum/gas/trace_gas in removed.trace_gases)
|
||||
if(istype(trace_gas, /datum/gas/oxygen_agent_b))
|
||||
removed.trace_gases -= trace_gas
|
||||
filtered_out.trace_gases += trace_gas
|
||||
else if(istype(trace_gas, /datum/gas/sleeping_agent) && scrub_N2O)
|
||||
removed.trace_gases -= trace_gas
|
||||
filtered_out.trace_gases += trace_gas
|
||||
|
||||
air_contents.merge(removed)
|
||||
|
||||
//Remix the resulting gases
|
||||
air_contents.merge(filtered_out)
|
||||
|
||||
loc.assume_air(removed)
|
||||
|
||||
if(network)
|
||||
network.update = 1
|
||||
|
||||
return 1
|
||||
/* //unused piece of code
|
||||
hide(var/i) //to make the little pipe section invisible, the icon changes.
|
||||
if(on&&node)
|
||||
if(scrubbing)
|
||||
icon_state = "[i == 1 && istype(loc, /turf/simulated) ? "h" : "" ]on"
|
||||
else
|
||||
icon_state = "[i == 1 && istype(loc, /turf/simulated) ? "h" : "" ]in"
|
||||
else
|
||||
icon_state = "[i == 1 && istype(loc, /turf/simulated) ? "h" : "" ]off"
|
||||
on = 0
|
||||
else //Just siphoning all air
|
||||
if (air_contents.return_pressure()>=50*ONE_ATMOSPHERE)
|
||||
return
|
||||
|
||||
var/transfer_moles = environment.total_moles()*(volume_rate/environment.volume)
|
||||
|
||||
var/datum/gas_mixture/removed = loc.remove_air(transfer_moles)
|
||||
|
||||
air_contents.merge(removed)
|
||||
|
||||
if(network)
|
||||
network.update = 1
|
||||
|
||||
return 1
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent_scrubber/hide(var/i) //to make the little pipe section invisible, the icon changes.
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent_scrubber/receive_signal(datum/signal/signal)
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
*/
|
||||
if(!signal.data["tag"] || (signal.data["tag"] != id_tag) || (signal.data["sigtype"]!="command"))
|
||||
return 0
|
||||
|
||||
receive_signal(datum/signal/signal)
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
if(!signal.data["tag"] || (signal.data["tag"] != id_tag) || (signal.data["sigtype"]!="command"))
|
||||
return 0
|
||||
if(signal.data["power"] != null)
|
||||
on = text2num(signal.data["power"])
|
||||
if(signal.data["power_toggle"] != null)
|
||||
on = !on
|
||||
|
||||
if(signal.data["power"] != null)
|
||||
on = text2num(signal.data["power"])
|
||||
if(signal.data["power_toggle"] != null)
|
||||
on = !on
|
||||
if(signal.data["panic_siphon"]) //must be before if("scrubbing" thing
|
||||
panic = text2num(signal.data["panic_siphon"] != null)
|
||||
if(panic)
|
||||
on = 1
|
||||
scrubbing = 0
|
||||
volume_rate = 2000
|
||||
else
|
||||
scrubbing = 1
|
||||
volume_rate = initial(volume_rate)
|
||||
if(signal.data["toggle_panic_siphon"] != null)
|
||||
panic = !panic
|
||||
if(panic)
|
||||
on = 1
|
||||
scrubbing = 0
|
||||
volume_rate = 2000
|
||||
else
|
||||
scrubbing = 1
|
||||
volume_rate = initial(volume_rate)
|
||||
|
||||
if(signal.data["panic_siphon"]) //must be before if("scrubbing" thing
|
||||
panic = text2num(signal.data["panic_siphon"]) // We send 0 for false in the alarm.
|
||||
if(panic)
|
||||
on = 1
|
||||
scrubbing = 0
|
||||
volume_rate = 2000
|
||||
else
|
||||
scrubbing = 1
|
||||
volume_rate = initial(volume_rate)
|
||||
if(signal.data["toggle_panic_siphon"] != null)
|
||||
panic = !panic
|
||||
if(panic)
|
||||
on = 1
|
||||
scrubbing = 0
|
||||
volume_rate = 2000
|
||||
else
|
||||
scrubbing = 1
|
||||
volume_rate = initial(volume_rate)
|
||||
if(signal.data["scrubbing"] != null)
|
||||
scrubbing = text2num(signal.data["scrubbing"])
|
||||
if(signal.data["toggle_scrubbing"])
|
||||
scrubbing = !scrubbing
|
||||
|
||||
if(signal.data["scrubbing"] != null)
|
||||
scrubbing = text2num(signal.data["scrubbing"])
|
||||
if(signal.data["toggle_scrubbing"])
|
||||
scrubbing = !scrubbing
|
||||
if(signal.data["co2_scrub"] != null)
|
||||
scrub_CO2 = text2num(signal.data["co2_scrub"])
|
||||
if(signal.data["toggle_co2_scrub"])
|
||||
scrub_CO2 = !scrub_CO2
|
||||
|
||||
if(signal.data["co2_scrub"] != null)
|
||||
scrub_CO2 = text2num(signal.data["co2_scrub"])
|
||||
if(signal.data["toggle_co2_scrub"])
|
||||
scrub_CO2 = !scrub_CO2
|
||||
if(signal.data["tox_scrub"] != null)
|
||||
scrub_Toxins = text2num(signal.data["tox_scrub"])
|
||||
if(signal.data["toggle_tox_scrub"])
|
||||
scrub_Toxins = !scrub_Toxins
|
||||
|
||||
if(signal.data["tox_scrub"] != null)
|
||||
scrub_Toxins = text2num(signal.data["tox_scrub"])
|
||||
if(signal.data["toggle_tox_scrub"])
|
||||
scrub_Toxins = !scrub_Toxins
|
||||
if(signal.data["n2o_scrub"] != null)
|
||||
scrub_N2O = text2num(signal.data["n2o_scrub"])
|
||||
if(signal.data["toggle_n2o_scrub"])
|
||||
scrub_N2O = !scrub_N2O
|
||||
|
||||
if(signal.data["n2o_scrub"] != null)
|
||||
scrub_N2O = text2num(signal.data["n2o_scrub"])
|
||||
if(signal.data["toggle_n2o_scrub"])
|
||||
scrub_N2O = !scrub_N2O
|
||||
if(signal.data["init"] != null)
|
||||
name = signal.data["init"]
|
||||
return
|
||||
|
||||
if(signal.data["o2_scrub"] != null)
|
||||
scrub_O2 = text2num(signal.data["o2_scrub"])
|
||||
if(signal.data["toggle_o2_scrub"])
|
||||
scrub_O2 = !scrub_O2
|
||||
|
||||
if(signal.data["init"] != null)
|
||||
name = signal.data["init"]
|
||||
return
|
||||
|
||||
if(signal.data["status"] != null)
|
||||
spawn(2)
|
||||
broadcast_status()
|
||||
return //do not update_icon
|
||||
|
||||
// log_admin("DEBUG \[[world.timeofday]\]: vent_scrubber/receive_signal: unknown command \"[signal.data["command"]]\"\n[signal.debug_print()]")
|
||||
if(signal.data["status"] != null)
|
||||
spawn(2)
|
||||
broadcast_status()
|
||||
update_icon()
|
||||
return
|
||||
return //do not update_icon
|
||||
|
||||
power_change()
|
||||
if(powered(power_channel))
|
||||
stat &= ~NOPOWER
|
||||
else
|
||||
stat |= NOPOWER
|
||||
// log_admin("DEBUG \[[world.timeofday]\]: vent_scrubber/receive_signal: unknown command \"[signal.data["command"]]\"\n[signal.debug_print()]")
|
||||
spawn(2)
|
||||
broadcast_status()
|
||||
update_icon()
|
||||
return
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent_scrubber/power_change()
|
||||
var/old_stat = stat
|
||||
..()
|
||||
if(old_stat != stat)
|
||||
update_icon()
|
||||
|
||||
attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
|
||||
if (!istype(W, /obj/item/weapon/wrench))
|
||||
return ..()
|
||||
if (!(stat & NOPOWER) && on)
|
||||
user << "\red You cannot unwrench this [src], turn it off first."
|
||||
return 1
|
||||
var/turf/T = src.loc
|
||||
if (level==1 && isturf(T) && T.intact)
|
||||
user << "\red You must remove the plating first."
|
||||
return 1
|
||||
var/datum/gas_mixture/int_air = return_air()
|
||||
var/datum/gas_mixture/env_air = loc.return_air()
|
||||
if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE)
|
||||
user << "\red You cannot unwrench this [src], it too exerted due to internal pressure."
|
||||
add_fingerprint(user)
|
||||
return 1
|
||||
playsound(get_turf(src), 'sound/items/Ratchet.ogg', 50, 1)
|
||||
user << "\blue You begin to unfasten \the [src]..."
|
||||
if (do_after(user, 40))
|
||||
user.visible_message( \
|
||||
"[user] unfastens \the [src].", \
|
||||
"\blue You have unfastened \the [src].", \
|
||||
"You hear ratchet.")
|
||||
new /obj/item/pipe(loc, make_from=src)
|
||||
del(src)
|
||||
/obj/machinery/atmospherics/unary/vent_scrubber/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
|
||||
if (!istype(W, /obj/item/weapon/wrench))
|
||||
return ..()
|
||||
if (!(stat & NOPOWER) && on)
|
||||
user << "\red You cannot unwrench this [src], turn it off first."
|
||||
return 1
|
||||
var/turf/T = src.loc
|
||||
if (node && node.level==1 && isturf(T) && T.intact)
|
||||
user << "\red You must remove the plating first."
|
||||
return 1
|
||||
var/datum/gas_mixture/int_air = return_air()
|
||||
var/datum/gas_mixture/env_air = loc.return_air()
|
||||
if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE)
|
||||
user << "\red You cannot unwrench this [src], it too exerted due to internal pressure."
|
||||
add_fingerprint(user)
|
||||
return 1
|
||||
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
|
||||
user << "\blue You begin to unfasten \the [src]..."
|
||||
if (do_after(user, 40))
|
||||
user.visible_message( \
|
||||
"[user] unfastens \the [src].", \
|
||||
"\blue You have unfastened \the [src].", \
|
||||
"You hear ratchet.")
|
||||
new /obj/item/pipe(loc, make_from=src)
|
||||
del(src)
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent_scrubber/Destroy()
|
||||
/obj/machinery/atmospherics/unary/vent_scrubber/Del()
|
||||
if(initial_loc)
|
||||
initial_loc.air_scrub_info -= id_tag
|
||||
initial_loc.air_scrub_names -= id_tag
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
obj/machinery/atmospherics/valve
|
||||
icon = 'icons/obj/atmospherics/valve.dmi'
|
||||
icon_state = "valve0"
|
||||
/obj/machinery/atmospherics/valve
|
||||
icon = 'icons/atmos/valve.dmi'
|
||||
icon_state = "map_valve0"
|
||||
|
||||
name = "manual valve"
|
||||
desc = "A pipe valve"
|
||||
|
||||
level = 1
|
||||
dir = SOUTH
|
||||
initialize_directions = SOUTH|NORTH
|
||||
|
||||
@@ -17,323 +18,305 @@ obj/machinery/atmospherics/valve
|
||||
var/datum/pipe_network/network_node1
|
||||
var/datum/pipe_network/network_node2
|
||||
|
||||
open
|
||||
open = 1
|
||||
icon_state = "valve1"
|
||||
/obj/machinery/atmospherics/valve/open
|
||||
open = 1
|
||||
icon_state = "map_valve1"
|
||||
|
||||
update_icon(animation)
|
||||
if(animation)
|
||||
flick("valve[src.open][!src.open]",src)
|
||||
else
|
||||
icon_state = "valve[open]"
|
||||
/obj/machinery/atmospherics/valve/update_icon(animation)
|
||||
if(animation)
|
||||
flick("valve[src.open][!src.open]",src)
|
||||
else
|
||||
icon_state = "valve[open]"
|
||||
|
||||
New()
|
||||
switch(dir)
|
||||
if(NORTH || SOUTH)
|
||||
initialize_directions = NORTH|SOUTH
|
||||
if(EAST || WEST)
|
||||
initialize_directions = EAST|WEST
|
||||
..()
|
||||
/obj/machinery/atmospherics/valve/update_underlays()
|
||||
if(..())
|
||||
underlays.Cut()
|
||||
var/turf/T = get_turf(src)
|
||||
if(!istype(T))
|
||||
return
|
||||
add_underlay(T, node1, get_dir(src, node1))
|
||||
add_underlay(T, node2, get_dir(src, node2))
|
||||
|
||||
network_expand(datum/pipe_network/new_network, obj/machinery/atmospherics/pipe/reference)
|
||||
/obj/machinery/atmospherics/valve/hide(var/i)
|
||||
update_underlays()
|
||||
|
||||
/obj/machinery/atmospherics/valve/New()
|
||||
switch(dir)
|
||||
if(NORTH || SOUTH)
|
||||
initialize_directions = NORTH|SOUTH
|
||||
if(EAST || WEST)
|
||||
initialize_directions = EAST|WEST
|
||||
..()
|
||||
|
||||
if(reference == node1)
|
||||
network_node1 = new_network
|
||||
if(open)
|
||||
network_node2 = new_network
|
||||
else if(reference == node2)
|
||||
network_node2 = new_network
|
||||
if(open)
|
||||
network_node1 = new_network
|
||||
|
||||
if(new_network.normal_members.Find(src))
|
||||
return 0
|
||||
|
||||
new_network.normal_members += src
|
||||
|
||||
/obj/machinery/atmospherics/valve/network_expand(datum/pipe_network/new_network, obj/machinery/atmospherics/pipe/reference)
|
||||
if(reference == node1)
|
||||
network_node1 = new_network
|
||||
if(open)
|
||||
if(reference == node1)
|
||||
if(node2)
|
||||
return node2.network_expand(new_network, src)
|
||||
else if(reference == node2)
|
||||
if(node1)
|
||||
return node1.network_expand(new_network, src)
|
||||
network_node2 = new_network
|
||||
else if(reference == node2)
|
||||
network_node2 = new_network
|
||||
if(open)
|
||||
network_node1 = new_network
|
||||
|
||||
return null
|
||||
if(new_network.normal_members.Find(src))
|
||||
return 0
|
||||
|
||||
Destroy()
|
||||
loc = null
|
||||
new_network.normal_members += src
|
||||
|
||||
if(node1)
|
||||
node1.disconnect(src)
|
||||
del(network_node1)
|
||||
if(node2)
|
||||
node2.disconnect(src)
|
||||
del(network_node2)
|
||||
if(open)
|
||||
if(reference == node1)
|
||||
if(node2)
|
||||
return node2.network_expand(new_network, src)
|
||||
else if(reference == node2)
|
||||
if(node1)
|
||||
return node1.network_expand(new_network, src)
|
||||
|
||||
node1 = null
|
||||
node2 = null
|
||||
return null
|
||||
|
||||
..()
|
||||
/obj/machinery/atmospherics/valve/Del()
|
||||
loc = null
|
||||
|
||||
proc/open()
|
||||
if(node1)
|
||||
node1.disconnect(src)
|
||||
del(network_node1)
|
||||
if(node2)
|
||||
node2.disconnect(src)
|
||||
del(network_node2)
|
||||
|
||||
if(open) return 0
|
||||
node1 = null
|
||||
node2 = null
|
||||
|
||||
open = 1
|
||||
update_icon()
|
||||
..()
|
||||
|
||||
if(network_node1&&network_node2)
|
||||
network_node1.merge(network_node2)
|
||||
network_node2 = network_node1
|
||||
/obj/machinery/atmospherics/valve/proc/open()
|
||||
if(open) return 0
|
||||
|
||||
if(network_node1)
|
||||
network_node1.update = 1
|
||||
else if(network_node2)
|
||||
network_node2.update = 1
|
||||
open = 1
|
||||
update_icon()
|
||||
|
||||
return 1
|
||||
if(network_node1&&network_node2)
|
||||
network_node1.merge(network_node2)
|
||||
network_node2 = network_node1
|
||||
|
||||
proc/close()
|
||||
if(network_node1)
|
||||
network_node1.update = 1
|
||||
else if(network_node2)
|
||||
network_node2.update = 1
|
||||
|
||||
if(!open)
|
||||
return 0
|
||||
return 1
|
||||
|
||||
open = 0
|
||||
update_icon()
|
||||
/obj/machinery/atmospherics/valve/proc/close()
|
||||
if(!open)
|
||||
return 0
|
||||
|
||||
if(network_node1)
|
||||
del(network_node1)
|
||||
if(network_node2)
|
||||
del(network_node2)
|
||||
open = 0
|
||||
update_icon()
|
||||
|
||||
build_network()
|
||||
if(network_node1)
|
||||
del(network_node1)
|
||||
if(network_node2)
|
||||
del(network_node2)
|
||||
|
||||
return 1
|
||||
build_network()
|
||||
|
||||
proc/normalize_dir()
|
||||
if(dir==3)
|
||||
dir = 1
|
||||
else if(dir==12)
|
||||
dir = 4
|
||||
return 1
|
||||
|
||||
attack_ai(mob/user as mob)
|
||||
return
|
||||
/obj/machinery/atmospherics/valve/proc/normalize_dir()
|
||||
if(dir==3)
|
||||
dir = 1
|
||||
else if(dir==12)
|
||||
dir = 4
|
||||
|
||||
attack_paw(mob/user as mob)
|
||||
return attack_hand(user)
|
||||
/obj/machinery/atmospherics/valve/attack_ai(mob/user as mob)
|
||||
return
|
||||
|
||||
attack_hand(mob/user as mob)
|
||||
src.add_fingerprint(usr)
|
||||
update_icon(1)
|
||||
sleep(10)
|
||||
if (src.open)
|
||||
src.close()
|
||||
else
|
||||
src.open()
|
||||
/obj/machinery/atmospherics/valve/attack_paw(mob/user as mob)
|
||||
return attack_hand(user)
|
||||
|
||||
process()
|
||||
..()
|
||||
. = PROCESS_KILL
|
||||
/obj/machinery/atmospherics/valve/attack_hand(mob/user as mob)
|
||||
src.add_fingerprint(usr)
|
||||
update_icon(1)
|
||||
sleep(10)
|
||||
if (src.open)
|
||||
src.close()
|
||||
else
|
||||
src.open()
|
||||
|
||||
/* if(open && (!node1 || !node2))
|
||||
close()
|
||||
if(!node1)
|
||||
if(!nodealert)
|
||||
//world << "Missing node from [src] at [src.x],[src.y],[src.z]"
|
||||
nodealert = 1
|
||||
else if (!node2)
|
||||
if(!nodealert)
|
||||
//world << "Missing node from [src] at [src.x],[src.y],[src.z]"
|
||||
nodealert = 1
|
||||
else if (nodealert)
|
||||
nodealert = 0
|
||||
*/
|
||||
/obj/machinery/atmospherics/valve/process()
|
||||
..()
|
||||
. = PROCESS_KILL
|
||||
|
||||
return
|
||||
return
|
||||
|
||||
initialize()
|
||||
normalize_dir()
|
||||
/obj/machinery/atmospherics/valve/initialize()
|
||||
normalize_dir()
|
||||
|
||||
var/node1_dir
|
||||
var/node2_dir
|
||||
var/node1_dir
|
||||
var/node2_dir
|
||||
|
||||
for(var/direction in cardinal)
|
||||
if(direction&initialize_directions)
|
||||
if (!node1_dir)
|
||||
node1_dir = direction
|
||||
else if (!node2_dir)
|
||||
node2_dir = direction
|
||||
for(var/direction in cardinal)
|
||||
if(direction&initialize_directions)
|
||||
if (!node1_dir)
|
||||
node1_dir = direction
|
||||
else if (!node2_dir)
|
||||
node2_dir = direction
|
||||
|
||||
for(var/obj/machinery/atmospherics/target in get_step(src,node1_dir))
|
||||
if(target.initialize_directions & get_dir(target,src))
|
||||
for(var/obj/machinery/atmospherics/target in get_step(src,node1_dir))
|
||||
if(target.initialize_directions & get_dir(target,src))
|
||||
var/c = check_connect_types(target,src)
|
||||
if (c)
|
||||
target.connected_to = c
|
||||
src.connected_to = c
|
||||
node1 = target
|
||||
break
|
||||
for(var/obj/machinery/atmospherics/target in get_step(src,node2_dir))
|
||||
if(target.initialize_directions & get_dir(target,src))
|
||||
for(var/obj/machinery/atmospherics/target in get_step(src,node2_dir))
|
||||
if(target.initialize_directions & get_dir(target,src))
|
||||
var/c = check_connect_types(target,src)
|
||||
if (c)
|
||||
target.connected_to = c
|
||||
src.connected_to = c
|
||||
node2 = target
|
||||
break
|
||||
|
||||
build_network()
|
||||
|
||||
if(openDuringInit)
|
||||
close()
|
||||
open()
|
||||
openDuringInit = 0
|
||||
|
||||
/*
|
||||
var/connect_directions
|
||||
switch(dir)
|
||||
if(NORTH)
|
||||
connect_directions = NORTH|SOUTH
|
||||
if(SOUTH)
|
||||
connect_directions = NORTH|SOUTH
|
||||
if(EAST)
|
||||
connect_directions = EAST|WEST
|
||||
if(WEST)
|
||||
connect_directions = EAST|WEST
|
||||
else
|
||||
connect_directions = dir
|
||||
|
||||
for(var/direction in cardinal)
|
||||
if(direction&connect_directions)
|
||||
for(var/obj/machinery/atmospherics/target in get_step(src,direction))
|
||||
if(target.initialize_directions & get_dir(target,src))
|
||||
connect_directions &= ~direction
|
||||
node1 = target
|
||||
break
|
||||
if(node1)
|
||||
break
|
||||
|
||||
for(var/direction in cardinal)
|
||||
if(direction&connect_directions)
|
||||
for(var/obj/machinery/atmospherics/target in get_step(src,direction))
|
||||
if(target.initialize_directions & get_dir(target,src))
|
||||
node2 = target
|
||||
break
|
||||
if(node1)
|
||||
break
|
||||
*/
|
||||
build_network()
|
||||
if(!network_node1 && node1)
|
||||
network_node1 = new /datum/pipe_network()
|
||||
network_node1.normal_members += src
|
||||
network_node1.build_network(node1, src)
|
||||
|
||||
update_icon()
|
||||
update_underlays()
|
||||
|
||||
if(!network_node2 && node2)
|
||||
network_node2 = new /datum/pipe_network()
|
||||
network_node2.normal_members += src
|
||||
network_node2.build_network(node2, src)
|
||||
if(openDuringInit)
|
||||
close()
|
||||
open()
|
||||
openDuringInit = 0
|
||||
|
||||
/obj/machinery/atmospherics/valve/build_network()
|
||||
if(!network_node1 && node1)
|
||||
network_node1 = new /datum/pipe_network()
|
||||
network_node1.normal_members += src
|
||||
network_node1.build_network(node1, src)
|
||||
|
||||
return_network(obj/machinery/atmospherics/reference)
|
||||
build_network()
|
||||
if(!network_node2 && node2)
|
||||
network_node2 = new /datum/pipe_network()
|
||||
network_node2.normal_members += src
|
||||
network_node2.build_network(node2, src)
|
||||
|
||||
if(reference==node1)
|
||||
return network_node1
|
||||
/obj/machinery/atmospherics/valve/return_network(obj/machinery/atmospherics/reference)
|
||||
build_network()
|
||||
|
||||
if(reference==node2)
|
||||
return network_node2
|
||||
if(reference==node1)
|
||||
return network_node1
|
||||
|
||||
return null
|
||||
if(reference==node2)
|
||||
return network_node2
|
||||
|
||||
reassign_network(datum/pipe_network/old_network, datum/pipe_network/new_network)
|
||||
if(network_node1 == old_network)
|
||||
network_node1 = new_network
|
||||
if(network_node2 == old_network)
|
||||
network_node2 = new_network
|
||||
return null
|
||||
|
||||
/obj/machinery/atmospherics/valve/reassign_network(datum/pipe_network/old_network, datum/pipe_network/new_network)
|
||||
if(network_node1 == old_network)
|
||||
network_node1 = new_network
|
||||
if(network_node2 == old_network)
|
||||
network_node2 = new_network
|
||||
|
||||
return 1
|
||||
|
||||
/obj/machinery/atmospherics/valve/return_network_air(datum/network/reference)
|
||||
return null
|
||||
|
||||
/obj/machinery/atmospherics/valve/disconnect(obj/machinery/atmospherics/reference)
|
||||
if(reference==node1)
|
||||
del(network_node1)
|
||||
node1 = null
|
||||
|
||||
else if(reference==node2)
|
||||
del(network_node2)
|
||||
node2 = null
|
||||
|
||||
update_underlays()
|
||||
|
||||
return null
|
||||
|
||||
/obj/machinery/atmospherics/valve/digital // can be controlled by AI
|
||||
name = "digital valve"
|
||||
desc = "A digitally controlled valve."
|
||||
icon = 'icons/atmos/digital_valve.dmi'
|
||||
|
||||
var/frequency = 0
|
||||
var/id = null
|
||||
var/datum/radio_frequency/radio_connection
|
||||
|
||||
/obj/machinery/atmospherics/valve/digital/attack_ai(mob/user as mob)
|
||||
return src.attack_hand(user)
|
||||
|
||||
/obj/machinery/atmospherics/valve/digital/attack_hand(mob/user as mob)
|
||||
if(!powered())
|
||||
return
|
||||
if(!src.allowed(user))
|
||||
user << "\red Access denied."
|
||||
return
|
||||
..()
|
||||
|
||||
/obj/machinery/atmospherics/valve/digital/open
|
||||
open = 1
|
||||
icon_state = "map_valve1"
|
||||
|
||||
/obj/machinery/atmospherics/valve/digital/power_change()
|
||||
var/old_stat = stat
|
||||
..()
|
||||
if(old_stat != stat)
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/atmospherics/valve/digital/update_icon()
|
||||
..()
|
||||
if(!powered())
|
||||
icon_state = "valve[open]nopower"
|
||||
|
||||
/obj/machinery/atmospherics/valve/digital/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_ATMOSIA)
|
||||
|
||||
/obj/machinery/atmospherics/valve/digital/initialize()
|
||||
..()
|
||||
if(frequency)
|
||||
set_frequency(frequency)
|
||||
|
||||
/obj/machinery/atmospherics/valve/digital/receive_signal(datum/signal/signal)
|
||||
if(!signal.data["tag"] || (signal.data["tag"] != id))
|
||||
return 0
|
||||
|
||||
switch(signal.data["command"])
|
||||
if("valve_open")
|
||||
if(!open)
|
||||
open()
|
||||
|
||||
if("valve_close")
|
||||
if(open)
|
||||
close()
|
||||
|
||||
if("valve_toggle")
|
||||
if(open)
|
||||
close()
|
||||
else
|
||||
open()
|
||||
|
||||
/obj/machinery/atmospherics/valve/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
|
||||
if (!istype(W, /obj/item/weapon/wrench))
|
||||
return ..()
|
||||
if (istype(src, /obj/machinery/atmospherics/valve/digital))
|
||||
user << "\red You cannot unwrench this [src], it's too complicated."
|
||||
return 1
|
||||
|
||||
return_network_air(datum/network/reference)
|
||||
return null
|
||||
|
||||
disconnect(obj/machinery/atmospherics/reference)
|
||||
if(reference==node1)
|
||||
del(network_node1)
|
||||
node1 = null
|
||||
|
||||
else if(reference==node2)
|
||||
del(network_node2)
|
||||
node2 = null
|
||||
|
||||
return null
|
||||
|
||||
digital // can be controlled by AI
|
||||
name = "digital valve"
|
||||
desc = "A digitally controlled valve."
|
||||
icon = 'icons/obj/atmospherics/digital_valve.dmi'
|
||||
|
||||
attack_ai(mob/user as mob)
|
||||
src.add_hiddenprint(user)
|
||||
return src.attack_hand(user)
|
||||
|
||||
attack_hand(mob/user as mob)
|
||||
if(!src.allowed(user))
|
||||
user << "\red Access denied."
|
||||
return
|
||||
..()
|
||||
|
||||
//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_ATMOSIA)
|
||||
|
||||
var/frequency = 0
|
||||
var/id = null
|
||||
var/datum/radio_frequency/radio_connection
|
||||
|
||||
initialize()
|
||||
..()
|
||||
if(frequency)
|
||||
set_frequency(frequency)
|
||||
|
||||
receive_signal(datum/signal/signal)
|
||||
if(!signal.data["tag"] || (signal.data["tag"] != id))
|
||||
return 0
|
||||
|
||||
switch(signal.data["command"])
|
||||
if("valve_open")
|
||||
if(!open)
|
||||
open()
|
||||
|
||||
if("valve_close")
|
||||
if(open)
|
||||
close()
|
||||
|
||||
if("valve_toggle")
|
||||
if(open)
|
||||
close()
|
||||
else
|
||||
open()
|
||||
|
||||
attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
|
||||
if (!istype(W, /obj/item/weapon/wrench))
|
||||
return ..()
|
||||
if (istype(src,/obj/machinery/atmospherics/valve/digital) && src:frequency)
|
||||
user << "\red You cannot unwrench this [src], it's digitally connected to another device."
|
||||
return 1
|
||||
var/turf/T = src.loc
|
||||
if (level==1 && isturf(T) && T.intact)
|
||||
user << "\red You must remove the plating first."
|
||||
return 1
|
||||
var/datum/gas_mixture/int_air = return_air()
|
||||
var/datum/gas_mixture/env_air = loc.return_air()
|
||||
if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE)
|
||||
user << "\red You cannot unwrench this [src], it too exerted due to internal pressure."
|
||||
add_fingerprint(user)
|
||||
return 1
|
||||
playsound(get_turf(src), 'sound/items/Ratchet.ogg', 50, 1)
|
||||
user << "\blue You begin to unfasten \the [src]..."
|
||||
if (do_after(user, 40))
|
||||
user.visible_message( \
|
||||
"[user] unfastens \the [src].", \
|
||||
"\blue You have unfastened \the [src].", \
|
||||
"You hear ratchet.")
|
||||
new /obj/item/pipe(loc, make_from=src)
|
||||
del(src)
|
||||
var/datum/gas_mixture/int_air = return_air()
|
||||
var/datum/gas_mixture/env_air = loc.return_air()
|
||||
if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE)
|
||||
user << "\red You cannot unwrench this [src], it too exerted due to internal pressure."
|
||||
add_fingerprint(user)
|
||||
return 1
|
||||
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
|
||||
user << "\blue You begin to unfasten \the [src]..."
|
||||
if (do_after(user, 40))
|
||||
user.visible_message( \
|
||||
"[user] unfastens \the [src].", \
|
||||
"\blue You have unfastened \the [src].", \
|
||||
"You hear ratchet.")
|
||||
new /obj/item/pipe(loc, make_from=src)
|
||||
del(src)
|
||||
@@ -1,7 +1,8 @@
|
||||
|
||||
/obj/machinery/atmospherics/pipe/simple/heat_exchanging
|
||||
icon = 'icons/obj/pipes/heat.dmi'
|
||||
icon = 'icons/atmos/heat.dmi'
|
||||
icon_state = "intact"
|
||||
pipe_icon = "hepipe"
|
||||
level = 2
|
||||
var/initialize_directions_he
|
||||
var/surface = 2
|
||||
@@ -9,25 +10,25 @@
|
||||
minimum_temperature_difference = 20
|
||||
thermal_conductivity = OPEN_HEAT_TRANSFER_COEFFICIENT
|
||||
|
||||
process()
|
||||
if(!parent)
|
||||
..()
|
||||
else
|
||||
var/environment_temperature = 0
|
||||
if(istype(loc, /turf/simulated/))
|
||||
if(loc:blocks_air)
|
||||
environment_temperature = loc:temperature
|
||||
else
|
||||
var/datum/gas_mixture/environment = loc.return_air()
|
||||
environment_temperature = environment.temperature
|
||||
var/datum/gas_mixture/pipe_air = return_air()
|
||||
if(abs(environment_temperature-pipe_air.temperature) > minimum_temperature_difference)
|
||||
parent.temperature_interact(loc, volume, thermal_conductivity)
|
||||
/obj/machinery/atmospherics/pipe/simple/heat_exchanging/process()
|
||||
if(!parent)
|
||||
..()
|
||||
else
|
||||
var/environment_temperature = 0
|
||||
if(istype(loc, /turf/simulated/))
|
||||
if(loc:blocks_air)
|
||||
environment_temperature = loc:temperature
|
||||
else
|
||||
parent.radiate_heat(surface, 1)
|
||||
var/datum/gas_mixture/environment = loc.return_air()
|
||||
environment_temperature = environment.temperature
|
||||
var/datum/gas_mixture/pipe_air = return_air()
|
||||
if(abs(environment_temperature-pipe_air.temperature) > minimum_temperature_difference)
|
||||
parent.temperature_interact(loc, volume, thermal_conductivity)
|
||||
else
|
||||
parent.radiate_heat(surface, 1)
|
||||
|
||||
|
||||
// BubbleWrap
|
||||
// BubbleWrap
|
||||
/obj/machinery/atmospherics/pipe/simple/heat_exchanging/New()
|
||||
..()
|
||||
initialize_directions_he = initialize_directions // The auto-detection from /pipe is good enough for a simple HE pipe
|
||||
@@ -53,6 +54,11 @@
|
||||
if(target.initialize_directions_he & get_dir(target,src))
|
||||
node2 = target
|
||||
break
|
||||
|
||||
if(!node1 && !node2)
|
||||
del(src)
|
||||
return
|
||||
|
||||
update_icon()
|
||||
return
|
||||
|
||||
@@ -65,8 +71,9 @@
|
||||
// JUNCTION
|
||||
/////////////////////////////////
|
||||
/obj/machinery/atmospherics/pipe/simple/heat_exchanging/junction
|
||||
icon = 'icons/obj/pipes/junction.dmi'
|
||||
icon = 'icons/atmos/junction.dmi'
|
||||
icon_state = "intact"
|
||||
pipe_icon = "hejunction"
|
||||
level = 2
|
||||
minimum_temperature_difference = 300
|
||||
thermal_conductivity = WALL_HEAT_TRANSFER_COEFFICIENT
|
||||
@@ -89,16 +96,6 @@
|
||||
initialize_directions_he = WEST
|
||||
// BubbleWrap END
|
||||
|
||||
/obj/machinery/atmospherics/pipe/simple/heat_exchanging/junction/update_icon()
|
||||
if(node1&&node2)
|
||||
icon_state = "intact[invisibility ? "-f" : "" ]"
|
||||
else
|
||||
var/have_node1 = node1?1:0
|
||||
var/have_node2 = node2?1:0
|
||||
icon_state = "exposed[have_node1][have_node2]"
|
||||
if(!node1&&!node2)
|
||||
qdel(src)
|
||||
|
||||
/obj/machinery/atmospherics/pipe/simple/heat_exchanging/junction/initialize()
|
||||
for(var/obj/machinery/atmospherics/target in get_step(src,initialize_directions))
|
||||
if(target.initialize_directions & get_dir(target,src))
|
||||
@@ -108,6 +105,10 @@
|
||||
if(target.initialize_directions_he & get_dir(target,src))
|
||||
node2 = target
|
||||
break
|
||||
|
||||
if(!node1 && !node2)
|
||||
del(src)
|
||||
return
|
||||
|
||||
update_icon()
|
||||
return
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
client/verb/discon_pipes()
|
||||
set name = "Show Disconnected Pipes"
|
||||
set category = "Debug"
|
||||
|
||||
for(var/obj/machinery/atmospherics/pipe/simple/P in world)
|
||||
if(!P.node1 || !P.node2)
|
||||
usr << "[P], [P.x], [P.y], [P.z], [P.loc.loc]"
|
||||
|
||||
for(var/obj/machinery/atmospherics/pipe/manifold/P in world)
|
||||
if(!P.node1 || !P.node2 || !P.node3)
|
||||
usr << "[P], [P.x], [P.y], [P.z], [P.loc.loc]"
|
||||
|
||||
for(var/obj/machinery/atmospherics/pipe/manifold4w/P in world)
|
||||
if(!P.node1 || !P.node2 || !P.node3 || !P.node4)
|
||||
usr << "[P], [P.x], [P.y], [P.z], [P.loc.loc]"
|
||||
//With thanks to mini. Check before use, uncheck after. Do Not Use on a live server.
|
||||
+1315
-1194
File diff suppressed because it is too large
Load Diff
@@ -54,7 +54,7 @@
|
||||
var/list/data[0]
|
||||
data["alarm"]=null
|
||||
if(current)
|
||||
data += current.get_nano_data(user,TRUE)
|
||||
data += current.get_nano_data(user,1,emagged)
|
||||
data["alarm"] = "\ref[current]"
|
||||
|
||||
var/list/alarms=list()
|
||||
|
||||
@@ -1,30 +1,30 @@
|
||||
//Mime's Hardsuit
|
||||
/obj/item/clothing/head/helmet/space/mime
|
||||
name = "mime hardsuit helmet"
|
||||
/obj/item/clothing/head/helmet/space/eva/mime
|
||||
name = "mime eva helmet"
|
||||
// icon = 'spaceciv.dmi'
|
||||
desc = "A hardsuit helmet specifically designed for the mime."
|
||||
desc = "An eva helmet specifically designed for the mime."
|
||||
icon_state = "spacemimehelmet"
|
||||
item_state = "spacemimehelmet"
|
||||
|
||||
obj/item/clothing/suit/space/mime
|
||||
name = "mime hardsuit"
|
||||
obj/item/clothing/suit/space/eva/mime
|
||||
name = "mime eva suit"
|
||||
// icon = 'spaceciv.dmi'
|
||||
desc = "A hardsuit specifically designed for the mime."
|
||||
desc = "An EVA suit specifically designed for the mime."
|
||||
icon_state = "spacemime_suit"
|
||||
item_state = "spacemime_items"
|
||||
allowed = list(/obj/item/weapon/tank)
|
||||
|
||||
/obj/item/clothing/head/helmet/space/clown
|
||||
name = "clown hardsuit helmet"
|
||||
/obj/item/clothing/head/helmet/space/eva/clown
|
||||
name = "clown eva helmet"
|
||||
// icon = 'spaceciv.dmi'
|
||||
desc = "A hardsuit helmet specifically designed for the clown. SPESSHONK!"
|
||||
desc = "An EVA helmet specifically designed for the clown. SPESSHONK!"
|
||||
icon_state = "clownhelmet"
|
||||
item_state = "clownhelmet"
|
||||
|
||||
obj/item/clothing/suit/space/clown
|
||||
name = "clown hardsuit"
|
||||
obj/item/clothing/suit/space/eva/clown
|
||||
name = "clown eva suit"
|
||||
// icon = 'spaceciv.dmi'
|
||||
desc = "A hardsuit specifically designed for the clown. SPESSHONK!"
|
||||
desc = "An EVA suit specifically designed for the clown. SPESSHONK!"
|
||||
icon_state = "spaceclown_suit"
|
||||
item_state = "spaceclown_items"
|
||||
allowed = list(/obj/item/weapon/tank)
|
||||
|
||||
@@ -293,7 +293,7 @@
|
||||
return total
|
||||
|
||||
/obj/machinery/lapvend/proc/choose_progs(var/obj/item/weapon/card/id/C)
|
||||
if(access_security in C.access)
|
||||
if(access_security in C.access || access_forensics_lockers in C.access)
|
||||
newlap.spawn_files += (/datum/file/program/secure_data)
|
||||
newlap.spawn_files += (/datum/file/camnet_key)
|
||||
newlap.spawn_files += (/datum/file/camnet_key/researchoutpost)
|
||||
|
||||
@@ -445,3 +445,17 @@ proc/isInSight(var/atom/A, var/atom/B)
|
||||
var/g = mixOneColor(weights, greens)
|
||||
var/b = mixOneColor(weights, blues)
|
||||
return rgb(r,g,b)
|
||||
|
||||
/proc/alone_in_area(var/area/the_area, var/mob/must_be_alone, var/check_type = /mob/living/carbon)
|
||||
var/area/our_area = get_area_master(the_area)
|
||||
for(var/C in living_mob_list)
|
||||
if(!istype(C, check_type))
|
||||
continue
|
||||
if(C == must_be_alone)
|
||||
continue
|
||||
if(our_area == get_area_master(C))
|
||||
return 0
|
||||
return 1
|
||||
|
||||
/proc/MinutesToTicks(var/minutes as num)
|
||||
return minutes * 60 * 10
|
||||
@@ -117,6 +117,10 @@ var/list/sqrtTable = list(1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4,
|
||||
var/d = max - min
|
||||
var/t = Floor((val - min) / d)
|
||||
return val - (t * d)
|
||||
|
||||
/proc/RaiseToPower(num, power)
|
||||
if(!power) return 1
|
||||
return (power-- > 1 ? num * RaiseToPower(num, power) : num)
|
||||
|
||||
//converts a uniform distributed random number into a normal distributed one
|
||||
//since this method produces two random numbers, one is saved for subsequent calls
|
||||
|
||||
@@ -227,6 +227,12 @@ proc/tg_text2list(text, glue=",", assocglue=";")
|
||||
. += copytext(text, last_found, found)
|
||||
last_found = found + delim_len
|
||||
while(found)
|
||||
|
||||
/proc/text2numlist(text, delimiter="\n")
|
||||
var/list/num_list = list()
|
||||
for(var/x in text2list(text, delimiter))
|
||||
num_list += text2num(x)
|
||||
return num_list
|
||||
|
||||
//Splits the text of a file at seperator and returns them in a list.
|
||||
/proc/file2list(filename, seperator="\n")
|
||||
|
||||
+11
-9
@@ -31,11 +31,11 @@
|
||||
if(client.buildmode) // comes after object.Click to allow buildmode gui objects to be clicked
|
||||
build_click(src, client.buildmode, params, A)
|
||||
return
|
||||
|
||||
|
||||
if(control_disabled || stat)
|
||||
return
|
||||
|
||||
if(alienAI)
|
||||
if(alienAI)
|
||||
return
|
||||
|
||||
var/list/modifiers = params2list(params)
|
||||
@@ -58,7 +58,7 @@
|
||||
CtrlClickOn(A)
|
||||
return
|
||||
|
||||
if(world.time <= next_move)
|
||||
if(world.time <= next_move)
|
||||
return
|
||||
next_move = world.time + 9
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
if(waypoint_mode)
|
||||
set_waypoint(A)
|
||||
waypoint_mode = 0
|
||||
return
|
||||
return
|
||||
/*
|
||||
AI restrained() currently does nothing
|
||||
if(restrained())
|
||||
@@ -122,10 +122,10 @@
|
||||
if(user.client)
|
||||
examine()
|
||||
return
|
||||
|
||||
/atom/proc/AIAltShiftClick()
|
||||
|
||||
/atom/proc/AIAltShiftClick()
|
||||
return
|
||||
|
||||
|
||||
/obj/machinery/door/airlock/AIAltShiftClick() // Sets/Unsets Emergency Access Override
|
||||
if(emagged)
|
||||
return
|
||||
@@ -134,7 +134,7 @@
|
||||
else
|
||||
Topic("aiDisable=11", list("aiDisable"="11"), 1)
|
||||
return
|
||||
|
||||
|
||||
/atom/proc/AIShiftClick()
|
||||
return
|
||||
|
||||
@@ -148,7 +148,7 @@
|
||||
/atom/proc/AICtrlClick(var/mob/living/silicon/ai/user)
|
||||
if(user.holo)
|
||||
var/obj/machinery/hologram/holopad/H = user.holo
|
||||
H.face_atom(src)
|
||||
H.face_atom(src)
|
||||
return
|
||||
|
||||
/obj/machinery/door/airlock/AICtrlClick() // Bolts doors
|
||||
@@ -173,9 +173,11 @@
|
||||
if(!secondsElectrified)
|
||||
// permanent shock
|
||||
Topic("aiEnable=6", list("aiEnable"="6"), 1) // 1 meaning no window (consistency!)
|
||||
use_log += text("\[[time_stamp()]\] <font color='red'>[usr.name] ([usr.ckey]) electrified [src].</font>")
|
||||
else
|
||||
// disable/6 is not in Topic; disable/5 disables both temporary and permanent shock
|
||||
Topic("aiDisable=5", list("aiDisable"="5"), 1)
|
||||
use_log += text("\[[time_stamp()]\] <font color='orange'>[usr.name] ([usr.ckey]) toggled turned off the [src]'s electrification.</font>")
|
||||
return
|
||||
|
||||
/obj/machinery/turretid/AIAltClick() //toggles lethal on turrets
|
||||
|
||||
@@ -1,344 +1,344 @@
|
||||
/*
|
||||
HOW IT WORKS
|
||||
|
||||
The radio_controller is a global object maintaining all radio transmissions, think about it as about "ether".
|
||||
Note that walkie-talkie, intercoms and headsets handle transmission using nonstandard way.
|
||||
procs:
|
||||
|
||||
add_object(obj/device as obj, var/new_frequency as num, var/filter as text|null = null)
|
||||
Adds listening object.
|
||||
parameters:
|
||||
device - device receiving signals, must have proc receive_signal (see description below).
|
||||
one device may listen several frequencies, but not same frequency twice.
|
||||
new_frequency - see possibly frequencies below;
|
||||
filter - thing for optimization. Optional, but recommended.
|
||||
All filters should be consolidated in this file, see defines later.
|
||||
Device without listening filter will receive all signals (on specified frequency).
|
||||
Device with filter will receive any signals sent without filter.
|
||||
Device with filter will not receive any signals sent with different filter.
|
||||
returns:
|
||||
Reference to frequency object.
|
||||
|
||||
remove_object (obj/device, old_frequency)
|
||||
Obliviously, after calling this proc, device will not receive any signals on old_frequency.
|
||||
Other frequencies will left unaffected.
|
||||
|
||||
return_frequency(var/frequency as num)
|
||||
returns:
|
||||
Reference to frequency object. Use it if you need to send and do not need to listen.
|
||||
|
||||
radio_frequency is a global object maintaining list of devices that listening specific frequency.
|
||||
procs:
|
||||
|
||||
post_signal(obj/source as obj|null, datum/signal/signal, var/filter as text|null = null, var/range as num|null = null)
|
||||
Sends signal to all devices that wants such signal.
|
||||
parameters:
|
||||
source - object, emitted signal. Usually, devices will not receive their own signals.
|
||||
signal - see description below.
|
||||
filter - described above.
|
||||
range - radius of regular byond's square circle on that z-level. null means everywhere, on all z-levels.
|
||||
|
||||
obj/proc/receive_signal(datum/signal/signal, var/receive_method as num, var/receive_param)
|
||||
Handler from received signals. By default does nothing. Define your own for your object.
|
||||
Avoid of sending signals directly from this proc, use spawn(-1). Do not use sleep() here please.
|
||||
parameters:
|
||||
signal - see description below. Extract all needed data from the signal before doing sleep(), spawn() or return!
|
||||
receive_method - may be TRANSMISSION_WIRE or TRANSMISSION_RADIO.
|
||||
TRANSMISSION_WIRE is currently unused.
|
||||
receive_param - for TRANSMISSION_RADIO here comes frequency.
|
||||
|
||||
datum/signal
|
||||
vars:
|
||||
source
|
||||
an object that emitted signal. Used for debug and bearing.
|
||||
data
|
||||
list with transmitting data. Usual use pattern:
|
||||
data["msg"] = "hello world"
|
||||
encryption
|
||||
Some number symbolizing "encryption key".
|
||||
Note that game actually do not use any cryptography here.
|
||||
If receiving object don't know right key, it must ignore encrypted signal in its receive_signal.
|
||||
|
||||
*/
|
||||
|
||||
/* the radio controller is a confusing piece of shit and didnt work
|
||||
so i made radios not use the radio controller.
|
||||
*/
|
||||
var/list/all_radios = list()
|
||||
|
||||
/proc/add_radio(var/obj/item/radio, freq)
|
||||
if(!freq || !radio)
|
||||
return
|
||||
if(!all_radios["[freq]"])
|
||||
all_radios["[freq]"] = list(radio)
|
||||
return freq
|
||||
|
||||
all_radios["[freq]"] |= radio
|
||||
return freq
|
||||
|
||||
/proc/remove_radio(var/obj/item/radio, freq)
|
||||
if(!freq || !radio)
|
||||
return
|
||||
if(!all_radios["[freq]"])
|
||||
return
|
||||
|
||||
all_radios["[freq]"] -= radio
|
||||
|
||||
/proc/remove_radio_all(var/obj/item/radio)
|
||||
for(var/freq in all_radios)
|
||||
all_radios["[freq]"] -= radio
|
||||
|
||||
/*
|
||||
Frequency range: 1200 to 1600
|
||||
Radiochat range: 1441 to 1489 (most devices refuse to be tune to other frequency, even during mapmaking)
|
||||
|
||||
Radio:
|
||||
1459 - standard radio chat
|
||||
1351 - Science
|
||||
1353 - Command
|
||||
1355 - Medical
|
||||
1357 - Engineering
|
||||
1359 - Security
|
||||
1441 - death squad
|
||||
1443 - Confession Intercom
|
||||
1347 - Cargo techs
|
||||
1349 - Service
|
||||
|
||||
Devices:
|
||||
1451 - tracking implant
|
||||
1457 - RSD default
|
||||
|
||||
On the map:
|
||||
1311 for prison shuttle console (in fact, it is not used)
|
||||
1435 for status displays
|
||||
1437 for atmospherics/fire alerts
|
||||
1439 for engine components
|
||||
1439 for air pumps, air scrubbers, atmo control
|
||||
1441 for atmospherics - supply tanks
|
||||
1443 for atmospherics - distribution loop/mixed air tank
|
||||
1445 for bot nav beacons
|
||||
1447 for mulebot, secbot and ed209 control
|
||||
1449 for airlock controls, electropack, magnets
|
||||
1451 for toxin lab access
|
||||
1453 for engineering access
|
||||
1455 for AI access
|
||||
*/
|
||||
|
||||
var/list/radiochannels = list(
|
||||
"Common" = 1459,
|
||||
"Science" = 1351,
|
||||
"Command" = 1353,
|
||||
"Medical" = 1355,
|
||||
"Engineering" = 1357,
|
||||
"Security" = 1359,
|
||||
"Response Team" = 1443,
|
||||
"Deathsquad" = 1441,
|
||||
"Syndicate" = 1213,
|
||||
"Supply" = 1347,
|
||||
"Service" = 1349,
|
||||
"AI Private" = 1447
|
||||
)
|
||||
//depenging helpers
|
||||
var/list/DEPT_FREQS = list(1351, 1355, 1357, 1359, 1213, 1443, 1441, 1347, 1349)
|
||||
|
||||
// central command channels, i.e deathsquid & response teams
|
||||
var/list/CENT_FREQS = list(1441, 1443)
|
||||
|
||||
var/const/COMM_FREQ = 1353 //command, colored gold in chat window
|
||||
var/const/SYND_FREQ = 1213
|
||||
|
||||
// department channels
|
||||
var/const/SEC_FREQ = 1359
|
||||
var/const/ENG_FREQ = 1357
|
||||
var/const/SCI_FREQ = 1351
|
||||
var/const/MED_FREQ = 1355
|
||||
var/const/SUP_FREQ = 1347
|
||||
var/const/SRV_FREQ = 1349
|
||||
|
||||
// other channels
|
||||
var/const/AIPRIV_FREQ = 1447
|
||||
|
||||
#define TRANSMISSION_WIRE 0
|
||||
#define TRANSMISSION_RADIO 1
|
||||
|
||||
/* filters */
|
||||
var/const/RADIO_TO_AIRALARM = "1"
|
||||
var/const/RADIO_FROM_AIRALARM = "2"
|
||||
var/const/RADIO_CHAT = "3"
|
||||
var/const/RADIO_ATMOSIA = "4"
|
||||
var/const/RADIO_NAVBEACONS = "5"
|
||||
var/const/RADIO_AIRLOCK = "6"
|
||||
var/const/RADIO_SECBOT = "7"
|
||||
var/const/RADIO_MULEBOT = "8"
|
||||
var/const/RADIO_MAGNETS = "9"
|
||||
var/const/RADIO_CLEANBOT = "10"
|
||||
var/const/RADIO_FLOORBOT = "11"
|
||||
var/const/RADIO_MEDBOT = "12"
|
||||
|
||||
var/global/datum/controller/radio/radio_controller
|
||||
|
||||
/hook/startup/proc/createRadioController()
|
||||
radio_controller = new /datum/controller/radio()
|
||||
return 1
|
||||
|
||||
datum/controller/radio
|
||||
var/list/datum/radio_frequency/frequencies = list()
|
||||
|
||||
proc/add_object(obj/device as obj, var/new_frequency as num, var/filter = null as text|null)
|
||||
var/f_text = num2text(new_frequency)
|
||||
var/datum/radio_frequency/frequency = frequencies[f_text]
|
||||
|
||||
if(!frequency)
|
||||
frequency = new
|
||||
frequency.frequency = new_frequency
|
||||
frequencies[f_text] = frequency
|
||||
|
||||
frequency.add_listener(device, filter)
|
||||
return frequency
|
||||
|
||||
proc/remove_object(obj/device, old_frequency)
|
||||
var/f_text = num2text(old_frequency)
|
||||
var/datum/radio_frequency/frequency = frequencies[f_text]
|
||||
|
||||
if(frequency)
|
||||
frequency.remove_listener(device)
|
||||
|
||||
if(frequency.devices.len == 0)
|
||||
del(frequency)
|
||||
frequencies -= f_text
|
||||
|
||||
return 1
|
||||
|
||||
proc/return_frequency(var/new_frequency as num)
|
||||
var/f_text = num2text(new_frequency)
|
||||
var/datum/radio_frequency/frequency = frequencies[f_text]
|
||||
|
||||
if(!frequency)
|
||||
frequency = new
|
||||
frequency.frequency = new_frequency
|
||||
frequencies[f_text] = frequency
|
||||
|
||||
return frequency
|
||||
|
||||
datum/radio_frequency
|
||||
var/frequency as num
|
||||
var/list/list/obj/devices = list()
|
||||
|
||||
proc
|
||||
post_signal(obj/source as obj|null, datum/signal/signal, var/filter = null as text|null, var/range = null as num|null)
|
||||
//log_admin("DEBUG \[[world.timeofday]\]: post_signal {source=\"[source]\", [signal.debug_print()], filter=[filter]}")
|
||||
// var/N_f=0
|
||||
// var/N_nf=0
|
||||
// var/Nt=0
|
||||
var/turf/start_point
|
||||
if(range)
|
||||
start_point = get_turf(source)
|
||||
if(!start_point)
|
||||
del(signal)
|
||||
return 0
|
||||
if (filter) //here goes some copypasta. It is for optimisation. -rastaf0
|
||||
for(var/obj/device in devices[filter])
|
||||
if(device == source)
|
||||
continue
|
||||
if(range)
|
||||
var/turf/end_point = get_turf(device)
|
||||
if(!end_point)
|
||||
continue
|
||||
//if(max(abs(start_point.x-end_point.x), abs(start_point.y-end_point.y)) <= range)
|
||||
if(start_point.z!=end_point.z || get_dist(start_point, end_point) > range)
|
||||
continue
|
||||
device.receive_signal(signal, TRANSMISSION_RADIO, frequency)
|
||||
for(var/obj/device in devices["_default"])
|
||||
if(device == source)
|
||||
continue
|
||||
if(range)
|
||||
var/turf/end_point = get_turf(device)
|
||||
if(!end_point)
|
||||
continue
|
||||
//if(max(abs(start_point.x-end_point.x), abs(start_point.y-end_point.y)) <= range)
|
||||
if(start_point.z!=end_point.z || get_dist(start_point, end_point) > range)
|
||||
continue
|
||||
device.receive_signal(signal, TRANSMISSION_RADIO, frequency)
|
||||
// N_f++
|
||||
else
|
||||
for (var/next_filter in devices)
|
||||
// var/list/obj/DDD = devices[next_filter]
|
||||
// Nt+=DDD.len
|
||||
for(var/obj/device in devices[next_filter])
|
||||
if(device == source)
|
||||
continue
|
||||
if(range)
|
||||
var/turf/end_point = get_turf(device)
|
||||
if(!end_point)
|
||||
continue
|
||||
//if(max(abs(start_point.x-end_point.x), abs(start_point.y-end_point.y)) <= range)
|
||||
if(start_point.z!=end_point.z || get_dist(start_point, end_point) > range)
|
||||
continue
|
||||
device.receive_signal(signal, TRANSMISSION_RADIO, frequency)
|
||||
// N_nf++
|
||||
|
||||
// log_admin("DEBUG: post_signal(source=[source] ([source.x], [source.y], [source.z]),filter=[filter]) frequency=[frequency], N_f=[N_f], N_nf=[N_nf]")
|
||||
|
||||
|
||||
// del(signal)
|
||||
|
||||
add_listener(obj/device as obj, var/filter as text|null)
|
||||
if (!filter)
|
||||
filter = "_default"
|
||||
//log_admin("add_listener(device=[device],filter=[filter]) frequency=[frequency]")
|
||||
var/list/obj/devices_line = devices[filter]
|
||||
if (!devices_line)
|
||||
devices_line = new
|
||||
devices[filter] = devices_line
|
||||
devices_line+=device
|
||||
// var/list/obj/devices_line___ = devices[filter_str]
|
||||
// var/l = devices_line___.len
|
||||
//log_admin("DEBUG: devices_line.len=[devices_line.len]")
|
||||
//log_admin("DEBUG: devices(filter_str).len=[l]")
|
||||
|
||||
remove_listener(obj/device)
|
||||
for (var/devices_filter in devices)
|
||||
var/list/devices_line = devices[devices_filter]
|
||||
devices_line-=device
|
||||
while (null in devices_line)
|
||||
devices_line -= null
|
||||
if (devices_line.len==0)
|
||||
devices -= devices_filter
|
||||
del(devices_line)
|
||||
|
||||
|
||||
obj/proc
|
||||
receive_signal(datum/signal/signal, receive_method, receive_param)
|
||||
return null
|
||||
|
||||
datum/signal
|
||||
var/obj/source
|
||||
|
||||
var/transmission_method = 0
|
||||
//0 = wire
|
||||
//1 = radio transmission
|
||||
//2 = subspace transmission
|
||||
|
||||
var/data = list()
|
||||
var/encryption
|
||||
|
||||
var/frequency = 0
|
||||
|
||||
proc/copy_from(datum/signal/model)
|
||||
source = model.source
|
||||
transmission_method = model.transmission_method
|
||||
data = model.data
|
||||
encryption = model.encryption
|
||||
frequency = model.frequency
|
||||
|
||||
proc/debug_print()
|
||||
if (source)
|
||||
. = "signal = {source = '[source]' ([source:x],[source:y],[source:z])\n"
|
||||
else
|
||||
. = "signal = {source = '[source]' ()\n"
|
||||
for (var/i in data)
|
||||
. += "data\[\"[i]\"\] = \"[data[i]]\"\n"
|
||||
if(islist(data[i]))
|
||||
var/list/L = data[i]
|
||||
for(var/t in L)
|
||||
. += "data\[\"[i]\"\] list has: [t]"
|
||||
/*
|
||||
HOW IT WORKS
|
||||
|
||||
The radio_controller is a global object maintaining all radio transmissions, think about it as about "ether".
|
||||
Note that walkie-talkie, intercoms and headsets handle transmission using nonstandard way.
|
||||
procs:
|
||||
|
||||
add_object(obj/device as obj, var/new_frequency as num, var/filter as text|null = null)
|
||||
Adds listening object.
|
||||
parameters:
|
||||
device - device receiving signals, must have proc receive_signal (see description below).
|
||||
one device may listen several frequencies, but not same frequency twice.
|
||||
new_frequency - see possibly frequencies below;
|
||||
filter - thing for optimization. Optional, but recommended.
|
||||
All filters should be consolidated in this file, see defines later.
|
||||
Device without listening filter will receive all signals (on specified frequency).
|
||||
Device with filter will receive any signals sent without filter.
|
||||
Device with filter will not receive any signals sent with different filter.
|
||||
returns:
|
||||
Reference to frequency object.
|
||||
|
||||
remove_object (obj/device, old_frequency)
|
||||
Obliviously, after calling this proc, device will not receive any signals on old_frequency.
|
||||
Other frequencies will left unaffected.
|
||||
|
||||
return_frequency(var/frequency as num)
|
||||
returns:
|
||||
Reference to frequency object. Use it if you need to send and do not need to listen.
|
||||
|
||||
radio_frequency is a global object maintaining list of devices that listening specific frequency.
|
||||
procs:
|
||||
|
||||
post_signal(obj/source as obj|null, datum/signal/signal, var/filter as text|null = null, var/range as num|null = null)
|
||||
Sends signal to all devices that wants such signal.
|
||||
parameters:
|
||||
source - object, emitted signal. Usually, devices will not receive their own signals.
|
||||
signal - see description below.
|
||||
filter - described above.
|
||||
range - radius of regular byond's square circle on that z-level. null means everywhere, on all z-levels.
|
||||
|
||||
obj/proc/receive_signal(datum/signal/signal, var/receive_method as num, var/receive_param)
|
||||
Handler from received signals. By default does nothing. Define your own for your object.
|
||||
Avoid of sending signals directly from this proc, use spawn(-1). Do not use sleep() here please.
|
||||
parameters:
|
||||
signal - see description below. Extract all needed data from the signal before doing sleep(), spawn() or return!
|
||||
receive_method - may be TRANSMISSION_WIRE or TRANSMISSION_RADIO.
|
||||
TRANSMISSION_WIRE is currently unused.
|
||||
receive_param - for TRANSMISSION_RADIO here comes frequency.
|
||||
|
||||
datum/signal
|
||||
vars:
|
||||
source
|
||||
an object that emitted signal. Used for debug and bearing.
|
||||
data
|
||||
list with transmitting data. Usual use pattern:
|
||||
data["msg"] = "hello world"
|
||||
encryption
|
||||
Some number symbolizing "encryption key".
|
||||
Note that game actually do not use any cryptography here.
|
||||
If receiving object don't know right key, it must ignore encrypted signal in its receive_signal.
|
||||
|
||||
*/
|
||||
|
||||
/* the radio controller is a confusing piece of shit and didnt work
|
||||
so i made radios not use the radio controller.
|
||||
*/
|
||||
var/list/all_radios = list()
|
||||
|
||||
/proc/add_radio(var/obj/item/radio, freq)
|
||||
if(!freq || !radio)
|
||||
return
|
||||
if(!all_radios["[freq]"])
|
||||
all_radios["[freq]"] = list(radio)
|
||||
return freq
|
||||
|
||||
all_radios["[freq]"] |= radio
|
||||
return freq
|
||||
|
||||
/proc/remove_radio(var/obj/item/radio, freq)
|
||||
if(!freq || !radio)
|
||||
return
|
||||
if(!all_radios["[freq]"])
|
||||
return
|
||||
|
||||
all_radios["[freq]"] -= radio
|
||||
|
||||
/proc/remove_radio_all(var/obj/item/radio)
|
||||
for(var/freq in all_radios)
|
||||
all_radios["[freq]"] -= radio
|
||||
|
||||
/*
|
||||
Frequency range: 1200 to 1600
|
||||
Radiochat range: 1441 to 1489 (most devices refuse to be tune to other frequency, even during mapmaking)
|
||||
|
||||
Radio:
|
||||
1459 - standard radio chat
|
||||
1351 - Science
|
||||
1353 - Command
|
||||
1355 - Medical
|
||||
1357 - Engineering
|
||||
1359 - Security
|
||||
1441 - death squad
|
||||
1443 - Confession Intercom
|
||||
1347 - Cargo techs
|
||||
1349 - Service
|
||||
|
||||
Devices:
|
||||
1451 - tracking implant
|
||||
1457 - RSD default
|
||||
|
||||
On the map:
|
||||
1311 for prison shuttle console (in fact, it is not used)
|
||||
1435 for status displays
|
||||
1437 for atmospherics/fire alerts
|
||||
1439 for engine components
|
||||
1439 for air pumps, air scrubbers, atmo control
|
||||
1441 for atmospherics - supply tanks
|
||||
1443 for atmospherics - distribution loop/mixed air tank
|
||||
1445 for bot nav beacons
|
||||
1447 for mulebot, secbot and ed209 control
|
||||
1449 for airlock controls, electropack, magnets
|
||||
1451 for toxin lab access
|
||||
1453 for engineering access
|
||||
1455 for AI access
|
||||
*/
|
||||
|
||||
var/list/radiochannels = list(
|
||||
"Common" = 1459,
|
||||
"Science" = 1351,
|
||||
"Command" = 1353,
|
||||
"Medical" = 1355,
|
||||
"Engineering" = 1357,
|
||||
"Security" = 1359,
|
||||
"Response Team" = 1443,
|
||||
"Deathsquad" = 1441,
|
||||
"Syndicate" = 1213,
|
||||
"Supply" = 1347,
|
||||
"Service" = 1349,
|
||||
"AI Private" = 1447
|
||||
)
|
||||
//depenging helpers
|
||||
var/list/DEPT_FREQS = list(1351, 1355, 1357, 1359, 1213, 1443, 1441, 1347, 1349)
|
||||
|
||||
// central command channels, i.e deathsquid & response teams
|
||||
var/list/CENT_FREQS = list(1441, 1443)
|
||||
|
||||
var/const/COMM_FREQ = 1353 //command, colored gold in chat window
|
||||
var/const/SYND_FREQ = 1213
|
||||
|
||||
// department channels
|
||||
var/const/SEC_FREQ = 1359
|
||||
var/const/ENG_FREQ = 1357
|
||||
var/const/SCI_FREQ = 1351
|
||||
var/const/MED_FREQ = 1355
|
||||
var/const/SUP_FREQ = 1347
|
||||
var/const/SRV_FREQ = 1349
|
||||
|
||||
// other channels
|
||||
var/const/AIPRIV_FREQ = 1447
|
||||
|
||||
#define TRANSMISSION_WIRE 0
|
||||
#define TRANSMISSION_RADIO 1
|
||||
|
||||
/* filters */
|
||||
var/const/RADIO_TO_AIRALARM = "1"
|
||||
var/const/RADIO_FROM_AIRALARM = "2"
|
||||
var/const/RADIO_CHAT = "3"
|
||||
var/const/RADIO_ATMOSIA = "4"
|
||||
var/const/RADIO_NAVBEACONS = "5"
|
||||
var/const/RADIO_AIRLOCK = "6"
|
||||
var/const/RADIO_SECBOT = "7"
|
||||
var/const/RADIO_MULEBOT = "8"
|
||||
var/const/RADIO_MAGNETS = "9"
|
||||
var/const/RADIO_CLEANBOT = "10"
|
||||
var/const/RADIO_FLOORBOT = "11"
|
||||
var/const/RADIO_MEDBOT = "12"
|
||||
|
||||
var/global/datum/controller/radio/radio_controller
|
||||
|
||||
/hook/startup/proc/createRadioController()
|
||||
radio_controller = new /datum/controller/radio()
|
||||
return 1
|
||||
|
||||
datum/controller/radio
|
||||
var/list/datum/radio_frequency/frequencies = list()
|
||||
|
||||
proc/add_object(obj/device as obj, var/new_frequency as num, var/filter = null as text|null)
|
||||
var/f_text = num2text(new_frequency)
|
||||
var/datum/radio_frequency/frequency = frequencies[f_text]
|
||||
|
||||
if(!frequency)
|
||||
frequency = new
|
||||
frequency.frequency = new_frequency
|
||||
frequencies[f_text] = frequency
|
||||
|
||||
frequency.add_listener(device, filter)
|
||||
return frequency
|
||||
|
||||
proc/remove_object(obj/device, old_frequency)
|
||||
var/f_text = num2text(old_frequency)
|
||||
var/datum/radio_frequency/frequency = frequencies[f_text]
|
||||
|
||||
if(frequency)
|
||||
frequency.remove_listener(device)
|
||||
|
||||
if(frequency.devices.len == 0)
|
||||
del(frequency)
|
||||
frequencies -= f_text
|
||||
|
||||
return 1
|
||||
|
||||
proc/return_frequency(var/new_frequency as num)
|
||||
var/f_text = num2text(new_frequency)
|
||||
var/datum/radio_frequency/frequency = frequencies[f_text]
|
||||
|
||||
if(!frequency)
|
||||
frequency = new
|
||||
frequency.frequency = new_frequency
|
||||
frequencies[f_text] = frequency
|
||||
|
||||
return frequency
|
||||
|
||||
datum/radio_frequency
|
||||
var/frequency as num
|
||||
var/list/list/obj/devices = list()
|
||||
|
||||
proc
|
||||
post_signal(obj/source as obj|null, datum/signal/signal, var/filter = null as text|null, var/range = null as num|null)
|
||||
//log_admin("DEBUG \[[world.timeofday]\]: post_signal {source=\"[source]\", [signal.debug_print()], filter=[filter]}")
|
||||
// var/N_f=0
|
||||
// var/N_nf=0
|
||||
// var/Nt=0
|
||||
var/turf/start_point
|
||||
if(range)
|
||||
start_point = get_turf(source)
|
||||
if(!start_point)
|
||||
del(signal)
|
||||
return 0
|
||||
if (filter) //here goes some copypasta. It is for optimisation. -rastaf0
|
||||
for(var/obj/device in devices[filter])
|
||||
if(device == source)
|
||||
continue
|
||||
if(range)
|
||||
var/turf/end_point = get_turf(device)
|
||||
if(!end_point)
|
||||
continue
|
||||
//if(max(abs(start_point.x-end_point.x), abs(start_point.y-end_point.y)) <= range)
|
||||
if(start_point.z!=end_point.z || get_dist(start_point, end_point) > range)
|
||||
continue
|
||||
device.receive_signal(signal, TRANSMISSION_RADIO, frequency)
|
||||
for(var/obj/device in devices["_default"])
|
||||
if(device == source)
|
||||
continue
|
||||
if(range)
|
||||
var/turf/end_point = get_turf(device)
|
||||
if(!end_point)
|
||||
continue
|
||||
//if(max(abs(start_point.x-end_point.x), abs(start_point.y-end_point.y)) <= range)
|
||||
if(start_point.z!=end_point.z || get_dist(start_point, end_point) > range)
|
||||
continue
|
||||
device.receive_signal(signal, TRANSMISSION_RADIO, frequency)
|
||||
// N_f++
|
||||
else
|
||||
for (var/next_filter in devices)
|
||||
// var/list/obj/DDD = devices[next_filter]
|
||||
// Nt+=DDD.len
|
||||
for(var/obj/device in devices[next_filter])
|
||||
if(device == source)
|
||||
continue
|
||||
if(range)
|
||||
var/turf/end_point = get_turf(device)
|
||||
if(!end_point)
|
||||
continue
|
||||
//if(max(abs(start_point.x-end_point.x), abs(start_point.y-end_point.y)) <= range)
|
||||
if(start_point.z!=end_point.z || get_dist(start_point, end_point) > range)
|
||||
continue
|
||||
device.receive_signal(signal, TRANSMISSION_RADIO, frequency)
|
||||
// N_nf++
|
||||
|
||||
// log_admin("DEBUG: post_signal(source=[source] ([source.x], [source.y], [source.z]),filter=[filter]) frequency=[frequency], N_f=[N_f], N_nf=[N_nf]")
|
||||
|
||||
|
||||
// del(signal)
|
||||
|
||||
add_listener(obj/device as obj, var/filter as text|null)
|
||||
if (!filter)
|
||||
filter = "_default"
|
||||
//log_admin("add_listener(device=[device],filter=[filter]) frequency=[frequency]")
|
||||
var/list/obj/devices_line = devices[filter]
|
||||
if (!devices_line)
|
||||
devices_line = new
|
||||
devices[filter] = devices_line
|
||||
devices_line+=device
|
||||
// var/list/obj/devices_line___ = devices[filter_str]
|
||||
// var/l = devices_line___.len
|
||||
//log_admin("DEBUG: devices_line.len=[devices_line.len]")
|
||||
//log_admin("DEBUG: devices(filter_str).len=[l]")
|
||||
|
||||
remove_listener(obj/device)
|
||||
for (var/devices_filter in devices)
|
||||
var/list/devices_line = devices[devices_filter]
|
||||
devices_line-=device
|
||||
while (null in devices_line)
|
||||
devices_line -= null
|
||||
if (devices_line.len==0)
|
||||
devices -= devices_filter
|
||||
del(devices_line)
|
||||
|
||||
|
||||
obj/proc
|
||||
receive_signal(datum/signal/signal, receive_method, receive_param)
|
||||
return null
|
||||
|
||||
datum/signal
|
||||
var/obj/source
|
||||
|
||||
var/transmission_method = 0
|
||||
//0 = wire
|
||||
//1 = radio transmission
|
||||
//2 = subspace transmission
|
||||
|
||||
var/data = list()
|
||||
var/encryption
|
||||
|
||||
var/frequency = 0
|
||||
|
||||
proc/copy_from(datum/signal/model)
|
||||
source = model.source
|
||||
transmission_method = model.transmission_method
|
||||
data = model.data
|
||||
encryption = model.encryption
|
||||
frequency = model.frequency
|
||||
|
||||
proc/debug_print()
|
||||
if (source)
|
||||
. = "signal = {source = '[source]' ([source:x],[source:y],[source:z])\n"
|
||||
else
|
||||
. = "signal = {source = '[source]' ()\n"
|
||||
for (var/i in data)
|
||||
. += "data\[\"[i]\"\] = \"[data[i]]\"\n"
|
||||
if(islist(data[i]))
|
||||
var/list/L = data[i]
|
||||
for(var/t in L)
|
||||
. += "data\[\"[i]\"\] list has: [t]"
|
||||
@@ -81,17 +81,6 @@
|
||||
|
||||
var/media_base_url = "http://nanotrasen.se/media" // http://ss13.nexisonline.net/media
|
||||
|
||||
//Alert level description
|
||||
var/alert_desc_green = "All threats to the station have passed. Security may not have weapons visible, privacy laws are once again fully enforced."
|
||||
var/alert_desc_blue_upto = "The station has received reliable information about possible hostile activity on the station. Security staff may have weapons visible, random searches are permitted."
|
||||
var/alert_desc_blue_downto = "The immediate threat has passed. Security may no longer have weapons drawn at all times, but may continue to have them visible. Random searches are still allowed."
|
||||
var/alert_desc_red_upto = "There is an immediate serious threat to the station. Security may have weapons unholstered at all times. Random searches are allowed and advised."
|
||||
var/alert_desc_red_downto = "The self-destruct mechanism has been deactivated, there is still however an immediate serious threat to the station. Security may have weapons unholstered at all times, random searches are allowed and advised."
|
||||
var/alert_desc_delta = "The station's self-destruct mechanism has been engaged. All crew are instructed to obey all instructions given by heads of staff. Any violations of these orders can be punished by death. This is not a drill."
|
||||
var/alert_desc_epsilon = "Security level EPSILON reached. Consider all contracts terminated."
|
||||
var/alert_desc_gamma = "GAMMA Security level has been set by Centcom, Security is to have weapons at all times, and all civilians are to seek their nearest head for transportation to a safe location. GAMMA Armory unlocked for security personnel."
|
||||
|
||||
|
||||
var/forbid_singulo_possession = 0
|
||||
|
||||
//game_options.txt configs
|
||||
@@ -144,6 +133,19 @@
|
||||
var/python_path = "" //Path to the python executable. Defaults to "python" on windows and "/usr/bin/env python2" on unix
|
||||
|
||||
var/default_laws = 0 //Controls what laws the AI spawns with.
|
||||
|
||||
var/const/minutes_to_ticks = 60 * 10
|
||||
// Event settings
|
||||
var/expected_round_length = 60 * 2 * minutes_to_ticks // 2 hours
|
||||
// If the first delay has a custom start time
|
||||
// No custom time, no custom time, between 80 to 100 minutes respectively.
|
||||
var/list/event_first_run = list(EVENT_LEVEL_MUNDANE = null, EVENT_LEVEL_MODERATE = null, EVENT_LEVEL_MAJOR = list("lower" = 48000, "upper" = 60000))
|
||||
// The lowest delay until next event
|
||||
// 10, 30, 50 minutes respectively
|
||||
var/list/event_delay_lower = list(EVENT_LEVEL_MUNDANE = 6000, EVENT_LEVEL_MODERATE = 18000, EVENT_LEVEL_MAJOR = 30000)
|
||||
// The upper delay until next event
|
||||
// 15, 45, 70 minutes respectively
|
||||
var/list/event_delay_upper = list(EVENT_LEVEL_MUNDANE = 9000, EVENT_LEVEL_MODERATE = 27000, EVENT_LEVEL_MAJOR = 42000)
|
||||
|
||||
/datum/configuration/New()
|
||||
var/list/L = typesof(/datum/game_mode) - /datum/game_mode
|
||||
@@ -358,30 +360,6 @@
|
||||
if("load_jobs_from_txt")
|
||||
load_jobs_from_txt = 1
|
||||
|
||||
if("alert_red_upto")
|
||||
config.alert_desc_red_upto = value
|
||||
|
||||
if("alert_red_downto")
|
||||
config.alert_desc_red_downto = value
|
||||
|
||||
if("alert_blue_downto")
|
||||
config.alert_desc_blue_downto = value
|
||||
|
||||
if("alert_blue_upto")
|
||||
config.alert_desc_blue_upto = value
|
||||
|
||||
if("alert_green")
|
||||
config.alert_desc_green = value
|
||||
|
||||
if("alert_delta")
|
||||
config.alert_desc_delta = value
|
||||
|
||||
if("alert_gamma")
|
||||
config.alert_desc_gamma = value
|
||||
|
||||
if("alert_epsilon")
|
||||
config.alert_desc_epsilon = value
|
||||
|
||||
if("forbid_singulo_possession")
|
||||
forbid_singulo_possession = 1
|
||||
|
||||
@@ -475,6 +453,33 @@
|
||||
|
||||
if("max_maint_drones")
|
||||
config.max_maint_drones = text2num(value)
|
||||
|
||||
if("expected_round_length")
|
||||
config.expected_round_length = MinutesToTicks(text2num(value))
|
||||
|
||||
if("event_custom_start_mundane")
|
||||
var/values = text2numlist(value, ";")
|
||||
config.event_first_run[EVENT_LEVEL_MUNDANE] = list("lower" = MinutesToTicks(values[1]), "upper" = MinutesToTicks(values[2]))
|
||||
|
||||
if("event_custom_start_moderate")
|
||||
var/values = text2numlist(value, ";")
|
||||
config.event_first_run[EVENT_LEVEL_MODERATE] = list("lower" = MinutesToTicks(values[1]), "upper" = MinutesToTicks(values[2]))
|
||||
|
||||
if("event_custom_start_major")
|
||||
var/values = text2numlist(value, ";")
|
||||
config.event_first_run[EVENT_LEVEL_MAJOR] = list("lower" = MinutesToTicks(values[1]), "upper" = MinutesToTicks(values[2]))
|
||||
|
||||
if("event_delay_lower")
|
||||
var/values = text2numlist(value, ";")
|
||||
config.event_delay_lower[EVENT_LEVEL_MUNDANE] = MinutesToTicks(values[1])
|
||||
config.event_delay_lower[EVENT_LEVEL_MODERATE] = MinutesToTicks(values[2])
|
||||
config.event_delay_lower[EVENT_LEVEL_MAJOR] = MinutesToTicks(values[3])
|
||||
|
||||
if("event_delay_upper")
|
||||
var/values = text2numlist(value, ";")
|
||||
config.event_delay_upper[EVENT_LEVEL_MUNDANE] = MinutesToTicks(values[1])
|
||||
config.event_delay_upper[EVENT_LEVEL_MODERATE] = MinutesToTicks(values[2])
|
||||
config.event_delay_upper[EVENT_LEVEL_MAJOR] = MinutesToTicks(values[3])
|
||||
|
||||
else
|
||||
diary << "Unknown setting in configuration: '[name]'"
|
||||
|
||||
@@ -73,6 +73,7 @@ datum/controller/game_controller/proc/setup()
|
||||
if(!garbage)
|
||||
garbage = new /datum/controller/garbage_collector()
|
||||
|
||||
color_windows_init()
|
||||
setup_objects()
|
||||
setupgenetics()
|
||||
setupfactions()
|
||||
@@ -82,9 +83,6 @@ datum/controller/game_controller/proc/setup()
|
||||
for(var/i=0, i<max_secret_rooms, i++)
|
||||
make_mining_asteroid_secret()
|
||||
|
||||
color_windows_init()
|
||||
|
||||
|
||||
spawn(0)
|
||||
if(ticker)
|
||||
ticker.pregame()
|
||||
@@ -323,6 +321,7 @@ datum/controller/game_controller/proc/process()
|
||||
powernets -= Powernet
|
||||
|
||||
/datum/controller/game_controller/proc/processNano()
|
||||
last_thing_processed = /datum/nanoui
|
||||
for (var/datum/nanoui/Nanoui in nanomanager.processing_uis)
|
||||
if (Nanoui)
|
||||
Nanoui.process()
|
||||
@@ -332,15 +331,8 @@ datum/controller/game_controller/proc/process()
|
||||
|
||||
/datum/controller/game_controller/proc/processEvents()
|
||||
last_thing_processed = /datum/event
|
||||
event_manager.process()
|
||||
|
||||
for (var/datum/event/Event in events)
|
||||
if (Event)
|
||||
Event.process()
|
||||
continue
|
||||
|
||||
events -= Event
|
||||
|
||||
checkEvent()
|
||||
|
||||
/*
|
||||
/datum/controller/game_controller/proc/processPuddles()
|
||||
|
||||
@@ -134,7 +134,7 @@ var/global/datum/shuttle_controller/shuttle_controller
|
||||
admin_shuttle.area_offsite = locate(/area/shuttle/administration/centcom)
|
||||
admin_shuttle.area_station = locate(/area/shuttle/administration/station)
|
||||
admin_shuttle.docking_controller_tag = "admin_shuttle_port"
|
||||
admin_shuttle.docking_controller_tag_station = "admin_shuttle_starboard"
|
||||
admin_shuttle.docking_controller_tag_station = "admin_shuttle_port"
|
||||
admin_shuttle.docking_controller_tag_offsite = "admin_shuttle_port"
|
||||
admin_shuttle.dock_target_station = "admin_shuttle_dock_airlock"
|
||||
admin_shuttle.dock_target_offsite = "admin_shuttle_bay"
|
||||
@@ -217,8 +217,8 @@ var/global/datum/shuttle_controller/shuttle_controller
|
||||
)
|
||||
|
||||
VS.announcer = "NSV Icarus"
|
||||
VS.arrival_message = "Attention, Cyberiad, we just tracked a small target bypassing our defensive perimeter. Can't fire on it without hitting the station - you've got incoming visitors, like it or not."
|
||||
VS.departure_message = "Your guests are pulling away, Cyberiad - moving too fast for us to draw a bead on them. Looks like they're heading out of the system at a rapid clip."
|
||||
VS.arrival_message = "Attention, [station_name()], we just tracked a small target bypassing our defensive perimeter. Can't fire on it without hitting the station - you've got incoming visitors, like it or not."
|
||||
VS.departure_message = "Your guests are pulling away, [station_name()] - moving too fast for us to draw a bead on them. Looks like they're heading out of the system at a rapid clip."
|
||||
VS.interim = locate(/area/vox_station/transit)
|
||||
|
||||
VS.warmup_time = 0
|
||||
@@ -240,8 +240,8 @@ var/global/datum/shuttle_controller/shuttle_controller
|
||||
)
|
||||
|
||||
MS.announcer = "NSV Icarus"
|
||||
MS.arrival_message = "Attention, Cyberiad, you have a large signature approaching the station - looks unarmed to surface scans. We're too far out to intercept - brace for visitors."
|
||||
MS.departure_message = "Your visitors are on their way out of the system, Cyberiad, burning delta-v like it's nothing. Good riddance."
|
||||
MS.arrival_message = "Attention, [station_name()], you have a large signature approaching the station - looks unarmed to surface scans. We're too far out to intercept - brace for visitors."
|
||||
MS.departure_message = "Your visitors are on their way out of the system, [station_name()], burning delta-v like it's nothing. Good riddance."
|
||||
MS.interim = locate(/area/syndicate_station/transit)
|
||||
|
||||
MS.warmup_time = 0
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
return
|
||||
|
||||
|
||||
/client/proc/debug_controller(controller in list("Master","Failsafe","Ticker","Lighting","Air","Jobs","Sun","Radio","Supply","Shuttles","Emergency Shuttle","Configuration","pAI", "Cameras","Garbage", "Crafting", "Transfer Controller"))
|
||||
/client/proc/debug_controller(controller in list("Master","Failsafe","Ticker","Lighting","Air","Jobs","Sun","Radio","Supply","Shuttles","Emergency Shuttle","Configuration","pAI", "Cameras","Garbage", "Crafting", "Transfer Controller","Event"))
|
||||
set category = "Debug"
|
||||
set name = "Debug Controller"
|
||||
set desc = "Debug the various periodic loop controllers for the game (be careful!)"
|
||||
@@ -104,5 +104,9 @@
|
||||
if("Crafting")
|
||||
debug_variables(crafting_master)
|
||||
feedback_add_details("admin_verb","DCrafting")
|
||||
if("Event")
|
||||
debug_variables(event_manager)
|
||||
feedback_add_details("admin_verb","DEvent")
|
||||
|
||||
message_admins("Admin [key_name_admin(usr)] is debugging the [controller] controller.")
|
||||
return
|
||||
|
||||
@@ -191,9 +191,6 @@ proc/get_id_photo(var/mob/living/carbon/human/H)
|
||||
if("Nanotrasen Representative")
|
||||
clothes_s = new /icon('icons/mob/uniform.dmi', "officer_s")
|
||||
clothes_s.Blend(new /icon('icons/mob/feet.dmi', "laceups"), ICON_UNDERLAY)
|
||||
if("Nanotrasen Recruiter")
|
||||
clothes_s = new /icon('icons/mob/uniform.dmi', "officer_s")
|
||||
clothes_s.Blend(new /icon('icons/mob/feet.dmi', "laceups"), ICON_UNDERLAY)
|
||||
if("Blueshield")
|
||||
clothes_s = new /icon('icons/mob/uniform.dmi', "officer_s")
|
||||
clothes_s.Blend(new /icon('icons/mob/feet.dmi', "jackboots"), ICON_UNDERLAY)
|
||||
@@ -285,9 +282,6 @@ proc/get_id_photo(var/mob/living/carbon/human/H)
|
||||
clothes_s = new /icon('icons/mob/uniform.dmi', "secred_s")
|
||||
clothes_s.Blend(new /icon('icons/mob/feet.dmi', "jackboots"), ICON_UNDERLAY)
|
||||
clothes_s.Blend(new /icon('icons/mob/suit.dmi', "bomber"), ICON_OVERLAY)
|
||||
if("Customs Officer")
|
||||
clothes_s = new /icon('icons/obj/custom_items.dmi', "milohachert_s")
|
||||
clothes_s.Blend(new /icon('icons/mob/feet.dmi', "jackboots"), ICON_UNDERLAY)
|
||||
if("Brig Physician")
|
||||
clothes_s = new /icon('icons/mob/uniform.dmi', "medical_s")
|
||||
clothes_s.Blend(new /icon('icons/mob/feet.dmi', "white"), ICON_UNDERLAY)
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
break
|
||||
else if(istype(item, /obj/item/weapon/gun/magic))
|
||||
var/obj/item/weapon/gun/magic/I = item
|
||||
if(prob(80))
|
||||
if(prob(80) && !I.can_charge)
|
||||
I.max_charges--
|
||||
if(I.max_charges <= 0)
|
||||
I.max_charges = 0
|
||||
|
||||
@@ -22,11 +22,11 @@
|
||||
return
|
||||
|
||||
var/mob/living/carbon/target = targets[1]
|
||||
|
||||
|
||||
if(!target)
|
||||
return
|
||||
|
||||
if(!(target.type in compatible_mobs))
|
||||
if(target.type in compatible_mobs || ishuman(target))
|
||||
user << "<span class='notice'>It'd be stupid to curse [target] with a horse's head!</span>"
|
||||
return
|
||||
|
||||
|
||||
@@ -10,10 +10,6 @@
|
||||
range = 1
|
||||
cooldown_min = 200 //100 deciseconds reduction per rank
|
||||
var/list/protected_roles = list("Wizard","Changeling","Cultist") //which roles are immune to the spell
|
||||
var/base_spell_loss_chance = 20 //base probability of the wizard losing a spell in the process
|
||||
var/spell_loss_chance_modifier = 7 //amount of probability of losing a spell added per spell (mind_transfer included)
|
||||
var/spell_loss_amount = 1 //the maximum amount of spells possible to lose during a single transfer
|
||||
var/msg_wait = 500 //how long in deciseconds it waits before telling that body doesn't feel right or mind swap robbed of a spell
|
||||
var/paralysis_amount_caster = 20 //how much the caster is paralysed for after the spell
|
||||
var/paralysis_amount_victim = 20 //how much the victim is paralysed for after the spell
|
||||
icon_power_button = "spell_mind"
|
||||
@@ -53,27 +49,6 @@ Also, you never added distance checking after target is selected. I've went ahea
|
||||
var/mob/living/victim = target//The target of the spell whos body will be transferred to.
|
||||
var/mob/caster = user//The wizard/whomever doing the body transferring.
|
||||
|
||||
//SPELL LOSS BEGIN
|
||||
//NOTE: The caster must ALWAYS keep mind transfer, even when other spells are lost.
|
||||
var/obj/effect/proc_holder/spell/wizard/targeted/mind_transfer/m_transfer = locate() in user.spell_list//Find mind transfer directly.
|
||||
var/list/checked_spells = user.spell_list
|
||||
checked_spells -= m_transfer //Remove Mind Transfer from the list.
|
||||
|
||||
if(caster.spell_list.len)//If they have any spells left over after mind transfer is taken out. If they don't, we don't need this.
|
||||
for(var/i=spell_loss_amount,(i>0&&checked_spells.len),i--)//While spell loss amount is greater than zero and checked_spells has spells in it, run this proc.
|
||||
for(var/j=checked_spells.len,(j>0&&checked_spells.len),j--)//While the spell list to check is greater than zero and has spells in it, run this proc.
|
||||
if(prob(base_spell_loss_chance))
|
||||
checked_spells -= pick(checked_spells)//Pick a random spell to remove.
|
||||
spawn(msg_wait)
|
||||
victim << "The mind transfer has robbed you of a spell."
|
||||
break//Spell lost. Break loop, going back to the previous for() statement.
|
||||
else//Or keep checking, adding spell chance modifier to increase chance of losing a spell.
|
||||
base_spell_loss_chance += spell_loss_chance_modifier
|
||||
|
||||
checked_spells += m_transfer//Add back Mind Transfer.
|
||||
user.spell_list = checked_spells//Set user spell list to whatever the new list is.
|
||||
//SPELL LOSS END
|
||||
|
||||
//MIND TRANSFER BEGIN
|
||||
if(caster.mind.special_verbs.len)//If the caster had any special verbs, remove them from the mob verb list.
|
||||
for(var/V in caster.mind.special_verbs)//Since the caster is using an object spell system, this is mostly moot.
|
||||
@@ -105,7 +80,3 @@ Also, you never added distance checking after target is selected. I've went ahea
|
||||
//Here we paralyze both mobs and knock them out for a time.
|
||||
caster.Paralyse(paralysis_amount_caster)
|
||||
victim.Paralyse(paralysis_amount_victim)
|
||||
|
||||
//After a certain amount of time the victim gets a message about being in a different body.
|
||||
spawn(msg_wait)
|
||||
caster << "\red You feel woozy and lightheaded. <b>Your body doesn't seem like your own.</b>"
|
||||
|
||||
@@ -0,0 +1,107 @@
|
||||
/obj/effect/proc_holder/spell/wizard/targeted/summonitem
|
||||
name = "Instant Summons"
|
||||
desc = "This spell can be used to recall a previously marked item to your hand from anywhere in the universe."
|
||||
school = "transmutation"
|
||||
charge_max = 100
|
||||
clothes_req = 0
|
||||
invocation = "GAR YOK"
|
||||
invocation_type = "whisper"
|
||||
range = -1
|
||||
level_max = 1 //cannot be improved
|
||||
cooldown_min = 100
|
||||
include_user = 1
|
||||
|
||||
var/obj/marked_item
|
||||
|
||||
/obj/effect/proc_holder/spell/wizard/targeted/summonitem/cast(list/targets)
|
||||
for(var/mob/living/user in targets)
|
||||
var/list/hand_items = list(user.get_active_hand(),user.get_inactive_hand())
|
||||
var/butterfingers = 0
|
||||
var/message
|
||||
|
||||
if(!marked_item) //linking item to the spell
|
||||
message = "<span class='notice'>"
|
||||
for(var/obj/item in hand_items)
|
||||
if(istype(item, /obj/item/brain)) //Yeah, sadly this doesn't work due to the organ system.
|
||||
break
|
||||
marked_item = item
|
||||
message += "You mark [item] for recall.</span>"
|
||||
name = "Recall [item]"
|
||||
break
|
||||
|
||||
if(!marked_item)
|
||||
if(hand_items)
|
||||
message = "<span class='caution'>You aren't holding anything that can be marked for recall.</span>"
|
||||
else
|
||||
message = "<span class='notice'>You must hold the desired item in your hands to mark it for recall.</span>"
|
||||
else if(marked_item && marked_item in hand_items) //unlinking item to the spell
|
||||
message = "<span class='notice'>You remove the mark on [marked_item] to use elsewhere.</span>"
|
||||
name = "Instant Summons"
|
||||
marked_item = null
|
||||
|
||||
else if(marked_item && !marked_item.loc) //the item was destroyed at some point
|
||||
message = "<span class='warning'>You sense your marked item has been destroyed!</span>"
|
||||
name = "Instant Summons"
|
||||
marked_item = null
|
||||
|
||||
else //Getting previously marked item
|
||||
var/obj/item_to_retrive = marked_item
|
||||
var/infinite_recursion = 0 //I don't want to know how someone could put something inside itself but these are wizards so let's be safe
|
||||
|
||||
while(!isturf(item_to_retrive.loc) && infinite_recursion < 10) //if it's in something you get the whole thing.
|
||||
if(ismob(item_to_retrive.loc)) //If its on someone, properly drop it
|
||||
var/mob/M = item_to_retrive.loc
|
||||
|
||||
if(issilicon(M)) //Items in silicons warp the whole silicon
|
||||
M.loc.visible_message("<span class='warning'>[M] suddenly disappears!</span>")
|
||||
M.loc = user.loc
|
||||
M.loc.visible_message("<span class='caution'>[M] suddenly appears!</span>")
|
||||
item_to_retrive = null
|
||||
break
|
||||
|
||||
M.u_equip(item_to_retrive)
|
||||
|
||||
if(ishuman(M)) //Edge case housekeeping
|
||||
var/mob/living/carbon/human/C = M
|
||||
/*if(C.internal_organs_by_name && item_to_retrive in C.internal_organs_by_name ) //This won't work, as we use organ datums instead of objects. --DZD
|
||||
C.internal_organs_by_name -= item_to_retrive
|
||||
if(istype(marked_item, /obj/item/brain)) //If this code ever runs I will be happy
|
||||
var/obj/item/brain/B = new /obj/item/brain(user.loc)
|
||||
B.transfer_identity(C)
|
||||
C.death()
|
||||
add_logs(user, C, "magically debrained", addition="INTENT: [uppertext(user.a_intent)]")*/
|
||||
if(C.stomach_contents && item_to_retrive in C.stomach_contents)
|
||||
C.stomach_contents -= item_to_retrive
|
||||
|
||||
else
|
||||
if(istype(item_to_retrive.loc,/obj/machinery/portable_atmospherics/)) //Edge cases for moved machinery
|
||||
var/obj/machinery/portable_atmospherics/P = item_to_retrive.loc
|
||||
P.disconnect()
|
||||
P.update_icon()
|
||||
|
||||
item_to_retrive = item_to_retrive.loc
|
||||
|
||||
infinite_recursion += 1
|
||||
|
||||
if(!item_to_retrive)
|
||||
return
|
||||
|
||||
item_to_retrive.loc.visible_message("<span class='warning'>The [item_to_retrive.name] suddenly disappears!</span>")
|
||||
|
||||
|
||||
if(user.hand) //left active hand
|
||||
if(!user.equip_to_slot_if_possible(item_to_retrive, slot_l_hand, 0, 1, 1))
|
||||
if(!user.equip_to_slot_if_possible(item_to_retrive, slot_r_hand, 0, 1, 1))
|
||||
butterfingers = 1
|
||||
else //right active hand
|
||||
if(!user.equip_to_slot_if_possible(item_to_retrive, slot_r_hand, 0, 1, 1))
|
||||
if(!user.equip_to_slot_if_possible(item_to_retrive, slot_l_hand, 0, 1, 1))
|
||||
butterfingers = 1
|
||||
if(butterfingers)
|
||||
item_to_retrive.loc = user.loc
|
||||
item_to_retrive.loc.visible_message("<span class='caution'>The [item_to_retrive.name] suddenly appears!</span>")
|
||||
else
|
||||
item_to_retrive.loc.visible_message("<span class='caution'>The [item_to_retrive.name] suddenly appears in [user]'s hand!</span>")
|
||||
|
||||
if(message)
|
||||
user << message
|
||||
@@ -46,6 +46,7 @@
|
||||
message = "\blue You feel strong! You feel a pressure building behind your eyes!"
|
||||
range = -1
|
||||
include_user = 1
|
||||
centcom_cancast = 0
|
||||
|
||||
mutations = list(M_LASER, M_HULK)
|
||||
duration = 300
|
||||
@@ -278,4 +279,48 @@
|
||||
/obj/effect/proc_holder/spell/wizard/targeted/explosion/fireball
|
||||
ex_severe = -1
|
||||
ex_heavy = -1
|
||||
ex_light = 2
|
||||
ex_light = 2
|
||||
|
||||
/obj/effect/proc_holder/spell/wizard/aoe_turf/repulse
|
||||
name = "Repulse"
|
||||
desc = "This spell throws everything around the user away."
|
||||
charge_max = 400
|
||||
clothes_req = 1
|
||||
invocation = "GITTAH WEIGH"
|
||||
invocation_type = "shout"
|
||||
range = 5
|
||||
cooldown_min = 150
|
||||
selection_type = "view"
|
||||
var/maxthrow = 5
|
||||
|
||||
/obj/effect/proc_holder/spell/wizard/aoe_turf/repulse/cast(list/targets)
|
||||
var/mob/user = usr
|
||||
var/list/thrownatoms = list()
|
||||
var/atom/throwtarget
|
||||
var/distfromcaster
|
||||
for(var/turf/T in targets) //Done this way so things don't get thrown all around hilariously.
|
||||
for(var/atom/movable/AM in T)
|
||||
thrownatoms += AM
|
||||
|
||||
for(var/atom/movable/AM in thrownatoms)
|
||||
if(AM == user || AM.anchored) continue
|
||||
|
||||
var/obj/effect/overlay/targeteffect = new /obj/effect/overlay{icon='icons/effects/effects.dmi'; icon_state="shieldsparkles"; mouse_opacity=0; density = 0}()
|
||||
AM.overlays += targeteffect
|
||||
throwtarget = get_edge_target_turf(user, get_dir(user, get_step_away(AM, user)))
|
||||
distfromcaster = get_dist(user, AM)
|
||||
spawn(10)
|
||||
AM.overlays -= targeteffect
|
||||
qdel(targeteffect)
|
||||
if(distfromcaster == 0)
|
||||
if(istype(AM, /mob/living))
|
||||
var/mob/living/M = AM
|
||||
M.Weaken(5)
|
||||
M.adjustBruteLoss(5)
|
||||
M << "<span class='userdanger'>You're slammed into the floor by a mystical force!</span>"
|
||||
else
|
||||
if(istype(AM, /mob/living))
|
||||
var/mob/living/M = AM
|
||||
M.Weaken(2)
|
||||
M << "<span class='userdanger'>You're thrown back by a mystical force!</span>"
|
||||
spawn(0) AM.throw_at(throwtarget, ((Clamp((maxthrow - (Clamp(distfromcaster - 2, 0, distfromcaster))), 3, maxthrow))), 1)//So stuff gets tossed around at the same time.
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
proc/log_and_message_admins(var/message as text)
|
||||
log_admin("[usr]([usr.ckey]) " + message)
|
||||
message_admins("[usr]([usr.ckey]) " + message)
|
||||
|
||||
proc/admin_log_and_message_admins(var/message as text)
|
||||
log_admin("[key_name(usr)] " + message)
|
||||
message_admins("[key_name_admin(usr)] " + message, 1)
|
||||
@@ -66,10 +66,12 @@ var/list/teleportlocs = list()
|
||||
for(var/area/AR in world)
|
||||
if(istype(AR, /area/shuttle) || istype(AR, /area/syndicate_station) || istype(AR, /area/wizard_station)) continue
|
||||
if(teleportlocs.Find(AR.name)) continue
|
||||
var/turf/picked = pick(get_area_turfs(AR.type))
|
||||
if (picked.z == 1)
|
||||
teleportlocs += AR.name
|
||||
teleportlocs[AR.name] = AR
|
||||
var/list/turfs = get_area_turfs(AR.type)
|
||||
if(turfs.len)
|
||||
var/turf/picked = pick(turfs)
|
||||
if (picked.z == 1)
|
||||
teleportlocs += AR.name
|
||||
teleportlocs[AR.name] = AR
|
||||
|
||||
teleportlocs = sortAssoc(teleportlocs)
|
||||
|
||||
@@ -83,10 +85,12 @@ var/list/ghostteleportlocs = list()
|
||||
if(istype(AR, /area/turret_protected/aisat) || istype(AR, /area/derelict) || istype(AR, /area/tdome))
|
||||
ghostteleportlocs += AR.name
|
||||
ghostteleportlocs[AR.name] = AR
|
||||
var/turf/picked = pick(get_area_turfs(AR.type))
|
||||
if (picked.z == 1 || picked.z == 5 || picked.z == 3)
|
||||
ghostteleportlocs += AR.name
|
||||
ghostteleportlocs[AR.name] = AR
|
||||
var/list/turfs = get_area_turfs(AR.type)
|
||||
if(turfs.len)
|
||||
var/turf/picked = pick(turfs)
|
||||
if (picked.z == 1 || picked.z == 5 || picked.z == 3)
|
||||
ghostteleportlocs += AR.name
|
||||
ghostteleportlocs[AR.name] = AR
|
||||
|
||||
ghostteleportlocs = sortAssoc(ghostteleportlocs)
|
||||
|
||||
@@ -748,6 +752,15 @@ var/list/ghostteleportlocs = list()
|
||||
/area/prison/cell_block/C
|
||||
name = "\improper Prison Cell Block C"
|
||||
icon_state = "brig"
|
||||
|
||||
//Labor camp
|
||||
/area/mine/laborcamp
|
||||
name = "Labor Camp"
|
||||
icon_state = "brig"
|
||||
|
||||
/area/mine/laborcamp/security
|
||||
name = "Labor Camp Security"
|
||||
icon_state = "security"
|
||||
|
||||
//STATION13
|
||||
|
||||
@@ -816,9 +829,13 @@ var/list/ghostteleportlocs = list()
|
||||
/area/maintenance/aft
|
||||
name = "Engineering Maintenance"
|
||||
icon_state = "amaint"
|
||||
|
||||
/area/maintenance/engi_shuttle
|
||||
name = "Engineering Shuttle Access"
|
||||
icon_state = "maint_e_shuttle"
|
||||
|
||||
/area/maintenance/storage
|
||||
name = "Atmospherics"
|
||||
name = "Atmospherics Maintenance"
|
||||
icon_state = "green"
|
||||
|
||||
/area/maintenance/incinerator
|
||||
@@ -2240,55 +2257,6 @@ area/security/podbay
|
||||
luminosity = 1
|
||||
lighting_use_dynamic = 0
|
||||
requires_power = 0
|
||||
var/sound/mysound = null
|
||||
|
||||
New()
|
||||
..()
|
||||
var/sound/S = new/sound()
|
||||
mysound = S
|
||||
S.file = 'sound/ambience/shore.ogg'
|
||||
S.repeat = 1
|
||||
S.wait = 0
|
||||
S.channel = 123
|
||||
S.volume = 100
|
||||
S.priority = 255
|
||||
S.status = SOUND_UPDATE
|
||||
process()
|
||||
|
||||
Entered(atom/movable/Obj,atom/OldLoc)
|
||||
if(ismob(Obj))
|
||||
if(Obj:client)
|
||||
mysound.status = SOUND_UPDATE
|
||||
Obj << mysound
|
||||
return
|
||||
|
||||
Exited(atom/movable/Obj)
|
||||
if(ismob(Obj))
|
||||
if(Obj:client)
|
||||
mysound.status = SOUND_PAUSED | SOUND_UPDATE
|
||||
Obj << mysound
|
||||
|
||||
proc/process()
|
||||
//set background = 1
|
||||
|
||||
var/sound/S = null
|
||||
var/sound_delay = 0
|
||||
if(prob(25))
|
||||
S = sound(file=pick('sound/ambience/seag1.ogg','sound/ambience/seag2.ogg','sound/ambience/seag3.ogg'), volume=100)
|
||||
sound_delay = rand(0, 50)
|
||||
|
||||
for(var/mob/living/carbon/human/H in src)
|
||||
if(H.s_tone > -55)
|
||||
H.s_tone--
|
||||
H.update_body()
|
||||
if(H.client)
|
||||
mysound.status = SOUND_UPDATE
|
||||
H << mysound
|
||||
if(S)
|
||||
spawn(sound_delay)
|
||||
H << S
|
||||
|
||||
spawn(60) .()
|
||||
|
||||
////////////////////////AWAY AREAS///////////////////////////////////
|
||||
|
||||
|
||||
@@ -49,6 +49,10 @@
|
||||
|
||||
// Use this to force a mut check on a single gene!
|
||||
/proc/genemutcheck(var/mob/living/M, var/block, var/connected=null, var/flags=0)
|
||||
if(ishuman(M)) // Would've done this via species instead of type, but the basic mob doesn't have a species, go figure.
|
||||
var/mob/living/carbon/human/H = M
|
||||
if(H.species.flags & IS_SYNTHETIC)
|
||||
return
|
||||
if(!M)
|
||||
return
|
||||
if(block < 0)
|
||||
|
||||
@@ -320,13 +320,20 @@
|
||||
icon_power_button = "genetic_incendiary"
|
||||
|
||||
/obj/effect/proc_holder/spell/wizard/targeted/immolate/cast(list/targets)
|
||||
if(!targets.len)
|
||||
|
||||
/* if(!targets.len) Uncomment this to allow the power to be used on targets other than yourself. That said, if you uncomment this I will find you and hurt you. Uncounterable and untracable burn damage with a 60-second cooldown is fun for exactly one person, and that's the person who is using it.
|
||||
usr << "<span class='notice'>No target found in range.</span>"
|
||||
return
|
||||
|
||||
var/mob/living/carbon/L = targets[1]
|
||||
if(L)
|
||||
usr.attack_log += text("\[[time_stamp()]\] <font color='red'>[usr.real_name] ([usr.ckey]) cast the spell [name] on [L.real_name] ([L.ckey]).</font>")
|
||||
L.attack_log += text("\[[time_stamp()]\] <font color='red'>[usr.real_name] ([usr.ckey]) cast the spell [name] on [L.real_name] ([L.ckey]).</font>")
|
||||
msg_admin_attack("[usr.real_name] ([usr.ckey]) has cast the spell [name] on [L.real_name] ([L.ckey]) (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[usr.x];Y=[usr.y];Z=[usr.z]'>JM
|
||||
*/
|
||||
var/mob/living/carbon/L = usr
|
||||
|
||||
L.adjust_fire_stacks(0.5) // Same as walking into fire. Was 100 (goon fire)
|
||||
L.adjust_fire_stacks(0.5)
|
||||
L.visible_message("\red <b>[L.name]</b> suddenly bursts into flames!")
|
||||
L.on_fire = 1
|
||||
L.update_icon = 1
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
return 0 // not enough candidates for borer
|
||||
|
||||
for(var/obj/machinery/atmospherics/unary/vent_pump/v in world)
|
||||
if(!v.welded && v.z == STATION_Z && v.canSpawnMice==1) // No more spawning in atmos. Assuming the mappers did their jobs, anyway.
|
||||
if(!v.welded && v.z == STATION_Z) // No more spawning in atmos. Assuming the mappers did their jobs, anyway.
|
||||
found_vents.Add(v)
|
||||
|
||||
// for each 2 possible borers, add one borer and one host
|
||||
|
||||
@@ -8,7 +8,8 @@ var/list/possible_changeling_IDs = list("Alpha","Beta","Gamma","Delta","Epsilon"
|
||||
name = "changeling"
|
||||
config_tag = "changeling"
|
||||
restricted_jobs = list("AI", "Cyborg")
|
||||
protected_jobs = list("Security Officer", "Warden", "Detective", "Head of Security", "Captain", "Blueshield", "Nanotrasen Representative", "Security Pod Pilot", "Nanotrasen Recruiter", "Magistrate", "Brig Physician", "Customs Officer", "Internal Affairs Agent")
|
||||
protected_jobs = list("Security Officer", "Warden", "Detective", "Head of Security", "Captain", "Blueshield", "Nanotrasen Representative", "Security Pod Pilot", "Magistrate", "Brig Physician", "Internal Affairs Agent")
|
||||
protected_species = list("Machine")
|
||||
required_players = 2
|
||||
required_players_secret = 10
|
||||
required_enemies = 1
|
||||
|
||||
@@ -268,6 +268,9 @@
|
||||
src.dna = chosen_dna.Clone()
|
||||
src.real_name = chosen_dna.real_name
|
||||
src.flavor_text = ""
|
||||
if(ishuman(src))
|
||||
var/mob/living/carbon/human/H = src
|
||||
H.set_species()
|
||||
src.UpdateAppearance()
|
||||
domutcheck(src, null)
|
||||
|
||||
@@ -408,7 +411,7 @@
|
||||
O.dna = C.dna.Clone()
|
||||
C.dna = null
|
||||
O.real_name = chosen_dna.real_name
|
||||
|
||||
O.set_species()
|
||||
for(var/obj/T in C)
|
||||
del(T)
|
||||
|
||||
@@ -729,7 +732,7 @@ var/list/datum/dna/hivemind_bank = list()
|
||||
src << "<span class='notice'>We return our vocal glands to their original location.</span>"
|
||||
return
|
||||
|
||||
var/mimic_voice = input("Enter a name to mimic.", "Mimic Voice", null) as text
|
||||
var/mimic_voice = stripped_input(usr, "Enter a name to mimic.", "Mimic Voice", null, MAX_NAME_LEN)
|
||||
if(!mimic_voice)
|
||||
return
|
||||
|
||||
@@ -927,6 +930,10 @@ var/list/datum/dna/hivemind_bank = list()
|
||||
|
||||
var/mob/living/carbon/human/T = changeling_sting(40, /mob/proc/changeling_extract_dna_sting)
|
||||
if(!T) return 0
|
||||
if(T.species.flags & NO_SCAN) // Yeah, this needs the same protection, otherwise you can steal DNA from Slime People and then blood overdose when you turn into one.
|
||||
src << "<span class='warning'>We do not know how to parse this creature's DNA!</span>"
|
||||
changeling.chem_charges += 40
|
||||
return 0
|
||||
|
||||
T.dna.real_name = T.real_name
|
||||
changeling.absorbed_dna |= T.dna
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
required_players_secret = 10
|
||||
required_enemies = 2
|
||||
recommended_enemies = 3
|
||||
var/protected_species_changeling = list("Machine")
|
||||
|
||||
/datum/game_mode/traitor/changeling/announce()
|
||||
world << "<B>The current game mode is - Traitor+Changeling!</B>"
|
||||
@@ -23,7 +24,11 @@
|
||||
for(var/job in restricted_jobs)//Removing robots from the list
|
||||
if(player.assigned_role == job)
|
||||
possible_changelings -= player
|
||||
|
||||
|
||||
for(var/mob/new_player/player in player_list)
|
||||
if((player.mind in possible_changelings) && (player.client.prefs.species in protected_species_changeling))
|
||||
possible_changelings -= player.mind
|
||||
|
||||
if(possible_changelings.len>0)
|
||||
var/datum/mind/changeling = pick(possible_changelings)
|
||||
//possible_changelings-=changeling
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
/datum/game_mode/cult
|
||||
name = "cult"
|
||||
config_tag = "cult"
|
||||
restricted_jobs = list("Chaplain","AI", "Cyborg", "Internal Affairs Agent", "Security Officer", "Warden", "Detective", "Security Pod Pilot", "Head of Security", "Captain", "Head of Personnel", "Blueshield", "Nanotrasen Representative", "Nanotrasen Recruiter", "Magistrate", "Brig Physician", "Customs Officer")
|
||||
restricted_jobs = list("Chaplain","AI", "Cyborg", "Internal Affairs Agent", "Security Officer", "Warden", "Detective", "Security Pod Pilot", "Head of Security", "Captain", "Head of Personnel", "Blueshield", "Nanotrasen Representative", "Magistrate", "Brig Physician")
|
||||
protected_jobs = list()
|
||||
required_players = 5
|
||||
required_players_secret = 15
|
||||
|
||||
@@ -145,12 +145,12 @@ Not sure why this would be useful (it's not) but whatever. Ninjas need their smo
|
||||
//=======//EM PULSE//=======//
|
||||
//Disables nearby tech equipment.
|
||||
/obj/item/clothing/suit/space/space_ninja/proc/ninjapulse()
|
||||
set name = "EM Burst (1,500E)"
|
||||
set name = "EM Burst (2,000E)"
|
||||
set desc = "Disable any nearby technology with a electro-magnetic pulse."
|
||||
set category = "Ninja Ability"
|
||||
set popup_menu = 0
|
||||
|
||||
var/C = 1500
|
||||
var/C = 2000
|
||||
if(!ninjacost(C, 1))
|
||||
var/mob/living/carbon/human/U = affecting
|
||||
playsound(U.loc, 'sound/effects/EMPulse.ogg', 60, 2)
|
||||
|
||||
@@ -625,7 +625,7 @@ ________________________________________________________________________________
|
||||
A << "There are no potential [href_list["name"]=="Phase Shift"?"destinations" : "targets"] in view."
|
||||
|
||||
if("Unlock Kamikaze")
|
||||
if(input(U)=="Divine Wind")
|
||||
if(input(U)=="Divine Wind" && (k_unlock==7||!s_control))
|
||||
if(U.loc.loc.name != "\improper SpiderClan Outpost")
|
||||
if( !(U.stat||U.wear_suit!=src||!s_initialized))
|
||||
if( !(cell.charge<=1||s_busy) )
|
||||
|
||||
@@ -22,7 +22,8 @@
|
||||
var/explosion_in_progress = 0 //sit back and relax
|
||||
var/list/datum/mind/modePlayer = new
|
||||
var/list/restricted_jobs = list() // Jobs it doesn't make sense to be. I.E chaplain or AI cultist
|
||||
var/list/protected_jobs = list() // Jobs that can't be trators
|
||||
var/list/protected_jobs = list() // Jobs that can't be traitors
|
||||
var/list/protected_species = list() // Species that can't be traitors
|
||||
var/required_players = 0
|
||||
var/required_players_secret = 0 //Minimum number of players for that game mode to be chose in Secret
|
||||
var/required_enemies = 0
|
||||
@@ -356,9 +357,9 @@ Implants;
|
||||
// Shuffle the players list so that it becomes ping-independent.
|
||||
players = shuffle(players)
|
||||
|
||||
// Get a list of all the people who want to be the antagonist for this round
|
||||
// Get a list of all the people who want to be the antagonist for this round, except those with incompatible species
|
||||
for(var/mob/new_player/player in players)
|
||||
if(player.client.prefs.be_special & role)
|
||||
if(player.client.prefs.be_special & role && !(player.client.prefs.species in protected_species))
|
||||
log_debug("[player.key] had [roletext] enabled, so we are drafting them.")
|
||||
candidates += player.mind
|
||||
players -= player
|
||||
|
||||
@@ -486,6 +486,9 @@ var/global/datum/controller/gameticker/ticker
|
||||
|
||||
scoreboard()
|
||||
karmareminder()
|
||||
|
||||
//Ask the event manager to print round end information
|
||||
event_manager.RoundEnd()
|
||||
|
||||
return 1
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
var/const/waittime_l = 600
|
||||
var/const/waittime_h = 1800 // started at 1800
|
||||
|
||||
var/AI_win_timeleft = 5400 //started at 5400, in case I change this for testing round end.
|
||||
var/AI_win_timeleft = 2000 //started at 2000, in case I change this for testing round end.
|
||||
var/malf_mode_declared = 0
|
||||
var/station_captured = 0
|
||||
var/to_nuke_or_not_to_nuke = 0
|
||||
@@ -88,8 +88,8 @@
|
||||
|
||||
|
||||
/datum/game_mode/malfunction/process()
|
||||
if ((apcs > 0) && malf_mode_declared)
|
||||
AI_win_timeleft -= apcs * last_tick_duration //Victory timer now de-increments based on how many APCs are hacked. --NeoFite
|
||||
if (apcs >= 3 && malf_mode_declared)
|
||||
AI_win_timeleft -= ((apcs/6)*last_tick_duration) //Victory timer now de-increments based on how many APCs are hacked. --NeoFite
|
||||
..()
|
||||
if (AI_win_timeleft<=0)
|
||||
check_win()
|
||||
|
||||
@@ -226,7 +226,7 @@ proc/issyndicate(mob/living/M as mob)
|
||||
/datum/game_mode/proc/equip_syndicate(mob/living/carbon/human/synd_mob)
|
||||
var/radio_freq = SYND_FREQ
|
||||
|
||||
var/obj/item/device/radio/R = new /obj/item/device/radio/headset/syndicate(synd_mob)
|
||||
var/obj/item/device/radio/R = new /obj/item/device/radio/headset/syndicate/alt(synd_mob)
|
||||
R.set_frequency(radio_freq)
|
||||
synd_mob.equip_to_slot_or_del(R, slot_l_ear)
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
/datum/game_mode/revolution
|
||||
name = "revolution"
|
||||
config_tag = "revolution"
|
||||
restricted_jobs = list("Security Officer", "Warden", "Detective", "Internal Affairs Agent", "AI", "Cyborg","Captain", "Head of Personnel", "Head of Security", "Chief Engineer", "Research Director", "Chief Medical Officer", "Blueshield", "Nanotrasen Representative", "Nanotrasen Recruiter", "Magistrate", "Brig Physician", "Customs Officer")
|
||||
restricted_jobs = list("Security Officer", "Warden", "Detective", "Internal Affairs Agent", "AI", "Cyborg","Captain", "Head of Personnel", "Head of Security", "Chief Engineer", "Research Director", "Chief Medical Officer", "Blueshield", "Nanotrasen Representative", "Security Pod Pilot", "Magistrate", "Brig Physician")
|
||||
protected_jobs = list()
|
||||
required_players = 4
|
||||
required_players_secret = 15
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
name = "traitor"
|
||||
config_tag = "traitor"
|
||||
restricted_jobs = list("Cyborg")//They are part of the AI if he is traitor so are they, they use to get double chances
|
||||
protected_jobs = list("Security Officer", "Warden", "Detective", "Head of Security", "Internal Affairs Agent", "Captain", "Blueshield", "Nanotrasen Representative", "Security Pod Pilot", "Nanotrasen Recruiter", "Magistrate", "Customs Officer", "Internal Affairs Agent")//AI", Currently out of the list as malf does not work for shit
|
||||
protected_jobs = list("Security Officer", "Warden", "Detective", "Head of Security", "Internal Affairs Agent", "Captain", "Blueshield", "Nanotrasen Representative", "Security Pod Pilot", "Magistrate", "Internal Affairs Agent", "Brig Physician")//AI", Currently out of the list as malf does not work for shit
|
||||
required_players = 0
|
||||
required_enemies = 1
|
||||
recommended_enemies = 4
|
||||
|
||||
@@ -8,7 +8,8 @@
|
||||
name = "vampire"
|
||||
config_tag = "vampire"
|
||||
restricted_jobs = list("AI", "Cyborg")
|
||||
protected_jobs = list("Security Officer", "Warden", "Detective", "Head of Security", "Captain", "Blueshield", "Nanotrasen Representative", "Security Pod Pilot", "Nanotrasen Recruiter", "Magistrate", "Chaplain", "Brig Physician", "Customs Officer", "Internal Affairs Agent")
|
||||
protected_jobs = list("Security Officer", "Warden", "Detective", "Head of Security", "Captain", "Blueshield", "Nanotrasen Representative", "Security Pod Pilot", "Magistrate", "Chaplain", "Brig Physician", "Internal Affairs Agent")
|
||||
protected_species = list("Machine")
|
||||
required_players = 2
|
||||
required_players_secret = 10
|
||||
required_enemies = 1
|
||||
@@ -461,6 +462,24 @@ You are weak to holy things and starlight. Don't go into space and avoid the Cha
|
||||
|
||||
if(T.density)
|
||||
return
|
||||
vamp_burn()
|
||||
|
||||
/mob/living/carbon/human/proc/handle_vampire()
|
||||
if(hud_used)
|
||||
if(!hud_used.vampire_blood_display)
|
||||
hud_used.vampire_hud()
|
||||
hud_used.human_hud('icons/mob/screen1_Vampire.dmi')
|
||||
hud_used.vampire_blood_display.maptext_width = 64
|
||||
hud_used.vampire_blood_display.maptext_height = 26
|
||||
hud_used.vampire_blood_display.maptext = "<div align='left' valign='top' style='position:relative; top:0px; left:6px'> U:<font color='#33FF33' size='1'>[mind.vampire.bloodusable]</font><br> T:<font color='#FFFF00' size='1'>[mind.vampire.bloodtotal]</font></div>"
|
||||
handle_vampire_cloak()
|
||||
if(istype(loc, /turf/space))
|
||||
check_sun()
|
||||
if(istype(loc.loc, /area/chapel) && !(VAMP_FULL in src.mind.vampire.powers))
|
||||
vamp_burn()
|
||||
mind.vampire.nullified = max(0, mind.vampire.nullified - 1)
|
||||
|
||||
mob/living/carbon/human/proc/vamp_burn()
|
||||
if(prob(35))
|
||||
switch(health)
|
||||
if(80 to 100)
|
||||
@@ -481,16 +500,4 @@ You are weak to holy things and starlight. Don't go into space and avoid the Cha
|
||||
fire_stacks++
|
||||
IgniteMob()
|
||||
adjustFireLoss(3)
|
||||
|
||||
/mob/living/carbon/human/proc/handle_vampire()
|
||||
if(hud_used)
|
||||
if(!hud_used.vampire_blood_display)
|
||||
hud_used.vampire_hud()
|
||||
hud_used.human_hud('icons/mob/screen1_Vampire.dmi')
|
||||
hud_used.vampire_blood_display.maptext_width = 64
|
||||
hud_used.vampire_blood_display.maptext_height = 26
|
||||
hud_used.vampire_blood_display.maptext = "<div align='left' valign='top' style='position:relative; top:0px; left:6px'> U:<font color='#33FF33' size='1'>[mind.vampire.bloodusable]</font><br> T:<font color='#FFFF00' size='1'>[mind.vampire.bloodtotal]</font></div>"
|
||||
handle_vampire_cloak()
|
||||
if(istype(loc, /turf/space))
|
||||
check_sun()
|
||||
mind.vampire.nullified = max(0, mind.vampire.nullified - 1)
|
||||
return
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
|
||||
|
||||
/mob/proc/rightandwrong(var/summon_type) //0 = Summon Guns, 1 = Summon Magic
|
||||
var/list/gunslist = list("taser","egun","laser","revolver","detective","c20r","nuclear","deagle","gyrojet","pulse","silenced","cannon","doublebarrel","shotgun","combatshotgun","bulldog","mateba","sabr","crossbow","saw","car")
|
||||
var/list/magiclist = list("fireball","smoke","blind","mindswap","forcewall","knock","horsemask","charge", "summonitem", "wandnothing", "wanddeath", "wandresurrection", "wandpolymorph", "wandteleport", "wanddoor", "wandfireball", "staffhealing", "armor", "scrying", "staffdoor", "special")
|
||||
var/list/magicspeciallist = list("staffchange","staffanimation", "wandbelt", "contract", "staffchaos")
|
||||
usr << "<B>You summoned [summon_type ? "magic" : "guns"]!</B>"
|
||||
message_admins("[key_name_admin(usr, 1)] summoned [summon_type ? "magic" : "guns"]!")
|
||||
for(var/mob/living/carbon/human/H in player_list)
|
||||
@@ -19,8 +22,9 @@
|
||||
for(var/datum/objective/OBJ in H.mind.objectives)
|
||||
H << "<B>Objective #[obj_count]</B>: [OBJ.explanation_text]"
|
||||
obj_count++
|
||||
var/randomizeguns = pick("taser","egun","laser","revolver","detective","c20r","nuclear","deagle","gyrojet","pulse","silenced","cannon","doublebarrel","shotgun","combatshotgun","bulldog","mateba","sabr","crossbow","saw","car")
|
||||
var/randomizemagic = pick("fireball","smoke","blind","mindswap","forcewall","knock","horsemask","charge","wandnothing", "wanddeath", "wandresurrection", "wandpolymorph", "wandteleport", "wanddoor", "wandfireball", "staffchange", "staffhealing", "armor", "scrying")
|
||||
var/randomizeguns = pick(gunslist)
|
||||
var/randomizemagic = pick(magiclist)
|
||||
var/randomizemagicspecial = pick(magicspeciallist)
|
||||
if(!summon_type)
|
||||
switch (randomizeguns)
|
||||
if("taser")
|
||||
@@ -96,10 +100,12 @@
|
||||
new /obj/item/weapon/gun/magic/wand/teleport(get_turf(H))
|
||||
if("wanddoor")
|
||||
new /obj/item/weapon/gun/magic/wand/door(get_turf(H))
|
||||
if("staffchange")
|
||||
new /obj/item/weapon/gun/magic/staff/change(get_turf(H))
|
||||
if("wandfireball")
|
||||
new /obj/item/weapon/gun/magic/wand/fireball(get_turf(H))
|
||||
if("staffhealing")
|
||||
new /obj/item/weapon/gun/magic/staff/healing(get_turf(H))
|
||||
if("staffdoor")
|
||||
new /obj/item/weapon/gun/magic/staff/door(get_turf(H))
|
||||
if("armor")
|
||||
new /obj/item/clothing/suit/space/rig/wizard(get_turf(H))
|
||||
new /obj/item/clothing/head/helmet/space/rig/wizard(get_turf(H))
|
||||
@@ -110,4 +116,19 @@
|
||||
H.sight |= (SEE_MOBS|SEE_OBJS|SEE_TURFS)
|
||||
H.see_in_dark = 8
|
||||
H.see_invisible = SEE_INVISIBLE_LEVEL_TWO
|
||||
H << "\blue The walls suddenly disappear."
|
||||
H << "<span class='notice'>The walls suddenly disappear.</span>"
|
||||
|
||||
if("special")
|
||||
magiclist -= "special" //only one super OP item per summoning max
|
||||
switch (randomizemagicspecial)
|
||||
if("staffchange")
|
||||
new /obj/item/weapon/gun/magic/staff/change(get_turf(H))
|
||||
if("staffanimation")
|
||||
new /obj/item/weapon/gun/magic/staff/animate(get_turf(H))
|
||||
if("wandbelt")
|
||||
new /obj/item/weapon/storage/belt/wands/full(get_turf(H))
|
||||
if("contract")
|
||||
new /obj/item/weapon/contract(get_turf(H))
|
||||
if("staffchaos")
|
||||
new /obj/item/weapon/gun/magic/staff/chaos(get_turf(H))
|
||||
H << "<span class='notice'>You suddenly feel lucky.</span>"
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
var/temp = null
|
||||
var/max_uses = 5
|
||||
var/op = 1
|
||||
var/activepage
|
||||
|
||||
/obj/item/weapon/spellbook/attackby(obj/item/O as obj, mob/user as mob)
|
||||
if(istype(O, /obj/item/weapon/contract))
|
||||
@@ -31,14 +32,24 @@
|
||||
var/dat
|
||||
if(temp)
|
||||
dat = "[temp]<BR><BR><A href='byond://?src=\ref[src];temp=1'>Clear</A>"
|
||||
else
|
||||
dat = "<B>The Book of Spells:</B><BR>"
|
||||
dat += "Spells left to memorize: [uses]<BR>"
|
||||
else if(!activepage || activepage == "return")
|
||||
dat = "<B>The Book of Magic:</B><BR>"
|
||||
dat += "Uses remaining: [uses]<BR>"
|
||||
dat += "<HR>"
|
||||
dat += "<B>Memorize which spell:</B><BR>"
|
||||
dat += "<I>The number after the spell name is the cooldown time.</I><BR>"
|
||||
dat += "<A href='byond://?src=\ref[src];spell_choice=spells'>Learn and Improve Magical Abilities</A><BR>"
|
||||
dat += "<A href='byond://?src=\ref[src];spell_choice=artifacts'>Summon Magical Tools and Weapons</A><BR>"
|
||||
dat += "<A href='byond://?src=\ref[src];spell_choice=oneuse'>Cast Powerful One Time Spells</A><BR>"
|
||||
|
||||
dat += "<A href='byond://?src=\ref[src];spell_choice=noclothes'>Remove Clothes Requirement</A>"
|
||||
dat += "<HR>"
|
||||
dat += "<A href='byond://?src=\ref[src];spell_choice=rememorize'>Re-memorize Spells</A><BR>"
|
||||
else if (activepage == "spells")
|
||||
dat += "<B>Spells:</B><BR>"
|
||||
dat += "Spells that can be reused endlessly. Unless stated otherwise all spells require full wizard garb as a focus.<BR>"
|
||||
dat += "The number after the spell name is the cooldown time. You can reduce this number by spending more points on the spell.<BR>"
|
||||
|
||||
dat += "<HR>"
|
||||
|
||||
dat += "<A href='byond://?src=\ref[src];spell_choice=noclothes'>Remove Clothes Requirement</A><BR>"
|
||||
dat += "<b>Warning: this takes away 2 spell choices.</b><BR>"
|
||||
|
||||
dat += "<A href='byond://?src=\ref[src];spell_choice=magicmissile'>Magic Missile</A> (15)<BR>"
|
||||
@@ -56,6 +67,9 @@
|
||||
dat += "<A href='byond://?src=\ref[src];spell_choice=smoke'>Smoke</A> (10)<BR>"
|
||||
dat += "<I>This spell spawns a cloud of choking smoke at your location and does not require wizard garb.</I><BR>"
|
||||
|
||||
dat += "<A href='byond://?src=\ref[src];spell_choice=repulse'>Repulse</A> (40)<BR>"
|
||||
dat += "<I>This spell throws nearby objects away from you and knocks creatures down.</I><BR>"
|
||||
|
||||
dat += "<A href='byond://?src=\ref[src];spell_choice=blind'>Blind</A> (30)<BR>"
|
||||
dat += "<I>This spell temporarly blinds a single person and does not require wizard garb.</I><BR>"
|
||||
|
||||
@@ -86,6 +100,20 @@
|
||||
dat += "<A href='byond://?src=\ref[src];spell_choice=fleshtostone'>Flesh to Stone</A> (60)<BR>"
|
||||
dat += "<I>This spell will curse a person to immediately turn into an unmoving statue. The effect will eventually wear off if the statue is not destroyed.</I><BR>"
|
||||
|
||||
dat += "<A href='byond://?src=\ref[src];spell_choice=summonitem'>Instant Summons</A> (10)<BR>"
|
||||
dat += "<I>This spell can be used to bind a valuable item to you, bringing it to your hand at will. Using this spell while holding the bound item will allow you to unbind it. It does not require wizard garb.</I><BR>"
|
||||
|
||||
dat += "<HR>"
|
||||
|
||||
dat += "<A href='byond://?src=\ref[src];spell_choice=return'><B>Return</B></A><BR>"
|
||||
|
||||
else if (activepage == "oneuse")
|
||||
dat += "<B>One Time Spells:</B><BR>"
|
||||
dat += "These potent spells can only be used once and will be used automatically upon purchase.<BR>"
|
||||
dat += "The effects are global and irreversable, these spells cannot be unlearned, but they can be bought multiple times.<BR>"
|
||||
|
||||
dat += "<HR>"
|
||||
|
||||
dat += "<A href='byond://?src=\ref[src];spell_choice=summonguns'>Summon Guns</A> (One time use, global spell)<BR>"
|
||||
dat += "<I>Nothing could possibly go wrong with arming a crew of lunatics just itching for an excuse to kill eachother. Just be careful not to get hit in the crossfire!</I><BR>"
|
||||
|
||||
@@ -93,9 +121,14 @@
|
||||
dat += "<I>Share the wonders of magic with the crew and show them why they aren't to be trusted with it at the same time.</I><BR>"
|
||||
|
||||
dat += "<HR>"
|
||||
|
||||
dat += "<A href='byond://?src=\ref[src];spell_choice=return'><B>Return</B></A><BR>"
|
||||
|
||||
else if (activepage == "artifacts")
|
||||
|
||||
dat += "<B>Artefacts:</B><BR>"
|
||||
dat += "Powerful items imbued with eldritch magics. Summoning one will count towards your maximum number of spells.<BR>"
|
||||
dat += "It is recommended that only experienced wizards attempt to wield such artefacts.<BR>"
|
||||
dat += "Powerful items imbued with eldritch magics. Summoning one will count towards your maximum number of uses.<BR>"
|
||||
dat += "These items are not bound to you and can be stolen. Additionaly they cannot typically be returned once purchased.<BR>"
|
||||
dat += "<HR>"
|
||||
|
||||
dat += "<A href='byond://?src=\ref[src];spell_choice=staffchange'>Staff of Change</A><BR>"
|
||||
@@ -106,14 +139,26 @@
|
||||
dat += "<I>Soul Stone Shards are ancient tools capable of capturing and harnessing the spirits of the dead and dying. The spell Artificer allows you to create arcane machines for the captured souls to pilot.</I><BR>"
|
||||
dat += "<HR>"
|
||||
|
||||
dat += "<A href='byond://?src=\ref[src];spell_choice=armor'>Mastercrafted Armor Set</A><BR>"
|
||||
dat += "<I>An artefact suit of armor that allows you to cast spells while providing more protection against attacks and the void of space.</I><BR>"
|
||||
dat += "<HR>"
|
||||
|
||||
dat += "<A href='byond://?src=\ref[src];spell_choice=staffanimation'>Staff of Animation</A><BR>"
|
||||
dat += "<I>An arcane staff capable of shooting bolts of eldritch energy which cause inanimate objects to come to life. This magic doesn't affect machines.</I><BR>"
|
||||
dat += "<HR>"
|
||||
|
||||
dat += "<A href='byond://?src=\ref[src];spell_choice=staffdoor'>Staff of Door Creation</A><BR>"
|
||||
dat += "<I>A particular staff that can mold solid metal into ornate wooden doors. Useful for getting around in the absence of other transportation. Does not work on glass.</I><BR>"
|
||||
dat += "<HR>"
|
||||
|
||||
dat += "<A href='byond://?src=\ref[src];spell_choice=staffchaos'>Staff of Chaos</A><BR>"
|
||||
dat += "<I>A caprious tool that can fire all sorts of magic without any rhyme or reason. Using it on people you care about is not recommended.</I><BR>"
|
||||
dat += "<HR>"
|
||||
|
||||
dat += "<A href='byond://?src=\ref[src];spell_choice=wands'>Wand Assortment</A><BR>"
|
||||
dat += "<I>A collection of wands that allow for a wide variety of utility. Wands do not recharge, so be conservative in use. Comes in a handy belt.</I><BR>"
|
||||
dat += "<HR>"
|
||||
|
||||
dat += "<A href='byond://?src=\ref[src];spell_choice=armor'>Mastercrafted Armor Set</A><BR>"
|
||||
dat += "<I>An artefact suit of armor that allows you to cast spells while providing more protection against attacks and the void of space.</I><BR>"
|
||||
dat += "<HR>"
|
||||
|
||||
dat += "<A href='byond://?src=\ref[src];spell_choice=contract'>Contract of Apprenticeship</A><BR>"
|
||||
dat += "<I>A magical contract binding an apprentice wizard to your service, using it will summon them to your side.</I><BR>"
|
||||
dat += "<HR>"
|
||||
@@ -122,7 +167,7 @@
|
||||
dat += "<I>An incandescent orb of crackling energy, using it will allow you to ghost while alive, allowing you to spy upon the station with ease. In addition, buying it will permanently grant you x-ray vision.</I><BR>"
|
||||
|
||||
dat += "<HR>"
|
||||
dat += "<A href='byond://?src=\ref[src];spell_choice=rememorize'>Re-memorize Spells</A><BR>"
|
||||
dat += "<A href='byond://?src=\ref[src];spell_choice=return'><B>Return</B></A><BR>"
|
||||
user << browse(dat, "window=radio")
|
||||
onclose(user, "radio")
|
||||
return
|
||||
@@ -152,11 +197,13 @@
|
||||
feedback_add_details("wizard_spell_learned","UM") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells
|
||||
else
|
||||
temp = "You may only re-memorize spells whilst located inside the wizard sanctuary."
|
||||
else if(href_list["spell_choice"] == "spells" || href_list["spell_choice"] == "artifacts" || href_list["spell_choice"] == "oneuse" || href_list["spell_choice"] == "return")
|
||||
activepage = href_list["spell_choice"]
|
||||
else if(uses >= 1 && max_uses >=1)
|
||||
uses--
|
||||
/*
|
||||
*/
|
||||
var/list/available_spells = list(magicmissile = "Magic Missile", fireball = "Fireball", disintegrate = "Disintegrate", disabletech = "Disable Tech", smoke = "Smoke", blind = "Blind", mindswap = "Mind Transfer", forcewall = "Forcewall", blink = "Blink", teleport = "Teleport", mutate = "Mutate", etherealjaunt = "Ethereal Jaunt", knock = "Knock", horseman = "Curse of the Horseman", fleshtostone = "Flesh to Stone", summonguns = "Summon Guns", summonmagic = "Summon Magic", staffchange = "Staff of Change", soulstone = "Six Soul Stone Shards and the spell Artificer", armor = "Mastercrafted Armor Set", staffanimate = "Staff of Animation")
|
||||
var/list/available_spells = list(magicmissile = "Magic Missile", fireball = "Fireball", disintegrate = "Disintegrate", disabletech = "Disable Tech", repulse = "Repulse", smoke = "Smoke", blind = "Blind", mindswap = "Mind Transfer", forcewall = "Forcewall", blink = "Blink", teleport = "Teleport", mutate = "Mutate", etherealjaunt = "Ethereal Jaunt", knock = "Knock", horseman = "Curse of the Horseman", fleshtostone = "Flesh to Stone", summonitem = "Instant Summons", summonguns = "Summon Guns", summonmagic = "Summon Magic", staffchange = "Staff of Change", soulstone = "Six Soul Stone Shards and the spell Artificer", armor = "Mastercrafted Armor Set", staffanimate = "Staff of Animation", staffchaos = "Staff of Chaos", staffdoor = "Staff of Door Creation", wands = "Wand Assortment")
|
||||
var/already_knows = 0
|
||||
for(var/obj/effect/proc_holder/spell/wizard/aspell in H.spell_list)
|
||||
if(available_spells[href_list["spell_choice"]] == initial(aspell.name))
|
||||
@@ -194,7 +241,7 @@
|
||||
feedback_add_details("wizard_spell_learned","NC")
|
||||
H.spell_list += new /obj/effect/proc_holder/spell/wizard/noclothes
|
||||
temp = "This teaches you how to use your spells without your magical garb, truely you are the wizardest."
|
||||
uses--
|
||||
uses -= 2
|
||||
if("magicmissile")
|
||||
feedback_add_details("wizard_spell_learned","MM") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells
|
||||
H.spell_list += new /obj/effect/proc_holder/spell/wizard/targeted/projectile/magic_missile(H)
|
||||
@@ -211,6 +258,10 @@
|
||||
feedback_add_details("wizard_spell_learned","DT") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells
|
||||
H.spell_list += new /obj/effect/proc_holder/spell/wizard/targeted/emplosion/disable_tech(H)
|
||||
temp = "You have learned disable technology."
|
||||
if("repulse")
|
||||
feedback_add_details("wizard_spell_learned","RP") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells
|
||||
H.spell_list += new /obj/effect/proc_holder/spell/wizard/aoe_turf/repulse(null)
|
||||
temp = "You have learned repulse."
|
||||
if("smoke")
|
||||
feedback_add_details("wizard_spell_learned","SM") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells
|
||||
H.spell_list += new /obj/effect/proc_holder/spell/wizard/targeted/smoke(H)
|
||||
@@ -255,24 +306,20 @@
|
||||
feedback_add_details("wizard_spell_learned","FS") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells
|
||||
H.spell_list += new /obj/effect/proc_holder/spell/wizard/targeted/inflict_handler/flesh_to_stone(H)
|
||||
temp = "You have learned flesh to stone."
|
||||
if("summonitem")
|
||||
feedback_add_details("wizard_spell_learned","IS") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells
|
||||
H.spell_list += new /obj/effect/proc_holder/spell/wizard/targeted/summonitem(null)
|
||||
temp = "You have learned instant summons."
|
||||
if("summonguns")
|
||||
if(max_uses < 5)
|
||||
temp = "You need 5 slots for this spell"
|
||||
return
|
||||
else
|
||||
feedback_add_details("wizard_spell_learned","SG") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells
|
||||
H.rightandwrong(0)
|
||||
max_uses-=5
|
||||
temp = "You have cast summon guns."
|
||||
feedback_add_details("wizard_spell_learned","SG") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells
|
||||
H.rightandwrong(0)
|
||||
max_uses--
|
||||
temp = "You have cast summon guns."
|
||||
if("summonmagic")
|
||||
if(max_uses < 5)
|
||||
temp = "You need 5 slots for this spell"
|
||||
return
|
||||
else
|
||||
feedback_add_details("wizard_spell_learned","SM") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells
|
||||
H.rightandwrong(1)
|
||||
max_uses-=5
|
||||
temp = "You have cast summon magic."
|
||||
feedback_add_details("wizard_spell_learned","SM") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells
|
||||
H.rightandwrong(1)
|
||||
max_uses--
|
||||
temp = "You have cast summon magic."
|
||||
if("staffchange")
|
||||
feedback_add_details("wizard_spell_learned","ST") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells
|
||||
new /obj/item/weapon/gun/magic/staff/change(get_turf(H))
|
||||
@@ -297,6 +344,21 @@
|
||||
new /obj/item/weapon/gun/magic/staff/animate(get_turf(H))
|
||||
temp = "You have purchased a staff of animation."
|
||||
max_uses--
|
||||
if("staffchaos")
|
||||
feedback_add_details("wizard_spell_learned","SC") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells
|
||||
new /obj/item/weapon/gun/magic/staff/chaos(get_turf(H))
|
||||
temp = "You have purchased a staff of chaos."
|
||||
max_uses--
|
||||
if("staffdoor")
|
||||
feedback_add_details("wizard_spell_learned","SD") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells
|
||||
new /obj/item/weapon/gun/magic/staff/door(get_turf(H))
|
||||
temp = "You have purchased a staff of door creation."
|
||||
max_uses--
|
||||
if("wands")
|
||||
feedback_add_details("wizard_spell_learned","WA") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells
|
||||
new /obj/item/weapon/storage/belt/wands/full(get_turf(H))
|
||||
temp = "You have purchased an assortment of wands."
|
||||
max_uses--
|
||||
if("contract")
|
||||
feedback_add_details("wizard_spell_learned","CT") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells
|
||||
new /obj/item/weapon/contract(get_turf(H))
|
||||
@@ -317,6 +379,7 @@
|
||||
else
|
||||
if(href_list["temp"])
|
||||
temp = null
|
||||
activepage = null
|
||||
attack_self(H)
|
||||
|
||||
return
|
||||
@@ -510,4 +573,15 @@
|
||||
/obj/item/weapon/spellbook/oneuse/charge/recoil(mob/user as mob)
|
||||
..()
|
||||
user <<"<span class='warning'>[src] suddenly feels very warm!</span>"
|
||||
empulse(src, 1, 1)
|
||||
empulse(src, 1, 1)
|
||||
|
||||
/obj/item/weapon/spellbook/oneuse/summonitem
|
||||
spell = /obj/effect/proc_holder/spell/wizard/targeted/summonitem
|
||||
spellname = "instant summons"
|
||||
icon_state ="booksummons"
|
||||
desc = "This book is bright and garish, very hard to miss."
|
||||
|
||||
/obj/item/weapon/spellbook/oneuse/summonitem/recoil(mob/user as mob)
|
||||
..()
|
||||
user <<"<span class='warning'>[src] suddenly vanishes!</span>"
|
||||
qdel(src)
|
||||
|
||||
@@ -67,11 +67,9 @@
|
||||
/var/const/access_xenoarch = 65
|
||||
/var/const/access_paramedic = 66
|
||||
/var/const/access_blueshield = 67
|
||||
/var/const/access_customs = 68
|
||||
/var/const/access_salvage_captain = 69 // Salvage ship captain's quarters
|
||||
/var/const/access_mechanic = 70
|
||||
/var/const/access_pilot = 71
|
||||
/var/const/access_ntrec = 72
|
||||
/var/const/access_ntrep = 73
|
||||
/var/const/access_magistrate = 74
|
||||
/var/const/access_minisat = 75
|
||||
@@ -238,8 +236,8 @@
|
||||
access_hydroponics, access_library, access_lawyer, access_virology, access_psychiatrist, access_cmo, access_qm, access_clown, access_mime, access_surgery,
|
||||
access_theatre, access_research, access_mining, access_mailsorting,
|
||||
access_heads_vault, access_mining_station, access_xenobiology, access_ce, access_hop, access_hos, access_RC_announce,
|
||||
access_keycard_auth, access_tcomsat, access_gateway, access_xenoarch, access_paramedic, access_blueshield, access_customs, access_mechanic,access_weapons,
|
||||
access_pilot, access_ntrec, access_ntrep, access_magistrate, access_minisat)
|
||||
access_keycard_auth, access_tcomsat, access_gateway, access_xenoarch, access_paramedic, access_blueshield, access_mechanic,access_weapons,
|
||||
access_pilot, access_ntrep, access_magistrate, access_minisat)
|
||||
|
||||
/proc/get_all_centcom_access()
|
||||
return list(access_cent_general, access_cent_thunder, access_cent_specops, access_cent_medical, access_cent_living, access_cent_storage, access_cent_teleporter, access_cent_creed, access_cent_captain)
|
||||
@@ -252,7 +250,7 @@
|
||||
if(0)
|
||||
return get_all_accesses()
|
||||
if(1) //security
|
||||
return list(access_sec_doors, access_security, access_brig, access_armory, access_forensics_lockers, access_court, access_customs, access_pilot, access_hos)
|
||||
return list(access_sec_doors, access_security, access_brig, access_armory, access_forensics_lockers, access_court, access_pilot, access_hos)
|
||||
if(2) //medbay
|
||||
return list(access_medical, access_genetics, access_morgue, access_chemistry, access_psychiatrist, access_virology, access_surgery, access_cmo, access_paramedic)
|
||||
if(3) //research
|
||||
@@ -260,7 +258,7 @@
|
||||
if(4) //engineering and maintenance
|
||||
return list(access_construction, access_maint_tunnels, access_engine, access_engine_equip, access_external_airlocks, access_tech_storage, access_atmospherics, access_minisat, access_ce, access_mechanic)
|
||||
if(5) //command
|
||||
return list(access_heads, access_RC_announce, access_keycard_auth, access_change_ids, access_ai_upload, access_teleporter, access_eva, access_tcomsat, access_gateway, access_all_personal_lockers, access_heads_vault, access_blueshield, access_ntrec, access_ntrep, access_hop, access_captain)
|
||||
return list(access_heads, access_RC_announce, access_keycard_auth, access_change_ids, access_ai_upload, access_teleporter, access_eva, access_tcomsat, access_gateway, access_all_personal_lockers, access_heads_vault, access_blueshield, access_ntrep, access_hop, access_captain)
|
||||
if(6) //station general
|
||||
return list(access_kitchen,access_bar, access_hydroponics, access_janitor, access_chapel_office, access_crematorium, access_library, access_theatre, access_lawyer, access_magistrate, access_clown, access_mime)
|
||||
if(7) //supply
|
||||
@@ -420,14 +418,10 @@
|
||||
return "Brig"
|
||||
if(access_blueshield)
|
||||
return "Blueshield"
|
||||
if(access_ntrec)
|
||||
return "Nanotrasen Recruiter"
|
||||
if(access_ntrep)
|
||||
return "Nanotrasen Rep."
|
||||
if(access_paramedic)
|
||||
return "Paramedic"
|
||||
if(access_customs)
|
||||
return "Customs"
|
||||
if(access_mechanic)
|
||||
return "Mechanic Workshop"
|
||||
if(access_pilot)
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
selection_color = "#dddddd"
|
||||
access = list() //See /datum/job/assistant/get_access()
|
||||
minimal_access = list() //See /datum/job/assistant/get_access()
|
||||
alt_titles = list("Tourist","Businessman","Trader")
|
||||
alt_titles = list("Tourist","Businessman","Trader","Assistant")
|
||||
|
||||
/datum/job/civilian/equip(var/mob/living/carbon/human/H)
|
||||
if(!H) return 0
|
||||
@@ -21,4 +21,7 @@
|
||||
return 1
|
||||
|
||||
/datum/job/civilian/get_access()
|
||||
return list()
|
||||
if(config.assistant_maint)
|
||||
return list(access_maint_tunnels)
|
||||
else
|
||||
return list()
|
||||
@@ -9,13 +9,13 @@
|
||||
idtype = /obj/item/weapon/card/id/silver
|
||||
req_admin_notify = 1
|
||||
access = list(access_security, access_sec_doors, access_brig, access_armory, access_court,
|
||||
access_forensics_lockers, access_customs, access_pilot, access_morgue, access_maint_tunnels, access_all_personal_lockers,
|
||||
access_forensics_lockers, access_pilot, access_morgue, access_maint_tunnels, access_all_personal_lockers,
|
||||
access_research, access_engine, access_mining, access_medical, access_construction, access_mailsorting,
|
||||
access_heads, access_hos, access_RC_announce, access_keycard_auth, access_gateway, access_weapons)
|
||||
minimal_access = list(access_eva, access_security, access_sec_doors, access_brig, access_armory, access_court,
|
||||
access_forensics_lockers, access_morgue, access_maint_tunnels, access_all_personal_lockers,
|
||||
access_research, access_engine, access_mining, access_medical, access_construction, access_mailsorting,
|
||||
access_heads, access_hos, access_RC_announce, access_keycard_auth, access_gateway, access_customs, access_pilot, access_weapons)
|
||||
access_heads, access_hos, access_RC_announce, access_keycard_auth, access_gateway, access_pilot, access_weapons)
|
||||
minimal_player_age = 21
|
||||
|
||||
equip(var/mob/living/carbon/human/H)
|
||||
@@ -24,7 +24,7 @@
|
||||
if(2) H.equip_or_collect(new /obj/item/weapon/storage/backpack/security(H), slot_back)
|
||||
if(3) H.equip_or_collect(new /obj/item/weapon/storage/backpack/satchel_sec(H), slot_back)
|
||||
if(4) H.equip_or_collect(new /obj/item/weapon/storage/backpack/satchel(H), slot_back)
|
||||
H.equip_or_collect(new /obj/item/device/radio/headset/heads/hos(H), slot_l_ear)
|
||||
H.equip_or_collect(new /obj/item/device/radio/headset/heads/hos/alt(H), slot_l_ear)
|
||||
H.equip_or_collect(new /obj/item/clothing/under/rank/head_of_security(H), slot_w_uniform)
|
||||
H.equip_or_collect(new /obj/item/clothing/shoes/jackboots(H), slot_shoes)
|
||||
H.equip_or_collect(new /obj/item/clothing/suit/armor/hos(H), slot_wear_suit)
|
||||
@@ -64,7 +64,7 @@
|
||||
|
||||
equip(var/mob/living/carbon/human/H)
|
||||
if(!H) return 0
|
||||
H.equip_or_collect(new /obj/item/device/radio/headset/headset_sec(H), slot_l_ear)
|
||||
H.equip_or_collect(new /obj/item/device/radio/headset/headset_sec/alt(H), slot_l_ear)
|
||||
switch(H.backbag)
|
||||
if(2) H.equip_or_collect(new /obj/item/weapon/storage/backpack/security(H), slot_back)
|
||||
if(3) H.equip_or_collect(new /obj/item/weapon/storage/backpack/satchel_sec(H), slot_back)
|
||||
@@ -111,7 +111,7 @@
|
||||
minimal_player_age = 14
|
||||
equip(var/mob/living/carbon/human/H)
|
||||
if(!H) return 0
|
||||
H.equip_or_collect(new /obj/item/device/radio/headset/headset_sec(H), slot_l_ear)
|
||||
H.equip_or_collect(new /obj/item/device/radio/headset/headset_sec/alt(H), slot_l_ear)
|
||||
switch(H.backbag)
|
||||
if(2) H.equip_or_collect(new /obj/item/weapon/storage/backpack(H), slot_back)
|
||||
if(3) H.equip_or_collect(new /obj/item/weapon/storage/backpack/satchel_norm(H), slot_back)
|
||||
@@ -166,7 +166,7 @@
|
||||
minimal_player_age = 14
|
||||
equip(var/mob/living/carbon/human/H)
|
||||
if(!H) return 0
|
||||
H.equip_or_collect(new /obj/item/device/radio/headset/headset_sec(H), slot_l_ear)
|
||||
H.equip_or_collect(new /obj/item/device/radio/headset/headset_sec/alt(H), slot_l_ear)
|
||||
switch(H.backbag)
|
||||
if(2) H.equip_or_collect(new /obj/item/weapon/storage/backpack/security(H), slot_back)
|
||||
if(3) H.equip_or_collect(new /obj/item/weapon/storage/backpack/satchel_sec(H), slot_back)
|
||||
@@ -174,7 +174,7 @@
|
||||
H.equip_or_collect(new /obj/item/clothing/under/rank/security(H), slot_w_uniform)
|
||||
H.equip_or_collect(new /obj/item/clothing/shoes/jackboots(H), slot_shoes)
|
||||
H.equip_or_collect(new /obj/item/clothing/suit/armor/vest/security(H), slot_wear_suit)
|
||||
H.equip_to_slot_or_del(new /obj/item/clothing/head/soft/sec(H), slot_head)
|
||||
H.equip_to_slot_or_del(new /obj/item/clothing/head/helmet(H), slot_head)
|
||||
H.equip_or_collect(new /obj/item/device/pda/security(H), slot_wear_pda)
|
||||
H.equip_or_collect(new /obj/item/weapon/gun/energy/advtaser(H), slot_s_store)
|
||||
H.equip_or_collect(new /obj/item/device/flash(H), slot_l_store)
|
||||
@@ -192,42 +192,6 @@
|
||||
L.part = affected
|
||||
return 1
|
||||
|
||||
|
||||
/datum/job/customs
|
||||
title = "Customs Officer"
|
||||
flag = CUSTOMS
|
||||
department_flag = KARMA
|
||||
total_positions = 2
|
||||
spawn_positions = 2
|
||||
supervisors = "the head of security"
|
||||
selection_color = "#ffeeee"
|
||||
access = list(access_security, access_sec_doors, access_brig, access_court, access_maint_tunnels, access_morgue, access_weapons)
|
||||
minimal_access = list(access_brig, access_sec_doors, access_security, access_customs, access_maint_tunnels, access_weapons)
|
||||
minimal_player_age = 7
|
||||
equip(var/mob/living/carbon/human/H)
|
||||
if(!H) return 0
|
||||
H.equip_or_collect(new /obj/item/device/radio/headset/headset_sec(H), slot_l_ear)
|
||||
switch(H.backbag)
|
||||
if(2) H.equip_or_collect(new /obj/item/weapon/storage/backpack/security(H), slot_back)
|
||||
if(3) H.equip_or_collect(new /obj/item/weapon/storage/backpack/satchel_sec(H), slot_back)
|
||||
if(4) H.equip_or_collect(new /obj/item/weapon/storage/backpack/satchel(H), slot_back)
|
||||
H.equip_or_collect(new /obj/item/clothing/under/fluff/milo_hachert(H), slot_w_uniform)
|
||||
H.equip_or_collect(new /obj/item/clothing/shoes/jackboots(H), slot_shoes)
|
||||
H.equip_or_collect(new /obj/item/clothing/head/customs(H), slot_head)
|
||||
H.equip_or_collect(new /obj/item/device/pda/security(H), slot_wear_pda)
|
||||
H.equip_or_collect(new /obj/item/weapon/gun/energy/advtaser(H), slot_s_store)
|
||||
H.equip_or_collect(new /obj/item/device/flash(H), slot_l_store)
|
||||
H.equip_or_collect(new /obj/item/weapon/storage/box/survival(H.back), slot_in_backpack)
|
||||
H.equip_or_collect(new /obj/item/weapon/stamp(H), slot_in_backpack)
|
||||
H.equip_or_collect(new /obj/item/weapon/stamp/denied(H), slot_in_backpack)
|
||||
var/obj/item/weapon/implant/loyalty/L = new/obj/item/weapon/implant/loyalty(H)
|
||||
L.imp_in = H
|
||||
L.implanted = 1
|
||||
var/datum/organ/external/affected = H.organs_by_name["head"]
|
||||
affected.implants += L
|
||||
L.part = affected
|
||||
return 1
|
||||
|
||||
/datum/job/brigdoc
|
||||
title = "Brig Physician"
|
||||
flag = BRIGDOC
|
||||
@@ -241,7 +205,7 @@
|
||||
|
||||
equip(var/mob/living/carbon/human/H)
|
||||
if(!H) return 0
|
||||
H.equip_or_collect(new /obj/item/device/radio/headset/headset_sec(H), slot_l_ear)
|
||||
H.equip_or_collect(new /obj/item/device/radio/headset/headset_sec/alt(H), slot_l_ear)
|
||||
switch(H.backbag)
|
||||
if(2) H.equip_or_collect(new /obj/item/weapon/storage/backpack/medic(H), slot_back)
|
||||
if(3) H.equip_or_collect(new /obj/item/weapon/storage/backpack/satchel_med(H), slot_back)
|
||||
@@ -278,7 +242,7 @@
|
||||
minimal_player_age = 7
|
||||
equip(var/mob/living/carbon/human/H)
|
||||
if(!H) return 0
|
||||
H.equip_or_collect(new /obj/item/device/radio/headset/headset_sec(H), slot_l_ear)
|
||||
H.equip_or_collect(new /obj/item/device/radio/headset/headset_sec/alt(H), slot_l_ear)
|
||||
switch(H.backbag)
|
||||
if(2) H.equip_or_collect(new /obj/item/weapon/storage/backpack/security(H), slot_back)
|
||||
if(3) H.equip_or_collect(new /obj/item/weapon/storage/backpack/satchel_sec(H), slot_back)
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
minimal_player_age = 30
|
||||
equip(var/mob/living/carbon/human/H)
|
||||
if(!H) return 0
|
||||
H.equip_or_collect(new /obj/item/device/radio/headset/heads/captain(H), slot_l_ear)
|
||||
H.equip_or_collect(new /obj/item/device/radio/headset/heads/captain/alt(H), slot_l_ear)
|
||||
switch(H.backbag)
|
||||
if(2) H.equip_or_collect(new /obj/item/weapon/storage/backpack/captain(H), slot_back)
|
||||
if(3) H.equip_or_collect(new /obj/item/weapon/storage/backpack/satchel_cap(H), slot_back)
|
||||
@@ -68,7 +68,7 @@
|
||||
access_all_personal_lockers, access_maint_tunnels, access_bar, access_janitor, access_construction, access_morgue,
|
||||
access_crematorium, access_kitchen, access_cargo, access_cargo_bot, access_mailsorting, access_qm, access_hydroponics, access_lawyer,
|
||||
access_theatre, access_chapel_office, access_library, access_research, access_mining, access_heads_vault, access_mining_station,
|
||||
access_clown, access_mime, access_hop, access_RC_announce, access_keycard_auth, access_gateway, access_customs, access_weapons)
|
||||
access_clown, access_mime, access_hop, access_RC_announce, access_keycard_auth, access_gateway, access_weapons)
|
||||
|
||||
|
||||
equip(var/mob/living/carbon/human/H)
|
||||
@@ -136,50 +136,6 @@
|
||||
L.part = affected
|
||||
return 1
|
||||
|
||||
/datum/job/nanotrasenrec
|
||||
title = "Nanotrasen Recruiter"
|
||||
flag = NANOREC
|
||||
department_flag = KARMA
|
||||
total_positions = 1
|
||||
spawn_positions = 1
|
||||
supervisors = "the Nanotrasen Board of Directors"
|
||||
selection_color = "#ddddff"
|
||||
idtype = /obj/item/weapon/card/id/centcom
|
||||
req_admin_notify = 1
|
||||
minimal_player_age = 21
|
||||
access = list(access_security, access_sec_doors, access_brig, access_court, access_forensics_lockers,
|
||||
access_medical, access_engine, access_change_ids, access_ai_upload, access_eva, access_heads, access_change_ids,
|
||||
access_all_personal_lockers, access_maint_tunnels, access_bar, access_janitor, access_construction, access_morgue,
|
||||
access_crematorium, access_kitchen, access_cargo, access_cargo_bot, access_mailsorting, access_qm, access_hydroponics, access_lawyer,
|
||||
access_theatre, access_chapel_office, access_library, access_research, access_mining, access_heads_vault, access_mining_station,
|
||||
access_clown, access_mime, access_hop, access_RC_announce, access_keycard_auth, access_gateway, access_ntrec)
|
||||
minimal_access = list(access_security, access_sec_doors, access_brig, access_court, access_forensics_lockers,
|
||||
access_medical, access_engine, access_ai_upload, access_eva, access_heads, access_change_ids,
|
||||
access_all_personal_lockers, access_maint_tunnels, access_bar, access_janitor, access_construction, access_morgue,
|
||||
access_crematorium, access_kitchen, access_cargo, access_cargo_bot, access_mailsorting, access_qm, access_hydroponics, access_lawyer,
|
||||
access_theatre, access_chapel_office, access_library, access_research, access_mining, access_heads_vault, access_mining_station,
|
||||
access_clown, access_mime, access_hop, access_RC_announce, access_keycard_auth, access_gateway, access_ntrec)
|
||||
|
||||
equip(var/mob/living/carbon/human/H)
|
||||
if(!H) return 0
|
||||
H.equip_or_collect(new /obj/item/device/radio/headset/heads/ntrec(H), slot_l_ear)
|
||||
switch(H.backbag)
|
||||
if(2) H.equip_or_collect(new /obj/item/weapon/storage/backpack(H), slot_back)
|
||||
if(3) H.equip_or_collect(new /obj/item/weapon/storage/backpack/satchel_norm(H), slot_back)
|
||||
if(4) H.equip_or_collect(new /obj/item/weapon/storage/backpack/satchel(H), slot_back)
|
||||
H.equip_or_collect(new /obj/item/weapon/storage/box/survival(H.back), slot_in_backpack)
|
||||
H.equip_or_collect(new /obj/item/weapon/lighter/zippo/fluff/nt_rep(H.back), slot_in_backpack)
|
||||
H.equip_if_possible(new /obj/item/clothing/under/rank/centcom/representative(H), slot_w_uniform)
|
||||
H.equip_if_possible(new /obj/item/clothing/shoes/centcom(H), slot_shoes)
|
||||
H.equip_or_collect(new /obj/item/device/pda/heads/ntrec(H), slot_wear_pda)
|
||||
var/obj/item/weapon/implant/loyalty/L = new/obj/item/weapon/implant/loyalty(H)
|
||||
L.imp_in = H
|
||||
L.implanted = 1
|
||||
var/datum/organ/external/affected = H.organs_by_name["head"]
|
||||
affected.implants += L
|
||||
L.part = affected
|
||||
return 1
|
||||
|
||||
/datum/job/blueshield
|
||||
title = "Blueshield"
|
||||
flag = BLUESHIELD
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
|
||||
equip(var/mob/living/carbon/human/H)
|
||||
if(!H) return 0
|
||||
H.see_invisible = SEE_INVISIBLE_OBSERVER
|
||||
var/obj/item/weapon/storage/bible/B = new /obj/item/weapon/storage/bible(H) //BS12 EDIT
|
||||
H.equip_or_collect(B, slot_l_hand)
|
||||
H.equip_or_collect(new /obj/item/clothing/under/rank/chaplain(H), slot_w_uniform)
|
||||
|
||||
@@ -26,28 +26,6 @@
|
||||
new /obj/effect/forcefield/mime(locate(usr.x,usr.y,usr.z))
|
||||
return
|
||||
|
||||
///////////Mimewalls///////////
|
||||
|
||||
/obj/effect/forcefield/mime
|
||||
icon_state = "empty"
|
||||
name = "invisible wall"
|
||||
desc = "You have a bad feeling about this."
|
||||
var/timeleft = 300
|
||||
var/last_process = 0
|
||||
|
||||
/obj/effect/forcefield/mime/New()
|
||||
..()
|
||||
last_process = world.time
|
||||
processing_objects.Add(src)
|
||||
|
||||
/obj/effect/forcefield/mime/process()
|
||||
timeleft -= (world.time - last_process)
|
||||
if(timeleft <= 0)
|
||||
processing_objects.Remove(src)
|
||||
del(src)
|
||||
|
||||
///////////////////////////////
|
||||
|
||||
/client/proc/mimespeak()
|
||||
set category = "Mime"
|
||||
set name = "Speech"
|
||||
|
||||
@@ -50,13 +50,11 @@ var/const/KARMA =(1<<3)
|
||||
|
||||
var/const/NANO =(1<<0)
|
||||
var/const/BLUESHIELD =(1<<1)
|
||||
var/const/CUSTOMS =(1<<2)
|
||||
var/const/BARBER =(1<<3)
|
||||
var/const/MECHANIC =(1<<4)
|
||||
var/const/BRIGDOC =(1<<5)
|
||||
var/const/JUDGE =(1<<6)
|
||||
var/const/PILOT =(1<<7)
|
||||
var/const/NANOREC =(1<<8)
|
||||
|
||||
var/list/assistant_occupations = list(
|
||||
)
|
||||
@@ -116,7 +114,6 @@ var/list/support_positions = list(
|
||||
"Mime",
|
||||
"Barber",
|
||||
"Magistrate",
|
||||
"Nanotrasen Recruiter"
|
||||
)
|
||||
|
||||
|
||||
@@ -125,7 +122,6 @@ var/list/security_positions = list(
|
||||
"Warden",
|
||||
"Detective",
|
||||
"Security Officer",
|
||||
"Customs Officer",
|
||||
"Blueshield",
|
||||
"Brig Physician",
|
||||
"Security Pod Pilot"
|
||||
@@ -144,14 +140,12 @@ var/list/nonhuman_positions = list(
|
||||
|
||||
var/list/whitelisted_positions = list(
|
||||
"Blueshield",
|
||||
"Customs Officer",
|
||||
"Nanotrasen Representative",
|
||||
"Barber",
|
||||
"Mechanic",
|
||||
"Brig Physician",
|
||||
"Magistrate",
|
||||
"Security Pod Pilot",
|
||||
"Nanotrasen Recruiter"
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
anchored = 1.0
|
||||
use_power = 1
|
||||
current_heat_capacity = 1000
|
||||
layer = 3
|
||||
|
||||
/obj/machinery/atmospherics/unary/cold_sink/freezer/New()
|
||||
..()
|
||||
@@ -137,6 +138,7 @@
|
||||
density = 1
|
||||
var/max_temperature = 0
|
||||
anchored = 1.0
|
||||
layer = 3
|
||||
|
||||
current_heat_capacity = 1000
|
||||
|
||||
|
||||
@@ -242,6 +242,8 @@
|
||||
/obj/machinery/sleeper/upgraded/New()
|
||||
..()
|
||||
component_parts = list()
|
||||
component_parts += new /obj/item/weapon/circuitboard/sleeper(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/matter_bin/super(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/manipulator/pico(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/console_screen(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/console_screen(src)
|
||||
|
||||
@@ -620,7 +620,7 @@
|
||||
data["danger"]=danger
|
||||
return data
|
||||
|
||||
/obj/machinery/alarm/proc/get_nano_data(mob/user, fromAtmosConsole=0)
|
||||
/obj/machinery/alarm/proc/get_nano_data(mob/user, fromAtmosConsole=0, AtmosConsoleEmagged=0)
|
||||
|
||||
var/data[0]
|
||||
data["air"]=ui_air_status()
|
||||
@@ -631,7 +631,7 @@
|
||||
// Not sent from atmos console AND
|
||||
// Not silicon AND locked.
|
||||
data["locked"]=!fromAtmosConsole && (!(istype(user, /mob/living/silicon)) && locked)
|
||||
if(fromAtmosConsole && remote_control < 2)
|
||||
if(fromAtmosConsole && (remote_control < 2 && !AtmosConsoleEmagged))
|
||||
data["locked"] = 1
|
||||
data["rcon"]=rcon_setting
|
||||
data["target_temp"] = target_temperature - T0C
|
||||
|
||||
@@ -202,9 +202,10 @@ update_flag
|
||||
return
|
||||
|
||||
/obj/machinery/portable_atmospherics/canister/bullet_act(var/obj/item/projectile/Proj)
|
||||
if(Proj.damage)
|
||||
src.health -= round(Proj.damage / 2)
|
||||
healthcheck()
|
||||
if((Proj.damage_type == BRUTE || Proj.damage_type == BURN))
|
||||
if(Proj.damage)
|
||||
src.health -= round(Proj.damage / 2)
|
||||
healthcheck()
|
||||
..()
|
||||
|
||||
/obj/machinery/portable_atmospherics/canister/meteorhit(var/obj/O as obj)
|
||||
@@ -252,7 +253,7 @@ update_flag
|
||||
|
||||
/obj/machinery/portable_atmospherics/canister/attack_paw(var/mob/user as mob)
|
||||
return src.attack_hand(user)
|
||||
|
||||
|
||||
/obj/machinery/portable_atmospherics/canister/attack_alien(mob/living/carbon/alien/humanoid/user)
|
||||
return
|
||||
|
||||
|
||||
@@ -55,7 +55,18 @@
|
||||
|
||||
wires = new(src)
|
||||
files = new /datum/research/autolathe(src)
|
||||
|
||||
|
||||
/obj/machinery/autolathe/upgraded/New()
|
||||
..()
|
||||
component_parts = list()
|
||||
component_parts += new /obj/item/weapon/circuitboard/autolathe(null)
|
||||
component_parts += new /obj/item/weapon/stock_parts/matter_bin/super(null)
|
||||
component_parts += new /obj/item/weapon/stock_parts/matter_bin/super(null)
|
||||
component_parts += new /obj/item/weapon/stock_parts/matter_bin/super(null)
|
||||
component_parts += new /obj/item/weapon/stock_parts/manipulator/pico(null)
|
||||
component_parts += new /obj/item/weapon/stock_parts/console_screen(null)
|
||||
RefreshParts()
|
||||
|
||||
/obj/machinery/autolathe/interact(mob/user)
|
||||
if(shocked && !(stat & NOPOWER))
|
||||
shock(user,50)
|
||||
|
||||
@@ -58,7 +58,6 @@
|
||||
var/created_name = "ED-209 Security Robot" //To preserve the name if it's a unique securitron I guess
|
||||
var/lasercolor = ""
|
||||
|
||||
|
||||
/obj/machinery/bot/ed209/New(loc,created_name,created_lasercolor)
|
||||
..()
|
||||
if(created_name)
|
||||
@@ -660,8 +659,6 @@ Auto Patrol[]"},
|
||||
if(istype(W, /obj/item/weapon/screwdriver))
|
||||
playsound(loc, 'sound/items/Screwdriver.ogg', 100, 1)
|
||||
var/turf/T = get_turf(user)
|
||||
user << "<span class='notice'>Now attaching the gun to the frame...</span>"
|
||||
sleep(40)
|
||||
if(get_turf(user) == T)
|
||||
build_step++
|
||||
name = "armed [name]"
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
networks["Mining Outpost"] = list(access_qm,access_hop,access_hos,access_captain)
|
||||
networks["Research"] = list(access_rd,access_hos,access_captain)
|
||||
networks["Prison"] = list(access_hos,access_captain)
|
||||
networks["Labor"] = list(access_hos,access_captain)
|
||||
networks["Interrogation"] = list(access_hos,access_captain)
|
||||
networks["Atmosphere Alarms"] = list(access_ce,access_hos,access_captain)
|
||||
networks["Fire Alarms"] = list(access_ce,access_hos,access_captain)
|
||||
|
||||
@@ -63,10 +63,10 @@
|
||||
|
||||
/obj/machinery/computer/bullet_act(var/obj/item/projectile/Proj)
|
||||
if(prob(Proj.damage))
|
||||
set_broken()
|
||||
if((Proj.damage_type == BRUTE || Proj.damage_type == BURN))
|
||||
set_broken()
|
||||
..()
|
||||
|
||||
|
||||
/obj/machinery/computer/blob_act()
|
||||
if (prob(75))
|
||||
for(var/x in verbs)
|
||||
|
||||
@@ -38,8 +38,9 @@
|
||||
var/p = inserted_id:points
|
||||
var/g = inserted_id:goal
|
||||
dat += text("<A href='?src=\ref[src];id=1'>[inserted_id]</A><br>")
|
||||
dat += text("Collectd Points: [p]. <A href='?src=\ref[src];id=2'>Reset.</A><br>")
|
||||
dat += text("Collected points: [p]. <A href='?src=\ref[src];id=2'>Reset.</A><br>")
|
||||
dat += text("Card goal: [g]. <A href='?src=\ref[src];id=3'>Set </A><br>")
|
||||
dat += text("Space Law recommends sentences of 100 points per minute they would normally serve in the brig.<BR>")
|
||||
else
|
||||
dat += text("<A href='?src=\ref[src];id=0'>Insert Prisoner ID.</A><br>")
|
||||
dat += "<HR>Chemical Implants<BR>"
|
||||
|
||||
@@ -125,6 +125,7 @@
|
||||
if (!status)
|
||||
message_admins("\blue [key_name_admin(usr)] has initiated the global cyborg killswitch!")
|
||||
log_game("\blue [key_name(usr)] has initiated the global cyborg killswitch!")
|
||||
use_log += text("\[[time_stamp()]\] <font color='red'>[usr.name] ([usr.ckey]) has initiated the global cyborg killswitch!</font>")
|
||||
src.status = 1
|
||||
src.start_sequence()
|
||||
src.temp = null
|
||||
@@ -170,6 +171,7 @@
|
||||
else
|
||||
message_admins("\blue [key_name_admin(usr)] detonated [R.name]!")
|
||||
log_game("\blue [key_name_admin(usr)] detonated [R.name]!")
|
||||
use_log += text("\[[time_stamp()]\] <font color='red'>[usr.name] ([usr.ckey]) detonated [R.name] ([R.ckey])!</font>")
|
||||
R.self_destruct()
|
||||
else
|
||||
usr << "\red Access Denied."
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
var/temperature_archived
|
||||
var/mob/living/carbon/occupant = null
|
||||
var/obj/item/weapon/reagent_containers/glass/beaker = null
|
||||
var/autoeject = 0
|
||||
|
||||
var/current_heat_capacity = 50
|
||||
var/efficiency
|
||||
@@ -36,12 +37,24 @@
|
||||
component_parts += new /obj/item/stack/cable_coil(src, 1)
|
||||
RefreshParts()
|
||||
|
||||
/obj/machinery/atmospherics/unary/cryo_cell/New()
|
||||
..()
|
||||
component_parts = list()
|
||||
component_parts += new /obj/item/weapon/circuitboard/cryo_tube(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/matter_bin/super(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/console_screen(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/console_screen(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/console_screen(src)
|
||||
component_parts += new /obj/item/weapon/stock_parts/console_screen(src)
|
||||
component_parts += new /obj/item/stack/cable_coil(src, 1)
|
||||
RefreshParts()
|
||||
|
||||
/obj/machinery/atmospherics/unary/cryo_cell/RefreshParts()
|
||||
var/C
|
||||
for(var/obj/item/weapon/stock_parts/matter_bin/M in component_parts)
|
||||
C += M.rating
|
||||
current_heat_capacity = 50 * C
|
||||
efficiency = C
|
||||
efficiency = C
|
||||
|
||||
/obj/machinery/atmospherics/unary/cryo_cell/initialize()
|
||||
if(node) return
|
||||
@@ -103,6 +116,12 @@
|
||||
|
||||
/obj/machinery/atmospherics/unary/cryo_cell/process()
|
||||
..()
|
||||
if(autoeject)
|
||||
if(occupant)
|
||||
if(occupant.health >= 100)
|
||||
on = 0
|
||||
go_out()
|
||||
playsound(src.loc, 'sound/machines/ding.ogg', 50, 1)
|
||||
if(!node)
|
||||
return
|
||||
if(!on)
|
||||
@@ -141,7 +160,7 @@
|
||||
return
|
||||
|
||||
ui_interact(user)
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* The ui_interact proc is used to open and update Nano UIs
|
||||
@@ -229,6 +248,12 @@
|
||||
on = 0
|
||||
update_icon()
|
||||
|
||||
if(href_list["autoejectOn"])
|
||||
autoeject = 1
|
||||
|
||||
if(href_list["autoejectOff"])
|
||||
autoeject = 0
|
||||
|
||||
if(href_list["ejectBeaker"])
|
||||
if(beaker)
|
||||
beaker.loc = get_step(loc, SOUTH)
|
||||
@@ -256,15 +281,15 @@
|
||||
if (istype(G, /obj/item/weapon/screwdriver))
|
||||
if(occupant || on)
|
||||
user << "<span class='notice'>The maintenance panel is locked.</span>"
|
||||
return
|
||||
return
|
||||
default_deconstruction_screwdriver(user, "cell-o", "cell-off", G)
|
||||
return
|
||||
|
||||
return
|
||||
|
||||
if(exchange_parts(user, G))
|
||||
return
|
||||
|
||||
default_deconstruction_crowbar(G)
|
||||
|
||||
|
||||
if(istype(G, /obj/item/weapon/grab))
|
||||
if(panel_open)
|
||||
user << "\blue <b>Close the maintenance panel first.</b>"
|
||||
|
||||
@@ -284,23 +284,23 @@
|
||||
name = "Secure Armory Airlock"
|
||||
hackProof = 1
|
||||
aiControlDisabled = 1
|
||||
|
||||
|
||||
/obj/machinery/door/airlock/alien
|
||||
name = "Alien Airlock"
|
||||
desc = "A mysterious alien airlock with a complicated opening mechanism."
|
||||
hackProof = 1
|
||||
icon = 'icons/obj/doors/Doorplasma.dmi'
|
||||
|
||||
/obj/machinery/door/airlock/alien/bumpopen(mob/living/user as mob)
|
||||
|
||||
/obj/machinery/door/airlock/alien/bumpopen(mob/living/user as mob)
|
||||
if(istype(user,/mob/living/carbon/alien) || isrobot(user) || isAI(user))
|
||||
..(user)
|
||||
else
|
||||
user << "You do not know how to operate this airlock's mechanism."
|
||||
return
|
||||
|
||||
|
||||
/obj/machinery/door/airlock/alien/attackby(C as obj, mob/user as mob)
|
||||
if(isalien(user) || isrobot(user) || isAI(user))
|
||||
..(C, user)
|
||||
..(C, user)
|
||||
else
|
||||
user << "You do not know how to operate this airlock's mechanism."
|
||||
return
|
||||
@@ -512,8 +512,8 @@ About the new airlock wires panel:
|
||||
if(src.emergency)
|
||||
t1 += text("Emergency Access Override is enabled. <A href='?src=\ref[];aiDisable=11'>Disable?</a><br>\n", src)
|
||||
else
|
||||
t1 += text("Emergency Access Override is disabled. <A href='?src=\ref[];aiEnable=11'>Enable?</a><br>\n", src)
|
||||
|
||||
t1 += text("Emergency Access Override is disabled. <A href='?src=\ref[];aiEnable=11'>Enable?</a><br>\n", src)
|
||||
|
||||
if(src.isWireCut(AIRLOCK_WIRE_MAIN_POWER1))
|
||||
t1 += text("Main Power Input wire is cut.<br>\n")
|
||||
if(src.isWireCut(AIRLOCK_WIRE_MAIN_POWER2))
|
||||
@@ -1094,28 +1094,9 @@ About the new airlock wires panel:
|
||||
if(locate(/mob/living) in turf)
|
||||
// playsound(src.loc, 'sound/machines/buzz-two.ogg', 50, 0) //THE BUZZING IT NEVER STOPS -Pete
|
||||
spawn (60)
|
||||
close()
|
||||
autoclose()
|
||||
return
|
||||
|
||||
for(var/turf/turf in locs)
|
||||
for(var/mob/living/M in turf)
|
||||
if(isrobot(M))
|
||||
M.adjustBruteLoss(DOOR_CRUSH_DAMAGE)
|
||||
else
|
||||
M.adjustBruteLoss(DOOR_CRUSH_DAMAGE)
|
||||
M.SetStunned(5)
|
||||
M.SetWeakened(5)
|
||||
var/obj/effect/stop/S
|
||||
S = new /obj/effect/stop
|
||||
S.victim = M
|
||||
S.loc = M.loc
|
||||
spawn(20)
|
||||
del(S)
|
||||
M.emote("scream")
|
||||
var/turf/location = src.loc
|
||||
if(istype(location, /turf/simulated))
|
||||
location.add_blood(M)
|
||||
|
||||
use_power(50)
|
||||
if(forced)
|
||||
playsound(src.loc, 'sound/machines/airlockforced.ogg', 30, 1)
|
||||
@@ -1131,7 +1112,28 @@ About the new airlock wires panel:
|
||||
if (W)
|
||||
W.destroy()
|
||||
|
||||
..()
|
||||
if(density)
|
||||
return 1
|
||||
operating = 1
|
||||
door_animate("closing")
|
||||
src.layer = 3.1
|
||||
sleep(5)
|
||||
src.density = 1
|
||||
if(!safe)
|
||||
crush()
|
||||
sleep(5)
|
||||
update_icon()
|
||||
if(visible && !glass)
|
||||
SetOpacity(1)
|
||||
operating = 0
|
||||
update_nearby_tiles()
|
||||
if(locate(/mob/living) in get_turf(src))
|
||||
open()
|
||||
|
||||
//I shall not add a check every x ticks if a door has closed over some fire.
|
||||
var/obj/fire/fire = locate() in loc
|
||||
if(fire)
|
||||
del fire
|
||||
return
|
||||
|
||||
/obj/machinery/door/airlock/proc/lock(var/forced=0)
|
||||
@@ -1230,7 +1232,7 @@ About the new airlock wires panel:
|
||||
return
|
||||
else
|
||||
return
|
||||
|
||||
|
||||
|
||||
/obj/machinery/door/airlock/CanAStarPass(var/obj/item/weapon/card/id/ID)
|
||||
//Airlock is passable if it is open (!density), bot has access, and is not bolted shut)
|
||||
|
||||
@@ -227,24 +227,27 @@
|
||||
|
||||
|
||||
/obj/machinery/door/proc/open()
|
||||
if(!density) return 1
|
||||
if(operating > 0) return
|
||||
if(!ticker) return 0
|
||||
if(!density)
|
||||
return 1
|
||||
if(operating > 0)
|
||||
return
|
||||
if(!ticker)
|
||||
return 0
|
||||
if(!operating) operating = 1
|
||||
|
||||
door_animate("opening")
|
||||
icon_state = "door0"
|
||||
src.SetOpacity(0)
|
||||
sleep(10)
|
||||
src.layer = 2.7
|
||||
sleep(5)
|
||||
src.density = 0
|
||||
sleep(5)
|
||||
src.layer = 2.7
|
||||
explosion_resistance = 0
|
||||
update_icon()
|
||||
SetOpacity(0)
|
||||
operating = 0
|
||||
update_nearby_tiles()
|
||||
|
||||
if(operating) operating = 0
|
||||
|
||||
if(autoclose && normalspeed)
|
||||
spawn(150)
|
||||
autoclose()
|
||||
@@ -256,15 +259,18 @@
|
||||
|
||||
|
||||
/obj/machinery/door/proc/close()
|
||||
if(density) return 1
|
||||
if(operating > 0) return
|
||||
if(density)
|
||||
return 1
|
||||
if(operating > 0)
|
||||
return
|
||||
operating = 1
|
||||
|
||||
door_animate("closing")
|
||||
src.density = 1
|
||||
explosion_resistance = initial(explosion_resistance)
|
||||
src.layer = 3.0
|
||||
sleep(10)
|
||||
src.layer = 3.1
|
||||
sleep(5)
|
||||
src.density = 1
|
||||
sleep(5)
|
||||
update_icon()
|
||||
if(visible && !glass)
|
||||
SetOpacity(1) //caaaaarn!
|
||||
@@ -277,6 +283,24 @@
|
||||
del fire
|
||||
return
|
||||
|
||||
/obj/machinery/door/proc/crush()
|
||||
for(var/mob/living/L in get_turf(src))
|
||||
if(isalien(L)) //For xenos
|
||||
L.adjustBruteLoss(DOOR_CRUSH_DAMAGE * 1.5) //Xenos go into crit after aproximately the same amount of crushes as humans.
|
||||
L.emote("roar")
|
||||
else if(ishuman(L)) //For humans
|
||||
L.adjustBruteLoss(DOOR_CRUSH_DAMAGE)
|
||||
L.emote("scream")
|
||||
L.Weaken(5)
|
||||
else if(ismonkey(L)) //For monkeys
|
||||
L.adjustBruteLoss(DOOR_CRUSH_DAMAGE)
|
||||
L.Weaken(5)
|
||||
else //for simple_animals & borgs
|
||||
L.adjustBruteLoss(DOOR_CRUSH_DAMAGE)
|
||||
var/turf/location = src.loc
|
||||
if(istype(location, /turf/simulated)) //add_blood doesn't work for borgs/xenos, but add_blood_floor does.
|
||||
location.add_blood(L)
|
||||
|
||||
/obj/machinery/door/proc/requiresID()
|
||||
return 1
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
/obj/machinery/door/poddoor/four_tile_ver/
|
||||
name = "Large Pod Door"
|
||||
icon = 'icons/obj/doors/1x4blast_vert.dmi'
|
||||
|
||||
|
||||
/obj/machinery/door/poddoor/three_tile_ver/
|
||||
name = "Large Pod Door"
|
||||
icon = 'icons/obj/doors/1x3blast_vert.dmi'
|
||||
@@ -51,8 +51,9 @@
|
||||
flick("pdoorc0", src)
|
||||
src.icon_state = "pdoor0"
|
||||
src.SetOpacity(0)
|
||||
sleep(10)
|
||||
sleep(5)
|
||||
src.density = 0
|
||||
sleep(5)
|
||||
update_nearby_tiles()
|
||||
|
||||
if(operating == 1) //emag again
|
||||
@@ -68,11 +69,13 @@
|
||||
src.operating = 1
|
||||
flick("pdoorc1", src)
|
||||
src.icon_state = "pdoor1"
|
||||
src.density = 1
|
||||
src.SetOpacity(initial(opacity))
|
||||
update_nearby_tiles()
|
||||
sleep(5)
|
||||
crush()
|
||||
src.density = 1
|
||||
sleep(5)
|
||||
|
||||
sleep(10)
|
||||
src.operating = 0
|
||||
return
|
||||
|
||||
@@ -153,7 +156,7 @@
|
||||
spawn(150)
|
||||
autoclose()
|
||||
return 1
|
||||
|
||||
|
||||
/obj/machinery/door/poddoor/three_tile_hor/close()
|
||||
if (src.operating)
|
||||
return
|
||||
@@ -332,7 +335,7 @@
|
||||
|
||||
sleep(10)
|
||||
src.operating = 0
|
||||
return
|
||||
return
|
||||
|
||||
/obj/machinery/door/poddoor/four_tile_ver/open()
|
||||
if (src.operating == 1) //doors can still open when emag-disabled
|
||||
@@ -364,7 +367,7 @@
|
||||
spawn(150)
|
||||
autoclose()
|
||||
return 1
|
||||
|
||||
|
||||
/obj/machinery/door/poddoor/four_tile_ver/close()
|
||||
if (src.operating)
|
||||
return
|
||||
@@ -454,7 +457,7 @@
|
||||
del f2
|
||||
del f3
|
||||
..()
|
||||
|
||||
|
||||
/obj/machinery/door/poddoor/three_tile_ver
|
||||
var/obj/machinery/door/poddoor/filler_object/f1
|
||||
var/obj/machinery/door/poddoor/filler_object/f2
|
||||
@@ -477,8 +480,8 @@
|
||||
del f1
|
||||
del f2
|
||||
del f3
|
||||
..()
|
||||
|
||||
..()
|
||||
|
||||
/obj/machinery/door/poddoor/four_tile_hor
|
||||
var/obj/machinery/door/poddoor/filler_object/f1
|
||||
var/obj/machinery/door/poddoor/filler_object/f2
|
||||
|
||||
@@ -18,7 +18,8 @@
|
||||
src.icon_state = "[src.icon_state]"
|
||||
src.base_state = src.icon_state
|
||||
|
||||
color = color_windows(src)
|
||||
if(!color)
|
||||
color = color_windows(src)
|
||||
return
|
||||
|
||||
/obj/machinery/door/window/Destroy()
|
||||
|
||||
@@ -113,6 +113,7 @@ Class Procs:
|
||||
var/panel_open = 0
|
||||
var/area/myArea
|
||||
var/interact_offline = 0 // Can the machine be interacted with while de-powered.
|
||||
var/use_log = list()
|
||||
|
||||
/obj/machinery/New()
|
||||
addAtProcessing()
|
||||
@@ -297,7 +298,7 @@ Class Procs:
|
||||
user << "<span class='notice'>You close the maintenance hatch of [src].</span>"
|
||||
return 1
|
||||
return 0
|
||||
|
||||
|
||||
/obj/machinery/proc/default_change_direction_wrench(var/mob/user, var/obj/item/weapon/wrench/W)
|
||||
if(panel_open && istype(W))
|
||||
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
|
||||
@@ -328,7 +329,7 @@ Class Procs:
|
||||
state(text, "blue")
|
||||
playsound(src.loc, 'sound/machines/ping.ogg', 50, 0)
|
||||
|
||||
/obj/machinery/proc/exchange_parts(mob/user, obj/item/weapon/storage/part_replacer/W)
|
||||
/obj/machinery/proc/exchange_parts(mob/user, obj/item/weapon/storage/part_replacer/W)
|
||||
var/shouldplaysound = 0
|
||||
if(istype(W) && component_parts)
|
||||
if(panel_open)
|
||||
@@ -365,7 +366,7 @@ Class Procs:
|
||||
component_parts += B
|
||||
B.loc = null
|
||||
user << "<span class='notice'>[A.name] replaced with [B.name].</span>"
|
||||
break
|
||||
break
|
||||
RefreshParts()
|
||||
else
|
||||
user << "<span class='notice'>Following parts detected in the machine:</span>"
|
||||
|
||||
@@ -48,6 +48,35 @@ var/datum/feed_network/news_network = new /datum/feed_network //The global n
|
||||
|
||||
var/list/obj/machinery/newscaster/allCasters = list() //Global list that will contain reference to all newscasters in existence.
|
||||
|
||||
/obj/item/newscaster_frame
|
||||
name = "newscaster frame"
|
||||
desc = "Used to build newscasters, just secure to the wall."
|
||||
icon_state = "newscaster"
|
||||
item_state = "syringe_kit"
|
||||
m_amt = 14000
|
||||
g_amt = 8000
|
||||
|
||||
/obj/item/newscaster_frame/proc/try_build(turf/on_wall)
|
||||
if (get_dist(on_wall,usr)>1)
|
||||
return
|
||||
var/ndir = get_dir(usr,on_wall)
|
||||
if (!(ndir in cardinal))
|
||||
return
|
||||
var/turf/loc = get_turf(usr)
|
||||
var/area/A = loc.loc
|
||||
if (!istype(loc, /turf/simulated/floor))
|
||||
usr << "<span class='alert'>Newscaster cannot be placed on this spot.</span>"
|
||||
return
|
||||
if (A.requires_power == 0 || A.name == "Space")
|
||||
usr << "<span class='alert'>Newscaster cannot be placed in this area.</span>"
|
||||
return
|
||||
for(var/obj/machinery/newscaster/T in loc)
|
||||
usr << "<span class='alert'>There is another newscaster here.</span>"
|
||||
return
|
||||
var/obj/machinery/newscaster/N = new(loc)
|
||||
N.pixel_y -= (loc.y - on_wall.y) * 32
|
||||
N.pixel_x -= (loc.x - on_wall.x) * 32
|
||||
qdel(src)
|
||||
|
||||
/obj/machinery/newscaster
|
||||
name = "newscaster"
|
||||
@@ -699,40 +728,34 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co
|
||||
|
||||
|
||||
/obj/machinery/newscaster/attackby(obj/item/I as obj, mob/user as mob)
|
||||
if(istype(I, /obj/item/weapon/wrench))
|
||||
user << "<span class='notice'>Now [anchored ? "un" : ""]securing [name]</span>"
|
||||
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
|
||||
if(do_after(user, 60))
|
||||
new /obj/item/newscaster_frame(loc)
|
||||
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
/* if (istype(I, /obj/item/weapon/card/id) || istype(I, /obj/item/device/pda) ) //Name verification for channels or messages
|
||||
if(src.screen == 4 || src.screen == 5)
|
||||
if( istype(I, /obj/item/device/pda) )
|
||||
var/obj/item/device/pda/P = I
|
||||
if(P.id)
|
||||
src.scanned_user = "[P.id.registered_name] ([P.id.assignment])"
|
||||
src.screen=2
|
||||
else
|
||||
var/obj/item/weapon/card/id/T = I
|
||||
src.scanned_user = text("[T.registered_name] ([T.assignment])")
|
||||
src.screen=2*/ //Obsolete after autorecognition
|
||||
|
||||
if (src.isbroken)
|
||||
if (isbroken)
|
||||
playsound(src.loc, 'sound/effects/hit_on_shattered_glass.ogg', 100, 1)
|
||||
for (var/mob/O in hearers(5, src.loc))
|
||||
O.show_message("<EM>[user.name]</EM> further abuses the shattered [src.name].")
|
||||
visible_message("<span class='danger'>[user.name] further abuses the shattered [src.name].</span>", null, 5 )
|
||||
else
|
||||
if(istype(I, /obj/item/weapon) )
|
||||
var/obj/item/weapon/W = I
|
||||
if(W.damtype == STAMINA)
|
||||
return
|
||||
if(W.force <15)
|
||||
for (var/mob/O in hearers(5, src.loc))
|
||||
O.show_message("[user.name] hits the [src.name] with the [W.name] with no visible effect." )
|
||||
playsound(src.loc, 'sound/effects/Glasshit.ogg', 100, 1)
|
||||
visible_message("<span class='danger'>[user.name] hits the [src.name] with the [W.name] with no visible effect.</span>", null , 5 )
|
||||
playsound(src.loc, 'sound/effects/Glasshit.ogg', 100, 1)
|
||||
else
|
||||
src.hitstaken++
|
||||
if(src.hitstaken==3)
|
||||
for (var/mob/O in hearers(5, src.loc))
|
||||
O.show_message("[user.name] smashes the [src.name]!" )
|
||||
src.isbroken=1
|
||||
hitstaken++
|
||||
if(hitstaken==3)
|
||||
visible_message("<span class='danger'>[user.name] smashes the [src.name]!</span>", null, 5 )
|
||||
isbroken=1
|
||||
playsound(src.loc, 'sound/effects/Glassbr3.ogg', 100, 1)
|
||||
else
|
||||
for (var/mob/O in hearers(5, src.loc))
|
||||
O.show_message("[user.name] forcefully slams the [src.name] with the [I.name]!" )
|
||||
visible_message("<span class='danger'>[user.name] forcefully slams the [src.name] with the [I.name]!</span>", null, 5 )
|
||||
playsound(src.loc, 'sound/effects/Glasshit.ogg', 100, 1)
|
||||
else
|
||||
user << "<FONT COLOR='blue'>This does nothing.</FONT>"
|
||||
|
||||
@@ -23,6 +23,25 @@ Buildable meters
|
||||
#define PIPE_MTVALVE 18
|
||||
#define PIPE_MANIFOLD4W 19
|
||||
#define PIPE_CAP 20
|
||||
///// Z-Level stuff
|
||||
#define PIPE_UP 21
|
||||
#define PIPE_DOWN 22
|
||||
///// Z-Level stuff
|
||||
#define PIPE_GAS_FILTER_M 23
|
||||
#define PIPE_GAS_MIXER_T 24
|
||||
#define PIPE_GAS_MIXER_M 25
|
||||
#define PIPE_OMNI_MIXER 26
|
||||
#define PIPE_OMNI_FILTER 27
|
||||
///// Supply, scrubbers and universal pipes
|
||||
#define PIPE_UNIVERSAL 28
|
||||
#define PIPE_SUPPLY_STRAIGHT 29
|
||||
#define PIPE_SUPPLY_BENT 30
|
||||
#define PIPE_SCRUBBERS_STRAIGHT 31
|
||||
#define PIPE_SCRUBBERS_BENT 32
|
||||
#define PIPE_SUPPLY_MANIFOLD 33
|
||||
#define PIPE_SCRUBBERS_MANIFOLD 34
|
||||
#define PIPE_SUPPLY_MANIFOLD4W 35
|
||||
#define PIPE_SCRUBBERS_MANIFOLD4W 36
|
||||
|
||||
/obj/item/pipe
|
||||
name = "pipe"
|
||||
@@ -30,6 +49,7 @@ Buildable meters
|
||||
var/pipe_type = 0
|
||||
//var/pipe_dir = 0
|
||||
var/pipename
|
||||
var/connect_types[] = list(1) //1=regular, 2=supply, 3=scrubber
|
||||
force = 7
|
||||
icon = 'icons/obj/pipe-item.dmi'
|
||||
icon_state = "simple"
|
||||
@@ -43,6 +63,7 @@ Buildable meters
|
||||
if (make_from)
|
||||
src.dir = make_from.dir
|
||||
src.pipename = make_from.name
|
||||
color = make_from.pipe_color
|
||||
var/is_bent
|
||||
if (make_from.initialize_directions in list(NORTH|SOUTH, WEST|EAST))
|
||||
is_bent = 0
|
||||
@@ -54,18 +75,43 @@ Buildable meters
|
||||
src.pipe_type = PIPE_HE_STRAIGHT + is_bent
|
||||
else if(istype(make_from, /obj/machinery/atmospherics/pipe/simple/insulated))
|
||||
src.pipe_type = PIPE_INSULATED_STRAIGHT + is_bent
|
||||
else if(istype(make_from, /obj/machinery/atmospherics/pipe/simple/visible/supply) || istype(make_from, /obj/machinery/atmospherics/pipe/simple/hidden/supply))
|
||||
src.pipe_type = PIPE_SUPPLY_STRAIGHT + is_bent
|
||||
connect_types = list(2)
|
||||
src.color = PIPE_COLOR_BLUE
|
||||
else if(istype(make_from, /obj/machinery/atmospherics/pipe/simple/visible/scrubbers) || istype(make_from, /obj/machinery/atmospherics/pipe/simple/hidden/scrubbers))
|
||||
src.pipe_type = PIPE_SCRUBBERS_STRAIGHT + is_bent
|
||||
connect_types = list(3)
|
||||
src.color = PIPE_COLOR_RED
|
||||
else if(istype(make_from, /obj/machinery/atmospherics/pipe/simple/visible/universal) || istype(make_from, /obj/machinery/atmospherics/pipe/simple/hidden/universal))
|
||||
src.pipe_type = PIPE_UNIVERSAL
|
||||
connect_types = list(1,2,3)
|
||||
else if(istype(make_from, /obj/machinery/atmospherics/pipe/simple))
|
||||
src.pipe_type = PIPE_SIMPLE_STRAIGHT + is_bent
|
||||
else if(istype(make_from, /obj/machinery/atmospherics/portables_connector))
|
||||
src.pipe_type = PIPE_CONNECTOR
|
||||
else if(istype(make_from, /obj/machinery/atmospherics/pipe/manifold/visible/supply) || istype(make_from, /obj/machinery/atmospherics/pipe/manifold/hidden/supply))
|
||||
src.pipe_type = PIPE_SUPPLY_MANIFOLD
|
||||
connect_types = list(2)
|
||||
src.color = PIPE_COLOR_BLUE
|
||||
else if(istype(make_from, /obj/machinery/atmospherics/pipe/manifold/visible/scrubbers) || istype(make_from, /obj/machinery/atmospherics/pipe/manifold/hidden/scrubbers))
|
||||
src.pipe_type = PIPE_SCRUBBERS_MANIFOLD
|
||||
connect_types = list(3)
|
||||
src.color = PIPE_COLOR_RED
|
||||
else if(istype(make_from, /obj/machinery/atmospherics/pipe/manifold))
|
||||
src.pipe_type = PIPE_MANIFOLD
|
||||
else if(istype(make_from, /obj/machinery/atmospherics/unary/vent_pump))
|
||||
src.pipe_type = PIPE_UVENT
|
||||
else if(istype(make_from, /obj/machinery/atmospherics/valve))
|
||||
src.pipe_type = PIPE_MVALVE
|
||||
else if(istype(make_from, /obj/machinery/atmospherics/binary/pump))
|
||||
else if(istype(make_from, /obj/machinery/atmospherics/binary/volume_pump))
|
||||
src.pipe_type = PIPE_PUMP
|
||||
else if(istype(make_from, /obj/machinery/atmospherics/trinary/filter/m_filter))
|
||||
src.pipe_type = PIPE_GAS_FILTER_M
|
||||
else if(istype(make_from, /obj/machinery/atmospherics/trinary/mixer/t_mixer))
|
||||
src.pipe_type = PIPE_GAS_MIXER_T
|
||||
else if(istype(make_from, /obj/machinery/atmospherics/trinary/mixer/m_mixer))
|
||||
src.pipe_type = PIPE_GAS_MIXER_M
|
||||
else if(istype(make_from, /obj/machinery/atmospherics/trinary/filter))
|
||||
src.pipe_type = PIPE_GAS_FILTER
|
||||
else if(istype(make_from, /obj/machinery/atmospherics/trinary/mixer))
|
||||
@@ -80,42 +126,45 @@ Buildable meters
|
||||
src.pipe_type = PIPE_HEAT_EXCHANGE
|
||||
else if(istype(make_from, /obj/machinery/atmospherics/tvalve))
|
||||
src.pipe_type = PIPE_MTVALVE
|
||||
else if(istype(make_from, /obj/machinery/atmospherics/pipe/manifold4w/visible/supply) || istype(make_from, /obj/machinery/atmospherics/pipe/manifold4w/hidden/supply))
|
||||
src.pipe_type = PIPE_SUPPLY_MANIFOLD4W
|
||||
connect_types = list(2)
|
||||
src.color = PIPE_COLOR_BLUE
|
||||
else if(istype(make_from, /obj/machinery/atmospherics/pipe/manifold4w/visible/scrubbers) || istype(make_from, /obj/machinery/atmospherics/pipe/manifold4w/hidden/scrubbers))
|
||||
src.pipe_type = PIPE_SCRUBBERS_MANIFOLD4W
|
||||
connect_types = list(3)
|
||||
src.color = PIPE_COLOR_RED
|
||||
else if(istype(make_from, /obj/machinery/atmospherics/pipe/manifold4w))
|
||||
src.pipe_type = PIPE_MANIFOLD4W
|
||||
else if(istype(make_from, /obj/machinery/atmospherics/pipe/cap))
|
||||
src.pipe_type = PIPE_CAP
|
||||
else if(istype(make_from, /obj/machinery/atmospherics/omni/mixer))
|
||||
src.pipe_type = PIPE_OMNI_MIXER
|
||||
else if(istype(make_from, /obj/machinery/atmospherics/omni/filter))
|
||||
src.pipe_type = PIPE_OMNI_FILTER
|
||||
///// Z-Level stuff
|
||||
/*else if(istype(make_from, /obj/machinery/atmospherics/pipe/zpipe/up))
|
||||
src.pipe_type = PIPE_UP
|
||||
else if(istype(make_from, /obj/machinery/atmospherics/pipe/zpipe/down))
|
||||
src.pipe_type = PIPE_DOWN*/
|
||||
///// Z-Level stuff
|
||||
else
|
||||
src.pipe_type = pipe_type
|
||||
src.dir = dir
|
||||
if (pipe_type == 29 || pipe_type == 30 || pipe_type == 33 || pipe_type == 35)
|
||||
connect_types = list(2)
|
||||
src.color = PIPE_COLOR_BLUE
|
||||
else if (pipe_type == 31 || pipe_type == 32 || pipe_type == 34 || pipe_type == 36)
|
||||
connect_types = list(3)
|
||||
src.color = PIPE_COLOR_RED
|
||||
else if (pipe_type == 28)
|
||||
connect_types = list(1,2,3)
|
||||
//src.pipe_dir = get_pipe_dir()
|
||||
update()
|
||||
src.pixel_x = rand(-5, 5)
|
||||
src.pixel_y = rand(-5, 5)
|
||||
|
||||
//update the name and icon of the pipe item depending on the type
|
||||
var/global/list/pipeID2State = list(
|
||||
"simple", \
|
||||
"simple", \
|
||||
"he", \
|
||||
"he", \
|
||||
"connector", \
|
||||
"manifold", \
|
||||
"junction", \
|
||||
"uvent", \
|
||||
"mvalve", \
|
||||
"pump", \
|
||||
"scrubber", \
|
||||
"insulated", \
|
||||
"insulated", \
|
||||
"filter", \
|
||||
"mixer", \
|
||||
"passivegate", \
|
||||
"volumepump", \
|
||||
"heunary", \
|
||||
"mtvalve", \
|
||||
"manifold4w", \
|
||||
"cap", \
|
||||
)
|
||||
|
||||
/obj/item/pipe/proc/update()
|
||||
var/list/nlist = list( \
|
||||
@@ -140,9 +189,70 @@ var/global/list/pipeID2State = list(
|
||||
"t-valve", \
|
||||
"4-way manifold", \
|
||||
"pipe cap", \
|
||||
///// Z-Level stuff
|
||||
"pipe up", \
|
||||
"pipe down", \
|
||||
///// Z-Level stuff
|
||||
"gas filter m", \
|
||||
"gas mixer t", \
|
||||
"gas mixer m", \
|
||||
"omni mixer", \
|
||||
"omni filter", \
|
||||
///// Supply and scrubbers pipes
|
||||
"universal pipe adapter", \
|
||||
"supply pipe", \
|
||||
"bent supply pipe", \
|
||||
"scrubbers pipe", \
|
||||
"bent scrubbers pipe", \
|
||||
"supply manifold", \
|
||||
"scrubbers manifold", \
|
||||
"supply 4-way manifold", \
|
||||
"scrubbers 4-way manifold", \
|
||||
)
|
||||
name = nlist[pipe_type+1] + " fitting"
|
||||
icon_state = pipeID2State[pipe_type + 1]
|
||||
var/list/islist = list( \
|
||||
"simple", \
|
||||
"simple", \
|
||||
"he", \
|
||||
"he", \
|
||||
"connector", \
|
||||
"manifold", \
|
||||
"junction", \
|
||||
"uvent", \
|
||||
"mvalve", \
|
||||
"pump", \
|
||||
"scrubber", \
|
||||
"insulated", \
|
||||
"insulated", \
|
||||
"filter", \
|
||||
"mixer", \
|
||||
"passivegate", \
|
||||
"volumepump", \
|
||||
"heunary", \
|
||||
"mtvalve", \
|
||||
"manifold4w", \
|
||||
"cap", \
|
||||
///// Z-Level stuff
|
||||
"cap", \
|
||||
"cap", \
|
||||
///// Z-Level stuff
|
||||
"m_filter", \
|
||||
"t_mixer", \
|
||||
"m_mixer", \
|
||||
"omni_mixer", \
|
||||
"omni_filter", \
|
||||
///// Supply and scrubbers pipes
|
||||
"universal", \
|
||||
"simple", \
|
||||
"simple", \
|
||||
"simple", \
|
||||
"simple", \
|
||||
"manifold", \
|
||||
"manifold", \
|
||||
"manifold4w", \
|
||||
"manifold4w", \
|
||||
)
|
||||
icon_state = islist[pipe_type + 1]
|
||||
|
||||
//called when a turf is attacked with a pipe item
|
||||
// place the pipe on the turf, setting pipe level to 1 (underfloor) if the turf is not intact
|
||||
@@ -159,22 +269,22 @@ var/global/list/pipeID2State = list(
|
||||
|
||||
src.dir = turn(src.dir, -90)
|
||||
|
||||
if (pipe_type in list (PIPE_SIMPLE_STRAIGHT, PIPE_HE_STRAIGHT, PIPE_INSULATED_STRAIGHT, PIPE_MVALVE))
|
||||
if (pipe_type in list (PIPE_SIMPLE_STRAIGHT, PIPE_SUPPLY_STRAIGHT, PIPE_SCRUBBERS_STRAIGHT, PIPE_UNIVERSAL, PIPE_HE_STRAIGHT, PIPE_INSULATED_STRAIGHT, PIPE_MVALVE))
|
||||
if(dir==2)
|
||||
dir = 1
|
||||
else if(dir==8)
|
||||
dir = 4
|
||||
else if (pipe_type == PIPE_MANIFOLD4W)
|
||||
else if (pipe_type in list (PIPE_MANIFOLD4W, PIPE_SUPPLY_MANIFOLD4W, PIPE_SCRUBBERS_MANIFOLD4W))
|
||||
dir = 2
|
||||
//src.pipe_dir = get_pipe_dir()
|
||||
return
|
||||
|
||||
/obj/item/pipe/Move()
|
||||
..()
|
||||
if ((pipe_type in list (PIPE_SIMPLE_BENT, PIPE_HE_BENT, PIPE_INSULATED_BENT)) \
|
||||
if ((pipe_type in list (PIPE_SIMPLE_BENT, PIPE_SUPPLY_BENT, PIPE_SCRUBBERS_BENT, PIPE_HE_BENT, PIPE_INSULATED_BENT)) \
|
||||
&& (src.dir in cardinal))
|
||||
src.dir = src.dir|turn(src.dir, 90)
|
||||
else if (pipe_type in list (PIPE_SIMPLE_STRAIGHT, PIPE_HE_STRAIGHT, PIPE_INSULATED_STRAIGHT, PIPE_MVALVE))
|
||||
else if (pipe_type in list (PIPE_SIMPLE_STRAIGHT, PIPE_SUPPLY_STRAIGHT, PIPE_SCRUBBERS_STRAIGHT, PIPE_UNIVERSAL, PIPE_HE_STRAIGHT, PIPE_INSULATED_STRAIGHT, PIPE_MVALVE))
|
||||
if(dir==2)
|
||||
dir = 1
|
||||
else if(dir==8)
|
||||
@@ -198,21 +308,32 @@ var/global/list/pipeID2State = list(
|
||||
PIPE_PUMP ,\
|
||||
PIPE_VOLUME_PUMP ,\
|
||||
PIPE_PASSIVE_GATE ,\
|
||||
PIPE_MVALVE \
|
||||
PIPE_MVALVE ,\
|
||||
PIPE_SUPPLY_STRAIGHT, \
|
||||
PIPE_SCRUBBERS_STRAIGHT, \
|
||||
PIPE_UNIVERSAL, \
|
||||
)
|
||||
return dir|flip
|
||||
if(PIPE_SIMPLE_BENT, PIPE_INSULATED_BENT, PIPE_HE_BENT)
|
||||
if(PIPE_SIMPLE_BENT, PIPE_INSULATED_BENT, PIPE_HE_BENT, PIPE_SUPPLY_BENT, PIPE_SCRUBBERS_BENT)
|
||||
return dir //dir|acw
|
||||
if(PIPE_CONNECTOR,PIPE_UVENT,PIPE_SCRUBBER,PIPE_HEAT_EXCHANGE)
|
||||
return dir
|
||||
if(PIPE_MANIFOLD4W)
|
||||
if(PIPE_MANIFOLD4W, PIPE_SUPPLY_MANIFOLD4W, PIPE_SCRUBBERS_MANIFOLD4W, PIPE_OMNI_MIXER, PIPE_OMNI_FILTER)
|
||||
return dir|flip|cw|acw
|
||||
if(PIPE_MANIFOLD)
|
||||
if(PIPE_MANIFOLD, PIPE_SUPPLY_MANIFOLD, PIPE_SCRUBBERS_MANIFOLD)
|
||||
return flip|cw|acw
|
||||
if(PIPE_GAS_FILTER, PIPE_GAS_MIXER,PIPE_MTVALVE)
|
||||
return dir|flip|cw
|
||||
if(PIPE_GAS_FILTER_M, PIPE_GAS_MIXER_M)
|
||||
return dir|flip|acw
|
||||
if(PIPE_GAS_MIXER_T)
|
||||
return dir|cw|acw
|
||||
if(PIPE_CAP)
|
||||
return flip
|
||||
///// Z-Level stuff
|
||||
if(PIPE_UP,PIPE_DOWN)
|
||||
return dir
|
||||
///// Z-Level stuff
|
||||
return 0
|
||||
|
||||
/obj/item/pipe/proc/get_pdir() //endpoints for regular pipes
|
||||
@@ -257,26 +378,84 @@ var/global/list/pipeID2State = list(
|
||||
return ..()
|
||||
if (!isturf(src.loc))
|
||||
return 1
|
||||
if (pipe_type in list (PIPE_SIMPLE_STRAIGHT, PIPE_HE_STRAIGHT, PIPE_INSULATED_STRAIGHT, PIPE_MVALVE))
|
||||
if (pipe_type in list (PIPE_SIMPLE_STRAIGHT, PIPE_SUPPLY_STRAIGHT, PIPE_SCRUBBERS_STRAIGHT, PIPE_HE_STRAIGHT, PIPE_INSULATED_STRAIGHT, PIPE_MVALVE))
|
||||
if(dir==2)
|
||||
dir = 1
|
||||
else if(dir==8)
|
||||
dir = 4
|
||||
else if (pipe_type == PIPE_MANIFOLD4W)
|
||||
else if (pipe_type in list(PIPE_MANIFOLD4W, PIPE_SUPPLY_MANIFOLD4W, PIPE_SCRUBBERS_MANIFOLD4W, PIPE_OMNI_MIXER, PIPE_OMNI_FILTER))
|
||||
dir = 2
|
||||
var/pipe_dir = get_pipe_dir()
|
||||
|
||||
for(var/obj/machinery/atmospherics/M in src.loc)
|
||||
if(M.initialize_directions & pipe_dir) // matches at least one direction on either type of pipe
|
||||
user << "\red There is already a pipe at that location."
|
||||
if((M.initialize_directions & pipe_dir) && M.check_connect_types_construction(M,src)) // matches at least one direction on either type of pipe
|
||||
user << "\red There is already a pipe of the same type at this location."
|
||||
return 1
|
||||
// no conflicts found
|
||||
|
||||
var/pipefailtext = "\red There's nothing to connect this pipe section to! (with how the pipe code works, at least one end needs to be connected to something, otherwise the game deletes the segment)"
|
||||
var/pipefailtext = "\red There's nothing to connect this pipe section to!" //(with how the pipe code works, at least one end needs to be connected to something, otherwise the game deletes the segment)"
|
||||
|
||||
switch(pipe_type)
|
||||
if(PIPE_SIMPLE_STRAIGHT, PIPE_SIMPLE_BENT)
|
||||
var/obj/machinery/atmospherics/pipe/simple/P = new( src.loc )
|
||||
P.pipe_color = color
|
||||
P.dir = src.dir
|
||||
P.initialize_directions = pipe_dir
|
||||
var/turf/T = P.loc
|
||||
P.level = T.intact ? 2 : 1
|
||||
P.initialize()
|
||||
if (!P)
|
||||
usr << pipefailtext
|
||||
return 1
|
||||
P.build_network()
|
||||
if (P.node1)
|
||||
P.node1.initialize()
|
||||
P.node1.build_network()
|
||||
if (P.node2)
|
||||
P.node2.initialize()
|
||||
P.node2.build_network()
|
||||
|
||||
if(PIPE_SUPPLY_STRAIGHT, PIPE_SUPPLY_BENT)
|
||||
var/obj/machinery/atmospherics/pipe/simple/hidden/supply/P = new( src.loc )
|
||||
P.color = color
|
||||
P.dir = src.dir
|
||||
P.initialize_directions = pipe_dir
|
||||
var/turf/T = P.loc
|
||||
P.level = T.intact ? 2 : 1
|
||||
P.initialize()
|
||||
if (!P)
|
||||
usr << pipefailtext
|
||||
return 1
|
||||
P.build_network()
|
||||
if (P.node1)
|
||||
P.node1.initialize()
|
||||
P.node1.build_network()
|
||||
if (P.node2)
|
||||
P.node2.initialize()
|
||||
P.node2.build_network()
|
||||
|
||||
if(PIPE_SCRUBBERS_STRAIGHT, PIPE_SCRUBBERS_BENT)
|
||||
var/obj/machinery/atmospherics/pipe/simple/hidden/scrubbers/P = new( src.loc )
|
||||
P.color = color
|
||||
P.dir = src.dir
|
||||
P.initialize_directions = pipe_dir
|
||||
var/turf/T = P.loc
|
||||
P.level = T.intact ? 2 : 1
|
||||
P.initialize()
|
||||
if (!P)
|
||||
usr << pipefailtext
|
||||
return 1
|
||||
P.build_network()
|
||||
if (P.node1)
|
||||
P.node1.initialize()
|
||||
P.node1.build_network()
|
||||
if (P.node2)
|
||||
P.node2.initialize()
|
||||
P.node2.build_network()
|
||||
|
||||
if(PIPE_UNIVERSAL)
|
||||
var/obj/machinery/atmospherics/pipe/simple/hidden/universal/P = new( src.loc )
|
||||
P.color = color
|
||||
P.dir = src.dir
|
||||
P.initialize_directions = pipe_dir
|
||||
var/turf/T = P.loc
|
||||
@@ -296,7 +475,7 @@ var/global/list/pipeID2State = list(
|
||||
if(PIPE_HE_STRAIGHT, PIPE_HE_BENT)
|
||||
var/obj/machinery/atmospherics/pipe/simple/heat_exchanging/P = new ( src.loc )
|
||||
P.dir = src.dir
|
||||
P.initialize_directions = 0
|
||||
P.initialize_directions = pipe_dir //this var it's used to know if the pipe is bent or not
|
||||
P.initialize_directions_he = pipe_dir
|
||||
//var/turf/T = P.loc
|
||||
//P.level = T.intact ? 2 : 1
|
||||
@@ -329,6 +508,7 @@ var/global/list/pipeID2State = list(
|
||||
|
||||
if(PIPE_MANIFOLD) //manifold
|
||||
var/obj/machinery/atmospherics/pipe/manifold/M = new( src.loc )
|
||||
M.pipe_color = color
|
||||
M.dir = dir
|
||||
M.initialize_directions = pipe_dir
|
||||
//M.New()
|
||||
@@ -336,7 +516,53 @@ var/global/list/pipeID2State = list(
|
||||
M.level = T.intact ? 2 : 1
|
||||
M.initialize()
|
||||
if (!M)
|
||||
usr << "There's nothing to connect this manifold to! (with how the pipe code works, at least one end needs to be connected to something, otherwise the game deletes the segment)"
|
||||
usr << pipefailtext
|
||||
return 1
|
||||
M.build_network()
|
||||
if (M.node1)
|
||||
M.node1.initialize()
|
||||
M.node1.build_network()
|
||||
if (M.node2)
|
||||
M.node2.initialize()
|
||||
M.node2.build_network()
|
||||
if (M.node3)
|
||||
M.node3.initialize()
|
||||
M.node3.build_network()
|
||||
|
||||
if(PIPE_SUPPLY_MANIFOLD) //manifold
|
||||
var/obj/machinery/atmospherics/pipe/manifold/hidden/supply/M = new( src.loc )
|
||||
M.color = color
|
||||
M.dir = dir
|
||||
M.initialize_directions = pipe_dir
|
||||
//M.New()
|
||||
var/turf/T = M.loc
|
||||
M.level = T.intact ? 2 : 1
|
||||
M.initialize()
|
||||
if (!M)
|
||||
usr << pipefailtext
|
||||
return 1
|
||||
M.build_network()
|
||||
if (M.node1)
|
||||
M.node1.initialize()
|
||||
M.node1.build_network()
|
||||
if (M.node2)
|
||||
M.node2.initialize()
|
||||
M.node2.build_network()
|
||||
if (M.node3)
|
||||
M.node3.initialize()
|
||||
M.node3.build_network()
|
||||
|
||||
if(PIPE_SCRUBBERS_MANIFOLD) //manifold
|
||||
var/obj/machinery/atmospherics/pipe/manifold/hidden/scrubbers/M = new( src.loc )
|
||||
M.color = color
|
||||
M.dir = dir
|
||||
M.initialize_directions = pipe_dir
|
||||
//M.New()
|
||||
var/turf/T = M.loc
|
||||
M.level = T.intact ? 2 : 1
|
||||
M.initialize()
|
||||
if (!M)
|
||||
usr << pipefailtext
|
||||
return 1
|
||||
M.build_network()
|
||||
if (M.node1)
|
||||
@@ -351,6 +577,7 @@ var/global/list/pipeID2State = list(
|
||||
|
||||
if(PIPE_MANIFOLD4W) //4-way manifold
|
||||
var/obj/machinery/atmospherics/pipe/manifold4w/M = new( src.loc )
|
||||
M.pipe_color = color
|
||||
M.dir = dir
|
||||
M.initialize_directions = pipe_dir
|
||||
//M.New()
|
||||
@@ -358,7 +585,61 @@ var/global/list/pipeID2State = list(
|
||||
M.level = T.intact ? 2 : 1
|
||||
M.initialize()
|
||||
if (!M)
|
||||
usr << "There's nothing to connect this manifold to! (with how the pipe code works, at least one end needs to be connected to something, otherwise the game deletes the segment)"
|
||||
usr << pipefailtext
|
||||
return 1
|
||||
M.build_network()
|
||||
if (M.node1)
|
||||
M.node1.initialize()
|
||||
M.node1.build_network()
|
||||
if (M.node2)
|
||||
M.node2.initialize()
|
||||
M.node2.build_network()
|
||||
if (M.node3)
|
||||
M.node3.initialize()
|
||||
M.node3.build_network()
|
||||
if (M.node4)
|
||||
M.node4.initialize()
|
||||
M.node4.build_network()
|
||||
|
||||
if(PIPE_SUPPLY_MANIFOLD4W) //4-way manifold
|
||||
var/obj/machinery/atmospherics/pipe/manifold4w/hidden/supply/M = new( src.loc )
|
||||
M.color = color
|
||||
M.dir = dir
|
||||
M.initialize_directions = pipe_dir
|
||||
M.connect_types = src.connect_types
|
||||
//M.New()
|
||||
var/turf/T = M.loc
|
||||
M.level = T.intact ? 2 : 1
|
||||
M.initialize()
|
||||
if (!M)
|
||||
usr << pipefailtext
|
||||
return 1
|
||||
M.build_network()
|
||||
if (M.node1)
|
||||
M.node1.initialize()
|
||||
M.node1.build_network()
|
||||
if (M.node2)
|
||||
M.node2.initialize()
|
||||
M.node2.build_network()
|
||||
if (M.node3)
|
||||
M.node3.initialize()
|
||||
M.node3.build_network()
|
||||
if (M.node4)
|
||||
M.node4.initialize()
|
||||
M.node4.build_network()
|
||||
|
||||
if(PIPE_SCRUBBERS_MANIFOLD4W) //4-way manifold
|
||||
var/obj/machinery/atmospherics/pipe/manifold4w/hidden/scrubbers/M = new( src.loc )
|
||||
M.color = color
|
||||
M.dir = dir
|
||||
M.initialize_directions = pipe_dir
|
||||
M.connect_types = src.connect_types
|
||||
//M.New()
|
||||
var/turf/T = M.loc
|
||||
M.level = T.intact ? 2 : 1
|
||||
M.initialize()
|
||||
if (!M)
|
||||
usr << pipefailtext
|
||||
return 1
|
||||
M.build_network()
|
||||
if (M.node1)
|
||||
@@ -383,7 +664,7 @@ var/global/list/pipeID2State = list(
|
||||
//P.level = T.intact ? 2 : 1
|
||||
P.initialize()
|
||||
if (!P)
|
||||
usr << "There's nothing to connect this junction to! (with how the pipe code works, at least one end needs to be connected to something, otherwise the game deletes the segment)"
|
||||
usr << pipefailtext //"There's nothing to connect this pipe to! (with how the pipe code works, at least one end needs to be connected to something, otherwise the game deletes the segment)"
|
||||
return 1
|
||||
P.build_network()
|
||||
if (P.node1)
|
||||
@@ -428,7 +709,7 @@ var/global/list/pipeID2State = list(
|
||||
V.node2.build_network()
|
||||
|
||||
if(PIPE_PUMP) //gas pump
|
||||
var/obj/machinery/atmospherics/binary/pump/P = new(src.loc)
|
||||
var/obj/machinery/atmospherics/binary/volume_pump/P = new(src.loc)
|
||||
P.dir = dir
|
||||
P.initialize_directions = pipe_dir
|
||||
if (pipename)
|
||||
@@ -464,7 +745,7 @@ var/global/list/pipeID2State = list(
|
||||
P.node3.initialize()
|
||||
P.node3.build_network()
|
||||
|
||||
if(PIPE_GAS_MIXER) //gas filter
|
||||
if(PIPE_GAS_MIXER) //gas mixer
|
||||
var/obj/machinery/atmospherics/trinary/mixer/P = new(src.loc)
|
||||
P.dir = dir
|
||||
P.initialize_directions = pipe_dir
|
||||
@@ -484,6 +765,66 @@ var/global/list/pipeID2State = list(
|
||||
P.node3.initialize()
|
||||
P.node3.build_network()
|
||||
|
||||
if(PIPE_GAS_FILTER_M) //gas filter mirrored
|
||||
var/obj/machinery/atmospherics/trinary/filter/m_filter/P = new(src.loc)
|
||||
P.dir = dir
|
||||
P.initialize_directions = pipe_dir
|
||||
if (pipename)
|
||||
P.name = pipename
|
||||
var/turf/T = P.loc
|
||||
P.level = T.intact ? 2 : 1
|
||||
P.initialize()
|
||||
P.build_network()
|
||||
if (P.node1)
|
||||
P.node1.initialize()
|
||||
P.node1.build_network()
|
||||
if (P.node2)
|
||||
P.node2.initialize()
|
||||
P.node2.build_network()
|
||||
if (P.node3)
|
||||
P.node3.initialize()
|
||||
P.node3.build_network()
|
||||
|
||||
if(PIPE_GAS_MIXER_T) //gas mixer-t
|
||||
var/obj/machinery/atmospherics/trinary/mixer/t_mixer/P = new(src.loc)
|
||||
P.dir = dir
|
||||
P.initialize_directions = pipe_dir
|
||||
if (pipename)
|
||||
P.name = pipename
|
||||
var/turf/T = P.loc
|
||||
P.level = T.intact ? 2 : 1
|
||||
P.initialize()
|
||||
P.build_network()
|
||||
if (P.node1)
|
||||
P.node1.initialize()
|
||||
P.node1.build_network()
|
||||
if (P.node2)
|
||||
P.node2.initialize()
|
||||
P.node2.build_network()
|
||||
if (P.node3)
|
||||
P.node3.initialize()
|
||||
P.node3.build_network()
|
||||
|
||||
if(PIPE_GAS_MIXER_M) //gas mixer mirrored
|
||||
var/obj/machinery/atmospherics/trinary/mixer/m_mixer/P = new(src.loc)
|
||||
P.dir = dir
|
||||
P.initialize_directions = pipe_dir
|
||||
if (pipename)
|
||||
P.name = pipename
|
||||
var/turf/T = P.loc
|
||||
P.level = T.intact ? 2 : 1
|
||||
P.initialize()
|
||||
P.build_network()
|
||||
if (P.node1)
|
||||
P.node1.initialize()
|
||||
P.node1.build_network()
|
||||
if (P.node2)
|
||||
P.node2.initialize()
|
||||
P.node2.build_network()
|
||||
if (P.node3)
|
||||
P.node3.initialize()
|
||||
P.node3.build_network()
|
||||
|
||||
if(PIPE_SCRUBBER) //scrubber
|
||||
var/obj/machinery/atmospherics/unary/vent_scrubber/S = new(src.loc)
|
||||
S.dir = dir
|
||||
@@ -593,6 +934,52 @@ var/global/list/pipeID2State = list(
|
||||
if (C.node)
|
||||
C.node.initialize()
|
||||
C.node.build_network()
|
||||
///// Z-Level stuff
|
||||
/* if(PIPE_UP)
|
||||
var/obj/machinery/atmospherics/pipe/zpipe/up/P = new(src.loc)
|
||||
P.dir = dir
|
||||
P.initialize_directions = pipe_dir
|
||||
if (pipename)
|
||||
P.name = pipename
|
||||
var/turf/T = P.loc
|
||||
P.level = T.intact ? 2 : 1
|
||||
P.initialize()
|
||||
P.build_network()
|
||||
if (P.node1)
|
||||
P.node1.initialize()
|
||||
P.node1.build_network()
|
||||
if (P.node2)
|
||||
P.node2.initialize()
|
||||
P.node2.build_network()
|
||||
if(PIPE_DOWN)
|
||||
var/obj/machinery/atmospherics/pipe/zpipe/down/P = new(src.loc)
|
||||
P.dir = dir
|
||||
P.initialize_directions = pipe_dir
|
||||
if (pipename)
|
||||
P.name = pipename
|
||||
var/turf/T = P.loc
|
||||
P.level = T.intact ? 2 : 1
|
||||
P.initialize()
|
||||
P.build_network()
|
||||
if (P.node1)
|
||||
P.node1.initialize()
|
||||
P.node1.build_network()
|
||||
if (P.node2)
|
||||
P.node2.initialize()
|
||||
P.node2.build_network()*/
|
||||
///// Z-Level stuff
|
||||
if(PIPE_OMNI_MIXER)
|
||||
var/obj/machinery/atmospherics/omni/mixer/P = new(loc)
|
||||
var/turf/T = P.loc
|
||||
P.level = T.intact ? 2 : 1
|
||||
P.initialize()
|
||||
P.build_network()
|
||||
if(PIPE_OMNI_FILTER)
|
||||
var/obj/machinery/atmospherics/omni/filter/P = new(loc)
|
||||
var/turf/T = P.loc
|
||||
P.level = T.intact ? 2 : 1
|
||||
P.initialize()
|
||||
P.build_network()
|
||||
|
||||
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
|
||||
user.visible_message( \
|
||||
@@ -649,4 +1036,14 @@ var/global/list/pipeID2State = list(
|
||||
#undef PIPE_VOLUME_PUMP
|
||||
#undef PIPE_OUTLET_INJECT
|
||||
#undef PIPE_MTVALVE
|
||||
//#undef PIPE_MANIFOLD4W
|
||||
#undef PIPE_GAS_FILTER_M
|
||||
#undef PIPE_GAS_MIXER_T
|
||||
#undef PIPE_GAS_MIXER_M
|
||||
#undef PIPE_SUPPLY_STRAIGHT
|
||||
#undef PIPE_SUPPLY_BENT
|
||||
#undef PIPE_SCRUBBERS_STRAIGHT
|
||||
#undef PIPE_SCRUBBERS_BENT
|
||||
#undef PIPE_SUPPLY_MANIFOLD
|
||||
#undef PIPE_SCRUBBERS_MANIFOLD
|
||||
#undef PIPE_UNIVERSAL
|
||||
//#undef PIPE_MANIFOLD4W
|
||||
|
||||
@@ -22,7 +22,18 @@
|
||||
<A href='?src=\ref[src];make=20;dir=1'>Pipe Cap</A><BR>
|
||||
<A href='?src=\ref[src];make=19;dir=1'>4-Way Manifold</A><BR>
|
||||
<A href='?src=\ref[src];make=18;dir=1'>Manual T-Valve</A><BR>
|
||||
<b>Supply pipes:</b><BR>
|
||||
<A href='?src=\ref[src];make=29;dir=1'>Pipe</A><BR>
|
||||
<A href='?src=\ref[src];make=30;dir=5'>Bent Pipe</A><BR>
|
||||
<A href='?src=\ref[src];make=33;dir=1'>Manifold</A><BR>
|
||||
<A href='?src=\ref[src];make=35;dir=1'>4-Way Manifold</A><BR>
|
||||
<b>Scrubbers pipes:</b><BR>
|
||||
<A href='?src=\ref[src];make=31;dir=1'>Pipe</A><BR>
|
||||
<A href='?src=\ref[src];make=32;dir=5'>Bent Pipe</A><BR>
|
||||
<A href='?src=\ref[src];make=34;dir=1'>Manifold</A><BR>
|
||||
<A href='?src=\ref[src];make=36;dir=1'>4-Way Manifold</A><BR>
|
||||
<b>Devices:</b><BR>
|
||||
<A href='?src=\ref[src];make=28;dir=1'>Universal Pipe Adapter</A><BR>
|
||||
<A href='?src=\ref[src];make=4;dir=1'>Connector</A><BR>
|
||||
<A href='?src=\ref[src];make=7;dir=1'>Unary Vent</A><BR>
|
||||
<A href='?src=\ref[src];make=9;dir=1'>Gas Pump</A><BR>
|
||||
|
||||
@@ -369,8 +369,11 @@ Status: []<BR>"},
|
||||
sleep(60)
|
||||
attacked = 0
|
||||
|
||||
src.health -= Proj.damage
|
||||
if((Proj.damage_type == BRUTE || Proj.damage_type == BURN))
|
||||
health -= Proj.damage
|
||||
|
||||
..()
|
||||
|
||||
if(prob(45) && Proj.damage > 0) src.spark_system.start()
|
||||
if (src.health <= 0)
|
||||
src.die() // the death process :(
|
||||
|
||||
@@ -31,8 +31,8 @@
|
||||
//The units themselves/////////////////
|
||||
|
||||
/obj/machinery/suit_storage_unit/standard_unit
|
||||
SUIT_TYPE = /obj/item/clothing/suit/space
|
||||
HELMET_TYPE = /obj/item/clothing/head/helmet/space
|
||||
SUIT_TYPE = /obj/item/clothing/suit/space/eva
|
||||
HELMET_TYPE = /obj/item/clothing/head/helmet/space/eva
|
||||
MASK_TYPE = /obj/item/clothing/mask/breath
|
||||
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
icon_state = "separator-AO1"
|
||||
layer = MOB_LAYER+1 // Overhead
|
||||
anchored = 1
|
||||
density = 0
|
||||
density = 1
|
||||
var/transform_dead = 0
|
||||
var/transform_standing = 0
|
||||
var/cooldown_duration = 600 // 1 minute
|
||||
|
||||
@@ -275,12 +275,13 @@
|
||||
popping = 0
|
||||
|
||||
/obj/machinery/turret/bullet_act(var/obj/item/projectile/Proj)
|
||||
src.health -= Proj.damage
|
||||
..()
|
||||
if(prob(45) && Proj.damage > 0) src.spark_system.start()
|
||||
del (Proj)
|
||||
if (src.health <= 0)
|
||||
src.die()
|
||||
if((Proj.damage_type == BRUTE || Proj.damage_type == BURN))
|
||||
src.health -= Proj.damage
|
||||
..()
|
||||
if(prob(45) && Proj.damage > 0) src.spark_system.start()
|
||||
del(Proj)
|
||||
if (src.health <= 0)
|
||||
src.die()
|
||||
return
|
||||
|
||||
/obj/machinery/turret/attackby(obj/item/weapon/W, mob/user)//I can't believe no one added this before/N
|
||||
|
||||
@@ -862,7 +862,7 @@
|
||||
req_access_txt = "1"
|
||||
products = list(/obj/item/weapon/handcuffs = 8,/obj/item/weapon/grenade/flashbang = 4,/obj/item/device/flash = 5,
|
||||
/obj/item/weapon/reagent_containers/food/snacks/donut/normal = 12,/obj/item/weapon/storage/box/evidence = 6,/obj/item/device/flashlight/seclite = 4)
|
||||
contraband = list(/obj/item/clothing/glasses/sunglasses = 2,/obj/item/weapon/storage/fancy/donut_box = 2)
|
||||
contraband = list(/obj/item/clothing/glasses/sunglasses = 2,/obj/item/weapon/storage/fancy/donut_box = 2,/obj/item/device/hailer = 5)
|
||||
|
||||
/obj/machinery/vending/hydronutrients
|
||||
name = "NutriMax"
|
||||
@@ -1017,7 +1017,7 @@
|
||||
/obj/machinery/vending/eva
|
||||
name = "Hardsuit Kits"
|
||||
desc = "Conversion kits for your alien hardsuit needs."
|
||||
products = list(/obj/item/device/modkit = 6,/obj/item/device/modkit/tajaran = 6,/obj/item/device/modkit/unathi = 6)
|
||||
products = list(/obj/item/device/modkit = 6,/obj/item/device/modkit/tajaran = 6,/obj/item/device/modkit/unathi = 6,/obj/item/device/modkit/vox = 6)
|
||||
|
||||
|
||||
/obj/machinery/vending/sustenance
|
||||
@@ -1105,8 +1105,9 @@
|
||||
/obj/item/clothing/under/sundress=2,/obj/item/clothing/under/stripeddress = 1, /obj/item/clothing/under/sailordress = 1, /obj/item/clothing/under/redeveninggown = 1, /obj/item/clothing/under/blacktango=1,/obj/item/clothing/suit/jacket=3,
|
||||
/obj/item/clothing/glasses/regular=2,/obj/item/clothing/head/sombrero=1,/obj/item/clothing/suit/poncho=1,
|
||||
/obj/item/clothing/suit/ianshirt=1,/obj/item/clothing/shoes/laceup=2,/obj/item/clothing/shoes/black=4,
|
||||
/obj/item/clothing/shoes/sandal=1)
|
||||
contraband = list(/obj/item/clothing/under/syndicate/tacticool=1,/obj/item/clothing/mask/balaclava=1,/obj/item/clothing/head/ushanka=1,/obj/item/clothing/under/soviet=1)
|
||||
/obj/item/clothing/shoes/sandal=1,
|
||||
/obj/item/weapon/storage/belt/fannypack=1, /obj/item/weapon/storage/belt/fannypack/blue=1, /obj/item/weapon/storage/belt/fannypack/red=1)
|
||||
contraband = list(/obj/item/clothing/under/syndicate/tacticool=1,/obj/item/clothing/mask/balaclava=1,/obj/item/clothing/head/ushanka=1,/obj/item/clothing/under/soviet=1,/obj/item/weapon/storage/belt/fannypack/black=1)
|
||||
premium = list(/obj/item/clothing/under/suit_jacket/checkered=1,/obj/item/clothing/head/mailman=1,/obj/item/clothing/under/rank/mailman=1,/obj/item/clothing/suit/jacket/leather=1,/obj/item/clothing/under/pants/mustangjeans=1)
|
||||
refill_canister = /obj/item/weapon/vending_refill/clothing
|
||||
|
||||
|
||||
@@ -59,6 +59,17 @@
|
||||
component_parts += new /obj/item/weapon/stock_parts/console_screen(null)
|
||||
RefreshParts()
|
||||
files = new /datum/research(src) //Setup the research data holder.
|
||||
|
||||
/obj/machinery/mecha_part_fabricator/upgraded/New()
|
||||
..()
|
||||
component_parts = list()
|
||||
component_parts += new /obj/item/weapon/circuitboard/mechfab(null)
|
||||
component_parts += new /obj/item/weapon/stock_parts/matter_bin/super(null)
|
||||
component_parts += new /obj/item/weapon/stock_parts/matter_bin/super(null)
|
||||
component_parts += new /obj/item/weapon/stock_parts/manipulator/pico(null)
|
||||
component_parts += new /obj/item/weapon/stock_parts/micro_laser/ultra(null)
|
||||
component_parts += new /obj/item/weapon/stock_parts/console_screen(null)
|
||||
RefreshParts()
|
||||
|
||||
/obj/machinery/mecha_part_fabricator/RefreshParts()
|
||||
var/T = 0
|
||||
|
||||
@@ -260,7 +260,7 @@
|
||||
if(do_after(melee_cooldown))
|
||||
melee_can_hit = 1
|
||||
return
|
||||
|
||||
|
||||
/obj/mecha/proc/mech_toxin_damage(mob/living/target)
|
||||
playsound(src, 'sound/effects/spray2.ogg', 50, 1)
|
||||
if(target.reagents)
|
||||
@@ -554,8 +554,10 @@
|
||||
return
|
||||
if(istype(Proj, /obj/item/projectile/beam/pulse))
|
||||
ignore_threshold = 1
|
||||
src.take_damage(Proj.damage,Proj.flag)
|
||||
src.check_for_internal_damage(list(MECHA_INT_FIRE,MECHA_INT_TEMP_CONTROL,MECHA_INT_TANK_BREACH,MECHA_INT_CONTROL_LOST,MECHA_INT_SHORT_CIRCUIT),ignore_threshold)
|
||||
if((Proj.damage_type == BRUTE || Proj.damage_type == BURN))
|
||||
src.take_damage(Proj.damage,Proj.flag)
|
||||
src.visible_message("<span class='danger'>[src.name] is hit by [Proj].</span>")
|
||||
src.check_for_internal_damage(list(MECHA_INT_FIRE,MECHA_INT_TEMP_CONTROL,MECHA_INT_TANK_BREACH,MECHA_INT_CONTROL_LOST,MECHA_INT_SHORT_CIRCUIT),ignore_threshold)
|
||||
Proj.on_hit(src)
|
||||
return
|
||||
|
||||
|
||||
@@ -19,6 +19,43 @@
|
||||
return
|
||||
*/
|
||||
|
||||
/obj/mecha/working/ripley/Destroy()
|
||||
while(src.damage_absorption.["brute"] < 0.6)
|
||||
new /obj/item/asteroid/goliath_hide(src.loc)
|
||||
src.damage_absorption.["brute"] = src.damage_absorption.["brute"] + 0.1 //If a goliath-plated ripley gets killed, all the plates drop
|
||||
for(var/atom/movable/A in src.cargo)
|
||||
A.loc = loc
|
||||
step_rand(A)
|
||||
cargo.Cut()
|
||||
..()
|
||||
|
||||
/obj/mecha/working/ripley/go_out()
|
||||
..()
|
||||
if (src.damage_absorption.["brute"] < 0.6 && src.damage_absorption.["brute"] > 0.3)
|
||||
src.overlays = null
|
||||
src.overlays += image("icon" = "mecha.dmi", "icon_state" = "ripley-g-open")
|
||||
else if (src.damage_absorption.["brute"] == 0.3)
|
||||
src.overlays = null
|
||||
src.overlays += image("icon" = "mecha.dmi", "icon_state" = "ripley-g-full-open")
|
||||
|
||||
/obj/mecha/working/ripley/moved_inside(var/mob/living/carbon/human/H as mob)
|
||||
..()
|
||||
if (src.damage_absorption.["brute"] < 0.6 && src.damage_absorption.["brute"] > 0.3)
|
||||
src.overlays = null
|
||||
src.overlays += image("icon" = "mecha.dmi", "icon_state" = "ripley-g")
|
||||
else if (src.damage_absorption.["brute"] == 0.3)
|
||||
src.overlays = null
|
||||
src.overlays += image("icon" = "mecha.dmi", "icon_state" = "ripley-g-full")
|
||||
|
||||
/obj/mecha/working/ripley/mmi_moved_inside(var/obj/item/device/mmi/mmi_as_oc as obj,mob/user as mob)
|
||||
..()
|
||||
if (src.damage_absorption.["brute"] < 0.6 && src.damage_absorption.["brute"] > 0.3)
|
||||
src.overlays = null
|
||||
src.overlays += image("icon" = "mecha.dmi", "icon_state" = "ripley-g")
|
||||
else if (src.damage_absorption.["brute"] == 0.3)
|
||||
src.overlays = null
|
||||
src.overlays += image("icon" = "mecha.dmi", "icon_state" = "ripley-g-full")
|
||||
|
||||
/obj/mecha/working/ripley/firefighter
|
||||
desc = "Standart APLU chassis was refitted with additional thermal protection and cistern."
|
||||
name = "APLU \"Firefighter\""
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
for(var/atom/movable/O in src)
|
||||
O.loc = src.loc
|
||||
|
||||
del(src)
|
||||
qdel(src)
|
||||
|
||||
|
||||
/obj/effect/anomaly/attackby(obj/item/I, mob/user)
|
||||
@@ -85,7 +85,7 @@
|
||||
|
||||
/obj/effect/anomaly/flux/New()
|
||||
..()
|
||||
aSignal.origin_tech = "powerstorage=5;programming=3;plasmatech=2"
|
||||
aSignal.origin_tech = "powerstorage=6;programming=4;plasmatech=4"
|
||||
|
||||
/////////////////////
|
||||
|
||||
@@ -97,7 +97,7 @@
|
||||
|
||||
/obj/effect/anomaly/bluespace/New()
|
||||
..()
|
||||
aSignal.origin_tech = "bluespace=5;magnets=3;powerstorage=2"
|
||||
aSignal.origin_tech = "bluespace=5;magnets=5;powerstorage=3"
|
||||
|
||||
/obj/effect/anomaly/bluespace/Bumped(atom/A)
|
||||
if(isliving(A))
|
||||
@@ -112,7 +112,7 @@
|
||||
|
||||
/obj/effect/anomaly/pyro/New()
|
||||
..()
|
||||
aSignal.origin_tech = "plasmatech=5;powerstorage=3;biotech=3"
|
||||
aSignal.origin_tech = "plasmatech=5;powerstorage=4;biotech=6"
|
||||
|
||||
/obj/effect/anomaly/pyro/anomalyEffect()
|
||||
..()
|
||||
@@ -122,7 +122,6 @@
|
||||
payload.toxins = 60
|
||||
T.zone.air.merge(payload)
|
||||
T.hotspot_expose(1000, CELL_VOLUME)
|
||||
// T.atmos_spawn_air("fire", 3)
|
||||
|
||||
/////////////////////
|
||||
|
||||
@@ -133,12 +132,12 @@
|
||||
|
||||
/obj/effect/anomaly/bhole/New()
|
||||
..()
|
||||
aSignal.origin_tech = "materials=5;combat=4;engineering=3"
|
||||
aSignal.origin_tech = "materials=5;combat=4;engineering=4"
|
||||
|
||||
/obj/effect/anomaly/bhole/anomalyEffect()
|
||||
..()
|
||||
if(!isturf(loc)) //blackhole cannot be contained inside anything. Weird stuff might happen
|
||||
del(src)
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
grav(rand(0,3), rand(2,3), 50, 25)
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
/obj/effect/forcefield
|
||||
desc = "A space wizard's magic wall."
|
||||
name = "FORCEWALL"
|
||||
icon = 'icons/effects/effects.dmi'
|
||||
icon_state = "m_shield"
|
||||
anchored = 1.0
|
||||
opacity = 0
|
||||
density = 1
|
||||
unacidable = 1
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
///////////Mimewalls///////////
|
||||
|
||||
/obj/effect/forcefield/mime
|
||||
icon_state = "empty"
|
||||
name = "invisible wall"
|
||||
desc = "You have a bad feeling about this."
|
||||
var/timeleft = 50
|
||||
var/last_process = 0
|
||||
|
||||
/obj/effect/forcefield/mime/New()
|
||||
..()
|
||||
last_process = world.time
|
||||
processing_objects.Add(src)
|
||||
|
||||
/obj/effect/forcefield/mime/process()
|
||||
timeleft -= (world.time - last_process)
|
||||
if(timeleft <= 0)
|
||||
processing_objects.Remove(src)
|
||||
qdel(src)
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user