mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-20 11:34:19 +01:00
Atmospherics refactor (#18460)
* Atmospherics refactor * META(GAMING) * Cleanup * RPD hotfix * Fox review * Do this * Well that escalated * Repath these * Ah yes, scope creep * Remove this comment * Regression #1
This commit is contained in:
@@ -59,6 +59,7 @@
|
||||
var/atmos_overlay_type = null //current active overlay
|
||||
|
||||
// Dont make this Initialize(), youll break all of atmos
|
||||
// Challenge accepted in a few years -aa07
|
||||
/turf/simulated/New()
|
||||
..()
|
||||
if(!blocks_air)
|
||||
|
||||
@@ -257,8 +257,8 @@
|
||||
apply_preset(1) // Don't cycle.
|
||||
GLOB.air_alarm_repository.update_cache(src)
|
||||
|
||||
/obj/machinery/alarm/Initialize()
|
||||
..()
|
||||
/obj/machinery/alarm/Initialize(mapload)
|
||||
. = ..()
|
||||
set_frequency(frequency)
|
||||
if(!master_is_operating())
|
||||
elect_master()
|
||||
|
||||
@@ -18,13 +18,14 @@ Pipelines + Other Objects -> Pipe network
|
||||
active_power_usage = 0
|
||||
power_channel = ENVIRON
|
||||
on_blueprints = TRUE
|
||||
armor = list(MELEE = 25, BULLET = 10, LASER = 10, ENERGY = 100, BOMB = 0, BIO = 100, RAD = 100, FIRE = 100, ACID = 70)
|
||||
var/nodealert = FALSE
|
||||
var/can_unwrench = FALSE
|
||||
/// If the machine is currently operating or not.
|
||||
var/on = FALSE
|
||||
/// The amount of pressure the machine wants to operate at.
|
||||
var/target_pressure = 0
|
||||
var/connect_types[] = list(1) //1=regular, 2=supply, 3=scrubber
|
||||
var/list/connect_types = list(CONNECT_TYPE_NORMAL)
|
||||
var/connected_to = 1 //same as above, currently not used for anything
|
||||
var/icon_connect_type = "" //"-supply" or "-scrubbers"
|
||||
|
||||
@@ -33,21 +34,22 @@ Pipelines + Other Objects -> Pipe network
|
||||
var/pipe_color
|
||||
var/image/pipe_image
|
||||
|
||||
/obj/machinery/atmospherics/New()
|
||||
if (!armor)
|
||||
armor = list(MELEE = 25, BULLET = 10, LASER = 10, ENERGY = 100, BOMB = 0, BIO = 100, RAD = 100, FIRE = 100, ACID = 70)
|
||||
..()
|
||||
|
||||
/obj/machinery/atmospherics/Initialize(mapload)
|
||||
. = ..()
|
||||
SSair.atmos_machinery += src
|
||||
|
||||
|
||||
if(!pipe_color)
|
||||
pipe_color = color
|
||||
|
||||
color = null
|
||||
|
||||
if(!pipe_color_check(pipe_color))
|
||||
pipe_color = null
|
||||
|
||||
/obj/machinery/atmospherics/Initialize()
|
||||
. = ..()
|
||||
SSair.atmos_machinery += src
|
||||
/obj/machinery/atmospherics/proc/process_atmos() //If you dont use process why are you here
|
||||
return PROCESS_KILL
|
||||
|
||||
/obj/machinery/atmospherics/proc/atmos_init()
|
||||
// Updates all pipe overlays and underlays
|
||||
@@ -122,24 +124,20 @@ Pipelines + Other Objects -> Pipe network
|
||||
|
||||
// Connect types
|
||||
/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++)
|
||||
var/list/list1 = atmos1.connect_types
|
||||
var/list/list2 = atmos2.connect_types
|
||||
for(var/i in 1 to length(list1))
|
||||
for(var/j in 1 to length(list2))
|
||||
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++)
|
||||
var/list/list1 = atmos1.connect_types
|
||||
var/list/list2 = pipe2.connect_types
|
||||
for(var/i in 1 to length(list1))
|
||||
for(var/j in 1 to length(list2))
|
||||
if(list1[i] == list2[j])
|
||||
var/n = list1[i]
|
||||
return n
|
||||
@@ -247,7 +245,7 @@ Pipelines + Other Objects -> Pipe network
|
||||
/obj/machinery/atmospherics/deconstruct(disassembled = TRUE)
|
||||
if(!(flags & NODECONSTRUCT))
|
||||
if(can_unwrench)
|
||||
var/obj/item/pipe/stored = new(loc, make_from = src)
|
||||
var/obj/item/pipe/stored = new(loc, null, null, src)
|
||||
if(!disassembled)
|
||||
stored.obj_integrity = stored.max_integrity * 0.5
|
||||
transfer_fingerprints_to(stored)
|
||||
|
||||
@@ -27,15 +27,16 @@
|
||||
/obj/item/pipe/circulator
|
||||
name = "circulator/heat exchanger fitting"
|
||||
|
||||
/obj/item/pipe/circulator/New(loc)
|
||||
var/obj/machinery/atmospherics/binary/circulator/C = new /obj/machinery/atmospherics/binary/circulator(null)
|
||||
..(loc, make_from = C)
|
||||
/obj/item/pipe/circulator/Initialize(mapload, pipe_type, dir, obj/machinery/atmospherics/make_from)
|
||||
. = ..(make_from = new /obj/machinery/atmospherics/binary/circulator(null))
|
||||
|
||||
/obj/machinery/atmospherics/binary/circulator/Destroy()
|
||||
if(generator && generator.cold_circ == src)
|
||||
generator.cold_circ = null
|
||||
|
||||
else if(generator && generator.hot_circ == src)
|
||||
generator.hot_circ = null
|
||||
|
||||
return ..()
|
||||
|
||||
/obj/machinery/atmospherics/binary/circulator/proc/return_transfer_air()
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
level = 1
|
||||
|
||||
connect_types = list(1,2,3) //connects to regular, supply and scrubbers pipes
|
||||
connect_types = list(CONNECT_TYPE_NORMAL, CONNECT_TYPE_SUPPLY, CONNECT_TYPE_SCRUBBER) //connects to regular, supply and scrubbers pipes
|
||||
|
||||
var/releasing = TRUE //FALSE = siphoning, TRUE = releasing
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
can_unwrench = TRUE
|
||||
layer = GAS_FILTER_LAYER
|
||||
|
||||
var/obj/machinery/portable_atmospherics/connected_device
|
||||
var/obj/machinery/atmospherics/portable/connected_device
|
||||
|
||||
/obj/machinery/atmospherics/unary/portables_connector/Destroy()
|
||||
if(connected_device)
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
var/radio_filter_out
|
||||
var/radio_filter_in
|
||||
|
||||
connect_types = list(1,2) //connects to regular and supply pipes
|
||||
connect_types = list(CONNECT_TYPE_NORMAL, CONNECT_TYPE_SUPPLY) //connects to regular and supply pipes
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent_pump/detailed_examine()
|
||||
return "This pumps the contents of the attached pipe out into the atmosphere, if needed. It can be controlled from an Air Alarm."
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
var/radio_filter_out
|
||||
var/radio_filter_in
|
||||
|
||||
connect_types = list(1,3) //connects to regular and scrubber pipes
|
||||
connect_types = list(CONNECT_TYPE_NORMAL, CONNECT_TYPE_SCRUBBER) //connects to regular and scrubber pipes
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent_scrubber/on
|
||||
on = TRUE
|
||||
|
||||
@@ -73,7 +73,7 @@
|
||||
<font color="red">[status]</font><br>
|
||||
<a href="?src=[UID()];scan=1">Scan</a>
|
||||
<table border="1" width="90%">"}
|
||||
for(var/obj/machinery/portable_atmospherics/scrubber/huge/scrubber in connectedscrubbers)
|
||||
for(var/obj/machinery/atmospherics/portable/scrubber/huge/scrubber in connectedscrubbers)
|
||||
dat += {"
|
||||
<tr>
|
||||
<td>[scrubber.name]</td>
|
||||
@@ -100,7 +100,7 @@
|
||||
if(href_list["scan"])
|
||||
scanscrubbers()
|
||||
else if(href_list["toggle"])
|
||||
var/obj/machinery/portable_atmospherics/scrubber/huge/scrubber = locate(href_list["scrub"])
|
||||
var/obj/machinery/atmospherics/portable/scrubber/huge/scrubber = locate(href_list["scrub"])
|
||||
|
||||
if(!validscrubber(scrubber))
|
||||
spawn(20)
|
||||
@@ -112,7 +112,7 @@
|
||||
scrubber.on = text2num(href_list["toggle"])
|
||||
scrubber.update_icon()
|
||||
|
||||
/obj/machinery/computer/area_atmos/proc/validscrubber(obj/machinery/portable_atmospherics/scrubber/huge/scrubber as obj)
|
||||
/obj/machinery/computer/area_atmos/proc/validscrubber(obj/machinery/atmospherics/portable/scrubber/huge/scrubber as obj)
|
||||
if(!isobj(scrubber) || get_dist(scrubber.loc, src.loc) > src.range || scrubber.loc.z != src.loc.z)
|
||||
return 0
|
||||
|
||||
@@ -122,7 +122,7 @@
|
||||
connectedscrubbers = new()
|
||||
|
||||
var/found = 0
|
||||
for(var/obj/machinery/portable_atmospherics/scrubber/huge/scrubber in range(range, src.loc))
|
||||
for(var/obj/machinery/atmospherics/portable/scrubber/huge/scrubber in range(range, src.loc))
|
||||
if(istype(scrubber))
|
||||
found = 1
|
||||
connectedscrubbers += scrubber
|
||||
@@ -136,7 +136,7 @@
|
||||
/obj/machinery/computer/area_atmos/area
|
||||
zone = "This computer is working in a wired network limited to this area."
|
||||
|
||||
/obj/machinery/computer/area_atmos/area/validscrubber(obj/machinery/portable_atmospherics/scrubber/huge/scrubber as obj )
|
||||
/obj/machinery/computer/area_atmos/area/validscrubber(obj/machinery/atmospherics/portable/scrubber/huge/scrubber as obj )
|
||||
if(!isobj(scrubber))
|
||||
return 0
|
||||
|
||||
@@ -164,7 +164,7 @@
|
||||
var/turf/T = get_turf(src)
|
||||
if(!T.loc) return
|
||||
var/area/A = get_area(T)
|
||||
for(var/obj/machinery/portable_atmospherics/scrubber/huge/scrubber in SSair.atmos_machinery)
|
||||
for(var/obj/machinery/atmospherics/portable/scrubber/huge/scrubber in SSair.atmos_machinery)
|
||||
var/turf/T2 = get_turf(scrubber)
|
||||
if(T2 && T2.loc)
|
||||
var/area/A2 = T2.loc
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/obj/machinery/meter
|
||||
/obj/machinery/atmospherics/meter
|
||||
name = "gas flow meter"
|
||||
desc = "It measures something."
|
||||
icon = 'icons/obj/meter.dmi'
|
||||
@@ -12,7 +12,6 @@
|
||||
armor = list(MELEE = 0, BULLET = 0, LASER = 0, ENERGY = 100, BOMB = 0, BIO = 100, RAD = 100, FIRE = 40, ACID = 0)
|
||||
power_channel = ENVIRON
|
||||
frequency = ATMOS_DISTRO_FREQ
|
||||
var/id
|
||||
var/id_tag
|
||||
use_power = IDLE_POWER_USE
|
||||
idle_power_usage = 2
|
||||
@@ -21,28 +20,18 @@
|
||||
Mtoollink = TRUE
|
||||
settagwhitelist = list("id_tag")
|
||||
|
||||
/obj/machinery/meter/New()
|
||||
..()
|
||||
SSair.atmos_machinery += src
|
||||
/obj/machinery/atmospherics/meter/Initialize(mapload)
|
||||
. = ..()
|
||||
target = locate(/obj/machinery/atmospherics/pipe) in loc
|
||||
if(id && !id_tag)//i'm not dealing with further merge conflicts, fuck it
|
||||
id_tag = id
|
||||
return 1
|
||||
|
||||
/obj/machinery/meter/Destroy()
|
||||
SSair.atmos_machinery -= src
|
||||
/obj/machinery/atmospherics/meter/Destroy()
|
||||
target = null
|
||||
return ..()
|
||||
|
||||
/obj/machinery/meter/Initialize()
|
||||
..()
|
||||
if(!target)
|
||||
target = locate(/obj/machinery/atmospherics/pipe) in loc
|
||||
|
||||
/obj/machinery/meter/detailed_examine()
|
||||
/obj/machinery/atmospherics/meter/detailed_examine()
|
||||
return "Measures the volume and temperature of the pipe under the meter."
|
||||
|
||||
/obj/machinery/meter/process_atmos()
|
||||
/obj/machinery/atmospherics/meter/process_atmos()
|
||||
if(!target || (stat & (BROKEN|NOPOWER)))
|
||||
update_icon(UPDATE_ICON_STATE)
|
||||
return
|
||||
@@ -69,9 +58,9 @@
|
||||
"sigtype" = "status"
|
||||
)
|
||||
radio_connection.post_signal(src, signal)
|
||||
|
||||
|
||||
/obj/machinery/meter/update_icon_state()
|
||||
|
||||
/obj/machinery/atmospherics/meter/update_icon_state()
|
||||
if(!target)
|
||||
icon_state = "meterX"
|
||||
return
|
||||
@@ -100,7 +89,7 @@
|
||||
else
|
||||
icon_state = "meter4"
|
||||
|
||||
/obj/machinery/meter/proc/status()
|
||||
/obj/machinery/atmospherics/meter/proc/status()
|
||||
var/t = ""
|
||||
if(target)
|
||||
var/datum/gas_mixture/environment = target.return_air()
|
||||
@@ -112,7 +101,7 @@
|
||||
t += "The connect error light is blinking."
|
||||
return t
|
||||
|
||||
/obj/machinery/meter/examine(mob/user)
|
||||
/obj/machinery/atmospherics/meter/examine(mob/user)
|
||||
var/t = "A gas flow meter. "
|
||||
|
||||
if(get_dist(user, src) > 3 && !(istype(user, /mob/living/silicon/ai) || istype(user, /mob/dead)))
|
||||
@@ -132,14 +121,14 @@
|
||||
|
||||
. = list(t)
|
||||
|
||||
/obj/machinery/meter/Click()
|
||||
/obj/machinery/atmospherics/meter/Click()
|
||||
if(istype(usr, /mob/living/silicon/ai)) // ghosts can call ..() for examine
|
||||
usr.examinate(src)
|
||||
return 1
|
||||
|
||||
return ..()
|
||||
|
||||
/obj/machinery/meter/attackby(obj/item/W as obj, mob/user as mob, params)
|
||||
/obj/machinery/atmospherics/meter/attackby(obj/item/W as obj, mob/user as mob, params)
|
||||
if(istype(W, /obj/item/multitool))
|
||||
update_multitool_menu(user)
|
||||
return 1
|
||||
@@ -155,33 +144,17 @@
|
||||
"You hear ratchet.")
|
||||
deconstruct(TRUE)
|
||||
|
||||
/obj/machinery/meter/deconstruct(disassembled = TRUE)
|
||||
/obj/machinery/atmospherics/meter/deconstruct(disassembled = TRUE)
|
||||
if(!(flags & NODECONSTRUCT))
|
||||
new /obj/item/pipe_meter(loc)
|
||||
qdel(src)
|
||||
|
||||
/obj/machinery/meter/singularity_pull(S, current_size)
|
||||
/obj/machinery/atmospherics/meter/singularity_pull(S, current_size)
|
||||
..()
|
||||
if(current_size >= STAGE_FIVE)
|
||||
deconstruct()
|
||||
|
||||
// TURF METER - REPORTS A TILE'S AIR CONTENTS
|
||||
|
||||
/obj/machinery/meter/turf/New()
|
||||
..()
|
||||
target = loc
|
||||
return 1
|
||||
|
||||
|
||||
/obj/machinery/meter/turf/Initialize()
|
||||
if(!target)
|
||||
target = loc
|
||||
..()
|
||||
|
||||
/obj/machinery/meter/turf/attackby(obj/item/W as obj, mob/user as mob, params)
|
||||
return
|
||||
|
||||
/obj/machinery/meter/multitool_menu(mob/user, obj/item/multitool/P)
|
||||
/obj/machinery/atmospherics/meter/multitool_menu(mob/user, obj/item/multitool/P)
|
||||
return {"
|
||||
<b>Main</b>
|
||||
<ul>
|
||||
|
||||
@@ -86,7 +86,7 @@
|
||||
name = "scrubbers pipe endcap"
|
||||
desc = "An endcap for scrubbers pipes"
|
||||
icon_state = "cap-scrubbers"
|
||||
connect_types = list(3)
|
||||
connect_types = list(CONNECT_TYPE_SCRUBBER)
|
||||
layer = 2.38
|
||||
icon_connect_type = "-scrubbers"
|
||||
color = PIPE_COLOR_RED
|
||||
@@ -95,7 +95,7 @@
|
||||
name = "supply pipe endcap"
|
||||
desc = "An endcap for supply pipes"
|
||||
icon_state = "cap-supply"
|
||||
connect_types = list(2)
|
||||
connect_types = list(CONNECT_TYPE_SUPPLY)
|
||||
layer = 2.39
|
||||
icon_connect_type = "-supply"
|
||||
color = PIPE_COLOR_BLUE
|
||||
@@ -109,7 +109,7 @@
|
||||
name = "scrubbers pipe endcap"
|
||||
desc = "An endcap for scrubbers pipes"
|
||||
icon_state = "cap-scrubbers"
|
||||
connect_types = list(3)
|
||||
connect_types = list(CONNECT_TYPE_SCRUBBER)
|
||||
layer = 2.38
|
||||
icon_connect_type = "-scrubbers"
|
||||
color = PIPE_COLOR_RED
|
||||
@@ -118,7 +118,7 @@
|
||||
name = "supply pipe endcap"
|
||||
desc = "An endcap for supply pipes"
|
||||
icon_state = "cap-supply"
|
||||
connect_types = list(2)
|
||||
connect_types = list(CONNECT_TYPE_SUPPLY)
|
||||
layer = 2.39
|
||||
icon_connect_type = "-supply"
|
||||
color = PIPE_COLOR_BLUE
|
||||
|
||||
@@ -160,7 +160,7 @@
|
||||
name="Scrubbers pipe manifold"
|
||||
desc = "A manifold composed of scrubbers pipes"
|
||||
icon_state = "map-scrubbers"
|
||||
connect_types = list(3)
|
||||
connect_types = list(CONNECT_TYPE_SCRUBBER)
|
||||
layer = 2.38
|
||||
icon_connect_type = "-scrubbers"
|
||||
color = PIPE_COLOR_RED
|
||||
@@ -173,7 +173,7 @@
|
||||
name="Air supply pipe manifold"
|
||||
desc = "A manifold composed of supply pipes"
|
||||
icon_state = "map-supply"
|
||||
connect_types = list(2)
|
||||
connect_types = list(CONNECT_TYPE_SUPPLY)
|
||||
layer = 2.39
|
||||
icon_connect_type = "-supply"
|
||||
color = PIPE_COLOR_BLUE
|
||||
@@ -209,7 +209,7 @@
|
||||
name="Scrubbers pipe manifold"
|
||||
desc = "A manifold composed of scrubbers pipes"
|
||||
icon_state = "map-scrubbers"
|
||||
connect_types = list(3)
|
||||
connect_types = list(CONNECT_TYPE_SCRUBBER)
|
||||
layer = 2.38
|
||||
icon_connect_type = "-scrubbers"
|
||||
color = PIPE_COLOR_RED
|
||||
@@ -222,7 +222,7 @@
|
||||
name="Air supply pipe manifold"
|
||||
desc = "A manifold composed of supply pipes"
|
||||
icon_state = "map-supply"
|
||||
connect_types = list(2)
|
||||
connect_types = list(CONNECT_TYPE_SUPPLY)
|
||||
layer = 2.39
|
||||
icon_connect_type = "-supply"
|
||||
color = PIPE_COLOR_BLUE
|
||||
|
||||
@@ -170,7 +170,7 @@
|
||||
name="4-way scrubbers pipe manifold"
|
||||
desc = "A manifold composed of scrubbers pipes"
|
||||
icon_state = "map_4way-scrubbers"
|
||||
connect_types = list(3)
|
||||
connect_types = list(CONNECT_TYPE_SCRUBBER)
|
||||
layer = 2.38
|
||||
icon_connect_type = "-scrubbers"
|
||||
color = PIPE_COLOR_RED
|
||||
@@ -183,7 +183,7 @@
|
||||
name="4-way air supply pipe manifold"
|
||||
desc = "A manifold composed of supply pipes"
|
||||
icon_state = "map_4way-supply"
|
||||
connect_types = list(2)
|
||||
connect_types = list(CONNECT_TYPE_SUPPLY)
|
||||
layer = 2.39
|
||||
icon_connect_type = "-supply"
|
||||
color = PIPE_COLOR_BLUE
|
||||
@@ -213,7 +213,7 @@
|
||||
name="4-way scrubbers pipe manifold"
|
||||
desc = "A manifold composed of scrubbers pipes"
|
||||
icon_state = "map_4way-scrubbers"
|
||||
connect_types = list(3)
|
||||
connect_types = list(CONNECT_TYPE_SCRUBBER)
|
||||
layer = 2.38
|
||||
icon_connect_type = "-scrubbers"
|
||||
color = PIPE_COLOR_RED
|
||||
@@ -226,7 +226,7 @@
|
||||
name="4-way air supply pipe manifold"
|
||||
desc = "A manifold composed of supply pipes"
|
||||
icon_state = "map_4way-supply"
|
||||
connect_types = list(2)
|
||||
connect_types = list(CONNECT_TYPE_SUPPLY)
|
||||
layer = 2.39
|
||||
icon_connect_type = "-supply"
|
||||
color = PIPE_COLOR_BLUE
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
|
||||
flags_2 = NO_MALF_EFFECT_2
|
||||
|
||||
/obj/machinery/atmospherics/pipe/New()
|
||||
..()
|
||||
/obj/machinery/atmospherics/pipe/Initialize(mapload)
|
||||
. = ..()
|
||||
//so pipes under walls are hidden
|
||||
if(istype(get_turf(src), /turf/simulated/wall))
|
||||
level = 1
|
||||
@@ -26,7 +26,7 @@
|
||||
QDEL_NULL(air_temporary)
|
||||
|
||||
var/turf/T = loc
|
||||
for(var/obj/machinery/meter/meter in T)
|
||||
for(var/obj/machinery/atmospherics/meter/meter in T)
|
||||
if(meter.target == src)
|
||||
var/obj/item/pipe_meter/PM = new (T)
|
||||
meter.transfer_fingerprints_to(PM)
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
name = "Scrubbers pipe"
|
||||
desc = "A one meter section of scrubbers pipe"
|
||||
icon_state = "intact-scrubbers"
|
||||
connect_types = list(3)
|
||||
connect_types = list(CONNECT_TYPE_SCRUBBER)
|
||||
layer = 2.38
|
||||
icon_connect_type = "-scrubbers"
|
||||
color = PIPE_COLOR_RED
|
||||
@@ -20,7 +20,7 @@
|
||||
name = "Air supply pipe"
|
||||
desc = "A one meter section of supply pipe"
|
||||
icon_state = "intact-supply"
|
||||
connect_types = list(2)
|
||||
connect_types = list(CONNECT_TYPE_SUPPLY)
|
||||
layer = 2.39
|
||||
icon_connect_type = "-supply"
|
||||
color = PIPE_COLOR_BLUE
|
||||
@@ -32,7 +32,7 @@
|
||||
/obj/machinery/atmospherics/pipe/simple/hidden/universal
|
||||
name="Universal pipe adapter"
|
||||
desc = "An adapter for regular, supply and scrubbers pipes"
|
||||
connect_types = list(1,2,3)
|
||||
connect_types = list(CONNECT_TYPE_NORMAL, CONNECT_TYPE_SUPPLY, CONNECT_TYPE_SCRUBBER)
|
||||
icon_state = "map_universal"
|
||||
|
||||
/obj/machinery/atmospherics/pipe/simple/hidden/universal/detailed_examine()
|
||||
@@ -41,7 +41,7 @@
|
||||
/obj/machinery/atmospherics/pipe/simple/hidden/universal/update_overlays()
|
||||
. = list()
|
||||
alpha = 255
|
||||
. += SSair.icon_manager.get_atmos_icon("pipe", , pipe_color, "universal")
|
||||
. += SSair.icon_manager.get_atmos_icon("pipe", color = pipe_color, state = "universal")
|
||||
update_underlays()
|
||||
|
||||
/obj/machinery/atmospherics/pipe/simple/hidden/universal/update_underlays()
|
||||
@@ -53,14 +53,14 @@
|
||||
universal_underlays(node2)
|
||||
else
|
||||
var/node2_dir = turn(get_dir(src,node1),-180)
|
||||
universal_underlays(,node2_dir)
|
||||
universal_underlays(direction = node2_dir)
|
||||
else if(node2)
|
||||
universal_underlays(node2)
|
||||
var/node1_dir = turn(get_dir(src,node2),-180)
|
||||
universal_underlays(,node1_dir)
|
||||
universal_underlays(direction = node1_dir)
|
||||
else
|
||||
universal_underlays(,dir)
|
||||
universal_underlays(,turn(dir, -180))
|
||||
universal_underlays(direction = dir)
|
||||
universal_underlays(direction = turn(dir, -180))
|
||||
|
||||
/obj/machinery/atmospherics/pipe/simple/hidden/yellow
|
||||
color = PIPE_COLOR_YELLOW
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
name = "Scrubbers pipe"
|
||||
desc = "A one meter section of scrubbers pipe"
|
||||
icon_state = "intact-scrubbers"
|
||||
connect_types = list(3)
|
||||
connect_types = list(CONNECT_TYPE_SCRUBBER)
|
||||
layer = 2.38
|
||||
icon_connect_type = "-scrubbers"
|
||||
color = PIPE_COLOR_RED
|
||||
@@ -19,7 +19,7 @@
|
||||
name = "Air supply pipe"
|
||||
desc = "A one meter section of supply pipe"
|
||||
icon_state = "intact-supply"
|
||||
connect_types = list(2)
|
||||
connect_types = list(CONNECT_TYPE_SUPPLY)
|
||||
layer = 2.39
|
||||
icon_connect_type = "-supply"
|
||||
color = PIPE_COLOR_BLUE
|
||||
@@ -49,7 +49,7 @@
|
||||
/obj/machinery/atmospherics/pipe/simple/visible/universal
|
||||
name="Universal pipe adapter"
|
||||
desc = "An adapter for regular, supply and scrubbers pipes"
|
||||
connect_types = list(1,2,3)
|
||||
connect_types = list(CONNECT_TYPE_NORMAL, CONNECT_TYPE_SUPPLY, CONNECT_TYPE_SCRUBBER)
|
||||
icon_state = "map_universal"
|
||||
|
||||
/obj/machinery/atmospherics/pipe/simple/visible/universal/detailed_examine()
|
||||
@@ -58,7 +58,7 @@
|
||||
/obj/machinery/atmospherics/pipe/simple/visible/universal/update_overlays()
|
||||
. = list()
|
||||
alpha = 255
|
||||
. += SSair.icon_manager.get_atmos_icon("pipe", , pipe_color, "universal")
|
||||
. += SSair.icon_manager.get_atmos_icon("pipe", color = pipe_color, state = "universal")
|
||||
update_underlays()
|
||||
|
||||
/obj/machinery/atmospherics/pipe/simple/visible/universal/update_underlays()
|
||||
@@ -70,9 +70,9 @@
|
||||
universal_underlays(node2)
|
||||
else
|
||||
var/node1_dir = get_dir(node1,src)
|
||||
universal_underlays(,node1_dir)
|
||||
universal_underlays(direction = node1_dir)
|
||||
else if(node2)
|
||||
universal_underlays(node2)
|
||||
else
|
||||
universal_underlays(,dir)
|
||||
universal_underlays(,turn(dir, -180))
|
||||
universal_underlays(direction = dir)
|
||||
universal_underlays(direction = turn(dir, -180))
|
||||
|
||||
@@ -1,42 +1,46 @@
|
||||
/datum/canister_icons
|
||||
var
|
||||
possiblemaincolor = list( //these lists contain the possible colors of a canister
|
||||
list("name" = "\[N2O\]", "icon" = "redws"),
|
||||
list("name" = "\[N2\]", "icon" = "red"),
|
||||
list("name" = "\[O2\]", "icon" = "blue"),
|
||||
list("name" = "\[Toxin (Bio)\]", "icon" = "orange"),
|
||||
list("name" = "\[CO2\]", "icon" = "black"),
|
||||
list("name" = "\[Air\]", "icon" = "grey"),
|
||||
list("name" = "\[CAUTION\]", "icon" = "yellow"),
|
||||
list("name" = "\[SPECIAL\]", "icon" = "whiters")
|
||||
)
|
||||
possibleseccolor = list( // no point in having the N2O and "whiters" ones in these lists
|
||||
list("name" = "\[None\]", "icon" = "none"),
|
||||
list("name" = "\[N2\]", "icon" = "red-c"),
|
||||
list("name" = "\[O2\]", "icon" = "blue-c"),
|
||||
list("name" = "\[Toxin (Bio)\]", "icon" = "orange-c"),
|
||||
list("name" = "\[CO2\]", "icon" = "black-c"),
|
||||
list("name" = "\[Air\]", "icon" = "grey-c"),
|
||||
list("name" = "\[CAUTION\]", "icon" = "yellow-c")
|
||||
)
|
||||
possibletertcolor = list(
|
||||
list("name" = "\[None\]", "icon" = "none"),
|
||||
list("name" = "\[N2\]", "icon" = "red-c-1"),
|
||||
list("name" = "\[O2\]", "icon" = "blue-c-1"),
|
||||
list("name" = "\[Toxin (Bio)\]", "icon" = "orange-c-1"),
|
||||
list("name" = "\[CO2\]", "icon" = "black-c-1"),
|
||||
list("name" = "\[Air\]", "icon" = "grey-c-1"),
|
||||
list("name" = "\[CAUTION\]", "icon" = "yellow-c-1")
|
||||
)
|
||||
possiblequartcolor = list(
|
||||
list("name" = "\[None\]", "icon" = "none"),
|
||||
list("name" = "\[N2\]", "icon" = "red-c-2"),
|
||||
list("name" = "\[O2\]", "icon" = "blue-c-2"),
|
||||
list("name" = "\[Toxin (Bio)\]", "icon" = "orange-c-2"),
|
||||
list("name" = "\[CO2\]", "icon" = "black-c-2"),
|
||||
list("name" = "\[Air\]", "icon" = "grey-c-2"),
|
||||
list("name" = "\[CAUTION\]", "icon" = "yellow-c-2")
|
||||
)
|
||||
var/list/possiblemaincolor = list( //these lists contain the possible colors of a canister
|
||||
list("name" = "\[N2O\]", "icon" = "redws"),
|
||||
list("name" = "\[N2\]", "icon" = "red"),
|
||||
list("name" = "\[O2\]", "icon" = "blue"),
|
||||
list("name" = "\[Toxin (Bio)\]", "icon" = "orange"),
|
||||
list("name" = "\[CO2\]", "icon" = "black"),
|
||||
list("name" = "\[Air\]", "icon" = "grey"),
|
||||
list("name" = "\[CAUTION\]", "icon" = "yellow"),
|
||||
list("name" = "\[SPECIAL\]", "icon" = "whiters")
|
||||
)
|
||||
|
||||
var/list/possibleseccolor = list( // no point in having the N2O and "whiters" ones in these lists
|
||||
list("name" = "\[None\]", "icon" = "none"),
|
||||
list("name" = "\[N2\]", "icon" = "red-c"),
|
||||
list("name" = "\[O2\]", "icon" = "blue-c"),
|
||||
list("name" = "\[Toxin (Bio)\]", "icon" = "orange-c"),
|
||||
list("name" = "\[CO2\]", "icon" = "black-c"),
|
||||
list("name" = "\[Air\]", "icon" = "grey-c"),
|
||||
list("name" = "\[CAUTION\]", "icon" = "yellow-c")
|
||||
)
|
||||
|
||||
var/list/possibletertcolor = list(
|
||||
list("name" = "\[None\]", "icon" = "none"),
|
||||
list("name" = "\[N2\]", "icon" = "red-c-1"),
|
||||
list("name" = "\[O2\]", "icon" = "blue-c-1"),
|
||||
list("name" = "\[Toxin (Bio)\]", "icon" = "orange-c-1"),
|
||||
list("name" = "\[CO2\]", "icon" = "black-c-1"),
|
||||
list("name" = "\[Air\]", "icon" = "grey-c-1"),
|
||||
list("name" = "\[CAUTION\]", "icon" = "yellow-c-1")
|
||||
)
|
||||
|
||||
var/list/possiblequartcolor = list(
|
||||
list("name" = "\[None\]", "icon" = "none"),
|
||||
list("name" = "\[N2\]", "icon" = "red-c-2"),
|
||||
list("name" = "\[O2\]", "icon" = "blue-c-2"),
|
||||
list("name" = "\[Toxin (Bio)\]", "icon" = "orange-c-2"),
|
||||
list("name" = "\[CO2\]", "icon" = "black-c-2"),
|
||||
list("name" = "\[Air\]", "icon" = "grey-c-2"),
|
||||
list("name" = "\[CAUTION\]", "icon" = "yellow-c-2")
|
||||
)
|
||||
|
||||
|
||||
GLOBAL_DATUM_INIT(canister_icon_container, /datum/canister_icons, new())
|
||||
|
||||
#define HOLDING_TANK 1
|
||||
@@ -48,7 +52,7 @@ GLOBAL_DATUM_INIT(canister_icon_container, /datum/canister_icons, new())
|
||||
#define NEW_COLOR 64
|
||||
#define RESET 68
|
||||
|
||||
/obj/machinery/portable_atmospherics/canister
|
||||
/obj/machinery/atmospherics/portable/canister
|
||||
name = "canister"
|
||||
icon = 'icons/obj/atmos.dmi'
|
||||
icon_state = "yellow"
|
||||
@@ -80,15 +84,18 @@ GLOBAL_DATUM_INIT(canister_icon_container, /datum/canister_icons, new())
|
||||
var/release_log = ""
|
||||
var/update_flag = NONE
|
||||
|
||||
/obj/machinery/portable_atmospherics/canister/New()
|
||||
..()
|
||||
/obj/machinery/atmospherics/portable/canister/Initialize(mapload)
|
||||
. = ..()
|
||||
|
||||
canister_color = list(
|
||||
"prim" = "yellow",
|
||||
"sec" = "none",
|
||||
"ter" = "none",
|
||||
"quart" = "none"
|
||||
)
|
||||
old_color = new /list()
|
||||
|
||||
old_color = list()
|
||||
|
||||
colorcontainer = list(
|
||||
"prim" = list(
|
||||
"options" = GLOB.canister_icon_container.possiblemaincolor,
|
||||
@@ -107,18 +114,20 @@ GLOBAL_DATUM_INIT(canister_icon_container, /datum/canister_icons, new())
|
||||
"name" = "Quaternary color",
|
||||
)
|
||||
)
|
||||
|
||||
color_index = list()
|
||||
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/portable_atmospherics/canister/detailed_examine()
|
||||
/obj/machinery/atmospherics/portable/canister/detailed_examine()
|
||||
return "The canister can be connected to a connector port with a wrench. Tanks of gas (the kind you can hold in your hand) \
|
||||
can be filled by the canister, by using the tank on the canister, increasing the release pressure, then opening the valve until it is full, and then close it. \
|
||||
*DO NOT* remove the tank until the valve is closed. A gas analyzer can be used to check the contents of the canister."
|
||||
|
||||
/obj/machinery/portable_atmospherics/canister/detailed_examine_antag()
|
||||
/obj/machinery/atmospherics/portable/canister/detailed_examine_antag()
|
||||
return "Canisters can be damaged, spilling their contents into the air, or you can just leave the release valve open."
|
||||
|
||||
/obj/machinery/portable_atmospherics/canister/proc/check_change()
|
||||
/obj/machinery/atmospherics/portable/canister/proc/check_change()
|
||||
var/old_flag = update_flag
|
||||
update_flag = NONE
|
||||
if(holding_tank)
|
||||
@@ -144,7 +153,7 @@ GLOBAL_DATUM_INIT(canister_icon_container, /datum/canister_icons, new())
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/portable_atmospherics/canister/update_icon_state()
|
||||
/obj/machinery/atmospherics/portable/canister/update_icon_state()
|
||||
/*
|
||||
(note: colors has to be applied every icon update)
|
||||
*/
|
||||
@@ -159,7 +168,7 @@ GLOBAL_DATUM_INIT(canister_icon_container, /datum/canister_icons, new())
|
||||
if(!check_change()) //Returns FALSE if no change needed to icons.
|
||||
return
|
||||
|
||||
/obj/machinery/portable_atmospherics/canister/update_overlays()
|
||||
/obj/machinery/atmospherics/portable/canister/update_overlays()
|
||||
. = ..()
|
||||
if(stat & BROKEN)
|
||||
return
|
||||
@@ -187,12 +196,12 @@ GLOBAL_DATUM_INIT(canister_icon_container, /datum/canister_icons, new())
|
||||
update_flag &= ~RESET //the flag NEW_COLOR represents change, not states. As such, we have to reset them to be able to detect a change on the next go.
|
||||
return
|
||||
|
||||
/obj/machinery/portable_atmospherics/canister/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume)
|
||||
/obj/machinery/atmospherics/portable/canister/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume)
|
||||
..()
|
||||
if(exposed_temperature > temperature_resistance)
|
||||
take_damage(5, BURN, 0)
|
||||
|
||||
/obj/machinery/portable_atmospherics/canister/deconstruct(disassembled = TRUE)
|
||||
/obj/machinery/atmospherics/portable/canister/deconstruct(disassembled = TRUE)
|
||||
if(!(flags & NODECONSTRUCT))
|
||||
if(!(stat & BROKEN))
|
||||
canister_break()
|
||||
@@ -202,12 +211,12 @@ GLOBAL_DATUM_INIT(canister_icon_container, /datum/canister_icons, new())
|
||||
new /obj/item/stack/sheet/metal (loc, 5)
|
||||
qdel(src)
|
||||
|
||||
/obj/machinery/portable_atmospherics/canister/obj_break(damage_flag)
|
||||
/obj/machinery/atmospherics/portable/canister/obj_break(damage_flag)
|
||||
if((stat & BROKEN) || (flags & NODECONSTRUCT))
|
||||
return
|
||||
canister_break()
|
||||
|
||||
/obj/machinery/portable_atmospherics/canister/proc/canister_break()
|
||||
/obj/machinery/atmospherics/portable/canister/proc/canister_break()
|
||||
disconnect()
|
||||
var/datum/gas_mixture/expelled_gas = air_contents.remove(air_contents.total_moles())
|
||||
var/turf/T = get_turf(src)
|
||||
@@ -223,7 +232,7 @@ GLOBAL_DATUM_INIT(canister_icon_container, /datum/canister_icons, new())
|
||||
holding_tank.forceMove(T)
|
||||
holding_tank = null
|
||||
|
||||
/obj/machinery/portable_atmospherics/canister/process_atmos()
|
||||
/obj/machinery/atmospherics/portable/canister/process_atmos()
|
||||
if(stat & BROKEN)
|
||||
return
|
||||
|
||||
@@ -260,49 +269,50 @@ GLOBAL_DATUM_INIT(canister_icon_container, /datum/canister_icons, new())
|
||||
else
|
||||
can_label = FALSE
|
||||
|
||||
|
||||
/obj/machinery/portable_atmospherics/canister/return_air()
|
||||
/obj/machinery/atmospherics/portable/canister/return_air()
|
||||
return air_contents
|
||||
|
||||
/obj/machinery/portable_atmospherics/canister/proc/return_temperature()
|
||||
/obj/machinery/atmospherics/portable/canister/proc/return_temperature()
|
||||
var/datum/gas_mixture/GM = return_air()
|
||||
if(GM && GM.volume>0)
|
||||
return GM.temperature
|
||||
return
|
||||
|
||||
/obj/machinery/portable_atmospherics/canister/proc/return_pressure()
|
||||
/obj/machinery/atmospherics/portable/canister/proc/return_pressure()
|
||||
var/datum/gas_mixture/GM = return_air()
|
||||
if(GM && GM.volume>0)
|
||||
return GM.return_pressure()
|
||||
return
|
||||
|
||||
/obj/machinery/portable_atmospherics/canister/replace_tank(mob/living/user, close_valve)
|
||||
/obj/machinery/atmospherics/portable/canister/replace_tank(mob/living/user, close_valve)
|
||||
. = ..()
|
||||
|
||||
if(.)
|
||||
if(close_valve)
|
||||
valve_open = FALSE
|
||||
update_icon()
|
||||
investigate_log("Valve was <b>closed</b> by [key_name(user)].<br>", "atmos")
|
||||
|
||||
else if(valve_open && holding_tank)
|
||||
investigate_log("[key_name(user)] started a transfer into [holding_tank].<br>", "atmos")
|
||||
|
||||
/obj/machinery/portable_atmospherics/canister/attack_ai(mob/user)
|
||||
/obj/machinery/atmospherics/portable/canister/attack_ai(mob/user)
|
||||
add_hiddenprint(user)
|
||||
return attack_hand(user)
|
||||
|
||||
/obj/machinery/portable_atmospherics/canister/attack_ghost(mob/user)
|
||||
/obj/machinery/atmospherics/portable/canister/attack_ghost(mob/user)
|
||||
return ui_interact(user)
|
||||
|
||||
/obj/machinery/portable_atmospherics/canister/attack_hand(mob/user)
|
||||
/obj/machinery/atmospherics/portable/canister/attack_hand(mob/user)
|
||||
return ui_interact(user)
|
||||
|
||||
/obj/machinery/portable_atmospherics/canister/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = TRUE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.physical_state)
|
||||
/obj/machinery/atmospherics/portable/canister/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = TRUE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.physical_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "Canister", name, 600, 350, master_ui, state)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/portable_atmospherics/canister/ui_data()
|
||||
/obj/machinery/atmospherics/portable/canister/ui_data()
|
||||
var/data = list()
|
||||
data["portConnected"] = connected_port ? TRUE : FALSE
|
||||
data["tankPressure"] = round(air_contents.return_pressure() ? air_contents.return_pressure() : 0)
|
||||
@@ -320,12 +330,14 @@ GLOBAL_DATUM_INIT(canister_icon_container, /datum/canister_icons, new())
|
||||
data["holdingTank"] = list("name" = holding_tank.name, "tankPressure" = round(holding_tank.air_contents.return_pressure()))
|
||||
return data
|
||||
|
||||
/obj/machinery/portable_atmospherics/canister/ui_act(action, params)
|
||||
/obj/machinery/atmospherics/portable/canister/ui_act(action, params)
|
||||
if(..())
|
||||
return
|
||||
|
||||
var/can_min_release_pressure = round(ONE_ATMOSPHERE / 10)
|
||||
var/can_max_release_pressure = round(ONE_ATMOSPHERE * 10)
|
||||
. = TRUE
|
||||
|
||||
switch(action)
|
||||
if("relabel")
|
||||
if(can_label)
|
||||
@@ -338,6 +350,7 @@ GLOBAL_DATUM_INIT(canister_icon_container, /datum/canister_icons, new())
|
||||
else
|
||||
to_chat(usr, "<span class='warning'>As you attempted to rename it the pressure rose!</span>")
|
||||
. = FALSE
|
||||
|
||||
if("pressure")
|
||||
var/pressure = params["pressure"]
|
||||
if(pressure == "reset")
|
||||
@@ -355,141 +368,152 @@ GLOBAL_DATUM_INIT(canister_icon_container, /datum/canister_icons, new())
|
||||
if(.)
|
||||
release_pressure = clamp(round(pressure), can_min_release_pressure, can_max_release_pressure)
|
||||
investigate_log("was set to [release_pressure] kPa by [key_name(usr)].", "atmos")
|
||||
|
||||
if("valve")
|
||||
var/logmsg
|
||||
valve_open = !valve_open
|
||||
if(valve_open)
|
||||
logmsg = "Valve was <b>opened</b> by [key_name(usr)], starting a transfer into the [holding_tank || "air"].<br>"
|
||||
|
||||
if(!holding_tank)
|
||||
logmsg = "Valve was <b>opened</b> by [key_name(usr)], starting a transfer into the air.<br>"
|
||||
|
||||
if(air_contents.toxins > 0)
|
||||
message_admins("[key_name_admin(usr)] opened a canister that contains plasma in [get_area(src)]! (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[x];Y=[y];Z=[z]'>JMP</a>)")
|
||||
log_admin("[key_name(usr)] opened a canister that contains plasma at [get_area(src)]: [x], [y], [z]")
|
||||
|
||||
if(air_contents.sleeping_agent > 0)
|
||||
message_admins("[key_name_admin(usr)] opened a canister that contains N2O in [get_area(src)]! (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[x];Y=[y];Z=[z]'>JMP</a>)")
|
||||
log_admin("[key_name(usr)] opened a canister that contains N2O at [get_area(src)]: [x], [y], [z]")
|
||||
|
||||
else
|
||||
logmsg = "Valve was <b>closed</b> by [key_name(usr)], stopping the transfer into the [holding_tank || "air"].<br>"
|
||||
|
||||
investigate_log(logmsg, "atmos")
|
||||
release_log += logmsg
|
||||
|
||||
if("eject")
|
||||
if(holding_tank)
|
||||
if(valve_open)
|
||||
valve_open = FALSE
|
||||
release_log += "Valve was <b>closed</b> by [key_name(usr)], stopping the transfer into the [holding_tank]<br>"
|
||||
replace_tank(usr, FALSE)
|
||||
|
||||
if("recolor")
|
||||
if(can_label)
|
||||
var/ctype = params["ctype"]
|
||||
var/cnum = text2num(params["nc"])
|
||||
|
||||
if(isnull(colorcontainer[ctype]))
|
||||
message_admins("[key_name_admin(usr)] passed an invalid ctype var to a canister.")
|
||||
return
|
||||
|
||||
var/newcolor = sanitize_integer(cnum, 0, length(colorcontainer[ctype]["options"]))
|
||||
color_index[ctype] = newcolor
|
||||
newcolor++ // javascript starts arrays at 0, byond (for some reason) starts them at 1, this converts JS values to byond values
|
||||
canister_color[ctype] = colorcontainer[ctype]["options"][newcolor]["icon"]
|
||||
|
||||
add_fingerprint(usr)
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/atmospherics/portable/canister/atmos_init()
|
||||
. = ..()
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/portable_atmospherics/canister/toxins
|
||||
/obj/machinery/atmospherics/portable/canister/toxins
|
||||
name = "Canister \[Toxin (Plasma)\]"
|
||||
icon_state = "orange" //See New()
|
||||
icon_state = "orange" //See Initialize()
|
||||
can_label = FALSE
|
||||
/obj/machinery/portable_atmospherics/canister/oxygen
|
||||
/obj/machinery/atmospherics/portable/canister/oxygen
|
||||
name = "Canister: \[O2\]"
|
||||
icon_state = "blue" //See New()
|
||||
icon_state = "blue" //See Initialize()
|
||||
can_label = FALSE
|
||||
/obj/machinery/portable_atmospherics/canister/sleeping_agent
|
||||
/obj/machinery/atmospherics/portable/canister/sleeping_agent
|
||||
name = "Canister: \[N2O\]"
|
||||
icon_state = "redws" //See New()
|
||||
icon_state = "redws" //See Initialize()
|
||||
can_label = FALSE
|
||||
/obj/machinery/portable_atmospherics/canister/nitrogen
|
||||
/obj/machinery/atmospherics/portable/canister/nitrogen
|
||||
name = "Canister: \[N2\]"
|
||||
icon_state = "red" //See New()
|
||||
icon_state = "red" //See Initialize()
|
||||
can_label = FALSE
|
||||
/obj/machinery/portable_atmospherics/canister/carbon_dioxide
|
||||
/obj/machinery/atmospherics/portable/canister/carbon_dioxide
|
||||
name = "Canister \[CO2\]"
|
||||
icon_state = "black" //See New()
|
||||
icon_state = "black" //See Initialize()
|
||||
can_label = FALSE
|
||||
/obj/machinery/portable_atmospherics/canister/air
|
||||
/obj/machinery/atmospherics/portable/canister/air
|
||||
name = "Canister \[Air\]"
|
||||
icon_state = "grey" //See New()
|
||||
icon_state = "grey" //See Initialize()
|
||||
can_label = FALSE
|
||||
/obj/machinery/portable_atmospherics/canister/custom_mix
|
||||
/obj/machinery/atmospherics/portable/canister/custom_mix
|
||||
name = "Canister \[Custom\]"
|
||||
icon_state = "whiters" //See New()
|
||||
icon_state = "whiters" //See Initialize()
|
||||
can_label = FALSE
|
||||
|
||||
/obj/machinery/portable_atmospherics/canister/toxins/New()
|
||||
..()
|
||||
|
||||
/obj/machinery/atmospherics/portable/canister/toxins/Initialize(mapload)
|
||||
. = ..()
|
||||
|
||||
canister_color["prim"] = "orange"
|
||||
air_contents.toxins = (maximum_pressure * filled) * air_contents.volume / (R_IDEAL_GAS_EQUATION * air_contents.temperature)
|
||||
|
||||
update_icon()
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/portable_atmospherics/canister/oxygen/New()
|
||||
..()
|
||||
/obj/machinery/atmospherics/portable/canister/oxygen/Initialize(mapload)
|
||||
. = ..()
|
||||
|
||||
canister_color["prim"] = "blue"
|
||||
air_contents.oxygen = (maximum_pressure * filled) * air_contents.volume / (R_IDEAL_GAS_EQUATION * air_contents.temperature)
|
||||
|
||||
update_icon()
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/portable_atmospherics/canister/sleeping_agent/New()
|
||||
..()
|
||||
/obj/machinery/atmospherics/portable/canister/sleeping_agent/Initialize(mapload)
|
||||
. = ..()
|
||||
|
||||
canister_color["prim"] = "redws"
|
||||
air_contents.sleeping_agent = (maximum_pressure * filled) * air_contents.volume / (R_IDEAL_GAS_EQUATION * air_contents.temperature)
|
||||
|
||||
update_icon()
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/portable_atmospherics/canister/nitrogen/New()
|
||||
..()
|
||||
/obj/machinery/atmospherics/portable/canister/nitrogen/Initialize(mapload)
|
||||
. = ..()
|
||||
|
||||
canister_color["prim"] = "red"
|
||||
air_contents.nitrogen = (maximum_pressure * filled) * air_contents.volume / (R_IDEAL_GAS_EQUATION * air_contents.temperature)
|
||||
|
||||
update_icon()
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/portable_atmospherics/canister/carbon_dioxide/New()
|
||||
..()
|
||||
|
||||
/obj/machinery/atmospherics/portable/canister/carbon_dioxide/Initialize(mapload)
|
||||
. = ..()
|
||||
|
||||
canister_color["prim"] = "black"
|
||||
air_contents.carbon_dioxide = (maximum_pressure * filled) * air_contents.volume / (R_IDEAL_GAS_EQUATION * air_contents.temperature)
|
||||
|
||||
update_icon()
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/portable_atmospherics/canister/air/New()
|
||||
..()
|
||||
/obj/machinery/atmospherics/portable/canister/air/Initialize(mapload)
|
||||
. = ..()
|
||||
|
||||
canister_color["prim"] = "grey"
|
||||
air_contents.oxygen = (O2STANDARD * maximum_pressure * filled) * air_contents.volume / (R_IDEAL_GAS_EQUATION * air_contents.temperature)
|
||||
air_contents.nitrogen = (N2STANDARD * maximum_pressure * filled) * air_contents.volume / (R_IDEAL_GAS_EQUATION * air_contents.temperature)
|
||||
|
||||
update_icon()
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/portable_atmospherics/canister/custom_mix/New()
|
||||
..()
|
||||
/obj/machinery/atmospherics/portable/canister/custom_mix/Initialize(mapload)
|
||||
. = ..()
|
||||
|
||||
canister_color["prim"] = "whiters"
|
||||
update_icon() // Otherwise new canisters do not have their icon updated with the pressure light, likely want to add this to the canister class constructor, avoiding at current time to refrain from screwing up code for other canisters. --DZD
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/portable_atmospherics/canister/welder_act(mob/user, obj/item/I)
|
||||
/obj/machinery/atmospherics/portable/canister/welder_act(mob/user, obj/item/I)
|
||||
if(!(stat & BROKEN))
|
||||
return
|
||||
|
||||
. = TRUE
|
||||
if(!I.tool_use_check(user, 0))
|
||||
return
|
||||
|
||||
WELDER_ATTEMPT_SLICING_MESSAGE
|
||||
if(I.use_tool(src, user, 50, volume = I.tool_volume))
|
||||
to_chat(user, "<span class='notice'>You salvage whats left of [src]!</span>")
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
/obj/machinery/portable_atmospherics
|
||||
/obj/machinery/atmospherics/portable
|
||||
name = "atmoalter"
|
||||
anchored = FALSE
|
||||
layer = BELOW_OBJ_LAYER
|
||||
use_power = NO_POWER_USE
|
||||
max_integrity = 250
|
||||
armor = list(MELEE = 0, BULLET = 0, LASER = 0, ENERGY = 100, BOMB = 0, BIO = 100, RAD = 100, FIRE = 60, ACID = 30)
|
||||
@@ -10,40 +12,45 @@
|
||||
|
||||
var/volume = 0
|
||||
|
||||
var/maximum_pressure = 90*ONE_ATMOSPHERE
|
||||
var/maximum_pressure = 90 * ONE_ATMOSPHERE
|
||||
|
||||
/obj/machinery/portable_atmospherics/New()
|
||||
..()
|
||||
/obj/machinery/atmospherics/portable/Initialize(mapload)
|
||||
. = ..()
|
||||
SSair.atmos_machinery += src
|
||||
|
||||
air_contents.volume = volume
|
||||
air_contents.temperature = T20C
|
||||
|
||||
return TRUE
|
||||
if(mapload)
|
||||
return INITIALIZE_HINT_LATELOAD
|
||||
|
||||
/obj/machinery/portable_atmospherics/Initialize()
|
||||
. = ..()
|
||||
spawn()
|
||||
var/obj/machinery/atmospherics/unary/portables_connector/port = locate() in loc
|
||||
if(port)
|
||||
connect(port)
|
||||
update_icon()
|
||||
check_for_port()
|
||||
|
||||
/obj/machinery/portable_atmospherics/process_atmos()
|
||||
// Late init this otherwise it shares with the port and it tries to div temperature by 0
|
||||
/obj/machinery/atmospherics/portable/LateInitialize()
|
||||
check_for_port()
|
||||
|
||||
/obj/machinery/atmospherics/portable/proc/check_for_port()
|
||||
var/obj/machinery/atmospherics/unary/portables_connector/port = locate() in loc
|
||||
if(port)
|
||||
connect(port)
|
||||
|
||||
/obj/machinery/atmospherics/portable/process_atmos()
|
||||
if(!connected_port) //only react when pipe_network will ont it do it for you
|
||||
//Allow for reactions
|
||||
air_contents.react()
|
||||
else
|
||||
update_icon()
|
||||
return
|
||||
|
||||
/obj/machinery/portable_atmospherics/Destroy()
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/atmospherics/portable/Destroy()
|
||||
SSair.atmos_machinery -= src
|
||||
disconnect()
|
||||
QDEL_NULL(air_contents)
|
||||
QDEL_NULL(holding_tank)
|
||||
return ..()
|
||||
|
||||
/obj/machinery/portable_atmospherics/proc/connect(obj/machinery/atmospherics/unary/portables_connector/new_port)
|
||||
/obj/machinery/atmospherics/portable/proc/connect(obj/machinery/atmospherics/unary/portables_connector/new_port)
|
||||
//Make sure not already connected to something else
|
||||
if(connected_port || !new_port || new_port.connected_device)
|
||||
return
|
||||
@@ -65,7 +72,7 @@
|
||||
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/portable_atmospherics/proc/disconnect()
|
||||
/obj/machinery/atmospherics/portable/disconnect()
|
||||
if(!connected_port)
|
||||
return
|
||||
|
||||
@@ -76,10 +83,10 @@
|
||||
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/portable_atmospherics/portableConnectorReturnAir()
|
||||
/obj/machinery/atmospherics/portable/portableConnectorReturnAir()
|
||||
return air_contents
|
||||
|
||||
/obj/machinery/portable_atmospherics/AltClick(mob/living/user)
|
||||
/obj/machinery/atmospherics/portable/AltClick(mob/living/user)
|
||||
if(!istype(user) || user.incapacitated())
|
||||
to_chat(user, "<span class='warning'>You can't do that right now!</span>")
|
||||
return
|
||||
@@ -91,12 +98,12 @@
|
||||
to_chat(user, "<span class='notice'>You remove [holding_tank] from [src].</span>")
|
||||
replace_tank(user, TRUE)
|
||||
|
||||
/obj/machinery/portable_atmospherics/examine(mob/user)
|
||||
/obj/machinery/atmospherics/portable/examine(mob/user)
|
||||
. = ..()
|
||||
if(holding_tank)
|
||||
. += "<span class='notice'>\The [src] contains [holding_tank]. Alt-click [src] to remove it.</span>"
|
||||
|
||||
/obj/machinery/portable_atmospherics/proc/replace_tank(mob/living/user, close_valve, obj/item/tank/new_tank)
|
||||
/obj/machinery/atmospherics/portable/proc/replace_tank(mob/living/user, close_valve, obj/item/tank/new_tank)
|
||||
if(holding_tank)
|
||||
holding_tank.forceMove(drop_location())
|
||||
if(Adjacent(user) && !issilicon(user))
|
||||
@@ -108,7 +115,7 @@
|
||||
update_icon()
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/portable_atmospherics/attackby(obj/item/W, mob/user, params)
|
||||
/obj/machinery/atmospherics/portable/attackby(obj/item/W, mob/user, params)
|
||||
if(istype(W, /obj/item/tank))
|
||||
if(!(stat & BROKEN))
|
||||
if(!user.drop_item())
|
||||
@@ -127,7 +134,7 @@
|
||||
return
|
||||
return ..()
|
||||
|
||||
/obj/machinery/portable_atmospherics/wrench_act(mob/user, obj/item/I)
|
||||
/obj/machinery/atmospherics/portable/wrench_act(mob/user, obj/item/I)
|
||||
. = TRUE
|
||||
if(!I.use_tool(src, user, 0, volume = I.tool_volume))
|
||||
return
|
||||
@@ -148,7 +155,7 @@
|
||||
else
|
||||
to_chat(user, "<span class='notice'>Nothing happens.</span>")
|
||||
|
||||
/obj/machinery/portable_atmospherics/attacked_by(obj/item/I, mob/user)
|
||||
/obj/machinery/atmospherics/portable/attacked_by(obj/item/I, mob/user)
|
||||
if(I.force < 10 && !(stat & BROKEN))
|
||||
take_damage(0)
|
||||
else
|
||||
|
||||
@@ -6,35 +6,33 @@
|
||||
/// The pump will be pumping gas out.
|
||||
#define DIRECTION_OUT 1
|
||||
|
||||
/obj/machinery/portable_atmospherics/pump
|
||||
/obj/machinery/atmospherics/portable/pump
|
||||
name = "Portable Air Pump"
|
||||
icon = 'icons/obj/atmos.dmi'
|
||||
icon_state = "psiphon:0"
|
||||
density = TRUE
|
||||
volume = 1000
|
||||
/// If the pump is turned on or off.
|
||||
var/on = FALSE
|
||||
/// The direction the pump is operating in. This should be either `DIRECTION_IN` or `DIRECTION_OUT`.
|
||||
var/direction = DIRECTION_IN
|
||||
/// The desired pressure the pump should be outputting, either into the atmosphere, or into a holding tank.
|
||||
var/target_pressure = 101.325
|
||||
target_pressure = 101.325
|
||||
|
||||
/obj/machinery/portable_atmospherics/pump/detailed_examine()
|
||||
/obj/machinery/atmospherics/portable/pump/detailed_examine()
|
||||
return "Invaluable for filling air in a room rapidly after a breach repair. The internal gas container can be filled by \
|
||||
connecting it to a connector port. The pump can pump the air in (sucking) or out (blowing), at a specific target pressure. The powercell inside can be \
|
||||
replaced by using a screwdriver, and then adding a new cell. A tank of gas can also be attached to the air pump."
|
||||
|
||||
/obj/machinery/portable_atmospherics/pump/update_icon_state()
|
||||
/obj/machinery/atmospherics/portable/pump/update_icon_state()
|
||||
icon_state = "psiphon:[on]"
|
||||
|
||||
/obj/machinery/portable_atmospherics/pump/update_overlays()
|
||||
/obj/machinery/atmospherics/portable/pump/update_overlays()
|
||||
. = ..()
|
||||
if(holding_tank)
|
||||
. += "siphon-open"
|
||||
if(connected_port)
|
||||
. += "siphon-connector"
|
||||
|
||||
/obj/machinery/portable_atmospherics/pump/emp_act(severity)
|
||||
/obj/machinery/atmospherics/portable/pump/emp_act(severity)
|
||||
if(stat & (BROKEN|NOPOWER))
|
||||
..(severity)
|
||||
return
|
||||
@@ -50,7 +48,7 @@
|
||||
|
||||
..(severity)
|
||||
|
||||
/obj/machinery/portable_atmospherics/pump/process_atmos()
|
||||
/obj/machinery/atmospherics/portable/pump/process_atmos()
|
||||
..()
|
||||
if(on)
|
||||
var/datum/gas_mixture/environment
|
||||
@@ -94,10 +92,10 @@
|
||||
|
||||
return
|
||||
|
||||
/obj/machinery/portable_atmospherics/pump/return_air()
|
||||
/obj/machinery/atmospherics/portable/pump/return_air()
|
||||
return air_contents
|
||||
|
||||
/obj/machinery/portable_atmospherics/pump/replace_tank(mob/living/user, close_valve)
|
||||
/obj/machinery/atmospherics/portable/pump/replace_tank(mob/living/user, close_valve)
|
||||
. = ..()
|
||||
if(.)
|
||||
if(close_valve)
|
||||
@@ -107,23 +105,23 @@
|
||||
else if(on && holding_tank && direction == DIRECTION_OUT)
|
||||
investigate_log("[key_name(user)] started a transfer into [holding_tank].<br>", "atmos")
|
||||
|
||||
/obj/machinery/portable_atmospherics/pump/attack_ai(mob/user)
|
||||
/obj/machinery/atmospherics/portable/pump/attack_ai(mob/user)
|
||||
add_hiddenprint(user)
|
||||
return attack_hand(user)
|
||||
|
||||
/obj/machinery/portable_atmospherics/pump/attack_ghost(mob/user)
|
||||
/obj/machinery/atmospherics/portable/pump/attack_ghost(mob/user)
|
||||
return attack_hand(user)
|
||||
|
||||
/obj/machinery/portable_atmospherics/pump/attack_hand(mob/user)
|
||||
/obj/machinery/atmospherics/portable/pump/attack_hand(mob/user)
|
||||
ui_interact(user)
|
||||
|
||||
/obj/machinery/portable_atmospherics/pump/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
|
||||
/obj/machinery/atmospherics/portable/pump/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "PortablePump", "Portable Pump", 434, 377, master_ui, state)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/portable_atmospherics/pump/ui_data(mob/user)
|
||||
/obj/machinery/atmospherics/portable/pump/ui_data(mob/user)
|
||||
var/list/data = list(
|
||||
"on" = on,
|
||||
"direction" = direction,
|
||||
@@ -140,7 +138,7 @@
|
||||
|
||||
return data
|
||||
|
||||
/obj/machinery/portable_atmospherics/pump/ui_act(action, list/params)
|
||||
/obj/machinery/atmospherics/portable/pump/ui_act(action, list/params)
|
||||
if(..())
|
||||
return
|
||||
|
||||
|
||||
@@ -1,25 +1,23 @@
|
||||
|
||||
#define MAX_RATE 10 * ONE_ATMOSPHERE
|
||||
|
||||
/obj/machinery/portable_atmospherics/scrubber
|
||||
/obj/machinery/atmospherics/portable/scrubber
|
||||
name = "Portable Air Scrubber"
|
||||
icon = 'icons/obj/atmos.dmi'
|
||||
icon_state = "pscrubber:0"
|
||||
density = TRUE
|
||||
volume = 750
|
||||
/// Whether the scrubber is switched on or off.
|
||||
var/on = FALSE
|
||||
/// The volume of gas that can be scrubbed every time `process_atmos()` is called (0.5 seconds).
|
||||
var/volume_rate = 101.325
|
||||
/// Is this scrubber acting on the 3x3 area around it.
|
||||
var/widenet = FALSE
|
||||
|
||||
/obj/machinery/portable_atmospherics/scrubber/detailed_examine()
|
||||
/obj/machinery/atmospherics/portable/scrubber/detailed_examine()
|
||||
return "Filters the air, placing harmful gases into the internal gas container. The container can be emptied by \
|
||||
connecting it to a connector port. The pump can pump the air in (sucking) or out (blowing), at a specific target pressure. The powercell inside can be \
|
||||
replaced by using a screwdriver, and then adding a new cell. A tank of gas can also be attached to the scrubber."
|
||||
|
||||
/obj/machinery/portable_atmospherics/scrubber/emp_act(severity)
|
||||
/obj/machinery/atmospherics/portable/scrubber/emp_act(severity)
|
||||
if(stat & (BROKEN|NOPOWER))
|
||||
..(severity)
|
||||
return
|
||||
@@ -30,20 +28,20 @@
|
||||
|
||||
..(severity)
|
||||
|
||||
/obj/machinery/portable_atmospherics/scrubber/update_icon_state()
|
||||
/obj/machinery/atmospherics/portable/scrubber/update_icon_state()
|
||||
if(on)
|
||||
icon_state = "pscrubber:1"
|
||||
else
|
||||
icon_state = "pscrubber:0"
|
||||
|
||||
/obj/machinery/portable_atmospherics/scrubber/update_overlays()
|
||||
/obj/machinery/atmospherics/portable/scrubber/update_overlays()
|
||||
. = ..()
|
||||
if(holding_tank)
|
||||
. += "scrubber-open"
|
||||
if(connected_port)
|
||||
. += "scrubber-connector"
|
||||
|
||||
/obj/machinery/portable_atmospherics/scrubber/process_atmos()
|
||||
/obj/machinery/atmospherics/portable/scrubber/process_atmos()
|
||||
..()
|
||||
|
||||
if(!on)
|
||||
@@ -55,7 +53,7 @@
|
||||
for(var/turf/simulated/tile in T.GetAtmosAdjacentTurfs(alldir=1))
|
||||
scrub(tile)
|
||||
|
||||
/obj/machinery/portable_atmospherics/scrubber/proc/scrub(turf/simulated/tile)
|
||||
/obj/machinery/atmospherics/portable/scrubber/proc/scrub(turf/simulated/tile)
|
||||
var/datum/gas_mixture/environment
|
||||
if(holding_tank)
|
||||
environment = holding_tank.air_contents
|
||||
@@ -98,28 +96,28 @@
|
||||
tile.assume_air(removed)
|
||||
tile.air_update_turf()
|
||||
|
||||
/obj/machinery/portable_atmospherics/scrubber/return_air()
|
||||
/obj/machinery/atmospherics/portable/scrubber/return_air()
|
||||
return air_contents
|
||||
|
||||
/obj/machinery/portable_atmospherics/scrubber/attack_ai(mob/user)
|
||||
/obj/machinery/atmospherics/portable/scrubber/attack_ai(mob/user)
|
||||
add_hiddenprint(user)
|
||||
return attack_hand(user)
|
||||
|
||||
/obj/machinery/portable_atmospherics/scrubber/attack_ghost(mob/user)
|
||||
/obj/machinery/atmospherics/portable/scrubber/attack_ghost(mob/user)
|
||||
return attack_hand(user)
|
||||
|
||||
/obj/machinery/portable_atmospherics/scrubber/attack_hand(mob/user)
|
||||
/obj/machinery/atmospherics/portable/scrubber/attack_hand(mob/user)
|
||||
ui_interact(user)
|
||||
return
|
||||
|
||||
/obj/machinery/portable_atmospherics/scrubber/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
|
||||
/obj/machinery/atmospherics/portable/scrubber/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "PortableScrubber", "Portable Scrubber", 433, 346, master_ui, state)
|
||||
ui.open()
|
||||
ui.set_autoupdate(TRUE)
|
||||
|
||||
/obj/machinery/portable_atmospherics/scrubber/ui_data(mob/user)
|
||||
/obj/machinery/atmospherics/portable/scrubber/ui_data(mob/user)
|
||||
var/list/data = list(
|
||||
"on" = on,
|
||||
"port_connected" = connected_port ? TRUE : FALSE,
|
||||
@@ -135,7 +133,7 @@
|
||||
|
||||
return data
|
||||
|
||||
/obj/machinery/portable_atmospherics/scrubber/ui_act(action, list/params)
|
||||
/obj/machinery/atmospherics/portable/scrubber/ui_act(action, list/params)
|
||||
if(..())
|
||||
return
|
||||
|
||||
@@ -158,7 +156,7 @@
|
||||
|
||||
add_fingerprint(usr)
|
||||
|
||||
/obj/machinery/portable_atmospherics/scrubber/huge
|
||||
/obj/machinery/atmospherics/portable/scrubber/huge
|
||||
name = "Huge Air Scrubber"
|
||||
icon_state = "scrubber:0"
|
||||
anchored = TRUE
|
||||
@@ -170,26 +168,26 @@
|
||||
var/id = 0
|
||||
var/stationary = FALSE
|
||||
|
||||
/obj/machinery/portable_atmospherics/scrubber/huge/New()
|
||||
/obj/machinery/atmospherics/portable/scrubber/huge/New()
|
||||
..()
|
||||
id = gid
|
||||
gid++
|
||||
|
||||
name = "[name] (ID [id])"
|
||||
|
||||
/obj/machinery/portable_atmospherics/scrubber/huge/attack_hand(mob/user)
|
||||
/obj/machinery/atmospherics/portable/scrubber/huge/attack_hand(mob/user)
|
||||
to_chat(usr, "<span class='warning'>You can't directly interact with this machine. Use the area atmos computer.</span>")
|
||||
|
||||
/obj/machinery/portable_atmospherics/scrubber/huge/update_icon_state()
|
||||
/obj/machinery/atmospherics/portable/scrubber/huge/update_icon_state()
|
||||
icon_state = "scrubber:[on]"
|
||||
|
||||
/obj/machinery/portable_atmospherics/scrubber/huge/attackby(obj/item/W, mob/user, params)
|
||||
/obj/machinery/atmospherics/portable/scrubber/huge/attackby(obj/item/W, mob/user, params)
|
||||
if((istype(W, /obj/item/analyzer)) && get_dist(user, src) <= 1)
|
||||
atmosanalyzer_scan(air_contents, user)
|
||||
return
|
||||
return ..()
|
||||
|
||||
/obj/machinery/portable_atmospherics/scrubber/huge/wrench_act(mob/user, obj/item/I)
|
||||
/obj/machinery/atmospherics/portable/scrubber/huge/wrench_act(mob/user, obj/item/I)
|
||||
. = TRUE
|
||||
if(stationary)
|
||||
to_chat(user, "<span class='warning'>The bolts are too tight for you to unscrew!</span>")
|
||||
@@ -202,7 +200,7 @@
|
||||
anchored = !anchored
|
||||
to_chat(user, "<span class='notice'>You [anchored ? "wrench" : "unwrench"] [src].</span>")
|
||||
|
||||
/obj/machinery/portable_atmospherics/scrubber/huge/stationary
|
||||
/obj/machinery/atmospherics/portable/scrubber/huge/stationary
|
||||
name = "Stationary Air Scrubber"
|
||||
stationary = TRUE
|
||||
|
||||
|
||||
@@ -97,7 +97,7 @@
|
||||
color = "#00ff80"
|
||||
|
||||
/obj/effect/countdown/supermatter/get_value()
|
||||
var/obj/machinery/power/supermatter_crystal/S = attached_to
|
||||
var/obj/machinery/atmospherics/supermatter_crystal/S = attached_to
|
||||
if(!istype(S))
|
||||
return
|
||||
return "<div align='center' valign='middle' style='position:relative; top:0px; left:0px'>[round(S.get_integrity(), 1)]%</div>"
|
||||
|
||||
@@ -178,28 +178,35 @@ GLOBAL_DATUM(error_cache, /datum/ErrorViewer/ErrorCache)
|
||||
/datum/ErrorViewer/ErrorEntry/showTo(user, datum/ErrorViewer/back_to, linear)
|
||||
if(!istype(back_to))
|
||||
back_to = error_source
|
||||
|
||||
var/html = buildHeader(back_to, linear)
|
||||
html += "<div class='bad'><b>Be sure to censor out ckeys when copying runtimes!</b></div><br>"
|
||||
html += "<div class='runtime'>[html_encode(name)]<br>[desc]</div>"
|
||||
|
||||
if(srcRef)
|
||||
html += "<br>src: <a href='?_src_=vars;Vars=[srcUID]'>VV</a>"
|
||||
|
||||
if(ispath(srcType, /mob))
|
||||
html += " <a href='?_src_=holder;adminplayeropts=[srcUID]'>PP</a>"
|
||||
html += " <a href='?_src_=holder;adminplayerobservefollow=[srcUID]'>Follow</a>"
|
||||
|
||||
if(istype(srcLoc))
|
||||
html += "<br>src.loc: <a href='?_src_=vars;Vars=[srcLoc.UID()]'>VV</a>"
|
||||
html += " <a href='?_src_=holder;adminplayerobservecoodjump=1;X=[srcLoc.x];Y=[srcLoc.y];Z=[srcLoc.z]'>JMP</a>"
|
||||
|
||||
if(usrRef)
|
||||
html += "<br>usr: <a href='?_src_=vars;Vars=[usrUID]'>VV</a>"
|
||||
html += " <a href='?_src_=holder;adminplayeropts=[usrUID]'>PP</a>"
|
||||
html += " <a href='?_src_=holder;adminplayerobservefollow=[usrUID]'>Follow</a>"
|
||||
|
||||
if(istype(usrLoc))
|
||||
html += "<br>usr.loc: <a href='?_src_=vars;Vars=[usrLoc.UID()]'>VV</a>"
|
||||
html += " <a href='?_src_=holder;adminplayerobservecoodjump=1;X=[usrLoc.x];Y=[usrLoc.y];Z=[usrLoc.z]'>JMP</a>"
|
||||
|
||||
browseTo(user, html)
|
||||
|
||||
/datum/ErrorViewer/ErrorEntry/makeLink(linktext, datum/ErrorViewer/back_to, linear)
|
||||
if(isSkipCount)
|
||||
return html_encode(name)
|
||||
else
|
||||
return ..()
|
||||
|
||||
return ..()
|
||||
|
||||
@@ -121,8 +121,8 @@
|
||||
if(istype(A, /obj/item/tank))
|
||||
var/obj/item/tank/T = A
|
||||
pda.atmosanalyzer_scan(T.air_contents, user, T)
|
||||
else if(istype(A, /obj/machinery/portable_atmospherics))
|
||||
var/obj/machinery/portable_atmospherics/T = A
|
||||
else if(istype(A, /obj/machinery/atmospherics/portable))
|
||||
var/obj/machinery/atmospherics/portable/T = A
|
||||
pda.atmosanalyzer_scan(T.air_contents, user, T)
|
||||
else if(istype(A, /obj/machinery/atmospherics/pipe))
|
||||
var/obj/machinery/atmospherics/pipe/T = A
|
||||
@@ -135,8 +135,8 @@
|
||||
var/obj/item/flamethrower/T = A
|
||||
if(T.ptank)
|
||||
pda.atmosanalyzer_scan(T.ptank.air_contents, user, T)
|
||||
else if(istype(A, /obj/machinery/portable_atmospherics/scrubber/huge))
|
||||
var/obj/machinery/portable_atmospherics/scrubber/huge/T = A
|
||||
else if(istype(A, /obj/machinery/atmospherics/portable/scrubber/huge))
|
||||
var/obj/machinery/atmospherics/portable/scrubber/huge/T = A
|
||||
pda.atmosanalyzer_scan(T.air_contents, user, T)
|
||||
else if(istype(A, /obj/machinery/atmospherics/unary/tank))
|
||||
var/obj/machinery/atmospherics/unary/tank/T = A
|
||||
|
||||
@@ -275,7 +275,7 @@
|
||||
/obj/singularity/proc/consume(atom/A)
|
||||
var/gain = A.singularity_act(current_size)
|
||||
src.energy += gain
|
||||
if(istype(A, /obj/machinery/power/supermatter_crystal) && !consumedSupermatter)
|
||||
if(istype(A, /obj/machinery/atmospherics/supermatter_crystal) && !consumedSupermatter)
|
||||
desc = "[initial(desc)] It glows fiercely with inner fire."
|
||||
name = "supermatter-charged [initial(name)]"
|
||||
consumedSupermatter = TRUE
|
||||
|
||||
@@ -78,7 +78,7 @@
|
||||
|
||||
#define MAX_SPACE_EXPOSURE_DAMAGE 2
|
||||
|
||||
/obj/machinery/power/supermatter_crystal
|
||||
/obj/machinery/atmospherics/supermatter_crystal
|
||||
name = "supermatter crystal"
|
||||
desc = "A strangely translucent and iridescent crystal."
|
||||
icon = 'icons/obj/supermatter.dmi'
|
||||
@@ -192,7 +192,7 @@
|
||||
///Disables the sm's proccessing totally.
|
||||
var/processes = TRUE
|
||||
|
||||
/obj/machinery/power/supermatter_crystal/Initialize(mapload)
|
||||
/obj/machinery/atmospherics/supermatter_crystal/Initialize(mapload)
|
||||
. = ..()
|
||||
supermatter_id = global_supermatter_id++
|
||||
SSair.atmos_machinery += src
|
||||
@@ -206,7 +206,7 @@
|
||||
|
||||
soundloop = new(list(src), TRUE)
|
||||
|
||||
/obj/machinery/power/supermatter_crystal/Destroy()
|
||||
/obj/machinery/atmospherics/supermatter_crystal/Destroy()
|
||||
investigate_log("has been destroyed.", "supermatter")
|
||||
SSair.atmos_machinery -= src
|
||||
QDEL_NULL(radio)
|
||||
@@ -215,7 +215,7 @@
|
||||
QDEL_NULL(soundloop)
|
||||
return ..()
|
||||
|
||||
/obj/machinery/power/supermatter_crystal/examine(mob/user)
|
||||
/obj/machinery/atmospherics/supermatter_crystal/examine(mob/user)
|
||||
. = ..()
|
||||
if(!ishuman(user))
|
||||
return
|
||||
@@ -224,7 +224,7 @@
|
||||
if(!immune && !HAS_TRAIT(H, TRAIT_MESON_VISION) && (get_dist(user, src) < HALLUCINATION_RANGE(power)))
|
||||
. += "<span class='danger'>You get headaches just from looking at it.</span>"
|
||||
|
||||
/obj/machinery/power/supermatter_crystal/detailed_examine()
|
||||
/obj/machinery/atmospherics/supermatter_crystal/detailed_examine()
|
||||
return "When energized by a laser (or something hitting it), it emits radiation and heat. If the heat reaches above 7000 kelvin, it will send an alert and start taking damage. \
|
||||
After integrity falls to zero percent, it will delaminate, causing a massive explosion, station-wide radiation spikes, and hallucinations. \
|
||||
Supermatter reacts badly to oxygen in the atmosphere. It'll also heat up really quick if it is in vacuum.<br>\
|
||||
@@ -236,12 +236,12 @@
|
||||
Touching the supermatter will result in *instant death*, with no corpse left behind! You can drag the supermatter, but anything else will kill you. \
|
||||
It is advised to obtain a genetic backup before trying to drag it."
|
||||
|
||||
/obj/machinery/power/supermatter_crystal/detailed_examine_antag()
|
||||
/obj/machinery/atmospherics/supermatter_crystal/detailed_examine_antag()
|
||||
return "Exposing the supermatter to oxygen or vacuum will cause it to start rapidly heating up. Sabotaging the supermatter and making it explode will \
|
||||
cause a period of lag as the explosion is processed by the server, as well as irradiating the entire station and causing hallucinations to happen. \
|
||||
Wearing radiation equipment will protect you from most of the delamination effects sans explosion."
|
||||
|
||||
/obj/machinery/power/supermatter_crystal/proc/get_status()
|
||||
/obj/machinery/atmospherics/supermatter_crystal/proc/get_status()
|
||||
var/turf/T = get_turf(src)
|
||||
if(!T)
|
||||
return SUPERMATTER_ERROR
|
||||
@@ -269,7 +269,7 @@
|
||||
return SUPERMATTER_NORMAL
|
||||
return SUPERMATTER_INACTIVE
|
||||
|
||||
/obj/machinery/power/supermatter_crystal/proc/alarm()
|
||||
/obj/machinery/atmospherics/supermatter_crystal/proc/alarm()
|
||||
switch(get_status())
|
||||
if(SUPERMATTER_DELAMINATING)
|
||||
playsound(src, 'sound/misc/bloblarm.ogg', 100, FALSE, 40, 30, falloff_distance = 10)
|
||||
@@ -280,13 +280,13 @@
|
||||
if(SUPERMATTER_WARNING)
|
||||
playsound(src, 'sound/machines/terminal_alert.ogg', 75)
|
||||
|
||||
/obj/machinery/power/supermatter_crystal/proc/get_integrity()
|
||||
/obj/machinery/atmospherics/supermatter_crystal/proc/get_integrity()
|
||||
var/integrity = damage / explosion_point
|
||||
integrity = round(100 - integrity * 100, 0.01)
|
||||
integrity = integrity < 0 ? 0 : integrity
|
||||
return integrity
|
||||
|
||||
/obj/machinery/power/supermatter_crystal/proc/countdown()
|
||||
/obj/machinery/atmospherics/supermatter_crystal/proc/countdown()
|
||||
set waitfor = FALSE
|
||||
|
||||
if(final_countdown) // We're already doing it go away
|
||||
@@ -320,7 +320,7 @@
|
||||
|
||||
explode()
|
||||
|
||||
/obj/machinery/power/supermatter_crystal/proc/explode()
|
||||
/obj/machinery/atmospherics/supermatter_crystal/proc/explode()
|
||||
SSblackbox.record_feedback("amount", "supermatter_delaminations", 1)
|
||||
for(var/mob in GLOB.alive_mob_list)
|
||||
var/mob/living/L = mob
|
||||
@@ -358,7 +358,7 @@
|
||||
if(T)
|
||||
var/obj/singularity/energy_ball/E = new(T)
|
||||
E.energy = 200 //Gets us about 9 balls
|
||||
// else if(power > EVENT_POWER_PENALTY_THRESHOLD && prob(power/50) && !istype(src, /obj/machinery/power/supermatter_crystal/shard))
|
||||
// else if(power > EVENT_POWER_PENALTY_THRESHOLD && prob(power/50) && !istype(src, /obj/machinery/atmospherics/supermatter_crystal/shard))
|
||||
// var/datum/round_event_control/crystal_invasion/crystals = new/datum/round_event_control/crystal_invasion
|
||||
// crystals.runEvent()
|
||||
// return //No boom for me sir
|
||||
@@ -366,7 +366,7 @@
|
||||
explosion(get_turf(T), explosion_power * max(gasmix_power_ratio, 0.205) * 0.5 , explosion_power * max(gasmix_power_ratio, 0.205) + 2, explosion_power * max(gasmix_power_ratio, 0.205) + 4 , explosion_power * max(gasmix_power_ratio, 0.205) + 6, 1, 1)
|
||||
qdel(src)
|
||||
|
||||
/obj/machinery/power/supermatter_crystal/process_atmos()
|
||||
/obj/machinery/atmospherics/supermatter_crystal/process_atmos()
|
||||
if(!processes) //Just fuck me up bro
|
||||
return
|
||||
var/turf/T = loc
|
||||
@@ -634,7 +634,7 @@
|
||||
|
||||
return 1
|
||||
|
||||
/obj/machinery/power/supermatter_crystal/bullet_act(obj/item/projectile/Proj)
|
||||
/obj/machinery/atmospherics/supermatter_crystal/bullet_act(obj/item/projectile/Proj)
|
||||
var/turf/L = loc
|
||||
if(!istype(L))
|
||||
return FALSE
|
||||
@@ -651,7 +651,7 @@
|
||||
damage += Proj.damage * bullet_energy
|
||||
return FALSE
|
||||
|
||||
/obj/machinery/power/supermatter_crystal/singularity_act()
|
||||
/obj/machinery/atmospherics/supermatter_crystal/singularity_act()
|
||||
var/gain = 100
|
||||
investigate_log("Supermatter shard consumed by singularity.", "singulo")
|
||||
message_admins("Singularity has consumed a supermatter shard and can now become stage six.")
|
||||
@@ -664,7 +664,7 @@
|
||||
qdel(src)
|
||||
return gain
|
||||
|
||||
/obj/machinery/power/supermatter_crystal/blob_act(obj/structure/blob/B)
|
||||
/obj/machinery/atmospherics/supermatter_crystal/blob_act(obj/structure/blob/B)
|
||||
if(B && !isspaceturf(loc)) //does nothing in space
|
||||
playsound(get_turf(src), 'sound/effects/supermatter.ogg', 50, TRUE)
|
||||
damage += B.obj_integrity * 0.5 //take damage equal to 50% of remaining blob health before it tried to eat us
|
||||
@@ -677,7 +677,7 @@
|
||||
"<span class='italics'>You hear a loud crack as you are washed with a wave of heat.</span>")
|
||||
Consume(B)
|
||||
|
||||
/obj/machinery/power/supermatter_crystal/attack_tk(mob/user)
|
||||
/obj/machinery/atmospherics/supermatter_crystal/attack_tk(mob/user)
|
||||
if(iscarbon(user))
|
||||
var/mob/living/carbon/C = user
|
||||
to_chat(C, "<span class='userdanger'>That was a really dense idea.</span>")
|
||||
@@ -687,10 +687,10 @@
|
||||
B.remove(C)
|
||||
qdel(B)
|
||||
|
||||
/obj/machinery/power/supermatter_crystal/attack_alien(mob/user)
|
||||
/obj/machinery/atmospherics/supermatter_crystal/attack_alien(mob/user)
|
||||
dust_mob(user, cause = "alien attack")
|
||||
|
||||
/obj/machinery/power/supermatter_crystal/attack_animal(mob/living/simple_animal/S)
|
||||
/obj/machinery/atmospherics/supermatter_crystal/attack_animal(mob/living/simple_animal/S)
|
||||
var/murder
|
||||
if(!S.melee_damage_upper && !S.melee_damage_lower)
|
||||
murder = S.friendly
|
||||
@@ -701,18 +701,18 @@
|
||||
"<span class='userdanger'>You unwisely touch [src], and your vision glows brightly as your body crumbles to dust. Oops.</span>", \
|
||||
"simple animal attack")
|
||||
|
||||
/obj/machinery/power/supermatter_crystal/attack_robot(mob/user)
|
||||
/obj/machinery/atmospherics/supermatter_crystal/attack_robot(mob/user)
|
||||
if(Adjacent(user))
|
||||
dust_mob(user, cause = "cyborg attack")
|
||||
|
||||
/obj/machinery/power/supermatter_crystal/attack_ai(mob/user)
|
||||
/obj/machinery/atmospherics/supermatter_crystal/attack_ai(mob/user)
|
||||
return
|
||||
|
||||
/obj/machinery/power/supermatter_crystal/attack_hand(mob/living/user)
|
||||
/obj/machinery/atmospherics/supermatter_crystal/attack_hand(mob/living/user)
|
||||
..()
|
||||
dust_mob(user, cause = "hand")
|
||||
|
||||
/obj/machinery/power/supermatter_crystal/proc/dust_mob(mob/living/nom, vis_msg, mob_msg, cause)
|
||||
/obj/machinery/atmospherics/supermatter_crystal/proc/dust_mob(mob/living/nom, vis_msg, mob_msg, cause)
|
||||
if(nom.incorporeal_move || nom.status_flags & GODMODE)
|
||||
return
|
||||
if(!vis_msg)
|
||||
@@ -726,7 +726,7 @@
|
||||
playsound(get_turf(src), 'sound/effects/supermatter.ogg', 50, TRUE)
|
||||
Consume(nom)
|
||||
|
||||
/obj/machinery/power/supermatter_crystal/attackby(obj/item/I, mob/living/user, params)
|
||||
/obj/machinery/atmospherics/supermatter_crystal/attackby(obj/item/I, mob/living/user, params)
|
||||
if(!istype(I) || (I.flags & ABSTRACT) || !istype(user))
|
||||
return
|
||||
if(moveable && default_unfasten_wrench(user, I, time = 20))
|
||||
@@ -769,7 +769,7 @@
|
||||
|
||||
radiation_pulse(src, 150, 4)
|
||||
|
||||
/obj/machinery/power/supermatter_crystal/Bumped(atom/movable/AM)
|
||||
/obj/machinery/atmospherics/supermatter_crystal/Bumped(atom/movable/AM)
|
||||
if(isliving(AM))
|
||||
AM.visible_message("<span class='danger'>[AM] slams into [src] inducing a resonance... [AM.p_their()] body starts to glow and burst into flames before flashing into dust!</span>",\
|
||||
"<span class='userdanger'>You slam into [src] as your ears are filled with unearthly ringing. Your last thought is \"Oh, fuck.\"</span>",\
|
||||
@@ -783,7 +783,7 @@
|
||||
playsound(get_turf(src), 'sound/effects/supermatter.ogg', 50, TRUE)
|
||||
Consume(AM)
|
||||
|
||||
/obj/machinery/power/supermatter_crystal/proc/Consume(atom/movable/AM)
|
||||
/obj/machinery/atmospherics/supermatter_crystal/proc/Consume(atom/movable/AM)
|
||||
if(isliving(AM))
|
||||
var/mob/living/user = AM
|
||||
if(user.status_flags & GODMODE)
|
||||
@@ -802,7 +802,7 @@
|
||||
suspicion = "last touched by [AM.fingerprintslast]"
|
||||
message_admins("[src] has consumed [AM], [suspicion] [ADMIN_JMP(src)].")
|
||||
investigate_log("has consumed [AM] - [suspicion].", "supermatter")
|
||||
if(istype(AM, /obj/machinery/power/supermatter_crystal))
|
||||
if(istype(AM, /obj/machinery/atmospherics/supermatter_crystal))
|
||||
power += 5000//releases A LOT of power
|
||||
matter_power += 500000
|
||||
damage += 180//drops the integrety by 20%
|
||||
@@ -822,10 +822,10 @@
|
||||
else
|
||||
L.show_message("<span class='italics'>You hear an unearthly ringing and notice your skin is covered in fresh radiation burns.</span>", 2)
|
||||
|
||||
/obj/machinery/power/supermatter_crystal/engine
|
||||
/obj/machinery/atmospherics/supermatter_crystal/engine
|
||||
is_main_engine = TRUE
|
||||
|
||||
/obj/machinery/power/supermatter_crystal/shard
|
||||
/obj/machinery/atmospherics/supermatter_crystal/shard
|
||||
name = "supermatter shard"
|
||||
desc = "A strangely translucent and iridescent crystal that looks like it used to be part of a larger structure."
|
||||
base_icon_state = "darkmatter_shard"
|
||||
@@ -836,7 +836,7 @@
|
||||
layer = ABOVE_MOB_LAYER
|
||||
moveable = TRUE
|
||||
|
||||
/obj/machinery/power/supermatter_crystal/shard/engine
|
||||
/obj/machinery/atmospherics/supermatter_crystal/shard/engine
|
||||
name = "anchored supermatter shard"
|
||||
is_main_engine = TRUE
|
||||
anchored = TRUE
|
||||
@@ -844,7 +844,7 @@
|
||||
|
||||
// When you wanna make a supermatter shard for the dramatic effect, but
|
||||
// don't want it exploding suddenly
|
||||
/obj/machinery/power/supermatter_crystal/shard/hugbox
|
||||
/obj/machinery/atmospherics/supermatter_crystal/shard/hugbox
|
||||
name = "anchored supermatter shard"
|
||||
takes_damage = FALSE
|
||||
produces_gas = FALSE
|
||||
@@ -853,12 +853,12 @@
|
||||
moveable = FALSE
|
||||
anchored = TRUE
|
||||
|
||||
/obj/machinery/power/supermatter_crystal/shard/hugbox/fakecrystal //Hugbox shard with crystal visuals, used in the Supermatter/Hyperfractal shuttle
|
||||
/obj/machinery/atmospherics/supermatter_crystal/shard/hugbox/fakecrystal //Hugbox shard with crystal visuals, used in the Supermatter/Hyperfractal shuttle
|
||||
name = "supermatter crystal"
|
||||
base_icon_state = "darkmatter"
|
||||
icon_state = "darkmatter"
|
||||
|
||||
/obj/machinery/power/supermatter_crystal/proc/supermatter_pull(turf/center, pull_range = 3)
|
||||
/obj/machinery/atmospherics/supermatter_crystal/proc/supermatter_pull(turf/center, pull_range = 3)
|
||||
playsound(center, 'sound/weapons/marauder.ogg', 100, TRUE, extrarange = pull_range - world.view, channel = CHANNEL_ENGINE)
|
||||
for(var/atom/movable/P in orange(pull_range,center))
|
||||
if((P.anchored || P.move_resist >= MOVE_FORCE_EXTREMELY_STRONG)) //move resist memes.
|
||||
@@ -876,7 +876,7 @@
|
||||
visible_message("<span class='danger'>[src]'s sheer force rips [M] away from [buckler]!</span>")
|
||||
step_towards(P,center)
|
||||
|
||||
/obj/machinery/power/supermatter_crystal/proc/supermatter_anomaly_gen(turf/anomalycenter, type = FLUX_ANOMALY, anomalyrange = 5)
|
||||
/obj/machinery/atmospherics/supermatter_crystal/proc/supermatter_anomaly_gen(turf/anomalycenter, type = FLUX_ANOMALY, anomalyrange = 5)
|
||||
var/turf/L = pick(orange(anomalyrange, anomalycenter))
|
||||
if(L)
|
||||
switch(type)
|
||||
@@ -888,7 +888,7 @@
|
||||
if(PYRO_ANOMALY)
|
||||
new /obj/effect/anomaly/pyro(L, 200, FALSE)
|
||||
|
||||
/obj/machinery/power/supermatter_crystal/proc/supermatter_zap(atom/zapstart = src, range = 5, zap_str = 4000, zap_flags = ZAP_SUPERMATTER_FLAGS, list/targets_hit = list())
|
||||
/obj/machinery/atmospherics/supermatter_crystal/proc/supermatter_zap(atom/zapstart = src, range = 5, zap_str = 4000, zap_flags = ZAP_SUPERMATTER_FLAGS, list/targets_hit = list())
|
||||
if(QDELETED(zapstart))
|
||||
return
|
||||
. = zapstart.dir
|
||||
|
||||
@@ -223,7 +223,7 @@
|
||||
var/closest_type = 0
|
||||
var/static/things_to_shock = typecacheof(list(/obj/machinery, /mob/living, /obj/structure, /obj/vehicle))
|
||||
var/static/blacklisted_tesla_types = typecacheof(list(/obj/machinery/atmospherics,
|
||||
/obj/machinery/portable_atmospherics,
|
||||
/obj/machinery/atmospherics/portable,
|
||||
/obj/machinery/power/emitter,
|
||||
/obj/machinery/field/generator,
|
||||
/mob/living/simple_animal/slime,
|
||||
|
||||
@@ -2,21 +2,22 @@
|
||||
// Store Item
|
||||
/////////////////////////////
|
||||
/datum/storeitem
|
||||
var/name="Thing"
|
||||
var/desc="It's a thing."
|
||||
var/typepath=/obj/item/storage/box
|
||||
var/cost=0
|
||||
var/name = "Thing"
|
||||
var/desc = "It's a thing."
|
||||
var/typepath = /obj/item/storage/box
|
||||
var/cost = 0
|
||||
|
||||
/datum/storeitem/proc/deliver(mob/usr)
|
||||
/datum/storeitem/proc/deliver(mob/user)
|
||||
if(!istype(typepath,/obj/item/storage))
|
||||
var/obj/item/storage/box/box=new(usr.loc)
|
||||
var/obj/item/storage/box/box=new(user.loc)
|
||||
new typepath(box)
|
||||
box.name="[name] package"
|
||||
box.desc="A special gift for doing your job."
|
||||
usr.put_in_hands(box)
|
||||
user.put_in_hands(box)
|
||||
|
||||
else
|
||||
var/thing = new typepath(usr.loc)
|
||||
usr.put_in_hands(thing)
|
||||
var/thing = new typepath(user.loc)
|
||||
user.put_in_hands(thing)
|
||||
|
||||
|
||||
/////////////////////////////
|
||||
|
||||
@@ -52,14 +52,16 @@ GLOBAL_DATUM_INIT(centcomm_store, /datum/store, new())
|
||||
linked_db = DB
|
||||
break
|
||||
|
||||
/datum/store/proc/PlaceOrder(mob/living/usr, itemID)
|
||||
/datum/store/proc/PlaceOrder(mob/living/user, itemID)
|
||||
// Get our item, first.
|
||||
var/datum/storeitem/item = items[itemID]
|
||||
if(!item)
|
||||
return 0
|
||||
return FALSE
|
||||
|
||||
// Try to deduct funds.
|
||||
if(!charge(usr.mind,item.cost,item))
|
||||
return 0
|
||||
if(!charge(user.mind,item.cost,item))
|
||||
return FALSE
|
||||
|
||||
// Give them the item.
|
||||
item.deliver(usr)
|
||||
return 1
|
||||
item.deliver(user)
|
||||
return TRUE
|
||||
|
||||
Reference in New Issue
Block a user