diff --git a/code/ATMOSPHERICS/components/binary_devices/algae_generator_vr.dm b/code/ATMOSPHERICS/components/binary_devices/algae_generator_vr.dm
index adafb2ed17..454d04ff44 100644
--- a/code/ATMOSPHERICS/components/binary_devices/algae_generator_vr.dm
+++ b/code/ATMOSPHERICS/components/binary_devices/algae_generator_vr.dm
@@ -200,7 +200,7 @@
"moles" = round(air2.gas[output_gas], 0.01))
// update the ui if it exists, returns null if no ui is passed/found
- ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
+ ui = GLOB.nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, "algae_farm_vr.tmpl", "Algae Farm Control Panel", 500, 600)
ui.set_initial_data(data)
diff --git a/code/ATMOSPHERICS/components/binary_devices/circulator.dm b/code/ATMOSPHERICS/components/binary_devices/circulator.dm
index ff1089e6f8..5e2bbce6da 100644
--- a/code/ATMOSPHERICS/components/binary_devices/circulator.dm
+++ b/code/ATMOSPHERICS/components/binary_devices/circulator.dm
@@ -89,7 +89,7 @@
return 1
/obj/machinery/atmospherics/binary/circulator/attackby(obj/item/weapon/W as obj, mob/user as mob)
- if(istype(W, /obj/item/weapon/wrench))
+ if(W.is_wrench())
playsound(src, W.usesound, 75, 1)
anchored = !anchored
user.visible_message("[user.name] [anchored ? "secures" : "unsecures"] the bolts holding [src.name] to the floor.", \
diff --git a/code/ATMOSPHERICS/components/binary_devices/passive_gate.dm b/code/ATMOSPHERICS/components/binary_devices/passive_gate.dm
index c08c82f6b9..3988b790c8 100644
--- a/code/ATMOSPHERICS/components/binary_devices/passive_gate.dm
+++ b/code/ATMOSPHERICS/components/binary_devices/passive_gate.dm
@@ -197,7 +197,7 @@
)
// update the ui if it exists, returns null if no ui is passed/found
- ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
+ ui = GLOB.nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
// the ui does not exist, so we'll create a new() one
// for a list of parameters and their descriptions see the code docs in \code\modules\nano\nanoui.dm
@@ -243,7 +243,7 @@
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))
+ if (!W.is_wrench())
return ..()
if (unlocked)
to_chat(user, "You cannot unwrench \the [src], turn it off first.")
diff --git a/code/ATMOSPHERICS/components/binary_devices/pipeturbine.dm b/code/ATMOSPHERICS/components/binary_devices/pipeturbine.dm
index a7127a4dc6..d26422c309 100644
--- a/code/ATMOSPHERICS/components/binary_devices/pipeturbine.dm
+++ b/code/ATMOSPHERICS/components/binary_devices/pipeturbine.dm
@@ -84,7 +84,7 @@
overlays += image('icons/obj/pipeturbine.dmi', "hi-turb")
attackby(obj/item/weapon/W as obj, mob/user as mob)
- if(istype(W, /obj/item/weapon/wrench))
+ if(W.is_wrench())
anchored = !anchored
playsound(src, W.usesound, 50, 1)
to_chat(user, "You [anchored ? "secure" : "unsecure"] the bolts holding \the [src] to the floor.")
@@ -259,7 +259,7 @@
attackby(obj/item/weapon/W as obj, mob/user as mob)
- if(istype(W, /obj/item/weapon/wrench))
+ if(W.is_wrench())
anchored = !anchored
playsound(src, W.usesound, 50, 1)
turbine = null
diff --git a/code/ATMOSPHERICS/components/binary_devices/pump.dm b/code/ATMOSPHERICS/components/binary_devices/pump.dm
index a89b1c5659..b03206b262 100644
--- a/code/ATMOSPHERICS/components/binary_devices/pump.dm
+++ b/code/ATMOSPHERICS/components/binary_devices/pump.dm
@@ -140,7 +140,7 @@ Thus, the two variables affect pump operation are set in New():
)
// update the ui if it exists, returns null if no ui is passed/found
- ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
+ ui = GLOB.nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
// the ui does not exist, so we'll create a new() one
// for a list of parameters and their descriptions see the code docs in \code\modules\nano\nanoui.dm
@@ -222,7 +222,7 @@ Thus, the two variables affect pump operation are set in New():
update_icon()
/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))
+ if (!W.is_wrench())
return ..()
if (!(stat & NOPOWER) && use_power)
to_chat(user, "You cannot unwrench this [src], turn it off first.")
diff --git a/code/ATMOSPHERICS/components/omni_devices/filter.dm b/code/ATMOSPHERICS/components/omni_devices/filter.dm
index 57889c463e..428f37fcfa 100644
--- a/code/ATMOSPHERICS/components/omni_devices/filter.dm
+++ b/code/ATMOSPHERICS/components/omni_devices/filter.dm
@@ -93,7 +93,7 @@
data = build_uidata()
- ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
+ ui = GLOB.nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, "omni_filter.tmpl", "Omni Filter Control", 330, 330)
@@ -181,7 +181,7 @@
switch_filter(dir_flag(href_list["dir"]), mode_return_switch(new_filter))
update_icon()
- nanomanager.update_uis(src)
+ GLOB.nanomanager.update_uis(src)
return
/obj/machinery/atmospherics/omni/atmos_filter/proc/mode_return_switch(var/mode)
diff --git a/code/ATMOSPHERICS/components/omni_devices/mixer.dm b/code/ATMOSPHERICS/components/omni_devices/mixer.dm
index c833b5bb2a..fc00be6ba4 100644
--- a/code/ATMOSPHERICS/components/omni_devices/mixer.dm
+++ b/code/ATMOSPHERICS/components/omni_devices/mixer.dm
@@ -76,7 +76,7 @@
if(output)
output.air.volume = ATMOS_DEFAULT_VOLUME_MIXER * 0.75 * inputs.len
output.concentration = 1
-
+
rebuild_mixing_inputs()
/obj/machinery/atmospherics/omni/mixer/proc/mapper_set()
@@ -131,7 +131,7 @@
data = build_uidata()
- ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
+ ui = GLOB.nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, "omni_mixer.tmpl", "Omni Mixer Control", 360, 330)
@@ -200,7 +200,7 @@
con_lock(dir_flag(href_list["dir"]))
update_icon()
- nanomanager.update_uis(src)
+ GLOB.nanomanager.update_uis(src)
return
/obj/machinery/atmospherics/omni/mixer/proc/switch_mode(var/port = NORTH, var/mode = ATM_NONE)
diff --git a/code/ATMOSPHERICS/components/omni_devices/omni_base.dm b/code/ATMOSPHERICS/components/omni_devices/omni_base.dm
index 0981ff6b44..6f78a7d064 100644
--- a/code/ATMOSPHERICS/components/omni_devices/omni_base.dm
+++ b/code/ATMOSPHERICS/components/omni_devices/omni_base.dm
@@ -80,7 +80,7 @@
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))
+ if(!W.is_wrench())
return ..()
if(!can_unwrench())
diff --git a/code/ATMOSPHERICS/components/portables_connector.dm b/code/ATMOSPHERICS/components/portables_connector.dm
index 7dca3f52d4..b30bc9b038 100644
--- a/code/ATMOSPHERICS/components/portables_connector.dm
+++ b/code/ATMOSPHERICS/components/portables_connector.dm
@@ -133,7 +133,7 @@
/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))
+ if (!W.is_wrench())
return ..()
if (connected_device)
to_chat(user, "You cannot unwrench \the [src], dettach \the [connected_device] first.")
diff --git a/code/ATMOSPHERICS/components/trinary_devices/trinary_base.dm b/code/ATMOSPHERICS/components/trinary_devices/trinary_base.dm
index 0a68f74c71..394dbceeda 100644
--- a/code/ATMOSPHERICS/components/trinary_devices/trinary_base.dm
+++ b/code/ATMOSPHERICS/components/trinary_devices/trinary_base.dm
@@ -52,7 +52,7 @@
update_icon()
/obj/machinery/atmospherics/trinary/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
- if (!istype(W, /obj/item/weapon/wrench))
+ if (!W.is_wrench())
return ..()
if(!can_unwrench())
to_chat(user, "You cannot unwrench \the [src], it too exerted due to internal pressure.")
diff --git a/code/ATMOSPHERICS/components/tvalve.dm b/code/ATMOSPHERICS/components/tvalve.dm
index b65c615174..cfc990c6e5 100644
--- a/code/ATMOSPHERICS/components/tvalve.dm
+++ b/code/ATMOSPHERICS/components/tvalve.dm
@@ -327,7 +327,7 @@
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))
+ if (!W.is_wrench())
return ..()
if (istype(src, /obj/machinery/atmospherics/tvalve/digital))
to_chat(user, "You cannot unwrench \the [src], it's too complicated.")
diff --git a/code/ATMOSPHERICS/components/unary/cold_sink.dm b/code/ATMOSPHERICS/components/unary/cold_sink.dm
index 07b0052910..8ff0aa7479 100644
--- a/code/ATMOSPHERICS/components/unary/cold_sink.dm
+++ b/code/ATMOSPHERICS/components/unary/cold_sink.dm
@@ -83,7 +83,7 @@
data["gasTemperatureClass"] = temp_class
// update the ui if it exists, returns null if no ui is passed/found
- ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
+ ui = GLOB.nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if(!ui)
// the ui does not exist, so we'll create a new() one
// for a list of parameters and their descriptions see the code docs in \code\modules\nano\nanoui.dm
@@ -180,4 +180,4 @@
/obj/machinery/atmospherics/unary/freezer/examine(mob/user)
..(user)
if(panel_open)
- user << "The maintenance hatch is open."
+ to_chat(user, "The maintenance hatch is open.")
diff --git a/code/ATMOSPHERICS/components/unary/heat_exchanger.dm b/code/ATMOSPHERICS/components/unary/heat_exchanger.dm
index ed4010f81e..2295f70378 100644
--- a/code/ATMOSPHERICS/components/unary/heat_exchanger.dm
+++ b/code/ATMOSPHERICS/components/unary/heat_exchanger.dm
@@ -67,7 +67,7 @@
return 1
attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
- if (!istype(W, /obj/item/weapon/wrench))
+ if (!W.is_wrench())
return ..()
var/turf/T = src.loc
if (level==1 && isturf(T) && !T.is_plating())
diff --git a/code/ATMOSPHERICS/components/unary/heat_source.dm b/code/ATMOSPHERICS/components/unary/heat_source.dm
index bc1aaae118..69e638bc22 100644
--- a/code/ATMOSPHERICS/components/unary/heat_source.dm
+++ b/code/ATMOSPHERICS/components/unary/heat_source.dm
@@ -103,7 +103,7 @@
data["gasTemperatureClass"] = temp_class
// update the ui if it exists, returns null if no ui is passed/found
- ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
+ ui = GLOB.nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if(!ui)
// the ui does not exist, so we'll create a new() one
// for a list of parameters and their descriptions see the code docs in \code\modules\nano\nanoui.dm
@@ -167,4 +167,4 @@
/obj/machinery/atmospherics/unary/heater/examine(mob/user)
..(user)
if(panel_open)
- user << "The maintenance hatch is open."
+ to_chat(user, "The maintenance hatch is open.")
diff --git a/code/ATMOSPHERICS/components/unary/vent_pump.dm b/code/ATMOSPHERICS/components/unary/vent_pump.dm
index 9338516343..ce2eb97e67 100644
--- a/code/ATMOSPHERICS/components/unary/vent_pump.dm
+++ b/code/ATMOSPHERICS/components/unary/vent_pump.dm
@@ -407,7 +407,7 @@
update_icon()
/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))
+ if (!W.is_wrench())
return ..()
if (!(stat & NOPOWER) && use_power)
to_chat(user, "You cannot unwrench \the [src], turn it off first.")
diff --git a/code/ATMOSPHERICS/components/unary/vent_scrubber.dm b/code/ATMOSPHERICS/components/unary/vent_scrubber.dm
index 09b5fde7c1..cb460bd2f1 100644
--- a/code/ATMOSPHERICS/components/unary/vent_scrubber.dm
+++ b/code/ATMOSPHERICS/components/unary/vent_scrubber.dm
@@ -20,7 +20,7 @@
var/hibernate = 0 //Do we even process?
var/scrubbing = 1 //0 = siphoning, 1 = scrubbing
- var/list/scrubbing_gas = list("carbon_dioxide", "phoron")
+ var/list/scrubbing_gas = list("carbon_dioxide")
var/panic = 0 //is this scrubber panicked?
@@ -264,7 +264,7 @@
update_icon()
/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))
+ if (!W.is_wrench())
return ..()
if (!(stat & NOPOWER) && use_power)
to_chat(user, "You cannot unwrench \the [src], turn it off first.")
diff --git a/code/ATMOSPHERICS/components/valve.dm b/code/ATMOSPHERICS/components/valve.dm
index 93e5da7c32..f385ae5ed6 100644
--- a/code/ATMOSPHERICS/components/valve.dm
+++ b/code/ATMOSPHERICS/components/valve.dm
@@ -288,7 +288,7 @@
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))
+ if (!W.is_wrench())
return ..()
if (istype(src, /obj/machinery/atmospherics/valve/digital) && !src.allowed(user))
to_chat(user, "Access denied.")
diff --git a/code/ATMOSPHERICS/datum_pipeline.dm b/code/ATMOSPHERICS/datum_pipeline.dm
index 74cef7a172..28391c4352 100644
--- a/code/ATMOSPHERICS/datum_pipeline.dm
+++ b/code/ATMOSPHERICS/datum_pipeline.dm
@@ -10,7 +10,7 @@ datum/pipeline
var/alert_pressure = 0
Destroy()
- qdel_null(network)
+ QDEL_NULL(network)
if(air && air.volume)
temporarily_store_air()
@@ -204,16 +204,16 @@ datum/pipeline
proc/radiate_heat_to_space(surface, thermal_conductivity)
var/gas_density = air.total_moles/air.volume
thermal_conductivity *= min(gas_density / ( RADIATOR_OPTIMUM_PRESSURE/(R_IDEAL_GAS_EQUATION*GAS_CRITICAL_TEMPERATURE) ), 1) //mult by density ratio
-
+
// We only get heat from the star on the exposed surface area.
// If the HE pipes gain more energy from AVERAGE_SOLAR_RADIATION than they can radiate, then they have a net heat increase.
var/heat_gain = AVERAGE_SOLAR_RADIATION * (RADIATOR_EXPOSED_SURFACE_AREA_RATIO * surface) * thermal_conductivity
-
+
// Previously, the temperature would enter equilibrium at 26C or 294K.
// Only would happen if both sides (all 2 square meters of surface area) were exposed to sunlight. We now assume it aligned edge on.
// It currently should stabilise at 129.6K or -143.6C
heat_gain -= surface * STEFAN_BOLTZMANN_CONSTANT * thermal_conductivity * (air.temperature - COSMIC_RADIATION_TEMPERATURE) ** 4
-
+
air.add_thermal_energy(heat_gain)
if(network)
network.update = 1
diff --git a/code/ATMOSPHERICS/pipes/pipe_base.dm b/code/ATMOSPHERICS/pipes/pipe_base.dm
index 19b05e8b71..a035857e54 100644
--- a/code/ATMOSPHERICS/pipes/pipe_base.dm
+++ b/code/ATMOSPHERICS/pipes/pipe_base.dm
@@ -72,7 +72,7 @@
return parent.return_network(reference)
/obj/machinery/atmospherics/pipe/Destroy()
- qdel_null(parent)
+ QDEL_NULL(parent)
if(air_temporary)
loc.assume_air(air_temporary)
for(var/obj/machinery/meter/meter in loc)
@@ -89,7 +89,7 @@
if(istype(W,/obj/item/device/pipe_painter))
return 0
- if (!istype(W, /obj/item/weapon/wrench))
+ if (!W.is_wrench())
return ..()
var/turf/T = src.loc
if (level==1 && isturf(T) && !T.is_plating())
diff --git a/code/ZAS/Phoron.dm b/code/ZAS/Phoron.dm
index 0f39ab4b56..b7ab1999f0 100644
--- a/code/ZAS/Phoron.dm
+++ b/code/ZAS/Phoron.dm
@@ -40,15 +40,11 @@ var/image/contamination_overlay = image('icons/effects/contamination.dmi')
obj/var/contaminated = 0
-obj/var/phoronproof = 0
-
/obj/item/proc/can_contaminate()
//Clothing and backpacks can be contaminated.
if(flags & PHORONGUARD)
return 0
- else if(phoronproof == 1)
- return 0
else if(istype(src,/obj/item/weapon/storage/backpack))
return 0 //Cannot be washed :(
else if(istype(src,/obj/item/clothing))
@@ -148,7 +144,7 @@ obj/var/phoronproof = 0
//Checks if the head is adequately sealed. //This is just odd. TODO: Make this respect the body_parts_covered stuff like thermal gear does.
if(head)
if(vsc.plc.PHORONGUARD_ONLY)
- if(head.flags & PHORONGUARD || head.phoronproof)
+ if(head.flags & PHORONGUARD)
return 1
else if(head.body_parts_covered & EYES)
return 1
@@ -160,7 +156,7 @@ obj/var/phoronproof = 0
for(var/obj/item/protection in list(wear_suit, gloves, shoes)) //This is why it's odd. If I'm in a full suit, but my shoes and gloves aren't phoron proof, damage.
if(!protection)
continue
- if(vsc.plc.PHORONGUARD_ONLY && !(protection.flags & PHORONGUARD) && !protection.phoronproof)
+ if(vsc.plc.PHORONGUARD_ONLY && !(protection.flags & PHORONGUARD))
return 0
coverage |= protection.body_parts_covered
diff --git a/code/__datastructures/globals.dm b/code/__datastructures/globals.dm
new file mode 100644
index 0000000000..637af7f0fc
--- /dev/null
+++ b/code/__datastructures/globals.dm
@@ -0,0 +1,38 @@
+//See controllers/globals.dm
+#define GLOBAL_MANAGED(X, InitValue)\
+/datum/controller/global_vars/proc/InitGlobal##X(){\
+ ##X = ##InitValue;\
+ gvars_datum_init_order += #X;\
+}
+#define GLOBAL_UNMANAGED(X, InitValue) /datum/controller/global_vars/proc/InitGlobal##X()
+
+#ifndef TESTING
+#define GLOBAL_PROTECT(X)\
+/datum/controller/global_vars/InitGlobal##X(){\
+ ..();\
+ gvars_datum_protected_varlist += #X;\
+}
+#else
+#define GLOBAL_PROTECT(X)
+#endif
+
+#define GLOBAL_REAL_VAR(X) var/global/##X
+#define GLOBAL_REAL(X, Typepath) var/global##Typepath/##X
+
+#define GLOBAL_RAW(X) /datum/controller/global_vars/var/global##X
+
+#define GLOBAL_VAR_INIT(X, InitValue) GLOBAL_RAW(/##X); GLOBAL_MANAGED(X, InitValue)
+
+#define GLOBAL_VAR_CONST(X, InitValue) GLOBAL_RAW(/const/##X) = InitValue; GLOBAL_UNMANAGED(X, InitValue)
+
+#define GLOBAL_LIST_INIT(X, InitValue) GLOBAL_RAW(/list/##X); GLOBAL_MANAGED(X, InitValue)
+
+#define GLOBAL_LIST_EMPTY(X) GLOBAL_LIST_INIT(X, list())
+
+#define GLOBAL_DATUM_INIT(X, Typepath, InitValue) GLOBAL_RAW(Typepath/##X); GLOBAL_MANAGED(X, InitValue)
+
+#define GLOBAL_VAR(X) GLOBAL_RAW(/##X); GLOBAL_MANAGED(X, null)
+
+#define GLOBAL_LIST(X) GLOBAL_RAW(/list/##X); GLOBAL_MANAGED(X, null)
+
+#define GLOBAL_DATUM(X, Typepath) GLOBAL_RAW(Typepath/##X); GLOBAL_MANAGED(X, null)
diff --git a/code/__defines/MC.dm b/code/__defines/MC.dm
index 1d41a31209..ad03630666 100644
--- a/code/__defines/MC.dm
+++ b/code/__defines/MC.dm
@@ -1,14 +1,15 @@
-#define MC_TICK_CHECK ( ( TICK_USAGE > Master.current_ticklimit || src.state != SS_RUNNING ) ? pause() : 0 )
+#define MC_TICK_CHECK ( ( TICK_USAGE > GLOB.CURRENT_TICKLIMIT || src.state != SS_RUNNING ) ? pause() : 0 )
// Used for splitting up your remaining time into phases, if you want to evenly divide it.
-#define MC_SPLIT_TICK_INIT(phase_count) var/original_tick_limit = Master.current_ticklimit; var/split_tick_phases = ##phase_count
+#define MC_SPLIT_TICK_INIT(phase_count) var/original_tick_limit = GLOB.CURRENT_TICKLIMIT; var/split_tick_phases = ##phase_count
+
#define MC_SPLIT_TICK \
- if(split_tick_phases > 1){\
- Master.current_ticklimit = ((original_tick_limit - TICK_USAGE) / split_tick_phases) + TICK_USAGE;\
- --split_tick_phases;\
- } else {\
- Master.current_ticklimit = original_tick_limit;\
- }
+ if(split_tick_phases > 1){\
+ GLOB.CURRENT_TICKLIMIT = ((original_tick_limit - world.tick_usage) / split_tick_phases) + world.tick_usage;\
+ --split_tick_phases;\
+ } else {\
+ GLOB.CURRENT_TICKLIMIT = original_tick_limit;\
+ }
// Boilerplate code for multi-step processors. See machines.dm for example use.
#define INTERNAL_PROCESS_STEP(this_step, initial_step, proc_to_call, cost_var, next_step)\
@@ -78,9 +79,15 @@ if(current_step == this_step || (initial_step && !resumed)) /* So we start at st
#define SS_PAUSING 5 //in the middle of pausing
// Standard way to define a global subsystem, keep boilerplate organized here!
-#define SUBSYSTEM_DEF(X) var/datum/controller/subsystem/##X/SS##X;\
+#define SUBSYSTEM_DEF(X) GLOBAL_REAL(SS##X, /datum/controller/subsystem/##X);\
/datum/controller/subsystem/##X/New(){\
NEW_SS_GLOBAL(SS##X);\
PreInit();\
}\
/datum/controller/subsystem/##X
+ #define PROCESSING_SUBSYSTEM_DEF(X) GLOBAL_REAL(SS##X, /datum/controller/subsystem/processing/##X);\
+/datum/controller/subsystem/processing/##X/New(){\
+ NEW_SS_GLOBAL(SS##X);\
+ PreInit();\
+}\
+/datum/controller/subsystem/processing/##X
\ No newline at end of file
diff --git a/code/__defines/_planes+layers.dm b/code/__defines/_planes+layers.dm
index 3686518108..4d258cd91f 100644
--- a/code/__defines/_planes+layers.dm
+++ b/code/__defines/_planes+layers.dm
@@ -73,8 +73,9 @@ What is the naming convention for planes or layers?
#define ABOVE_JUNK_LAYER 3.1 // Things that want to be slightly above common objects
#define DOOR_CLOSED_LAYER 3.1 // Doors when closed
#define WINDOW_LAYER 3.2 // Windows
+ #define ABOVE_WINDOW_LAYER 3.25 //Above full tile windows so wall items are clickable
#define ON_WINDOW_LAYER 3.3 // Ontop of a window
-
+
// Mob planes
#define MOB_PLANE -25
#define BELOW_MOB_LAYER 3.9 // Should be converted to plane swaps
@@ -90,11 +91,11 @@ What is the naming convention for planes or layers?
//#define AREA_LAYER 1 //For easy recordkeeping; this is a byond define
//#define TURF_LAYER 2 //For easy recordkeeping; this is a byond define
-
+
//#define OBJ_LAYER 3 //For easy recordkeeping; this is a byond define
-
+
//#define MOB_LAYER 4 //For easy recordkeeping; this is a byond define
-
+
//#define FLY_LAYER 5 //For easy recordkeeping; this is a byond define
#define HUD_LAYER 20 // Above lighting, but below obfuscation. For in-game HUD effects (whereas SCREEN_LAYER is for abstract/OOC things like inventory slots)
diff --git a/code/__defines/_tick.dm b/code/__defines/_tick.dm
index 2c761b86f9..7ca3fb23a2 100644
--- a/code/__defines/_tick.dm
+++ b/code/__defines/_tick.dm
@@ -3,7 +3,7 @@
#define TICK_LIMIT_MC 70
#define TICK_LIMIT_MC_INIT_DEFAULT 98
-#define TICK_CHECK ( TICK_USAGE > Master.current_ticklimit )
+#define TICK_CHECK ( TICK_USAGE > GLOB.CURRENT_TICKLIMIT )
#define CHECK_TICK if TICK_CHECK stoplag()
#define TICK_USAGE world.tick_usage
diff --git a/code/__defines/color.dm b/code/__defines/color.dm
new file mode 100644
index 0000000000..ba9efe20de
--- /dev/null
+++ b/code/__defines/color.dm
@@ -0,0 +1,17 @@
+//Color defines used by the assembly detailer.
+#define COLOR_ASSEMBLY_BLACK "#545454"
+#define COLOR_ASSEMBLY_BGRAY "#9497AB"
+#define COLOR_ASSEMBLY_WHITE "#E2E2E2"
+#define COLOR_ASSEMBLY_RED "#CC4242"
+#define COLOR_ASSEMBLY_ORANGE "#E39751"
+#define COLOR_ASSEMBLY_BEIGE "#AF9366"
+#define COLOR_ASSEMBLY_BROWN "#97670E"
+#define COLOR_ASSEMBLY_GOLD "#AA9100"
+#define COLOR_ASSEMBLY_YELLOW "#CECA2B"
+#define COLOR_ASSEMBLY_GURKHA "#999875"
+#define COLOR_ASSEMBLY_LGREEN "#789876"
+#define COLOR_ASSEMBLY_GREEN "#44843C"
+#define COLOR_ASSEMBLY_LBLUE "#5D99BE"
+#define COLOR_ASSEMBLY_BLUE "#38559E"
+#define COLOR_ASSEMBLY_PURPLE "#6F6192"
+#define COLOR_ASSEMBLY_HOT_PINK "#FF69B4"
\ No newline at end of file
diff --git a/code/__defines/holomap.dm b/code/__defines/holomap.dm
index dec72be760..0b93e03ae0 100644
--- a/code/__defines/holomap.dm
+++ b/code/__defines/holomap.dm
@@ -4,7 +4,7 @@
#define WORLD_ICON_SIZE 32 // Size of a standard tile in pixels (world.icon_size)
#define PIXEL_MULTIPLIER WORLD_ICON_SIZE/32 // Convert from normal icon size of 32 to whatever insane thing this server is using.
-#define HOLOMAP_ICON 'icons/480x480_vr.dmi' // Icon file to start with when drawing holomaps (to get a 480x480 canvas).
+#define HOLOMAP_ICON 'icons/480x480.dmi' // Icon file to start with when drawing holomaps (to get a 480x480 canvas).
#define HOLOMAP_ICON_SIZE 480 // Pixel width & height of the holomap icon. Used for auto-centering etc.
#define ui_holomap "CENTER-7, CENTER-7" // Screen location of the holomap "hud"
diff --git a/code/__defines/integrated_circuits.dm b/code/__defines/integrated_circuits.dm
new file mode 100644
index 0000000000..b2859a232d
--- /dev/null
+++ b/code/__defines/integrated_circuits.dm
@@ -0,0 +1,3 @@
+// Methods of obtaining a circuit.
+#define IC_SPAWN_DEFAULT 1 // If the circuit comes in the default circuit box and able to be printed in the IC printer.
+#define IC_SPAWN_RESEARCH 2 // If the circuit design will be available in the IC printer after upgrading it.
\ No newline at end of file
diff --git a/code/__defines/misc.dm b/code/__defines/misc.dm
index 4563bf989e..c44df79802 100644
--- a/code/__defines/misc.dm
+++ b/code/__defines/misc.dm
@@ -282,3 +282,9 @@ var/global/list/##LIST_NAME = list();\
#define MATRIX_Achromatomaly list(0.62, 0.32, 0.06, 0.16, 0.78, 0.06, 0.16, 0.32, 0.52)
#define MATRIX_Vulp_Colorblind list(0.50, 0.40, 0.10, 0.50, 0.40, 0.10, 0, 0.20, 0.80)
#define MATRIX_Taj_Colorblind list(0.40, 0.20, 0.40, 0.40, 0.60, 0, 0.20, 0.20, 0.60)
+
+// Tool substitution defines
+#define IS_SCREWDRIVER "screwdriver"
+#define IS_CROWBAR "crowbar"
+#define IS_WIRECUTTER "wirecutter"
+#define IS_WRENCH "wrench"
\ No newline at end of file
diff --git a/code/__defines/mobs.dm b/code/__defines/mobs.dm
index c73ebf4d41..679962b210 100644
--- a/code/__defines/mobs.dm
+++ b/code/__defines/mobs.dm
@@ -168,18 +168,19 @@
#define MODIFIER_GENETIC 1 // Modifiers with this flag will be copied to mobs who get cloned.
// Bodyparts and organs.
-#define O_MOUTH "mouth"
#define O_EYES "eyes"
#define O_HEART "heart"
-#define O_CELL "cell"
#define O_LUNGS "lungs"
#define O_BRAIN "brain"
#define O_LIVER "liver"
#define O_KIDNEYS "kidneys"
#define O_APPENDIX "appendix"
#define O_VOICE "voicebox"
+#define O_STANDARD list(O_EYES, O_HEART, O_LUNGS, O_BRAIN, O_LIVER, O_KIDNEYS, O_APPENDIX, O_VOICE)
// Non-Standard organs
+#define O_MOUTH "mouth"
+#define O_CELL "cell"
#define O_PLASMA "plasma vessel"
#define O_HIVE "hive node"
#define O_NUTRIENT "nutrient vessel"
@@ -191,7 +192,9 @@
#define O_ACID "acid gland"
#define O_EGG "egg sac"
#define O_RESIN "resin spinner"
+#define O_ALL list(O_STANDARD, O_MOUTH, O_CELL, O_PLASMA, O_HIVE, O_NUTRIENT, O_STRATA, O_RESPONSE, O_GBLADDER, O_POLYP, O_ANCHOR, O_ACID, O_EGG, O_RESIN)
+// External organs, aka limbs
#define BP_L_FOOT "l_foot"
#define BP_R_FOOT "r_foot"
#define BP_L_LEG "l_leg"
diff --git a/code/__defines/planets.dm b/code/__defines/planets.dm
index 98b10b328a..3c2a1abcfc 100644
--- a/code/__defines/planets.dm
+++ b/code/__defines/planets.dm
@@ -10,5 +10,16 @@
#define WEATHER_HOT "hot"
#define WEATHER_BLOOD_MOON "blood moon" // For admin fun or cult later on.
+#define MOON_PHASE_NEW_MOON "new moon"
+#define MOON_PHASE_WAXING_CRESCENT "waxing crescent"
+#define MOON_PHASE_FIRST_QUARTER "first quarter"
+#define MOON_PHASE_WAXING_GIBBOUS "waxing gibbous"
+#define MOON_PHASE_FULL_MOON "full moon" // ware-shantaks sold seperately.
+#define MOON_PHASE_WANING_GIBBOUS "waning gibbous"
+#define MOON_PHASE_LAST_QUARTER "last quarter"
+#define MOON_PHASE_WANING_CRESCENT "waning crescent"
+
#define PLANET_PROCESS_SUN 0x1
-#define PLANET_PROCESS_TEMP 0x2
\ No newline at end of file
+#define PLANET_PROCESS_TEMP 0x2
+
+#define PLANET_TIME_MODIFIER 1 // If you want planet time to go faster than realtime, increase this number.
\ No newline at end of file
diff --git a/code/__defines/sound.dm b/code/__defines/sound.dm
index 6fae2fadcb..0995f0e071 100644
--- a/code/__defines/sound.dm
+++ b/code/__defines/sound.dm
@@ -4,7 +4,7 @@
#define CHANNEL_VOX 1022
#define CHANNEL_JUKEBOX 1021
#define CHANNEL_HEARTBEAT 1020 //sound channel for heartbeats
-#define CHANNEL_AMBIENCE_FORCED 1019
+#define CHANNEL_AMBIENCE_FORCED 1019
#define CHANNEL_AMBIENCE 1018
#define CHANNEL_BUZZ 1017
#define CHANNEL_BICYCLE 1016
@@ -54,3 +54,125 @@
#define SMALL_SOFTFLOOR ROOM
#define ASTEROID CAVE
#define SPACE UNDERWATER
+
+// Ambience presets.
+// All you need to do to make an area play one of these is set their ambience var to one of these lists.
+// You can even combine them by adding them together, since they're just lists, however you'd have to do that in initialization.
+
+// For weird alien places like the crashed UFO.
+#define AMBIENCE_OTHERWORLDLY list(\
+ 'sound/ambience/otherworldly/otherworldly1.ogg',\
+ 'sound/ambience/otherworldly/otherworldly2.ogg',\
+ 'sound/ambience/otherworldly/otherworldly3.ogg'\
+ )
+
+// Restricted, military, or mercenary aligned locations like the armory, the merc ship/base, BSD, etc.
+#define AMBIENCE_HIGHSEC list(\
+ 'sound/ambience/highsec/highsec1.ogg',\
+ 'sound/ambience/highsec/highsec2.ogg'\
+ )
+
+// Ruined structures found on the surface or in the caves.
+#define AMBIENCE_RUINS list(\
+ 'sound/ambience/ruins/ruins1.ogg',\
+ 'sound/ambience/ruins/ruins2.ogg',\
+ 'sound/ambience/ruins/ruins3.ogg',\
+ 'sound/ambience/ruins/ruins4.ogg',\
+ 'sound/ambience/ruins/ruins5.ogg',\
+ 'sound/ambience/ruins/ruins6.ogg'\
+ )
+
+// Similar to the above, but for more technology/signaling based ruins.
+#define AMBIENCE_TECH_RUINS list(\
+ 'sound/ambience/tech_ruins/tech_ruins1.ogg',\
+ 'sound/ambience/tech_ruins/tech_ruins2.ogg',\
+ 'sound/ambience/tech_ruins/tech_ruins3.ogg'\
+ )
+
+// The actual chapel room, and maybe some other places of worship.
+#define AMBIENCE_CHAPEL list(\
+ 'sound/ambience/chapel/chapel1.ogg',\
+ 'sound/ambience/chapel/chapel2.ogg',\
+ 'sound/ambience/chapel/chapel3.ogg',\
+ 'sound/ambience/chapel/chapel4.ogg'\
+ )
+
+// For peaceful, serene areas, distinct from the Chapel.
+#define AMBIENCE_HOLY list(\
+ 'sound/ambience/holy/holy1.ogg',\
+ 'sound/ambience/holy/holy2.ogg'\
+ )
+
+// Generic sounds for less special rooms.
+#define AMBIENCE_GENERIC list(\
+ 'sound/ambience/generic/generic1.ogg',\
+ 'sound/ambience/generic/generic2.ogg',\
+ 'sound/ambience/generic/generic3.ogg',\
+ 'sound/ambience/generic/generic4.ogg'\
+ )
+
+// Sounds of PA announcements, presumably involving shuttles?
+#define AMBIENCE_ARRIVALS list(\
+ 'sound/ambience/arrivals/arrivals1.ogg',\
+ 'sound/ambience/arrivals/arrivals2.ogg'\
+ )
+
+// Sounds suitable for being inside dark, tight corridors in the underbelly of the station.
+#define AMBIENCE_MAINTENANCE list(\
+ 'sound/ambience/maintenance/maintenance1.ogg',\
+ 'sound/ambience/maintenance/maintenance2.ogg',\
+ 'sound/ambience/maintenance/maintenance3.ogg',\
+ 'sound/ambience/maintenance/maintenance4.ogg',\
+ 'sound/ambience/maintenance/maintenance5.ogg',\
+ 'sound/ambience/maintenance/maintenance6.ogg'\
+ )
+
+// Life support machinery at work, keeping everyone breathing.
+#define AMBIENCE_ENGINEERING list(\
+ 'sound/ambience/engineering/engineering1.ogg',\
+ 'sound/ambience/engineering/engineering2.ogg',\
+ 'sound/ambience/engineering/engineering3.ogg'\
+ )
+
+// Creepy AI/borg stuff.
+#define AMBIENCE_AI list(\
+ 'sound/ambience/ai/ai1.ogg'\
+ )
+
+// Peaceful sounds when floating in the void.
+#define AMBIENCE_SPACE list(\
+ 'sound/ambience/space/space_serithi.ogg',\
+ 'sound/ambience/space/space1.ogg'\
+ )
+
+// Vaguely spooky sounds when around dead things.
+#define AMBIENCE_GHOSTLY list(\
+ 'sound/ambience/ghostly/ghostly1.ogg',\
+ 'sound/ambience/ghostly/ghostly2.ogg'\
+ )
+
+// Concerning sounds, for when one discovers something horrible happened in a PoI.
+#define AMBIENCE_FOREBODING list(\
+ 'sound/ambience/foreboding/foreboding1.ogg',\
+ 'sound/ambience/foreboding/foreboding2.ogg'\
+ )
+
+// Ambience heard when aboveground on Sif and not in a Point of Interest.
+#define AMBIENCE_SIF list(\
+ 'sound/ambience/sif/sif1.ogg'\
+ )
+
+// If we ever add geothermal PoIs or other places that are really hot, this will do.
+#define AMBIENCE_LAVA list(\
+ 'sound/ambience/lava/lava1.ogg'\
+ )
+
+// Cult-y ambience, for some PoIs, and maybe when the cultists darken the world with the ritual.
+#define AMBIENCE_UNHOLY list(\
+ 'sound/ambience/unholy/unholy1.ogg'\
+ )
+
+// For the memes.
+#define AMBIENCE_AESTHETIC list(\
+ 'sound/ambience/vaporwave.ogg'\
+ )
\ No newline at end of file
diff --git a/code/__defines/subsystems.dm b/code/__defines/subsystems.dm
index 9d34ead4df..8a52e013f4 100644
--- a/code/__defines/subsystems.dm
+++ b/code/__defines/subsystems.dm
@@ -1,3 +1,18 @@
+//Timing subsystem
+//Don't run if there is an identical unique timer active
+#define TIMER_UNIQUE 0x1
+//For unique timers: Replace the old timer rather then not start this one
+#define TIMER_OVERRIDE 0x2
+//Timing should be based on how timing progresses on clients, not the sever.
+// tracking this is more expensive,
+// should only be used in conjuction with things that have to progress client side, such as animate() or sound()
+#define TIMER_CLIENT_TIME 0x4
+//Timer can be stopped using deltimer()
+#define TIMER_STOPPABLE 0x8
+//To be used with TIMER_UNIQUE
+//prevents distinguishing identical timers with the wait variable
+#define TIMER_NO_HASH_WAIT 0x10
+#define TIMER_NO_INVOKE_WARNING 600 //number of byond ticks that are allowed to pass before the timer subsystem thinks it hung on something
#define INITIALIZATION_INSSATOMS 0 //New should not call Initialize
#define INITIALIZATION_INNEW_MAPLOAD 1 //New should call Initialize(TRUE)
@@ -7,6 +22,15 @@
#define INITIALIZE_HINT_LATELOAD 1 //Call LateInitialize
#define INITIALIZE_HINT_QDEL 2 //Call qdel on the atom
+//type and all subtypes should always call Initialize in New()
+#define INITIALIZE_IMMEDIATE(X) ##X/New(loc, ...){\
+ ..();\
+ if(!initialized) {\
+ args[1] = TRUE;\
+ SSatoms.InitAtom(src, args);\
+ }\
+}
+
// SS runlevels
#define RUNLEVEL_INIT 0 // "Initialize Only" - Used for subsystems that should never be fired (Should also have SS_NO_FIRE set)
@@ -32,9 +56,11 @@ var/global/list/runlevel_flags = list(RUNLEVEL_LOBBY, RUNLEVEL_SETUP, RUNLEVEL_G
#define INIT_ORDER_LIGHTING 0
#define INIT_ORDER_AIR -1
#define INIT_ORDER_PLANETS -4
+#define INIT_ORDER_HOLOMAPS -5
#define INIT_ORDER_OVERLAY -6
#define INIT_ORDER_XENOARCH -20
-
+#define INIT_ORDER_CIRCUIT -21
+
// Subsystem fire priority, from lowest to highest priority
// If the subsystem isn't listed here it's either DEFAULT or PROCESS (if it's a processing subsystem child)
diff --git a/code/__defines/supply.dm b/code/__defines/supply.dm
new file mode 100644
index 0000000000..81b32d703d
--- /dev/null
+++ b/code/__defines/supply.dm
@@ -0,0 +1,19 @@
+// Supply shuttle status defines
+#define SUP_SHUTTLE_ERROR -1 // Error state
+#define SUP_SHUTTLE_DOCKED 0
+#define SUP_SHUTTLE_UNDOCKED 1
+#define SUP_SHUTTLE_DOCKING 2
+#define SUP_SHUTTLE_UNDOCKING 3
+#define SUP_SHUTTLE_TRANSIT 4
+#define SUP_SHUTTLE_AWAY 5
+
+// Supply computer access levels
+#define SUP_SEND_SHUTTLE 0x1 // Send the shuttle back and forth
+#define SUP_ACCEPT_ORDERS 0x2 // Accept orders
+#define SUP_CONTRABAND 0x4 // Able to order contraband supply packs
+
+// Supply_order status values
+#define SUP_ORDER_REQUESTED "Requested"
+#define SUP_ORDER_APPROVED "Approved"
+#define SUP_ORDER_DENIED "Denied"
+#define SUP_ORDER_SHIPPED "Shipped"
\ No newline at end of file
diff --git a/code/_global_vars/lists/mapping.dm b/code/_global_vars/lists/mapping.dm
new file mode 100644
index 0000000000..42e6f1baf3
--- /dev/null
+++ b/code/_global_vars/lists/mapping.dm
@@ -0,0 +1,32 @@
+GLOBAL_LIST_INIT(cardinal, list(NORTH, SOUTH, EAST, WEST))
+GLOBAL_LIST_INIT(cardinalz, list(NORTH, SOUTH, EAST, WEST, UP, DOWN))
+GLOBAL_LIST_INIT(cornerdirs, list(NORTHEAST, NORTHWEST, SOUTHEAST, SOUTHWEST))
+GLOBAL_LIST_INIT(cornerdirsz, list(NORTHEAST, NORTHWEST, SOUTHEAST, SOUTHWEST, NORTH|UP, EAST|UP, WEST|UP, SOUTH|UP, NORTH|DOWN, EAST|DOWN, WEST|DOWN, SOUTH|DOWN))
+GLOBAL_LIST_INIT(alldirs, list(NORTH, SOUTH, EAST, WEST, NORTHEAST, NORTHWEST, SOUTHEAST, SOUTHWEST))
+GLOBAL_LIST_INIT(reverse_dir, list( // reverse_dir[dir] = reverse of dir
+ 2, 1, 3, 8, 10, 9, 11, 4, 6, 5, 7, 12, 14, 13, 15,
+ 32, 34, 33, 35, 40, 42, 41, 43, 36, 38, 37, 39, 44, 46, 45, 47,
+ 16, 18, 17, 19, 24, 26, 25, 27, 20, 22, 21, 23, 28, 30, 29, 31,
+ 48, 50, 49, 51, 56, 58, 57, 59, 52, 54, 53, 55, 60, 62, 61, 63
+))
+
+GLOBAL_LIST_INIT(flip_dir, list( // flip_dir[dir] = 180 degree rotation of dir. Unlike reverse_dir, UP remains UP & DOWN remains DOWN.
+ 2, 1, 3, 8, 10, 9, 11, 4, 6, 5, 7, 12, 14, 13, 15,
+ 16, 18, 17, 19, 24, 26, 25, 27, 20, 22, 21, 23, 28, 30, 29, 31, // UP - Same as first line but +16
+ 32, 34, 33, 35, 40, 42, 41, 43, 36, 38, 37, 39, 44, 46, 45, 47, // DOWN - Same as first line but +32
+ 48, 50, 49, 51, 56, 58, 57, 59, 52, 54, 53, 55, 60, 62, 61, 63 // UP+DOWN - Same as first line but +48
+))
+
+GLOBAL_LIST_INIT(cw_dir, list( // cw_dir[dir] = clockwise rotation of dir. Unlike reverse_dir, UP remains UP & DOWN remains DOWN.
+ 4, 8, 12, 2, 6, 10, 14, 1, 5, 9, 13, 3, 7, 11, 15,
+ 16, 20, 24, 28, 18, 22, 26, 30, 17, 21, 25, 19, 29, 23, 27, 31, // UP - Same as first line but +16
+ 32, 36, 40, 44, 34, 38, 42, 46, 33, 37, 41, 45, 35, 39, 43, 47, // DOWN - Same as first line but +32
+ 48, 52, 56, 40, 50, 54, 58, 62, 49, 53, 57, 61, 51, 55, 59, 63 // UP+DOWN - Same as first line but +48
+))
+
+GLOBAL_LIST_INIT(cww_dir, list( // cww_dir[dir] = counter-clockwise rotation of dir. Unlike reverse_dir, UP remains UP & DOWN remains DOWN.
+ 8, 4, 12, 1, 9, 5, 13, 2, 10, 6, 14, 3, 11, 7, 15,
+ 16, 24, 20, 28, 17, 25, 21, 29, 18, 26, 22, 30, 19, 27, 23, 31, // UP - Same as first line but +16
+ 32, 40, 36, 44, 33, 41, 37, 45, 34, 42, 38, 46, 35, 43, 39, 47, // DOWN - Same as first line but +32
+ 48, 56, 52, 60, 49, 57, 53, 61, 50, 58, 54, 62, 51, 59, 55, 63 // UP+DOWN - Same as first line but +48
+))
diff --git a/code/_global_vars/misc.dm b/code/_global_vars/misc.dm
new file mode 100644
index 0000000000..de2779c45b
--- /dev/null
+++ b/code/_global_vars/misc.dm
@@ -0,0 +1 @@
+GLOBAL_LIST_EMPTY(all_observable_events)
\ No newline at end of file
diff --git a/code/_global_vars/mobs.dm b/code/_global_vars/mobs.dm
new file mode 100644
index 0000000000..7fa2b5d162
--- /dev/null
+++ b/code/_global_vars/mobs.dm
@@ -0,0 +1,2 @@
+GLOBAL_LIST_EMPTY(admins) //all clients whom are admins
+GLOBAL_PROTECT(admins)
\ No newline at end of file
diff --git a/code/_global_vars/sensitive.dm b/code/_global_vars/sensitive.dm
new file mode 100644
index 0000000000..d4eda095ad
--- /dev/null
+++ b/code/_global_vars/sensitive.dm
@@ -0,0 +1,11 @@
+// MySQL configuration
+GLOBAL_REAL_VAR(sqladdress) = "localhost"
+GLOBAL_REAL_VAR(sqlport) = "3306"
+GLOBAL_REAL_VAR(sqldb) = "tgstation"
+GLOBAL_REAL_VAR(sqllogin) = "root"
+GLOBAL_REAL_VAR(sqlpass) = ""
+// Feedback gathering sql connection
+GLOBAL_REAL_VAR(sqlfdbkdb) = "test"
+GLOBAL_REAL_VAR(sqlfdbklogin) = "root"
+GLOBAL_REAL_VAR(sqlfdbkpass) = ""
+GLOBAL_REAL_VAR(sqllogging) = 0 // Should we log deaths, population stats, etc.?
\ No newline at end of file
diff --git a/code/_helpers/game.dm b/code/_helpers/game.dm
index e6f6383b87..dc3fdc005c 100644
--- a/code/_helpers/game.dm
+++ b/code/_helpers/game.dm
@@ -546,7 +546,7 @@ datum/projectile_data
/proc/getOPressureDifferential(var/turf/loc)
var/minp=16777216;
var/maxp=0;
- for(var/dir in cardinal)
+ for(var/dir in GLOB.cardinal)
var/turf/simulated/T=get_turf(get_step(loc,dir))
var/cp=0
if(T && istype(T) && T.zone)
@@ -567,7 +567,7 @@ datum/projectile_data
/proc/getCardinalAirInfo(var/turf/loc, var/list/stats=list("temperature"))
var/list/temps = new/list(4)
- for(var/dir in cardinal)
+ for(var/dir in GLOB.cardinal)
var/direction
switch(dir)
if(NORTH)
diff --git a/code/_helpers/icons.dm b/code/_helpers/icons.dm
index 3b59d9600b..32af8ac846 100644
--- a/code/_helpers/icons.dm
+++ b/code/_helpers/icons.dm
@@ -634,7 +634,6 @@ as a single icon. Useful for when you want to manipulate an icon via the above a
The _flatIcons list is a cache for generated icon files.
*/
-// Creates a single icon from a given /atom or /image. Only the first argument is required.
/proc/getFlatIcon(image/A, defdir, deficon, defstate, defblend, start = TRUE, no_anim = FALSE)
// We start with a blank canvas, otherwise some icon procs crash silently
var/icon/flat = icon('icons/effects/effects.dmi', "nothing") // Final flattened icon
@@ -677,7 +676,7 @@ The _flatIcons list is a cache for generated icon files.
var/curdir
var/base_icon_dir //We'll use this to get the icon state to display if not null BUT NOT pass it to overlays as the dir we have
-
+
//These should use the parent's direction (most likely)
if(!A.dir || A.dir == SOUTH)
curdir = defdir
@@ -686,7 +685,7 @@ The _flatIcons list is a cache for generated icon files.
//Let's check if the icon actually contains any diagonals, just skip if it's south to save (lot of) time
if(curdir != SOUTH)
- var/icon/test_icon
+ var/icon/test_icon
var/directionals_exist = FALSE
var/list/dirs_to_check = cardinal - SOUTH
outer:
@@ -824,6 +823,9 @@ The _flatIcons list is a cache for generated icon files.
else
return icon(flat, "", SOUTH)
+
+
+
/proc/getIconMask(atom/A)//By yours truly. Creates a dynamic mask for a mob/whatever. /N
var/icon/alpha_mask = new(A.icon,A.icon_state)//So we want the default icon and icon state of A.
for(var/I in A.overlays)//For every image in overlays. var/image/I will not work, don't try it.
@@ -874,10 +876,13 @@ The _flatIcons list is a cache for generated icon files.
if(4) I.pixel_y++
overlays += I//And finally add the overlay.
-/proc/getHologramIcon(icon/A, safety=1)//If safety is on, a new icon is not created.
+/proc/getHologramIcon(icon/A, safety=1, no_color = FALSE)//If safety is on, a new icon is not created.
var/icon/flat_icon = safety ? A : new(A)//Has to be a new icon to not constantly change the same icon.
- //flat_icon.ColorTone(rgb(125,180,225))//Let's make it bluish. //VOREStation Removal for AI Vore effects
- //flat_icon.ChangeOpacity(0.5)//Make it half transparent. //VOREStation Removal for AI Vore effects
+ /* VOREStation Removal - For AI Vore effects
+ if(!no_color)
+ flat_icon.ColorTone(rgb(125,180,225))//Let's make it bluish.
+ flat_icon.ChangeOpacity(0.5)//Make it half transparent.
+ */ //VOREStation Removal End
var/icon/alpha_mask = new('icons/effects/effects.dmi', "scanline")//Scanline effect.
flat_icon.AddAlphaMask(alpha_mask)//Finally, let's mix in a distortion effect.
return flat_icon
diff --git a/code/_helpers/time.dm b/code/_helpers/time.dm
index 58348761f8..f75802eb45 100644
--- a/code/_helpers/time.dm
+++ b/code/_helpers/time.dm
@@ -135,6 +135,6 @@ var/round_start_time = 0
. += CEILING(i*DELTA_CALC, 1)
sleep(i*world.tick_lag*DELTA_CALC)
i *= 2
- while (TICK_USAGE > min(TICK_LIMIT_TO_RUN, Master.current_ticklimit))
+ while (TICK_USAGE > min(TICK_LIMIT_TO_RUN, GLOB.CURRENT_TICKLIMIT))
#undef DELTA_CALC
\ No newline at end of file
diff --git a/code/_helpers/unsorted.dm b/code/_helpers/unsorted.dm
index 866a8b8a14..1377ce2adf 100644
--- a/code/_helpers/unsorted.dm
+++ b/code/_helpers/unsorted.dm
@@ -1054,62 +1054,21 @@ proc/get_mob_with_client_list()
//Quick type checks for some tools
var/global/list/common_tools = list(
/obj/item/stack/cable_coil,
-/obj/item/weapon/wrench,
+/obj/item/weapon/tool/wrench,
/obj/item/weapon/weldingtool,
-/obj/item/weapon/screwdriver,
-/obj/item/weapon/wirecutters,
+/obj/item/weapon/tool/screwdriver,
+/obj/item/weapon/tool/wirecutters,
/obj/item/device/multitool,
-/obj/item/weapon/crowbar)
+/obj/item/weapon/tool/crowbar)
/proc/istool(O)
if(O && is_type_in_list(O, common_tools))
return 1
return 0
-/proc/iswrench(O)
- if(istype(O, /obj/item/weapon/wrench))
- return 1
- return 0
-
-/proc/iswelder(O)
- if(istype(O, /obj/item/weapon/weldingtool))
- return 1
- return 0
-
-/proc/iscoil(O)
- if(istype(O, /obj/item/stack/cable_coil))
- return 1
- return 0
-
-/proc/iswirecutter(O)
- if(istype(O, /obj/item/weapon/wirecutters))
- return 1
- return 0
-
-/proc/isscrewdriver(O)
- if(istype(O, /obj/item/weapon/screwdriver))
- return 1
- return 0
-
-/proc/ismultitool(O)
- if(istype(O, /obj/item/device/multitool))
- return 1
- return 0
-
-/proc/iscrowbar(O)
- if(istype(O, /obj/item/weapon/crowbar))
- return 1
- return 0
-
-/proc/iswire(O)
- if(istype(O, /obj/item/stack/cable_coil))
- return 1
- return 0
/proc/is_wire_tool(obj/item/I)
- if(istype(I, /obj/item/device/multitool))
- return TRUE
- if(istype(I, /obj/item/weapon/wirecutters))
+ if(istype(I, /obj/item/device/multitool) || I.is_wirecutter())
return TRUE
if(istype(I, /obj/item/device/assembly/signaler))
return TRUE
@@ -1149,24 +1108,30 @@ proc/is_hot(obj/item/W as obj)
//Whether or not the given item counts as sharp in terms of dealing damage
/proc/is_sharp(obj/O as obj)
- if (!O) return 0
- if (O.sharp) return 1
- if (O.edge) return 1
- return 0
+ if(!O)
+ return FALSE
+ if(O.sharp)
+ return TRUE
+ if(O.edge)
+ return TRUE
+ return FALSE
//Whether or not the given item counts as cutting with an edge in terms of removing limbs
/proc/has_edge(obj/O as obj)
- if (!O) return 0
- if (O.edge) return 1
- return 0
+ if(!O)
+ return FALSE
+ if(O.edge)
+ return TRUE
+ return FALSE
//Returns 1 if the given item is capable of popping things like balloons, inflatable barriers, or cutting police tape.
/proc/can_puncture(obj/item/W as obj) // For the record, WHAT THE HELL IS THIS METHOD OF DOING IT?
- if(!W) return 0
- if(W.sharp) return 1
+ if(!W)
+ return FALSE
+ if(W.sharp)
+ return TRUE
return ( \
- W.sharp || \
- istype(W, /obj/item/weapon/screwdriver) || \
+ W.is_screwdriver() || \
istype(W, /obj/item/weapon/pen) || \
istype(W, /obj/item/weapon/weldingtool) || \
istype(W, /obj/item/weapon/flame/lighter/zippo) || \
@@ -1485,3 +1450,6 @@ var/mob/dview/dview_mob = new
return
var/datum/D = list_or_datum
D.vars[var_name] = var_value
+
+/proc/pass()
+ return
diff --git a/code/_macros.dm b/code/_macros.dm
index efd1e72edd..9cd11a6c15 100644
--- a/code/_macros.dm
+++ b/code/_macros.dm
@@ -65,9 +65,9 @@
#define CanInteract(user, state) (CanUseTopic(user, state) == STATUS_INTERACTIVE)
-#define qdel_null_list(x) if(x) { for(var/y in x) { qdel(y) } ; x = null }
+#define QDEL_NULL_LIST(x) if(x) { for(var/y in x) { qdel(y) } ; x = null }
-#define qdel_null(x) if(x) { qdel(x) ; x = null }
+#define QDEL_NULL(x) if(x) { qdel(x) ; x = null }
#define ARGS_DEBUG log_debug("[__FILE__] - [__LINE__]") ; for(var/arg in args) { log_debug("\t[log_info_line(arg)]") }
@@ -91,4 +91,6 @@
// Null-safe L.Cut()
#define LAZYCLEARLIST(L) if(L) L.Cut()
// Reads L or an empty list if L is not a list. Note: Does NOT assign, L may be an expression.
-#define SANITIZE_LIST(L) ( islist(L) ? L : list() )
\ No newline at end of file
+#define SANITIZE_LIST(L) ( islist(L) ? L : list() )
+// Turns LAZYINITLIST(L) L[K] = V into ... for associated lists
+#define LAZYSET(L, K, V) if(!L) { L = list(); } L[K] = V;
\ No newline at end of file
diff --git a/code/_onclick/cyborg.dm b/code/_onclick/cyborg.dm
index e64d4f946f..1dcc2bc955 100644
--- a/code/_onclick/cyborg.dm
+++ b/code/_onclick/cyborg.dm
@@ -76,7 +76,7 @@
if(A == loc || (A in loc) || (A in contents))
// No adjacency checks
- var/resolved = A.attackby(W,src)
+ var/resolved = A.attackby(W, src, 1)
if(!resolved && A && W)
W.afterattack(A,src,1,params)
return
@@ -88,7 +88,7 @@
if(isturf(A) || isturf(A.loc))
if(A.Adjacent(src)) // see adjacent.dm
- var/resolved = A.attackby(W, src)
+ var/resolved = A.attackby(W, src, 1)
if(!resolved && A && W)
W.afterattack(A, src, 1, params)
return
diff --git a/code/_onclick/hud/action.dm b/code/_onclick/hud/action.dm
index 7e03151fd6..2b29fa6492 100644
--- a/code/_onclick/hud/action.dm
+++ b/code/_onclick/hud/action.dm
@@ -31,7 +31,7 @@
if(owner)
Remove(owner)
target = null
- qdel_null(button)
+ QDEL_NULL(button)
return ..()
/datum/action/proc/Grant(mob/living/T)
@@ -48,7 +48,7 @@
if(button)
if(T.client)
T.client.screen -= button
- qdel_null(button)
+ QDEL_NULL(button)
T.actions.Remove(src)
T.update_action_buttons()
owner = null
diff --git a/code/_onclick/hud/hud.dm b/code/_onclick/hud/hud.dm
index 3a8d8696ce..8b32d1447e 100644
--- a/code/_onclick/hud/hud.dm
+++ b/code/_onclick/hud/hud.dm
@@ -15,7 +15,7 @@ var/list/global_huds = list(
global_hud.meson,
global_hud.science,
global_hud.material,
- global_hud.holomap // VOREStation Edit - Holomap
+ global_hud.holomap
)
/datum/hud/var/obj/screen/grab_intent
@@ -36,7 +36,7 @@ var/list/global_huds = list(
var/obj/screen/meson
var/obj/screen/science
var/obj/screen/material
- var/obj/screen/holomap // VOREStation Edit - Holomap
+ var/obj/screen/holomap
/datum/global_hud/proc/setup_overlay(var/icon_state)
var/obj/screen/screen = new /obj/screen()
@@ -92,19 +92,17 @@ var/list/global_huds = list(
science = setup_overlay("science_hud")
material = setup_overlay("material_hud")
- // VOREStation Edit Begin - Holomap
// The holomap screen object is actually totally invisible.
// Station maps work by setting it as an images location before sending to client, not
// actually changing the icon or icon state of the screen object itself!
// Why do they work this way? I don't know really, that is how /vg designed them, but since they DO
- // work this way, we can take advantage of their immutability by making them part of
+ // work this way, we can take advantage of their immutability by making them part of
// the global_hud (something we have and /vg doesn't) instead of an instance per mob.
holomap = new /obj/screen()
holomap.name = "holomap"
holomap.icon = null
holomap.screen_loc = ui_holomap
holomap.mouse_opacity = 0
- // VOREStation Edit End
var/obj/screen/O
var/i
diff --git a/code/_onclick/item_attack.dm b/code/_onclick/item_attack.dm
index d583084791..d1a61ec8f4 100644
--- a/code/_onclick/item_attack.dm
+++ b/code/_onclick/item_attack.dm
@@ -28,26 +28,29 @@ avoid code duplication. This includes items that may sometimes act as a standard
return
//I would prefer to rename this to attack(), but that would involve touching hundreds of files.
-/obj/item/proc/resolve_attackby(atom/A, mob/user)
+/obj/item/proc/resolve_attackby(atom/A, mob/user, var/attack_modifier = 1)
pre_attack(A, user)
add_fingerprint(user)
- return A.attackby(src, user)
+ return A.attackby(src, user, attack_modifier)
// No comment
-/atom/proc/attackby(obj/item/W, mob/user)
+/atom/proc/attackby(obj/item/W, mob/user, var/attack_modifier)
return
-/atom/movable/attackby(obj/item/W, mob/user)
+/atom/movable/attackby(obj/item/W, mob/user, var/attack_modifier)
if(!(W.flags & NOBLUDGEON))
visible_message("[src] has been hit by [user] with [W].")
-/mob/living/attackby(obj/item/I, mob/user)
+/mob/living/attackby(obj/item/I, mob/user, var/attack_modifier)
if(!ismob(user))
return 0
- if(can_operate(src) && I.do_surgery(src,user)) //Surgery
- return 1
- if(attempt_vr(src,"vore_attackby",args)) return //VOREStation Code
- return I.attack(src, user, user.zone_sel.selecting)
+ if(can_operate(src) && I.do_surgery(src,user))
+ if(I.can_do_surgery(src,user))
+ return 1
+ else
+ return 0
+ if(attempt_vr(src,"vore_attackby",args)) return //VOREStation Add - The vore, of course.
+ return I.attack(src, user, user.zone_sel.selecting, attack_modifier)
// Used to get how fast a mob should attack, and influences click delay.
// This is just for inheritence.
@@ -71,7 +74,7 @@ avoid code duplication. This includes items that may sometimes act as a standard
return
//I would prefer to rename this attack_as_weapon(), but that would involve touching hundreds of files.
-/obj/item/proc/attack(mob/living/M, mob/living/user, var/target_zone)
+/obj/item/proc/attack(mob/living/M, mob/living/user, var/target_zone, var/attack_modifier)
if(!force || (flags & NOBLUDGEON))
return 0
if(M == user && user.a_intent != I_HURT)
@@ -90,12 +93,12 @@ avoid code duplication. This includes items that may sometimes act as a standard
var/hit_zone = M.resolve_item_attack(src, user, target_zone)
if(hit_zone)
- apply_hit_effect(M, user, hit_zone)
+ apply_hit_effect(M, user, hit_zone, attack_modifier)
return 1
//Called when a weapon is used to make a successful melee attack on a mob. Returns the blocked result
-/obj/item/proc/apply_hit_effect(mob/living/target, mob/living/user, var/hit_zone)
+/obj/item/proc/apply_hit_effect(mob/living/target, mob/living/user, var/hit_zone, var/attack_modifier)
user.break_cloak()
if(hitsound)
playsound(loc, hitsound, 50, 1, -1)
@@ -104,7 +107,10 @@ avoid code duplication. This includes items that may sometimes act as a standard
for(var/datum/modifier/M in user.modifiers)
if(!isnull(M.outgoing_melee_damage_percent))
power *= M.outgoing_melee_damage_percent
+
if(HULK in user.mutations)
power *= 2
- return target.hit_with_weapon(src, user, power, hit_zone)
+ power *= attack_modifier
+
+ return target.hit_with_weapon(src, user, power, hit_zone)
\ No newline at end of file
diff --git a/code/_onclick/telekinesis.dm b/code/_onclick/telekinesis.dm
index 26c1680421..229e717e45 100644
--- a/code/_onclick/telekinesis.dm
+++ b/code/_onclick/telekinesis.dm
@@ -154,7 +154,7 @@ var/const/tk_maxrange = 15
O.anchored = 1
O.density = 0
O.layer = FLY_LAYER
- O.set_dir(pick(cardinal))
+ O.set_dir(pick(GLOB.cardinal))
O.icon = 'icons/effects/effects.dmi'
O.icon_state = "nothing"
flick("empdisable",O)
diff --git a/code/controllers/Processes/nanoui.dm b/code/controllers/Processes/nanoui.dm
index 21d2f8e5f0..0f720600bc 100644
--- a/code/controllers/Processes/nanoui.dm
+++ b/code/controllers/Processes/nanoui.dm
@@ -4,10 +4,10 @@
/datum/controller/process/nanoui/statProcess()
..()
- stat(null, "[nanomanager.processing_uis.len] UIs")
+ stat(null, "[GLOB.nanomanager.processing_uis.len] UIs")
/datum/controller/process/nanoui/doWork()
- for(last_object in nanomanager.processing_uis)
+ for(last_object in GLOB.nanomanager.processing_uis)
var/datum/nanoui/NUI = last_object
if(istype(NUI) && !QDELETED(NUI))
try
@@ -16,4 +16,4 @@
catchException(e, NUI)
else
catchBadType(NUI)
- nanomanager.processing_uis -= NUI
\ No newline at end of file
+ GLOB.nanomanager.processing_uis -= NUI
\ No newline at end of file
diff --git a/code/controllers/Processes/supply.dm b/code/controllers/Processes/supply.dm
index 5b3e4f6f2b..2234b7a9ac 100644
--- a/code/controllers/Processes/supply.dm
+++ b/code/controllers/Processes/supply.dm
@@ -8,15 +8,22 @@
//Computers are in /code/game/machinery/computer/supply.dm
/datum/supply_order
- var/ordernum
- var/datum/supply_packs/object = null
- var/orderedby = null
- var/comment = null
+ var/ordernum // Unfabricatable index
+ var/index // Fabricatable index
+ var/datum/supply_pack/object = null
+ var/cost // Cost of the supply pack (Fabricatable) (Changes not reflected when purchasing supply packs, this is cosmetic only)
+ var/name // Name of the supply pack datum (Fabricatable)
+ var/ordered_by = null // Who requested the order
+ var/comment = null // What reason was given for the order
+ var/approved_by = null // Who approved the order
+ var/ordered_at // Date and time the order was requested at
+ var/approved_at // Date and time the order was approved at
+ var/status // [Requested, Accepted, Denied, Shipped]
/datum/exported_crate
var/name
var/value
-
+ var/list/contents
var/datum/controller/supply/supply_controller = new()
@@ -25,25 +32,29 @@ var/datum/controller/supply/supply_controller = new()
var/points = 50
var/points_per_process = 1.5
var/points_per_slip = 2
- var/points_per_platinum = 5 // 5 points per sheet
- var/points_per_phoron = 5
var/points_per_money = 0.02 // 1 point for $50
//control
var/ordernum
- var/list/shoppinglist = list()
- var/list/requestlist = list()
- var/list/supply_packs = list()
- var/list/exported_crates = list()
+ var/list/shoppinglist = list() // Approved orders
+ var/list/supply_pack = list() // All supply packs
+ var/list/exported_crates = list() // Crates sent from the station
+ var/list/order_history = list() // History of orders, showing edits made by users
+ var/list/adm_order_history = list() // Complete history of all orders, for admin use
+ var/list/adm_export_history = list() // Complete history of all crates sent back on the shuttle, for admin use
//shuttle movement
var/movetime = 1200
var/datum/shuttle/ferry/supply/shuttle
+ var/list/material_points_conversion = list( // Any materials not named in this list are worth 0 points
+ "phoron" = 5,
+ "platinum" = 5
+ )
/datum/controller/supply/New()
ordernum = rand(1,9000)
- for(var/typepath in (typesof(/datum/supply_packs) - /datum/supply_packs))
- var/datum/supply_packs/P = new typepath()
- supply_packs[P.name] = P
+ for(var/typepath in subtypesof(/datum/supply_pack))
+ var/datum/supply_pack/P = new typepath()
+ supply_pack[P.name] = P
/datum/controller/process/supply/setup()
name = "supply controller"
@@ -80,23 +91,17 @@ var/datum/controller/supply/supply_controller = new()
callHook("sell_shuttle", list(area_shuttle));
- var/phoron_count = 0
- var/plat_count = 0
- var/money_count = 0
-
- exported_crates = list()
-
for(var/atom/movable/MA in area_shuttle)
if(MA.anchored)
continue
+ var/datum/exported_crate/EC = new /datum/exported_crate()
+ EC.name = "\proper[MA.name]"
+ EC.value = 0
+ EC.contents = list()
+
// Must be in a crate!
if(istype(MA,/obj/structure/closet/crate))
- var/oldpoints = points
- var/oldphoron = phoron_count
- var/oldplatinum = plat_count
- var/oldmoney = money_count
-
var/obj/structure/closet/crate/CR = MA
callHook("sell_crate", list(CR, area_shuttle))
@@ -104,44 +109,63 @@ var/datum/controller/supply/supply_controller = new()
var/find_slip = 1
for(var/atom/A in CR)
+ EC.contents[++EC.contents.len] = list(
+ "object" = "\proper[A.name]",
+ "value" = 0,
+ "quantity" = 1
+ )
+
// Sell manifests
if(find_slip && istype(A,/obj/item/weapon/paper/manifest))
var/obj/item/weapon/paper/manifest/slip = A
if(!slip.is_copy && slip.stamped && slip.stamped.len) //yes, the clown stamp will work. clown is the highest authority on the station, it makes sense
points += points_per_slip
+ EC.contents[EC.contents.len]["value"] = points_per_slip
find_slip = 0
continue
// Sell phoron and platinum
if(istype(A, /obj/item/stack))
var/obj/item/stack/P = A
- switch(P.get_material_name())
- if("phoron")
- phoron_count += P.get_amount()
- if("platinum")
- plat_count += P.get_amount()
+ if(material_points_conversion[P.get_material_name()])
+ EC.contents[EC.contents.len]["value"] = P.get_amount() * material_points_conversion[P.get_material_name()]
+ EC.contents[EC.contents.len]["quantity"] = P.get_amount()
+ EC.value += EC.contents[EC.contents.len]["value"]
//Sell spacebucks
if(istype(A, /obj/item/weapon/spacecash))
var/obj/item/weapon/spacecash/cashmoney = A
- money_count += cashmoney.worth
+ EC.contents[EC.contents.len]["value"] = cashmoney.worth * points_per_money
+ EC.contents[EC.contents.len]["quantity"] = cashmoney.worth
+ EC.value += EC.contents[EC.contents.len]["value"]
- var/datum/exported_crate/EC = new /datum/exported_crate()
- EC.name = CR.name
- EC.value = points - oldpoints
- EC.value += (phoron_count - oldphoron) * points_per_phoron
- EC.value += (plat_count - oldplatinum) * points_per_platinum
- EC.value += (money_count - oldmoney) * points_per_money
- exported_crates += EC
+
+
+ // Make a log of it, but it wasn't shipped properly, and so isn't worth anything
+ else
+ EC.contents = list(
+ "error" = "Error: Product was improperly packaged. Payment rendered null under terms of agreement."
+ )
+
+ exported_crates += EC
+ points += EC.value
+
+ // Duplicate the receipt for the admin-side log
+ var/datum/exported_crate/adm = new()
+ adm.name = EC.name
+ adm.value = EC.value
+ adm.contents = deepCopyList(EC.contents)
+ adm_export_history += adm
qdel(MA)
- points += phoron_count * points_per_phoron
- points += plat_count * points_per_platinum
- points += money_count * points_per_money
-
//Buying
/datum/controller/supply/proc/buy()
+ var/list/shoppinglist = list()
+ for(var/datum/supply_order/SO in order_history)
+ if(SO.status == SUP_ORDER_APPROVED)
+ shoppinglist += SO
+
if(!shoppinglist.len)
return
@@ -165,17 +189,16 @@ var/datum/controller/supply/supply_controller = new()
continue
clear_turfs += T
- for(var/S in shoppinglist)
+ for(var/datum/supply_order/SO in shoppinglist)
if(!clear_turfs.len)
break
var/i = rand(1,clear_turfs.len)
var/turf/pickedloc = clear_turfs[i]
clear_turfs.Cut(i,i+1)
- shoppinglist -= S
- var/datum/supply_order/SO = S
- var/datum/supply_packs/SP = SO.object
+ SO.status = SUP_ORDER_SHIPPED
+ var/datum/supply_pack/SP = SO.object
var/obj/A = new SP.containertype(pickedloc)
A.name = "[SP.containername] [SO.comment ? "([SO.comment])":"" ]"
@@ -202,8 +225,8 @@ var/datum/controller/supply/supply_controller = new()
log_debug("Supply pack with invalid access restriction [SP.access] encountered!")
var/list/contains
- if(istype(SP,/datum/supply_packs/randomised))
- var/datum/supply_packs/randomised/SPR = SP
+ if(istype(SP,/datum/supply_pack/randomised))
+ var/datum/supply_pack/randomised/SPR = SP
contains = list()
if(SPR.contains.len)
for(var/j=1,j<=SPR.num_contained,j++)
@@ -227,3 +250,141 @@ var/datum/controller/supply/supply_controller = new()
slip.info += "CHECK CONTENTS AND STAMP BELOW THE LINE TO CONFIRM RECEIPT OF GOODS
"
return
+
+// Will attempt to purchase the specified order, returning TRUE on success, FALSE on failure
+/datum/controller/supply/proc/approve_order(var/datum/supply_order/O, var/mob/user)
+ // Not enough points to purchase the crate
+ if(supply_controller.points <= O.object.cost)
+ return FALSE
+
+ // Based on the current model, there shouldn't be any entries in order_history, requestlist, or shoppinglist, that aren't matched in adm_order_history
+ var/datum/supply_order/adm_order
+ for(var/datum/supply_order/temp in adm_order_history)
+ if(temp.ordernum == O.ordernum)
+ adm_order = temp
+ break
+
+ var/idname = "*None Provided*"
+ if(ishuman(user))
+ var/mob/living/carbon/human/H = user
+ idname = H.get_authentification_name()
+ else if(issilicon(user))
+ idname = user.real_name
+
+ // Update order status
+ O.status = SUP_ORDER_APPROVED
+ O.approved_by = idname
+ O.approved_at = stationdate2text() + " - " + stationtime2text()
+ // Update admin-side mirror
+ adm_order.status = SUP_ORDER_APPROVED
+ adm_order.approved_by = idname
+ adm_order.approved_at = stationdate2text() + " - " + stationtime2text()
+
+ // Deduct cost
+ supply_controller.points -= O.object.cost
+ return TRUE
+
+// Will deny the specified order. Only useful if the order is currently requested, but available at any status
+/datum/controller/supply/proc/deny_order(var/datum/supply_order/O, var/mob/user)
+ // Based on the current model, there shouldn't be any entries in order_history, requestlist, or shoppinglist, that aren't matched in adm_order_history
+ var/datum/supply_order/adm_order
+ for(var/datum/supply_order/temp in adm_order_history)
+ if(temp.ordernum == O.ordernum)
+ adm_order = temp
+ break
+
+ var/idname = "*None Provided*"
+ if(ishuman(user))
+ var/mob/living/carbon/human/H = user
+ idname = H.get_authentification_name()
+ else if(issilicon(user))
+ idname = user.real_name
+
+ // Update order status
+ O.status = SUP_ORDER_DENIED
+ O.approved_by = idname
+ O.approved_at = stationdate2text() + " - " + stationtime2text()
+ // Update admin-side mirror
+ adm_order.status = SUP_ORDER_DENIED
+ adm_order.approved_by = idname
+ adm_order.approved_at = stationdate2text() + " - " + stationtime2text()
+ return
+
+// Will deny all requested orders
+/datum/controller/supply/proc/deny_all_pending(var/mob/user)
+ for(var/datum/supply_order/O in order_history)
+ if(O.status == SUP_ORDER_REQUESTED)
+ deny_order(O, user)
+
+// Will delete the specified order from the user-side list
+/datum/controller/supply/proc/delete_order(var/datum/supply_order/O, var/mob/user)
+ // Making sure they know what they're doing
+ if(alert(user, "Are you sure you want to delete this record? If it has been approved, cargo points will NOT be refunded!", "Delete Record","No","Yes") == "Yes")
+ if(alert(user, "Are you really sure? There is no way to recover the order once deleted.", "Delete Record", "No", "Yes") == "Yes")
+ log_admin("[key_name(user)] has deleted supply order \ref[O] [O] from the user-side order history.")
+ supply_controller.order_history -= O
+ return
+
+// Will generate a new, requested order, for the given supply pack type
+/datum/controller/supply/proc/create_order(var/datum/supply_pack/S, var/mob/user, var/reason)
+ var/datum/supply_order/new_order = new()
+ var/datum/supply_order/adm_order = new() // Admin-recorded order must be a separate copy in memory, or user-made edits will corrupt it
+
+ var/idname = "*None Provided*"
+ if(ishuman(user))
+ var/mob/living/carbon/human/H = user
+ idname = H.get_authentification_name()
+ else if(issilicon(user))
+ idname = user.real_name
+
+ new_order.ordernum = ++ordernum // Ordernum is used to track the order between the playerside list of orders and the adminside list
+ new_order.index = new_order.ordernum // Index can be fabricated, or falsified. Ordernum is a permanent marker used to track the order
+ new_order.object = S
+ new_order.name = S.name
+ new_order.cost = S.cost
+ new_order.ordered_by = idname
+ new_order.comment = reason
+ new_order.ordered_at = stationdate2text() + " - " + stationtime2text()
+ new_order.status = SUP_ORDER_REQUESTED
+
+ adm_order.ordernum = new_order.ordernum
+ adm_order.index = new_order.index
+ adm_order.object = new_order.object
+ adm_order.name = new_order.name
+ adm_order.cost = new_order.cost
+ adm_order.ordered_by = new_order.ordered_by
+ adm_order.comment = new_order.comment
+ adm_order.ordered_at = new_order.ordered_at
+ adm_order.status = new_order.status
+
+ order_history += new_order
+ adm_order_history += adm_order
+
+// Will delete the specified export receipt from the user-side list
+/datum/controller/supply/proc/delete_export(var/datum/exported_crate/E, var/mob/user)
+ // Making sure they know what they're doing
+ if(alert(user, "Are you sure you want to delete this record?", "Delete Record","No","Yes") == "Yes")
+ if(alert(user, "Are you really sure? There is no way to recover the receipt once deleted.", "Delete Record", "No", "Yes") == "Yes")
+ log_admin("[key_name(user)] has deleted export receipt \ref[E] [E] from the user-side export history.")
+ supply_controller.exported_crates -= E
+ return
+
+// Will add an item entry to the specified export receipt on the user-side list
+/datum/controller/supply/proc/add_export_item(var/datum/exported_crate/E, var/mob/user)
+ var/new_name = input(user, "Name", "Please enter the name of the item.") as null|text
+ if(!new_name)
+ return
+
+ var/new_quantity = input(user, "Name", "Please enter the quantity of the item.") as null|num
+ if(!new_quantity)
+ return
+
+ var/new_value = input(user, "Name", "Please enter the value of the item.") as null|num
+ if(!new_value)
+ return
+
+ E.contents[++E.contents.len] = list(
+ "object" = new_name,
+ "quantity" = new_quantity,
+ "value" = new_value
+ )
diff --git a/code/controllers/globals.dm b/code/controllers/globals.dm
new file mode 100644
index 0000000000..fa7b917194
--- /dev/null
+++ b/code/controllers/globals.dm
@@ -0,0 +1,59 @@
+GLOBAL_REAL(GLOB, /datum/controller/global_vars)
+
+/datum/controller/global_vars
+ name = "Global Variables"
+
+ var/list/gvars_datum_protected_varlist
+ var/list/gvars_datum_in_built_vars
+ var/list/gvars_datum_init_order
+
+/datum/controller/global_vars/New()
+ if(GLOB)
+ CRASH("Multiple instances of global variable controller created")
+ GLOB = src
+
+ var/datum/controller/exclude_these = new
+ gvars_datum_in_built_vars = exclude_these.vars + list("gvars_datum_protected_varlist", "gvars_datum_in_built_vars", "gvars_datum_init_order")
+
+ log_world("[vars.len - gvars_datum_in_built_vars.len] global variables")
+
+ Initialize(exclude_these)
+
+/datum/controller/global_vars/Destroy(force)
+ crash_with("There was an attempt to qdel the global vars holder!")
+ if(!force)
+ return QDEL_HINT_LETMELIVE
+
+ QDEL_NULL(statclick)
+ gvars_datum_protected_varlist.Cut()
+ gvars_datum_in_built_vars.Cut()
+
+ GLOB = null
+
+ return ..()
+
+/datum/controller/global_vars/stat_entry()
+ if(!statclick)
+ statclick = new/obj/effect/statclick/debug(null, "Initializing...", src)
+
+ stat("Globals:", statclick.update("Edit"))
+
+/datum/controller/global_vars/VV_hidden()
+ return ..() + gvars_datum_protected_varlist
+
+/datum/controller/global_vars/Initialize(var/exclude_these)
+ gvars_datum_init_order = list()
+ gvars_datum_protected_varlist = list("gvars_datum_protected_varlist")
+
+ //See https://github.com/tgstation/tgstation/issues/26954
+ for(var/I in typesof(/datum/controller/global_vars/proc))
+ var/CLEANBOT_RETURNS = "[I]"
+ pass(CLEANBOT_RETURNS)
+
+ for(var/I in (vars - gvars_datum_in_built_vars))
+ var/start_tick = world.time
+ call(src, "InitGlobal[I]")()
+ var/end_tick = world.time
+ if(end_tick - start_tick)
+ warning("Global [I] slept during initialization!")
+ QDEL_NULL(exclude_these)
\ No newline at end of file
diff --git a/code/controllers/master.dm b/code/controllers/master.dm
index 997e0fd3e0..050251fb0d 100644
--- a/code/controllers/master.dm
+++ b/code/controllers/master.dm
@@ -6,7 +6,21 @@
* Odds are, there is a reason
*
**/
-var/datum/controller/master/Master = new()
+
+//This is the ABSOLUTE ONLY THING that should init globally like this
+GLOBAL_REAL(Master, /datum/controller/master) = new
+
+//THIS IS THE INIT ORDER
+//Master -> SSPreInit -> GLOB -> world -> config -> SSInit -> Failsafe
+//GOT IT MEMORIZED?
+GLOBAL_VAR_INIT(MC_restart_clear, 0)
+GLOBAL_VAR_INIT(MC_restart_timeout, 0)
+GLOBAL_VAR_INIT(MC_restart_count, 0)
+
+//current tick limit, assigned by the queue controller before running a subsystem.
+//used by check_tick as well so that the procs subsystems call can obey that SS's tick limits
+GLOBAL_VAR_INIT(CURRENT_TICKLIMIT, TICK_LIMIT_RUNNING)
+
/datum/controller/master
name = "Master"
@@ -48,10 +62,6 @@ var/datum/controller/master/Master = new()
var/static/restart_timeout = 0
var/static/restart_count = 0
- //current tick limit, assigned before running a subsystem.
- //used by CHECK_TICK as well so that the procs subsystems call can obey that SS's tick limits
- var/static/current_ticklimit = TICK_LIMIT_RUNNING
-
/datum/controller/master/New()
// Highlander-style: there can only be one! Kill off the old and replace it with the new.
var/list/_subsystems = list()
@@ -67,6 +77,9 @@ var/datum/controller/master/Master = new()
_subsystems += new I
Master = src
+ if(!GLOB)
+ new /datum/controller/global_vars
+
/datum/controller/master/Destroy()
..()
// Tell qdel() to Del() this object.
@@ -85,14 +98,14 @@ var/datum/controller/master/Master = new()
// -1 if we encountered a runtime trying to recreate it
/proc/Recreate_MC()
. = -1 //so if we runtime, things know we failed
- if (world.time < Master.restart_timeout)
+ if (world.time < GLOB.MC_restart_timeout)
return 0
- if (world.time < Master.restart_clear)
- Master.restart_count *= 0.5
+ if (world.time < GLOB.MC_restart_clear)
+ GLOB.MC_restart_count *= 0.5
- var/delay = 50 * ++Master.restart_count
- Master.restart_timeout = world.time + delay
- Master.restart_clear = world.time + (delay * 2)
+ var/delay = 50 * ++GLOB.MC_restart_count
+ GLOB.MC_restart_timeout = world.time + delay
+ GLOB.MC_restart_clear = world.time + (delay * 2)
Master.processing = FALSE //stop ticking this one
try
new/datum/controller/master()
@@ -136,6 +149,7 @@ var/datum/controller/master/Master = new()
if (istype(Master.subsystems))
if(FireHim)
Master.subsystems += new BadBoy.type //NEW_SS_GLOBAL will remove the old one
+
subsystems = Master.subsystems
current_runlevel = Master.current_runlevel
StartProcessing(10)
@@ -162,13 +176,13 @@ var/datum/controller/master/Master = new()
var/start_timeofday = REALTIMEOFDAY
// Initialize subsystems.
- current_ticklimit = config.tick_limit_mc_init
+ GLOB.CURRENT_TICKLIMIT = config.tick_limit_mc_init
for (var/datum/controller/subsystem/SS in subsystems)
if (SS.flags & SS_NO_INIT)
continue
SS.Initialize(REALTIMEOFDAY)
CHECK_TICK
- current_ticklimit = TICK_LIMIT_RUNNING
+ GLOB.CURRENT_TICKLIMIT = TICK_LIMIT_RUNNING
var/time = (REALTIMEOFDAY - start_timeofday) / 10
var/msg = "Initializations complete within [time] second[time == 1 ? "" : "s"]!"
@@ -277,7 +291,7 @@ var/datum/controller/master/Master = new()
tickdrift = max(0, MC_AVERAGE_FAST(tickdrift, (((REALTIMEOFDAY - init_timeofday) - (world.time - init_time)) / world.tick_lag)))
var/starting_tick_usage = TICK_USAGE
if (processing <= 0)
- current_ticklimit = TICK_LIMIT_RUNNING
+ GLOB.CURRENT_TICKLIMIT = TICK_LIMIT_RUNNING
sleep(10)
continue
@@ -286,7 +300,7 @@ var/datum/controller/master/Master = new()
// (because sleeps are processed in the order received, longer sleeps are more likely to run first)
if (starting_tick_usage > TICK_LIMIT_MC) //if there isn't enough time to bother doing anything this tick, sleep a bit.
sleep_delta *= 2
- current_ticklimit = TICK_LIMIT_RUNNING * 0.5
+ GLOB.CURRENT_TICKLIMIT = TICK_LIMIT_RUNNING * 0.5
sleep(world.tick_lag * (processing * sleep_delta))
continue
@@ -332,7 +346,7 @@ var/datum/controller/master/Master = new()
if (!error_level)
iteration++
error_level++
- current_ticklimit = TICK_LIMIT_RUNNING
+ GLOB.CURRENT_TICKLIMIT = TICK_LIMIT_RUNNING
sleep(10)
continue
@@ -344,7 +358,7 @@ var/datum/controller/master/Master = new()
if (!error_level)
iteration++
error_level++
- current_ticklimit = TICK_LIMIT_RUNNING
+ GLOB.CURRENT_TICKLIMIT = TICK_LIMIT_RUNNING
sleep(10)
continue
error_level--
@@ -355,9 +369,9 @@ var/datum/controller/master/Master = new()
iteration++
last_run = world.time
src.sleep_delta = MC_AVERAGE_FAST(src.sleep_delta, sleep_delta)
- current_ticklimit = TICK_LIMIT_RUNNING
+ GLOB.CURRENT_TICKLIMIT = TICK_LIMIT_RUNNING
if (processing * sleep_delta <= world.tick_lag)
- current_ticklimit -= (TICK_LIMIT_RUNNING * 0.25) //reserve the tail 1/4 of the next tick for the mc if we plan on running next tick
+ GLOB.CURRENT_TICKLIMIT -= (TICK_LIMIT_RUNNING * 0.25) //reserve the tail 1/4 of the next tick for the mc if we plan on running next tick
sleep(world.tick_lag * (processing * sleep_delta))
@@ -449,7 +463,7 @@ var/datum/controller/master/Master = new()
// Reduce tick allocation for subsystems that overran on their last tick.
tick_precentage = max(tick_precentage*0.5, tick_precentage-queue_node.tick_overrun)
- current_ticklimit = round(TICK_USAGE + tick_precentage)
+ GLOB.CURRENT_TICKLIMIT = round(TICK_USAGE + tick_precentage)
if (!(queue_node_flags & SS_TICKER))
ran_non_ticker = TRUE
diff --git a/code/controllers/master_controller.dm b/code/controllers/master_controller.dm
index e203650066..2695a39373 100644
--- a/code/controllers/master_controller.dm
+++ b/code/controllers/master_controller.dm
@@ -53,4 +53,4 @@ datum/controller/game_controller/proc/setup_objects()
populate_antag_type_list()
//Set up spawn points.
- populate_spawn_points()
+ populate_spawn_points()
\ No newline at end of file
diff --git a/code/controllers/subsystems/circuits.dm b/code/controllers/subsystems/circuits.dm
new file mode 100644
index 0000000000..8fda048c60
--- /dev/null
+++ b/code/controllers/subsystems/circuits.dm
@@ -0,0 +1,96 @@
+//
+// This is for custom circuits, mostly the initialization of global properties about them.
+// Might make this also process them in the future if its better to do that than using the obj ticker.
+//
+SUBSYSTEM_DEF(circuit)
+ name = "Circuit"
+ init_order = INIT_ORDER_CIRCUIT
+ flags = SS_NO_FIRE
+ var/list/all_components = list() // Associative list of [component_name]:[component_path] pairs
+ var/list/cached_components = list() // Associative list of [component_path]:[component] pairs
+ var/list/all_assemblies = list() // Associative list of [assembly_name]:[assembly_path] pairs
+ var/list/cached_assemblies = list() // Associative list of [assembly_path]:[assembly] pairs
+ var/list/all_circuits = list() // Associative list of [circuit_name]:[circuit_path] pairs
+ var/list/circuit_fabricator_recipe_list = list() // Associative list of [category_name]:[list_of_circuit_paths] pairs
+// var/cost_multiplier = MINERAL_MATERIAL_AMOUNT / 10 // Each circuit cost unit is 200cm3
+
+/datum/controller/subsystem/circuit/Recover()
+ flags |= SS_NO_INIT // Make extra sure we don't initialize twice.
+
+/datum/controller/subsystem/circuit/Initialize(timeofday)
+ circuits_init()
+ return ..()
+
+/datum/controller/subsystem/circuit/proc/circuits_init()
+ //Cached lists for free performance
+ for(var/path in typesof(/obj/item/integrated_circuit))
+ var/obj/item/integrated_circuit/IC = path
+ var/name = initial(IC.name)
+ all_components[name] = path // Populating the component lists
+ cached_components[IC] = new path
+
+ if(!(initial(IC.spawn_flags) & (IC_SPAWN_DEFAULT | IC_SPAWN_RESEARCH)))
+ continue
+
+ var/category = initial(IC.category_text)
+ if(!circuit_fabricator_recipe_list[category])
+ circuit_fabricator_recipe_list[category] = list()
+ var/list/category_list = circuit_fabricator_recipe_list[category]
+ category_list += IC // Populating the fabricator categories
+
+ for(var/path in typesof(/obj/item/device/electronic_assembly))
+ var/obj/item/device/electronic_assembly/A = path
+ var/name = initial(A.name)
+ all_assemblies[name] = path
+ cached_assemblies[A] = new path
+
+
+ circuit_fabricator_recipe_list["Assemblies"] = list(
+ /obj/item/device/electronic_assembly/default,
+ /obj/item/device/electronic_assembly/calc,
+ /obj/item/device/electronic_assembly/clam,
+ /obj/item/device/electronic_assembly/simple,
+ /obj/item/device/electronic_assembly/hook,
+ /obj/item/device/electronic_assembly/pda,
+ /obj/item/device/electronic_assembly/tiny/default,
+ /obj/item/device/electronic_assembly/tiny/cylinder,
+ /obj/item/device/electronic_assembly/tiny/scanner,
+ /obj/item/device/electronic_assembly/tiny/hook,
+ /obj/item/device/electronic_assembly/tiny/box,
+ /obj/item/device/electronic_assembly/medium/default,
+ /obj/item/device/electronic_assembly/medium/box,
+ /obj/item/device/electronic_assembly/medium/clam,
+ /obj/item/device/electronic_assembly/medium/medical,
+ /obj/item/device/electronic_assembly/medium/gun,
+ /obj/item/device/electronic_assembly/medium/radio,
+ /obj/item/device/electronic_assembly/large/default,
+ /obj/item/device/electronic_assembly/large/scope,
+ /obj/item/device/electronic_assembly/large/terminal,
+ /obj/item/device/electronic_assembly/large/arm,
+ /obj/item/device/electronic_assembly/large/tall,
+ /obj/item/device/electronic_assembly/large/industrial,
+ /obj/item/device/electronic_assembly/drone/default,
+ /obj/item/device/electronic_assembly/drone/arms,
+ /obj/item/device/electronic_assembly/drone/secbot,
+ /obj/item/device/electronic_assembly/drone/medbot,
+ /obj/item/device/electronic_assembly/drone/genbot,
+ /obj/item/device/electronic_assembly/drone/android,
+ /obj/item/device/electronic_assembly/wallmount/tiny,
+ /obj/item/device/electronic_assembly/wallmount/light,
+ /obj/item/device/electronic_assembly/wallmount,
+ /obj/item/device/electronic_assembly/wallmount/heavy,
+ /obj/item/weapon/implant/integrated_circuit,
+ /obj/item/clothing/under/circuitry,
+ /obj/item/clothing/gloves/circuitry,
+ /obj/item/clothing/glasses/circuitry,
+ /obj/item/clothing/shoes/circuitry,
+ /obj/item/clothing/head/circuitry,
+ /obj/item/clothing/ears/circuitry,
+ /obj/item/clothing/suit/circuitry
+ )
+
+ circuit_fabricator_recipe_list["Tools"] = list(
+ /obj/item/device/integrated_electronics/wirer,
+ /obj/item/device/integrated_electronics/debugger,
+ /obj/item/device/integrated_electronics/detailer
+ )
diff --git a/code/controllers/subsystems/holomaps_vr.dm b/code/controllers/subsystems/holomaps.dm
similarity index 100%
rename from code/controllers/subsystems/holomaps_vr.dm
rename to code/controllers/subsystems/holomaps.dm
diff --git a/code/controllers/subsystems/planets.dm b/code/controllers/subsystems/planets.dm
index a163a3b1e7..f7fc49b661 100644
--- a/code/controllers/subsystems/planets.dm
+++ b/code/controllers/subsystems/planets.dm
@@ -57,6 +57,7 @@ SUBSYSTEM_DEF(planets)
else
P.planet_walls -= T
T.vis_contents -= P.weather_holder.visuals
+ T.vis_contents -= P.weather_holder.special_visuals
/datum/controller/subsystem/planets/proc/allocateTurfs(var/initial = FALSE)
var/list/currentlist = new_outdoor_turfs
@@ -67,6 +68,7 @@ SUBSYSTEM_DEF(planets)
var/datum/planet/P = z_to_planet[OT.z]
P.planet_floors |= OT
OT.vis_contents |= P.weather_holder.visuals
+ OT.vis_contents |= P.weather_holder.special_visuals
if(!initial && MC_TICK_CHECK)
return
@@ -85,6 +87,7 @@ SUBSYSTEM_DEF(planets)
var/datum/planet/P = z_to_planet[T.z]
P.planet_floors -= T
T.vis_contents -= P.weather_holder.visuals
+ T.vis_contents -= P.weather_holder.special_visuals
/datum/controller/subsystem/planets/fire(resumed = 0)
diff --git a/code/controllers/verbs.dm b/code/controllers/verbs.dm
index 363acf0d69..af465b3e5e 100644
--- a/code/controllers/verbs.dm
+++ b/code/controllers/verbs.dm
@@ -125,7 +125,7 @@
debug_variables(alarm_manager)
feedback_add_details("admin_verb", "DAlarm")
if("Nano")
- debug_variables(nanomanager)
+ debug_variables(GLOB.nanomanager)
feedback_add_details("admin_verb", "DNano")
if("Chemistry")
debug_variables(chemistryProcess)
diff --git a/code/datums/autolathe/tools.dm b/code/datums/autolathe/tools.dm
index 70ea299ec8..d0aa2aa196 100644
--- a/code/datums/autolathe/tools.dm
+++ b/code/datums/autolathe/tools.dm
@@ -1,6 +1,6 @@
/datum/category_item/autolathe/tools/crowbar
name = "crowbar"
- path =/obj/item/weapon/crowbar
+ path =/obj/item/weapon/tool/crowbar
/datum/category_item/autolathe/tools/multitool
name = "multitool"
@@ -21,15 +21,15 @@
/datum/category_item/autolathe/tools/screwdriver
name = "screwdriver"
- path =/obj/item/weapon/screwdriver
+ path =/obj/item/weapon/tool/screwdriver
/datum/category_item/autolathe/tools/wirecutters
name = "wirecutters"
- path =/obj/item/weapon/wirecutters
+ path =/obj/item/weapon/tool/wirecutters
/datum/category_item/autolathe/tools/wrench
name = "wrench"
- path =/obj/item/weapon/wrench
+ path =/obj/item/weapon/tool/wrench
/datum/category_item/autolathe/tools/hatchet
name = "hatchet"
diff --git a/code/datums/datum.dm b/code/datums/datum.dm
index a9fea93f9d..fd58220657 100644
--- a/code/datums/datum.dm
+++ b/code/datums/datum.dm
@@ -19,5 +19,5 @@
/datum/proc/Destroy(force=FALSE)
weakref = null // Clear this reference to ensure it's kept for as brief duration as possible.
tag = null
- nanomanager.close_uis(src)
+ GLOB.nanomanager.close_uis(src)
return QDEL_HINT_QUEUE
diff --git a/code/datums/helper_datums/construction_datum.dm b/code/datums/helper_datums/construction_datum.dm
index 0bda144e8a..e2d3dbdfd4 100644
--- a/code/datums/helper_datums/construction_datum.dm
+++ b/code/datums/helper_datums/construction_datum.dm
@@ -1,105 +1,152 @@
#define FORWARD -1
#define BACKWARD 1
+
+// As of August 4th, 2018, these datums are only used in Mech construction.
/datum/construction
var/list/steps
var/atom/holder
var/result
var/list/steps_desc
- New(atom)
- ..()
- holder = atom
- if(!holder) //don't want this without a holder
- spawn
- qdel(src)
+/datum/construction/New(atom)
+ ..()
+ holder = atom
+ if(!holder) //don't want this without a holder
+ spawn
+ qdel(src)
+ set_desc(steps.len)
+ return
+
+/datum/construction/proc/next_step()
+ steps.len--
+ if(!steps.len)
+ spawn_result()
+ else
set_desc(steps.len)
- return
+ return
- proc/next_step()
- steps.len--
- if(!steps.len)
- spawn_result()
- else
- set_desc(steps.len)
- return
+/datum/construction/proc/action(var/obj/item/I,mob/user as mob)
+ return
- proc/action(atom/used_atom,mob/user as mob)
- return
+/datum/construction/proc/check_step(var/obj/item/I,mob/user as mob) //check last step only
+ var/valid_step = is_right_key(I)
+ if(valid_step)
+ if(custom_action(valid_step, I, user))
+ next_step()
+ return 1
+ return 0
- proc/check_step(atom/used_atom,mob/user as mob) //check last step only
- var/valid_step = is_right_key(used_atom)
- if(valid_step)
- if(custom_action(valid_step, used_atom, user))
- next_step()
+/datum/construction/proc/is_right_key(var/obj/item/I) // returns current step num if I is of the right type.
+ var/list/L = steps[steps.len]
+ switch(L["key"])
+ if(IS_SCREWDRIVER)
+ if(I.is_screwdriver())
+ return steps.len
+ if(IS_CROWBAR)
+ if(I.is_crowbar())
+ return steps.len
+ if(IS_WIRECUTTER)
+ if(I.is_wirecutter())
+ return steps.len
+ if(IS_WRENCH)
+ if(I.is_wrench())
+ return steps.len
+
+ if(istype(I, L["key"]))
+ return steps.len
+ return 0
+
+/datum/construction/proc/custom_action(step, I, user)
+ return 1
+
+/datum/construction/proc/check_all_steps(var/obj/item/I,mob/user as mob) //check all steps, remove matching one.
+ for(var/i=1;i<=steps.len;i++)
+ var/list/L = steps[i];
+ if(istype(I, L["key"]))
+ if(custom_action(i, I, user))
+ steps[i]=null;//stupid byond list from list removal...
+ listclearnulls(steps);
+ if(!steps.len)
+ spawn_result()
return 1
- return 0
-
- proc/is_right_key(atom/used_atom) // returns current step num if used_atom is of the right type.
- var/list/L = steps[steps.len]
- if(istype(used_atom, L["key"]))
- return steps.len
- return 0
-
- proc/custom_action(step, used_atom, user)
- return 1
-
- proc/check_all_steps(atom/used_atom,mob/user as mob) //check all steps, remove matching one.
- for(var/i=1;i<=steps.len;i++)
- var/list/L = steps[i];
- if(istype(used_atom, L["key"]))
- if(custom_action(i, used_atom, user))
- steps[i]=null;//stupid byond list from list removal...
- listclearnulls(steps);
- if(!steps.len)
- spawn_result()
- return 1
- return 0
+ return 0
- proc/spawn_result()
- if(result)
- new result(get_turf(holder))
- spawn()
- qdel(holder)
- return
+/datum/construction/proc/spawn_result()
+ if(result)
+ new result(get_turf(holder))
+ spawn()
+ qdel(holder)
+ return
- proc/set_desc(index as num)
- var/list/step = steps[index]
- holder.desc = step["desc"]
- return
+/datum/construction/proc/set_desc(index as num)
+ var/list/step = steps[index]
+ holder.desc = step["desc"]
+ return
+
+// Reversible
/datum/construction/reversible
var/index
- New(atom)
- ..()
- index = steps.len
- return
+/datum/construction/reversible/New(atom)
+ ..()
+ index = steps.len
+ return
- proc/update_index(diff as num)
- index+=diff
- if(index==0)
- spawn_result()
- else
- set_desc(index)
- return
+/datum/construction/reversible/proc/update_index(diff as num)
+ index+=diff
+ if(index==0)
+ spawn_result()
+ else
+ set_desc(index)
+ return
- is_right_key(atom/used_atom) // returns index step
- var/list/L = steps[index]
- if(istype(used_atom, L["key"]))
- return FORWARD //to the first step -> forward
- else if(L["backkey"] && istype(used_atom, L["backkey"]))
- return BACKWARD //to the last step -> backwards
- return 0
+/datum/construction/reversible/is_right_key(var/obj/item/I) // returns index step
+ var/list/L = steps[index]
- check_step(atom/used_atom,mob/user as mob)
- var/diff = is_right_key(used_atom)
- if(diff)
- if(custom_action(index, diff, used_atom, user))
- update_index(diff)
- return 1
- return 0
+ switch(L["key"])
+ if(IS_SCREWDRIVER)
+ if(I.is_screwdriver())
+ return FORWARD
+ if(IS_CROWBAR)
+ if(I.is_crowbar())
+ return FORWARD
+ if(IS_WIRECUTTER)
+ if(I.is_wirecutter())
+ return FORWARD
+ if(IS_WRENCH)
+ if(I.is_wrench())
+ return FORWARD
- custom_action(index, diff, used_atom, user)
- return 1
\ No newline at end of file
+ switch(L["backkey"])
+ if(IS_SCREWDRIVER)
+ if(I.is_screwdriver())
+ return BACKWARD
+ if(IS_CROWBAR)
+ if(I.is_crowbar())
+ return BACKWARD
+ if(IS_WIRECUTTER)
+ if(I.is_wirecutter())
+ return BACKWARD
+ if(IS_WRENCH)
+ if(I.is_wrench())
+ return BACKWARD
+
+ if(istype(I, L["key"]))
+ return FORWARD //to the first step -> forward
+ else if(L["backkey"] && istype(I, L["backkey"]))
+ return BACKWARD //to the last step -> backwards
+ return 0
+
+/datum/construction/reversible/check_step(var/obj/item/I,mob/user as mob)
+ var/diff = is_right_key(I)
+ if(diff)
+ if(custom_action(index, diff, I, user))
+ update_index(diff)
+ return 1
+ return 0
+
+/datum/construction/reversible/custom_action(index, diff, I, user)
+ return 1
\ No newline at end of file
diff --git a/code/datums/mind.dm b/code/datums/mind.dm
index 31e7ff290c..5204964bda 100644
--- a/code/datums/mind.dm
+++ b/code/datums/mind.dm
@@ -85,7 +85,7 @@
current.verbs -= /datum/changeling/proc/EvolutionMenu
current.mind = null
- nanomanager.user_transferred(current, new_character) // transfer active NanoUI instances to new user
+ GLOB.nanomanager.user_transferred(current, new_character) // transfer active NanoUI instances to new user
if(new_character.mind) //remove any mind currently in our new body's mind variable
new_character.mind.current = null
diff --git a/code/datums/observation/dir_set.dm b/code/datums/observation/dir_set.dm
index 1f4c8e251e..a626a07c4b 100644
--- a/code/datums/observation/dir_set.dm
+++ b/code/datums/observation/dir_set.dm
@@ -8,7 +8,7 @@
// /old_dir: The dir before the change.
// /new_dir: The dir after the change.
-var/decl/observ/dir_set/dir_set_event = new()
+GLOBAL_DATUM_INIT(dir_set_event, /decl/observ/dir_set, new)
/decl/observ/dir_set
name = "Direction Set"
@@ -27,9 +27,9 @@ var/decl/observ/dir_set/dir_set_event = new()
/atom/movable/Entered(var/atom/movable/am, atom/old_loc)
. = ..()
- if(. != CANCEL_MOVE_EVENT && dir_set_event.has_listeners(am))
- dir_set_event.register(src, am, /atom/proc/recursive_dir_set)
+ if(. != CANCEL_MOVE_EVENT && GLOB.dir_set_event.has_listeners(am))
+ GLOB.dir_set_event.register(src, am, /atom/proc/recursive_dir_set)
/atom/movable/Exited(var/atom/movable/am, atom/old_loc)
. = ..()
- dir_set_event.unregister(src, am, /atom/proc/recursive_dir_set)
+ GLOB.dir_set_event.unregister(src, am, /atom/proc/recursive_dir_set)
diff --git a/code/datums/observation/equipped.dm b/code/datums/observation/equipped.dm
index de07a74355..4142050a35 100644
--- a/code/datums/observation/equipped.dm
+++ b/code/datums/observation/equipped.dm
@@ -7,7 +7,7 @@
// /mob/equipper: The mob that equipped the item.
// /obj/item/item: The equipped item.
// slot: The slot equipped to.
-var/decl/observ/mob_equipped/mob_equipped_event = new()
+GLOBAL_DATUM_INIT(mob_equipped_event, /decl/observ/mob_equipped, new)
/decl/observ/mob_equipped
name = "Mob Equipped"
@@ -22,7 +22,7 @@ var/decl/observ/mob_equipped/mob_equipped_event = new()
// /obj/item/item: The equipped item.
// /mob/equipper: The mob that equipped the item.
// slot: The slot equipped to.
-var/decl/observ/item_equipped/item_equipped_event = new()
+GLOBAL_DATUM_INIT(item_equipped_event, /decl/observ/item_equipped, new)
/decl/observ/item_equipped
name = "Item Equipped"
@@ -34,5 +34,5 @@ var/decl/observ/item_equipped/item_equipped_event = new()
/obj/item/equipped(var/mob/user, var/slot)
. = ..()
- mob_equipped_event.raise_event(user, src, slot)
- item_equipped_event.raise_event(src, user, slot)
+ GLOB.mob_equipped_event.raise_event(user, src, slot)
+ GLOB.item_equipped_event.raise_event(src, user, slot)
diff --git a/code/datums/observation/helpers.dm b/code/datums/observation/helpers.dm
index 79ee8eb08d..9116026700 100644
--- a/code/datums/observation/helpers.dm
+++ b/code/datums/observation/helpers.dm
@@ -1,5 +1,5 @@
/atom/movable/proc/recursive_move(var/atom/movable/am, var/old_loc, var/new_loc)
- moved_event.raise_event(src, old_loc, new_loc)
+ GLOB.moved_event.raise_event(src, old_loc, new_loc)
/atom/movable/proc/move_to_destination(var/atom/movable/am, var/old_loc, var/new_loc)
var/turf/T = get_turf(new_loc)
@@ -10,9 +10,9 @@
set_dir(new_dir)
/proc/register_all_movement(var/event_source, var/listener)
- moved_event.register(event_source, listener, /atom/movable/proc/recursive_move)
- dir_set_event.register(event_source, listener, /atom/proc/recursive_dir_set)
+ GLOB.moved_event.register(event_source, listener, /atom/movable/proc/recursive_move)
+ GLOB.dir_set_event.register(event_source, listener, /atom/proc/recursive_dir_set)
/proc/unregister_all_movement(var/event_source, var/listener)
- moved_event.unregister(event_source, listener, /atom/movable/proc/recursive_move)
- dir_set_event.unregister(event_source, listener, /atom/proc/recursive_dir_set)
+ GLOB.moved_event.unregister(event_source, listener, /atom/movable/proc/recursive_move)
+ GLOB.dir_set_event.unregister(event_source, listener, /atom/proc/recursive_dir_set)
diff --git a/code/datums/observation/logged_in.dm b/code/datums/observation/logged_in.dm
index 311ff8acb6..c59e146a48 100644
--- a/code/datums/observation/logged_in.dm
+++ b/code/datums/observation/logged_in.dm
@@ -6,7 +6,7 @@
// Arguments that the called proc should expect:
// /mob/joiner: The mob that has logged in
-var/decl/observ/logged_in/logged_in_event = new()
+GLOBAL_DATUM_INIT(logged_in_event, /decl/observ/logged_in, new)
/decl/observ/logged_in
name = "Logged In"
@@ -18,4 +18,4 @@ var/decl/observ/logged_in/logged_in_event = new()
/mob/Login()
..()
- logged_in_event.raise_event(src)
+ GLOB.logged_in_event.raise_event(src)
diff --git a/code/datums/observation/moved.dm b/code/datums/observation/moved.dm
index 86a6b793ac..311f9673f6 100644
--- a/code/datums/observation/moved.dm
+++ b/code/datums/observation/moved.dm
@@ -8,7 +8,8 @@
// /atom/old_loc: The loc before the move.
// /atom/new_loc: The loc after the move.
-var/decl/observ/moved/moved_event = new()
+
+GLOBAL_DATUM_INIT(moved_event, /decl/observ/moved, new)
/decl/observ/moved
name = "Moved"
@@ -27,26 +28,26 @@ var/decl/observ/moved/moved_event = new()
/atom/Entered(var/atom/movable/am, var/atom/old_loc)
. = ..()
- moved_event.raise_event(am, old_loc, am.loc)
+ GLOB.moved_event.raise_event(am, old_loc, am.loc)
/atom/movable/Entered(var/atom/movable/am, atom/old_loc)
. = ..()
- if(moved_event.has_listeners(am))
- moved_event.register(src, am, /atom/movable/proc/recursive_move)
+ if(GLOB.moved_event.has_listeners(am))
+ GLOB.moved_event.register(src, am, /atom/movable/proc/recursive_move)
/atom/movable/Exited(var/atom/movable/am, atom/old_loc)
. = ..()
- moved_event.unregister(src, am, /atom/movable/proc/recursive_move)
+ GLOB.moved_event.unregister(src, am, /atom/movable/proc/recursive_move)
// Entered() typically lifts the moved event, but in the case of null-space we'll have to handle it.
/atom/movable/Move()
var/old_loc = loc
. = ..()
if(. && !loc)
- moved_event.raise_event(src, old_loc, null)
+ GLOB.moved_event.raise_event(src, old_loc, null)
/atom/movable/forceMove(atom/destination)
var/old_loc = loc
. = ..()
if(. && !loc)
- moved_event.raise_event(src, old_loc, null)
+ GLOB.moved_event.raise_event(src, old_loc, null)
diff --git a/code/datums/observation/unequipped.dm b/code/datums/observation/unequipped.dm
index 3287c0a3b5..6ad8d8eca0 100644
--- a/code/datums/observation/unequipped.dm
+++ b/code/datums/observation/unequipped.dm
@@ -7,7 +7,7 @@
// /mob/equipped: The mob that unequipped/dropped the item.
// /obj/item/item: The unequipped item.
-var/decl/observ/mob_unequipped/mob_unequipped_event = new()
+GLOBAL_DATUM_INIT(mob_unequipped_event, /decl/observ/mob_unequipped, new)
/decl/observ/mob_unequipped
name = "Mob Unequipped"
@@ -22,7 +22,7 @@ var/decl/observ/mob_unequipped/mob_unequipped_event = new()
// /obj/item/item: The unequipped item.
// /mob/equipped: The mob that unequipped/dropped the item.
-var/decl/observ/item_unequipped/item_unequipped_event = new()
+GLOBAL_DATUM_INIT(item_unequipped_event, /decl/observ/item_unequipped, new)
/decl/observ/item_unequipped
name = "Item Unequipped"
@@ -34,5 +34,5 @@ var/decl/observ/item_unequipped/item_unequipped_event = new()
/obj/item/dropped(var/mob/user)
..()
- mob_unequipped_event.raise_event(user, src)
- item_unequipped_event.raise_event(src, user)
+ GLOB.mob_unequipped_event.raise_event(user, src)
+ GLOB.item_unequipped_event.raise_event(src, user)
diff --git a/code/datums/outfits/jobs/cargo.dm b/code/datums/outfits/jobs/cargo.dm
index bbfe6f59f5..3423efcf33 100644
--- a/code/datums/outfits/jobs/cargo.dm
+++ b/code/datums/outfits/jobs/cargo.dm
@@ -25,5 +25,5 @@
satchel_one = /obj/item/weapon/storage/backpack/satchel/eng
id_type = /obj/item/weapon/card/id/cargo/mining
pda_type = /obj/item/device/pda/shaftminer
- backpack_contents = list(/obj/item/weapon/crowbar = 1, /obj/item/weapon/storage/bag/ore = 1)
+ backpack_contents = list(/obj/item/weapon/tool/crowbar = 1, /obj/item/weapon/storage/bag/ore = 1)
flags = OUTFIT_HAS_BACKPACK|OUTFIT_EXTENDED_SURVIVAL
diff --git a/code/datums/progressbar.dm b/code/datums/progressbar.dm
index afcb65a8c1..8d2edbeeb9 100644
--- a/code/datums/progressbar.dm
+++ b/code/datums/progressbar.dm
@@ -22,7 +22,7 @@
/datum/progressbar/Destroy()
if (client)
client.images -= bar
- qdel_null(bar)
+ QDEL_NULL(bar)
user = null
client = null
return ..()
diff --git a/code/datums/recipe.dm b/code/datums/recipe.dm
index 23af6093ef..9cddd506b6 100644
--- a/code/datums/recipe.dm
+++ b/code/datums/recipe.dm
@@ -32,7 +32,7 @@
/datum/recipe
var/list/reagents // example: = list("berryjuice" = 5) // do not list same reagent twice
- var/list/items // example: = list(/obj/item/weapon/crowbar, /obj/item/weapon/welder) // place /foo/bar before /foo
+ var/list/items // example: = list(/obj/item/weapon/tool/crowbar, /obj/item/weapon/welder) // place /foo/bar before /foo
var/list/fruit // example: = list("fruit" = 3)
var/result // example: = /obj/item/weapon/reagent_containers/food/snacks/donut/normal
var/time = 100 // 1/10 part of second
diff --git a/code/datums/repositories/ammomaterial.dm b/code/datums/repositories/ammomaterial.dm
new file mode 100644
index 0000000000..7186adbd00
--- /dev/null
+++ b/code/datums/repositories/ammomaterial.dm
@@ -0,0 +1,18 @@
+var/global/datum/repository/ammomaterial/ammo_repository = new()
+
+/datum/repository/ammomaterial
+ var/list/ammotypes
+
+/datum/repository/ammomaterial/New()
+ ammotypes = list()
+ ..()
+
+/datum/repository/ammomaterial/proc/get_materials_from_object(obj/item/ammo_casing/I)
+
+ if(!(I in ammotypes))
+ ammotypes += I
+ var/obj/item/ammo_casing/temp = new I
+ ammotypes[I] = temp.matter
+ qdel(temp)
+
+ return ammotypes[I]
\ No newline at end of file
diff --git a/code/datums/repositories/radiation.dm b/code/datums/repositories/radiation.dm
index bdf363ce6e..bbc1e01632 100644
--- a/code/datums/repositories/radiation.dm
+++ b/code/datums/repositories/radiation.dm
@@ -122,7 +122,7 @@ var/global/repository/radiation/radiation_repository = new()
/turf/simulated/wall/calc_rad_resistance()
radiation_repository.resistance_cache[src] = (length(contents) + 1)
- cached_rad_resistance = (density ? material.weight : 0)
+ cached_rad_resistance = (density ? material.weight + material.radiation_resistance : 0)
/obj
var/rad_resistance = 0 // Allow overriding rad resistance
diff --git a/code/datums/supplypacks/atmospherics.dm b/code/datums/supplypacks/atmospherics.dm
index ee53af377c..cf102f129d 100644
--- a/code/datums/supplypacks/atmospherics.dm
+++ b/code/datums/supplypacks/atmospherics.dm
@@ -4,45 +4,45 @@
*/
-/datum/supply_packs/atmos
+/datum/supply_pack/atmos
group = "Atmospherics"
-/datum/supply_packs/atmos/inflatable
+/datum/supply_pack/atmos/inflatable
name = "Inflatable barriers"
contains = list(/obj/item/weapon/storage/briefcase/inflatable = 3)
cost = 20
containertype = /obj/structure/closet/crate/engineering
containername = "Inflatable Barrier Crate"
-/datum/supply_packs/atmos/canister_empty
+/datum/supply_pack/atmos/canister_empty
name = "Empty gas canister"
cost = 7
containername = "Empty gas canister crate"
containertype = /obj/structure/largecrate
contains = list(/obj/machinery/portable_atmospherics/canister)
-/datum/supply_packs/atmos/canister_air
+/datum/supply_pack/atmos/canister_air
name = "Air canister"
cost = 10
containername = "Air canister crate"
containertype = /obj/structure/largecrate
contains = list(/obj/machinery/portable_atmospherics/canister/air)
-/datum/supply_packs/atmos/canister_oxygen
+/datum/supply_pack/atmos/canister_oxygen
name = "Oxygen canister"
cost = 15
containername = "Oxygen canister crate"
containertype = /obj/structure/largecrate
contains = list(/obj/machinery/portable_atmospherics/canister/oxygen)
-/datum/supply_packs/atmos/canister_nitrogen
+/datum/supply_pack/atmos/canister_nitrogen
name = "Nitrogen canister"
cost = 10
containername = "Nitrogen canister crate"
containertype = /obj/structure/largecrate
contains = list(/obj/machinery/portable_atmospherics/canister/nitrogen)
-/datum/supply_packs/atmos/canister_phoron
+/datum/supply_pack/atmos/canister_phoron
name = "Phoron gas canister"
cost = 60
containername = "Phoron gas canister crate"
@@ -50,7 +50,7 @@
access = access_atmospherics
contains = list(/obj/machinery/portable_atmospherics/canister/phoron)
-/datum/supply_packs/atmos/canister_sleeping_agent
+/datum/supply_pack/atmos/canister_sleeping_agent
name = "N2O gas canister"
cost = 15
containername = "N2O gas canister crate"
@@ -58,7 +58,7 @@
access = access_atmospherics
contains = list(/obj/machinery/portable_atmospherics/canister/sleeping_agent)
-/datum/supply_packs/atmos/canister_carbon_dioxide
+/datum/supply_pack/atmos/canister_carbon_dioxide
name = "Carbon dioxide gas canister"
cost = 15
containername = "CO2 canister crate"
@@ -66,7 +66,7 @@
access = access_atmospherics
contains = list(/obj/machinery/portable_atmospherics/canister/carbon_dioxide)
-/datum/supply_packs/atmos/air_dispenser
+/datum/supply_pack/atmos/air_dispenser
contains = list(/obj/machinery/pipedispenser/orderable)
name = "Pipe Dispenser"
cost = 25
@@ -74,7 +74,7 @@
containername = "Pipe Dispenser Crate"
access = access_atmospherics
-/datum/supply_packs/atmos/disposals_dispenser
+/datum/supply_pack/atmos/disposals_dispenser
contains = list(/obj/machinery/pipedispenser/disposal/orderable)
name = "Disposals Pipe Dispenser"
cost = 25
@@ -82,7 +82,7 @@
containername = "Disposal Dispenser Crate"
access = access_atmospherics
-/datum/supply_packs/atmos/internals
+/datum/supply_pack/atmos/internals
name = "Internals crate"
contains = list(
/obj/item/clothing/mask/gas = 3,
@@ -92,7 +92,7 @@
containertype = /obj/structure/closet/crate/internals
containername = "Internals crate"
-/datum/supply_packs/atmos/evacuation
+/datum/supply_pack/atmos/evacuation
name = "Emergency equipment"
contains = list(
/obj/item/weapon/storage/toolbox/emergency = 2,
diff --git a/code/datums/supplypacks/contraband.dm b/code/datums/supplypacks/contraband.dm
index 1c54c3908d..339aae9a7c 100644
--- a/code/datums/supplypacks/contraband.dm
+++ b/code/datums/supplypacks/contraband.dm
@@ -4,7 +4,7 @@
*/
-/datum/supply_packs/randomised/contraband
+/datum/supply_pack/randomised/contraband
num_contained = 5
contains = list(
/obj/item/seeds/bloodtomatoseed,
@@ -20,7 +20,7 @@
contraband = 1
group = "Supplies"
-/datum/supply_packs/security/specialops
+/datum/supply_pack/security/specialops
name = "Special Ops supplies"
contains = list(
/obj/item/weapon/storage/box/emps,
@@ -32,7 +32,7 @@
containername = "Special Ops crate"
contraband = 1
-/datum/supply_packs/supply/moghes
+/datum/supply_pack/supply/moghes
name = "Moghes imports"
contains = list(
/obj/item/weapon/reagent_containers/food/drinks/bottle/redeemersbrew = 2,
@@ -43,7 +43,7 @@
containername = "Moghes imports crate"
contraband = 1
-/datum/supply_packs/munitions/bolt_rifles_militia
+/datum/supply_pack/munitions/bolt_rifles_militia
name = "Weapon - Surplus militia rifles"
contains = list(
/obj/item/weapon/gun/projectile/shotgun/pump/rifle = 3,
@@ -54,7 +54,7 @@
containertype = /obj/structure/closet/crate/secure/weapon
containername = "Ballistic weapons crate"
-/datum/supply_packs/randomised/misc/telecrate //you get something awesome, a couple of decent things, and a few weak/filler things
+/datum/supply_pack/randomised/misc/telecrate //you get something awesome, a couple of decent things, and a few weak/filler things
name = "ERR_NULL_ENTRY" //null crate! also dream maker is hell,
num_contained = 1
contains = list(
diff --git a/code/datums/supplypacks/contraband_vr.dm b/code/datums/supplypacks/contraband_vr.dm
index 32a809b7a4..3d13903d47 100644
--- a/code/datums/supplypacks/contraband_vr.dm
+++ b/code/datums/supplypacks/contraband_vr.dm
@@ -1,4 +1,4 @@
-/datum/supply_packs/supply/stolen
+/datum/supply_pack/supply/stolen
name = "Stolen supply crate"
contains = list(/obj/item/stolenpackage = 1)
cost = 150
@@ -6,14 +6,14 @@
containername = "Stolen crate"
contraband = 1
-/datum/supply_packs/supply/wolfgirl
+/datum/supply_pack/supply/wolfgirl
name = "Wolfgirl Crate"
cost = 200 //I mean, it's a whole wolfgirl
containertype = /obj/structure/largecrate/animal/wolfgirl
containername = "Wolfgirl crate"
contraband = 1
-/datum/supply_packs/supply/catgirl
+/datum/supply_pack/supply/catgirl
name = "Catgirl Crate"
cost = 200 //I mean, it's a whole catgirl
containertype = /obj/structure/largecrate/animal/catgirl
diff --git a/code/datums/supplypacks/costumes.dm b/code/datums/supplypacks/costumes.dm
index 1ea6aa1bd2..879d5accd0 100644
--- a/code/datums/supplypacks/costumes.dm
+++ b/code/datums/supplypacks/costumes.dm
@@ -4,13 +4,13 @@
*/
-/datum/supply_packs/costumes
+/datum/supply_pack/costumes
group = "Costumes"
-/datum/supply_packs/randomised/costumes
+/datum/supply_pack/randomised/costumes
group = "Costumes"
-/datum/supply_packs/costumes/wizard
+/datum/supply_pack/costumes/wizard
name = "Wizard costume"
contains = list(
/obj/item/weapon/staff,
@@ -22,7 +22,7 @@
containertype = /obj/structure/closet/crate
containername = "Wizard costume crate"
-/datum/supply_packs/randomised/costumes/hats
+/datum/supply_pack/randomised/costumes/hats
num_contained = 4
contains = list(
/obj/item/clothing/head/collectable/chef,
@@ -51,7 +51,7 @@
containertype = /obj/structure/closet/crate
containername = "Collectable hats crate! Brought to you by Bass.inc!"
-/datum/supply_packs/randomised/costumes/costume
+/datum/supply_pack/randomised/costumes/costume
num_contained = 3
contains = list(
/obj/item/clothing/suit/pirate,
@@ -87,7 +87,7 @@
containertype = /obj/structure/closet/crate
containername = "Actor Costumes"
-/datum/supply_packs/costumes/formal_wear
+/datum/supply_pack/costumes/formal_wear
contains = list(
/obj/item/clothing/head/bowler,
/obj/item/clothing/head/that,
@@ -109,7 +109,7 @@
containertype = /obj/structure/closet
containername = "Formalwear for the best occasions."
-datum/supply_packs/costumes/witch
+datum/supply_pack/costumes/witch
name = "Witch costume"
containername = "Witch costume"
containertype = /obj/structure/closet
@@ -121,7 +121,7 @@ datum/supply_packs/costumes/witch
/obj/item/weapon/staff/broom
)
-/datum/supply_packs/randomised/costumes/costume_hats
+/datum/supply_pack/randomised/costumes/costume_hats
name = "Costume hats"
containername = "Actor hats crate"
containertype = /obj/structure/closet/crate
@@ -146,7 +146,7 @@ datum/supply_packs/costumes/witch
/obj/item/clothing/head/ushanka
)
-/datum/supply_packs/randomised/costumes/dresses
+/datum/supply_pack/randomised/costumes/dresses
name = "Womens formal dress locker"
containername = "Pretty dress locker"
containertype = /obj/structure/closet
diff --git a/code/datums/supplypacks/costumes_vr.dm b/code/datums/supplypacks/costumes_vr.dm
index fd8921ba77..080ebb5457 100644
--- a/code/datums/supplypacks/costumes_vr.dm
+++ b/code/datums/supplypacks/costumes_vr.dm
@@ -1,4 +1,4 @@
-/datum/supply_packs/costumes/xenowear_vr
+/datum/supply_pack/costumes/xenowear_vr
name = "Xenowear crate"
contains = list(
/obj/item/clothing/shoes/footwraps,
@@ -19,7 +19,7 @@
containertype = /obj/structure/closet/crate
containername = "Xenowear crate"
-/datum/supply_packs/costumes/tesh_smocks_vr
+/datum/supply_pack/costumes/tesh_smocks_vr
name = "Teshari smocks"
contains = list(
/obj/item/clothing/under/seromi/smock,
@@ -32,93 +32,93 @@
containertype = /obj/structure/closet/crate
containername = "Teshari smocks crate"
-/datum/supply_packs/randomised/costumes/tesh_coats_vr
+/datum/supply_pack/randomised/costumes/tesh_coats_vr
name = "Teshari undercoats"
num_contained = 4
contains = list(
- /obj/item/clothing/under/seromi/undercoat/blue_grey,
- /obj/item/clothing/under/seromi/undercoat/brown_grey,
- /obj/item/clothing/under/seromi/undercoat/green_grey,
- /obj/item/clothing/under/seromi/undercoat/lightgrey_grey,
- /obj/item/clothing/under/seromi/undercoat/orange,
- /obj/item/clothing/under/seromi/undercoat/orange_grey,
- /obj/item/clothing/under/seromi/undercoat/pink_grey,
- /obj/item/clothing/under/seromi/undercoat/purple_grey,
- /obj/item/clothing/under/seromi/undercoat/rainbow,
- /obj/item/clothing/under/seromi/undercoat/red_grey,
- /obj/item/clothing/under/seromi/undercoat/white_grey,
- /obj/item/clothing/under/seromi/undercoat/yellow_grey
+ /obj/item/clothing/under/seromi/undercoat/standard/blue_grey,
+ /obj/item/clothing/under/seromi/undercoat/standard/brown_grey,
+ /obj/item/clothing/under/seromi/undercoat/standard/green_grey,
+ /obj/item/clothing/under/seromi/undercoat/standard/lightgrey_grey,
+ /obj/item/clothing/under/seromi/undercoat/standard/orange,
+ /obj/item/clothing/under/seromi/undercoat/standard/orange_grey,
+ /obj/item/clothing/under/seromi/undercoat/standard/pink_grey,
+ /obj/item/clothing/under/seromi/undercoat/standard/purple_grey,
+ /obj/item/clothing/under/seromi/undercoat/standard/rainbow,
+ /obj/item/clothing/under/seromi/undercoat/standard/red_grey,
+ /obj/item/clothing/under/seromi/undercoat/standard/white_grey,
+ /obj/item/clothing/under/seromi/undercoat/standard/yellow_grey
)
cost = 20
containertype = /obj/structure/closet/crate
containername = "Teshari undercoats crate"
-/datum/supply_packs/randomised/costumes/tesh_coats_b_vr
+/datum/supply_pack/randomised/costumes/tesh_coats_b_vr
name = "Teshari undercoats (black)"
num_contained = 4
contains = list(
- /obj/item/clothing/under/seromi/undercoat/black,
- /obj/item/clothing/under/seromi/undercoat/black_blue,
- /obj/item/clothing/under/seromi/undercoat/black_brown,
- /obj/item/clothing/under/seromi/undercoat/black_green,
- /obj/item/clothing/under/seromi/undercoat/black_grey,
- /obj/item/clothing/under/seromi/undercoat/black_lightgrey,
- /obj/item/clothing/under/seromi/undercoat/black_midgrey,
- /obj/item/clothing/under/seromi/undercoat/black_orange,
- /obj/item/clothing/under/seromi/undercoat/black_pink,
- /obj/item/clothing/under/seromi/undercoat/black_purple,
- /obj/item/clothing/under/seromi/undercoat/black_red,
- /obj/item/clothing/under/seromi/undercoat/black_white,
- /obj/item/clothing/under/seromi/undercoat/black_yellow
+ /obj/item/clothing/under/seromi/undercoat/standard/black,
+ /obj/item/clothing/under/seromi/undercoat/standard/black_blue,
+ /obj/item/clothing/under/seromi/undercoat/standard/black_brown,
+ /obj/item/clothing/under/seromi/undercoat/standard/black_green,
+ /obj/item/clothing/under/seromi/undercoat/standard/black_grey,
+ /obj/item/clothing/under/seromi/undercoat/standard/black_lightgrey,
+ /obj/item/clothing/under/seromi/undercoat/standard/black_midgrey,
+ /obj/item/clothing/under/seromi/undercoat/standard/black_orange,
+ /obj/item/clothing/under/seromi/undercoat/standard/black_pink,
+ /obj/item/clothing/under/seromi/undercoat/standard/black_purple,
+ /obj/item/clothing/under/seromi/undercoat/standard/black_red,
+ /obj/item/clothing/under/seromi/undercoat/standard/black_white,
+ /obj/item/clothing/under/seromi/undercoat/standard/black_yellow
)
cost = 20
containertype = /obj/structure/closet/crate
containername = "Teshari undercoats crate"
-/datum/supply_packs/randomised/costumes/tesh_cloaks_vr
+/datum/supply_pack/randomised/costumes/tesh_cloaks_vr
name = "Teshari cloaks"
num_contained = 4
contains = list(
- /obj/item/clothing/suit/storage/seromi/cloak/blue_grey,
- /obj/item/clothing/suit/storage/seromi/cloak/brown_grey,
- /obj/item/clothing/suit/storage/seromi/cloak/green_grey,
- /obj/item/clothing/suit/storage/seromi/cloak/lightgrey_grey,
- /obj/item/clothing/suit/storage/seromi/cloak/orange,
- /obj/item/clothing/suit/storage/seromi/cloak/orange_grey,
- /obj/item/clothing/suit/storage/seromi/cloak/pink_grey,
- /obj/item/clothing/suit/storage/seromi/cloak/purple_grey,
- /obj/item/clothing/suit/storage/seromi/cloak/rainbow,
- /obj/item/clothing/suit/storage/seromi/cloak/red_grey,
- /obj/item/clothing/suit/storage/seromi/cloak/white_grey,
- /obj/item/clothing/suit/storage/seromi/cloak/yellow_grey
+ /obj/item/clothing/suit/storage/seromi/cloak/standard/blue_grey,
+ /obj/item/clothing/suit/storage/seromi/cloak/standard/brown_grey,
+ /obj/item/clothing/suit/storage/seromi/cloak/standard/green_grey,
+ /obj/item/clothing/suit/storage/seromi/cloak/standard/lightgrey_grey,
+ /obj/item/clothing/suit/storage/seromi/cloak/standard/orange,
+ /obj/item/clothing/suit/storage/seromi/cloak/standard/orange_grey,
+ /obj/item/clothing/suit/storage/seromi/cloak/standard/pink_grey,
+ /obj/item/clothing/suit/storage/seromi/cloak/standard/purple_grey,
+ /obj/item/clothing/suit/storage/seromi/cloak/standard/rainbow,
+ /obj/item/clothing/suit/storage/seromi/cloak/standard/red_grey,
+ /obj/item/clothing/suit/storage/seromi/cloak/standard/white_grey,
+ /obj/item/clothing/suit/storage/seromi/cloak/standard/yellow_grey
)
cost = 40
containertype = /obj/structure/closet/crate
containername = "Teshari cloaks crate"
-/datum/supply_packs/randomised/costumes/tesh_cloaks_b_vr
+/datum/supply_pack/randomised/costumes/tesh_cloaks_b_vr
name = "Teshari cloaks (black)"
num_contained = 4
contains = list(
- /obj/item/clothing/suit/storage/seromi/cloak/black,
- /obj/item/clothing/suit/storage/seromi/cloak/black_blue,
- /obj/item/clothing/suit/storage/seromi/cloak/black_brown,
- /obj/item/clothing/suit/storage/seromi/cloak/black_green,
- /obj/item/clothing/suit/storage/seromi/cloak/black_grey,
- /obj/item/clothing/suit/storage/seromi/cloak/black_lightgrey,
- /obj/item/clothing/suit/storage/seromi/cloak/black_midgrey,
- /obj/item/clothing/suit/storage/seromi/cloak/black_orange,
- /obj/item/clothing/suit/storage/seromi/cloak/black_pink,
- /obj/item/clothing/suit/storage/seromi/cloak/black_purple,
- /obj/item/clothing/suit/storage/seromi/cloak/black_red,
- /obj/item/clothing/suit/storage/seromi/cloak/black_white,
- /obj/item/clothing/suit/storage/seromi/cloak/black_yellow
+ /obj/item/clothing/suit/storage/seromi/cloak/standard/black,
+ /obj/item/clothing/suit/storage/seromi/cloak/standard/black_blue,
+ /obj/item/clothing/suit/storage/seromi/cloak/standard/black_brown,
+ /obj/item/clothing/suit/storage/seromi/cloak/standard/black_green,
+ /obj/item/clothing/suit/storage/seromi/cloak/standard/black_grey,
+ /obj/item/clothing/suit/storage/seromi/cloak/standard/black_lightgrey,
+ /obj/item/clothing/suit/storage/seromi/cloak/standard/black_midgrey,
+ /obj/item/clothing/suit/storage/seromi/cloak/standard/black_orange,
+ /obj/item/clothing/suit/storage/seromi/cloak/standard/black_pink,
+ /obj/item/clothing/suit/storage/seromi/cloak/standard/black_purple,
+ /obj/item/clothing/suit/storage/seromi/cloak/standard/black_red,
+ /obj/item/clothing/suit/storage/seromi/cloak/standard/black_white,
+ /obj/item/clothing/suit/storage/seromi/cloak/standard/black_yellow
)
cost = 40
containertype = /obj/structure/closet/crate
containername = "Teshari cloaks crate"
-/datum/supply_packs/costumes/utility_vr
+/datum/supply_pack/costumes/utility_vr
name = "Utility uniforms"
contains = list(
/obj/item/clothing/under/utility,
@@ -129,7 +129,7 @@
containertype = /obj/structure/closet/crate
containername = "Utility uniforms crate"
-/datum/supply_packs/costumes/skirts_vr
+/datum/supply_pack/costumes/skirts_vr
name = "Skirts crate"
contains = list(
/obj/item/clothing/under/skirt,
@@ -147,7 +147,7 @@
containertype = /obj/structure/closet/crate
containername = "Skirts crate"
-/datum/supply_packs/costumes/varsity_vr
+/datum/supply_pack/costumes/varsity_vr
name = "Varsity jackets"
contains = list(
/obj/item/clothing/suit/varsity,
@@ -161,7 +161,7 @@
containertype = /obj/structure/closet/crate
containername = "Varsity jackets crate"
-/datum/supply_packs/randomised/costumes/leathergear_vr
+/datum/supply_pack/randomised/costumes/leathergear_vr
name = "Leather gear"
num_contained = 5
contains = list(
@@ -192,7 +192,7 @@
containertype = /obj/structure/closet/crate
containername = "Leather gear crate"
-/datum/supply_packs/costumes/eyewear_vr
+/datum/supply_pack/costumes/eyewear_vr
name = "Eyewear crate"
contains = list(
/obj/item/clothing/glasses/eyepatch,
@@ -211,7 +211,7 @@
containertype = /obj/structure/closet/crate
containername = "Eyewear crate"
-/datum/supply_packs/randomised/costumes/gloves_vr
+/datum/supply_pack/randomised/costumes/gloves_vr
name = "Gloves crate"
num_contained = 4
contains = list(
@@ -235,7 +235,7 @@
containertype = /obj/structure/closet/crate
containername = "Gloves crate"
-/datum/supply_packs/randomised/costumes/boots_vr
+/datum/supply_pack/randomised/costumes/boots_vr
name = "Boots crate"
num_contained = 3
contains = list(
@@ -252,7 +252,7 @@
containertype = /obj/structure/closet/crate
containername = "Boots crate"
-/datum/supply_packs/costumes/taurbags
+/datum/supply_pack/costumes/taurbags
name = "Saddlebags crate"
contains = list(
/obj/item/weapon/storage/backpack/saddlebag_common,
diff --git a/code/datums/supplypacks/engineering.dm b/code/datums/supplypacks/engineering.dm
index efa5c454f2..e3b9a148cc 100644
--- a/code/datums/supplypacks/engineering.dm
+++ b/code/datums/supplypacks/engineering.dm
@@ -4,66 +4,66 @@
*/
-/datum/supply_packs/eng
+/datum/supply_pack/eng
group = "Engineering"
-/datum/supply_packs/eng/lightbulbs
+/datum/supply_pack/eng/lightbulbs
name = "Replacement lights"
contains = list(/obj/item/weapon/storage/box/lights/mixed = 3)
cost = 10
containertype = /obj/structure/closet/crate
containername = "Replacement lights"
-/datum/supply_packs/eng/smescoil
+/datum/supply_pack/eng/smescoil
name = "Superconducting Magnetic Coil"
contains = list(/obj/item/weapon/smes_coil)
cost = 75
containertype = /obj/structure/closet/crate/engineering
containername = "Superconducting Magnetic Coil crate"
-/datum/supply_packs/eng/shield_capacitor
+/datum/supply_pack/eng/shield_capacitor
name = "Shield Capacitor"
contains = list(/obj/machinery/shield_capacitor)
cost = 20
containertype = /obj/structure/closet/crate/engineering
containername = "shield capacitor crate"
-/datum/supply_packs/eng/shield_capacitor/advanced
+/datum/supply_pack/eng/shield_capacitor/advanced
name = "Advanced Shield Capacitor"
contains = list(/obj/machinery/shield_capacitor/advanced)
cost = 30
containertype = /obj/structure/closet/crate/engineering
containername = "advanced shield capacitor crate"
-/datum/supply_packs/eng/bubble_shield
+/datum/supply_pack/eng/bubble_shield
name = "Bubble Shield Generator"
contains = list(/obj/machinery/shield_gen)
cost = 40
containertype = /obj/structure/closet/crate/engineering
containername = "shield bubble generator crate"
-/datum/supply_packs/eng/bubble_shield/advanced
+/datum/supply_pack/eng/bubble_shield/advanced
name = "Advanced Bubble Shield Generator"
contains = list(/obj/machinery/shield_gen/advanced)
cost = 60
containertype = /obj/structure/closet/crate/engineering
containername = "advanced bubble shield generator crate"
-/datum/supply_packs/eng/hull_shield
+/datum/supply_pack/eng/hull_shield
name = "Hull Shield Generator"
contains = list(/obj/machinery/shield_gen/external)
cost = 80
containertype = /obj/structure/closet/crate/engineering
containername = "shield hull generator crate"
-/datum/supply_packs/eng/hull_shield/advanced
+/datum/supply_pack/eng/hull_shield/advanced
name = "Advanced Hull Shield Generator"
contains = list(/obj/machinery/shield_gen/external/advanced)
cost = 120
containertype = /obj/structure/closet/crate/engineering
containername = "advanced hull shield generator crate"
-/datum/supply_packs/eng/electrical
+/datum/supply_pack/eng/electrical
name = "Electrical maintenance crate"
contains = list(
/obj/item/weapon/storage/toolbox/electrical = 2,
@@ -75,7 +75,7 @@
containertype = /obj/structure/closet/crate/engineering/electrical
containername = "Electrical maintenance crate"
-/datum/supply_packs/eng/e_welders
+/datum/supply_pack/eng/e_welders
name = "Electric welder crate"
contains = list(
/obj/item/weapon/weldingtool/electric = 3
@@ -84,7 +84,7 @@
containertype = /obj/structure/closet/crate/engineering/electrical
containername = "Electric welder crate"
-/datum/supply_packs/eng/mechanical
+/datum/supply_pack/eng/mechanical
name = "Mechanical maintenance crate"
contains = list(
/obj/item/weapon/storage/belt/utility/full = 3,
@@ -96,14 +96,14 @@
containertype = /obj/structure/closet/crate/engineering
containername = "Mechanical maintenance crate"
-/datum/supply_packs/eng/fueltank
+/datum/supply_pack/eng/fueltank
name = "Fuel tank crate"
contains = list(/obj/structure/reagent_dispensers/fueltank)
cost = 10
containertype = /obj/structure/largecrate
containername = "fuel tank crate"
-/datum/supply_packs/eng/solar
+/datum/supply_pack/eng/solar
name = "Solar Pack crate"
contains = list(
/obj/item/solar_assembly = 21,
@@ -115,7 +115,7 @@
containertype = /obj/structure/closet/crate/engineering
containername = "Solar pack crate"
-/datum/supply_packs/eng/engine
+/datum/supply_pack/eng/engine
name = "Emitter crate"
contains = list(/obj/machinery/power/emitter = 2)
cost = 10
@@ -123,27 +123,27 @@
containername = "Emitter crate"
access = access_ce
-/datum/supply_packs/eng/engine/field_gen
+/datum/supply_pack/eng/engine/field_gen
name = "Field Generator crate"
contains = list(/obj/machinery/field_generator = 2)
containertype = /obj/structure/closet/crate/secure/engineering
containername = "Field Generator crate"
access = access_ce
-/datum/supply_packs/eng/engine/sing_gen
+/datum/supply_pack/eng/engine/sing_gen
name = "Singularity Generator crate"
contains = list(/obj/machinery/the_singularitygen)
containertype = /obj/structure/closet/crate/secure/engineering
containername = "Singularity Generator crate"
access = access_ce
-/datum/supply_packs/eng/engine/collector
+/datum/supply_pack/eng/engine/collector
name = "Collector crate"
contains = list(/obj/machinery/power/rad_collector = 3)
containertype = /obj/structure/closet/crate/secure/engineering
containername = "Collector crate"
-/datum/supply_packs/eng/engine/PA
+/datum/supply_pack/eng/engine/PA
name = "Particle Accelerator crate"
cost = 40
contains = list(
@@ -159,7 +159,7 @@
containername = "Particle Accelerator crate"
access = access_ce
-/datum/supply_packs/eng/shield_gen
+/datum/supply_pack/eng/shield_gen
contains = list(/obj/item/weapon/circuitboard/shield_gen)
name = "Bubble shield generator circuitry"
cost = 30
@@ -167,7 +167,7 @@
containername = "bubble shield generator circuitry crate"
access = access_ce
-/datum/supply_packs/eng/shield_gen_ex
+/datum/supply_pack/eng/shield_gen_ex
contains = list(/obj/item/weapon/circuitboard/shield_gen_ex)
name = "Hull shield generator circuitry"
cost = 30
@@ -175,7 +175,7 @@
containername = "hull shield generator circuitry crate"
access = access_ce
-/datum/supply_packs/eng/shield_cap
+/datum/supply_pack/eng/shield_cap
contains = list(/obj/item/weapon/circuitboard/shield_cap)
name = "Bubble shield capacitor circuitry"
cost = 30
@@ -183,7 +183,7 @@
containername = "shield capacitor circuitry crate"
access = access_ce
-/datum/supply_packs/eng/smbig
+/datum/supply_pack/eng/smbig
name = "Supermatter Core"
contains = list(/obj/machinery/power/supermatter)
cost = 150
@@ -191,7 +191,7 @@
containername = "Supermatter crate (CAUTION)"
access = access_ce
-/datum/supply_packs/eng/teg
+/datum/supply_pack/eng/teg
contains = list(/obj/machinery/power/generator)
name = "Mark I Thermoelectric Generator"
cost = 40
@@ -199,7 +199,7 @@
containername = "Mk1 TEG crate"
access = access_engine
-/datum/supply_packs/eng/circulator
+/datum/supply_pack/eng/circulator
contains = list(/obj/machinery/atmospherics/binary/circulator)
name = "Binary atmospheric circulator"
cost = 20
@@ -207,7 +207,7 @@
containername = "Atmospheric circulator crate"
access = access_engine
-/datum/supply_packs/eng/radsuit
+/datum/supply_pack/eng/radsuit
contains = list(
/obj/item/clothing/suit/radiation = 3,
/obj/item/clothing/head/radiation = 3
@@ -217,7 +217,7 @@
containertype = /obj/structure/closet/radiation
containername = "Radiation suit locker"
-/datum/supply_packs/eng/pacman_parts
+/datum/supply_pack/eng/pacman_parts
name = "P.A.C.M.A.N. portable generator parts"
cost = 25
containername = "P.A.C.M.A.N. Portable Generator Construction Kit"
@@ -230,7 +230,7 @@
/obj/item/weapon/circuitboard/pacman
)
-/datum/supply_packs/eng/super_pacman_parts
+/datum/supply_pack/eng/super_pacman_parts
name = "Super P.A.C.M.A.N. portable generator parts"
cost = 35
containername = "Super P.A.C.M.A.N. portable generator construction kit"
@@ -243,7 +243,7 @@
/obj/item/weapon/circuitboard/pacman/super
)
-/datum/supply_packs/eng/fusion_core
+/datum/supply_pack/eng/fusion_core
name = "R-UST Mk. 8 Tokamak fusion core crate"
cost = 50
containername = "R-UST Mk. 8 Tokamak Fusion Core crate"
@@ -255,7 +255,7 @@
/obj/item/weapon/circuitboard/fusion_core
)
-/datum/supply_packs/eng/fusion_fuel_injector
+/datum/supply_pack/eng/fusion_fuel_injector
name = "R-UST Mk. 8 fuel injector crate"
cost = 30
containername = "R-UST Mk. 8 fuel injector crate"
@@ -267,7 +267,7 @@
/obj/item/weapon/circuitboard/fusion_injector
)
-/datum/supply_packs/eng/gyrotron
+/datum/supply_pack/eng/gyrotron
name = "Gyrotron crate"
cost = 15
containername = "Gyrotron Crate"
@@ -278,14 +278,14 @@
/obj/item/weapon/circuitboard/gyrotron
)
-/datum/supply_packs/eng/fusion_fuel_compressor
+/datum/supply_pack/eng/fusion_fuel_compressor
name = "Fusion Fuel Compressor circuitry crate"
cost = 10
containername = "Fusion Fuel Compressor circuitry crate"
containertype = /obj/structure/closet/crate/engineering
contains = list(/obj/item/weapon/circuitboard/fusion_fuel_compressor)
-/datum/supply_packs/eng/tritium
+/datum/supply_pack/eng/tritium
name = "Tritium crate"
cost = 75
containername = "Tritium crate"
diff --git a/code/datums/supplypacks/engineering_vr.dm b/code/datums/supplypacks/engineering_vr.dm
index 28faf96434..e334268426 100644
--- a/code/datums/supplypacks/engineering_vr.dm
+++ b/code/datums/supplypacks/engineering_vr.dm
@@ -1,24 +1,24 @@
-/datum/supply_packs/eng/thermoregulator
+/datum/supply_pack/eng/thermoregulator
contains = list(/obj/machinery/power/thermoregulator)
name = "Thermal Regulator"
cost = 30
containertype = /obj/structure/closet/crate/large
containername = "thermal regulator crate"
-/datum/supply_packs/eng/radsuit
+/datum/supply_pack/eng/radsuit
contains = list(
/obj/item/clothing/suit/radiation = 3,
/obj/item/clothing/head/radiation = 3
)
-/datum/supply_packs/eng/algae
+/datum/supply_pack/eng/algae
contains = list(/obj/item/stack/material/algae/ten)
name = "Algae Sheets (10)"
cost = 20
containertype = /obj/structure/closet/crate
containername = "algae sheets crate"
-/datum/supply_packs/eng/engine/tesla_gen
+/datum/supply_pack/eng/engine/tesla_gen
name = "Tesla Generator crate"
contains = list(/obj/machinery/the_singularitygen/tesla)
containertype = /obj/structure/closet/crate/secure/engineering
diff --git a/code/datums/supplypacks/hospitality.dm b/code/datums/supplypacks/hospitality.dm
index f3de751f23..5d663d05db 100644
--- a/code/datums/supplypacks/hospitality.dm
+++ b/code/datums/supplypacks/hospitality.dm
@@ -4,10 +4,10 @@
*/
-/datum/supply_packs/hospitality
+/datum/supply_pack/hospitality
group = "Hospitality"
-/datum/supply_packs/hospitality/party
+/datum/supply_pack/hospitality/party
name = "Party equipment"
contains = list(
/obj/item/weapon/storage/box/mixedglasses = 2,
@@ -26,7 +26,7 @@
containertype = /obj/structure/closet/crate
containername = "Party equipment"
-/datum/supply_packs/hospitality/barsupplies
+/datum/supply_pack/hospitality/barsupplies
name = "Bar supplies"
contains = list(
/obj/item/weapon/storage/box/glasses/cocktail,
@@ -46,10 +46,10 @@
containertype = /obj/structure/closet/crate
containername = "crate of bar supplies"
-/datum/supply_packs/randomised/hospitality/
+/datum/supply_pack/randomised/hospitality/
group = "Hospitality"
-/datum/supply_packs/randomised/hospitality/pizza
+/datum/supply_pack/randomised/hospitality/pizza
num_contained = 5
contains = list(
/obj/item/pizzabox/margherita,
@@ -62,7 +62,7 @@
containertype = /obj/structure/closet/crate/freezer
containername = "Pizza crate"
-/datum/supply_packs/hospitality/gifts
+/datum/supply_pack/hospitality/gifts
name = "Gift crate"
contains = list(
/obj/item/toy/bouquet = 3,
diff --git a/code/datums/supplypacks/hospitality_vr.dm b/code/datums/supplypacks/hospitality_vr.dm
index a8fb518233..642032d46f 100644
--- a/code/datums/supplypacks/hospitality_vr.dm
+++ b/code/datums/supplypacks/hospitality_vr.dm
@@ -1,4 +1,4 @@
-/datum/supply_packs/randomised/hospitality/burgers_vr
+/datum/supply_pack/randomised/hospitality/burgers_vr
num_contained = 5
contains = list(
/obj/item/weapon/reagent_containers/food/snacks/bigbiteburger,
@@ -12,7 +12,7 @@
containertype = /obj/structure/closet/crate/freezer
containername = "Burger crate"
/*
-/datum/supply_packs/randomised/hospitality/bakery_vr
+/datum/supply_pack/randomised/hospitality/bakery_vr
num_contained = 5
contains = list(
/obj/item/weapon/reagent_containers/food/snacks/baguette,
@@ -38,7 +38,7 @@
containertype = /obj/structure/closet/crate/freezer
containername = "Bakery products crate"
-/datum/supply_packs/randomised/hospitality/cakes_vr
+/datum/supply_pack/randomised/hospitality/cakes_vr
num_contained = 2
contains = list(
/obj/item/weapon/reagent_containers/food/snacks/sliceable/applecake,
@@ -56,7 +56,7 @@
containertype = /obj/structure/closet/crate/freezer
containername = "Cake crate"
-/datum/supply_packs/randomised/hospitality/mexican_vr
+/datum/supply_pack/randomised/hospitality/mexican_vr
num_contained = 5
contains = list(
/obj/item/weapon/reagent_containers/food/snacks/cheeseburrito,
@@ -69,7 +69,7 @@
containertype = /obj/structure/closet/crate/freezer
containername = "Mexican takeout crate"
*/
-/datum/supply_packs/randomised/hospitality/asian_vr
+/datum/supply_pack/randomised/hospitality/asian_vr
num_contained = 5
contains = list(
/obj/item/weapon/reagent_containers/food/snacks/generalschicken,
@@ -80,5 +80,5 @@
containertype = /obj/structure/closet/crate/freezer
containername = "Chinese takeout crate"
-/datum/supply_packs/randomised/hospitality/pizza
+/datum/supply_pack/randomised/hospitality/pizza
cost = 50
\ No newline at end of file
diff --git a/code/datums/supplypacks/hydroponics.dm b/code/datums/supplypacks/hydroponics.dm
index af9f513a95..9ee6a80532 100644
--- a/code/datums/supplypacks/hydroponics.dm
+++ b/code/datums/supplypacks/hydroponics.dm
@@ -4,45 +4,45 @@
*/
-/datum/supply_packs/hydro
+/datum/supply_pack/hydro
group = "Hydroponics"
-/datum/supply_packs/hydro/monkey
+/datum/supply_pack/hydro/monkey
name = "Monkey crate"
contains = list (/obj/item/weapon/storage/box/monkeycubes)
cost = 20
containertype = /obj/structure/closet/crate/freezer
containername = "Monkey crate"
-/datum/supply_packs/hydro/farwa
+/datum/supply_pack/hydro/farwa
name = "Farwa crate"
contains = list (/obj/item/weapon/storage/box/monkeycubes/farwacubes)
cost = 20
containertype = /obj/structure/closet/crate/freezer
containername = "Farwa crate"
-/datum/supply_packs/hydro/neara
+/datum/supply_pack/hydro/neara
name = "Neaera crate"
contains = list (/obj/item/weapon/storage/box/monkeycubes/neaeracubes)
cost = 20
containertype = /obj/structure/closet/crate/freezer
containername = "Neaera crate"
-/datum/supply_packs/hydro/stok
+/datum/supply_pack/hydro/stok
name = "Stok crate"
contains = list (/obj/item/weapon/storage/box/monkeycubes/stokcubes)
cost = 20
containertype = /obj/structure/closet/crate/freezer
containername = "Stok crate"
-/datum/supply_packs/hydro/lisa
+/datum/supply_pack/hydro/lisa
name = "Corgi Crate"
contains = list()
cost = 50
containertype = /obj/structure/largecrate/animal/corgi
containername = "Corgi Crate"
-/datum/supply_packs/hydro/hydroponics
+/datum/supply_pack/hydro/hydroponics
name = "Hydroponics Supply Crate"
contains = list(
/obj/item/weapon/reagent_containers/spray/plantbgone = 4,
@@ -60,28 +60,28 @@
containername = "Hydroponics crate"
access = access_hydroponics
-/datum/supply_packs/hydro/cow
+/datum/supply_pack/hydro/cow
name = "Cow crate"
cost = 25
containertype = /obj/structure/largecrate/animal/cow
containername = "Cow crate"
access = access_hydroponics
-/datum/supply_packs/hydro/goat
+/datum/supply_pack/hydro/goat
name = "Goat crate"
cost = 25
containertype = /obj/structure/largecrate/animal/goat
containername = "Goat crate"
access = access_hydroponics
-/datum/supply_packs/hydro/chicken
+/datum/supply_pack/hydro/chicken
name = "Chicken crate"
cost = 25
containertype = /obj/structure/largecrate/animal/chick
containername = "Chicken crate"
access = access_hydroponics
-/datum/supply_packs/hydro/seeds
+/datum/supply_pack/hydro/seeds
name = "Seeds crate"
contains = list(
/obj/item/seeds/chiliseed,
@@ -107,7 +107,7 @@
containername = "Seeds crate"
access = access_hydroponics
-/datum/supply_packs/hydro/weedcontrol
+/datum/supply_pack/hydro/weedcontrol
name = "Weed control crate"
contains = list(
/obj/item/weapon/material/knife/machete/hatchet = 2,
@@ -121,14 +121,14 @@
containername = "Weed control crate"
access = access_hydroponics
-/datum/supply_packs/hydro/watertank
+/datum/supply_pack/hydro/watertank
name = "Water tank crate"
contains = list(/obj/structure/reagent_dispensers/watertank)
cost = 10
containertype = /obj/structure/largecrate
containername = "water tank crate"
-/datum/supply_packs/hydro/bee_keeper
+/datum/supply_pack/hydro/bee_keeper
name = "Beekeeping crate"
contains = list(
/obj/item/beehive_assembly,
@@ -141,7 +141,7 @@
containername = "Beekeeping crate"
access = access_hydroponics
-/datum/supply_packs/hydro/tray
+/datum/supply_pack/hydro/tray
name = "Empty hydroponics trays"
cost = 50
containertype = /obj/structure/closet/crate/hydroponics
diff --git a/code/datums/supplypacks/hydroponics_vr.dm b/code/datums/supplypacks/hydroponics_vr.dm
index 541fd1721d..9ccbdf2d9e 100644
--- a/code/datums/supplypacks/hydroponics_vr.dm
+++ b/code/datums/supplypacks/hydroponics_vr.dm
@@ -1,39 +1,39 @@
-/datum/supply_packs/hydro/birds
+/datum/supply_pack/hydro/birds
name = "Birds Crate"
cost = 200 //You're getting 22 birds. Of course it's going to be a lot!
containertype = /obj/structure/largecrate/birds
containername = "Bird crate"
access = access_hydroponics
-/datum/supply_packs/hydro/sobaka
+/datum/supply_pack/hydro/sobaka
name = "Sobaka crate"
contains = list (/obj/item/weapon/storage/box/monkeycubes/sobakacubes)
cost = 20
containertype = /obj/structure/closet/crate/freezer
containername = "Sobaka crate"
-/datum/supply_packs/hydro/saru
+/datum/supply_pack/hydro/saru
name = "Saru crate"
contains = list (/obj/item/weapon/storage/box/monkeycubes/sarucubes)
cost = 20
containertype = /obj/structure/closet/crate/freezer
containername = "Saru crate"
-/datum/supply_packs/hydro/sparra
+/datum/supply_pack/hydro/sparra
name = "Sparra crate"
contains = list (/obj/item/weapon/storage/box/monkeycubes/sparracubes)
cost = 20
containertype = /obj/structure/closet/crate/freezer
containername = "Sparra crate"
-/datum/supply_packs/hydro/wolpin
+/datum/supply_pack/hydro/wolpin
name = "Wolpin crate"
contains = list (/obj/item/weapon/storage/box/monkeycubes/wolpincubes)
cost = 20
containertype = /obj/structure/closet/crate/freezer
containername = "Wolpin crate"
-
-/datum/supply_packs/hydro/fennec
+
+/datum/supply_pack/hydro/fennec
name = "Fennec crate"
cost = 60 //considering a corgi crate is 50, and you get two fennecs
containertype = /obj/structure/largecrate/animal/fennec
diff --git a/code/datums/supplypacks/materials.dm b/code/datums/supplypacks/materials.dm
index 4c5ddedf47..cd799a235b 100644
--- a/code/datums/supplypacks/materials.dm
+++ b/code/datums/supplypacks/materials.dm
@@ -4,45 +4,45 @@
*/
-/datum/supply_packs/materials
+/datum/supply_pack/materials
group = "Materials"
-/datum/supply_packs/materials/metal50
+/datum/supply_pack/materials/metal50
name = "50 metal sheets"
contains = list(/obj/fiftyspawner/steel)
cost = 10
containertype = /obj/structure/closet/crate
containername = "Metal sheets crate"
-/datum/supply_packs/materials/glass50
+/datum/supply_pack/materials/glass50
name = "50 glass sheets"
contains = list(/obj/fiftyspawner/glass)
cost = 10
containertype = /obj/structure/closet/crate
containername = "Glass sheets crate"
-/datum/supply_packs/materials/wood50
+/datum/supply_pack/materials/wood50
name = "50 wooden planks"
contains = list(/obj/fiftyspawner/wood)
cost = 10
containertype = /obj/structure/closet/crate
containername = "Wooden planks crate"
-/datum/supply_packs/materials/plastic50
+/datum/supply_pack/materials/plastic50
name = "50 plastic sheets"
contains = list(/obj/fiftyspawner/plastic)
cost = 10
containertype = /obj/structure/closet/crate
containername = "Plastic sheets crate"
-/datum/supply_packs/materials/cardboard_sheets
+/datum/supply_pack/materials/cardboard_sheets
contains = list(/obj/fiftyspawner/cardboard)
name = "50 cardboard sheets"
cost = 10
containertype = /obj/structure/closet/crate
containername = "Cardboard sheets crate"
-/datum/supply_packs/materials/carpet
+/datum/supply_pack/materials/carpet
name = "Imported carpet"
containertype = /obj/structure/closet/crate
containername = "Imported carpet crate"
@@ -53,7 +53,7 @@
)
-/datum/supply_packs/misc/linoleum
+/datum/supply_pack/misc/linoleum
name = "Linoleum"
containertype = /obj/structure/closet/crate
containername = "Linoleum crate"
diff --git a/code/datums/supplypacks/medical.dm b/code/datums/supplypacks/medical.dm
index 2c2e26d97d..555df731c4 100644
--- a/code/datums/supplypacks/medical.dm
+++ b/code/datums/supplypacks/medical.dm
@@ -4,10 +4,10 @@
*/
-/datum/supply_packs/med
+/datum/supply_pack/med
group = "Medical"
-/datum/supply_packs/med/medical
+/datum/supply_pack/med/medical
name = "Medical crate"
contains = list(
/obj/item/weapon/storage/firstaid/regular,
@@ -25,28 +25,28 @@
containertype = /obj/structure/closet/crate/medical
containername = "Medical crate"
-/datum/supply_packs/med/bloodpack
+/datum/supply_pack/med/bloodpack
name = "BloodPack crate"
contains = list(/obj/item/weapon/storage/box/bloodpacks = 3)
cost = 10
containertype = /obj/structure/closet/crate/medical
containername = "BloodPack crate"
-/datum/supply_packs/med/bodybag
+/datum/supply_pack/med/bodybag
name = "Body bag crate"
contains = list(/obj/item/weapon/storage/box/bodybags = 3)
cost = 10
containertype = /obj/structure/closet/crate/medical
containername = "Body bag crate"
-/datum/supply_packs/med/cryobag
+/datum/supply_pack/med/cryobag
name = "Stasis bag crate"
contains = list(/obj/item/bodybag/cryobag = 3)
cost = 40
containertype = /obj/structure/closet/crate/medical
containername = "Stasis bag crate"
-/datum/supply_packs/med/surgery
+/datum/supply_pack/med/surgery
name = "Surgery crate"
contains = list(
/obj/item/weapon/surgical/cautery,
@@ -66,7 +66,7 @@
containername = "Surgery crate"
access = access_medical
-/datum/supply_packs/med/deathalarm
+/datum/supply_pack/med/deathalarm
name = "Death Alarm crate"
contains = list(
/obj/item/weapon/storage/box/cdeathalarm_kit,
@@ -77,7 +77,7 @@
containername = "Death Alarm crate"
access = access_medical
-/datum/supply_packs/med/clotting
+/datum/supply_pack/med/clotting
name = "Clotting Medicine crate"
contains = list(
/obj/item/weapon/storage/firstaid/clotting
@@ -87,7 +87,7 @@
containername = "Clotting Medicine crate"
access = access_medical
-/datum/supply_packs/med/sterile
+/datum/supply_pack/med/sterile
name = "Sterile equipment crate"
contains = list(
/obj/item/clothing/under/rank/medical/scrubs/green = 2,
@@ -100,7 +100,7 @@
containertype = "/obj/structure/closet/crate"
containername = "Sterile equipment crate"
-/datum/supply_packs/med/extragear
+/datum/supply_pack/med/extragear
name = "Medical surplus equipment"
contains = list(
/obj/item/weapon/storage/belt/medical = 3,
@@ -113,7 +113,7 @@
containername = "Medical surplus equipment"
access = access_medical
-/datum/supply_packs/med/cmogear
+/datum/supply_pack/med/cmogear
name = "Chief medical officer equipment"
contains = list(
/obj/item/weapon/storage/belt/medical,
@@ -137,7 +137,7 @@
containername = "Chief medical officer equipment"
access = access_cmo
-/datum/supply_packs/med/doctorgear
+/datum/supply_pack/med/doctorgear
name = "Medical Doctor equipment"
contains = list(
/obj/item/weapon/storage/belt/medical,
@@ -160,7 +160,7 @@
containername = "Medical Doctor equipment"
access = access_medical_equip
-/datum/supply_packs/med/chemistgear
+/datum/supply_pack/med/chemistgear
name = "Chemist equipment"
contains = list(
/obj/item/weapon/storage/box/beakers,
@@ -183,7 +183,7 @@
containername = "Chemist equipment"
access = access_chemistry
-/datum/supply_packs/med/paramedicgear
+/datum/supply_pack/med/paramedicgear
name = "Paramedic equipment"
contains = list(
/obj/item/weapon/storage/belt/medical/emt,
@@ -211,7 +211,7 @@
containername = "Paramedic equipment"
access = access_medical_equip
-/datum/supply_packs/med/psychiatristgear
+/datum/supply_pack/med/psychiatristgear
name = "Psychiatrist equipment"
contains = list(
/obj/item/clothing/under/rank/psych,
@@ -230,7 +230,7 @@
containername = "Psychiatrist equipment"
access = access_psychiatrist
-/datum/supply_packs/med/medicalscrubs
+/datum/supply_pack/med/medicalscrubs
name = "Medical scrubs"
contains = list(
/obj/item/clothing/shoes/white = 3,,
@@ -251,7 +251,7 @@
containername = "Medical scrubs crate"
access = access_medical_equip
-/datum/supply_packs/med/autopsy
+/datum/supply_pack/med/autopsy
name = "Autopsy equipment"
contains = list(
/obj/item/weapon/folder/white,
@@ -268,7 +268,7 @@
containername = "Autopsy equipment crate"
access = access_morgue
-/datum/supply_packs/med/medicaluniforms
+/datum/supply_pack/med/medicaluniforms
name = "Medical uniforms"
contains = list(
/obj/item/clothing/shoes/white = 3,
@@ -295,7 +295,7 @@
containername = "Medical uniform crate"
access = access_medical_equip
-/datum/supply_packs/med/medicalbiosuits
+/datum/supply_pack/med/medicalbiosuits
name = "Medical biohazard gear"
contains = list(
/obj/item/clothing/head/bio_hood = 3,
@@ -313,7 +313,7 @@
containername = "Medical biohazard equipment"
access = access_medical_equip
-/datum/supply_packs/med/portablefreezers
+/datum/supply_pack/med/portablefreezers
name = "Portable freezers crate"
contains = list(/obj/item/weapon/storage/box/freezer = 7)
cost = 25
@@ -321,7 +321,7 @@
containername = "Portable freezers"
access = access_medical_equip
-/datum/supply_packs/med/virus
+/datum/supply_pack/med/virus
name = "Virus sample crate"
contains = list(/obj/item/weapon/virusdish/random = 4)
cost = 25
@@ -329,7 +329,7 @@
containername = "Virus sample crate"
access = access_cmo
-/datum/supply_packs/med/defib
+/datum/supply_pack/med/defib
name = "Defibrillator crate"
contains = list(/obj/item/device/defib_kit = 2)
cost = 30
diff --git a/code/datums/supplypacks/medical_vr.dm b/code/datums/supplypacks/medical_vr.dm
index 989e89297b..2cc35ad600 100644
--- a/code/datums/supplypacks/medical_vr.dm
+++ b/code/datums/supplypacks/medical_vr.dm
@@ -1,4 +1,4 @@
-/datum/supply_packs/med/medicalbiosuits
+/datum/supply_pack/med/medicalbiosuits
contains = list(
/obj/item/clothing/head/bio_hood/scientist = 3,
/obj/item/clothing/suit/bio_suit/scientist = 3,
@@ -14,7 +14,7 @@
)
cost = 40
-/datum/supply_packs/med/virologybiosuits
+/datum/supply_pack/med/virologybiosuits
name = "Virology biohazard gear"
contains = list(
/obj/item/clothing/suit/bio_suit/virology = 3,
diff --git a/code/datums/supplypacks/misc.dm b/code/datums/supplypacks/misc.dm
index 225e29335f..bc7687ab78 100644
--- a/code/datums/supplypacks/misc.dm
+++ b/code/datums/supplypacks/misc.dm
@@ -4,14 +4,14 @@
*/
-/datum/supply_packs/misc
+/datum/supply_pack/misc
group = "Miscellaneous"
-/datum/supply_packs/randomised/misc
+/datum/supply_pack/randomised/misc
group = "Miscellaneous"
-/datum/supply_packs/randomised/misc/card_packs
+/datum/supply_pack/randomised/misc/card_packs
num_contained = 5
contains = list(
/obj/item/weapon/pack/cardemon,
@@ -23,14 +23,14 @@
containertype = /obj/structure/closet/crate
containername = "cards crate"
-/datum/supply_packs/misc/eftpos
+/datum/supply_pack/misc/eftpos
contains = list(/obj/item/device/eftpos)
name = "EFTPOS scanner"
cost = 10
containertype = /obj/structure/closet/crate
containername = "EFTPOS crate"
-/datum/supply_packs/misc/chaplaingear
+/datum/supply_pack/misc/chaplaingear
name = "Chaplain equipment"
contains = list(
/obj/item/clothing/under/rank/chaplain,
@@ -48,14 +48,14 @@
containertype = "/obj/structure/closet/crate"
containername = "Chaplain equipment crate"
-/datum/supply_packs/misc/hoverpod
+/datum/supply_pack/misc/hoverpod
name = "Hoverpod Shipment"
contains = list()
cost = 80
containertype = /obj/structure/largecrate/hoverpod
containername = "Hoverpod Crate"
-/datum/supply_packs/randomised/misc/webbing
+/datum/supply_pack/randomised/misc/webbing
name = "Webbing crate"
num_contained = 4
contains = list(
@@ -71,7 +71,7 @@
containertype = "/obj/structure/closet/crate"
containername = "Webbing crate"
-/datum/supply_packs/misc/holoplant
+/datum/supply_pack/misc/holoplant
name = "Holoplant Pot"
contains = list(/obj/machinery/holoplant/shipped)
cost = 15
diff --git a/code/datums/supplypacks/misc_vr.dm b/code/datums/supplypacks/misc_vr.dm
index 6ff285ef99..072c4001fa 100644
--- a/code/datums/supplypacks/misc_vr.dm
+++ b/code/datums/supplypacks/misc_vr.dm
@@ -1,5 +1,5 @@
-/datum/supply_packs/misc/beltminer
+/datum/supply_pack/misc/beltminer
name = "Belt-miner gear crate"
contains = list(
/obj/item/weapon/gun/energy/particle = 2,
@@ -13,7 +13,7 @@
containername = "Belt-miner gear crate"
access = access_mining
-/datum/supply_packs/misc/eva_rig
+/datum/supply_pack/misc/eva_rig
name = "eva hardsuit (empty)"
contains = list(
/obj/item/weapon/rig/eva = 1
@@ -23,7 +23,7 @@
containername = "eva hardsuit crate"
access = access_mining
-/datum/supply_packs/misc/mining_rig
+/datum/supply_pack/misc/mining_rig
name = "industrial hardsuit (empty)"
contains = list(
/obj/item/weapon/rig/industrial = 1
diff --git a/code/datums/supplypacks/munitions.dm b/code/datums/supplypacks/munitions.dm
index eed77bbf2f..1e5bbb4d45 100644
--- a/code/datums/supplypacks/munitions.dm
+++ b/code/datums/supplypacks/munitions.dm
@@ -3,13 +3,13 @@
* related to weapons live.
*/
-/datum/supply_packs/munitions
+/datum/supply_pack/munitions
group = "Munitions"
-/datum/supply_packs/randomised/munitions
+/datum/supply_pack/randomised/munitions
group = "Munitions"
/* VOREStation Removal - What? This crate costs 40... the crate with just two eguns costs 50... what??? This crate is also like "the armory" and has OFFICER access?
-/datum/supply_packs/munitions/weapons
+/datum/supply_pack/munitions/weapons
name = "Weapons - Security basic equipment"
contains = list(
/obj/item/device/flash = 2,
@@ -24,7 +24,7 @@
containername = "Security equipment crate"
access = access_security*/
-/datum/supply_packs/munitions/egunpistol
+/datum/supply_pack/munitions/egunpistol
name = "Weapons - Energy sidearms"
contains = list(/obj/item/weapon/gun/energy/gun = 2)
cost = 50
@@ -32,7 +32,7 @@
containername = "Energy sidearms crate"
access = access_armory //VOREStation Edit - Guns are for the armory.
-/datum/supply_packs/munitions/flareguns
+/datum/supply_pack/munitions/flareguns
name = "Weapons - Flare guns"
contains = list(
/obj/item/weapon/gun/projectile/sec/flash,
@@ -45,7 +45,7 @@
containername = "Flare gun crate"
access = access_armory //VOREStation Edit - Guns are for the armory.
-/datum/supply_packs/munitions/eweapons
+/datum/supply_pack/munitions/eweapons
name = "Weapons - Experimental weapons crate"
contains = list(
/obj/item/weapon/gun/energy/xray = 2,
@@ -55,7 +55,7 @@
containername = "Experimental weapons crate"
access = access_armory
-/datum/supply_packs/munitions/energyweapons
+/datum/supply_pack/munitions/energyweapons
name = "Weapons - Laser rifle crate"
contains = list(/obj/item/weapon/gun/energy/laser = 2) //VOREStation Edit - Made to be consistent with the energy guns crate.
cost = 50
@@ -63,7 +63,7 @@
containername = "Energy weapons crate"
access = access_armory
-/datum/supply_packs/munitions/shotgun
+/datum/supply_pack/munitions/shotgun
name = "Weapons - Shotgun crate"
contains = list(
/obj/item/weapon/storage/box/shotgunammo,
@@ -75,7 +75,7 @@
containername = "Shotgun crate"
access = access_armory
/* VOREStation edit -- This is a bad idea. -- So is this.
-/datum/supply_packs/munitions/erifle
+/datum/supply_pack/munitions/erifle
name = "Weapons - Energy marksman"
contains = list(/obj/item/weapon/gun/energy/sniperrifle = 2)
cost = 100
@@ -83,7 +83,7 @@
containername = "Energy marksman crate"
access = access_armory
-/datum/supply_packs/munitions/burstlaser
+/datum/supply_pack/munitions/burstlaser
name = "Weapons - Burst laser"
contains = list(/obj/item/weapon/gun/energy/gun/burst = 2)
cost = 50
@@ -91,7 +91,7 @@
containername = "Burst laser crate"
access = access_armory
*/
-/datum/supply_packs/munitions/ionweapons
+/datum/supply_pack/munitions/ionweapons
name = "Weapons - Electromagnetic Rifles"
contains = list(
/obj/item/weapon/gun/energy/ionrifle = 2,
@@ -102,7 +102,7 @@
containername = "Electromagnetic weapons crate"
access = access_armory
-/datum/supply_packs/munitions/ionpistols
+/datum/supply_pack/munitions/ionpistols
name = "Weapons - Electromagnetic pistols"
contains = list(
/obj/item/weapon/gun/energy/ionrifle/pistol = 2,
@@ -113,7 +113,7 @@
containername = "Electromagnetic weapons crate"
access = access_armory
-/datum/supply_packs/munitions/bsmg
+/datum/supply_pack/munitions/bsmg
name = "Weapons - Ballistic SMGs"
contains = list(/obj/item/weapon/gun/projectile/automatic/wt550 = 2)
cost = 50
@@ -121,7 +121,7 @@
containername = "Ballistic weapon crate"
access = access_armory
-/datum/supply_packs/munitions/brifle
+/datum/supply_pack/munitions/brifle
name = "Weapons - Ballistic Rifles"
contains = list(/obj/item/weapon/gun/projectile/automatic/z8 = 2)
cost = 80
@@ -129,7 +129,7 @@
containername = "Ballistic weapon crate"
access = access_armory
-/datum/supply_packs/munitions/bolt_rifles_competitive
+/datum/supply_pack/munitions/bolt_rifles_competitive
name = "Weapons - Competitive shooting rifles"
contains = list(
/obj/item/device/assembly/timer,
@@ -144,7 +144,7 @@
containername = "Ballistic Weapons crate"
access = access_armory //VOREStation Edit - Guns are for the armory.
-/datum/supply_packs/munitions/shotgunammo
+/datum/supply_pack/munitions/shotgunammo
name = "Ammunition - Shotgun shells"
contains = list(
/obj/item/weapon/storage/box/shotgunammo = 2,
@@ -155,7 +155,7 @@
containername = "Ballistic ammunition crate"
access = access_armory
-/datum/supply_packs/munitions/beanbagammo
+/datum/supply_pack/munitions/beanbagammo
name = "Ammunition - Beanbag shells"
contains = list(/obj/item/weapon/storage/box/beanbags = 3)
cost = 25
@@ -163,7 +163,7 @@
containername = "Ballistic ammunition crate"
access = access_armory //VOREStation Edit - Guns are for the armory.
-/datum/supply_packs/munitions/bsmgammo
+/datum/supply_pack/munitions/bsmgammo
name = "Ammunition - 9mm top mounted lethal"
contains = list(/obj/item/ammo_magazine/m9mmt = 6)
cost = 25
@@ -171,7 +171,7 @@
containername = "Ballistic ammunition crate"
access = access_armory
-/datum/supply_packs/munitions/bsmgammorubber
+/datum/supply_pack/munitions/bsmgammorubber
name = "Ammunition - 9mm top mounted rubber"
contains = list(/obj/item/ammo_magazine/m9mmt/rubber = 6)
cost = 25
@@ -179,7 +179,7 @@
containername = "Ballistic ammunition crate"
access = access_security
-/datum/supply_packs/munitions/brifleammo
+/datum/supply_pack/munitions/brifleammo
name = "Ammunition - 7.62mm lethal"
contains = list(/obj/item/ammo_magazine/m762 = 6)
cost = 25
@@ -187,7 +187,7 @@
containername = "Ballistic ammunition crate"
access = access_armory
-/datum/supply_packs/munitions/pcellammo
+/datum/supply_pack/munitions/pcellammo
name = "Ammunition - Power cell"
contains = list(/obj/item/weapon/cell/device/weapon = 3)
cost = 50
diff --git a/code/datums/supplypacks/munitions_vr.dm b/code/datums/supplypacks/munitions_vr.dm
index 01a5becdf9..e6629435bf 100644
--- a/code/datums/supplypacks/munitions_vr.dm
+++ b/code/datums/supplypacks/munitions_vr.dm
@@ -1,4 +1,4 @@
-/datum/supply_packs/munitions/expeditionguns
+/datum/supply_pack/munitions/expeditionguns
name = "Frontier phaser (station-locked) crate"
contains = list(
/obj/item/weapon/gun/energy/frontier/locked = 2,
diff --git a/code/datums/supplypacks/recreation.dm b/code/datums/supplypacks/recreation.dm
index 7f801ea1b3..684ef962f4 100644
--- a/code/datums/supplypacks/recreation.dm
+++ b/code/datums/supplypacks/recreation.dm
@@ -4,14 +4,14 @@
*/
-/datum/supply_packs/recreation
+/datum/supply_pack/recreation
group = "Recreation"
-/datum/supply_packs/randomised/recreation
+/datum/supply_pack/randomised/recreation
group = "Recreation"
access = access_security
-/datum/supply_packs/recreation/foam_weapons
+/datum/supply_pack/recreation/foam_weapons
name = "Foam Weapon Crate"
contains = list(
/obj/item/weapon/material/sword/foam = 2,
@@ -23,7 +23,7 @@
containertype = /obj/structure/closet/crate
containername = "foam weapon crate"
-/datum/supply_packs/recreation/lasertag
+/datum/supply_pack/recreation/lasertag
name = "Lasertag equipment"
contains = list(
/obj/item/weapon/gun/energy/lasertag/red,
@@ -35,7 +35,7 @@
containername = "Lasertag Closet"
cost = 10
-/datum/supply_packs/recreation/artscrafts
+/datum/supply_pack/recreation/artscrafts
name = "Arts and Crafts supplies"
contains = list(
/obj/item/weapon/storage/fancy/crayons,
@@ -58,7 +58,7 @@
containertype = "/obj/structure/closet/crate"
containername = "Arts and Crafts crate"
-/datum/supply_packs/recreation/painters
+/datum/supply_pack/recreation/painters
name = "Station Painting Supplies"
cost = 10
containername = "station painting supplies crate"
diff --git a/code/datums/supplypacks/recreation_vr.dm b/code/datums/supplypacks/recreation_vr.dm
index cf12b4815b..007f3d2d88 100644
--- a/code/datums/supplypacks/recreation_vr.dm
+++ b/code/datums/supplypacks/recreation_vr.dm
@@ -1,5 +1,5 @@
/*
-/datum/supply_packs/recreation/rover
+/datum/supply_pack/recreation/rover
name = "NT Humvee"
contains = list(
/obj/vehicle/train/rover/engine
@@ -8,7 +8,7 @@
containername = "NT Humvee Crate"
cost = 100
*/
-/datum/supply_packs/recreation/restraints
+/datum/supply_pack/recreation/restraints
name = "Recreational Restraints"
contains = list(
/obj/item/clothing/mask/muzzle,
@@ -27,7 +27,7 @@
containername = "Restraints crate"
cost = 30
-/datum/supply_packs/recreation/wolfgirl_cosplay_crate
+/datum/supply_pack/recreation/wolfgirl_cosplay_crate
name = "Wolfgirl Cosplay Crate"
contains = list(
/obj/item/clothing/head/fluff/awoo = 1,
@@ -40,7 +40,7 @@
containertype = /obj/structure/closet/crate
containername = "wolfgirl cosplay crate"
-/datum/supply_packs/randomised/recreation/figures_vr
+/datum/supply_pack/randomised/recreation/figures_vr
name = "Action figures crate"
num_contained = 5
contains = list(
@@ -50,7 +50,7 @@
containertype = /obj/structure/closet/crate
containername = "Action figures crate"
-/datum/supply_packs/recreation/characters_vr
+/datum/supply_pack/recreation/characters_vr
name = "Tabletop miniatures"
contains = list(
/obj/item/weapon/storage/box/characters
@@ -59,7 +59,7 @@
containername = "Tabletop miniatures crate"
cost = 50
-/datum/supply_packs/randomised/recreation/plushies_vr
+/datum/supply_pack/randomised/recreation/plushies_vr
name = "Plushies crate"
num_contained = 3
contains = list(
diff --git a/code/datums/supplypacks/robotics.dm b/code/datums/supplypacks/robotics.dm
index d9f20c5aa6..1c1eb7f2bb 100644
--- a/code/datums/supplypacks/robotics.dm
+++ b/code/datums/supplypacks/robotics.dm
@@ -4,14 +4,14 @@
*/
-/datum/supply_packs/robotics
+/datum/supply_pack/robotics
group = "Robotics"
-/datum/supply_packs/randomised/robotics
+/datum/supply_pack/randomised/robotics
group = "Robotics"
access = access_robotics
-/datum/supply_packs/robotics/robotics_assembly
+/datum/supply_pack/robotics/robotics_assembly
name = "Robotics assembly crate"
contains = list(
/obj/item/device/assembly/prox_sensor = 3,
@@ -24,7 +24,7 @@
containername = "Robotics assembly"
access = access_robotics
-/*/datum/supply_packs/robotics/robolimbs_basic
+/*/datum/supply_pack/robotics/robolimbs_basic
name = "Basic robolimb blueprints"
contains = list(
/obj/item/weapon/disk/limb/morpheus,
@@ -35,7 +35,7 @@
containername = "Robolimb blueprints (basic)"
access = access_robotics
-/datum/supply_packs/robotics/robolimbs_adv
+/datum/supply_pack/robotics/robolimbs_adv
name = "All robolimb blueprints"
contains = list(
/obj/item/weapon/disk/limb/bishop,
@@ -52,7 +52,7 @@
access = access_robotics
*/
-/datum/supply_packs/robotics/robolimbs/morpheus
+/datum/supply_pack/robotics/robolimbs/morpheus
name = "Morpheus robolimb blueprints"
contains = list(/obj/item/weapon/disk/limb/morpheus)
cost = 20
@@ -60,7 +60,7 @@
containername = "Robolimb blueprints (Morpheus)"
access = access_robotics
-/datum/supply_packs/robotics/robolimbs/cybersolutions
+/datum/supply_pack/robotics/robolimbs/cybersolutions
name = "Cyber Solutions robolimb blueprints"
contains = list(/obj/item/weapon/disk/limb/cybersolutions)
cost = 20
@@ -68,7 +68,7 @@
containername = "Robolimb blueprints (Cyber Solutions)"
access = access_robotics
-/datum/supply_packs/robotics/robolimbs/xion
+/datum/supply_pack/robotics/robolimbs/xion
name = "Xion robolimb blueprints"
contains = list(/obj/item/weapon/disk/limb/xion)
cost = 20
@@ -76,7 +76,7 @@
containername = "Robolimb blueprints (Xion)"
access = access_robotics
-/datum/supply_packs/robotics/robolimbs/grayson
+/datum/supply_pack/robotics/robolimbs/grayson
name = "Grayson robolimb blueprints"
contains = list(/obj/item/weapon/disk/limb/grayson)
cost = 30
@@ -84,7 +84,7 @@
containername = "Robolimb blueprints (Grayson)"
access = access_robotics
-/datum/supply_packs/robotics/robolimbs/hephaestus
+/datum/supply_pack/robotics/robolimbs/hephaestus
name = "Hephaestus robolimb blueprints"
contains = list(/obj/item/weapon/disk/limb/hephaestus)
cost = 35
@@ -92,7 +92,7 @@
containername = "Robolimb blueprints (Hephaestus)"
access = access_robotics
-/datum/supply_packs/robotics/robolimbs/wardtakahashi
+/datum/supply_pack/robotics/robolimbs/wardtakahashi
name = "Ward-Takahashi robolimb blueprints"
contains = list(/obj/item/weapon/disk/limb/wardtakahashi)
cost = 35
@@ -100,7 +100,7 @@
containername = "Robolimb blueprints (Ward-Takahashi)"
access = access_robotics
-/datum/supply_packs/robotics/robolimbs/zenghu
+/datum/supply_pack/robotics/robolimbs/zenghu
name = "Zeng Hu robolimb blueprints"
contains = list(/obj/item/weapon/disk/limb/zenghu)
cost = 35
@@ -108,7 +108,7 @@
containername = "Robolimb blueprints (Zeng Hu)"
access = access_robotics
-/datum/supply_packs/robotics/robolimbs/bishop
+/datum/supply_pack/robotics/robolimbs/bishop
name = "Bishop robolimb blueprints"
contains = list(/obj/item/weapon/disk/limb/bishop)
cost = 70
@@ -116,7 +116,7 @@
containername = "Robolimb blueprints (Bishop)"
access = access_robotics
-/datum/supply_packs/robotics/mecha_ripley
+/datum/supply_pack/robotics/mecha_ripley
name = "Circuit Crate (\"Ripley\" APLU)"
contains = list(
/obj/item/weapon/book/manual/ripley_build_and_repair,
@@ -128,7 +128,7 @@
containername = "APLU \"Ripley\" Circuit Crate"
access = access_robotics
-/datum/supply_packs/robotics/mecha_odysseus
+/datum/supply_pack/robotics/mecha_odysseus
name = "Circuit Crate (\"Odysseus\")"
contains = list(
/obj/item/weapon/circuitboard/mecha/odysseus/peripherals,
@@ -139,7 +139,7 @@
containername = "\"Odysseus\" Circuit Crate"
access = access_robotics
-/datum/supply_packs/randomised/robotics/exosuit_mod
+/datum/supply_pack/randomised/robotics/exosuit_mod
num_contained = 1
contains = list(
/obj/item/device/kit/paint/ripley,
@@ -152,7 +152,7 @@
containertype = /obj/structure/closet/crate/science
containername = "heavy crate"
-/datum/supply_packs/randomised/robotics/exosuit_mod/durand
+/datum/supply_pack/randomised/robotics/exosuit_mod/durand
contains = list(
/obj/item/device/kit/paint/durand,
/obj/item/device/kit/paint/durand/seraph,
@@ -160,7 +160,7 @@
)
name = "Random Durand exosuit modkit"
-/datum/supply_packs/randomised/robotics/exosuit_mod/gygax
+/datum/supply_pack/randomised/robotics/exosuit_mod/gygax
contains = list(
/obj/item/device/kit/paint/gygax,
/obj/item/device/kit/paint/gygax/darkgygax,
@@ -168,7 +168,7 @@
)
name = "Random Gygax exosuit modkit"
-/datum/supply_packs/robotics/jumper_cables
+/datum/supply_pack/robotics/jumper_cables
name = "Jumper kit crate"
contains = list(
/obj/item/device/defib_kit/jumper_kit = 2
@@ -176,4 +176,25 @@
cost = 30
containertype = /obj/structure/closet/crate/secure/science
containername = "Jumper kit crate"
- access = access_robotics
\ No newline at end of file
+ access = access_robotics
+
+/datum/supply_pack/robotics/bike
+ name = "Spacebike Crate"
+ contains = list()
+ cost = 350
+ containertype = /obj/structure/largecrate/vehicle/bike
+ containername = "Spacebike Crate"
+
+/datum/supply_pack/robotics/quadbike
+ name = "ATV Crate"
+ contains = list()
+ cost = 300
+ containertype = /obj/structure/largecrate/vehicle/quadbike
+ containername = "ATV Crate"
+
+/datum/supply_pack/robotics/quadtrailer
+ name = "ATV Trailer Crate"
+ contains = list()
+ cost = 250
+ containertype = /obj/structure/largecrate/vehicle/quadtrailer
+ containername = "ATV Trailer Crate"
diff --git a/code/datums/supplypacks/robotics_vr.dm b/code/datums/supplypacks/robotics_vr.dm
index 9ee67ebb9d..5e06210079 100644
--- a/code/datums/supplypacks/robotics_vr.dm
+++ b/code/datums/supplypacks/robotics_vr.dm
@@ -1,4 +1,4 @@
-/datum/supply_packs/robotics/mecha_gopher
+/datum/supply_pack/robotics/mecha_gopher
name = "Circuit Crate (\"Gopher\" APLU)"
contains = list(
/obj/item/weapon/circuitboard/mecha/gopher/main,
@@ -8,8 +8,8 @@
containertype = /obj/structure/closet/crate/secure/science
containername = "APLU \"Gopher\" Circuit Crate"
access = access_robotics
-
-/datum/supply_packs/robotics/mecha_polecat
+
+/datum/supply_pack/robotics/mecha_polecat
name = "Circuit Crate (\"Polecat\" APLU)"
contains = list(
/obj/item/weapon/circuitboard/mecha/polecat/main,
@@ -21,7 +21,7 @@
containername = "APLU \"Polecat\" Circuit Crate"
access = access_robotics
-/datum/supply_packs/robotics/mecha_weasel
+/datum/supply_pack/robotics/mecha_weasel
name = "Circuit Crate (\"Weasel\" APLU)"
contains = list(
/obj/item/weapon/circuitboard/mecha/weasel/main,
@@ -33,7 +33,7 @@
containername = "APLU \"Weasel\" Circuit Crate"
access = access_robotics
-/datum/supply_packs/robotics/some_robolimbs
+/datum/supply_pack/robotics/some_robolimbs
name = "Basic Robolimb Blueprints"
contains = list(
/obj/item/weapon/disk/limb/morpheus,
@@ -45,7 +45,7 @@
containername = "Basic Robolimb Blueprint Crate"
access = access_robotics
-/datum/supply_packs/robotics/all_robolimbs
+/datum/supply_pack/robotics/all_robolimbs
name = "Advanced Robolimb Blueprints"
contains = list(
/obj/item/weapon/disk/limb/bishop,
diff --git a/code/datums/supplypacks/science.dm b/code/datums/supplypacks/science.dm
index d88718555a..83407c2866 100644
--- a/code/datums/supplypacks/science.dm
+++ b/code/datums/supplypacks/science.dm
@@ -2,25 +2,17 @@
* Here is where any supply packs
* related to security tasks live
*/
-/datum/supply_packs/sci
+/datum/supply_pack/sci
group = "Science"
-/datum/supply_packs/sci/virus
- name = "Virus sample crate"
- contains = list(/obj/item/weapon/virusdish/random = 4)
- cost = 25
- containertype = "/obj/structure/closet/crate/secure"
- containername = "Virus sample crate"
- access = access_cmo
-
-/datum/supply_packs/sci/coolanttank
+/datum/supply_pack/sci/coolanttank
name = "Coolant tank crate"
contains = list(/obj/structure/reagent_dispensers/coolanttank)
cost = 15
containertype = /obj/structure/largecrate
containername = "coolant tank crate"
-/datum/supply_packs/sci/phoron
+/datum/supply_pack/sci/phoron
name = "Phoron research crate"
contains = list(
/obj/item/weapon/tank/phoron = 3,
@@ -36,7 +28,7 @@
containername = "Phoron assembly crate"
access = access_tox_storage
-/datum/supply_packs/sci/exoticseeds
+/datum/supply_pack/sci/exoticseeds
name = "Exotic seeds crate"
contains = list(
/obj/item/seeds/replicapod = 2,
@@ -51,14 +43,14 @@
containername = "Exotic Seeds crate"
access = access_hydroponics
-/datum/supply_packs/sci/integrated_circuit_printer
+/datum/supply_pack/sci/integrated_circuit_printer
name = "Integrated circuit printer"
contains = list(/obj/item/device/integrated_circuit_printer = 2)
cost = 15
containertype = /obj/structure/closet/crate
containername = "Integrated circuit crate"
-/datum/supply_packs/sci/integrated_circuit_printer_upgrade
+/datum/supply_pack/sci/integrated_circuit_printer_upgrade
name = "Integrated circuit printer upgrade - advanced designs"
contains = list(/obj/item/weapon/disk/integrated_circuit/upgrade/advanced)
cost = 30
diff --git a/code/datums/supplypacks/science_vr.dm b/code/datums/supplypacks/science_vr.dm
index 4dbb5b847e..0f507ce8e0 100644
--- a/code/datums/supplypacks/science_vr.dm
+++ b/code/datums/supplypacks/science_vr.dm
@@ -1,5 +1,5 @@
/*
-/datum/supply_packs/sci/dune_buggy
+/datum/supply_pack/sci/dune_buggy
name = "Exploration Dune Buggy"
contains = list(
/obj/vehicle/train/rover/engine/dunebuggy
@@ -8,14 +8,14 @@
containertype = /obj/structure/largecrate
containername = "Exploration Dune Buggy Crate"
*/
-/datum/supply_packs/sci/pred
+/datum/supply_pack/sci/pred
name = "Dangerous Predator crate"
cost = 40
containertype = /obj/structure/largecrate/animal/pred
containername = "Dangerous Predator crate"
access = access_xenobiology
-/datum/supply_packs/sci/pred_doom
+/datum/supply_pack/sci/pred_doom
name = "EXTREMELY Dangerous Predator crate"
cost = 200
containertype = /obj/structure/largecrate/animal/dangerous
@@ -23,14 +23,14 @@
access = access_xenobiology
contraband = 1
-/datum/supply_packs/sci/otie
+/datum/supply_pack/sci/otie
name = "VARMAcorp adoptable reject (Dangerous!)"
cost = 100
containertype = /obj/structure/largecrate/animal/otie
containername = "VARMAcorp adoptable reject (Dangerous!)"
access = access_xenobiology
-/datum/supply_packs/sci/phoronotie
+/datum/supply_pack/sci/phoronotie
name = "VARMAcorp adaptive beta subject (Experimental)"
cost = 200
containertype = /obj/structure/largecrate/animal/otie/phoron
diff --git a/code/datums/supplypacks/security.dm b/code/datums/supplypacks/security.dm
index 4472ef4005..40698def5d 100644
--- a/code/datums/supplypacks/security.dm
+++ b/code/datums/supplypacks/security.dm
@@ -4,15 +4,15 @@
*/
-/datum/supply_packs/security
+/datum/supply_pack/security
group = "Security"
access = access_security
-/datum/supply_packs/randomised/security
+/datum/supply_pack/randomised/security
group = "Security"
access = access_security
-/datum/supply_packs/randomised/security/armor
+/datum/supply_pack/randomised/security/armor
name = "Armor - Security armor"
num_contained = 5
contains = list(
@@ -33,7 +33,7 @@
containername = "Armor crate"
access_armory //VOREStation Add - Armor is for the armory.
-/datum/supply_packs/security/riot_gear
+/datum/supply_pack/security/riot_gear
name = "Gear - Riot"
contains = list(
/obj/item/weapon/melee/baton = 3,
@@ -48,7 +48,7 @@
containername = "Riot gear crate"
access = access_armory
-/datum/supply_packs/security/riot_armor
+/datum/supply_pack/security/riot_armor
name = "Armor - Riot"
contains = list(
/obj/item/clothing/head/helmet/riot,
@@ -61,7 +61,7 @@
containername = "Riot armor crate"
access = access_armory
-/datum/supply_packs/security/ablative_armor
+/datum/supply_pack/security/ablative_armor
name = "Armor - Ablative"
contains = list(
/obj/item/clothing/head/helmet/laserproof,
@@ -74,7 +74,7 @@
containername = "Ablative armor crate"
access = access_armory
-/datum/supply_packs/security/bullet_resistant_armor
+/datum/supply_pack/security/bullet_resistant_armor
name = "Armor - Ballistic"
contains = list(
/obj/item/clothing/head/helmet/bulletproof,
@@ -87,7 +87,7 @@
containername = "Ballistic armor crate"
access = access_armory
/* VOREStation Removal - Howabout no ERT armor being orderable?
-/datum/supply_packs/security/combat_armor
+/datum/supply_pack/security/combat_armor
name = "Armor - Combat"
contains = list(
/obj/item/clothing/head/helmet/combat,
@@ -100,7 +100,7 @@
containername = "Combat armor crate"
access = access_armory
-/datum/supply_packs/security/tactical
+/datum/supply_pack/security/tactical
name = "Armor - Tactical"
containertype = /obj/structure/closet/crate/secure/gear
containername = "Tactical armor crate"
@@ -125,7 +125,7 @@
/obj/item/clothing/gloves/black
)
*/
-/datum/supply_packs/security/securitybarriers
+/datum/supply_pack/security/securitybarriers
name = "Misc - Security Barriers"
contains = list(/obj/machinery/deployable/barrier = 4)
cost = 20
@@ -133,7 +133,7 @@
containername = "Security barrier crate"
access = null
-/datum/supply_packs/security/securityshieldgen
+/datum/supply_pack/security/securityshieldgen
name = "Misc - Wall shield generators"
contains = list(/obj/machinery/shieldwallgen = 4)
cost = 20
@@ -141,7 +141,7 @@
containername = "Wall shield generators crate"
access = access_teleporter
-/datum/supply_packs/randomised/security/holster
+/datum/supply_pack/randomised/security/holster
name = "Gear - Holsters"
num_contained = 4
contains = list(
@@ -154,7 +154,7 @@
containertype = /obj/structure/closet/crate
containername = "Holster crate"
-/datum/supply_packs/security/extragear
+/datum/supply_pack/security/extragear
name = "Gear - Security surplus equipment"
contains = list(
/obj/item/weapon/storage/belt/security = 3,
@@ -166,7 +166,7 @@
containertype = /obj/structure/closet/crate
containername = "Security surplus equipment"
-/datum/supply_packs/security/detectivegear
+/datum/supply_pack/security/detectivegear
name = "Forensic - Investigation equipment"
contains = list(
/obj/item/weapon/storage/box/evidence = 2,
@@ -193,7 +193,7 @@
containername = "Forensic equipment"
access = access_forensics_lockers
-/datum/supply_packs/security/detectiveclothes
+/datum/supply_pack/security/detectiveclothes
name = "Forensic - Investigation apparel"
contains = list(
/obj/item/clothing/under/det/black = 2,
@@ -215,7 +215,7 @@
containername = "Investigation clothing"
access = access_forensics_lockers
-/datum/supply_packs/security/officergear
+/datum/supply_pack/security/officergear
name = "Gear - Officer equipment"
contains = list(
/obj/item/clothing/suit/storage/vest/officer,
@@ -245,7 +245,7 @@
containername = "Officer equipment"
access = access_brig
-/datum/supply_packs/security/wardengear
+/datum/supply_pack/security/wardengear
name = "Gear - Warden equipment"
contains = list(
/obj/item/clothing/suit/storage/vest/warden,
@@ -273,7 +273,7 @@
containername = "Warden equipment"
access = access_armory
-/datum/supply_packs/security/headofsecgear
+/datum/supply_pack/security/headofsecgear
name = "Gear - Head of security equipment"
contains = list(
/obj/item/clothing/head/helmet/HoS,
@@ -299,7 +299,7 @@
containername = "Head of security equipment"
access = access_hos
-/datum/supply_packs/security/securityclothing
+/datum/supply_pack/security/securityclothing
name = "Misc - Security uniform red"
contains = list(
/obj/item/weapon/storage/backpack/satchel/sec = 2,
@@ -317,7 +317,7 @@
containertype = /obj/structure/closet/crate/secure
containername = "Security uniform crate"
-/datum/supply_packs/security/navybluesecurityclothing
+/datum/supply_pack/security/navybluesecurityclothing
name = "Misc - Security uniform navy blue"
contains = list(
/obj/item/weapon/storage/backpack/satchel/sec = 2,
@@ -338,7 +338,7 @@
containertype = /obj/structure/closet/crate/secure
containername = "Navy blue security uniform crate"
-/datum/supply_packs/security/corporatesecurityclothing
+/datum/supply_pack/security/corporatesecurityclothing
name = "Misc - Security uniform corporate"
contains = list(
/obj/item/weapon/storage/backpack/satchel/sec = 2,
@@ -358,7 +358,7 @@
containertype = /obj/structure/closet/crate/secure
containername = "Corporate security uniform crate"
-/datum/supply_packs/security/biosuit
+/datum/supply_pack/security/biosuit
name = "Gear - Security biohazard gear"
contains = list(
/obj/item/clothing/head/bio_hood/security = 3,
diff --git a/code/datums/supplypacks/security_vr.dm b/code/datums/supplypacks/security_vr.dm
index 4c77b42e06..9c1ea33d43 100644
--- a/code/datums/supplypacks/security_vr.dm
+++ b/code/datums/supplypacks/security_vr.dm
@@ -1,4 +1,4 @@
-/datum/supply_packs/security/guardbeast
+/datum/supply_pack/security/guardbeast
name = "VARMAcorp autoNOMous security solution"
cost = 150
containertype = /obj/structure/largecrate/animal/guardbeast
@@ -7,7 +7,7 @@
access_security,
access_xenobiology)
-/datum/supply_packs/security/guardmutant
+/datum/supply_pack/security/guardmutant
name = "VARMAcorp autoNOMous security solution for hostile environments"
cost = 250
containertype = /obj/structure/largecrate/animal/guardmutant
@@ -16,7 +16,7 @@
access_security,
access_xenobiology)
-/datum/supply_packs/security/biosuit
+/datum/supply_pack/security/biosuit
contains = list(
/obj/item/clothing/head/bio_hood/security = 3,
/obj/item/clothing/under/rank/security = 3,
diff --git a/code/datums/supplypacks/supply.dm b/code/datums/supplypacks/supply.dm
index 47763854d2..e8f26993ff 100644
--- a/code/datums/supplypacks/supply.dm
+++ b/code/datums/supplypacks/supply.dm
@@ -3,10 +3,10 @@
* related to civilian tasks live
*/
-/datum/supply_packs/supply
+/datum/supply_pack/supply
group = "Supplies"
-/datum/supply_packs/supply/food
+/datum/supply_pack/supply/food
name = "Kitchen supply crate"
contains = list(
/obj/item/weapon/reagent_containers/food/condiment/flour = 6,
@@ -20,14 +20,14 @@
containertype = /obj/structure/closet/crate/freezer
containername = "Food crate"
-/datum/supply_packs/supply/toner
+/datum/supply_pack/supply/toner
name = "Toner cartridges"
contains = list(/obj/item/device/toner = 6)
cost = 10
containertype = /obj/structure/closet/crate
containername = "Toner cartridges"
-/datum/supply_packs/supply/janitor
+/datum/supply_pack/supply/janitor
name = "Janitorial supplies"
contains = list(
/obj/item/weapon/reagent_containers/glass/bucket,
@@ -50,7 +50,7 @@
containertype = /obj/structure/closet/crate
containername = "Janitorial supplies"
-/datum/supply_packs/supply/shipping
+/datum/supply_pack/supply/shipping
name = "Shipping supplies"
contains = list(
/obj/fiftyspawner/cardboard,
@@ -58,13 +58,13 @@
/obj/item/weapon/wrapping_paper = 2,
/obj/item/device/destTagger,
/obj/item/weapon/hand_labeler,
- /obj/item/weapon/wirecutters,
+ /obj/item/weapon/tool/wirecutters,
/obj/item/weapon/tape_roll = 2)
cost = 10
containertype = "/obj/structure/closet/crate"
containername = "Shipping supplies crate"
-/datum/supply_packs/supply/bureaucracy
+/datum/supply_pack/supply/bureaucracy
contains = list(
/obj/item/weapon/clipboard = 2,
/obj/item/weapon/pen/red,
@@ -84,14 +84,14 @@
containertype = /obj/structure/closet/crate
containername = "Office supplies crate"
-/datum/supply_packs/supply/spare_pda
+/datum/supply_pack/supply/spare_pda
name = "Spare PDAs"
cost = 10
containertype = /obj/structure/closet/crate
containername = "Spare PDA crate"
contains = list(/obj/item/device/pda = 3)
-/datum/supply_packs/supply/minergear
+/datum/supply_pack/supply/minergear
name = "Shaft miner equipment"
contains = list(
/obj/item/weapon/storage/backpack/industrial,
@@ -114,24 +114,24 @@
containertype = "/obj/structure/closet/crate/secure"
containername = "Shaft miner equipment"
access = access_mining
-/* //VOREStation Edit
-/datum/supply_packs/supply/mule
+/* //VOREStation Edit - Pointless on Tether.
+/datum/supply_pack/supply/mule
name = "Mulebot Crate"
contains = list()
cost = 20
containertype = /obj/structure/largecrate/animal/mulebot
containername = "Mulebot Crate"
*/ //VOREStation Edit
-/datum/supply_packs/supply/cargotrain
+/datum/supply_pack/supply/cargotrain
name = "Cargo Train Tug"
- contains = list(/obj/vehicle/train/cargo/engine)
+ contains = list(/obj/vehicle/train/engine)
cost = 35
containertype = /obj/structure/largecrate
containername = "Cargo Train Tug Crate"
-/datum/supply_packs/supply/cargotrailer
+/datum/supply_pack/supply/cargotrailer
name = "Cargo Train Trolley"
- contains = list(/obj/vehicle/train/cargo/trolley)
+ contains = list(/obj/vehicle/train/trolley)
cost = 15
containertype = /obj/structure/largecrate
containername = "Cargo Train Trolley Crate"
diff --git a/code/datums/supplypacks/supplypacks.dm b/code/datums/supplypacks/supplypacks.dm
index 3d2d4807fd..d29f03be6f 100644
--- a/code/datums/supplypacks/supplypacks.dm
+++ b/code/datums/supplypacks/supplypacks.dm
@@ -4,6 +4,7 @@
//ANOTER NOTE: Contraband is obtainable through modified supplycomp circuitboards.
//BIG NOTE: Don't add living things to crates, that's bad, it will break the shuttle.
//NEW NOTE: Do NOT set the price of any crates below 7 points. Doing so allows infinite points.
+//NOTE NOTE: Hidden var is now deprecated, whoever removed support for it should've removed the var altogether
//var/list/all_supply_groups = list("Operations","Security","Hospitality","Engineering","Atmospherics","Medical","Reagents","Reagent Cartridges","Science","Hydroponics", "Supply", "Miscellaneous")
var/list/all_supply_groups = list("Atmospherics",
@@ -24,30 +25,35 @@ var/list/all_supply_groups = list("Atmospherics",
"Supplies",
"Voidsuits")
-/datum/supply_packs
+/datum/supply_pack
var/name = null
- var/list/contains = list()
- var/manifest = ""
+ var/list/contains = list() // Typepaths, used to actually spawn the contents
+ var/list/manifest = list() // Object names, used to compile manifests
var/cost = null
var/containertype = null
var/containername = null
var/access = null
- var/hidden = 0
var/contraband = 0
+ var/num_contained = 0 //number of items picked to be contained in a /randomised crate
var/group = "Miscellaneous"
-/datum/supply_packs/New()
- manifest += ""
+/datum/supply_pack/New()
for(var/path in contains)
if(!path || !ispath(path, /atom))
continue
var/atom/O = path
- manifest += "- [initial(O.name)]
"
- manifest += "
"
+ manifest += "\proper[initial(O.name)]"
-/datum/supply_packs/randomised
- var/num_contained //number of items picked to be contained in a randomised crate
+/datum/supply_pack/proc/get_html_manifest()
+ var/dat = ""
+ if(num_contained)
+ dat +="Contains any [num_contained] of:"
+ dat += ""
+ for(var/O in manifest)
+ dat += "- [O]
"
+ dat += "
"
+ return dat
-/datum/supply_packs/randomised/New()
- manifest += "Contains any [num_contained] of:"
- ..()
\ No newline at end of file
+// Keeping this subtype here for posterity, so it's more apparent that this is the subtype to use if making new randomised packs
+/datum/supply_pack/randomised
+ num_contained = 1
\ No newline at end of file
diff --git a/code/datums/supplypacks/voidsuits.dm b/code/datums/supplypacks/voidsuits.dm
index 699c8ce9ee..e24403e03e 100644
--- a/code/datums/supplypacks/voidsuits.dm
+++ b/code/datums/supplypacks/voidsuits.dm
@@ -4,10 +4,10 @@
*/
-/datum/supply_packs/voidsuits
+/datum/supply_pack/voidsuits
group = "Voidsuits"
-/datum/supply_packs/voidsuits/atmos
+/datum/supply_pack/voidsuits/atmos
name = "Atmospheric voidsuits"
contains = list(
/obj/item/clothing/suit/space/void/atmos = 2,
@@ -21,7 +21,7 @@
containername = "Atmospheric voidsuit crate"
access = access_atmospherics
-/datum/supply_packs/voidsuits/atmos/alt
+/datum/supply_pack/voidsuits/atmos/alt
name = "Heavy Duty Atmospheric voidsuits"
contains = list(
/obj/item/clothing/suit/space/void/atmos/alt = 2,
@@ -35,7 +35,7 @@
containername = "Heavy Duty Atmospheric voidsuit crate"
access = access_atmospherics
-/datum/supply_packs/voidsuits/engineering
+/datum/supply_pack/voidsuits/engineering
name = "Engineering voidsuits"
contains = list(
/obj/item/clothing/suit/space/void/engineering = 2,
@@ -49,7 +49,7 @@
containername = "Engineering voidsuit crate"
access = access_engine_equip
-/datum/supply_packs/voidsuits/engineering/construction
+/datum/supply_pack/voidsuits/engineering/construction
name = "Engineering Construction voidsuits"
contains = list(
/obj/item/clothing/suit/space/void/engineering/construction = 2,
@@ -63,7 +63,7 @@
containername = "Engineering Construction voidsuit crate"
access = access_engine_equip
-/datum/supply_packs/voidsuits/engineering/hazmat
+/datum/supply_pack/voidsuits/engineering/hazmat
name = "Engineering Hazmat voidsuits"
contains = list(
/obj/item/clothing/suit/space/void/engineering/hazmat = 2,
@@ -77,7 +77,7 @@
containername = "Engineering Hazmat voidsuit crate"
access = access_engine_equip
-/datum/supply_packs/voidsuits/engineering/alt
+/datum/supply_pack/voidsuits/engineering/alt
name = "Reinforced Engineering voidsuits"
contains = list(
/obj/item/clothing/suit/space/void/engineering/alt = 2,
@@ -91,7 +91,7 @@
containername = "Reinforced Engineering voidsuit crate"
access = access_engine_equip
-/datum/supply_packs/voidsuits/medical
+/datum/supply_pack/voidsuits/medical
name = "Medical voidsuits"
contains = list(
/obj/item/clothing/suit/space/void/medical = 2,
@@ -105,7 +105,7 @@
containername = "Medical voidsuit crate"
access = access_medical_equip
-/datum/supply_packs/voidsuits/medical/emt
+/datum/supply_pack/voidsuits/medical/emt
name = "Medical EMT voidsuits"
contains = list(
/obj/item/clothing/suit/space/void/medical/emt = 2,
@@ -119,7 +119,7 @@
containername = "Medical EMT voidsuit crate"
access = access_medical_equip
-/datum/supply_packs/voidsuits/medical/bio
+/datum/supply_pack/voidsuits/medical/bio
name = "Medical Biohazard voidsuits"
contains = list(
/obj/item/clothing/suit/space/void/medical/bio = 2,
@@ -133,7 +133,7 @@
containername = "Medical Biohazard voidsuit crate"
access = access_medical_equip
-/datum/supply_packs/voidsuits/medical/alt
+/datum/supply_pack/voidsuits/medical/alt
name = "Vey-Med Medical voidsuits"
contains = list(
/obj/item/clothing/suit/space/void/medical/alt = 2,
@@ -147,7 +147,7 @@
containername = "Vey-Med Medical voidsuit crate"
access = access_medical_equip
-/datum/supply_packs/voidsuits/security
+/datum/supply_pack/voidsuits/security
name = "Security voidsuits"
contains = list(
/obj/item/clothing/suit/space/void/security = 2,
@@ -160,7 +160,7 @@
containertype = "/obj/structure/closet/crate/secure"
containername = "Security voidsuit crate"
-/datum/supply_packs/voidsuits/security/crowd
+/datum/supply_pack/voidsuits/security/crowd
name = "Security Crowd Control voidsuits"
contains = list(
/obj/item/clothing/suit/space/void/security/riot = 2,
@@ -174,7 +174,7 @@
containername = "Security Crowd Control voidsuit crate"
access = access_armory
-/datum/supply_packs/voidsuits/security/alt
+/datum/supply_pack/voidsuits/security/alt
name = "Security EVA Riot voidsuits"
contains = list(
/obj/item/clothing/suit/space/void/security/alt = 2,
@@ -188,7 +188,7 @@
containername = "Security EVA Riot voidsuit crate"
access = access_armory
-/datum/supply_packs/voidsuits/supply
+/datum/supply_pack/voidsuits/supply
name = "Mining voidsuits"
contains = list(
/obj/item/clothing/suit/space/void/mining = 2,
@@ -201,7 +201,7 @@
containername = "Mining voidsuit crate"
access = access_mining
-/datum/supply_packs/voidsuits/supply/alt
+/datum/supply_pack/voidsuits/supply/alt
name = "Frontier Mining voidsuits"
contains = list(
/obj/item/clothing/suit/space/void/mining/alt = 2,
diff --git a/code/datums/supplypacks/voidsuits_vr.dm b/code/datums/supplypacks/voidsuits_vr.dm
index 60765435f3..ccf296a10a 100644
--- a/code/datums/supplypacks/voidsuits_vr.dm
+++ b/code/datums/supplypacks/voidsuits_vr.dm
@@ -1,4 +1,4 @@
-/datum/supply_packs/voidsuits/atmos
+/datum/supply_pack/voidsuits/atmos
contains = list(
/obj/item/clothing/suit/space/void/atmos = 3,
/obj/item/clothing/head/helmet/space/void/atmos = 3,
@@ -7,7 +7,7 @@
/obj/item/weapon/tank/oxygen = 3,
)
-/datum/supply_packs/voidsuits/engineering
+/datum/supply_pack/voidsuits/engineering
contains = list(
/obj/item/clothing/suit/space/void/engineering = 3,
/obj/item/clothing/head/helmet/space/void/engineering = 3,
@@ -16,7 +16,7 @@
/obj/item/weapon/tank/oxygen = 3
)
-/datum/supply_packs/voidsuits/medical
+/datum/supply_pack/voidsuits/medical
contains = list(
/obj/item/clothing/suit/space/void/medical = 3,
/obj/item/clothing/head/helmet/space/void/medical = 3,
@@ -25,7 +25,7 @@
/obj/item/weapon/tank/oxygen = 3
)
-/datum/supply_packs/voidsuits/medical/alt
+/datum/supply_pack/voidsuits/medical/alt
contains = list(
/obj/item/clothing/suit/space/void/medical/alt = 3,
/obj/item/clothing/head/helmet/space/void/medical/alt = 3,
@@ -34,7 +34,7 @@
/obj/item/weapon/tank/oxygen = 3
)
-/datum/supply_packs/voidsuits/security
+/datum/supply_pack/voidsuits/security
contains = list(
/obj/item/clothing/suit/space/void/security = 3,
/obj/item/clothing/head/helmet/space/void/security = 3,
@@ -43,7 +43,7 @@
/obj/item/weapon/tank/oxygen = 3
)
-/datum/supply_packs/voidsuits/security/crowd
+/datum/supply_pack/voidsuits/security/crowd
contains = list(
/obj/item/clothing/suit/space/void/security/riot = 3,
/obj/item/clothing/head/helmet/space/void/security/riot = 3,
@@ -52,7 +52,7 @@
/obj/item/weapon/tank/oxygen = 3
)
-/datum/supply_packs/voidsuits/security/alt
+/datum/supply_pack/voidsuits/security/alt
contains = list(
/obj/item/clothing/suit/space/void/security/alt = 3,
/obj/item/clothing/head/helmet/space/void/security/alt = 3,
@@ -61,7 +61,7 @@
/obj/item/weapon/tank/oxygen = 3
)
-/datum/supply_packs/voidsuits/supply
+/datum/supply_pack/voidsuits/supply
name = "Mining voidsuits"
contains = list(
/obj/item/clothing/suit/space/void/mining = 3,
@@ -70,7 +70,7 @@
/obj/item/weapon/tank/oxygen = 3
)
-/datum/supply_packs/voidsuits/explorer
+/datum/supply_pack/voidsuits/explorer
name = "Exploration voidsuits"
contains = list(
/obj/item/clothing/suit/space/void/exploration = 3,
@@ -84,7 +84,7 @@
containername = "Exploration voidsuit crate"
access = access_explorer
-/datum/supply_packs/voidsuits/pilot
+/datum/supply_pack/voidsuits/pilot
name = "Pilot voidsuits"
contains = list(
/obj/item/clothing/suit/space/void/pilot = 1,
diff --git a/code/datums/wires/radio.dm b/code/datums/wires/radio.dm
index ab6053da83..dcd708c5f6 100644
--- a/code/datums/wires/radio.dm
+++ b/code/datums/wires/radio.dm
@@ -24,7 +24,7 @@ var/const/WIRE_TRANSMIT = 4
if(WIRE_TRANSMIT)
R.broadcasting = !R.broadcasting && !IsIndexCut(WIRE_SIGNAL)
- nanomanager.update_uis(holder)
+ GLOB.nanomanager.update_uis(holder)
/datum/wires/radio/UpdateCut(var/index, var/mended)
var/obj/item/device/radio/R = holder
@@ -38,4 +38,4 @@ var/const/WIRE_TRANSMIT = 4
if(WIRE_TRANSMIT)
R.broadcasting = mended && !IsIndexCut(WIRE_SIGNAL)
- nanomanager.update_uis(holder)
+ GLOB.nanomanager.update_uis(holder)
diff --git a/code/datums/wires/wires.dm b/code/datums/wires/wires.dm
index 435ca82fdc..0a83f542db 100644
--- a/code/datums/wires/wires.dm
+++ b/code/datums/wires/wires.dm
@@ -117,7 +117,7 @@ var/list/wireColours = list("red", "blue", "green", "darkred", "orange", "brown"
var/obj/item/I = L.get_active_hand()
holder.add_hiddenprint(L)
if(href_list["cut"]) // Toggles the cut/mend status
- if(istype(I, /obj/item/weapon/wirecutters))
+ if(I.is_wirecutter())
var/colour = href_list["cut"]
CutWireColour(colour)
playsound(holder, I.usesound, 20, 1)
diff --git a/code/game/area/Space Station 13 areas.dm b/code/game/area/Space Station 13 areas.dm
index e855a35868..66dbaa6e2e 100755
--- a/code/game/area/Space Station 13 areas.dm
+++ b/code/game/area/Space Station 13 areas.dm
@@ -28,8 +28,8 @@ NOTE: there are two lists of areas in the end of this file: centcom and station
power_light = 0
power_equip = 0
power_environ = 0
- ambience = list('sound/ambience/ambispace.ogg','sound/music/title2.ogg','sound/music/space.ogg','sound/music/main.ogg','sound/music/traitor.ogg','sound/ambience/serspaceamb1.ogg')
base_turf = /turf/space
+ ambience = AMBIENCE_SPACE
/area/space/atmosalert()
return
@@ -74,6 +74,7 @@ NOTE: there are two lists of areas in the end of this file: centcom and station
/area/shuttle/arrival
name = "\improper Arrival Shuttle"
+ ambience = AMBIENCE_ARRIVALS
/area/shuttle/arrival/pre_game
icon_state = "shuttle2"
@@ -81,6 +82,7 @@ NOTE: there are two lists of areas in the end of this file: centcom and station
/area/shuttle/arrival/station
icon_state = "shuttle"
dynamic_lighting = 0
+ ambience = AMBIENCE_ARRIVALS
/area/shuttle/escape
name = "\improper Emergency Shuttle"
@@ -384,9 +386,11 @@ NOTE: there are two lists of areas in the end of this file: centcom and station
/area/centcom/terminal
name = "\improper Docking Terminal"
icon_state = "centcom_dock"
+ ambience = AMBIENCE_ARRIVALS
/area/centcom/tram
name = "\improper Tram Station"
+ ambience = AMBIENCE_ARRIVALS
/area/centcom/security
name = "\improper CentCom Security"
@@ -399,6 +403,7 @@ NOTE: there are two lists of areas in the end of this file: centcom and station
/area/centcom/command
name = "\improper CentCom Command" //Central Command Command totally isn't RAS Syndrome in action.
icon_state = "centcom_command"
+ ambience = AMBIENCE_HIGHSEC
/area/centcom/main_hall
name = "\improper Main Hallway"
@@ -423,6 +428,7 @@ NOTE: there are two lists of areas in the end of this file: centcom and station
icon_state = "syndie-ship"
requires_power = 0
dynamic_lighting = 0
+ ambience = AMBIENCE_HIGHSEC
/area/syndicate_mothership/control
name = "\improper Mercenary Control Room"
@@ -488,6 +494,7 @@ NOTE: there are two lists of areas in the end of this file: centcom and station
requires_power = 0
flags = RAD_SHIELDED
base_turf = /turf/space
+ ambience = AMBIENCE_HIGHSEC
/area/syndicate_station/start
name = "\improper Mercenary Forward Operating Base"
@@ -542,12 +549,14 @@ NOTE: there are two lists of areas in the end of this file: centcom and station
icon_state = "yellow"
requires_power = 0
dynamic_lighting = 0
+ ambience = AMBIENCE_OTHERWORLDLY
/area/skipjack_station
name = "\improper Skipjack"
icon_state = "yellow"
requires_power = 0
base_turf = /turf/space
+ ambience = AMBIENCE_HIGHSEC
/area/skipjack_station/start
name = "\improper Skipjack"
@@ -581,6 +590,7 @@ NOTE: there are two lists of areas in the end of this file: centcom and station
/area/prison
name = "\improper Prison Station"
icon_state = "brig"
+ ambience = AMBIENCE_HIGHSEC
/area/prison/arrival_airlock
name = "\improper Prison Station Airlock"
@@ -664,12 +674,16 @@ NOTE: there are two lists of areas in the end of this file: centcom and station
//SPACE STATION 13//
////////////////////
+/area
+ ambience = AMBIENCE_GENERIC
+
//Maintenance
/area/maintenance
flags = RAD_SHIELDED
sound_env = TUNNEL_ENCLOSED
turf_initializer = new /datum/turf_initializer/maintenance()
+ ambience = AMBIENCE_MAINTENANCE
/area/maintenance/aft
name = "Aft Maintenance"
@@ -896,6 +910,7 @@ NOTE: there are two lists of areas in the end of this file: centcom and station
/area/hallway/primary/
sound_env = LARGE_ENCLOSED
+ ambience = AMBIENCE_GENERIC
/area/hallway/primary/fore
name = "\improper Fore Primary Hallway"
@@ -1104,6 +1119,7 @@ NOTE: there are two lists of areas in the end of this file: centcom and station
name = "\improper Dormitories"
icon_state = "Sleep"
flags = RAD_SHIELDED
+ ambience = AMBIENCE_GENERIC
/area/crew_quarters/toilet
name = "\improper Dormitory Toilets"
@@ -1363,10 +1379,12 @@ NOTE: there are two lists of areas in the end of this file: centcom and station
name = "\improper Library Conference Room"
icon_state = "library_conference_room"
+/area/chapel
+ ambience = AMBIENCE_CHAPEL
+
/area/chapel/main
name = "\improper Chapel"
icon_state = "chapel"
- ambience = list('sound/ambience/ambicha1.ogg','sound/ambience/ambicha2.ogg','sound/ambience/ambicha3.ogg','sound/ambience/ambicha4.ogg','sound/music/traitor.ogg')
sound_env = LARGE_ENCLOSED
/area/chapel/office
@@ -1470,7 +1488,7 @@ NOTE: there are two lists of areas in the end of this file: centcom and station
/area/engineering/
name = "\improper Engineering"
icon_state = "engineering"
- ambience = list('sound/ambience/ambisin1.ogg','sound/ambience/ambisin2.ogg','sound/ambience/ambisin3.ogg','sound/ambience/ambisin4.ogg')
+ ambience = AMBIENCE_ENGINEERING
/area/engineering/atmos
name = "\improper Atmospherics"
@@ -1554,6 +1572,7 @@ NOTE: there are two lists of areas in the end of this file: centcom and station
requires_power = 1
always_unpowered = 1
dynamic_lighting = 0
+ ambience = AMBIENCE_SPACE
auxport
name = "\improper Fore Port Solar Array"
@@ -1639,7 +1658,6 @@ NOTE: there are two lists of areas in the end of this file: centcom and station
name = "\improper AI Satellite Teleporter Room"
icon_state = "teleporter"
music = "signal"
- ambience = list('sound/ambience/ambimalf.ogg')
//MedBay
@@ -1749,7 +1767,6 @@ NOTE: there are two lists of areas in the end of this file: centcom and station
/area/medical/morgue
name = "\improper Morgue"
icon_state = "morgue"
- ambience = list('sound/ambience/ambimo1.ogg','sound/ambience/ambimo2.ogg','sound/music/main.ogg')
/area/medical/chemistry
name = "\improper Chemistry"
@@ -1850,6 +1867,7 @@ NOTE: there are two lists of areas in the end of this file: centcom and station
/area/security/armoury
name = "\improper Security - Armory"
icon_state = "armory"
+ ambience = AMBIENCE_HIGHSEC
/area/security/briefing_room
name = "\improper Security - Briefing Room"
@@ -1907,6 +1925,7 @@ NOTE: there are two lists of areas in the end of this file: centcom and station
/area/security/tactical
name = "\improper Security - Tactical Equipment"
icon_state = "Tactical"
+ ambience = AMBIENCE_HIGHSEC
/*
@@ -1929,6 +1948,7 @@ NOTE: there are two lists of areas in the end of this file: centcom and station
/area/security/nuke_storage
name = "\improper Vault"
icon_state = "nuke_storage"
+ ambience = AMBIENCE_HIGHSEC
/area/security/checkpoint
name = "\improper Security Checkpoint"
@@ -1937,6 +1957,7 @@ NOTE: there are two lists of areas in the end of this file: centcom and station
/area/security/checkpoint2
name = "\improper Security - Arrival Checkpoint"
icon_state = "security"
+ ambience = AMBIENCE_ARRIVALS
/area/security/checkpoint/supply
name = "Security Post - Cargo Bay"
@@ -2167,16 +2188,19 @@ NOTE: there are two lists of areas in the end of this file: centcom and station
/area/djstation
name = "\improper Listening Post"
icon_state = "LP"
+ ambience = AMBIENCE_TECH_RUINS
/area/djstation/solars
name = "\improper Listening Post Solars"
icon_state = "LPS"
+ ambience = AMBIENCE_TECH_RUINS
//DERELICT
/area/derelict
name = "\improper Derelict Station"
icon_state = "storage"
+ ambience = AMBIENCE_RUINS
/area/derelict/hallway/primary
name = "\improper Derelict Primary Hallway"
@@ -2375,6 +2399,7 @@ NOTE: there are two lists of areas in the end of this file: centcom and station
/area/ai_monitored/storage/secure
name = "Secure Storage"
icon_state = "storage"
+ ambience = AMBIENCE_HIGHSEC
/area/ai_monitored/storage/emergency
name = "Emergency Storage"
@@ -2387,74 +2412,85 @@ NOTE: there are two lists of areas in the end of this file: centcom and station
/area/ai_upload
name = "\improper AI Upload Chamber"
icon_state = "ai_upload"
- ambience = list('sound/ambience/ambimalf.ogg')
+ ambience = AMBIENCE_AI
/area/ai_upload_foyer
name = "AI Upload Access"
icon_state = "ai_foyer"
- ambience = list('sound/ambience/ambimalf.ogg')
sound_env = SMALL_ENCLOSED
+ ambience = AMBIENCE_AI
/area/ai_server_room
name = "Messaging Server Room"
icon_state = "ai_server"
sound_env = SMALL_ENCLOSED
+ ambience = AMBIENCE_AI
/area/ai
name = "\improper AI Chamber"
icon_state = "ai_chamber"
- ambience = list('sound/ambience/ambimalf.ogg')
+ ambience = AMBIENCE_AI
/area/ai_cyborg_station
name = "\improper Cyborg Station"
icon_state = "ai_cyborg"
sound_env = SMALL_ENCLOSED
+ ambience = AMBIENCE_AI
/area/aisat
name = "\improper AI Satellite"
icon_state = "ai"
+ ambience = AMBIENCE_AI
/area/aisat_interior
name = "\improper AI Satellite"
icon_state = "ai"
+ ambience = AMBIENCE_AI // The lack of inheritence hurts my soul.
/area/AIsatextFP
name = "\improper AI Sat Ext"
icon_state = "storage"
luminosity = 1
dynamic_lighting = 0
+ ambience = AMBIENCE_AI
/area/AIsatextFS
name = "\improper AI Sat Ext"
icon_state = "storage"
luminosity = 1
dynamic_lighting = 0
+ ambience = AMBIENCE_AI
/area/AIsatextAS
name = "\improper AI Sat Ext"
icon_state = "storage"
luminosity = 1
dynamic_lighting = 0
+ ambience = AMBIENCE_AI
/area/AIsatextAP
name = "\improper AI Sat Ext"
icon_state = "storage"
luminosity = 1
dynamic_lighting = 0
+ ambience = AMBIENCE_AI
/area/NewAIMain
name = "\improper AI Main New"
icon_state = "storage"
+ ambience = AMBIENCE_AI
//Misc
-
+/area/wreck
+ ambience = AMBIENCE_RUINS
/area/wreck/ai
name = "\improper AI Chamber"
icon_state = "ai"
+ ambience = AMBIENCE_TECH_RUINS
/area/wreck/main
name = "\improper Wreck"
@@ -2463,10 +2499,12 @@ NOTE: there are two lists of areas in the end of this file: centcom and station
/area/wreck/engineering
name = "\improper Power Room"
icon_state = "engine"
+ ambience = AMBIENCE_TECH_RUINS
/area/wreck/bridge
name = "\improper Bridge"
icon_state = "bridge"
+ ambience = AMBIENCE_TECH_RUINS
/area/generic
name = "Unknown"
@@ -2476,7 +2514,7 @@ NOTE: there are two lists of areas in the end of this file: centcom and station
// Telecommunications Satellite
/area/tcommsat/
- ambience = list('sound/ambience/ambisin2.ogg', 'sound/ambience/signal.ogg', 'sound/ambience/signal.ogg', 'sound/ambience/ambigen10.ogg')
+ ambience = AMBIENCE_ENGINEERING
/area/tcommsat/entrance
name = "\improper Telecomms Teleporter"
@@ -2489,22 +2527,22 @@ NOTE: there are two lists of areas in the end of this file: centcom and station
/area/tcomsat
name = "\improper Telecomms Satellite"
icon_state = "tcomsatlob"
- ambience = list('sound/ambience/ambisin2.ogg', 'sound/ambience/signal.ogg', 'sound/ambience/signal.ogg', 'sound/ambience/ambigen10.ogg')
+ ambience = AMBIENCE_ENGINEERING
/area/tcomfoyer
name = "\improper Telecomms Foyer"
icon_state = "tcomsatfoyer"
- ambience = list('sound/ambience/ambisin2.ogg', 'sound/ambience/signal.ogg', 'sound/ambience/signal.ogg', 'sound/ambience/ambigen10.ogg')
+ ambience = AMBIENCE_ENGINEERING
/area/tcomwest
name = "\improper Telecommunications Satellite West Wing"
icon_state = "tcomsatwest"
- ambience = list('sound/ambience/ambisin2.ogg', 'sound/ambience/signal.ogg', 'sound/ambience/signal.ogg', 'sound/ambience/ambigen10.ogg')
+ ambience = AMBIENCE_ENGINEERING
/area/tcomeast
name = "\improper Telecommunications Satellite East Wing"
icon_state = "tcomsateast"
- ambience = list('sound/ambience/ambisin2.ogg', 'sound/ambience/signal.ogg', 'sound/ambience/signal.ogg', 'sound/ambience/ambigen10.ogg')
+ ambience = AMBIENCE_ENGINEERING
/area/tcommsat/computer
name = "\improper Telecomms Control Room"
@@ -2523,6 +2561,7 @@ NOTE: there are two lists of areas in the end of this file: centcom and station
/area/awaymission
name = "\improper Strange Location"
icon_state = "away"
+ ambience = AMBIENCE_FOREBODING
/area/awaymission/gateway
name = "\improper Gateway"
@@ -2621,57 +2660,6 @@ NOTE: there are two lists of areas in the end of this file: centcom and station
luminosity = 1
dynamic_lighting = 0
requires_power = 0
- ambience = list()
-// Vorestation Removal - This is very broken. Sounds do not stop when you leave the area.
-/* 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_icons_body()
- if(H.client)
- mysound.status = SOUND_UPDATE
- H << mysound
- if(S)
- spawn(sound_delay)
- H << S
-
- spawn(60) .()*/
/////////////////////////////////////////////////////////////////////
/*
@@ -2744,53 +2732,3 @@ var/list/the_station_areas = list (
luminosity = 1
dynamic_lighting = 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) //ugh...nice/novel idea but please no.
-// H.s_tone--
-// H.update_icons_body()
- if(H.client)
- mysound.status = SOUND_UPDATE
- H << mysound
- if(S)
- spawn(sound_delay)
- H << S
-
- spawn(60) .()
-*/
diff --git a/code/game/area/areas.dm b/code/game/area/areas.dm
index 02c1ef391f..b9ba97b65a 100644
--- a/code/game/area/areas.dm
+++ b/code/game/area/areas.dm
@@ -35,7 +35,7 @@
// var/list/lights // list of all lights on this area
var/list/all_doors = null //Added by Strumpetplaya - Alarm Change - Contains a list of doors adjacent to this area
var/firedoors_closed = 0
- var/list/ambience = list('sound/ambience/ambigen1.ogg','sound/ambience/ambigen3.ogg','sound/ambience/ambigen4.ogg','sound/ambience/ambigen5.ogg','sound/ambience/ambigen6.ogg','sound/ambience/ambigen7.ogg','sound/ambience/ambigen8.ogg','sound/ambience/ambigen9.ogg','sound/ambience/ambigen10.ogg','sound/ambience/ambigen11.ogg','sound/ambience/ambigen12.ogg','sound/ambience/ambigen14.ogg')
+ var/list/ambience = list()
var/list/forced_ambience = null
var/sound_env = STANDARD_STATION
var/turf/base_turf //The base turf type of the area, which can be used to override the z-level's base turf
@@ -297,10 +297,6 @@ var/list/mob/living/forced_ambiance_list = new
L << sound(null, channel = CHANNEL_AMBIENCE_FORCED)
forced_ambiance_list -= L
- if(!L.client.ambience_playing)
- L.client.ambience_playing = 1
- L << sound('sound/ambience/shipambience.ogg', repeat = 1, wait = 0, volume = 35, channel = CHANNEL_AMBIENCE)
-
if(forced_ambience)
if(forced_ambience.len)
forced_ambiance_list |= L
@@ -311,10 +307,10 @@ var/list/mob/living/forced_ambiance_list = new
else
L << sound(null, channel = CHANNEL_AMBIENCE_FORCED)
else if(src.ambience.len && prob(35))
- if((world.time >= L.client.played + 600))
+ if((world.time >= L.client.time_last_ambience_played + 1 MINUTE))
var/sound = pick(ambience)
- L << sound(sound, repeat = 0, wait = 0, volume = 25, channel = CHANNEL_AMBIENCE)
- L.client.played = world.time
+ L << sound(sound, repeat = 0, wait = 0, volume = 50, channel = CHANNEL_AMBIENCE)
+ L.client.time_last_ambience_played = world.time
/area/proc/gravitychange(var/gravitystate = 0, var/area/A)
A.has_gravity = gravitystate
diff --git a/code/game/area/asteroid_areas.dm b/code/game/area/asteroid_areas.dm
index 66a7e86913..e5f22a77d7 100644
--- a/code/game/area/asteroid_areas.dm
+++ b/code/game/area/asteroid_areas.dm
@@ -2,28 +2,23 @@
/area/mine
icon_state = "mining"
- music = 'sound/ambience/song_game.ogg'
sound_env = ASTEROID
/area/mine/explored
name = "Mine"
icon_state = "explored"
- ambience = list('sound/ambience/ambimine.ogg', 'sound/ambience/song_game.ogg')
/area/mine/unexplored
name = "Mine"
icon_state = "unexplored"
- ambience = list('sound/ambience/ambimine.ogg', 'sound/ambience/song_game.ogg')
/area/mine/explored/upper_level
name = "Upper Level Mine"
icon_state = "explored"
- ambience = list('sound/ambience/ambimine.ogg', 'sound/ambience/song_game.ogg')
/area/mine/unexplored/upper_level
name = "Upper Level Mine"
icon_state = "unexplored"
- ambience = list('sound/ambience/ambimine.ogg', 'sound/ambience/song_game.ogg')
// OUTPOSTS
diff --git a/code/game/atoms_movable.dm b/code/game/atoms_movable.dm
index 48ffacb335..f287a23f75 100644
--- a/code/game/atoms_movable.dm
+++ b/code/game/atoms_movable.dm
@@ -16,9 +16,11 @@
var/mob/pulledby = null
var/item_state = null // Used to specify the item state for the on-mob overlays.
var/icon_scale = 1 // Used to scale icons up or down in update_transform().
+ var/icon_rotation = 0 // Used to rotate icons in update_transform()
var/old_x = 0
var/old_y = 0
var/datum/riding/riding_datum //VOREStation Add - Moved from /obj/vehicle
+ var/does_spin = TRUE // Does the atom spin when thrown (of course it does :P)
/atom/movable/Destroy()
. = ..()
@@ -38,7 +40,7 @@
if (pulledby.pulling == src)
pulledby.pulling = null
pulledby = null
- qdel_null(riding_datum) //VOREStation Add
+ QDEL_NULL(riding_datum) //VOREStation Add
/atom/movable/Bump(var/atom/A, yes)
if(src.throwing)
@@ -127,17 +129,23 @@
src.throw_impact(A,speed)
/atom/movable/proc/throw_at(atom/target, range, speed, thrower)
- if(!target || !src) return 0
+ if(!target || !src)
+ return 0
+ if(target.z != src.z)
+ return 0
//use a modified version of Bresenham's algorithm to get from the atom's current position to that of the target
-
src.throwing = 1
src.thrower = thrower
src.throw_source = get_turf(src) //store the origin turf
-
+ src.pixel_z = 0
if(usr)
if(HULK in usr.mutations)
src.throwing = 2 // really strong throw!
+ var/dist_travelled = 0
+ var/dist_since_sleep = 0
+ var/area/a = get_area(src.loc)
+
var/dist_x = abs(target.x - src.x)
var/dist_y = abs(target.y - src.y)
@@ -152,77 +160,57 @@
dy = NORTH
else
dy = SOUTH
- var/dist_travelled = 0
- var/dist_since_sleep = 0
- var/area/a = get_area(src.loc)
+
+ var/error
+ var/major_dir
+ var/major_dist
+ var/minor_dir
+ var/minor_dist
if(dist_x > dist_y)
- var/error = dist_x/2 - dist_y
-
-
-
- while(src && target &&((((src.x < target.x && dx == EAST) || (src.x > target.x && dx == WEST)) && dist_travelled < range) || (a && a.has_gravity == 0) || istype(src.loc, /turf/space)) && src.throwing && istype(src.loc, /turf))
- // only stop when we've gone the whole distance (or max throw range) and are on a non-space tile, or hit something, or hit the end of the map, or someone picks it up
- if(error < 0)
- var/atom/step = get_step(src, dy)
- if(!step) // going off the edge of the map makes get_step return null, don't let things go off the edge
- break
- src.Move(step)
- hit_check(speed)
- error += dist_x
- dist_travelled++
- dist_since_sleep++
- if(dist_since_sleep >= speed)
- dist_since_sleep = 0
- sleep(1)
- else
- var/atom/step = get_step(src, dx)
- if(!step) // going off the edge of the map makes get_step return null, don't let things go off the edge
- break
- src.Move(step)
- hit_check(speed)
- error -= dist_y
- dist_travelled++
- dist_since_sleep++
- if(dist_since_sleep >= speed)
- dist_since_sleep = 0
- sleep(1)
- a = get_area(src.loc)
+ error = dist_x/2 - dist_y
+ major_dir = dx
+ major_dist = dist_x
+ minor_dir = dy
+ minor_dist = dist_y
else
- var/error = dist_y/2 - dist_x
- while(src && target &&((((src.y < target.y && dy == NORTH) || (src.y > target.y && dy == SOUTH)) && dist_travelled < range) || (a && a.has_gravity == 0) || istype(src.loc, /turf/space)) && src.throwing && istype(src.loc, /turf))
- // only stop when we've gone the whole distance (or max throw range) and are on a non-space tile, or hit something, or hit the end of the map, or someone picks it up
- if(error < 0)
- var/atom/step = get_step(src, dx)
- if(!step) // going off the edge of the map makes get_step return null, don't let things go off the edge
- break
- src.Move(step)
- hit_check(speed)
- error += dist_y
- dist_travelled++
- dist_since_sleep++
- if(dist_since_sleep >= speed)
- dist_since_sleep = 0
- sleep(1)
- else
- var/atom/step = get_step(src, dy)
- if(!step) // going off the edge of the map makes get_step return null, don't let things go off the edge
- break
- src.Move(step)
- hit_check(speed)
- error -= dist_x
- dist_travelled++
- dist_since_sleep++
- if(dist_since_sleep >= speed)
- dist_since_sleep = 0
- sleep(1)
+ error = dist_y/2 - dist_x
+ major_dir = dy
+ major_dist = dist_y
+ minor_dir = dx
+ minor_dist = dist_x
- a = get_area(src.loc)
+ while(src && target && src.throwing && istype(src.loc, /turf) \
+ && ((abs(target.x - src.x)+abs(target.y - src.y) > 0 && dist_travelled < range) \
+ || (a && a.has_gravity == 0) \
+ || istype(src.loc, /turf/space)))
+ // only stop when we've gone the whole distance (or max throw range) and are on a non-space tile, or hit something, or hit the end of the map, or someone picks it up
+ var/atom/step
+ if(error >= 0)
+ step = get_step(src, major_dir)
+ error -= minor_dist
+ else
+ step = get_step(src, minor_dir)
+ error += major_dist
+ if(!step) // going off the edge of the map makes get_step return null, don't let things go off the edge
+ break
+ src.Move(step)
+ hit_check(speed)
+ dist_travelled++
+ dist_since_sleep++
+ if(dist_since_sleep >= speed)
+ dist_since_sleep = 0
+ sleep(1)
+ a = get_area(src.loc)
+ // and yet it moves
+ if(src.does_spin)
+ src.SpinAnimation(speed = 4, loops = 1)
//done throwing, either because it hit something or it finished moving
if(isobj(src)) src.throw_impact(get_turf(src),speed)
src.throwing = 0
src.thrower = null
src.throw_source = null
+ fall()
//Overlays
@@ -292,9 +280,14 @@
/atom/movable/proc/update_transform()
var/matrix/M = matrix()
M.Scale(icon_scale)
+ M.Turn(icon_rotation)
src.transform = M
// Use this to set the object's scale.
/atom/movable/proc/adjust_scale(new_scale)
icon_scale = new_scale
update_transform()
+
+/atom/movable/proc/adjust_rotation(new_rotation)
+ icon_rotation = new_rotation
+ update_transform()
\ No newline at end of file
diff --git a/code/game/dna/dna_modifier.dm b/code/game/dna/dna_modifier.dm
index dfb9d37147..623ccc11a3 100644
--- a/code/game/dna/dna_modifier.dm
+++ b/code/game/dna/dna_modifier.dm
@@ -270,7 +270,7 @@
I.loc = src
src.disk = I
user << "You insert [I]."
- nanomanager.update_uis(src) // update all UIs attached to src
+ GLOB.nanomanager.update_uis(src) // update all UIs attached to src
return
else
..()
@@ -428,7 +428,7 @@
data["beakerVolume"] += R.volume
// update the ui if it exists, returns null if no ui is passed/found
- ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
+ ui = GLOB.nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
// the ui does not exist, so we'll create a new() one
// for a list of parameters and their descriptions see the code docs in \code\modules\nano\nanoui.dm
@@ -465,7 +465,7 @@
irradiating = src.radiation_duration
var/lock_state = src.connected.locked
src.connected.locked = 1//lock it
- nanomanager.update_uis(src) // update all UIs attached to src
+ GLOB.nanomanager.update_uis(src) // update all UIs attached to src
sleep(10*src.radiation_duration) // sleep for radiation_duration seconds
@@ -566,7 +566,7 @@
irradiating = src.radiation_duration
var/lock_state = src.connected.locked
src.connected.locked = 1//lock it
- nanomanager.update_uis(src) // update all UIs attached to src
+ GLOB.nanomanager.update_uis(src) // update all UIs attached to src
sleep(10*src.radiation_duration) // sleep for radiation_duration seconds
@@ -624,7 +624,7 @@
irradiating = src.radiation_duration
var/lock_state = src.connected.locked
src.connected.locked = 1 //lock it
- nanomanager.update_uis(src) // update all UIs attached to src
+ GLOB.nanomanager.update_uis(src) // update all UIs attached to src
sleep(10*src.radiation_duration) // sleep for radiation_duration seconds
@@ -751,7 +751,7 @@
irradiating = 2
var/lock_state = src.connected.locked
src.connected.locked = 1//lock it
- nanomanager.update_uis(src) // update all UIs attached to src
+ GLOB.nanomanager.update_uis(src) // update all UIs attached to src
sleep(10*2) // sleep for 2 seconds
diff --git a/code/game/gamemodes/sandbox/h_sandbox.dm b/code/game/gamemodes/sandbox/h_sandbox.dm
index 6e9f040f5c..e919be9527 100644
--- a/code/game/gamemodes/sandbox/h_sandbox.dm
+++ b/code/game/gamemodes/sandbox/h_sandbox.dm
@@ -121,7 +121,7 @@ datum/hSB
var/obj/item/weapon/storage/hsb = new/obj/item/weapon/storage/toolbox/mechanical
for(var/obj/item/device/radio/T in hsb)
qdel(T)
- new/obj/item/weapon/crowbar (hsb)
+ new/obj/item/weapon/tool/crowbar (hsb)
hsb.loc = usr.loc
if("hsbmedkit")
var/obj/item/weapon/storage/firstaid/hsb = new/obj/item/weapon/storage/firstaid/regular
diff --git a/code/game/gamemodes/technomancer/spells/flame_tongue.dm b/code/game/gamemodes/technomancer/spells/flame_tongue.dm
index ffc12344e8..9e2c7b88b3 100644
--- a/code/game/gamemodes/technomancer/spells/flame_tongue.dm
+++ b/code/game/gamemodes/technomancer/spells/flame_tongue.dm
@@ -22,7 +22,7 @@
welder.setWelding(1)
/obj/item/weapon/spell/flame_tongue/Destroy()
- qdel_null(welder)
+ QDEL_NULL(welder)
return ..()
/obj/item/weapon/weldingtool/spell
diff --git a/code/game/gamemodes/technomancer/spells/illusion.dm b/code/game/gamemodes/technomancer/spells/illusion.dm
index 3e6d2dd8ab..418df75539 100644
--- a/code/game/gamemodes/technomancer/spells/illusion.dm
+++ b/code/game/gamemodes/technomancer/spells/illusion.dm
@@ -62,7 +62,7 @@
illusion.emote(what_to_emote)
/obj/item/weapon/spell/illusion/Destroy()
- qdel_null(illusion)
+ QDEL_NULL(illusion)
copied = null
return ..()
diff --git a/code/game/machinery/CableLayer.dm b/code/game/machinery/CableLayer.dm
index a6c161982d..659377281e 100644
--- a/code/game/machinery/CableLayer.dm
+++ b/code/game/machinery/CableLayer.dm
@@ -35,7 +35,7 @@
user << "You load [result] lengths of cable into [src]."
return
- if(istype(O, /obj/item/weapon/wirecutters))
+ if(O.is_wirecutter())
if(cable && cable.amount)
var/m = round(input(usr,"Please specify the length of cable to cut","Cut cable",min(cable.amount,30)) as num, 1)
m = min(m, cable.amount)
diff --git a/code/game/machinery/Sleeper.dm b/code/game/machinery/Sleeper.dm
index 002999d623..de673cec37 100644
--- a/code/game/machinery/Sleeper.dm
+++ b/code/game/machinery/Sleeper.dm
@@ -109,7 +109,7 @@
break
data["stasis"] = stasis_level_name
- ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
+ ui = GLOB.nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if(!ui)
ui = new(user, src, ui_key, "sleeper.tmpl", "Sleeper UI", 600, 600, state = state)
ui.set_initial_data(data)
diff --git a/code/game/machinery/adv_med.dm b/code/game/machinery/adv_med.dm
index 121082c008..2fb2d48a82 100644
--- a/code/game/machinery/adv_med.dm
+++ b/code/game/machinery/adv_med.dm
@@ -391,7 +391,7 @@
occupantData = attempt_vr(scanner,"get_occupant_data_vr",list(occupantData,H)) //VOREStation Insert
data["occupant"] = occupantData
- ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
+ ui = GLOB.nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if(!ui)
ui = new(user, src, ui_key, "adv_med.tmpl", "Body Scanner", 690, 800)
ui.set_initial_data(data)
diff --git a/code/game/machinery/airconditioner_vr.dm b/code/game/machinery/airconditioner_vr.dm
index 7edb0697b4..75b93fe90f 100644
--- a/code/game/machinery/airconditioner_vr.dm
+++ b/code/game/machinery/airconditioner_vr.dm
@@ -29,13 +29,13 @@
to_chat(user, "There is a small display that reads \"[convert_k2c(target_temp)]C\".")
/obj/machinery/power/thermoregulator/attackby(obj/item/I, mob/user)
- if(isscrewdriver(I))
+ if(I.is_screwdriver())
if(default_deconstruction_screwdriver(user,I))
return
- if(iscrowbar(I))
+ if(I.is_crowbar())
if(default_deconstruction_crowbar(user,I))
return
- if(iswrench(I))
+ if(I.is_wrench())
anchored = !anchored
visible_message("\The [src] has been [anchored ? "bolted to the floor" : "unbolted from the floor"] by [user].")
playsound(src, I.usesound, 75, 1)
@@ -45,7 +45,7 @@
disconnect_from_network()
turn_off()
return
- if(ismultitool(I))
+ if(I.is_multitool())
var/new_temp = input("Input a new target temperature, in degrees C.","Target Temperature", 20) as num
if(!Adjacent(user) || user.incapacitated())
return
diff --git a/code/game/machinery/alarm.dm b/code/game/machinery/alarm.dm
index 8e6acea643..6b4013b820 100644
--- a/code/game/machinery/alarm.dm
+++ b/code/game/machinery/alarm.dm
@@ -497,7 +497,7 @@
if(!(locked && !remote_connection) || remote_access || issilicon(user))
populate_controls(data)
- ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
+ ui = GLOB.nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if(!ui)
ui = new(user, src, ui_key, "air_alarm.tmpl", name, 325, 625, master_ui = master_ui, state = state)
ui.set_initial_data(data)
diff --git a/code/game/machinery/atmo_control.dm b/code/game/machinery/atmo_control.dm
index cb73da0c32..59e9670d1f 100644
--- a/code/game/machinery/atmo_control.dm
+++ b/code/game/machinery/atmo_control.dm
@@ -117,7 +117,7 @@ obj/machinery/computer/general_air_control/Destroy()
data["sensors"] = sensors_ui
- ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
+ ui = GLOB.nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if(!ui)
ui = new(user, src, ui_key, "atmo_control.tmpl", name, 525, 600)
ui.set_initial_data(data)
@@ -174,7 +174,7 @@ obj/machinery/computer/general_air_control/Destroy()
data["input_flow_setting"] = round(input_flow_setting, 0.1)
data["pressure_setting"] = pressure_setting
- ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
+ ui = GLOB.nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if(!ui)
ui = new(user, src, ui_key, "atmo_control.tmpl", name, 660, 500)
ui.set_initial_data(data)
@@ -284,7 +284,7 @@ obj/machinery/computer/general_air_control/Destroy()
data["input_flow_setting"] = round(input_flow_setting, 0.1)
data["pressure_setting"] = pressure_setting
- ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
+ ui = GLOB.nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if(!ui)
ui = new(user, src, ui_key, "atmo_control.tmpl", name, 650, 500)
ui.set_initial_data(data)
@@ -416,7 +416,7 @@ obj/machinery/computer/general_air_control/Destroy()
else
data["device_info"] = null
- ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
+ ui = GLOB.nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if(!ui)
ui = new(user, src, ui_key, "atmo_control.tmpl", name, 650, 500)
ui.set_initial_data(data)
diff --git a/code/game/machinery/atmoalter/canister.dm b/code/game/machinery/atmoalter/canister.dm
index a070ae9161..1749b68ac9 100644
--- a/code/game/machinery/atmoalter/canister.dm
+++ b/code/game/machinery/atmoalter/canister.dm
@@ -240,7 +240,7 @@ update_flag
..()
/obj/machinery/portable_atmospherics/canister/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
- if(!istype(W, /obj/item/weapon/wrench) && !istype(W, /obj/item/weapon/tank) && !istype(W, /obj/item/device/analyzer) && !istype(W, /obj/item/device/pda))
+ if(!W.is_wrench() && !istype(W, /obj/item/weapon/tank) && !istype(W, /obj/item/device/analyzer) && !istype(W, /obj/item/device/pda))
visible_message("\The [user] hits \the [src] with \a [W]!")
src.health -= W.force
src.add_fingerprint(user)
@@ -261,7 +261,7 @@ update_flag
..()
- nanomanager.update_uis(src) // Update all NanoUIs attached to src
+ GLOB.nanomanager.update_uis(src) // Update all NanoUIs attached to src
/obj/machinery/portable_atmospherics/canister/attack_ai(var/mob/user as mob)
return src.attack_hand(user)
@@ -289,7 +289,7 @@ update_flag
data["holdingTank"] = list("name" = holding.name, "tankPressure" = round(holding.air_contents.return_pressure()))
// update the ui if it exists, returns null if no ui is passed/found
- ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
+ ui = GLOB.nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
// the ui does not exist, so we'll create a new() one
// for a list of parameters and their descriptions see the code docs in \code\modules\nano\nanoui.dm
diff --git a/code/game/machinery/atmoalter/meter.dm b/code/game/machinery/atmoalter/meter.dm
index 8133cd48fb..c96837265d 100644
--- a/code/game/machinery/atmoalter/meter.dm
+++ b/code/game/machinery/atmoalter/meter.dm
@@ -107,7 +107,7 @@
return ..()
/obj/machinery/meter/attackby(var/obj/item/W, var/mob/user)
- if(iswrench(W))
+ if(W.is_wrench())
playsound(src, W.usesound, 50, 1)
to_chat(user, "You begin to unfasten \the [src]...")
if(do_after(user, 40 * W.toolspeed))
@@ -119,7 +119,7 @@
qdel(src)
return
- if(ismultitool(W))
+ if(istype(W, /obj/item/device/multitool))
for(var/obj/machinery/atmospherics/pipe/P in loc)
pipes_on_turf |= P
if(!pipes_on_turf.len)
diff --git a/code/game/machinery/atmoalter/portable_atmospherics.dm b/code/game/machinery/atmoalter/portable_atmospherics.dm
index 84d00eff04..73f5abce4b 100644
--- a/code/game/machinery/atmoalter/portable_atmospherics.dm
+++ b/code/game/machinery/atmoalter/portable_atmospherics.dm
@@ -22,8 +22,8 @@
return 1
/obj/machinery/portable_atmospherics/Destroy()
- qdel_null(air_contents)
- qdel_null(holding)
+ QDEL_NULL(air_contents)
+ QDEL_NULL(holding)
. = ..()
/obj/machinery/portable_atmospherics/initialize()
@@ -113,10 +113,10 @@
update_icon()
return
- else if (istype(W, /obj/item/weapon/wrench))
+ else if (W.is_wrench())
if(connected_port)
disconnect()
- user << "You disconnect \the [src] from the port."
+ to_chat(user, "You disconnect \the [src] from the port.")
update_icon()
playsound(src, W.usesound, 50, 1)
return
@@ -124,15 +124,15 @@
var/obj/machinery/atmospherics/portables_connector/possible_port = locate(/obj/machinery/atmospherics/portables_connector/) in loc
if(possible_port)
if(connect(possible_port))
- user << "You connect \the [src] to the port."
+ to_chat(user, "You connect \the [src] to the port.")
update_icon()
playsound(src, W.usesound, 50, 1)
return
else
- user << "\The [src] failed to connect to the port."
+ to_chat(user, "\The [src] failed to connect to the port.")
return
else
- user << "Nothing happens."
+ to_chat(user, "Nothing happens.")
return
else if ((istype(W, /obj/item/device/analyzer)) && Adjacent(user))
@@ -160,7 +160,7 @@
/obj/machinery/portable_atmospherics/powered/attackby(obj/item/I, mob/user)
if(istype(I, /obj/item/weapon/cell))
if(cell)
- user << "There is already a power cell installed."
+ to_chat(user, "There is already a power cell installed.")
return
var/obj/item/weapon/cell/C = I
@@ -173,9 +173,9 @@
power_change()
return
- if(istype(I, /obj/item/weapon/screwdriver))
+ if(I.is_screwdriver())
if(!cell)
- user << "There is no power cell installed."
+ to_chat(user, "There is no power cell installed.")
return
user.visible_message("[user] opens the panel on [src] and removes [cell].", "You open the panel on [src] and remove [cell].")
diff --git a/code/game/machinery/atmoalter/pump.dm b/code/game/machinery/atmoalter/pump.dm
index 9f31a9ba1a..7e2c786734 100644
--- a/code/game/machinery/atmoalter/pump.dm
+++ b/code/game/machinery/atmoalter/pump.dm
@@ -138,7 +138,7 @@
if (holding)
data["holdingTank"] = list("name" = holding.name, "tankPressure" = round(holding.air_contents.return_pressure() > 0 ? holding.air_contents.return_pressure() : 0))
- ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
+ ui = GLOB.nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, "portpump.tmpl", "Portable Pump", 480, 410, state = physical_state)
ui.set_initial_data(data)
diff --git a/code/game/machinery/atmoalter/pump_vr.dm b/code/game/machinery/atmoalter/pump_vr.dm
index d75ba77dc9..e58a81003a 100644
--- a/code/game/machinery/atmoalter/pump_vr.dm
+++ b/code/game/machinery/atmoalter/pump_vr.dm
@@ -83,7 +83,7 @@
update_connected_network()
/obj/machinery/portable_atmospherics/powered/pump/huge/attackby(var/obj/item/I, var/mob/user)
- if(istype(I, /obj/item/weapon/wrench))
+ if(I.is_wrench())
if(on)
user << "Turn \the [src] off first!"
return
@@ -97,7 +97,7 @@
//doesn't use power cells
if(istype(I, /obj/item/weapon/cell))
return
- if (istype(I, /obj/item/weapon/screwdriver))
+ if (I.is_screwdriver())
return
//doesn't hold tanks
@@ -111,7 +111,7 @@
name = "Stationary Air Pump"
/obj/machinery/portable_atmospherics/powered/pump/huge/stationary/attackby(var/obj/item/I, var/mob/user)
- if(istype(I, /obj/item/weapon/wrench))
+ if(I.is_wrench())
user << "The bolts are too tight for you to unscrew!"
return
diff --git a/code/game/machinery/atmoalter/scrubber.dm b/code/game/machinery/atmoalter/scrubber.dm
index 322c13242b..f249d7a8e7 100644
--- a/code/game/machinery/atmoalter/scrubber.dm
+++ b/code/game/machinery/atmoalter/scrubber.dm
@@ -114,7 +114,7 @@
if (holding)
data["holdingTank"] = list("name" = holding.name, "tankPressure" = round(holding.air_contents.return_pressure() > 0 ? holding.air_contents.return_pressure() : 0))
- ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
+ ui = GLOB.nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, "portscrubber.tmpl", "Portable Scrubber", 480, 400, state = physical_state)
ui.set_initial_data(data)
@@ -168,7 +168,7 @@
name = "[name] (ID [id])"
/obj/machinery/portable_atmospherics/powered/scrubber/huge/attack_hand(var/mob/user as mob)
- usr << "You can't directly interact with this machine. Use the scrubber control console."
+ to_chat(user, "You can't directly interact with this machine. Use the scrubber control console.")
/obj/machinery/portable_atmospherics/powered/scrubber/huge/update_icon()
src.overlays = 0
@@ -212,21 +212,21 @@
update_connected_network()
/obj/machinery/portable_atmospherics/powered/scrubber/huge/attackby(var/obj/item/I as obj, var/mob/user as mob)
- if(istype(I, /obj/item/weapon/wrench))
+ if(I.is_wrench())
if(on)
- user << "Turn \the [src] off first!"
+ to_chat(user, "Turn \the [src] off first!")
return
anchored = !anchored
playsound(src.loc, I.usesound, 50, 1)
- user << "You [anchored ? "wrench" : "unwrench"] \the [src]."
+ to_chat(user, "You [anchored ? "wrench" : "unwrench"] \the [src].")
return
//doesn't use power cells
if(istype(I, /obj/item/weapon/cell))
return
- if (istype(I, /obj/item/weapon/screwdriver))
+ if(I.is_screwdriver())
return
//doesn't hold tanks
@@ -240,8 +240,8 @@
name = "Stationary Air Scrubber"
/obj/machinery/portable_atmospherics/powered/scrubber/huge/stationary/attackby(var/obj/item/I as obj, var/mob/user as mob)
- if(istype(I, /obj/item/weapon/wrench))
- user << "The bolts are too tight for you to unscrew!"
+ if(I.is_wrench())
+ to_chat(user, "The bolts are too tight for you to unscrew!")
return
..()
diff --git a/code/game/machinery/autolathe.dm b/code/game/machinery/autolathe.dm
index 5669981f77..0ce85959ef 100644
--- a/code/game/machinery/autolathe.dm
+++ b/code/game/machinery/autolathe.dm
@@ -51,7 +51,7 @@
update_recipe_list()
if(..() || (disabled && !panel_open))
- user << "\The [src] is disabled!"
+ to_chat(user, "\The [src] is disabled!")
return
if(shocked)
@@ -119,7 +119,7 @@
/obj/machinery/autolathe/attackby(var/obj/item/O as obj, var/mob/user as mob)
if(busy)
- user << "\The [src] is busy. Please wait for completion of previous operation."
+ to_chat(user, "\The [src] is busy. Please wait for completion of previous operation.")
return
if(default_deconstruction_screwdriver(user, O))
@@ -135,7 +135,7 @@
if(panel_open)
//Don't eat multitools or wirecutters used on an open lathe.
- if(istype(O, /obj/item/device/multitool) || istype(O, /obj/item/weapon/wirecutters))
+ if(istype(O, /obj/item/device/multitool) || O.is_wirecutter())
attack_hand(user)
return
@@ -146,25 +146,25 @@
return 0
if(istype(O,/obj/item/ammo_magazine/clip) || istype(O,/obj/item/ammo_magazine/s357) || istype(O,/obj/item/ammo_magazine/s38) || istype (O,/obj/item/ammo_magazine/s44)/* VOREstation Edit*/) // Prevents ammo recycling exploit with speedloaders.
- user << "\The [O] is too hazardous to recycle with the autolathe!"
+ to_chat(user, "\The [O] is too hazardous to recycle with the autolathe!")
return
/* ToDo: Make this actually check for ammo and change the value of the magazine if it's empty. -Spades
var/obj/item/ammo_magazine/speedloader = O
if(speedloader.stored_ammo)
- user << "\The [speedloader] is too hazardous to put back into the autolathe while there's ammunition inside of it!"
+ to_chat(user, "\The [speedloader] is too hazardous to put back into the autolathe while there's ammunition inside of it!")
return
else
speedloader.matter = list(DEFAULT_WALL_MATERIAL = 75) // It's just a hunk of scrap metal now.
if(istype(O,/obj/item/ammo_magazine)) // This was just for immersion consistency with above.
var/obj/item/ammo_magazine/mag = O
if(mag.stored_ammo)
- user << "\The [mag] is too hazardous to put back into the autolathe while there's ammunition inside of it!"
+ to_chat(user, "\The [mag] is too hazardous to put back into the autolathe while there's ammunition inside of it!")
return*/
//Resources are being loaded.
var/obj/item/eating = O
if(!eating.matter)
- user << "\The [eating] does not contain significant amounts of useful materials and cannot be accepted."
+ to_chat(user, "\The [eating] does not contain significant amounts of useful materials and cannot be accepted.")
return
var/filltype = 0 // Used to determine message.
@@ -197,12 +197,12 @@
mass_per_sheet += eating.matter[material]
if(!filltype)
- user << "\The [src] is full. Please remove material from the autolathe in order to insert more."
+ to_chat(user, "\The [src] is full. Please remove material from the autolathe in order to insert more.")
return
else if(filltype == 1)
- user << "You fill \the [src] to capacity with \the [eating]."
+ to_chat(user, "You fill \the [src] to capacity with \the [eating].")
else
- user << "You fill \the [src] with \the [eating]."
+ to_chat(user, "You fill \the [src] with \the [eating].")
flick("autolathe_o", src) // Plays metal insertion animation. Work out a good way to work out a fitting animation. ~Z
@@ -228,7 +228,7 @@
add_fingerprint(usr)
if(busy)
- usr << "The autolathe is busy. Please wait for completion of previous operation."
+ to_chat(usr, "The autolathe is busy. Please wait for completion of previous operation.")
return
if(href_list["change_category"])
diff --git a/code/game/machinery/autolathe_vr.dm b/code/game/machinery/autolathe_vr.dm
index 252a31e6af..489c97f2f5 100644
--- a/code/game/machinery/autolathe_vr.dm
+++ b/code/game/machinery/autolathe_vr.dm
@@ -2,7 +2,7 @@
name = "SMG magazine (9mm)"
path = /obj/item/ammo_magazine/m9mml
hidden = 1
-
+/* De-coded?
/datum/category_item/autolathe/arms/classic_smg_9mmr
name = "SMG magazine (9mm rubber)"
path = /obj/item/ammo_magazine/m9mml/rubber
@@ -14,3 +14,4 @@
/datum/category_item/autolathe/arms/classic_smg_9mmf
name = "SMG magazine (9mm flash)"
path = /obj/item/ammo_magazine/m9mml/flash
+*/
\ No newline at end of file
diff --git a/code/game/machinery/biogenerator.dm b/code/game/machinery/biogenerator.dm
index 829c819faf..cd8320b571 100644
--- a/code/game/machinery/biogenerator.dm
+++ b/code/game/machinery/biogenerator.dm
@@ -50,43 +50,43 @@
return
if(istype(O, /obj/item/weapon/reagent_containers/glass))
if(beaker)
- user << "]The [src] is already loaded."
+ to_chat(user, "]The [src] is already loaded.")
else
user.remove_from_mob(O)
O.loc = src
beaker = O
updateUsrDialog()
else if(processing)
- user << "\The [src] is currently processing."
+ to_chat(user, "\The [src] is currently processing.")
else if(istype(O, /obj/item/weapon/storage/bag/plants))
var/i = 0
for(var/obj/item/weapon/reagent_containers/food/snacks/grown/G in contents)
i++
if(i >= 10)
- user << "\The [src] is already full! Activate it."
+ to_chat(user, "\The [src] is already full! Activate it.")
else
for(var/obj/item/weapon/reagent_containers/food/snacks/grown/G in O.contents)
G.loc = src
i++
if(i >= 10)
- user << "You fill \the [src] to its capacity."
+ to_chat(user, "You fill \the [src] to its capacity.")
break
if(i < 10)
- user << "You empty \the [O] into \the [src]."
+ to_chat(user, "You empty \the [O] into \the [src].")
else if(!istype(O, /obj/item/weapon/reagent_containers/food/snacks/grown))
- user << "You cannot put this in \the [src]."
+ to_chat(user, "You cannot put this in \the [src].")
else
var/i = 0
for(var/obj/item/weapon/reagent_containers/food/snacks/grown/G in contents)
i++
if(i >= 10)
- user << "\The [src] is full! Activate it."
+ to_chat(user, "\The [src] is full! Activate it.")
else
user.remove_from_mob(O)
O.loc = src
- user << "You put \the [O] in \the [src]"
+ to_chat(user, "You put \the [O] in \the [src]")
update_icon()
return
@@ -152,7 +152,7 @@
if(stat) //NOPOWER etc
return
if(processing)
- usr << "The biogenerator is in the process of working."
+ to_chat(usr, "The biogenerator is in the process of working.")
return
var/S = 0
for(var/obj/item/weapon/reagent_containers/food/snacks/grown/I in contents)
diff --git a/code/game/machinery/camera/camera.dm b/code/game/machinery/camera/camera.dm
index ad898fff62..4d061899e8 100644
--- a/code/game/machinery/camera/camera.dm
+++ b/code/game/machinery/camera/camera.dm
@@ -156,7 +156,7 @@
/obj/machinery/camera/attackby(obj/item/W as obj, mob/living/user as mob)
update_coverage()
// DECONSTRUCTION
- if(isscrewdriver(W))
+ if(W.is_screwdriver())
//user << "You start to [panel_open ? "close" : "open"] the camera's panel."
//if(toggle_panel(user)) // No delay because no one likes screwdrivers trying to be hip and have a duration cooldown
panel_open = !panel_open
@@ -164,10 +164,10 @@
"You screw the camera's panel [panel_open ? "open" : "closed"].")
playsound(src.loc, W.usesound, 50, 1)
- else if((iswirecutter(W) || ismultitool(W)) && panel_open)
+ else if((W.is_wirecutter() || istype(W, /obj/item/device/multitool)) && panel_open)
interact(user)
- else if(iswelder(W) && (wires.CanDeconstruct() || (stat & BROKEN)))
+ else if(istype(W, /obj/item/weapon/weldingtool) && (wires.CanDeconstruct() || (stat & BROKEN)))
if(weld(W, user))
if(assembly)
assembly.loc = src.loc
diff --git a/code/game/machinery/camera/camera_assembly.dm b/code/game/machinery/camera/camera_assembly.dm
index 67755f24e9..ac876d9632 100644
--- a/code/game/machinery/camera/camera_assembly.dm
+++ b/code/game/machinery/camera/camera_assembly.dm
@@ -29,7 +29,7 @@
if(0)
// State 0
- if(iswrench(W) && isturf(src.loc))
+ if(W.is_wrench() && isturf(src.loc))
playsound(src, W.usesound, 50, 1)
user << "You wrench the assembly into place."
anchored = 1
@@ -40,14 +40,14 @@
if(1)
// State 1
- if(iswelder(W))
+ if(istype(W, /obj/item/weapon/weldingtool))
if(weld(W, user))
user << "You weld the assembly securely into place."
anchored = 1
state = 2
return
- else if(iswrench(W))
+ else if(W.is_wrench())
playsound(src, W.usesound, 50, 1)
user << "You unattach the assembly from its place."
anchored = 0
@@ -57,7 +57,7 @@
if(2)
// State 2
- if(iscoil(W))
+ if(istype(W, /obj/item/stack/cable_coil))
var/obj/item/stack/cable_coil/C = W
if(C.use(2))
user << "You add wires to the assembly."
@@ -66,7 +66,7 @@
user << "You need 2 coils of wire to wire the assembly."
return
- else if(iswelder(W))
+ else if(istype(W, /obj/item/weapon/weldingtool))
if(weld(W, user))
user << "You unweld the assembly from its place."
@@ -77,7 +77,7 @@
if(3)
// State 3
- if(isscrewdriver(W))
+ if(W.is_screwdriver())
playsound(src.loc, W.usesound, 50, 1)
var/input = sanitize(input(usr, "Which networks would you like to connect this camera to? Separate networks with a comma. No Spaces!\nFor example: "+using_map.station_short+",Security,Secret ", "Set Network", camera_network ? camera_network : NETWORK_DEFAULT))
@@ -115,7 +115,7 @@
break
return
- else if(iswirecutter(W))
+ else if(W.is_wirecutter())
new/obj/item/stack/cable_coil(get_turf(src), 2)
playsound(src.loc, W.usesound, 50, 1)
@@ -132,7 +132,7 @@
return
// Taking out upgrades
- else if(iscrowbar(W) && upgrades.len)
+ else if(W.is_crowbar() && upgrades.len)
var/obj/U = locate(/obj) in upgrades
if(U)
user << "You unattach an upgrade from the assembly."
diff --git a/code/game/machinery/cell_charger.dm b/code/game/machinery/cell_charger.dm
index 6cb9e63eb5..bad819a985 100644
--- a/code/game/machinery/cell_charger.dm
+++ b/code/game/machinery/cell_charger.dm
@@ -61,7 +61,7 @@
user.visible_message("[user] inserts a cell into the charger.", "You insert a cell into the charger.")
chargelevel = -1
update_icon()
- else if(istype(W, /obj/item/weapon/wrench))
+ else if(W.is_wrench())
if(charging)
user << "Remove the cell first!"
return
diff --git a/code/game/machinery/cloning.dm b/code/game/machinery/cloning.dm
index a1ef2a8a83..6b5926042f 100644
--- a/code/game/machinery/cloning.dm
+++ b/code/game/machinery/cloning.dm
@@ -252,7 +252,7 @@
user.drop_item()
W.forceMove(src)
return
- else if(istype(W, /obj/item/weapon/wrench))
+ else if(W.is_wrench())
if(locked && (anchored || occupant))
to_chat(user, "Can not do that while [src] is in use.")
else
diff --git a/code/game/machinery/computer/Operating.dm b/code/game/machinery/computer/Operating.dm
index 12fafff5ff..ef1beeaac0 100644
--- a/code/game/machinery/computer/Operating.dm
+++ b/code/game/machinery/computer/Operating.dm
@@ -55,7 +55,7 @@
data["table"] = table
data["victim"] = victim_ui
- ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
+ ui = GLOB.nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, "operating.tmpl", src.name, 380, 400)
ui.set_initial_data(data)
@@ -69,4 +69,4 @@
usr.set_machine(src)
src.add_fingerprint(usr)
- nanomanager.update_uis(src)
\ No newline at end of file
+ GLOB.nanomanager.update_uis(src)
\ No newline at end of file
diff --git a/code/game/machinery/computer/ai_core.dm b/code/game/machinery/computer/ai_core.dm
index 0e68f1e7a3..bc6da68332 100644
--- a/code/game/machinery/computer/ai_core.dm
+++ b/code/game/machinery/computer/ai_core.dm
@@ -14,75 +14,75 @@
switch(state)
if(0)
- if(istype(P, /obj/item/weapon/wrench))
+ if(P.is_wrench())
playsound(loc, P.usesound, 50, 1)
if(do_after(user, 20 * P.toolspeed))
- user << "You wrench the frame into place."
+ to_chat(user, "You wrench the frame into place.")
anchored = 1
state = 1
if(istype(P, /obj/item/weapon/weldingtool))
var/obj/item/weapon/weldingtool/WT = P
if(!WT.isOn())
- user << "The welder must be on for this task."
+ to_chat(user, "The welder must be on for this task.")
return
playsound(loc, WT.usesound, 50, 1)
if(do_after(user, 20 * WT.toolspeed))
if(!src || !WT.remove_fuel(0, user)) return
- user << "You deconstruct the frame."
+ to_chat(user, "You deconstruct the frame.")
new /obj/item/stack/material/plasteel( loc, 4)
qdel(src)
if(1)
- if(istype(P, /obj/item/weapon/wrench))
+ if(P.is_wrench())
playsound(loc, P.usesound, 50, 1)
if(do_after(user, 20 * P.toolspeed))
- user << "You unfasten the frame."
+ to_chat(user, "You unfasten the frame.")
anchored = 0
state = 0
if(istype(P, /obj/item/weapon/circuitboard/aicore) && !circuit)
playsound(loc, 'sound/items/Deconstruct.ogg', 50, 1)
- user << "You place the circuit board inside the frame."
+ to_chat(user, "You place the circuit board inside the frame.")
icon_state = "1"
circuit = P
user.drop_item()
P.loc = src
- if(istype(P, /obj/item/weapon/screwdriver) && circuit)
+ if(P.is_screwdriver() && circuit)
playsound(loc, P.usesound, 50, 1)
- user << "You screw the circuit board into place."
+ to_chat(user, "You screw the circuit board into place.")
state = 2
icon_state = "2"
- if(istype(P, /obj/item/weapon/crowbar) && circuit)
+ if(P.is_crowbar() && circuit)
playsound(loc, P.usesound, 50, 1)
- user << "You remove the circuit board."
+ to_chat(user, "You remove the circuit board.")
state = 1
icon_state = "0"
circuit.loc = loc
circuit = null
if(2)
- if(istype(P, /obj/item/weapon/screwdriver) && circuit)
+ if(P.is_screwdriver() && circuit)
playsound(loc, P.usesound, 50, 1)
- user << "You unfasten the circuit board."
+ to_chat(user, "You unfasten the circuit board.")
state = 1
icon_state = "1"
if(istype(P, /obj/item/stack/cable_coil))
var/obj/item/stack/cable_coil/C = P
if (C.get_amount() < 5)
- user << "You need five coils of wire to add them to the frame."
+ to_chat(user, "You need five coils of wire to add them to the frame.")
return
- user << "You start to add cables to the frame."
+ to_chat(user, "You start to add cables to the frame.")
playsound(loc, 'sound/items/Deconstruct.ogg', 50, 1)
if (do_after(user, 20) && state == 2)
if (C.use(5))
state = 3
icon_state = "3"
- user << "You add cables to the frame."
+ to_chat(user, "You add cables to the frame.")
return
if(3)
- if(istype(P, /obj/item/weapon/wirecutters))
+ if(P.is_wirecutter())
if (brain)
- user << "Get that brain out of there first"
+ to_chat(user, "Get that brain out of there first")
else
playsound(loc, P.usesound, 50, 1)
- user << "You remove the cables."
+ to_chat(user, "You remove the cables.")
state = 2
icon_state = "2"
var/obj/item/stack/cable_coil/A = new /obj/item/stack/cable_coil( loc )
@@ -91,13 +91,13 @@
if(istype(P, /obj/item/stack/material) && P.get_material_name() == "rglass")
var/obj/item/stack/RG = P
if (RG.get_amount() < 2)
- user << "You need two sheets of glass to put in the glass panel."
+ to_chat(user, "You need two sheets of glass to put in the glass panel.")
return
- user << "You start to put in the glass panel."
+ to_chat(user, "You start to put in the glass panel.")
playsound(loc, 'sound/items/Deconstruct.ogg', 50, 1)
if (do_after(user, 20) && state == 3)
if(RG.use(2))
- user << "You put in the glass panel."
+ to_chat(user, "You put in the glass panel.")
state = 4
icon_state = "4"
@@ -126,14 +126,14 @@
if(istype(P, /obj/item/device/mmi))
var/obj/item/device/mmi/M = P
if(!M.brainmob)
- user << "Sticking an empty [P] into the frame would sort of defeat the purpose."
+ to_chat(user, "Sticking an empty [P] into the frame would sort of defeat the purpose.")
return
if(M.brainmob.stat == 2)
- user << "Sticking a dead [P] into the frame would sort of defeat the purpose."
+ to_chat(user, "Sticking a dead [P] into the frame would sort of defeat the purpose.")
return
if(jobban_isbanned(M.brainmob, "AI"))
- user << "This [P] does not seem to fit."
+ to_chat(user, "This [P] does not seem to fit.")
return
if(M.brainmob.mind)
@@ -145,17 +145,17 @@
usr << "Added [P]."
icon_state = "3b"
- if(istype(P, /obj/item/weapon/crowbar) && brain)
+ if(P.is_crowbar() && brain)
playsound(loc, P.usesound, 50, 1)
- user << "You remove the brain."
+ to_chat(user, "You remove the brain.")
brain.loc = loc
brain = null
icon_state = "3"
if(4)
- if(istype(P, /obj/item/weapon/crowbar))
+ if(P.is_crowbar())
playsound(loc, P.usesound, 50, 1)
- user << "You remove the glass panel."
+ to_chat(user, "You remove the glass panel.")
state = 3
if (brain)
icon_state = "3b"
@@ -164,9 +164,9 @@
new /obj/item/stack/material/glass/reinforced( loc, 2 )
return
- if(istype(P, /obj/item/weapon/screwdriver))
+ if(P.is_screwdriver())
playsound(loc, P.usesound, 50, 1)
- user << "You connect the monitor."
+ to_chat(user, "You connect the monitor.")
if(!brain)
var/open_for_latejoin = alert(user, "Would you like this core to be open for latejoining AIs?", "Latejoin", "Yes", "Yes", "No") == "Yes"
var/obj/structure/AIcore/deactivated/D = new(loc)
@@ -230,9 +230,9 @@ GLOBAL_LIST_BOILERPLATE(all_deactivated_AI_cores, /obj/structure/AIcore/deactiva
if(transfer)
load_ai(transfer,card,user)
else
- user << "ERROR: Unable to locate artificial intelligence."
+ to_chat(user, "ERROR: Unable to locate artificial intelligence.")
return
- else if(istype(W, /obj/item/weapon/wrench))
+ else if(W.is_wrench())
if(anchored)
user.visible_message("\The [user] starts to unbolt \the [src] from the plating...")
playsound(src, W.usesound, 50, 1)
@@ -270,7 +270,7 @@ GLOBAL_LIST_BOILERPLATE(all_deactivated_AI_cores, /obj/structure/AIcore/deactiva
if(D in empty_playable_ai_cores)
empty_playable_ai_cores -= D
- src << "\The [id] is now not available for latejoining AIs."
+ to_chat(src, "\The [id] is now not available for latejoining AIs.")
else
empty_playable_ai_cores += D
- src << "\The [id] is now available for latejoining AIs."
+ to_chat(src, "\The [id] is now available for latejoining AIs.")
diff --git a/code/game/machinery/computer/arcade.dm b/code/game/machinery/computer/arcade.dm
index 0724cd15be..dbd96823c1 100644
--- a/code/game/machinery/computer/arcade.dm
+++ b/code/game/machinery/computer/arcade.dm
@@ -139,7 +139,7 @@
data["enemyHP"] = enemy_hp
data["gameOver"] = gameover
- ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
+ ui = GLOB.nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, "arcade_battle.tmpl", src.name, 400, 300)
ui.set_initial_data(data)
@@ -201,7 +201,7 @@
emagged = 0
src.add_fingerprint(usr)
- nanomanager.update_uis(src)
+ GLOB.nanomanager.update_uis(src)
return
/obj/machinery/computer/arcade/battle/proc/arcade_action()
diff --git a/code/game/machinery/computer/atmos_alert.dm b/code/game/machinery/computer/atmos_alert.dm
index eef148a830..d757ae777d 100644
--- a/code/game/machinery/computer/atmos_alert.dm
+++ b/code/game/machinery/computer/atmos_alert.dm
@@ -37,7 +37,7 @@ var/global/list/minor_air_alarms = list()
data["priority_alarms"] = major_alarms
data["minor_alarms"] = minor_alarms
- ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
+ ui = GLOB.nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if(!ui)
ui = new(user, src, ui_key, "atmos_alert.tmpl", src.name, 500, 500)
ui.set_initial_data(data)
diff --git a/code/game/machinery/computer/buildandrepair.dm b/code/game/machinery/computer/buildandrepair.dm
index 6d7243c36c..960ce3dc35 100644
--- a/code/game/machinery/computer/buildandrepair.dm
+++ b/code/game/machinery/computer/buildandrepair.dm
@@ -13,75 +13,75 @@
/obj/structure/computerframe/attackby(obj/item/P as obj, mob/user as mob)
switch(state)
if(0)
- if(istype(P, /obj/item/weapon/wrench))
+ if(P.is_wrench())
playsound(src.loc, P.usesound, 50, 1)
if(do_after(user, 20 * P.toolspeed))
- user << "You wrench the frame into place."
+ to_chat(user, "You wrench the frame into place.")
src.anchored = 1
src.state = 1
if(istype(P, /obj/item/weapon/weldingtool))
var/obj/item/weapon/weldingtool/WT = P
if(!WT.remove_fuel(0, user))
- user << "The welding tool must be on to complete this task."
+ to_chat(user, "The welding tool must be on to complete this task.")
return
playsound(src.loc, WT.usesound, 50, 1)
if(do_after(user, 20 * WT.toolspeed))
if(!src || !WT.isOn()) return
- user << "You deconstruct the frame."
+ to_chat(user, "You deconstruct the frame.")
new /obj/item/stack/material/steel( src.loc, 5 )
qdel(src)
if(1)
- if(istype(P, /obj/item/weapon/wrench))
+ if(P.is_wrench())
playsound(src.loc, P.usesound, 50, 1)
if(do_after(user, 20 * P.toolspeed))
- user << "You unfasten the frame."
+ to_chat(user, "You unfasten the frame.")
src.anchored = 0
src.state = 0
if(istype(P, /obj/item/weapon/circuitboard) && !circuit)
var/obj/item/weapon/circuitboard/B = P
if(B.board_type == "computer")
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
- user << "You place the circuit board inside the frame."
+ to_chat(user, "You place the circuit board inside the frame.")
src.icon_state = "1"
src.circuit = P
user.drop_item()
P.loc = src
else
- user << "This frame does not accept circuit boards of this type!"
- if(istype(P, /obj/item/weapon/screwdriver) && circuit)
+ to_chat(user, "This frame does not accept circuit boards of this type!")
+ if(P.is_screwdriver() && circuit)
playsound(src.loc, P.usesound, 50, 1)
- user << "You screw the circuit board into place."
+ to_chat(user, "You screw the circuit board into place.")
src.state = 2
src.icon_state = "2"
- if(istype(P, /obj/item/weapon/crowbar) && circuit)
+ if(P.is_crowbar()) && circuit)
playsound(src.loc, P.usesound, 50, 1)
- user << "You remove the circuit board."
+ to_chat(user, "You remove the circuit board.")
src.state = 1
src.icon_state = "0"
circuit.loc = src.loc
src.circuit = null
if(2)
- if(istype(P, /obj/item/weapon/screwdriver) && circuit)
+ if(P.is_screwdriver() && circuit)
playsound(src.loc, P.usesound, 50, 1)
- user << "You unfasten the circuit board."
+ to_chat(user, "You unfasten the circuit board.")
src.state = 1
src.icon_state = "1"
if(istype(P, /obj/item/stack/cable_coil))
var/obj/item/stack/cable_coil/C = P
if (C.get_amount() < 5)
- user << "You need five coils of wire to add them to the frame."
+ to_chat(user, "You need five coils of wire to add them to the frame.")
return
- user << "You start to add cables to the frame."
+ to_chat(user, "You start to add cables to the frame.")
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
if(do_after(user, 20) && state == 2)
if (C.use(5))
- user << "You add cables to the frame."
+ to_chat(user, "You add cables to the frame.")
state = 3
icon_state = "3"
if(3)
- if(istype(P, /obj/item/weapon/wirecutters))
+ if(P.is_wirecutter())
playsound(src.loc, P.usesound, 50, 1)
- user << "You remove the cables."
+ to_chat(user, "You remove the cables.")
src.state = 2
src.icon_state = "2"
var/obj/item/stack/cable_coil/A = new /obj/item/stack/cable_coil( src.loc )
@@ -90,25 +90,25 @@
if(istype(P, /obj/item/stack/material) && P.get_material_name() == "glass")
var/obj/item/stack/G = P
if (G.get_amount() < 2)
- user << "You need two sheets of glass to put in the glass panel."
+ to_chat(user, "You need two sheets of glass to put in the glass panel.")
return
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
- user << "You start to put in the glass panel."
+ to_chat(user, "You start to put in the glass panel.")
if(do_after(user, 20) && state == 3)
if (G.use(2))
- user << "You put in the glass panel."
+ to_chat(user, "You put in the glass panel.")
src.state = 4
src.icon_state = "4"
if(4)
- if(istype(P, /obj/item/weapon/crowbar))
+ if(P.is_crowbar())
playsound(src.loc, P.usesound, 50, 1)
- user << "You remove the glass panel."
+ to_chat(user, "You remove the glass panel.")
src.state = 3
src.icon_state = "3"
new /obj/item/stack/material/glass( src.loc, 2 )
- if(istype(P, /obj/item/weapon/screwdriver))
+ if(P.is_screwdriver())
playsound(src.loc, P.usesound, 50, 1)
- user << "You connect the monitor."
+ to_chat(user, "You connect the monitor.")
var/B = new src.circuit.build_path ( src.loc )
src.circuit.construct(B)
qdel(src)
diff --git a/code/game/machinery/computer/camera.dm b/code/game/machinery/computer/camera.dm
index 7c16309ec0..745bdc0694 100644
--- a/code/game/machinery/computer/camera.dm
+++ b/code/game/machinery/computer/camera.dm
@@ -49,7 +49,7 @@
switch_to_camera(user, current_camera)
data["map_levels"] = using_map.get_map_levels(src.z)
- ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
+ ui = GLOB.nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, "sec_camera.tmpl", "Camera Console", 900, 800)
@@ -152,7 +152,7 @@
/obj/machinery/computer/security/process()
if(cache_id != camera_repository.camera_cache_id)
cache_id = camera_repository.camera_cache_id
- nanomanager.update_uis(src)
+ GLOB.nanomanager.update_uis(src)
/obj/machinery/computer/security/proc/can_access_camera(var/obj/machinery/camera/C)
var/list/shared_networks = src.network & C.network
diff --git a/code/game/machinery/computer/camera_circuit.dm b/code/game/machinery/computer/camera_circuit.dm
index 436703f724..347eb145c4 100644
--- a/code/game/machinery/computer/camera_circuit.dm
+++ b/code/game/machinery/computer/camera_circuit.dm
@@ -38,7 +38,7 @@
attackby(var/obj/item/I, var/mob/user)//if(health > 50)
..()
- else if(istype(I,/obj/item/weapon/screwdriver))
+ else if(I.is_screwdriver())
secured = !secured
user.visible_message("The [src] can [secured ? "no longer" : "now"] be modified.")
playsound(src, I.usesound, 50, 1)
diff --git a/code/game/machinery/computer/card.dm b/code/game/machinery/computer/card.dm
index 8bf00b4ace..d23c199db0 100644
--- a/code/game/machinery/computer/card.dm
+++ b/code/game/machinery/computer/card.dm
@@ -68,7 +68,7 @@
id_card.forceMove(src)
modify = id_card
- nanomanager.update_uis(src)
+ GLOB.nanomanager.update_uis(src)
attack_hand(user)
/obj/machinery/computer/card/attack_ai(var/mob/user as mob)
@@ -139,7 +139,7 @@
data["regions"] = regions
- ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
+ ui = GLOB.nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, "identification_computer.tmpl", src.name, 600, 700)
ui.set_initial_data(data)
@@ -235,7 +235,7 @@
modify.registered_name = temp_name
else
src.visible_message("[src] buzzes rudely.")
- nanomanager.update_uis(src)
+ GLOB.nanomanager.update_uis(src)
if ("account")
if (is_authenticated())
@@ -243,7 +243,7 @@
if ((modify == t2 && (in_range(src, usr) || (istype(usr, /mob/living/silicon))) && istype(loc, /turf)))
var/account_num = text2num(href_list["account"])
modify.associated_account_number = account_num
- nanomanager.update_uis(src)
+ GLOB.nanomanager.update_uis(src)
if ("mode")
mode = text2num(href_list["mode_target"])
@@ -253,7 +253,7 @@
printing = 1
spawn(50)
printing = null
- nanomanager.update_uis(src)
+ GLOB.nanomanager.update_uis(src)
var/obj/item/weapon/paper/P = new(loc)
if (mode)
diff --git a/code/game/machinery/computer/cloning.dm b/code/game/machinery/computer/cloning.dm
index 9660eca8bc..cbf0041025 100644
--- a/code/game/machinery/computer/cloning.dm
+++ b/code/game/machinery/computer/cloning.dm
@@ -146,7 +146,7 @@
data["diskette"] = diskette
data["temp"] = temp
- ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
+ ui = GLOB.nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, "cloning.tmpl", src.name, 400, 450)
ui.set_initial_data(data)
@@ -284,7 +284,7 @@
temp = ""
scantemp = ""
- nanomanager.update_uis(src)
+ GLOB.nanomanager.update_uis(src)
add_fingerprint(usr)
/obj/machinery/computer/cloning/proc/scan_mob(mob/living/carbon/human/subject as mob)
diff --git a/code/game/machinery/computer/computer.dm b/code/game/machinery/computer/computer.dm
index 7dd31da9a8..6c5817c036 100644
--- a/code/game/machinery/computer/computer.dm
+++ b/code/game/machinery/computer/computer.dm
@@ -106,11 +106,11 @@
if(istype(I,/obj/item/weapon/gripper)) //Behold, Grippers and their horribleness. If ..() is called by any computers' attackby() now or in the future, this should let grippers work with them appropriately.
var/obj/item/weapon/gripper/B = I //B, for Borg.
if(!B.wrapped)
- user << "\The [B] is not holding anything."
+ to_chat(user, "\The [B] is not holding anything.")
return
else
var/B_held = B.wrapped
- user << "You use \the [B] to use \the [B_held] with \the [src]."
+ to_chat(user, "You use \the [B] to use \the [B_held] with \the [src].")
playsound(src, "keyboard", 100, 1, 0)
return
attack_hand(user)
diff --git a/code/game/machinery/computer/guestpass.dm b/code/game/machinery/computer/guestpass.dm
index 3345e30ab7..91a4a76bb8 100644
--- a/code/game/machinery/computer/guestpass.dm
+++ b/code/game/machinery/computer/guestpass.dm
@@ -55,7 +55,7 @@
return ..()
/obj/item/weapon/card/id/guest/initialize()
- . = ..()
+ . = ..()
processing_objects.Add(src)
update_icon()
@@ -104,7 +104,7 @@
if(!giver && user.unEquip(I))
I.forceMove(src)
giver = I
- nanomanager.update_uis(src)
+ GLOB.nanomanager.update_uis(src)
else if(giver)
user << "There is already ID card inside."
return
@@ -150,7 +150,7 @@
data["log"] = internal_log
data["uid"] = uid
- ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
+ ui = GLOB.nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, "guest_pass.tmpl", src.name, 400, 520)
ui.set_initial_data(data)
@@ -242,4 +242,4 @@
usr << "Cannot issue pass without issuing ID."
src.add_fingerprint(usr)
- nanomanager.update_uis(src)
\ No newline at end of file
+ GLOB.nanomanager.update_uis(src)
\ No newline at end of file
diff --git a/code/game/machinery/computer/message.dm b/code/game/machinery/computer/message.dm
index fd82940b6d..670b637152 100644
--- a/code/game/machinery/computer/message.dm
+++ b/code/game/machinery/computer/message.dm
@@ -36,7 +36,7 @@
return
if(!istype(user))
return
- if(isscrewdriver(O) && emag)
+ if(O.is_screwdriver() && emag)
//Stops people from just unscrewing the monitor and putting it back to get the console working again.
user << "It is too hot to mess with!"
return
diff --git a/code/game/machinery/computer/pod.dm b/code/game/machinery/computer/pod.dm
index ee42ed18bd..1d210787de 100644
--- a/code/game/machinery/computer/pod.dm
+++ b/code/game/machinery/computer/pod.dm
@@ -52,11 +52,11 @@
/*
/obj/machinery/computer/pod/attackby(I as obj, user as mob)
- if(istype(I, /obj/item/weapon/screwdriver))
+ if(I.is_screwdriver())
playsound(src.loc, W.usesound, 50, 1)
if(do_after(user, 20))
if(stat & BROKEN)
- user << "The broken glass falls out."
+ to_chat(user, "The broken glass falls out.")
var/obj/structure/computerframe/A = new /obj/structure/computerframe( loc )
new /obj/item/weapon/material/shard( loc )
@@ -80,7 +80,7 @@
A.anchored = 1
qdel(src)
else
- user << "You disconnect the monitor."
+ to_chat(user << "You disconnect the monitor.")
var/obj/structure/computerframe/A = new /obj/structure/computerframe( loc )
//generate appropriate circuitboard. Accounts for /pod/old computer types
@@ -210,7 +210,7 @@
/obj/machinery/computer/pod/old/syndicate/attack_hand(var/mob/user as mob)
if(!allowed(user))
- user << "Access Denied"
+ to_chat(user, "Access Denied")
return
else
..()
diff --git a/code/game/machinery/computer/robot.dm b/code/game/machinery/computer/robot.dm
index f91ac2b677..c6c2c94a9e 100644
--- a/code/game/machinery/computer/robot.dm
+++ b/code/game/machinery/computer/robot.dm
@@ -19,7 +19,7 @@
data["is_ai"] = issilicon(user)
- ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
+ ui = GLOB.nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, "robot_control.tmpl", "Robotic Control Console", 400, 500)
ui.set_initial_data(data)
diff --git a/code/game/machinery/computer/supply.dm b/code/game/machinery/computer/supply.dm
index e76f4db468..fcaa2b4d8a 100644
--- a/code/game/machinery/computer/supply.dm
+++ b/code/game/machinery/computer/supply.dm
@@ -1,226 +1,196 @@
+// While it initially feels like the ordering console should be a subtype of the main console,
+// their function is similar enough that the ordering console emerges as the less specialized,
+// and therefore more deserving of parent-class status -- Ater
+
+// Supply requests console
/obj/machinery/computer/supplycomp
+ name = "supply ordering console"
+ icon_screen = "request"
+ circuit = /obj/item/weapon/circuitboard/supplycomp
+ var/authorization = 0
+ var/temp = null
+ var/reqtime = 0 //Cooldown for requisitions - Quarxink
+ var/can_order_contraband = 0
+ var/active_category = null
+ var/menu_tab = 0
+ var/list/expanded_packs = list()
+
+// Supply control console
+/obj/machinery/computer/supplycomp/control
name = "supply control console"
icon_keyboard = "tech_key"
icon_screen = "supply"
light_color = "#b88b2e"
req_access = list(access_cargo)
- circuit = /obj/item/weapon/circuitboard/supplycomp
- var/temp = null
- var/reqtime = 0 //Cooldown for requisitions - Quarxink
- var/can_order_contraband = 0
- var/last_viewed_group = "categories"
-
-/obj/machinery/computer/ordercomp
- name = "supply ordering console"
- icon_screen = "request"
- circuit = /obj/item/weapon/circuitboard/ordercomp
- var/temp = null
- var/reqtime = 0 //Cooldown for requisitions - Quarxink
- var/last_viewed_group = "categories"
-
-/obj/machinery/computer/ordercomp/attack_ai(var/mob/user as mob)
- return attack_hand(user)
+ circuit = /obj/item/weapon/circuitboard/supplycomp/control
+ authorization = SUP_SEND_SHUTTLE | SUP_ACCEPT_ORDERS
/obj/machinery/computer/supplycomp/attack_ai(var/mob/user as mob)
return attack_hand(user)
-/obj/machinery/computer/ordercomp/attack_hand(var/mob/user as mob)
- if(..())
- return
- user.set_machine(src)
- var/dat
- if(temp)
- dat = temp
- else
- var/datum/shuttle/ferry/supply/shuttle = supply_controller.shuttle
- if (shuttle)
- dat += {"
Supply shuttle
- Location: [shuttle.has_arrive_time() ? "Moving to station ([shuttle.eta_minutes()] Mins.)":shuttle.at_station() ? "Docked":"Away"]
-
Supply points: [supply_controller.points]
-
\nRequest items
- View approved orders
- View requests
- \nView export report
- Close"}
-
- user << browse(dat, "window=computer;size=575x450")
- onclose(user, "computer")
- return
-
-/obj/machinery/computer/ordercomp/Topic(href, href_list)
- if(..())
- return 1
-
- if( isturf(loc) && (in_range(src, usr) || istype(usr, /mob/living/silicon)) )
- usr.set_machine(src)
-
- if(href_list["order"])
- if(href_list["order"] == "categories")
- //all_supply_groups
- //Request what?
- last_viewed_group = "categories"
- temp = "Supply points: [supply_controller.points]
"
- temp += "Main Menu
"
- temp += "Select a category
"
- for(var/supply_group_name in all_supply_groups )
- temp += "[supply_group_name]
"
- else
- last_viewed_group = href_list["order"]
- temp = "Supply points: [supply_controller.points]
"
- temp += "Back to all categories
"
- temp += "Request from: [last_viewed_group]
"
- for(var/supply_name in supply_controller.supply_packs )
- var/datum/supply_packs/N = supply_controller.supply_packs[supply_name]
- if(N.hidden || N.contraband || N.group != last_viewed_group) continue //Have to send the type instead of a reference to
- temp += "[supply_name] Cost: [N.cost]
" //the obj because it would get caught by the garbage
-
- else if (href_list["doorder"])
- if(world.time < reqtime)
- for(var/mob/V in hearers(src))
- V.show_message("[src]'s monitor flashes, \"[world.time - reqtime] seconds remaining until another requisition form may be printed.\"")
- return
-
- //Find the correct supply_pack datum
- var/datum/supply_packs/P = supply_controller.supply_packs[href_list["doorder"]]
- if(!istype(P)) return
-
- var/timeout = world.time + 600
- var/reason = sanitize(input(usr,"Reason:","Why do you require this item?","") as null|text)
- if(world.time > timeout) return
- if(!reason) return
-
- var/idname = "*None Provided*"
- var/idrank = "*None Provided*"
- if(ishuman(usr))
- var/mob/living/carbon/human/H = usr
- idname = H.get_authentification_name()
- idrank = H.get_assignment()
- else if(issilicon(usr))
- idname = usr.real_name
-
- supply_controller.ordernum++
- var/obj/item/weapon/paper/reqform = new /obj/item/weapon/paper(loc)
- reqform.name = "Requisition Form - [P.name]"
- reqform.info += "[station_name()] Supply Requisition Form
"
- reqform.info += "INDEX: #[supply_controller.ordernum]
"
- reqform.info += "REQUESTED BY: [idname]
"
- reqform.info += "RANK: [idrank]
"
- reqform.info += "REASON: [reason]
"
- reqform.info += "SUPPLY CRATE TYPE: [P.name]
"
- reqform.info += "ACCESS RESTRICTION: [get_access_desc(P.access)]
"
- reqform.info += "CONTENTS:
"
- reqform.info += P.manifest
- reqform.info += "
"
- reqform.info += "STAMP BELOW TO APPROVE THIS REQUISITION:
"
-
- reqform.update_icon() //Fix for appearing blank when printed.
- reqtime = (world.time + 5) % 1e5
-
- //make our supply_order datum
- var/datum/supply_order/O = new /datum/supply_order()
- O.ordernum = supply_controller.ordernum
- O.object = P
- O.orderedby = idname
- supply_controller.requestlist += O
-
- temp = "Thanks for your request. The cargo team will process it as soon as possible.
"
- temp += "
Back Main Menu"
-
- else if (href_list["vieworders"])
- temp = "Current approved orders:
"
- for(var/S in supply_controller.shoppinglist)
- var/datum/supply_order/SO = S
- temp += "[SO.object.name] approved by [SO.orderedby] [SO.comment ? "([SO.comment])":""]
"
- temp += "
OK"
-
- else if (href_list["viewrequests"])
- temp = "Current requests:
"
- for(var/S in supply_controller.requestlist)
- var/datum/supply_order/SO = S
- temp += "#[SO.ordernum] - [SO.object.name] requested by [SO.orderedby]
"
- temp += "
OK"
-
- else if (href_list["mainmenu"])
- temp = null
-
- add_fingerprint(usr)
- updateUsrDialog()
- return
-
/obj/machinery/computer/supplycomp/attack_hand(var/mob/user as mob)
- if(!allowed(user))
- user << "Access Denied."
- return
-
if(..())
return
user.set_machine(src)
- post_signal("supply")
- var/dat
- if (temp)
- dat = temp
- else
- var/datum/shuttle/ferry/supply/shuttle = supply_controller.shuttle
- if (shuttle)
- dat += "
Supply shuttle
"
- dat += "\nLocation: "
- if (shuttle.has_arrive_time())
- dat += "In transit ([shuttle.eta_minutes()] Mins.)
"
- else
- if (shuttle.at_station())
- if (shuttle.docking_controller)
- switch(shuttle.docking_controller.get_docking_status())
- if ("docked") dat += "Docked at station
"
- if ("undocked") dat += "Undocked from station
"
- if ("docking") dat += "Docking with station [shuttle.can_force()? "Force Launch" : ""]
"
- if ("undocking") dat += "Undocking from station [shuttle.can_force()? "Force Launch" : ""]
"
- else
- dat += "Station
"
-
- if (shuttle.can_launch())
- dat += "Send away"
- else if (shuttle.can_cancel())
- dat += "Cancel launch"
- else
- dat += "*Shuttle is busy*"
- dat += "
\n
"
- else
- dat += "Away
"
- if (shuttle.can_launch())
- dat += "Request supply shuttle"
- else if (shuttle.can_cancel())
- dat += "Cancel request"
- else
- dat += "*Shuttle is busy*"
- dat += "
\n
"
-
-
- dat += {"
\nSupply points: [supply_controller.points]
\n
- \nOrder items
\n
- \nView requests
\n
- \nView orders
\n
- \nView export report
\n
- \nClose"}
-
-
- user << browse(dat, "window=computer;size=575x450")
- onclose(user, "computer")
+ ui_interact(user)
return
/obj/machinery/computer/supplycomp/emag_act(var/remaining_charges, var/mob/user)
if(!can_order_contraband)
- user << "Special supplies unlocked."
- can_order_contraband = 1
+ to_chat(user, "Special supplies unlocked.")
+ authorization |= SUP_CONTRABAND
req_access = list()
return 1
+
+
+
+/obj/machinery/computer/supplycomp/ui_interact(mob/user, ui_key = "supply_records", var/datum/nanoui/ui = null, var/force_open = 1, var/key_state = null)
+ var/data[0]
+ var/shuttle_status[0] // Supply shuttle status
+ var/pack_list[0] // List of supply packs within the active_category
+ var/orders[0]
+ var/receipts[0]
+
+ var/datum/shuttle/ferry/supply/shuttle = supply_controller.shuttle
+ if(shuttle)
+ if(shuttle.has_arrive_time())
+ shuttle_status["location"] = "In transit"
+ shuttle_status["mode"] = SUP_SHUTTLE_TRANSIT
+ shuttle_status["time"] = shuttle.eta_minutes()
+
+ else
+ shuttle_status["time"] = 0
+ if(shuttle.at_station())
+ if(shuttle.docking_controller)
+ switch(shuttle.docking_controller.get_docking_status())
+ if("docked")
+ shuttle_status["location"] = "Docked"
+ shuttle_status["mode"] = SUP_SHUTTLE_DOCKED
+ if("undocked")
+ shuttle_status["location"] = "Undocked"
+ shuttle_status["mode"] = SUP_SHUTTLE_UNDOCKED
+ if("docking")
+ shuttle_status["location"] = "Docking"
+ shuttle_status["mode"] = SUP_SHUTTLE_DOCKING
+ shuttle_status["force"] = shuttle.can_force()
+ if("undocking")
+ shuttle_status["location"] = "Undocking"
+ shuttle_status["mode"] = SUP_SHUTTLE_UNDOCKING
+ shuttle_status["force"] = shuttle.can_force()
+
+ else
+ shuttle_status["location"] = "Station"
+ shuttle_status["mode"] = SUP_SHUTTLE_DOCKED
+
+ else
+ shuttle_status["location"] = "Away"
+ shuttle_status["mode"] = SUP_SHUTTLE_AWAY
+
+ if(shuttle.can_launch())
+ shuttle_status["launch"] = 1
+ else if(shuttle.can_cancel())
+ shuttle_status["launch"] = 2
+ else
+ shuttle_status["launch"] = 0
+
+ switch(shuttle.moving_status)
+ if(SHUTTLE_IDLE)
+ shuttle_status["engine"] = "Idle"
+ if(SHUTTLE_WARMUP)
+ shuttle_status["engine"] = "Warming up"
+ if(SHUTTLE_INTRANSIT)
+ shuttle_status["engine"] = "Engaged"
+
+ else
+ shuttle["mode"] = SUP_SHUTTLE_ERROR
+
+ for(var/pack_name in supply_controller.supply_pack)
+ var/datum/supply_pack/P = supply_controller.supply_pack[pack_name]
+ if(P.group == active_category)
+ var/list/pack = list(
+ "name" = P.name,
+ "cost" = P.cost,
+ "contraband" = P.contraband,
+ "manifest" = uniquelist(P.manifest),
+ "random" = P.num_contained,
+ "expand" = 0,
+ "ref" = "\ref[P]"
+ )
+
+ if(P in expanded_packs)
+ pack["expand"] = 1
+
+ pack_list[++pack_list.len] = pack
+
+ // Compile user-side orders
+ // Status determines which menus the entry will display in
+ // Organized in field-entry list for iterative display
+ // List is nested so both the list of orders, and the list of elements in each order, can be iterated over
+ for(var/datum/supply_order/S in supply_controller.order_history)
+ orders[++orders.len] = list(
+ "ref" = "\ref[S]",
+ "status" = S.status,
+ "entries" = list(
+ list("field" = "Supply Pack", "entry" = S.name),
+ list("field" = "Cost", "entry" = S.cost),
+ list("field" = "Index", "entry" = S.index),
+ list("field" = "Reason", "entry" = S.comment),
+ list("field" = "Ordered by", "entry" = S.ordered_by),
+ list("field" = "Ordered at", "entry" = S.ordered_at),
+ list("field" = "Approved by", "entry" = S.approved_by),
+ list("field" = "Approved at", "entry" = S.approved_at)
+ )
+ )
+
+ // Compile exported crates
+ for(var/datum/exported_crate/E in supply_controller.exported_crates)
+ receipts[++receipts.len] = list(
+ "ref" = "\ref[E]",
+ "contents" = E.contents,
+ "error" = E.contents["error"],
+ "title" = list(
+ list("field" = "Name", "entry" = E.name),
+ list("field" = "Value", "entry" = E.value)
+ )
+ )
+
+ data["user"] = "\ref[user]"
+ data["currentTab"] = menu_tab // Communicator compatibility, controls which menu is in use
+ data["shuttle_auth"] = (authorization & SUP_SEND_SHUTTLE) // Whether this ui is permitted to control the supply shuttle
+ data["order_auth"] = (authorization & SUP_ACCEPT_ORDERS) // Whether this ui is permitted to accept/deny requested orders
+ data["shuttle"] = shuttle_status
+ data["supply_points"] = supply_controller.points
+ data["categories"] = all_supply_groups
+ data["active_category"] = active_category
+ data["supply_packs"] = pack_list
+ data["orders"] = orders
+ data["receipts"] = receipts
+ data["contraband"] = can_order_contraband || (authorization & SUP_CONTRABAND)
+
+ // update the ui if it exists, returns null if no ui is passed/found
+ ui = GLOB.nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
+ if(!ui)
+ // the ui does not exist, so we'll create a new() one
+ // for a list of parameters and their descriptions see the code docs in \code\modules\nano\nanoui.dm
+ ui = new(user, src, ui_key, "supply_records.tmpl", "Supply Console", 475, 700, state = key_state)
+ // when the ui is first opened this is the data it will use
+ ui.set_initial_data(data)
+ // open the new ui window
+ ui.open()
+ // auto update every 20 Master Controller tick
+ ui.set_auto_update(20) // Longer term to reduce the rate of data collection and processing
+
+
+
+
/obj/machinery/computer/supplycomp/Topic(href, href_list)
if(!supply_controller)
- world.log << "## ERROR: Eek. The supply_controller controller datum is missing somehow."
+ world.log << "## ERROR: The supply_controller datum is missing."
return
var/datum/shuttle/ferry/supply/shuttle = supply_controller.shuttle
if (!shuttle)
- world.log << "## ERROR: Eek. The supply/shuttle datum is missing somehow."
+ world.log << "## ERROR: The supply shuttle datum is missing."
return
if(..())
return 1
@@ -228,177 +198,212 @@
if(isturf(loc) && ( in_range(src, usr) || istype(usr, /mob/living/silicon) ) )
usr.set_machine(src)
- //Calling the shuttle
- if(href_list["send"])
- if(shuttle.at_station())
- if (shuttle.forbidden_atoms_check())
- temp = "For safety reasons the automated supply shuttle cannot transport live organisms, classified nuclear weaponry or homing beacons.
OK"
- else
- shuttle.launch(src)
- temp = "Initiating launch sequence. \[Force Launch\]
OK"
- else
- shuttle.launch(src)
- temp = "The supply shuttle has been called and will arrive in approximately [round(supply_controller.movetime/600,1)] minutes.
OK"
- post_signal("supply")
+ // NEW TOPIC
- if (href_list["force_send"])
- shuttle.force_launch(src)
+ // Switch menu
+ if(href_list["switch_tab"])
+ menu_tab = href_list["switch_tab"]
- if (href_list["cancel_send"])
- shuttle.cancel_launch(src)
+ if(href_list["active_category"])
+ active_category = href_list["active_category"]
- else if (href_list["order"])
- //if(!shuttle.idle()) return //this shouldn't be necessary it seems
- if(href_list["order"] == "categories")
- //all_supply_groups
- //Request what?
- last_viewed_group = "categories"
- temp = "Supply points: [supply_controller.points]
"
- temp += "Main Menu
"
- temp += "Select a category
"
- for(var/supply_group_name in all_supply_groups )
- temp += "[supply_group_name]
"
- else
- last_viewed_group = href_list["order"]
- temp = "Supply points: [supply_controller.points]
"
- temp += "Back to all categories
"
- temp += "Request from: [last_viewed_group]
"
- for(var/supply_name in supply_controller.supply_packs )
- var/datum/supply_packs/N = supply_controller.supply_packs[supply_name]
- if((N.contraband && !can_order_contraband) || N.group != last_viewed_group) continue //Have to send the type instead of a reference to
- temp += "[supply_name] Cost: [N.cost]
" //the obj because it would get caught by the garbage
+ if(href_list["pack_ref"])
+ var/datum/supply_pack/S = locate(href_list["pack_ref"])
- else if (href_list["doorder"])
- if(world.time < reqtime)
- for(var/mob/V in hearers(src))
- V.show_message("[src]'s monitor flashes, \"[world.time - reqtime] seconds remaining until another requisition form may be printed.\"")
+ // Invalid ref
+ if(!istype(S))
return
- //Find the correct supply_pack datum
- var/datum/supply_packs/P = supply_controller.supply_packs[href_list["doorder"]]
- if(!istype(P)) return
+ // Expand the supply pack's contents
+ if(href_list["expand"])
+ expanded_packs ^= S
- var/timeout = world.time + 600
- var/reason = sanitize(input(usr,"Reason:","Why do you require this item?","") as null|text)
- if(world.time > timeout) return
- if(!reason) return
+ // Make a request for the pack
+ if(href_list["request"])
+ var/mob/user = locate(href_list["user"])
+ if(!istype(user)) // Invalid ref
+ return
- var/idname = "*None Provided*"
- var/idrank = "*None Provided*"
- if(ishuman(usr))
- var/mob/living/carbon/human/H = usr
- idname = H.get_authentification_name()
- idrank = H.get_assignment()
- else if(issilicon(usr))
- idname = usr.real_name
+ if(world.time < reqtime)
+ visible_message("[src]'s monitor flashes, \"[reqtime - world.time] seconds remaining until another requisition form may be printed.\"")
+ return
- supply_controller.ordernum++
- var/obj/item/weapon/paper/reqform = new /obj/item/weapon/paper(loc)
- reqform.name = "Requisition Form - [P.name]"
- reqform.info += "[station_name()] Supply Requisition Form
"
- reqform.info += "INDEX: #[supply_controller.ordernum]
"
- reqform.info += "REQUESTED BY: [idname]
"
- reqform.info += "RANK: [idrank]
"
- reqform.info += "REASON: [reason]
"
- reqform.info += "SUPPLY CRATE TYPE: [P.name]
"
- reqform.info += "ACCESS RESTRICTION: [get_access_desc(P.access)]
"
- reqform.info += "CONTENTS:
"
- reqform.info += P.manifest
- reqform.info += "
"
- reqform.info += "STAMP BELOW TO APPROVE THIS REQUISITION:
"
+ var/timeout = world.time + 600
+ var/reason = sanitize(input(user, "Reason:","Why do you require this item?","") as null|text)
+ if(world.time > timeout)
+ to_chat(user, "Error. Request timed out.")
+ return
+ if(!reason)
+ return
- reqform.update_icon() //Fix for appearing blank when printed.
- reqtime = (world.time + 5) % 1e5
+ supply_controller.create_order(S, user, reason)
- //make our supply_order datum
- var/datum/supply_order/O = new /datum/supply_order()
- O.ordernum = supply_controller.ordernum
- O.object = P
- O.orderedby = idname
- supply_controller.requestlist += O
+ var/idname = "*None Provided*"
+ var/idrank = "*None Provided*"
+ if(ishuman(user))
+ var/mob/living/carbon/human/H = user
+ idname = H.get_authentification_name()
+ idrank = H.get_assignment()
+ else if(issilicon(user))
+ idname = user.real_name
+ idrank = "Stationbound synthetic"
- temp = "Order request placed.
"
- temp += "
Back | Main Menu | Authorize Order"
+ var/obj/item/weapon/paper/reqform = new /obj/item/weapon/paper(loc)
+ reqform.name = "Requisition Form - [S.name]"
+ reqform.info += "[station_name()] Supply Requisition Form
"
+ reqform.info += "INDEX: #[supply_controller.ordernum]
"
+ reqform.info += "REQUESTED BY: [idname]
"
+ reqform.info += "RANK: [idrank]
"
+ reqform.info += "REASON: [reason]
"
+ reqform.info += "SUPPLY CRATE TYPE: [S.name]
"
+ reqform.info += "ACCESS RESTRICTION: [get_access_desc(S.access)]
"
+ reqform.info += "CONTENTS:
"
+ reqform.info += S.get_html_manifest()
+ reqform.info += "
"
+ reqform.info += "STAMP BELOW TO APPROVE THIS REQUISITION:
"
- else if(href_list["confirmorder"])
- //Find the correct supply_order datum
- var/ordernum = text2num(href_list["confirmorder"])
- var/datum/supply_order/O
- var/datum/supply_packs/P
- temp = "Invalid Request"
- for(var/i=1, i<=supply_controller.requestlist.len, i++)
- var/datum/supply_order/SO = supply_controller.requestlist[i]
- if(SO.ordernum == ordernum)
- O = SO
- P = O.object
- if(supply_controller.points >= P.cost)
- supply_controller.requestlist.Cut(i,i+1)
- supply_controller.points -= P.cost
- supply_controller.shoppinglist += O
- temp = "Thanks for your order.
"
- temp += "
Back Main Menu"
- else
- temp = "Not enough supply points.
"
- temp += "
Back Main Menu"
- break
+ reqform.update_icon() //Fix for appearing blank when printed.
+ reqtime = (world.time + 5) % 1e5
- else if (href_list["vieworders"])
- temp = "Current approved orders:
"
- for(var/S in supply_controller.shoppinglist)
- var/datum/supply_order/SO = S
- temp += "#[SO.ordernum] - [SO.object.name] approved by [SO.orderedby][SO.comment ? " ([SO.comment])":""]
"// (Cancel)
"
- temp += "
OK"
-/*
- else if (href_list["cancelorder"])
- var/datum/supply_order/remove_supply = href_list["cancelorder"]
- supply_shuttle_shoppinglist -= remove_supply
- supply_shuttle_points += remove_supply.object.cost
- temp += "Canceled: [remove_supply.object.name]
"
+ if(href_list["order_ref"])
+ var/datum/supply_order/O = locate(href_list["order_ref"])
- for(var/S in supply_shuttle_shoppinglist)
- var/datum/supply_order/SO = S
- temp += "[SO.object.name] approved by [SO.orderedby][SO.comment ? " ([SO.comment])":""] (Cancel)
"
- temp += "
OK"
-*/
- else if (href_list["viewrequests"])
- temp = "Current requests:
"
- for(var/S in supply_controller.requestlist)
- var/datum/supply_order/SO = S
- temp += "#[SO.ordernum] - [SO.object.name] requested by [SO.orderedby] Approve Remove
"
+ // Invalid ref
+ if(!istype(O))
+ return
- temp += "
Clear list"
- temp += "
OK"
+ var/mob/user = locate(href_list["user"])
+ if(!istype(user)) // Invalid ref
+ return
- else if (href_list["viewexport"])
- temp = "Previous shuttle export report:
"
- var/cratecount = 0
- var/totalvalue = 0
- for(var/S in supply_controller.exported_crates)
- var/datum/exported_crate/EC = S
- cratecount += 1
- totalvalue += EC.value
- temp += "[EC.name] exported for [EC.value] supply points
"
- temp += "
Shipment of [cratecount] crates exported for [totalvalue] supply points.
"
- temp += "
OK"
+ if(href_list["edit"])
+ var/new_val = sanitize(input(user, href_list["edit"], "Enter the new value for this field:", href_list["default"]) as null|text)
+ if(!new_val)
+ return
- else if (href_list["rreq"])
- var/ordernum = text2num(href_list["rreq"])
- temp = "Invalid Request.
"
- for(var/i=1, i<=supply_controller.requestlist.len, i++)
- var/datum/supply_order/SO = supply_controller.requestlist[i]
- if(SO.ordernum == ordernum)
- supply_controller.requestlist.Cut(i,i+1)
- temp = "Request removed.
"
- break
- temp += "
Back Main Menu"
+ switch(href_list["edit"])
+ if("Supply Pack")
+ O.name = new_val
- else if (href_list["clearreq"])
- supply_controller.requestlist.Cut()
- temp = "List cleared.
"
- temp += "
OK"
+ if("Cost")
+ var/num = text2num(new_val)
+ if(num)
+ O.cost = num
- else if (href_list["mainmenu"])
- temp = null
+ if("Index")
+ var/num = text2num(new_val)
+ if(num)
+ O.index = num
+
+ if("Reason")
+ O.comment = new_val
+
+ if("Ordered by")
+ O.ordered_by = new_val
+
+ if("Ordered at")
+ O.ordered_at = new_val
+
+ if("Approved by")
+ O.approved_by = new_val
+
+ if("Approved at")
+ O.approved_at = new_val
+
+ if(href_list["approve"])
+ supply_controller.approve_order(O, user)
+
+ if(href_list["deny"])
+ supply_controller.deny_order(O, user)
+
+ if(href_list["delete"])
+ supply_controller.delete_order(O, user)
+
+ if(href_list["clear_all_requests"])
+ var/mob/user = locate(href_list["user"])
+ if(!istype(user)) // Invalid ref
+ return
+
+ supply_controller.deny_all_pending(user)
+
+ if(href_list["export_ref"])
+ var/datum/exported_crate/E = locate(href_list["export_ref"])
+
+ // Invalid ref
+ if(!istype(E))
+ return
+
+ var/mob/user = locate(href_list["user"])
+ if(!istype(user)) // Invalid ref
+ return
+
+ if(href_list["index"])
+ var/list/L = E.contents[href_list["index"]]
+
+ if(href_list["edit"])
+ var/field = alert(user, "Select which field to edit", , "Name", "Quantity", "Value")
+
+ var/new_val = sanitize(input(user, href_list["edit"], "Enter the new value for this field:", href_list["default"]) as null|text)
+ if(!new_val)
+ return
+
+ switch(field)
+ if("Name")
+ L["object"] = new_val
+
+ if("Quantity")
+ var/num = text2num(new_val)
+ if(num)
+ L["quantity"] = num
+
+ if("Value")
+ var/num = text2num(new_val)
+ if(num)
+ L["value"] = num
+
+ if(href_list["delete"])
+ E.contents.Cut(href_list["index"], href_list["index"] + 1)
+
+ // Else clause means they're editing/deleting the whole export report, rather than a specific item in it
+ else if(href_list["edit"])
+ var/new_val = sanitize(input(user, href_list["edit"], "Enter the new value for this field:", href_list["default"]) as null|text)
+ if(!new_val)
+ return
+
+ switch(href_list["edit"])
+ if("Name")
+ E.name = new_val
+
+ if("Value")
+ var/num = text2num(new_val)
+ if(num)
+ E.value = num
+
+ else if(href_list["delete"])
+ supply_controller.delete_export(E, user)
+
+ else if(href_list["add_item"])
+ supply_controller.add_export_item(E, user)
+
+
+
+ switch(href_list["send_shuttle"])
+ if("send_away")
+ if (shuttle.forbidden_atoms_check())
+ to_chat(usr, "For safety reasons the automated supply shuttle cannot transport live organisms, classified nuclear weaponry or homing beacons.")
+ else
+ shuttle.launch(src)
+ to_chat(usr, "Initiating launch sequence.")
+
+ if("send_to_station")
+ shuttle.launch(src)
+ to_chat(usr, "The supply shuttle has been called and will arrive in approximately [round(supply_controller.movetime/600,1)] minutes.")
+
+ if("cancel_shuttle")
+ shuttle.cancel_launch(src)
+
+ if("force_shuttle")
+ shuttle.force_launch(src)
add_fingerprint(usr)
updateUsrDialog()
diff --git a/code/game/machinery/computer/timeclock_vr.dm b/code/game/machinery/computer/timeclock_vr.dm
index d0557cd1f3..98dc8e635d 100644
--- a/code/game/machinery/computer/timeclock_vr.dm
+++ b/code/game/machinery/computer/timeclock_vr.dm
@@ -47,7 +47,7 @@
if(!card && user.unEquip(I))
I.forceMove(src)
card = I
- nanomanager.update_uis(src)
+ GLOB.nanomanager.update_uis(src)
update_icon()
else if(card)
to_chat(user, "There is already ID card inside.")
@@ -87,7 +87,7 @@
// if(job && job.timeoff_factor < 0) // Currently are Off Duty, so gotta lookup what on-duty jobs are open
// data["job_choices"] = getOpenOnDutyJobs(user, job.department)
- ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
+ ui = GLOB.nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, "timeclock_vr.tmpl", capitalize(src.name), 500, 520)
ui.set_initial_data(data)
diff --git a/code/game/machinery/computer3/buildandrepair.dm b/code/game/machinery/computer3/buildandrepair.dm
index 14270bf144..928675769c 100644
--- a/code/game/machinery/computer3/buildandrepair.dm
+++ b/code/game/machinery/computer3/buildandrepair.dm
@@ -78,7 +78,7 @@
/obj/structure/computer3frame/attackby(obj/item/P as obj, mob/user as mob)
switch(state)
if(0)
- if(istype(P, /obj/item/weapon/wrench))
+ if(P.is_wrench())
playsound(src.loc, P.usesound, 50, 1)
if(do_after(user, 20 * P.toolspeed))
to_chat(user, "You wrench the frame into place.")
@@ -96,7 +96,7 @@
new /obj/item/stack/material/steel( src.loc, 5 )
qdel(src)
if(1)
- if(istype(P, /obj/item/weapon/wrench))
+ if(P.is_wrench())
playsound(src.loc, P.usesound, 50, 1)
if(do_after(user, 20 * P.toolspeed))
to_chat(user, "You unfasten the frame.")
@@ -113,12 +113,12 @@
P.loc = src
else
to_chat(user, "This frame does not accept circuit boards of this type!")
- if(istype(P, /obj/item/weapon/screwdriver) && circuit)
+ if(P.is_screwdriver() && circuit)
playsound(src.loc, P.usesound, 50, 1)
to_chat(user, "You screw the circuit board into place.")
src.state = 2
src.icon_state = "2"
- if(istype(P, /obj/item/weapon/crowbar) && circuit)
+ if(P.is_crowbar() && circuit)
playsound(src.loc, P.usesound, 50, 1)
to_chat(user, "You remove the circuit board.")
src.state = 1
@@ -126,13 +126,13 @@
circuit.loc = src.loc
src.circuit = null
if(2)
- if(istype(P, /obj/item/weapon/screwdriver) && circuit)
+ if(P.is_screwdriver() && circuit)
playsound(src.loc, P.usesound, 50, 1)
to_chat(user, "You unfasten the circuit board.")
src.state = 1
src.icon_state = "1"
- if(istype(P, /obj/item/weapon/crowbar))
+ if(P.is_crowbar())
if(battery)
playsound(src.loc, P.usesound, 50, 1)
if(do_after(10 * P.toolspeed))
@@ -164,7 +164,7 @@
src.state = 3
src.icon_state = "3"
if(3)
- if(istype(P, /obj/item/weapon/wirecutters))
+ if(P.is_wirecutter())
if(components.len)
to_chat(user, "There are parts in the way!")
return
@@ -175,7 +175,7 @@
var/obj/item/stack/cable_coil/A = new /obj/item/stack/cable_coil( src.loc )
A.amount = 5
- if(istype(P, /obj/item/weapon/crowbar)) // complicated check
+ if(P.is_crowbar())
remove_peripheral()
if(istype(P, /obj/item/stack/material) && P.get_material_name() == "glass")
@@ -189,13 +189,13 @@
src.state = 4
src.icon_state = "4"
if(4)
- if(istype(P, /obj/item/weapon/crowbar))
+ if(P.is_crowbar())
playsound(src.loc, P.usesound, 50, 1)
to_chat(user, "You remove the glass panel.")
src.state = 3
src.icon_state = "3"
new /obj/item/stack/material/glass( src.loc, 2 )
- if(istype(P, /obj/item/weapon/screwdriver))
+ if(P.is_screwdriver())
playsound(src.loc, P.usesound, 50, 1)
to_chat(user, "You connect the monitor.")
var/obj/machinery/computer3/B = new src.circuit.build_path ( src.loc, built=1 )
diff --git a/code/game/machinery/computer3/computer.dm b/code/game/machinery/computer3/computer.dm
index 930ee6adcd..c9d8eb22de 100644
--- a/code/game/machinery/computer3/computer.dm
+++ b/code/game/machinery/computer3/computer.dm
@@ -309,8 +309,8 @@
if(os)
os.error = BUSTED_ASS_COMPUTER
-/obj/machinery/computer3/attackby(I as obj, mob/user as mob)
- if(istype(I, /obj/item/weapon/screwdriver) && allow_disassemble)
+/obj/machinery/computer3/attackby(obj/item/I as obj, mob/user as mob)
+ if(I.is_screwdriver() && allow_disassemble)
disassemble(user)
return
diff --git a/code/game/machinery/computer3/lapvend.dm b/code/game/machinery/computer3/lapvend.dm
index 147dbdaa44..79f297157c 100644
--- a/code/game/machinery/computer3/lapvend.dm
+++ b/code/game/machinery/computer3/lapvend.dm
@@ -34,11 +34,11 @@
if(vendmode == 1 && I)
scan_id(I, W)
vendmode = 0
- nanomanager.update_uis(src)
+ GLOB.nanomanager.update_uis(src)
if(vendmode == 2 && I)
if(reimburse_id(I, W))
vendmode = 0
- nanomanager.update_uis(src)
+ GLOB.nanomanager.update_uis(src)
if(vendmode == 0)
if(istype(W, /obj/item/device/laptop))
var/obj/item/device/laptop/L = W
@@ -48,7 +48,7 @@
L.loc = src
vendmode = 2
to_chat(user, "You slot your [L.name] into \The [src.name]")
- nanomanager.update_uis(src)
+ GLOB.nanomanager.update_uis(src)
else
..()
@@ -77,7 +77,7 @@
data["power"] = power
data["total"] = total()
- ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
+ ui = GLOB.nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, "laptop_vendor.tmpl", src.name, 480, 425)
ui.set_initial_data(data)
@@ -136,7 +136,7 @@
vendmode = 0
src.add_fingerprint(usr)
- nanomanager.update_uis(src)
+ GLOB.nanomanager.update_uis(src)
/obj/machinery/lapvend/proc/vend()
if(cardreader > 0)
diff --git a/code/game/machinery/constructable_frame.dm b/code/game/machinery/constructable_frame.dm
index c3b6e010d6..e74ffb7cf9 100644
--- a/code/game/machinery/constructable_frame.dm
+++ b/code/game/machinery/constructable_frame.dm
@@ -31,19 +31,19 @@
if(istype(P, /obj/item/stack/cable_coil))
var/obj/item/stack/cable_coil/C = P
if (C.get_amount() < 5)
- user << "You need five lengths of cable to add them to the frame."
+ to_chat(user, "You need five lengths of cable to add them to the frame.")
return
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
- user << "You start to add cables to the frame."
+ to_chat(user, "You start to add cables to the frame.")
if(do_after(user, 20) && state == 1)
if(C.use(5))
- user << "You add cables to the frame."
+ to_chat(user, "You add cables to the frame.")
state = 2
icon_state = "box_1"
else
- if(istype(P, /obj/item/weapon/wrench))
+ if(P.is_wrench())
playsound(src, W.usesound, 75, 1)
- user << "You dismantle the frame"
+ to_chat(user, "You dismantle the frame")
new /obj/item/stack/material/steel(src.loc, 5)
qdel(src)
if(2)
@@ -51,7 +51,7 @@
var/obj/item/weapon/circuitboard/B = P
if(B.board_type == "machine")
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
- user << "You add the circuit board to the frame."
+ to_chat(user, "You add the circuit board to the frame.")
circuit = P
user.drop_item()
P.loc = src
@@ -67,28 +67,28 @@
var/obj/ct = new cp() // have to quickly instantiate it get name
req_component_names[A] = ct.name
update_desc()
- user << desc
+ to_chat(user, desc)
else
- user << "This frame does not accept circuit boards of this type!"
+ to_chat(user, "This frame does not accept circuit boards of this type!")
else
- if(istype(P, /obj/item/weapon/wirecutters))
+ if(P.is_wirecutter())
playsound(src.loc, P.usesound, 50, 1)
- user << "You remove the cables."
+ to_chat(user, "You remove the cables.")
state = 1
icon_state = "box_0"
var/obj/item/stack/cable_coil/A = new /obj/item/stack/cable_coil( src.loc )
A.amount = 5
if(3)
- if(istype(P, /obj/item/weapon/crowbar))
+ if(P.is_crowbar())
playsound(src, P.usesound, 50, 1)
state = 2
circuit.loc = src.loc
circuit = null
if(components.len == 0)
- user << "You remove the circuit board."
+ to_chat(user, "You remove the circuit board.")
else
- user << "You remove the circuit board and other components."
+ to_chat(user, "You remove the circuit board and other components.")
for(var/obj/item/weapon/W in components)
W.loc = src.loc
desc = initial(desc)
@@ -96,7 +96,7 @@
components = null
icon_state = "box_1"
else
- if(istype(P, /obj/item/weapon/screwdriver))
+ if(P.is_screwdriver())
var/component_check = 1
for(var/R in req_components)
if(req_components[R] > 0)
@@ -132,7 +132,7 @@
for(var/I in req_components)
if(istype(P, text2path(I)) && (req_components[I] > 0))
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
- if(istype(P, /obj/item/stack/cable_coil))
+ if(P.is_cable_coil))
var/obj/item/stack/cable_coil/CP = P
if(CP.get_amount() > 1)
var/camt = min(CP.amount, req_components[I]) // amount of cable to take, idealy amount required, but limited by amount provided
@@ -150,6 +150,6 @@
req_components[I]--
update_desc()
break
- user << desc
+ to_chat(user, desc)
if(P && P.loc != src && !istype(P, /obj/item/stack/cable_coil))
- user << "You cannot add that component to the machine!"
+ to_chat(user, "You cannot add that component to the machine!")
diff --git a/code/game/machinery/cryo.dm b/code/game/machinery/cryo.dm
index 6c68620644..20a54046a6 100644
--- a/code/game/machinery/cryo.dm
+++ b/code/game/machinery/cryo.dm
@@ -141,7 +141,7 @@
data["beakerVolume"] += R.volume
// update the ui if it exists, returns null if no ui is passed/found
- ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
+ ui = GLOB.nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if(!ui)
// the ui does not exist, so we'll create a new() one
// for a list of parameters and their descriptions see the code docs in \code\modules\nano\nanoui.dm
@@ -185,7 +185,7 @@
/obj/machinery/atmospherics/unary/cryo_cell/attackby(var/obj/item/weapon/G as obj, var/mob/user as mob)
if(istype(G, /obj/item/weapon/reagent_containers/glass))
if(beaker)
- user << "A beaker is already loaded into the machine."
+ to_chat(user, "A beaker is already loaded into the machine.")
return
beaker = G
@@ -201,12 +201,12 @@
to_chat(user,"\The [src] is already occupied by [occupant].")
for(var/mob/living/simple_animal/slime/M in range(1,grab.affecting))
if(M.victim == grab.affecting)
- usr << "[grab.affecting.name] will not fit into the cryo because they have a slime latched onto their head."
+ to_chat(usr, "[grab.affecting.name] will not fit into the cryo because they have a slime latched onto their head.")
return
var/mob/M = grab.affecting
qdel(grab)
put_mob(M)
-
+
return
/obj/machinery/atmospherics/unary/cryo_cell/MouseDrop_T(var/mob/target, var/mob/user) //Allows borgs to put people into cryo without external assistance
@@ -293,19 +293,19 @@
return
/obj/machinery/atmospherics/unary/cryo_cell/proc/put_mob(mob/living/carbon/M as mob)
if(stat & (NOPOWER|BROKEN))
- usr << "The cryo cell is not functioning."
+ to_chat(usr, "The cryo cell is not functioning.")
return
if(!istype(M))
- usr << "The cryo cell cannot handle such a lifeform!"
+ to_chat(usr, "The cryo cell cannot handle such a lifeform!")
return
if(occupant)
- usr << "The cryo cell is already occupied!"
+ to_chat(usr, "The cryo cell is already occupied!")
return
if(M.abiotic())
- usr << "Subject may not have abiotic items on."
+ to_chat(usr, "Subject may not have abiotic items on.")
return
if(!node)
- usr << "The cell is not correctly connected to its pipe network!"
+ to_chat(usr, "The cell is not correctly connected to its pipe network!")
return
if(M.client)
M.client.perspective = EYE_PERSPECTIVE
@@ -314,7 +314,7 @@
M.loc = src
M.ExtinguishMob()
if(M.health > -100 && (M.health < 0 || M.sleeping))
- M << "You feel a cold liquid surround you. Your skin starts to freeze up."
+ to_chat(M, "You feel a cold liquid surround you. Your skin starts to freeze up.")
occupant = M
buckle_mob(occupant, forced = TRUE, check_loc = FALSE)
vis_contents |= occupant
@@ -333,7 +333,7 @@
if(usr == occupant)//If the user is inside the tube...
if(usr.stat == 2)//and he's not dead....
return
- usr << "Release sequence activated. This will take two minutes."
+ to_chat(usr, "Release sequence activated. This will take two minutes.")
sleep(1200)
if(!src || !usr || !occupant || (occupant != usr)) //Check if someone's released/replaced/bombed him already
return
@@ -351,7 +351,7 @@
set src in oview(1)
for(var/mob/living/simple_animal/slime/M in range(1,usr))
if(M.victim == usr)
- usr << "You're too busy getting your life sucked out of you."
+ to_chat(usr, "You're too busy getting your life sucked out of you.")
return
if(usr.stat != 0)
return
diff --git a/code/game/machinery/cryopod.dm b/code/game/machinery/cryopod.dm
index e5ebbc7d17..ffda46f7cf 100644
--- a/code/game/machinery/cryopod.dm
+++ b/code/game/machinery/cryopod.dm
@@ -97,7 +97,7 @@
//dat += "Recover object.
" //VOREStation Removal - Just log them.
//dat += "Recover all objects.
" //VOREStation Removal
- user << browse(dat, "window=cryopod_console")
+ to_chat(user, browse(dat, "window=cryopod_console"))
onclose(user, "cryopod_console")
/obj/machinery/computer/cryopod/Topic(href, href_list)
@@ -116,7 +116,7 @@
dat += "[person]
"
dat += "
"
- user << browse(dat, "window=cryolog")
+ to_chat(user, browse(dat, "window=cryolog"))
if(href_list["view"])
if(!allow_items) return
@@ -128,13 +128,13 @@
//VOREStation Edit End
dat += "
"
- user << browse(dat, "window=cryoitems")
+ to_chat(user, browse(dat, "window=cryoitems"))
else if(href_list["item"])
if(!allow_items) return
if(frozen_items.len == 0)
- user << "There is nothing to recover from storage."
+ to_chat(user, "There is nothing to recover from storage.")
return
var/obj/item/I = input(usr, "Please choose which object to retrieve.","Object recovery",null) as null|anything in frozen_items
@@ -142,7 +142,7 @@
return
if(!(I in frozen_items))
- user << "\The [I] is no longer in storage."
+ to_chat(user, "\The [I] is no longer in storage.")
return
visible_message("The console beeps happily as it disgorges \the [I].", 3)
@@ -154,7 +154,7 @@
if(!allow_items) return
if(frozen_items.len == 0)
- user << "There is nothing to recover from storage."
+ to_chat(user, "There is nothing to recover from storage.")
return
visible_message("The console beeps happily as it disgorges the desired objects.", 3)
@@ -519,7 +519,7 @@
var/obj/item/weapon/grab/grab = G
if(occupant)
- user << "\The [src] is in use."
+ to_chat(user, "\The [src] is in use.")
return
if(!ismob(grab.affecting))
@@ -564,12 +564,12 @@
return
if(occupant)
- usr << "\The [src] is in use."
+ to_chat(usr, "\The [src] is in use.")
return
for(var/mob/living/simple_animal/slime/M in range(1,usr))
if(M.victim == usr)
- usr << "You're too busy getting your life sucked out of you."
+ to_chat(usr, "You're too busy getting your life sucked out of you.")
return
visible_message("[usr] [on_enter_visible_message] [src].", 3)
@@ -580,7 +580,7 @@
return
if(occupant)
- usr << "\The [src] is in use."
+ to_chat(usr, "\The [src] is in use.")
return
usr.stop_pulling()
@@ -596,8 +596,8 @@
icon_state = occupied_icon_state
- usr << "[on_enter_occupant_message]"
- usr << "If you ghost, log out or close your client now, your character will shortly be permanently removed from the round."
+ to_chat(usr, "[on_enter_occupant_message]")
+ to_chat(usr, "If you ghost, log out or close your client now, your character will shortly be permanently removed from the round.")
time_entered = world.time
diff --git a/code/game/machinery/deployable.dm b/code/game/machinery/deployable.dm
index 2ed722e129..c50503f3c5 100644
--- a/code/game/machinery/deployable.dm
+++ b/code/game/machinery/deployable.dm
@@ -86,7 +86,7 @@ for reference:
return //hitting things with the wrong type of stack usually doesn't produce messages, and probably doesn't need to.
if(health < maxhealth)
if(D.get_amount() < 1)
- user << "You need one sheet of [material.display_name] to repair \the [src]."
+ to_chat(user, "You need one sheet of [material.display_name] to repair \the [src].")
return
visible_message("[user] begins to repair \the [src].")
if(do_after(user,20) && health < maxhealth)
@@ -168,10 +168,10 @@ for reference:
anchored = !anchored
icon_state = "barrier[locked]"
if((locked == 1.0) && (emagged < 2.0))
- user << "Barrier lock toggled on."
+ to_chat(user, "Barrier lock toggled on.")
return
else if((locked == 0.0) && (emagged < 2.0))
- user << "Barrier lock toggled off."
+ to_chat(user, "Barrier lock toggled off.")
return
else
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
@@ -180,7 +180,7 @@ for reference:
visible_message("BZZzZZzZZzZT")
return
return
- else if(istype(W, /obj/item/weapon/wrench))
+ else if(W.is_wrench())
if(health < maxhealth)
health = maxhealth
emagged = 0
@@ -252,7 +252,7 @@ for reference:
emagged = 1
req_access.Cut()
req_one_access.Cut()
- user << "You break the ID authentication lock on \the [src]."
+ to_chat(user, "You break the ID authentication lock on \the [src].")
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
s.set_up(2, 1, src)
s.start()
@@ -260,7 +260,7 @@ for reference:
return 1
else if(emagged == 1)
emagged = 2
- user << "You short out the anchoring mechanism on \the [src]."
+ to_chat(user, "You short out the anchoring mechanism on \the [src].")
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
s.set_up(2, 1, src)
s.start()
diff --git a/code/game/machinery/door_control.dm b/code/game/machinery/door_control.dm
index bc3a27fed7..e10e3bda3f 100644
--- a/code/game/machinery/door_control.dm
+++ b/code/game/machinery/door_control.dm
@@ -21,7 +21,7 @@
if(wires & 2)
return attack_hand(user)
else
- user << "Error, no route to host."
+ to_chat(user, "Error, no route to host.")
/obj/machinery/button/remote/attackby(obj/item/weapon/W, mob/user as mob)
return attack_hand(user)
@@ -42,7 +42,7 @@
return
if(!allowed(user) && (wires & 1))
- user << "Access Denied"
+ to_chat(user, "Access Denied")
flick("doorctrl-denied",src)
return
diff --git a/code/game/machinery/doorbell_vr.dm b/code/game/machinery/doorbell_vr.dm
index b23e490928..46dec472a6 100644
--- a/code/game/machinery/doorbell_vr.dm
+++ b/code/game/machinery/doorbell_vr.dm
@@ -136,7 +136,7 @@
var/obj/item/device/multitool/M = W
M.connectable = src
to_chat(user, "You save the data in \the [M]'s buffer.")
- else if(istype(W, /obj/item/weapon/wrench))
+ else if(W.is_wrench())
to_chat(user, "You start to unwrench \the [src].")
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
if(do_after(user, 15) && !QDELETED(src))
diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm
index ed68528861..327b1e11cd 100644
--- a/code/game/machinery/doors/airlock.dm
+++ b/code/game/machinery/doors/airlock.dm
@@ -728,7 +728,7 @@ About the new airlock wires panel:
data["commands"] = commands
- ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
+ ui = GLOB.nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, "door_control.tmpl", "Door Controls", 450, 350, state = state)
ui.set_initial_data(data)
@@ -903,7 +903,7 @@ About the new airlock wires panel:
if(istype(C, /mob/living))
..()
return
- if(!repairing && (istype(C, /obj/item/weapon/weldingtool) && !( src.operating > 0 ) && src.density))
+ if(!repairing && istype(C, /obj/item/weapon/weldingtool) && !( src.operating > 0 ) && src.density)
var/obj/item/weapon/weldingtool/W = C
if(W.remove_fuel(0,user))
if(!src.welded)
@@ -915,7 +915,7 @@ About the new airlock wires panel:
return
else
return
- else if(istype(C, /obj/item/weapon/screwdriver))
+ else if(C.is_screwdriver())
if (src.p_open)
if (stat & BROKEN)
to_chat(usr,"The panel is broken and cannot be closed.")
@@ -926,7 +926,7 @@ About the new airlock wires panel:
src.p_open = 1
playsound(src, C.usesound, 50, 1)
src.update_icon()
- else if(istype(C, /obj/item/weapon/wirecutters))
+ else if(C.is_wirecutter())
return src.attack_hand(user)
else if(istype(C, /obj/item/device/multitool))
return src.attack_hand(user)
@@ -935,7 +935,7 @@ About the new airlock wires panel:
else if(istype(C, /obj/item/weapon/pai_cable)) // -- TLE
var/obj/item/weapon/pai_cable/cable = C
cable.plugin(src, user)
- else if(!repairing && istype(C, /obj/item/weapon/crowbar))
+ else if(!repairing && C.is_crowbar())
if(can_remove_electronics())
playsound(src, C.usesound, 75, 1)
user.visible_message("[user] removes the electronics from the airlock assembly.", "You start to remove electronics from the airlock assembly.")
diff --git a/code/game/machinery/doors/blast_door.dm b/code/game/machinery/doors/blast_door.dm
index 58ce8b282c..f4926c2aa8 100644
--- a/code/game/machinery/doors/blast_door.dm
+++ b/code/game/machinery/doors/blast_door.dm
@@ -125,7 +125,7 @@
if(istype(C,/obj/item/weapon/material/twohanded/fireaxe)) // Fireaxes need to be in both hands to pry.
var/obj/item/weapon/material/twohanded/fireaxe/F = C
if(!F.wielded)
- user << "You need to be wielding \the [F] to do that."
+ to_chat(user, "You need to be wielding \the [F] to do that.")
return
// If we're at this point, it's a fireaxe in both hands or something else that doesn't care for twohanding.
@@ -133,7 +133,7 @@
force_toggle(1, user)
else
- usr << "[src]'s motors resist your effort."
+ to_chat(user, "[src]'s motors resist your effort.")
return
@@ -153,19 +153,19 @@
else if(istype(C, /obj/item/stack/material) && C.get_material_name() == "plasteel") // Repairing.
var/amt = Ceiling((maxhealth - health)/150)
if(!amt)
- usr << "\The [src] is already fully repaired."
+ to_chat(user, "\The [src] is already fully repaired.")
return
var/obj/item/stack/P = C
if(P.amount < amt)
- usr << "You don't have enough sheets to repair this! You need at least [amt] sheets."
+ to_chat(user, "You don't have enough sheets to repair this! You need at least [amt] sheets.")
return
- usr << "You begin repairing [src]..."
+ to_chat(user, "You begin repairing [src]...")
if(do_after(usr, 30))
if(P.use(amt))
- usr << "You have repaired \The [src]"
+ to_chat(user, "You have repaired \The [src]")
src.repair()
else
- usr << "You don't have enough sheets to repair this! You need at least [amt] sheets."
+ to_chat(user, "You don't have enough sheets to repair this! You need at least [amt] sheets.")
else if(src.density && (user.a_intent == I_HURT)) //If we can't pry it open and it's not a weapon.... Eh, let's attack it anyway.
var/obj/item/weapon/W = C
diff --git a/code/game/machinery/doors/door.dm b/code/game/machinery/doors/door.dm
index d8252fe4a9..ddb2001639 100644
--- a/code/game/machinery/doors/door.dm
+++ b/code/game/machinery/doors/door.dm
@@ -207,80 +207,83 @@
if (attempt_vr(src,"attackby_vr",list(I, user))) return
- if(istype(I, /obj/item/stack/material) && I.get_material_name() == src.get_material_name())
- if(stat & BROKEN)
- user << "It looks like \the [src] is pretty busted. It's going to need more than just patching up now."
- return
- if(health >= maxhealth)
- user << "Nothing to fix!"
- return
- if(!density)
- user << "\The [src] must be closed before you can repair it."
- return
+ if(istype(I))
+ if(istype(I, /obj/item/stack/material) && I.get_material_name() == src.get_material_name())
+ if(stat & BROKEN)
+ user << "It looks like \the [src] is pretty busted. It's going to need more than just patching up now."
+ return
+ if(health >= maxhealth)
+ user << "Nothing to fix!"
+ return
+ if(!density)
+ user << "\The [src] must be closed before you can repair it."
+ return
- //figure out how much metal we need
- var/amount_needed = (maxhealth - health) / DOOR_REPAIR_AMOUNT
- amount_needed = (round(amount_needed) == amount_needed)? amount_needed : round(amount_needed) + 1 //Why does BYOND not have a ceiling proc?
+ //figure out how much metal we need
+ var/amount_needed = (maxhealth - health) / DOOR_REPAIR_AMOUNT
+ amount_needed = (round(amount_needed) == amount_needed)? amount_needed : round(amount_needed) + 1 //Why does BYOND not have a ceiling proc?
- var/obj/item/stack/stack = I
- var/transfer
- if (repairing)
- transfer = stack.transfer_to(repairing, amount_needed - repairing.amount)
- if (!transfer)
- user << "You must weld or remove \the [repairing] from \the [src] before you can add anything else."
- else
- repairing = stack.split(amount_needed)
+ var/obj/item/stack/stack = I
+ var/transfer
if (repairing)
- repairing.loc = src
- transfer = repairing.amount
+ transfer = stack.transfer_to(repairing, amount_needed - repairing.amount)
+ if (!transfer)
+ user << "You must weld or remove \the [repairing] from \the [src] before you can add anything else."
+ else
+ repairing = stack.split(amount_needed)
+ if (repairing)
+ repairing.loc = src
+ transfer = repairing.amount
- if (transfer)
- user << "You fit [transfer] [stack.singular_name]\s to damaged and broken parts on \the [src]."
+ if (transfer)
+ user << "You fit [transfer] [stack.singular_name]\s to damaged and broken parts on \the [src]."
- return
-
- if(repairing && istype(I, /obj/item/weapon/weldingtool))
- if(!density)
- user << "\The [src] must be closed before you can repair it."
return
- var/obj/item/weapon/weldingtool/welder = I
- if(welder.remove_fuel(0,user))
- user << "You start to fix dents and weld \the [repairing] into place."
- playsound(src, welder.usesound, 50, 1)
- if(do_after(user, (5 * repairing.amount) * welder.toolspeed) && welder && welder.isOn())
- user << "You finish repairing the damage to \the [src]."
- health = between(health, health + repairing.amount*DOOR_REPAIR_AMOUNT, maxhealth)
- update_icon()
- qdel(repairing)
- repairing = null
+ if(repairing && istype(I, /obj/item/weapon/weldingtool))
+ if(!density)
+ user << "\The [src] must be closed before you can repair it."
+ return
+
+ var/obj/item/weapon/weldingtool/welder = I
+ if(welder.remove_fuel(0,user))
+ user << "You start to fix dents and weld \the [repairing] into place."
+ playsound(src, welder.usesound, 50, 1)
+ if(do_after(user, (5 * repairing.amount) * welder.toolspeed) && welder && welder.isOn())
+ user << "You finish repairing the damage to \the [src]."
+ health = between(health, health + repairing.amount*DOOR_REPAIR_AMOUNT, maxhealth)
+ update_icon()
+ qdel(repairing)
+ repairing = null
+ return
+
+ if(repairing && I.is_crowbar())
+ user << "You remove \the [repairing]."
+ playsound(src, I.usesound, 100, 1)
+ repairing.loc = user.loc
+ repairing = null
+ return
+
+ //psa to whoever coded this, there are plenty of objects that need to call attack() on doors without bludgeoning them.
+ if(src.density && istype(I, /obj/item/weapon) && user.a_intent == I_HURT && !istype(I, /obj/item/weapon/card))
+ var/obj/item/weapon/W = I
+ user.setClickCooldown(user.get_attack_speed(W))
+ if(W.damtype == BRUTE || W.damtype == BURN)
+ user.do_attack_animation(src)
+ if(W.force < min_force)
+ user.visible_message("\The [user] hits \the [src] with \the [W] with no visible effect.")
+ else
+ user.visible_message("\The [user] forcefully strikes \the [src] with \the [W]!")
+ playsound(src.loc, hitsound, 100, 1)
+ take_damage(W.force)
+ return
+
+ if(src.operating > 0 || isrobot(user))
+ return //borgs can't attack doors open because it conflicts with their AI-like interaction with them.
+
+ if(src.operating)
return
- if(repairing && istype(I, /obj/item/weapon/crowbar))
- user << "You remove \the [repairing]."
- playsound(src, I.usesound, 100, 1)
- repairing.loc = user.loc
- repairing = null
- return
-
- //psa to whoever coded this, there are plenty of objects that need to call attack() on doors without bludgeoning them.
- if(src.density && istype(I, /obj/item/weapon) && user.a_intent == I_HURT && !istype(I, /obj/item/weapon/card))
- var/obj/item/weapon/W = I
- user.setClickCooldown(user.get_attack_speed(W))
- if(W.damtype == BRUTE || W.damtype == BURN)
- user.do_attack_animation(src)
- if(W.force < min_force)
- user.visible_message("\The [user] hits \the [src] with \the [W] with no visible effect.")
- else
- user.visible_message("\The [user] forcefully strikes \the [src] with \the [W]!")
- playsound(src.loc, hitsound, 100, 1)
- take_damage(W.force)
- return
-
- if(src.operating > 0 || isrobot(user)) return //borgs can't attack doors open because it conflicts with their AI-like interaction with them.
-
- if(src.operating) return
-
if(src.allowed(user) && operable())
if(src.density)
open()
diff --git a/code/game/machinery/doors/door_vr.dm b/code/game/machinery/doors/door_vr.dm
index 1e0dd1d470..58d84e2d7c 100644
--- a/code/game/machinery/doors/door_vr.dm
+++ b/code/game/machinery/doors/door_vr.dm
@@ -133,7 +133,7 @@
repairing = null
return 1
- if(reinforcing && istype(I, /obj/item/weapon/crowbar))
+ if(reinforcing && I.is_crowbar())
user << "You remove \the [reinforcing]."
playsound(src.loc, 'sound/items/Crowbar.ogg', 100, 1)
reinforcing.loc = user.loc
diff --git a/code/game/machinery/doors/firedoor.dm b/code/game/machinery/doors/firedoor.dm
index 504d65c306..fb7609ee05 100644
--- a/code/game/machinery/doors/firedoor.dm
+++ b/code/game/machinery/doors/firedoor.dm
@@ -4,8 +4,8 @@
#define FIREDOOR_MIN_TEMP 0
// Bitflags
-#define FIREDOOR_ALERT_HOT 1
-#define FIREDOOR_ALERT_COLD 2
+#define FIREDOOR_ALERT_HOT 1
+#define FIREDOOR_ALERT_COLD 2
// Not used #define FIREDOOR_ALERT_LOWPRESS 4
/obj/machinery/door/firedoor
@@ -83,9 +83,9 @@
return
if(pdiff >= FIREDOOR_MAX_PRESSURE_DIFF)
- user << "WARNING: Current pressure differential is [pdiff]kPa! Opening door may result in injury!"
+ to_chat(user, "WARNING: Current pressure differential is [pdiff]kPa! Opening door may result in injury!")
- user << "Sensor readings:"
+ to_chat(user, "Sensor readings:")
for(var/index = 1; index <= tile_info.len; index++)
var/o = " "
switch(index)
@@ -99,7 +99,7 @@
o += "WEST: "
if(tile_info[index] == null)
o += "DATA UNAVAILABLE"
- user << o
+ to_chat(user, o)
continue
var/celsius = convert_k2c(tile_info[index][1])
var/pressure = tile_info[index][2]
@@ -107,14 +107,14 @@
o += "[celsius]°C "
o += ""
o += "[pressure]kPa"
- user << o
+ to_chat(user, o)
if(islist(users_to_open) && users_to_open.len)
var/users_to_open_string = users_to_open[1]
if(users_to_open.len >= 2)
for(var/i = 2 to users_to_open.len)
users_to_open_string += ", [users_to_open[i]]"
- user << "These people have opened \the [src] during an alert: [users_to_open_string]."
+ to_chat(user, "These people have opened \the [src] during an alert: [users_to_open_string].")
/obj/machinery/door/firedoor/Bumped(atom/AM)
if(p_open || operating)
@@ -142,7 +142,7 @@
return
if(blocked)
- user << "\The [src] is welded solid!"
+ to_chat(user, "\The [src] is welded solid!")
return
var/alarmed = lockdown
@@ -154,15 +154,15 @@
"\The [src]", "Yes, [density ? "open" : "close"]", "No")
if(answer == "No")
return
- if(user.incapacitated() || (get_dist(src, user) > 1 && !issilicon(user)))
- user << "Sorry, you must remain able bodied and close to \the [src] in order to use it."
+ if(user.incapacitated() || (get_dist(src, user) > 1 && !issilicon(user)))
+ to_chat(user, "Sorry, you must remain able bodied and close to \the [src] in order to use it.")
return
if(density && (stat & (BROKEN|NOPOWER))) //can still close without power
- user << "\The [src] is not functioning, you'll have to force it open manually."
+ to_chat(user, "\The [src] is not functioning, you'll have to force it open manually.")
return
if(alarmed && density && lockdown && !allowed(user))
- user << "Access denied. Please wait for authorities to arrive, or for the alert to clear."
+ to_chat(user, "Access denied. Please wait for authorities to arrive, or for the alert to clear.")
return
else
user.visible_message("\The [src] [density ? "open" : "close"]s for \the [user].",\
@@ -245,7 +245,7 @@
return//Already doing something.
if(istype(C, /obj/item/weapon/weldingtool) && !repairing)
if(prying)
- to_chat(user,"Someone's busy prying that [density ? "open" : "closed"]!")
+ to_chat(user, "Someone's busy prying that [density ? "open" : "closed"]!")
var/obj/item/weapon/weldingtool/W = C
if(W.remove_fuel(0, user))
blocked = !blocked
@@ -256,7 +256,7 @@
update_icon()
return
- if(density && istype(C, /obj/item/weapon/screwdriver))
+ if(density && C.is_screwdriver())
hatch_open = !hatch_open
playsound(src, C.usesound, 50, 1)
user.visible_message("[user] has [hatch_open ? "opened" : "closed"] \the [src] maintenance hatch.",
@@ -264,9 +264,9 @@
update_icon()
return
- if(blocked && istype(C, /obj/item/weapon/crowbar) && !repairing)
+ if(blocked && C.is_crowbar() && !repairing)
if(!hatch_open)
- user << "You must open the maintenance hatch first!"
+ to_chat(user, "You must open the maintenance hatch first!")
else
user.visible_message("[user] is removing the electronics from \the [src].",
"You start to remove the electronics from [src].")
@@ -290,14 +290,14 @@
return
if(blocked)
- user << "\The [src] is welded shut!"
+ to_chat(user, "\The [src] is welded shut!")
return
if(C.pry == 1)
if(operating)
return
- if(blocked && istype(C, /obj/item/weapon/crowbar))
+ if(blocked && C.is_crowbar())
user.visible_message("\The [user] pries at \the [src] with \a [C], but \the [src] is welded in place!",\
"You try to pry \the [src] [density ? "open" : "closed"], but it is welded in place!",\
"You hear someone struggle and metal straining.")
@@ -309,7 +309,7 @@
return
if(prying)
- to_chat(user,"Someone's already prying that [density ? "open" : "closed"].")
+ to_chat(user, "Someone's already prying that [density ? "open" : "closed"].")
return
user.visible_message("\The [user] starts to force \the [src] [density ? "open" : "closed"] with \a [C]!",\
@@ -319,7 +319,7 @@
update_icon()
playsound(src, C.usesound, 100, 1)
if(do_after(user,30 * C.toolspeed))
- if(istype(C, /obj/item/weapon/crowbar))
+ if(C.is_crowbar())
if(stat & (BROKEN|NOPOWER) || !density)
user.visible_message("\The [user] forces \the [src] [density ? "open" : "closed"] with \a [C]!",\
"You force \the [src] [density ? "open" : "closed"] with \the [C]!",\
@@ -504,7 +504,7 @@
/obj/machinery/door/firedoor/glass
name = "\improper Emergency Glass Shutter"
- desc = "Emergency air-tight shutter, capable of sealing off breached areas. This one has a resilient glass window, allowing you to see the danger."
+ desc = "Emergency air-tight shutter, capable of sealing off breached areas. This one has a resilient glass window, allowing you to see the danger."
icon = 'icons/obj/doors/DoorHazardGlass.dmi'
icon_state = "door_open"
glass = 1
diff --git a/code/game/machinery/doors/firedoor_assembly.dm b/code/game/machinery/doors/firedoor_assembly.dm
index f30c2e6146..cebafdbb40 100644
--- a/code/game/machinery/doors/firedoor_assembly.dm
+++ b/code/game/machinery/doors/firedoor_assembly.dm
@@ -26,7 +26,7 @@ obj/structure/firedoor_assembly/attackby(obj/item/C, mob/user as mob)
wired = 1
user << "You wire \the [src]."
- else if(istype(C, /obj/item/weapon/wirecutters) && wired )
+ else if(C.is_wirecutter() && wired )
playsound(src.loc, C.usesound, 100, 1)
user.visible_message("[user] cuts the wires from \the [src].", "You start to cut the wires from \the [src].")
@@ -46,7 +46,7 @@ obj/structure/firedoor_assembly/attackby(obj/item/C, mob/user as mob)
qdel(src)
else
user << "You must secure \the [src] first!"
- else if(istype(C, /obj/item/weapon/wrench))
+ else if(C.is_wrench())
anchored = !anchored
playsound(src.loc, C.usesound, 50, 1)
user.visible_message("[user] has [anchored ? "" : "un" ]secured \the [src]!",
diff --git a/code/game/machinery/doors/multi_tile.dm b/code/game/machinery/doors/multi_tile.dm
index 8fb012f870..608e02b9a0 100644
--- a/code/game/machinery/doors/multi_tile.dm
+++ b/code/game/machinery/doors/multi_tile.dm
@@ -12,8 +12,8 @@
create_fillers()
/obj/machinery/door/airlock/multi_tile/Destroy()
- qdel_null(filler1)
- qdel_null(filler2)
+ QDEL_NULL(filler1)
+ QDEL_NULL(filler2)
return ..()
/obj/machinery/door/airlock/multi_tile/Move()
diff --git a/code/game/machinery/doors/windowdoor.dm b/code/game/machinery/doors/windowdoor.dm
index d25473e709..fe21197dc5 100644
--- a/code/game/machinery/doors/windowdoor.dm
+++ b/code/game/machinery/doors/windowdoor.dm
@@ -154,6 +154,7 @@
return src.attack_hand(user)
/obj/machinery/door/window/attack_hand(mob/user as mob)
+ src.add_fingerprint(user)
if(istype(user,/mob/living/carbon/human))
var/mob/living/carbon/human/H = user
@@ -164,7 +165,17 @@
user.setClickCooldown(user.get_attack_speed())
take_damage(25)
return
- return src.attackby(user, user)
+
+ if (src.allowed(user))
+ if (src.density)
+ open()
+ else
+ close()
+
+ else if (src.density)
+ flick(text("[]deny", src.base_state), src)
+
+ return
/obj/machinery/door/window/emag_act(var/remaining_charges, var/mob/user)
if (density && operable())
@@ -174,85 +185,86 @@
open()
return 1
-/obj/machinery/door/window/attackby(obj/item/weapon/I as obj, mob/user as mob)
+/obj/machinery/door/window/attackby(obj/item/I as obj, mob/user as mob)
//If it's in the process of opening/closing, ignore the click
if (src.operating == 1)
return
- // Fixing.
- if(istype(I, /obj/item/weapon/weldingtool) && user.a_intent == I_HELP)
- var/obj/item/weapon/weldingtool/WT = I
- if(health < maxhealth)
- if(WT.remove_fuel(1 ,user))
- to_chat(user, "You begin repairing [src]...")
- playsound(src, WT.usesound, 50, 1)
- if(do_after(user, 40 * WT.toolspeed, target = src))
- health = maxhealth
- update_icon()
- to_chat(user, "You repair [src].")
- else
- to_chat(user, "[src] is already in good condition!")
- return
-
- //Emags and ninja swords? You may pass.
- if (istype(I, /obj/item/weapon/melee/energy/blade))
- if(emag_act(10, user))
- var/datum/effect/effect/system/spark_spread/spark_system = new /datum/effect/effect/system/spark_spread()
- spark_system.set_up(5, 0, src.loc)
- spark_system.start()
- playsound(src.loc, "sparks", 50, 1)
- playsound(src.loc, 'sound/weapons/blade1.ogg', 50, 1)
- visible_message("The glass door was sliced open by [user]!")
- return 1
-
- //If it's opened/emagged, crowbar can pry it out of its frame.
- if (!density && istype(I, /obj/item/weapon/crowbar))
- playsound(src, I.usesound, 50, 1)
- user.visible_message("[user] begins prying the windoor out of the frame.", "You start to pry the windoor out of the frame.")
- if (do_after(user,40 * I.toolspeed))
- to_chat(user,"You pried the windoor out of the frame!")
-
- var/obj/structure/windoor_assembly/wa = new/obj/structure/windoor_assembly(src.loc)
- if (istype(src, /obj/machinery/door/window/brigdoor))
- wa.secure = "secure_"
- if (src.base_state == "right" || src.base_state == "rightsecure")
- wa.facing = "r"
- wa.set_dir(src.dir)
- wa.anchored = 1
- wa.created_name = name
- wa.state = "02"
- wa.step = 2
- wa.update_state()
-
- if(operating == -1)
- wa.electronics = new/obj/item/weapon/circuitboard/broken()
+ if(istype(I))
+ // Fixing.
+ if(istype(I, /obj/item/weapon/weldingtool) && user.a_intent == I_HELP)
+ var/obj/item/weapon/weldingtool/WT = I
+ if(health < maxhealth)
+ if(WT.remove_fuel(1 ,user))
+ to_chat(user, "You begin repairing [src]...")
+ playsound(src, WT.usesound, 50, 1)
+ if(do_after(user, 40 * WT.toolspeed, target = src))
+ health = maxhealth
+ update_icon()
+ to_chat(user, "You repair [src].")
else
- if(!electronics)
- wa.electronics = new/obj/item/weapon/airlock_electronics()
- if(!src.req_access)
- src.check_access()
- if(src.req_access.len)
- wa.electronics.conf_access = src.req_access
- else if (src.req_one_access.len)
- wa.electronics.conf_access = src.req_one_access
- wa.electronics.one_access = 1
- else
- wa.electronics = electronics
- electronics = null
- operating = 0
- qdel(src)
+ to_chat(user, "[src] is already in good condition!")
return
- //If it's a weapon, smash windoor. Unless it's an id card, agent card, ect.. then ignore it (Cards really shouldnt damage a door anyway)
- if(src.density && istype(I, /obj/item/weapon) && !istype(I, /obj/item/weapon/card))
- user.setClickCooldown(user.get_attack_speed(I))
- var/aforce = I.force
- playsound(src.loc, 'sound/effects/Glasshit.ogg', 75, 1)
- visible_message("[src] was hit by [I].")
- if(I.damtype == BRUTE || I.damtype == BURN)
- take_damage(aforce)
- return
+ //Emags and ninja swords? You may pass.
+ if (istype(I, /obj/item/weapon/melee/energy/blade))
+ if(emag_act(10, user))
+ var/datum/effect/effect/system/spark_spread/spark_system = new /datum/effect/effect/system/spark_spread()
+ spark_system.set_up(5, 0, src.loc)
+ spark_system.start()
+ playsound(src.loc, "sparks", 50, 1)
+ playsound(src.loc, 'sound/weapons/blade1.ogg', 50, 1)
+ visible_message("The glass door was sliced open by [user]!")
+ return 1
+
+ //If it's opened/emagged, crowbar can pry it out of its frame.
+ if (!density && I.is_crowbar())
+ playsound(src, I.usesound, 50, 1)
+ user.visible_message("[user] begins prying the windoor out of the frame.", "You start to pry the windoor out of the frame.")
+ if (do_after(user,40 * I.toolspeed))
+ to_chat(user,"You pried the windoor out of the frame!")
+
+ var/obj/structure/windoor_assembly/wa = new/obj/structure/windoor_assembly(src.loc)
+ if (istype(src, /obj/machinery/door/window/brigdoor))
+ wa.secure = "secure_"
+ if (src.base_state == "right" || src.base_state == "rightsecure")
+ wa.facing = "r"
+ wa.set_dir(src.dir)
+ wa.anchored = 1
+ wa.created_name = name
+ wa.state = "02"
+ wa.step = 2
+ wa.update_state()
+
+ if(operating == -1)
+ wa.electronics = new/obj/item/weapon/circuitboard/broken()
+ else
+ if(!electronics)
+ wa.electronics = new/obj/item/weapon/airlock_electronics()
+ if(!src.req_access)
+ src.check_access()
+ if(src.req_access.len)
+ wa.electronics.conf_access = src.req_access
+ else if (src.req_one_access.len)
+ wa.electronics.conf_access = src.req_one_access
+ wa.electronics.one_access = 1
+ else
+ wa.electronics = electronics
+ electronics = null
+ operating = 0
+ qdel(src)
+ return
+
+ //If it's a weapon, smash windoor. Unless it's an id card, agent card, ect.. then ignore it (Cards really shouldnt damage a door anyway)
+ if(src.density && istype(I, /obj/item/weapon) && !istype(I, /obj/item/weapon/card))
+ user.setClickCooldown(user.get_attack_speed(I))
+ var/aforce = I.force
+ playsound(src.loc, 'sound/effects/Glasshit.ogg', 75, 1)
+ visible_message("[src] was hit by [I].")
+ if(I.damtype == BRUTE || I.damtype == BURN)
+ take_damage(aforce)
+ return
src.add_fingerprint(user)
@@ -268,8 +280,6 @@
return
-
-
/obj/machinery/door/window/brigdoor
name = "secure door"
icon = 'icons/obj/doors/windoor.dmi'
@@ -284,7 +294,6 @@
new /obj/item/stack/rods(src.loc, 2)
..()
-
/obj/machinery/door/window/northleft
dir = NORTH
diff --git a/code/game/machinery/embedded_controller/airlock_controllers.dm b/code/game/machinery/embedded_controller/airlock_controllers.dm
index b5895cd300..6bf5fe0553 100644
--- a/code/game/machinery/embedded_controller/airlock_controllers.dm
+++ b/code/game/machinery/embedded_controller/airlock_controllers.dm
@@ -33,7 +33,7 @@
"secure" = program.memory["secure"]
)
- ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
+ ui = GLOB.nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, "advanced_airlock_console.tmpl", name, 470, 290)
@@ -89,7 +89,7 @@
"processing" = program.memory["processing"],
)
- ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
+ ui = GLOB.nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, "simple_airlock_console.tmpl", name, 470, 290)
@@ -153,7 +153,7 @@
"processing" = program.memory["processing"]
)
- ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
+ ui = GLOB.nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, "door_access_console.tmpl", name, 330, 220)
diff --git a/code/game/machinery/embedded_controller/airlock_docking_controller.dm b/code/game/machinery/embedded_controller/airlock_docking_controller.dm
index a63874235f..86885ebd53 100644
--- a/code/game/machinery/embedded_controller/airlock_docking_controller.dm
+++ b/code/game/machinery/embedded_controller/airlock_docking_controller.dm
@@ -24,7 +24,7 @@
"override_enabled" = docking_program.override_enabled,
)
- ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
+ ui = GLOB.nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, "docking_airlock_console.tmpl", name, 470, 290)
diff --git a/code/game/machinery/embedded_controller/airlock_docking_controller_multi.dm b/code/game/machinery/embedded_controller/airlock_docking_controller_multi.dm
index 9fb1b34900..7c35568e51 100644
--- a/code/game/machinery/embedded_controller/airlock_docking_controller_multi.dm
+++ b/code/game/machinery/embedded_controller/airlock_docking_controller_multi.dm
@@ -35,7 +35,7 @@
"airlocks" = airlocks,
)
- ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
+ ui = GLOB.nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, "multi_docking_console.tmpl", name, 470, 290)
@@ -73,7 +73,7 @@
"override_enabled" = airlock_program.override_enabled,
)
- ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
+ ui = GLOB.nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, "docking_airlock_console.tmpl", name, 470, 290)
diff --git a/code/game/machinery/embedded_controller/simple_docking_controller.dm b/code/game/machinery/embedded_controller/simple_docking_controller.dm
index ed8b435fb6..9242afd762 100644
--- a/code/game/machinery/embedded_controller/simple_docking_controller.dm
+++ b/code/game/machinery/embedded_controller/simple_docking_controller.dm
@@ -19,7 +19,7 @@
"door_lock" = docking_program.memory["door_status"]["lock"],
)
- ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
+ ui = GLOB.nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, "simple_docking_console.tmpl", name, 470, 290)
diff --git a/code/game/machinery/exonet_node.dm b/code/game/machinery/exonet_node.dm
index 87eba96324..fee3fbd0ec 100644
--- a/code/game/machinery/exonet_node.dm
+++ b/code/game/machinery/exonet_node.dm
@@ -88,9 +88,9 @@
// Parameters: 2 (I - the item being whacked against the machine, user - the person doing the whacking)
// Description: Handles deconstruction.
/obj/machinery/exonet_node/attackby(obj/item/I, mob/user)
- if(istype(I, /obj/item/weapon/screwdriver))
+ if(I.is_screwdriver())
default_deconstruction_screwdriver(user, I)
- else if(istype(I, /obj/item/weapon/crowbar))
+ else if(I.is_crowbar())
default_deconstruction_crowbar(user, I)
else
..()
@@ -123,7 +123,7 @@
// update the ui if it exists, returns null if no ui is passed/found
- ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
+ ui = GLOB.nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if(!ui)
// the ui does not exist, so we'll create a new() one
// for a list of parameters and their descriptions see the code docs in \code\modules\nano\nanoui.dm
@@ -167,7 +167,7 @@
log_game(msg)
update_icon()
- nanomanager.update_uis(src)
+ GLOB.nanomanager.update_uis(src)
add_fingerprint(usr)
// Proc: get_exonet_node()
diff --git a/code/game/machinery/flasher.dm b/code/game/machinery/flasher.dm
index 18844dcd73..169bc8c6d7 100644
--- a/code/game/machinery/flasher.dm
+++ b/code/game/machinery/flasher.dm
@@ -35,7 +35,7 @@
//Don't want to render prison breaks impossible
/obj/machinery/flasher/attackby(obj/item/weapon/W as obj, mob/user as mob)
- if(istype(W, /obj/item/weapon/wirecutters))
+ if(W.is_wirecutter())
add_fingerprint(user)
disable = !disable
if(disable)
@@ -102,7 +102,7 @@
flash()
/obj/machinery/flasher/portable/attackby(obj/item/weapon/W as obj, mob/user as mob)
- if(istype(W, /obj/item/weapon/wrench))
+ if(W.is_wrench())
add_fingerprint(user)
anchored = !anchored
diff --git a/code/game/machinery/floodlight.dm b/code/game/machinery/floodlight.dm
index 88b36f6b5c..729d99f419 100644
--- a/code/game/machinery/floodlight.dm
+++ b/code/game/machinery/floodlight.dm
@@ -65,7 +65,7 @@
turn_off(1)
else
if(!turn_on(1))
- user << "You try to turn on \the [src] but it does not work."
+ to_chat(user, "You try to turn on \the [src] but it does not work.")
/obj/machinery/floodlight/attack_hand(mob/user as mob)
if(open && cell)
@@ -82,7 +82,7 @@
cell = null
on = 0
set_light(0)
- user << "You remove the power cell"
+ to_chat(user, "You remove the power cell")
update_icon()
return
@@ -90,38 +90,38 @@
turn_off(1)
else
if(!turn_on(1))
- user << "You try to turn on \the [src] but it does not work."
+ to_chat(user, "You try to turn on \the [src] but it does not work.")
update_icon()
/obj/machinery/floodlight/attackby(obj/item/weapon/W as obj, mob/user as mob)
- if(istype(W, /obj/item/weapon/screwdriver))
+ if(W.is_screwdriver())
if(!open)
if(unlocked)
unlocked = 0
- user << "You screw the battery panel in place."
+ to_chat(user, "You screw the battery panel in place.")
else
unlocked = 1
- user << "You unscrew the battery panel."
+ to_chat(user, "You unscrew the battery panel.")
- if(istype(W, /obj/item/weapon/crowbar))
+ if(W.is_crowbar())
if(unlocked)
if(open)
open = 0
overlays = null
- user << "You crowbar the battery panel in place."
+ to_chat(user, "You crowbar the battery panel in place.")
else
if(unlocked)
open = 1
- user << "You remove the battery panel."
+ to_chat(user, "You remove the battery panel.")
if(istype(W, /obj/item/weapon/cell))
if(open)
if(cell)
- user << "There is a power cell already installed."
+ to_chat(user, "There is a power cell already installed.")
else
user.drop_item()
W.loc = src
cell = W
- user << "You insert the power cell."
+ to_chat(user, "You insert the power cell.")
update_icon()
diff --git a/code/game/machinery/floor_light.dm b/code/game/machinery/floor_light.dm
index ced1ffa864..59dca1966e 100644
--- a/code/game/machinery/floor_light.dm
+++ b/code/game/machinery/floor_light.dm
@@ -23,13 +23,13 @@ var/list/floor_light_cache = list()
anchored = 1
/obj/machinery/floor_light/attackby(var/obj/item/W, var/mob/user)
- if(istype(W, /obj/item/weapon/screwdriver))
+ if(W.is_screwdriver())
anchored = !anchored
visible_message("\The [user] has [anchored ? "attached" : "detached"] \the [src].")
else if(istype(W, /obj/item/weapon/weldingtool) && (damaged || (stat & BROKEN)))
var/obj/item/weapon/weldingtool/WT = W
if(!WT.remove_fuel(0, user))
- user << "\The [src] must be on to complete this task."
+ to_chat(user, "\The [src] must be on to complete this task.")
return
playsound(src.loc, WT.usesound, 50, 1)
if(!do_after(user, 20 * WT.toolspeed))
@@ -60,15 +60,15 @@ var/list/floor_light_cache = list()
else
if(!anchored)
- user << "\The [src] must be screwed down first."
+ to_chat(user, "\The [src] must be screwed down first.")
return
if(stat & BROKEN)
- user << "\The [src] is too damaged to be functional."
+ to_chat(user, "\The [src] is too damaged to be functional.")
return
if(stat & NOPOWER)
- user << "\The [src] is unpowered."
+ to_chat(user, "\The [src] is unpowered.")
return
on = !on
diff --git a/code/game/machinery/floorlayer.dm b/code/game/machinery/floorlayer.dm
index 1cbccc195c..94f61981ea 100644
--- a/code/game/machinery/floorlayer.dm
+++ b/code/game/machinery/floorlayer.dm
@@ -34,7 +34,7 @@
return
/obj/machinery/floorlayer/attackby(var/obj/item/W as obj, var/mob/user as mob)
- if(istype(W, /obj/item/weapon/wrench))
+ if(W.is_wrench())
var/m = input("Choose work mode", "Mode") as null|anything in mode
mode[m] = !mode[m]
var/O = mode[m]
@@ -42,23 +42,23 @@
return
if(istype(W, /obj/item/stack/tile))
- user << "\The [W] successfully loaded."
+ to_chat(user, "\The [W] successfully loaded.")
user.drop_item(T)
TakeTile(T)
return
- if(istype(W, /obj/item/weapon/crowbar))
+ if(W.is_crowbar())
if(!length(contents))
- user << "\The [src] is empty."
+ to_chat(user, "\The [src] is empty.")
else
var/obj/item/stack/tile/E = input("Choose remove tile type.", "Tiles") as null|anything in contents
if(E)
- user << "You remove the [E] from /the [src]."
+ to_chat(user, "You remove the [E] from /the [src].")
E.loc = src.loc
T = null
return
- if(istype(W, /obj/item/weapon/screwdriver))
+ if(W.is_screwdriver())
T = input("Choose tile type.", "Tiles") as null|anything in contents
return
..()
diff --git a/code/game/machinery/frame.dm b/code/game/machinery/frame.dm
index f1f2ec0834..2c16d3771e 100644
--- a/code/game/machinery/frame.dm
+++ b/code/game/machinery/frame.dm
@@ -260,9 +260,9 @@
update_icon()
/obj/structure/frame/attackby(obj/item/P as obj, mob/user as mob)
- if(istype(P, /obj/item/weapon/wrench))
+ if(P.is_wrench())
if(state == FRAME_PLACED && !anchored)
- user << "You start to wrench the frame into place."
+ to_chat(user, "You start to wrench the frame into place.")
playsound(src.loc, P.usesound, 50, 1)
if(do_after(user, 20 * P.toolspeed))
anchored = 1
@@ -270,14 +270,14 @@
state = FRAME_FASTENED
check_components()
update_desc()
- user << "You wrench the frame into place and set the outer cover."
+ to_chat(user, "You wrench the frame into place and set the outer cover.")
else
- user << "You wrench the frame into place."
+ to_chat(user, "You wrench the frame into place.")
else if(state == FRAME_PLACED && anchored)
playsound(src, P.usesound, 50, 1)
if(do_after(user, 20 * P.toolspeed))
- user << "You unfasten the frame."
+ to_chat(user, "You unfasten the frame.")
anchored = 0
else if(istype(P, /obj/item/weapon/weldingtool))
@@ -287,12 +287,12 @@
playsound(src.loc, P.usesound, 50, 1)
if(do_after(user, 20 * P.toolspeed))
if(src && WT.isOn())
- user << "You deconstruct the frame."
+ to_chat(user, "You deconstruct the frame.")
new /obj/item/stack/material/steel(src.loc, frame_type.frame_size)
qdel(src)
return
else if(!WT.remove_fuel(0, user))
- user << "The welding tool must be on to complete this task."
+ to_chat(user, "The welding tool must be on to complete this task.")
return
else if(istype(P, /obj/item/weapon/circuitboard) && need_circuit && !circuit)
@@ -301,7 +301,7 @@
var/datum/frame/frame_types/board_type = B.board_type
if(board_type.name == frame_type.name)
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
- user << "You place the circuit board inside the frame."
+ to_chat(user, "You place the circuit board inside the frame.")
circuit = P
user.drop_item()
P.loc = src
@@ -310,25 +310,25 @@
check_components()
update_desc()
else
- user << "This frame does not accept circuit boards of this type!"
+ to_chat(user, "This frame does not accept circuit boards of this type!")
return
- else if(istype(P, /obj/item/weapon/screwdriver))
+ else if(P.is_screwdriver())
if(state == FRAME_UNFASTENED)
if(need_circuit && circuit)
playsound(src, P.usesound, 50, 1)
- user << "You screw the circuit board into place."
+ to_chat(user, "You screw the circuit board into place.")
state = FRAME_FASTENED
else if(state == FRAME_FASTENED)
if(need_circuit && circuit)
playsound(src, P.usesound, 50, 1)
- user << "You unfasten the circuit board."
+ to_chat(user, "You unfasten the circuit board.")
state = FRAME_UNFASTENED
else if(!need_circuit && circuit)
playsound(src, P.usesound, 50, 1)
- user << "You unfasten the outer cover."
+ to_chat(user, "You unfasten the outer cover.")
state = FRAME_PLACED
else if(state == FRAME_WIRED)
@@ -370,7 +370,7 @@
else if(frame_type.frame_class == FRAME_CLASS_ALARM)
playsound(src, P.usesound, 50, 1)
- user << "You fasten the cover."
+ to_chat(user, "You fasten the cover.")
var/obj/machinery/B = new circuit.build_path(src.loc)
B.pixel_x = pixel_x
B.pixel_y = pixel_y
@@ -384,7 +384,7 @@
else if(state == FRAME_PANELED)
if(frame_type.frame_class == FRAME_CLASS_COMPUTER)
playsound(src, P.usesound, 50, 1)
- user << "You connect the monitor."
+ to_chat(user, "You connect the monitor.")
var/obj/machinery/B = new circuit.build_path(src.loc)
B.pixel_x = pixel_x
B.pixel_y = pixel_y
@@ -397,7 +397,7 @@
else if(frame_type.frame_class == FRAME_CLASS_DISPLAY)
playsound(src, P.usesound, 50, 1)
- user << "You connect the monitor."
+ to_chat(user, "You connect the monitor.")
var/obj/machinery/B = new circuit.build_path(src.loc)
B.pixel_x = pixel_x
B.pixel_y = pixel_y
@@ -408,11 +408,11 @@
qdel(src)
return
- else if(istype(P, /obj/item/weapon/crowbar))
+ else if(P.is_crowbar())
if(state == FRAME_UNFASTENED)
if(need_circuit && circuit)
playsound(src, P.usesound, 50, 1)
- user << "You remove the circuit board."
+ to_chat(user, "You remove the circuit board.")
state = FRAME_PLACED
circuit.forceMove(src.loc)
circuit = null
@@ -423,25 +423,25 @@
if(frame_type.frame_class == FRAME_CLASS_MACHINE)
playsound(src, P.usesound, 50, 1)
if(components.len == 0)
- user << "There are no components to remove."
+ to_chat(user, "There are no components to remove.")
else
- user << "You remove the components."
+ to_chat(user, "You remove the components.")
for(var/obj/item/weapon/W in components)
W.forceMove(src.loc)
check_components()
update_desc()
- user << desc
+ to_chat(user, desc)
else if(state == FRAME_PANELED)
if(frame_type.frame_class == FRAME_CLASS_COMPUTER)
playsound(src, P.usesound, 50, 1)
- user << "You remove the glass panel."
+ to_chat(user, "You remove the glass panel.")
state = FRAME_WIRED
new /obj/item/stack/material/glass(src.loc, 2)
else if(frame_type.frame_class == FRAME_CLASS_DISPLAY)
playsound(src, P.usesound, 50, 1)
- user << "You remove the glass panel."
+ to_chat(user, "You remove the glass panel.")
state = FRAME_WIRED
new /obj/item/stack/material/glass(src.loc, 2)
@@ -449,16 +449,16 @@
if(state == FRAME_FASTENED)
var/obj/item/stack/cable_coil/C = P
if(C.get_amount() < 5)
- user << "You need five coils of wire to add them to the frame."
+ to_chat(user, "You need five coils of wire to add them to the frame.")
return
- user << "You start to add cables to the frame."
+ to_chat(user, "You start to add cables to the frame.")
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
if(do_after(user, 20) && state == FRAME_FASTENED)
if(C.use(5))
- user << "You add cables to the frame."
+ to_chat(user, "You add cables to the frame.")
state = FRAME_WIRED
if(frame_type.frame_class == FRAME_CLASS_MACHINE)
- user << desc
+ to_chat(user, desc)
else if(state == FRAME_WIRED)
if(frame_type.frame_class == FRAME_CLASS_MACHINE)
for(var/I in req_components)
@@ -483,31 +483,31 @@
req_components[I]--
update_desc()
break
- user << desc
+ to_chat(user, desc)
- else if(istype(P, /obj/item/weapon/wirecutters))
+ else if(P.is_wirecutter())
if(state == FRAME_WIRED)
if(frame_type.frame_class == FRAME_CLASS_COMPUTER)
playsound(src, P.usesound, 50, 1)
- user << "You remove the cables."
+ to_chat(user, "You remove the cables.")
state = FRAME_FASTENED
new /obj/item/stack/cable_coil(src.loc, 5)
else if(frame_type.frame_class == FRAME_CLASS_DISPLAY)
playsound(src, P.usesound, 50, 1)
- user << "You remove the cables."
+ to_chat(user, "You remove the cables.")
state = FRAME_FASTENED
new /obj/item/stack/cable_coil(src.loc, 5)
else if(frame_type.frame_class == FRAME_CLASS_ALARM)
playsound(src, P.usesound, 50, 1)
- user << "You remove the cables."
+ to_chat(user, "You remove the cables.")
state = FRAME_FASTENED
new /obj/item/stack/cable_coil(src.loc, 5)
else if(frame_type.frame_class == FRAME_CLASS_MACHINE)
playsound(src, P.usesound, 50, 1)
- user << "You remove the cables."
+ to_chat(user, "You remove the cables.")
state = FRAME_FASTENED
new /obj/item/stack/cable_coil(src.loc, 5)
@@ -516,25 +516,25 @@
if(frame_type.frame_class == FRAME_CLASS_COMPUTER)
var/obj/item/stack/G = P
if(G.get_amount() < 2)
- user << "You need two sheets of glass to put in the glass panel."
+ to_chat(user, "You need two sheets of glass to put in the glass panel.")
return
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
- user << "You start to put in the glass panel."
+ to_chat(user, "You start to put in the glass panel.")
if(do_after(user, 20) && state == FRAME_WIRED)
if(G.use(2))
- user << "You put in the glass panel."
+ to_chat(user, "You put in the glass panel.")
state = FRAME_PANELED
else if(frame_type.frame_class == FRAME_CLASS_DISPLAY)
var/obj/item/stack/G = P
if(G.get_amount() < 2)
- user << "You need two sheets of glass to put in the glass panel."
+ to_chat(user, "You need two sheets of glass to put in the glass panel.")
return
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
- user << "You start to put in the glass panel."
+ to_chat(user, "You start to put in the glass panel.")
if(do_after(user, 20) && state == FRAME_WIRED)
if(G.use(2))
- user << "You put in the glass panel."
+ to_chat(user, "You put in the glass panel.")
state = FRAME_PANELED
else if(istype(P, /obj/item))
@@ -562,9 +562,9 @@
req_components[I]--
update_desc()
break
- user << desc
+ to_chat(user, desc)
if(P && P.loc != src && !istype(P, /obj/item/stack/material))
- user << "You cannot add that component to the machine!"
+ to_chat(user, "You cannot add that component to the machine!")
return
update_icon()
@@ -578,12 +578,12 @@
return 0
if(anchored)
- usr << "It is fastened to the floor therefore you can't rotate it!"
+ to_chat(usr, "It is fastened to the floor therefore you can't rotate it!")
return 0
set_dir(turn(dir, 90))
- usr << "You rotate the [src] to face [dir2text(dir)]!"
+ to_chat(usr, "You rotate the [src] to face [dir2text(dir)]!")
return
@@ -597,11 +597,11 @@
return 0
if(anchored)
- usr << "It is fastened to the floor therefore you can't rotate it!"
+ to_chat(usr, "It is fastened to the floor therefore you can't rotate it!")
return 0
set_dir(turn(dir, 270))
- usr << "You rotate the [src] to face [dir2text(dir)]!"
+ to_chat(usr, "You rotate the [src] to face [dir2text(dir)]!")
return
\ No newline at end of file
diff --git a/code/game/machinery/igniter.dm b/code/game/machinery/igniter.dm
index 1e67fb8b4f..5cb521d423 100755
--- a/code/game/machinery/igniter.dm
+++ b/code/game/machinery/igniter.dm
@@ -71,7 +71,7 @@
// sd_SetLuminosity(0)
/obj/machinery/sparker/attackby(obj/item/weapon/W as obj, mob/user as mob)
- if(istype(W, /obj/item/weapon/screwdriver))
+ if(W.is_screwdriver())
add_fingerprint(user)
disable = !disable
playsound(src, W.usesound, 50, 1)
diff --git a/code/game/machinery/iv_drip.dm b/code/game/machinery/iv_drip.dm
index 306a098638..36ec27f4ac 100644
--- a/code/game/machinery/iv_drip.dm
+++ b/code/game/machinery/iv_drip.dm
@@ -55,21 +55,21 @@
/obj/machinery/iv_drip/attackby(obj/item/weapon/W as obj, mob/user as mob)
if(istype(W, /obj/item/weapon/reagent_containers))
if(!isnull(beaker))
- user << "There is already a reagent container loaded!"
+ to_chat(user, "There is already a reagent container loaded!")
return
user.drop_item()
W.loc = src
beaker = W
- user << "You attach \the [W] to \the [src]."
+ to_chat(user, "You attach \the [W] to \the [src].")
update_icon()
return
- if(istype(W, /obj/item/weapon/screwdriver))
+ if(W.is_screwdriver())
playsound(src, W.usesound, 50, 1)
- user << "You start to dismantle the IV drip."
+ to_chat(user, "You start to dismantle the IV drip.")
if(do_after(user, 15))
- user << "You dismantle the IV drip."
+ to_chat(user, "You dismantle the IV drip.")
var/obj/item/stack/rods/A = new /obj/item/stack/rods(src.loc)
A.amount = 6
if(beaker)
@@ -110,12 +110,14 @@
amount = min(amount, 4)
// If the beaker is full, ping
if(amount == 0)
- if(prob(5)) visible_message("\The [src] pings.")
+ if(prob(5))
+ visible_message("\The [src] pings.")
return
var/mob/living/carbon/human/T = attached
- if(!istype(T)) return
+ if(!istype(T))
+ return
if(!T.dna)
return
if(NOCLONE in T.mutations)
@@ -152,30 +154,31 @@
set src in view(1)
if(!istype(usr, /mob/living))
- usr << "You can't do that."
+ to_chat(usr, "You can't do that.")
return
if(usr.stat)
return
mode = !mode
- usr << "The IV drip is now [mode ? "injecting" : "taking blood"]."
+ to_chat(usr, "The IV drip is now [mode ? "injecting" : "taking blood"].")
/obj/machinery/iv_drip/examine(mob/user)
..(user)
- if(!(user in view(2)) && user != src.loc) return
+ if(!(user in view(2)) && user != src.loc)
+ return
- user << "The IV drip is [mode ? "injecting" : "taking blood"]."
+ to_chat(user, "The IV drip is [mode ? "injecting" : "taking blood"].")
if(beaker)
if(beaker.reagents && beaker.reagents.reagent_list.len)
- usr << "Attached is \a [beaker] with [beaker.reagents.total_volume] units of liquid."
+ to_chat(user, "Attached is \a [beaker] with [beaker.reagents.total_volume] units of liquid.")
else
- usr << "Attached is an empty [beaker]."
+ to_chat(user, "Attached is an empty [beaker].")
else
- usr << "No chemicals are attached."
+ to_chat(user, "No chemicals are attached.")
- usr << "[attached ? attached : "No one"] is attached."
+ to_chat(user, "[attached ? attached : "No one"] is attached.")
/obj/machinery/iv_drip/CanPass(atom/movable/mover, turf/target, height = 0, air_group = 0)
if(height && istype(mover) && mover.checkpass(PASSTABLE)) //allow bullets, beams, thrown objects, mice, drones, and the like through.
diff --git a/code/game/machinery/jukebox.dm b/code/game/machinery/jukebox.dm
index 8ffcb5cec4..5c94d8a114 100644
--- a/code/game/machinery/jukebox.dm
+++ b/code/game/machinery/jukebox.dm
@@ -25,13 +25,32 @@
var/datum/wires/jukebox/wires = null
var/hacked = 0 // Whether to show the hidden songs or not
var/freq = 0 // Currently no effect, will return in phase II of mediamanager.
-
+ //VOREStation Add
var/loop_mode = JUKEMODE_PLAY_ONCE // Behavior when finished playing a song
var/max_queue_len = 3 // How many songs are we allowed to queue up?
- var/datum/track/current_track // Currently playing song
- var/list/datum/track/queue = list() // Queued songs
- var/list/datum/track/tracks = list() // Available tracks
- var/list/datum/track/secret_tracks = list() // Only visible if hacked
+ var/list/queue = list()
+ //VOREStation Add End
+ var/datum/track/current_track
+ var/list/datum/track/tracks = list(
+ new/datum/track("Beyond", 'sound/ambience/ambispace.ogg'),
+ new/datum/track("Clouds of Fire", 'sound/music/clouds.s3m'),
+ new/datum/track("D`Bert", 'sound/music/title2.ogg'),
+ new/datum/track("D`Fort", 'sound/ambience/song_game.ogg'),
+ new/datum/track("Floating", 'sound/music/main.ogg'),
+ new/datum/track("Endless Space", 'sound/music/space.ogg'),
+ new/datum/track("Part A", 'sound/misc/TestLoop1.ogg'),
+ new/datum/track("Scratch", 'sound/music/title1.ogg'),
+ new/datum/track("Trai`Tor", 'sound/music/traitor.ogg'),
+ new/datum/track("Stellar Transit", 'sound/ambience/space/space_serithi.ogg'),
+ )
+
+ // Only visible if hacked
+ var/list/datum/track/secret_tracks = list(
+ new/datum/track("Clown", 'sound/music/clown.ogg'),
+ new/datum/track("Space Asshole", 'sound/music/space_asshole.ogg'),
+ new/datum/track("Thunderdome", 'sound/music/THUNDERDOME.ogg'),
+ new/datum/track("Russkiy rep Diskoteka", 'sound/music/russianrapdisco.ogg')
+ )
/obj/machinery/media/jukebox/New()
..()
@@ -47,16 +66,16 @@
// On initialization, copy our tracks from the global list
/obj/machinery/media/jukebox/initialize()
. = ..()
- if(all_jukebox_tracks.len < 1)
+ if(LAZYLEN(all_jukebox_tracks)) //Global list has tracks
+ tracks.Cut()
+ secret_tracks.Cut()
+ for(var/datum/track/T in all_jukebox_tracks) //Load them
+ if(T.secret)
+ secret_tracks |= T
+ else
+ tracks |= T
+ else if(!LAZYLEN(tracks)) //We don't even have default tracks
stat |= BROKEN // No tracks configured this round!
- return
- // Ootherwise load from the global list!
- for(var/datum/track/T in all_jukebox_tracks)
- if(T.secret)
- secret_tracks |= T
- else
- tracks |= T
- return
/obj/machinery/media/jukebox/process()
if(!playing)
@@ -120,11 +139,13 @@
return
if(default_deconstruction_crowbar(user, W))
return
- if(istype(W, /obj/item/weapon/wirecutters))
+ if(W.is_wirecutter())
return wires.Interact(user)
if(istype(W, /obj/item/device/multitool))
return wires.Interact(user)
- if(istype(W, /obj/item/weapon/wrench))
+ if(W.is_wrench())
+ if(playing)
+ StopPlaying()
user.visible_message("[user] has [anchored ? "un" : ""]secured \the [src].", "You [anchored ? "un" : ""]secure \the [src].")
anchored = !anchored
playsound(src, W.usesound, 50, 1)
@@ -170,11 +191,11 @@
return
if(!anchored)
- usr << "You must secure \the [src] first."
+ to_chat(usr, "You must secure \the [src] first.")
return
if(inoperable())
- usr << "\The [src] doesn't appear to function."
+ to_chat(usr, "\The [src] doesn't appear to function.")
return
if(href_list["change_track"])
@@ -210,7 +231,7 @@
spawn(15)
explode()
else if(current_track == null)
- usr << "No track selected."
+ to_chat(usr, "No track selected.")
else
StartPlaying()
@@ -218,7 +239,7 @@
/obj/machinery/media/jukebox/interact(mob/user)
if(inoperable())
- usr << "\The [src] doesn't appear to function."
+ to_chat(usr, "\The [src] doesn't appear to function.")
return
ui_interact(user)
@@ -244,7 +265,7 @@
data["tracks"] = nano_tracks
// update the ui if it exists, returns null if no ui is passed/found
- ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
+ ui = GLOB.nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, "jukebox.tmpl", title, 450, 600)
ui.set_initial_data(data)
@@ -277,7 +298,7 @@
return
if(default_deconstruction_crowbar(user, W))
return
- if(istype(W, /obj/item/weapon/wrench))
+ if(W.is_wrench())
if(playing)
StopPlaying()
user.visible_message("[user] has [anchored ? "un" : ""]secured \the [src].", "You [anchored ? "un" : ""]secure \the [src].")
diff --git a/code/game/machinery/kitchen/microwave.dm b/code/game/machinery/kitchen/microwave.dm
index 3da253e682..1ece9225b1 100644
--- a/code/game/machinery/kitchen/microwave.dm
+++ b/code/game/machinery/kitchen/microwave.dm
@@ -61,7 +61,7 @@
/obj/machinery/microwave/attackby(var/obj/item/O as obj, var/mob/user as mob)
if(src.broken > 0)
- if(src.broken == 2 && istype(O, /obj/item/weapon/screwdriver)) // If it's broken and they're using a screwdriver
+ if(src.broken == 2 && O.is_screwdriver()) // If it's broken and they're using a screwdriver
user.visible_message( \
"\The [user] starts to fix part of the microwave.", \
"You start to fix part of the microwave." \
@@ -73,7 +73,7 @@
"You have fixed part of the microwave." \
)
src.broken = 1 // Fix it a bit
- else if(src.broken == 1 && istype(O, /obj/item/weapon/wrench)) // If it's broken and they're doing the wrench
+ else if(src.broken == 1 && O.is_wrench()) // If it's broken and they're doing the wrench
user.visible_message( \
"\The [user] starts to fix part of the microwave.", \
"You start to fix part of the microwave." \
@@ -88,7 +88,7 @@
src.dirty = 0 // just to be sure
src.flags = OPENCONTAINER | NOREACT
else
- user << "It's broken!"
+ to_chat(user, "It's broken!")
return 1
else if(default_deconstruction_screwdriver(user, O))
return
@@ -113,11 +113,11 @@
src.icon_state = "mw"
src.flags = OPENCONTAINER | NOREACT
else //Otherwise bad luck!!
- user << "It's dirty!"
+ to_chat(user, "It's dirty!")
return 1
else if(is_type_in_list(O,acceptable_items))
if (contents.len>=(max_n_of_items + component_parts.len + 1)) //Adds component_parts to the maximum number of items. The 1 is from the circuit
- user << "This [src] is full of ingredients, you cannot put more."
+ to_chat(user, "This [src] is full of ingredients, you cannot put more.")
return 1
if(istype(O, /obj/item/stack) && O:get_amount() > 1) // This is bad, but I can't think of how to change it
var/obj/item/stack/S = O
@@ -143,15 +143,15 @@
return 1
for (var/datum/reagent/R in O.reagents.reagent_list)
if (!(R.id in acceptable_reagents))
- user << "Your [O] contains components unsuitable for cookery."
+ to_chat(user, "Your [O] contains components unsuitable for cookery.")
return 1
return
else if(istype(O,/obj/item/weapon/grab))
var/obj/item/weapon/grab/G = O
- user << "This is ridiculous. You can not fit \the [G.affecting] in this [src]."
+ to_chat(user, "This is ridiculous. You can not fit \the [G.affecting] in this [src].")
return 1
else
- user << "You have no idea what you can cook with this [O]."
+ to_chat(user, "You have no idea what you can cook with this [O].")
..()
src.updateUsrDialog()
@@ -225,7 +225,7 @@
Eject ingredients!
\
"}
- user << browse("Microwave Controls[dat]", "window=microwave")
+ to_chat(user, browse("Microwave Controls[dat]", "window=microwave"))
onclose(user, "microwave")
return
diff --git a/code/game/machinery/kitchen/smartfridge.dm b/code/game/machinery/kitchen/smartfridge.dm
index 21ba5f25d0..005f7749b6 100644
--- a/code/game/machinery/kitchen/smartfridge.dm
+++ b/code/game/machinery/kitchen/smartfridge.dm
@@ -208,26 +208,26 @@
********************/
/obj/machinery/smartfridge/attackby(var/obj/item/O as obj, var/mob/user as mob)
- if(istype(O, /obj/item/weapon/screwdriver))
+ if(O.is_screwdriver())
panel_open = !panel_open
user.visible_message("[user] [panel_open ? "opens" : "closes"] the maintenance panel of \the [src].", "You [panel_open ? "open" : "close"] the maintenance panel of \the [src].")
playsound(src, O.usesound, 50, 1)
overlays.Cut()
if(panel_open)
overlays += image(icon, icon_panel)
- nanomanager.update_uis(src)
+ GLOB.nanomanager.update_uis(src)
return
if(wrenchable && default_unfasten_wrench(user, O, 20))
return
- if(istype(O, /obj/item/device/multitool)||istype(O, /obj/item/weapon/wirecutters))
+ if(istype(O, /obj/item/device/multitool) || O.is_wirecutter())
if(panel_open)
attack_hand(user)
return
if(stat & NOPOWER)
- user << "\The [src] is unpowered and useless."
+ to_chat(user, "\The [src] is unpowered and useless.")
return
if(accept_check(O))
@@ -241,32 +241,33 @@
var/plants_loaded = 0
for(var/obj/G in P.contents)
if(accept_check(G))
+ P.remove_from_storage(G) //fixes ui bug - Pull Request 5515
stock(G)
plants_loaded = 1
if(plants_loaded)
user.visible_message("[user] loads \the [src] with \the [P].", "You load \the [src] with \the [P].")
if(P.contents.len > 0)
- user << "Some items are refused."
+ to_chat(user, "Some items are refused.")
else if(istype(O, /obj/item/weapon/gripper)) // Grippers. ~Mechoid.
var/obj/item/weapon/gripper/B = O //B, for Borg.
if(!B.wrapped)
- user << "\The [B] is not holding anything."
+ to_chat(user, "\The [B] is not holding anything.")
return
else
var/B_held = B.wrapped
- user << "You use \the [B] to put \the [B_held] into \the [src]."
+ to_chat(user, "You use \the [B] to put \the [B_held] into \the [src].")
return
else
- user << "\The [src] smartly refuses [O]."
+ to_chat(user, "\The [src] smartly refuses [O].")
return 1
/obj/machinery/smartfridge/secure/emag_act(var/remaining_charges, var/mob/user)
if(!emagged)
emagged = 1
locked = -1
- user << "You short out the product lock on [src]."
+ to_chat(user, "You short out the product lock on [src].")
return 1
/obj/machinery/smartfridge/proc/stock(obj/item/O)
@@ -280,11 +281,11 @@
var/datum/stored_item/item = new/datum/stored_item(src, O.type, O.name)
item.add_product(O)
item_records.Add(item)
- nanomanager.update_uis(src)
+ GLOB.nanomanager.update_uis(src)
/obj/machinery/smartfridge/proc/vend(datum/stored_item/I)
I.get_product(get_turf(src))
- nanomanager.update_uis(src)
+ GLOB.nanomanager.update_uis(src)
/obj/machinery/smartfridge/attack_ai(mob/user as mob)
attack_hand(user)
@@ -319,7 +320,7 @@
if(items.len > 0)
data["contents"] = items
- ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
+ ui = GLOB.nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if(!ui)
ui = new(user, src, ui_key, "smartfridge.tmpl", src.name, 400, 500)
ui.set_initial_data(data)
@@ -329,7 +330,7 @@
if(..()) return 0
var/mob/user = usr
- var/datum/nanoui/ui = nanomanager.get_open_ui(user, src, "main")
+ var/datum/nanoui/ui = GLOB.nanomanager.get_open_ui(user, src, "main")
src.add_fingerprint(user)
@@ -378,9 +379,10 @@
*************************/
/obj/machinery/smartfridge/secure/Topic(href, href_list)
- if(stat & (NOPOWER|BROKEN)) return 0
+ if(stat & (NOPOWER|BROKEN))
+ return 0
if(usr.contents.Find(src) || (in_range(src, usr) && istype(loc, /turf)))
if(!allowed(usr) && !emagged && locked != -1 && href_list["vend"])
- usr << "Access denied."
+ to_chat(usr, "Access denied.")
return 0
return ..()
diff --git a/code/game/machinery/lightswitch.dm b/code/game/machinery/lightswitch.dm
index 8f77ac90d9..2a1a7f6e89 100644
--- a/code/game/machinery/lightswitch.dm
+++ b/code/game/machinery/lightswitch.dm
@@ -46,7 +46,7 @@
/obj/machinery/light_switch/examine(mob/user)
if(..(user, 1))
- user << "A light switch. It is [on? "on" : "off"]."
+ to_chat(user, "A light switch. It is [on? "on" : "off"].")
/obj/machinery/light_switch/attack_hand(mob/user)
diff --git a/code/game/machinery/machinery.dm b/code/game/machinery/machinery.dm
index f68bc4cc8a..c103f1f39e 100644
--- a/code/game/machinery/machinery.dm
+++ b/code/game/machinery/machinery.dm
@@ -232,8 +232,8 @@ Class Procs:
return 1
if(user.lying || user.stat)
return 1
- if(!(istype(usr, /mob/living/carbon/human) || istype(usr, /mob/living/silicon)))
- usr << "You don't have the dexterity to do this!"
+ if(!(istype(user, /mob/living/carbon/human) || istype(user, /mob/living/silicon)))
+ to_chat(user, "You don't have the dexterity to do this!")
return 1
if(ishuman(user))
var/mob/living/carbon/human/H = user
@@ -241,7 +241,7 @@ Class Procs:
visible_message("[H] stares cluelessly at [src].")
return 1
else if(prob(H.getBrainLoss()))
- user << "You momentarily forget how to use [src]."
+ to_chat(user, "You momentarily forget how to use [src].")
return 1
add_fingerprint(user)
@@ -313,23 +313,23 @@ Class Procs:
component_parts -= A
component_parts += B
B.loc = null
- user << "[A.name] replaced with [B.name]."
+ to_chat(user, "[A.name] replaced with [B.name].")
break
update_icon()
RefreshParts()
else
- user << "Following parts detected in the machine:"
+ to_chat(user, "Following parts detected in the machine:")
for(var/var/obj/item/C in component_parts) //var/var/obj/item/C?
- user << " [C.name]"
+ to_chat(user, " [C.name]")
return 1
// Default behavior for wrenching down machines. Supports both delay and instant modes.
-/obj/machinery/proc/default_unfasten_wrench(var/mob/user, var/obj/item/weapon/wrench/W, var/time = 0)
- if(!istype(W))
+/obj/machinery/proc/default_unfasten_wrench(var/mob/user, var/obj/item/W, var/time = 0)
+ if(!W.is_wrench())
return FALSE
if(panel_open)
return FALSE // Close panel first!
- playsound(loc, W.usesound, 50, 1)
+ playsound(loc, W.usesound, 50, 1)
var/actual_time = W.toolspeed * time
if(actual_time != 0)
user.visible_message( \
@@ -344,48 +344,48 @@ Class Procs:
update_icon()
return TRUE
-/obj/machinery/proc/default_deconstruction_crowbar(var/mob/user, var/obj/item/weapon/crowbar/C)
- if(!istype(C))
+/obj/machinery/proc/default_deconstruction_crowbar(var/mob/user, var/obj/item/C)
+ if(!C.is_crowbar())
return 0
if(!panel_open)
return 0
. = dismantle()
-/obj/machinery/proc/default_deconstruction_screwdriver(var/mob/user, var/obj/item/weapon/screwdriver/S)
- if(!istype(S))
+/obj/machinery/proc/default_deconstruction_screwdriver(var/mob/user, var/obj/item/S)
+ if(!S.is_screwdriver())
return 0
playsound(src, S.usesound, 50, 1)
panel_open = !panel_open
- user << "You [panel_open ? "open" : "close"] the maintenance hatch of [src]."
+ to_chat(user, "You [panel_open ? "open" : "close"] the maintenance hatch of [src].")
update_icon()
return 1
-/obj/machinery/proc/computer_deconstruction_screwdriver(var/mob/user, var/obj/item/weapon/screwdriver/S)
- if(!istype(S))
+/obj/machinery/proc/computer_deconstruction_screwdriver(var/mob/user, var/obj/item/S)
+ if(!S.is_screwdriver())
return 0
if(!circuit)
return 0
- user << "You start disconnecting the monitor."
+ to_chat(user, "You start disconnecting the monitor.")
playsound(src, S.usesound, 50, 1)
if(do_after(user, 20 * S.toolspeed))
if(stat & BROKEN)
- user << "The broken glass falls out."
+ to_chat(user, "The broken glass falls out.")
new /obj/item/weapon/material/shard(src.loc)
else
- user << "You disconnect the monitor."
+ to_chat(user, "You disconnect the monitor.")
. = dismantle()
-/obj/machinery/proc/alarm_deconstruction_screwdriver(var/mob/user, var/obj/item/weapon/screwdriver/S)
- if(!istype(S))
+/obj/machinery/proc/alarm_deconstruction_screwdriver(var/mob/user, var/obj/item/S)
+ if(!S.is_screwdriver())
return 0
playsound(src, S.usesound, 50, 1)
panel_open = !panel_open
- user << "The wires have been [panel_open ? "exposed" : "unexposed"]"
+ to_chat(user, "The wires have been [panel_open ? "exposed" : "unexposed"]")
update_icon()
return 1
-/obj/machinery/proc/alarm_deconstruction_wirecutters(var/mob/user, var/obj/item/weapon/wirecutters/W)
- if(!istype(W))
+/obj/machinery/proc/alarm_deconstruction_wirecutters(var/mob/user, var/obj/item/W)
+ if(!W.is_wirecutter())
return 0
if(!panel_open)
return 0
diff --git a/code/game/machinery/mass_driver.dm b/code/game/machinery/mass_driver.dm
index 4d1affb3a0..1d13a36c3a 100644
--- a/code/game/machinery/mass_driver.dm
+++ b/code/game/machinery/mass_driver.dm
@@ -38,7 +38,7 @@
if(panel_open)
var/input = sanitize(input(usr, "What id would you like to give this conveyor?", "Multitool-Conveyor interface", id))
if(!input)
- usr << "No input found please hang up and try your call again."
+ to_chat(usr, "No input found please hang up and try your call again.")
return
id = input
return
@@ -55,7 +55,7 @@
O_limit++
if(O_limit >= 20)
for(var/mob/M in hearers(src, null))
- M << "The mass driver lets out a screech, it mustn't be able to handle any more items."
+ to_chat(M, "The mass driver lets out a screech, it mustn't be able to handle any more items.")
break
use_power(500)
spawn(0)
diff --git a/code/game/machinery/navbeacon.dm b/code/game/machinery/navbeacon.dm
index 7e472c8eca..6d4453d1f2 100644
--- a/code/game/machinery/navbeacon.dm
+++ b/code/game/machinery/navbeacon.dm
@@ -72,7 +72,7 @@ var/global/list/navbeacons = list() // no I don't like putting this in, but it w
if(!T.is_plating())
return // prevent intraction when T-scanner revealed
- if(istype(I, /obj/item/weapon/screwdriver))
+ if(I.is_screwdriver())
open = !open
playsound(src, I.usesound, 50, 1)
user.visible_message("[user] [open ? "opens" : "closes"] the beacon's cover.", "You [open ? "open" : "close"] the beacon's cover.")
@@ -83,12 +83,12 @@ var/global/list/navbeacons = list() // no I don't like putting this in, but it w
if(open)
if(allowed(user))
locked = !locked
- user << "Controls are now [locked ? "locked." : "unlocked."]"
+ to_chat(user, "Controls are now [locked ? "locked." : "unlocked."]")
else
- user << "Access denied."
+ to_chat(user, "Access denied.")
updateDialog()
else
- user << "You must open the cover first!"
+ to_chat(user, "You must open the cover first!")
return
/obj/machinery/navbeacon/attack_ai(var/mob/user)
@@ -107,7 +107,7 @@ var/global/list/navbeacons = list() // no I don't like putting this in, but it w
return // prevent intraction when T-scanner revealed
if(!open && !ai) // can't alter controls if not open, unless you're an AI
- user << "The beacon's control cover is closed."
+ to_chat(user, "The beacon's control cover is closed.")
return
diff --git a/code/game/machinery/nuclear_bomb.dm b/code/game/machinery/nuclear_bomb.dm
index 018cf75f53..53c4dcdd28 100644
--- a/code/game/machinery/nuclear_bomb.dm
+++ b/code/game/machinery/nuclear_bomb.dm
@@ -55,30 +55,30 @@ var/bomb_set
return
/obj/machinery/nuclearbomb/attackby(obj/item/weapon/O as obj, mob/user as mob)
- if(istype(O, /obj/item/weapon/screwdriver))
+ if(O.is_screwdriver())
playsound(src, O.usesound, 50, 1)
add_fingerprint(user)
if(auth)
if(opened == 0)
opened = 1
overlays += image(icon, "npanel_open")
- user << "You unscrew the control panel of [src]."
+ to_chat(user, "You unscrew the control panel of [src].")
else
opened = 0
overlays -= image(icon, "npanel_open")
- user << "You screw the control panel of [src] back on."
+ to_chat(user, "You screw the control panel of [src] back on.")
else
if(opened == 0)
- user << "The [src] emits a buzzing noise, the panel staying locked in."
+ to_chat(user, "The [src] emits a buzzing noise, the panel staying locked in.")
if(opened == 1)
opened = 0
overlays -= image(icon, "npanel_open")
- user << "You screw the control panel of [src] back on."
+ to_chat(user, "You screw the control panel of [src] back on.")
flick("nuclearbombc", src)
return
- if(istype(O, /obj/item/weapon/wirecutters) || istype(O, /obj/item/device/multitool))
+ if(O.is_wirecutter() || istype(O, /obj/item/device/multitool))
if(opened == 1)
nukehack_win(user)
return
@@ -99,7 +99,7 @@ var/bomb_set
var/obj/item/weapon/weldingtool/WT = O
if(!WT.isOn()) return
if(WT.get_fuel() < 5) // uses up 5 fuel.
- user << "You need more fuel to complete this task."
+ to_chat(user, "You need more fuel to complete this task.")
return
user.visible_message("[user] starts cutting loose the anchoring bolt covers on [src].", "You start cutting loose the anchoring bolt covers with [O]...")
@@ -111,7 +111,7 @@ var/bomb_set
return
if(1)
- if(istype(O,/obj/item/weapon/crowbar))
+ if(O.is_crowbar())
user.visible_message("[user] starts forcing open the bolt covers on [src].", "You start forcing open the anchoring bolt covers with [O]...")
playsound(src, O.usesound, 50, 1)
@@ -127,7 +127,7 @@ var/bomb_set
var/obj/item/weapon/weldingtool/WT = O
if(!WT.isOn()) return
if(WT.get_fuel() < 5) // uses up 5 fuel.
- user << "You need more fuel to complete this task."
+ to_chat(user, "You need more fuel to complete this task.")
return
user.visible_message("[user] starts cutting apart the anchoring system sealant on [src].", "You start cutting apart the anchoring system's sealant with [O]...")
@@ -139,7 +139,7 @@ var/bomb_set
return
if(3)
- if(istype(O,/obj/item/weapon/wrench))
+ if(O.is_wrench())
user.visible_message("[user] begins unwrenching the anchoring bolts on [src].", "You begin unwrenching the anchoring bolts...")
playsound(src, O.usesound, 50, 1)
@@ -150,7 +150,7 @@ var/bomb_set
return
if(4)
- if(istype(O,/obj/item/weapon/crowbar))
+ if(O.is_crowbar())
user.visible_message("[user] begins lifting [src] off of the anchors.", "You begin lifting the device off the anchors...")
playsound(src, O.usesound, 50, 1)
@@ -165,7 +165,7 @@ var/bomb_set
/obj/machinery/nuclearbomb/attack_hand(mob/user as mob)
if(extended)
if(!ishuman(user))
- usr << "You don't have the dexterity to do this!"
+ to_chat(user, "You don't have the dexterity to do this!")
return 1
user.set_machine(src)
@@ -219,14 +219,14 @@ obj/machinery/nuclearbomb/proc/nukehack_win(mob/user as mob)
if(!usr.canmove || usr.stat || usr.restrained())
return
if(!ishuman(usr))
- usr << "You don't have the dexterity to do this!"
+ to_chat(usr, "You don't have the dexterity to do this!")
return 1
if(deployable)
- usr << "You close several panels to make [src] undeployable."
+ to_chat(usr, "You close several panels to make [src] undeployable.")
deployable = 0
else
- usr << "You adjust some panels to make [src] deployable."
+ to_chat(usr, "You adjust some panels to make [src] deployable.")
deployable = 1
return
@@ -240,10 +240,10 @@ obj/machinery/nuclearbomb/proc/nukehack_win(mob/user as mob)
var/temp_wire = href_list["wire"]
if(href_list["act"] == "pulse")
if(!istype(usr.get_active_hand(), /obj/item/device/multitool))
- usr << "You need a multitool!"
+ to_chat(usr, "You need a multitool!")
else
if(wires[temp_wire])
- usr << "You can't pulse a cut wire."
+ to_chat(usr, "You can't pulse a cut wire.")
else
if(light_wire == temp_wire)
lighthack = !lighthack
@@ -262,8 +262,9 @@ obj/machinery/nuclearbomb/proc/nukehack_win(mob/user as mob)
else
visible_message("The [src] emits a quiet whirling noise!")
if(href_list["act"] == "wire")
- if(!istype(usr.get_active_hand(), /obj/item/weapon/wirecutters))
- usr << "You need wirecutters!"
+ var/obj/item/I = usr.get_active_hand()
+ if(!I.is_wirecutter())
+ to_chat(usr, "You need wirecutters!")
else
wires[temp_wire] = !wires[temp_wire]
if(safety_wire == temp_wire)
@@ -314,7 +315,7 @@ obj/machinery/nuclearbomb/proc/nukehack_win(mob/user as mob)
if(timing == -1.0)
return
if(safety)
- usr << "The safety is still on."
+ to_chat(usr, "The safety is still on.")
return
timing = !(timing)
if(timing)
diff --git a/code/game/machinery/oxygen_pump.dm b/code/game/machinery/oxygen_pump.dm
index 36db3f83f3..fd6a1048c7 100644
--- a/code/game/machinery/oxygen_pump.dm
+++ b/code/game/machinery/oxygen_pump.dm
@@ -36,8 +36,8 @@
visible_message("The mask rapidly retracts just before /the [src] is destroyed!")
breather = null
- qdel_null(tank)
- qdel_null(contained)
+ QDEL_NULL(tank)
+ QDEL_NULL(contained)
return ..()
/obj/machinery/oxygen_pump/MouseDrop(var/mob/living/carbon/human/target, src_location, over_location)
@@ -128,7 +128,7 @@
return 1
/obj/machinery/oxygen_pump/attackby(obj/item/weapon/W as obj, mob/user as mob)
- if(istype(W,/obj/item/weapon/screwdriver))
+ if(W.is_screwdriver())
stat ^= MAINT
user.visible_message("\The [user] [stat & MAINT ? "opens" : "closes"] \the [src].", "You [stat & MAINT ? "open" : "close"] \the [src].")
if(stat & MAINT)
@@ -205,7 +205,7 @@
// update the ui if it exists, returns null if no ui is passed/found
- ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
+ ui = GLOB.nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
// the ui does not exist, so we'll create a new() one
// for a list of parameters and their descriptions see the code docs in \code\modules\nano\nanoui.dm
diff --git a/code/game/machinery/partslathe_vr.dm b/code/game/machinery/partslathe_vr.dm
index 42fa5b32ae..fc594606d1 100644
--- a/code/game/machinery/partslathe_vr.dm
+++ b/code/game/machinery/partslathe_vr.dm
@@ -1,6 +1,6 @@
/*
** The Parts Lathe! Able to produce all tech level 1 stock parts for building machines!
-**
+**
** The idea is that engineering etc should be able to build/repair basic technology machines
** without having to use a protolathe to print what are not prototype technologies.
** Some felt having an autolathe do this might be OP, so its a separate machine.
@@ -12,7 +12,7 @@
** Leshana says:
** - Phase 1 of this project adds the machine and basic operation.
** - Phase 2 will enhance usability by making & labeling boxes with a set of parts.
-**
+**
** TODO - Implement phase 2 by adding cardboard boxes
*/
@@ -280,7 +280,7 @@
recipies_ui[++recipies_ui.len] = list("name" = R.name, "type" = "[T]")
data["recipies"] = recipies_ui
- ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
+ ui = GLOB.nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, "partslathe.tmpl", "Parts Lathe UI", 500, 450)
ui.set_initial_data(data)
diff --git a/code/game/machinery/pda_multicaster.dm b/code/game/machinery/pda_multicaster.dm
index fde455ae51..3388de0c31 100644
--- a/code/game/machinery/pda_multicaster.dm
+++ b/code/game/machinery/pda_multicaster.dm
@@ -46,9 +46,9 @@
icon_state = "[initial(icon_state)]-p"
/obj/machinery/pda_multicaster/attackby(obj/item/I, mob/user)
- if(istype(I, /obj/item/weapon/screwdriver))
+ if(I.is_screwdriver())
default_deconstruction_screwdriver(user, I)
- else if(istype(I, /obj/item/weapon/crowbar))
+ else if(I.is_crowbar())
default_deconstruction_crowbar(user, I)
else
..()
diff --git a/code/game/machinery/pipe/construction.dm b/code/game/machinery/pipe/construction.dm
index ca09d3de58..0482e2f242 100644
--- a/code/game/machinery/pipe/construction.dm
+++ b/code/game/machinery/pipe/construction.dm
@@ -166,11 +166,11 @@ Buildable meters
return ..()
/obj/item/pipe/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
- if(iswrench(W))
+ if(W.is_wrench())
return wrench_act(user, W)
return ..()
-/obj/item/pipe/proc/wrench_act(var/mob/living/user, var/obj/item/weapon/wrench/W)
+/obj/item/pipe/proc/wrench_act(var/mob/living/user, var/obj/item/weapon/tool/wrench/W)
if(!isturf(loc))
return TRUE
@@ -255,11 +255,11 @@ Buildable meters
var/piping_layer = PIPING_LAYER_DEFAULT
/obj/item/pipe_meter/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
- if(iswrench(W))
+ if(W.is_wrench())
return wrench_act(user, W)
return ..()
-/obj/item/pipe_meter/proc/wrench_act(var/mob/living/user, var/obj/item/weapon/wrench/W)
+/obj/item/pipe_meter/proc/wrench_act(var/mob/living/user, var/obj/item/weapon/tool/wrench/W)
var/obj/machinery/atmospherics/pipe/pipe
for(var/obj/machinery/atmospherics/pipe/P in loc)
if(P.piping_layer == piping_layer)
diff --git a/code/game/machinery/pipe/pipe_dispenser.dm b/code/game/machinery/pipe/pipe_dispenser.dm
index 6675a5ca15..d863e57b90 100644
--- a/code/game/machinery/pipe/pipe_dispenser.dm
+++ b/code/game/machinery/pipe/pipe_dispenser.dm
@@ -74,7 +74,7 @@
user.drop_item()
qdel(W)
return
- else if (istype(W, /obj/item/weapon/wrench))
+ else if(W.is_wrench())
if (unwrenched==0)
playsound(src, W.usesound, 50, 1)
user << "You begin to unfasten \the [src] from the floor..."
diff --git a/code/game/machinery/pipe/pipelayer.dm b/code/game/machinery/pipe/pipelayer.dm
index 65656929de..366a351d6b 100644
--- a/code/game/machinery/pipe/pipelayer.dm
+++ b/code/game/machinery/pipe/pipelayer.dm
@@ -13,7 +13,7 @@
var/max_metal = 50 // Max capacity for internal metal storage
var/metal = 0 // Current amount in internal metal storage
var/pipe_cost = 0.25 // Cost in steel for each pipe.
- var/obj/item/weapon/wrench/W // Internal wrench used for wrenching down the pipes
+ var/obj/item/weapon/tool/wrench/W // Internal wrench used for wrenching down the pipes
var/list/Pipes = list(
"regular pipes" = /obj/machinery/atmospherics/pipe/simple,
"scrubbers pipes" = /obj/machinery/atmospherics/pipe/simple/hidden/scrubbers,
@@ -28,7 +28,7 @@
update_icon()
/obj/machinery/pipelayer/Destroy()
- qdel_null(W)
+ QDEL_NULL(W)
. = ..()
/obj/machinery/pipelayer/RefreshParts()
@@ -57,7 +57,7 @@
return
if(panel_open)
if(metal < 1)
- user << "\The [src] is empty."
+ to_chat(user, "\The [src] is empty.")
return
var/answer = alert(user, "Do you want to eject all the metal in \the [src]?", , "Yes","No")
if(answer == "Yes")
@@ -66,7 +66,7 @@
"You remove [amount_ejected] sheet\s of [DEFAULT_WALL_MATERIAL] from \the [src].")
return
if(!metal && !on)
- user << "\The [src] doesn't work without metal."
+ to_chat(user, "\The [src] doesn't work without metal.")
return
on = !on
old_turf = get_turf(src)
@@ -81,33 +81,33 @@
return
if(default_part_replacement(user, W))
return
- if (!panel_open && iswrench(W))
+ if (!panel_open && W.is_wrench())
P_type_t = input("Choose pipe type", "Pipe type") as null|anything in Pipes
P_type = Pipes[P_type_t]
user.visible_message("[user] has set \the [src] to manufacture [P_type_t].", "You set \the [src] to manufacture [P_type_t].")
return
- if(!panel_open && iscrowbar(W))
+ if(!panel_open && W.is_crowbar())
a_dis = !a_dis
user.visible_message("[user] has [!a_dis?"de":""]activated auto-dismantling.", "You [!a_dis?"de":""]activate auto-dismantling.")
return
if(istype(W, /obj/item/pipe))
// NOTE - We must check for matter, otherwise the (free) pipe dispenser can be used to get infinite steel.
if(!W.matter || W.matter[DEFAULT_WALL_MATERIAL] < pipe_cost * SHEET_MATERIAL_AMOUNT)
- user << "\The [W] doesn't contain enough [DEFAULT_WALL_MATERIAL] to recycle."
+ to_chat(user, "\The [W] doesn't contain enough [DEFAULT_WALL_MATERIAL] to recycle.")
else if(metal + pipe_cost > max_metal)
- user << "\The [src] is full."
+ to_chat(user, "\The [src] is full.")
else
user.drop_from_inventory(W)
metal += pipe_cost
- usr << "You recycle \the [W]."
+ to_chat(user, "You recycle \the [W].")
qdel(W)
return
if(istype(W, /obj/item/stack/material) && W.get_material_name() == DEFAULT_WALL_MATERIAL)
var/result = load_metal(W)
if(isnull(result))
- user << "Unable to load [W] - no metal found."
+ to_chat(user, "Unable to load [W] - no metal found.")
else if(!result)
- user << "\The [src] is full."
+ to_chat(user, "\The [src] is full.")
else
user.visible_message("[user] has loaded metal into \the [src].", "You load metal into \the [src]")
return
@@ -116,7 +116,7 @@
/obj/machinery/pipelayer/examine(mob/user)
..()
- user << "\The [src] has [metal] sheet\s, is set to produce [P_type_t], and auto-dismantling is [!a_dis?"de":""]activated."
+ to_chat(user, "\The [src] has [metal] sheet\s, is set to produce [P_type_t], and auto-dismantling is [!a_dis?"de":""]activated.")
/obj/machinery/pipelayer/proc/reset()
on = 0
diff --git a/code/game/machinery/portable_turret.dm b/code/game/machinery/portable_turret.dm
index 2b59a24bd1..07357ceb7b 100644
--- a/code/game/machinery/portable_turret.dm
+++ b/code/game/machinery/portable_turret.dm
@@ -231,11 +231,11 @@ var/list/turret_icons
/obj/machinery/porta_turret/proc/isLocked(mob/user)
if(ailock && issilicon(user))
- user << "There seems to be a firewall preventing you from accessing this device."
+ to_chat(user, "There seems to be a firewall preventing you from accessing this device.")
return 1
if(locked && !issilicon(user))
- user << "Access denied."
+ to_chat(user, "Access denied.")
return 1
return 0
@@ -271,7 +271,7 @@ var/list/turret_icons
settings[++settings.len] = list("category" = "Neutralize All Entities", "setting" = "check_all", "value" = check_all)
data["settings"] = settings
- ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
+ ui = GLOB.nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if(!ui)
ui = new(user, src, ui_key, "turret_control.tmpl", "Turret Controls", 500, 300)
ui.set_initial_data(data)
@@ -284,14 +284,14 @@ var/list/turret_icons
/obj/machinery/porta_turret/CanUseTopic(var/mob/user)
if(HasController())
- user << "Turrets can only be controlled using the assigned turret controller."
+ to_chat(user, "Turrets can only be controlled using the assigned turret controller.")
return STATUS_CLOSE
if(isLocked(user))
return STATUS_CLOSE
if(!anchored)
- usr << "\The [src] has to be secured first!"
+ to_chat(user, "\The [src] has to be secured first!")
return STATUS_CLOSE
return ..()
@@ -335,13 +335,13 @@ var/list/turret_icons
/obj/machinery/porta_turret/attackby(obj/item/I, mob/user)
if(stat & BROKEN)
- if(istype(I, /obj/item/weapon/crowbar))
+ if(I.is_crowbar())
//If the turret is destroyed, you can remove it with a crowbar to
//try and salvage its components
- user << "You begin prying the metal coverings off."
+ to_chat(user, "You begin prying the metal coverings off.")
if(do_after(user, 20))
if(can_salvage && prob(70))
- user << "You remove the turret and salvage some components."
+ to_chat(user, "You remove the turret and salvage some components.")
if(installation)
var/obj/item/weapon/gun/energy/Gun = new installation(loc)
Gun.power_supply.charge = gun_charge
@@ -351,18 +351,18 @@ var/list/turret_icons
if(prob(50))
new /obj/item/device/assembly/prox_sensor(loc)
else
- user << "You remove the turret but did not manage to salvage anything."
+ to_chat(user, "You remove the turret but did not manage to salvage anything.")
qdel(src) // qdel
- else if((istype(I, /obj/item/weapon/wrench)))
+ else if(I.is_wrench())
if(enabled || raised)
- user << "You cannot unsecure an active turret!"
+ to_chat(user, "You cannot unsecure an active turret!")
return
if(wrenching)
- user << "Someone is already [anchored ? "un" : ""]securing the turret!"
+ to_chat(user, "Someone is already [anchored ? "un" : ""]securing the turret!")
return
if(!anchored && isinspace())
- user << "Cannot secure turrets in space!"
+ to_chat(user, "Cannot secure turrets in space!")
return
user.visible_message(\
@@ -377,11 +377,11 @@ var/list/turret_icons
playsound(loc, I.usesound, 100, 1)
anchored = 1
update_icon()
- user << "You secure the exterior bolts on the turret."
+ to_chat(user, "You secure the exterior bolts on the turret.")
else if(anchored)
playsound(loc, I.usesound, 100, 1)
anchored = 0
- user << "You unsecure the exterior bolts on the turret."
+ to_chat(user, "You unsecure the exterior bolts on the turret.")
update_icon()
wrenching = 0
@@ -389,10 +389,10 @@ var/list/turret_icons
//Behavior lock/unlock mangement
if(allowed(user))
locked = !locked
- user << "Controls are now [locked ? "locked" : "unlocked"]."
+ to_chat(user, "Controls are now [locked ? "locked" : "unlocked"].")
updateUsrDialog()
else
- user << "Access denied."
+ to_chat(user, "Access denied.")
else
//if the turret was attacked with the intention of harming it:
@@ -422,7 +422,7 @@ var/list/turret_icons
if(!emagged)
//Emagging the turret makes it go bonkers and stun everyone. It also makes
//the turret shoot much, much faster.
- user << "You short out [src]'s threat assessment circuits."
+ to_chat(user, "You short out [src]'s threat assessment circuits.")
visible_message("[src] hums oddly...")
emagged = 1
iconholder = 1
@@ -777,16 +777,16 @@ var/list/turret_icons
//this is a bit unwieldy but self-explanatory
switch(build_step)
if(0) //first step
- if(istype(I, /obj/item/weapon/wrench) && !anchored)
+ if(I.is_wrench() && !anchored)
playsound(loc, I.usesound, 100, 1)
- user << "You secure the external bolts."
+ to_chat(user, "You secure the external bolts.")
anchored = 1
build_step = 1
return
- else if(istype(I, /obj/item/weapon/crowbar) && !anchored)
+ else if(I.is_crowbar() && !anchored)
playsound(loc, I.usesound, 75, 1)
- user << "You dismantle the turret construction."
+ to_chat(user, "You dismantle the turret construction.")
new /obj/item/stack/material/steel(loc, 5)
qdel(src)
return
@@ -795,24 +795,24 @@ var/list/turret_icons
if(istype(I, /obj/item/stack/material) && I.get_material_name() == DEFAULT_WALL_MATERIAL)
var/obj/item/stack/M = I
if(M.use(2))
- user << "You add some metal armor to the interior frame."
+ to_chat(user, "You add some metal armor to the interior frame.")
build_step = 2
icon_state = "turret_frame2"
else
- user << "You need two sheets of metal to continue construction."
+ to_chat(user, "You need two sheets of metal to continue construction.")
return
- else if(istype(I, /obj/item/weapon/wrench))
+ else if(I.is_wrench())
playsound(loc, I.usesound, 75, 1)
- user << "You unfasten the external bolts."
+ to_chat(user, "You unfasten the external bolts.")
anchored = 0
build_step = 0
return
if(2)
- if(istype(I, /obj/item/weapon/wrench))
+ if(I.is_wrench())
playsound(loc, I.usesound, 100, 1)
- user << "You bolt the metal armor into place."
+ to_chat(user, "You bolt the metal armor into place.")
build_step = 3
return
@@ -821,14 +821,14 @@ var/list/turret_icons
if(!WT.isOn())
return
if(WT.get_fuel() < 5) //uses up 5 fuel.
- user << "You need more fuel to complete this task."
+ to_chat(user, "You need more fuel to complete this task.")
return
playsound(loc, I.usesound, 50, 1)
if(do_after(user, 20 * I.toolspeed))
if(!src || !WT.remove_fuel(5, user)) return
build_step = 1
- user << "You remove the turret's interior metal armor."
+ to_chat(user, "You remove the turret's interior metal armor.")
new /obj/item/stack/material/steel(loc, 2)
return
@@ -839,20 +839,20 @@ var/list/turret_icons
return
var/obj/item/weapon/gun/energy/E = I //typecasts the item to an energy gun
if(!user.unEquip(I))
- user << "\the [I] is stuck to your hand, you cannot put it in \the [src]"
+ to_chat(user, "\the [I] is stuck to your hand, you cannot put it in \the [src]")
return
installation = I.type //installation becomes I.type
gun_charge = E.power_supply.charge //the gun's charge is stored in gun_charge
- user << "You add [I] to the turret."
+ to_chat(user, "You add [I] to the turret.")
target_type = /obj/machinery/porta_turret
build_step = 4
qdel(I) //delete the gun :(
return
- else if(istype(I, /obj/item/weapon/wrench))
+ else if(I.is_wrench())
playsound(loc, I.usesound, 100, 1)
- user << "You remove the turret's metal armor bolts."
+ to_chat(user, "You remove the turret's metal armor bolts.")
build_step = 2
return
@@ -860,19 +860,19 @@ var/list/turret_icons
if(isprox(I))
build_step = 5
if(!user.unEquip(I))
- user << "\the [I] is stuck to your hand, you cannot put it in \the [src]"
+ to_chat(user, "\the [I] is stuck to your hand, you cannot put it in \the [src]")
return
- user << "You add the prox sensor to the turret."
+ to_chat(user, "You add the prox sensor to the turret.")
qdel(I)
return
//attack_hand() removes the gun
if(5)
- if(istype(I, /obj/item/weapon/screwdriver))
+ if(I.is_screwdriver())
playsound(loc, I.usesound, 100, 1)
build_step = 6
- user << "You close the internal access hatch."
+ to_chat(user, "You close the internal access hatch.")
return
//attack_hand() removes the prox sensor
@@ -881,16 +881,16 @@ var/list/turret_icons
if(istype(I, /obj/item/stack/material) && I.get_material_name() == DEFAULT_WALL_MATERIAL)
var/obj/item/stack/M = I
if(M.use(2))
- user << "You add some metal armor to the exterior frame."
+ to_chat(user, "You add some metal armor to the exterior frame.")
build_step = 7
else
- user << "You need two sheets of metal to continue construction."
+ to_chat(user, "You need two sheets of metal to continue construction.")
return
- else if(istype(I, /obj/item/weapon/screwdriver))
+ else if(I.is_screwdriver())
playsound(loc, I.usesound, 100, 1)
build_step = 5
- user << "You open the internal access hatch."
+ to_chat(user, "You open the internal access hatch.")
return
if(7)
@@ -898,14 +898,14 @@ var/list/turret_icons
var/obj/item/weapon/weldingtool/WT = I
if(!WT.isOn()) return
if(WT.get_fuel() < 5)
- user << "You need more fuel to complete this task."
+ to_chat(user, "You need more fuel to complete this task.")
playsound(loc, WT.usesound, 50, 1)
if(do_after(user, 30 * WT.toolspeed))
if(!src || !WT.remove_fuel(5, user))
return
build_step = 8
- user << "You weld the turret's armor down."
+ to_chat(user, "You weld the turret's armor down.")
//The final step: create a full turret
var/obj/machinery/porta_turret/Turret = new target_type(loc)
@@ -917,9 +917,9 @@ var/list/turret_icons
qdel(src) // qdel
- else if(istype(I, /obj/item/weapon/crowbar))
+ else if(I.is_crowbar())
playsound(loc, I.usesound, 75, 1)
- user << "You pry off the turret's exterior armor."
+ to_chat(user, "You pry off the turret's exterior armor.")
new /obj/item/stack/material/steel(loc, 2)
build_step = 6
return
@@ -948,10 +948,10 @@ var/list/turret_icons
Gun.update_icon()
installation = null
gun_charge = 0
- user << "You remove [Gun] from the turret frame."
+ to_chat(user, "You remove [Gun] from the turret frame.")
if(5)
- user << "You remove the prox sensor from the turret frame."
+ to_chat(user, "You remove the prox sensor from the turret frame.")
new /obj/item/device/assembly/prox_sensor(loc)
build_step = 4
diff --git a/code/game/machinery/recharger.dm b/code/game/machinery/recharger.dm
index c6bb798279..bf10bf2ca1 100644
--- a/code/game/machinery/recharger.dm
+++ b/code/game/machinery/recharger.dm
@@ -8,7 +8,7 @@ obj/machinery/recharger
idle_power_usage = 4
active_power_usage = 40000 //40 kW
var/obj/item/charging = null
- var/list/allowed_devices = list(/obj/item/weapon/gun/energy, /obj/item/weapon/melee/baton, /obj/item/device/laptop, /obj/item/weapon/cell, /obj/item/device/flashlight, /obj/item/device/electronic_assembly, /obj/item/weapon/weldingtool/electric, /obj/item/ammo_casing/nsfw_batt) //VOREStation Add - NSFW Batteries
+ var/list/allowed_devices = list(/obj/item/weapon/gun/energy, /obj/item/weapon/melee/baton, /obj/item/device/laptop, /obj/item/weapon/cell, /obj/item/device/flashlight, /obj/item/device/electronic_assembly, /obj/item/weapon/weldingtool/electric, /obj/item/ammo_magazine/smart, /obj/item/ammo_casing/nsfw_batt) //VOREStation Add - NSFW Batteries
var/icon_state_charged = "recharger2"
var/icon_state_charging = "recharger1"
var/icon_state_idle = "recharger0" //also when unpowered
@@ -52,7 +52,7 @@ obj/machinery/recharger
G.loc = src
charging = G
update_icon()
- else if(portable && istype(G, /obj/item/weapon/wrench))
+ else if(portable && G.is_wrench())
if(charging)
to_chat(user, "Remove [charging] first!")
return
diff --git a/code/game/machinery/rechargestation.dm b/code/game/machinery/rechargestation.dm
index 692e76bf5a..f702f3cf25 100644
--- a/code/game/machinery/rechargestation.dm
+++ b/code/game/machinery/rechargestation.dm
@@ -126,7 +126,7 @@
/obj/machinery/recharge_station/examine(mob/user)
..(user)
- user << "The charge meter reads: [round(chargepercentage())]%"
+ to_chat(user, "The charge meter reads: [round(chargepercentage())]%")
/obj/machinery/recharge_station/proc/chargepercentage()
if(!cell)
@@ -292,7 +292,7 @@
if(usr.incapacitated() || !isliving(usr))
return
-
+
go_in(usr)
/obj/machinery/recharge_station/ghost_pod_recharger
diff --git a/code/game/machinery/requests_console.dm b/code/game/machinery/requests_console.dm
index 2ad81624a3..5c81cfe31f 100644
--- a/code/game/machinery/requests_console.dm
+++ b/code/game/machinery/requests_console.dm
@@ -127,7 +127,7 @@ var/list/obj/machinery/requests_console/allConsoles = list()
data["msgVerified"] = msgVerified
data["announceAuth"] = announceAuth
- ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
+ ui = GLOB.nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if(!ui)
ui = new(user, src, ui_key, "request_console.tmpl", "[department] Request Console", 520, 410)
ui.set_initial_data(data)
@@ -247,7 +247,7 @@ var/list/obj/machinery/requests_console/allConsoles = list()
announcement.announcer = ID.assignment ? "[ID.assignment] [ID.registered_name]" : ID.registered_name
else
reset_message()
- user << "You are not authorized to send announcements."
+ to_chat(user, "You are not authorized to send announcements.")
updateUsrDialog()
if(istype(O, /obj/item/weapon/stamp))
if(inoperable(MAINT)) return
diff --git a/code/game/machinery/spaceheater.dm b/code/game/machinery/spaceheater.dm
index ec0af28d58..4c447e91f3 100644
--- a/code/game/machinery/spaceheater.dm
+++ b/code/game/machinery/spaceheater.dm
@@ -30,11 +30,11 @@
/obj/machinery/space_heater/examine(mob/user)
..(user)
- user << "The heater is [on ? "on" : "off"] and the hatch is [panel_open ? "open" : "closed"]."
+ to_chat(user, "The heater is [on ? "on" : "off"] and the hatch is [panel_open ? "open" : "closed"].")
if(panel_open)
- user << "The power cell is [cell ? "installed" : "missing"]."
+ to_chat(user, "The power cell is [cell ? "installed" : "missing"].")
else
- user << "The charge meter reads [cell ? round(cell.percent(),1) : 0]%"
+ to_chat(user, "The charge meter reads [cell ? round(cell.percent(),1) : 0]%")
return
/obj/machinery/space_heater/powered()
@@ -54,7 +54,7 @@
if(istype(I, /obj/item/weapon/cell))
if(panel_open)
if(cell)
- user << "There is already a power cell inside."
+ to_chat(user, "There is already a power cell inside.")
return
else
// insert cell
@@ -68,9 +68,9 @@
user.visible_message("[user] inserts a power cell into [src].", "You insert the power cell into [src].")
power_change()
else
- user << "The hatch must be open to insert a power cell."
+ to_chat(user, "The hatch must be open to insert a power cell.")
return
- else if(istype(I, /obj/item/weapon/screwdriver))
+ else if(I.is_screwdriver())
panel_open = !panel_open
playsound(src, I.usesound, 50, 1)
user.visible_message("[user] [panel_open ? "opens" : "closes"] the hatch on the [src].", "You [panel_open ? "open" : "close"] the hatch on the [src].")
diff --git a/code/game/machinery/suit_storage_unit.dm b/code/game/machinery/suit_storage_unit.dm
index d55dc0bb3e..41130ad5b9 100644
--- a/code/game/machinery/suit_storage_unit.dm
+++ b/code/game/machinery/suit_storage_unit.dm
@@ -207,14 +207,14 @@
if(!protected)
playsound(src.loc, "sparks", 75, 1, -1)
- user << "You try to touch the controls but you get zapped. There must be a short circuit somewhere."
+ to_chat(user, "You try to touch the controls but you get zapped. There must be a short circuit somewhere.")
return*/
else //welp, the guy is protected, we can continue
if(issuperUV)
- user << "You slide the dial back towards \"185nm\"."
+ to_chat(user, "You slide the dial back towards \"185nm\".")
issuperUV = 0
else
- user << "You crank the dial all the way up to \"15nm\"."
+ to_chat(user, "You crank the dial all the way up to \"15nm\".")
issuperUV = 1
return
@@ -233,10 +233,10 @@
if(!protected)
playsound(src.loc, "sparks", 75, 1, -1)
- user << "You try to touch the controls but you get zapped. There must be a short circuit somewhere."
+ to_chat(user, "You try to touch the controls but you get zapped. There must be a short circuit somewhere.")
return*/
else
- user << "You push the button. The coloured LED next to it changes."
+ to_chat(user, "You push the button. The coloured LED next to it changes.")
safetieson = !safetieson
@@ -285,7 +285,7 @@
/obj/machinery/suit_storage_unit/proc/toggle_open(mob/user as mob)
if(islocked || isUV)
- user << "Unable to open unit."
+ to_chat(user, "Unable to open unit.")
return
if(OCCUPANT)
eject_occupant(user)
@@ -296,7 +296,7 @@
/obj/machinery/suit_storage_unit/proc/toggle_lock(mob/user as mob)
if(OCCUPANT && safetieson)
- user << "The Unit's safety protocols disallow locking when a biological form is detected inside its compartments."
+ to_chat(user, "The Unit's safety protocols disallow locking when a biological form is detected inside its compartments.")
return
if(isopen)
return
@@ -308,12 +308,12 @@
if(isUV || isopen) //I'm bored of all these sanity checks
return
if(OCCUPANT && safetieson)
- user << "WARNING: Biological entity detected in the confines of the Unit's storage. Cannot initiate cycle."
+ to_chat(user, "WARNING: Biological entity detected in the confines of the Unit's storage. Cannot initiate cycle.")
return
if(!HELMET && !MASK && !SUIT && !OCCUPANT) //shit's empty yo
- user << "Unit storage bays empty. Nothing to disinfect -- Aborting."
+ to_chat(user, "Unit storage bays empty. Nothing to disinfect -- Aborting.")
return
- user << "You start the Unit's cauterisation cycle."
+ to_chat(user, "You start the Unit's cauterisation cycle.")
cycletime_left = 20
isUV = 1
if(OCCUPANT && !islocked)
@@ -378,10 +378,10 @@
if(OCCUPANT)
if(issuperUV)
OCCUPANT.take_organ_damage(0,40)
- user << "Test. You gave him 40 damage"
+ to_chat(user, "Test. You gave him 40 damage")
else
OCCUPANT.take_organ_damage(0,8)
- user << "Test. You gave him 8 damage"
+ to_chat(user, "Test. You gave him 8 damage")
return*/
@@ -438,13 +438,13 @@
if(usr.stat != 0)
return
if(!isopen)
- usr << "The unit's doors are shut."
+ to_chat(usr, "The unit's doors are shut.")
return
if(!ispowered || isbroken)
- usr << "The unit is not operational."
+ to_chat(usr, "The unit is not operational.")
return
if((OCCUPANT) || (HELMET) || (SUIT))
- usr << "It's too cluttered inside for you to fit in!"
+ to_chat(usr, "It's too cluttered inside for you to fit in!")
return
visible_message("[usr] starts squeezing into the suit storage unit!", 3)
if(do_after(usr, 10))
@@ -471,10 +471,10 @@
/obj/machinery/suit_storage_unit/attackby(obj/item/I as obj, mob/user as mob)
if(!ispowered)
return
- if(istype(I, /obj/item/weapon/screwdriver))
+ if(I.is_screwdriver())
panelopen = !panelopen
playsound(src, I.usesound, 100, 1)
- user << text("You [] the unit's maintenance panel.",(panelopen ? "open up" : "close"))
+ to_chat(user, "You [panelopen ? "open up" : "close"] the unit's maintenance panel.")
updateUsrDialog()
return
if(istype(I, /obj/item/weapon/grab))
@@ -482,13 +482,13 @@
if(!(ismob(G.affecting)))
return
if(!isopen)
- usr << "The unit's doors are shut."
+ to_chat(user, "The unit's doors are shut.")
return
if(!ispowered || isbroken)
- usr << "The unit is not operational."
+ to_chat(user, "The unit is not operational.")
return
if((OCCUPANT) || (HELMET) || (SUIT)) //Unit needs to be absolutely empty
- user << "The unit's storage area is too cluttered."
+ to_chat(user, "The unit's storage area is too cluttered.")
return
visible_message("[user] starts putting [G.affecting.name] into the Suit Storage Unit.", 3)
if(do_after(user, 20))
@@ -514,9 +514,9 @@
return
var/obj/item/clothing/suit/space/S = I
if(SUIT)
- user << "The unit already contains a suit."
+ to_chat(user, "The unit already contains a suit.")
return
- user << "You load the [S.name] into the storage compartment."
+ to_chat(user, "You load the [S.name] into the storage compartment.")
user.drop_item()
S.loc = src
SUIT = S
@@ -528,9 +528,9 @@
return
var/obj/item/clothing/head/helmet/H = I
if(HELMET)
- user << "The unit already contains a helmet."
+ to_chat(user, "The unit already contains a helmet.")
return
- user << "You load the [H.name] into the storage compartment."
+ to_chat(user, "You load the [H.name] into the storage compartment.")
user.drop_item()
H.loc = src
HELMET = H
@@ -542,9 +542,9 @@
return
var/obj/item/clothing/mask/M = I
if(MASK)
- user << "The unit already contains a mask."
+ to_chat(user, "The unit already contains a mask.")
return
- user << "You load the [M.name] into the storage compartment."
+ to_chat(user, "You load the [M.name] into the storage compartment.")
user.drop_item()
M.loc = src
MASK = M
@@ -643,6 +643,20 @@
departments = list("Mercenary", "Charring")
can_repair = 1
+/obj/machinery/suit_cycler/exploration
+ name = "Explorer suit cycler"
+ model_text = "Exploration"
+ departments = list("Exploration","Old Exploration")
+
+/obj/machinery/suit_cycler/exploreration/initialize()
+ species -= SPECIES_TESHARI
+ return ..()
+
+/obj/machinery/suit_cycler/pilot
+ name = "Pilot suit cycler"
+ model_text = "Pilot"
+ departments = list("Pilot Blue","Pilot")
+
/obj/machinery/suit_cycler/attack_ai(mob/user as mob)
return attack_hand(user)
@@ -653,7 +667,7 @@
return
//Hacking init.
- if(istype(I, /obj/item/device/multitool) || istype(I, /obj/item/weapon/wirecutters))
+ if(istype(I, /obj/item/device/multitool) || I.is_wirecutter())
if(panel_open)
attack_hand(user)
return
@@ -665,11 +679,11 @@
return
if(locked)
- user << "The suit cycler is locked."
+ to_chat(user, "The suit cycler is locked.")
return
if(contents.len > 0)
- user << "There is no room inside the cycler for [G.affecting.name]."
+ to_chat(user, "There is no room inside the cycler for [G.affecting.name].")
return
visible_message("[user] starts putting [G.affecting.name] into the suit cycler.", 3)
@@ -689,29 +703,29 @@
updateUsrDialog()
return
- else if(istype(I,/obj/item/weapon/screwdriver))
+ else if(I.is_screwdriver())
panel_open = !panel_open
playsound(src, I.usesound, 50, 1)
- user << "You [panel_open ? "open" : "close"] the maintenance panel."
+ to_chat(user, "You [panel_open ? "open" : "close"] the maintenance panel.")
updateUsrDialog()
return
else if(istype(I,/obj/item/clothing/head/helmet/space) && !istype(I, /obj/item/clothing/head/helmet/space/rig))
if(locked)
- user << "The suit cycler is locked."
+ to_chat(user, "The suit cycler is locked.")
return
if(helmet)
- user << "The cycler already contains a helmet."
+ to_chat(user, "The cycler already contains a helmet.")
return
if(I.icon_override == CUSTOM_ITEM_MOB)
- user << "You cannot refit a customised voidsuit."
+ to_chat(user, "You cannot refit a customised voidsuit.")
return
- user << "You fit \the [I] into the suit cycler."
+ to_chat(user, "You fit \the [I] into the suit cycler.")
user.drop_item()
I.loc = src
helmet = I
@@ -723,18 +737,18 @@
else if(istype(I,/obj/item/clothing/suit/space/void))
if(locked)
- user << "The suit cycler is locked."
+ to_chat(user, "The suit cycler is locked.")
return
if(suit)
- user << "The cycler already contains a voidsuit."
+ to_chat(user, "The cycler already contains a voidsuit.")
return
if(I.icon_override == CUSTOM_ITEM_MOB)
- user << "You cannot refit a customised voidsuit."
+ to_chat(user, "You cannot refit a customised voidsuit.")
return
- user << "You fit \the [I] into the suit cycler."
+ to_chat(user, "You fit \the [I] into the suit cycler.")
user.drop_item()
I.loc = src
suit = I
@@ -747,11 +761,11 @@
/obj/machinery/suit_cycler/emag_act(var/remaining_charges, var/mob/user)
if(emagged)
- user << "The cycler has already been subverted."
+ to_chat(user, "The cycler has already been subverted.")
return
//Clear the access reqs, disable the safeties, and open up all paintjobs.
- user << "You run the sequencer across the interface, corrupting the operating protocols."
+ to_chat(user, "You run the sequencer across the interface, corrupting the operating protocols.")
departments = list("Engineering","Mining","Medical","Security","Atmos","HAZMAT","Construction","Biohazard","Crowd Control","Emergency Medical Response","^%###^%$", "Charring")
species = list(SPECIES_HUMAN,SPECIES_SKRELL,SPECIES_UNATHI,SPECIES_TAJ, SPECIES_TESHARI, "Nevrean", "Akula", "Sergal", "Flatland Zorren", "Highlander Zorren", "Vulpkanin", "Promethean", "Xenomorph Hybrid", "Vasilissan", "Rapala") //VORESTATION EDIT
@@ -855,14 +869,14 @@
if(allowed(usr))
locked = !locked
- usr << "You [locked ? "" : "un"]lock \the [src]."
+ to_chat(usr, "You [locked ? "" : "un"]lock \the [src].")
else
- usr << "Access denied."
+ to_chat(usr, "Access denied.")
else if(href_list["begin_decontamination"])
if(safeties && occupant)
- usr << "The cycler has detected an occupant. Please remove the occupant before commencing the decontamination cycle."
+ to_chat(usr, "The cycler has detected an occupant. Please remove the occupant before commencing the decontamination cycle.")
return
active = 1
@@ -1106,6 +1120,51 @@
suit.icon_state = "rig-firebug"
suit.item_state_slots[slot_r_hand_str] = "rig-firebug"
suit.item_state_slots[slot_l_hand_str] = "rig-firebug"
+ if("Exploration")
+ if(helmet)
+ helmet.name = "exploration voidsuit helmet"
+ helmet.icon_state = "helm_explorer"
+ helmet.item_state = "helm_explorer"
+ if(suit)
+ suit.name = "exploration voidsuit"
+ suit.icon_state = "void_explorer"
+ suit.item_state = "void_explorer"
+ suit.item_state_slots[slot_r_hand_str] = "wiz_voidsuit"
+ suit.item_state_slots[slot_l_hand_str] = "wiz_voidsuit"
+ if("Old Exploration")
+ if(helmet)
+ helmet.name = "exploration voidsuit helmet"
+ helmet.icon_state = "helm_explorer2"
+ helmet.item_state = "helm_explorer2"
+ if(suit)
+ suit.name = "exploration voidsuit"
+ suit.icon_state = "void_explorer2"
+ suit.item_state = "void_explorer2"
+ suit.item_state_slots[slot_r_hand_str] = "wiz_voidsuit"
+ suit.item_state_slots[slot_l_hand_str] = "wiz_voidsuit"
+ if("Pilot")
+ if(helmet)
+ helmet.name = "pilot voidsuit helmet"
+ helmet.icon_state = "rig0_pilot"
+ helmet.item_state = "pilot_helm"
+ if(suit)
+ suit.name = "pilot voidsuit"
+ suit.icon_state = "rig-pilot"
+ suit.item_state = "rig-pilot"
+ suit.item_state_slots[slot_r_hand_str] = "sec_voidsuitTG"
+ suit.item_state_slots[slot_l_hand_str] = "sec_voidsuitTG"
+ if("Pilot Blue")
+ if(helmet)
+ helmet.name = "pilot voidsuit helmet"
+ helmet.icon_state = "rig0_pilot2"
+ helmet.item_state = "pilot_helm2"
+ if(suit)
+ suit.name = "pilot voidsuit"
+ suit.icon_state = "rig-pilot2"
+ suit.item_state = "rig-pilot2"
+ suit.item_state_slots[slot_r_hand_str] = "sec_voidsuitTG"
+ suit.item_state_slots[slot_l_hand_str] = "sec_voidsuitTG"
+
if(helmet) helmet.name = "refitted [helmet.name]"
if(suit) suit.name = "refitted [suit.name]"
diff --git a/code/game/machinery/supplybeacon.dm b/code/game/machinery/supplybeacon.dm
index 0f58bd9a48..9f228be5d4 100644
--- a/code/game/machinery/supplybeacon.dm
+++ b/code/game/machinery/supplybeacon.dm
@@ -45,7 +45,7 @@
drop_type = "supermatter"
/obj/machinery/power/supply_beacon/attackby(var/obj/item/weapon/W, var/mob/user)
- if(!use_power && istype(W, /obj/item/weapon/wrench))
+ if(!use_power && W.is_wrench())
if(!anchored && !connect_to_network())
to_chat(user, "This device must be placed over an exposed cable.")
return
diff --git a/code/game/machinery/syndicatebeacon.dm b/code/game/machinery/syndicatebeacon.dm
index 5befc59495..2c59ec8b20 100644
--- a/code/game/machinery/syndicatebeacon.dm
+++ b/code/game/machinery/syndicatebeacon.dm
@@ -56,7 +56,7 @@
return
if(istype(M, /mob/living/carbon/human))
var/mob/living/carbon/human/N = M
- M << "You have joined the ranks of the Syndicate and become a traitor to the station!"
+ to_chat(N, "You have joined the ranks of the Syndicate and become a traitor to the station!")
traitors.add_antagonist(N.mind)
traitors.equip(N)
message_admins("[N]/([N.ckey]) has accepted a traitor objective from a syndicate beacon.")
@@ -87,7 +87,8 @@
/obj/machinery/power/singularity_beacon/proc/Activate(mob/user = null)
if(surplus() < 1500)
- if(user) user << "The connected wire doesn't have enough current."
+ if(user)
+ to_chat(user, "The connected wire doesn't have enough current.")
return
for(var/obj/singularity/singulo in all_singularities)
if(singulo.z == z)
@@ -96,7 +97,7 @@
active = 1
START_MACHINE_PROCESSING(src)
if(user)
- user << "You activate the beacon."
+ to_chat(user, "You activate the beacon.")
/obj/machinery/power/singularity_beacon/proc/Deactivate(mob/user = null)
for(var/obj/singularity/singulo in all_singularities)
@@ -105,7 +106,7 @@
icon_state = "[icontype]0"
active = 0
if(user)
- user << "You deactivate the beacon."
+ to_chat(user, "You deactivate the beacon.")
/obj/machinery/power/singularity_beacon/attack_ai(mob/user as mob)
return
@@ -114,27 +115,27 @@
if(anchored)
return active ? Deactivate(user) : Activate(user)
else
- user << "You need to screw the beacon to the floor first!"
+ to_chat(user, "You need to screw the beacon to the floor first!")
return
/obj/machinery/power/singularity_beacon/attackby(obj/item/weapon/W as obj, mob/user as mob)
- if(istype(W,/obj/item/weapon/screwdriver))
+ if(W.is_screwdriver())
if(active)
- user << "You need to deactivate the beacon first!"
+ to_chat(user, "You need to deactivate the beacon first!")
return
if(anchored)
anchored = 0
- user << "You unscrew the beacon from the floor."
+ to_chat(user, "You unscrew the beacon from the floor.")
playsound(src, W.usesound, 50, 1)
disconnect_from_network()
return
else
if(!connect_to_network())
- user << "This device must be placed over an exposed cable."
+ to_chat(user, "This device must be placed over an exposed cable.")
return
anchored = 1
- user << "You screw the beacon to the floor and attach the cable."
+ to_chat(user, "You screw the beacon to the floor and attach the cable.")
playsound(src, W.usesound, 50, 1)
return
..()
diff --git a/code/game/machinery/telecomms/machine_interactions.dm b/code/game/machinery/telecomms/machine_interactions.dm
index 208b9d51e8..331f5644d9 100644
--- a/code/game/machinery/telecomms/machine_interactions.dm
+++ b/code/game/machinery/telecomms/machine_interactions.dm
@@ -28,35 +28,35 @@
if (integrity < 100) //Damaged, let's repair!
if (T.use(1))
integrity = between(0, integrity + rand(10,20), 100)
- usr << "You apply the Nanopaste to [src], repairing some of the damage."
+ to_chat(usr, "You apply the Nanopaste to [src], repairing some of the damage.")
else
- usr << "This machine is already in perfect condition."
+ to_chat(usr, "This machine is already in perfect condition.")
return
switch(construct_op)
if(0)
- if(istype(P, /obj/item/weapon/screwdriver))
- user << "You unfasten the bolts."
+ if(P.is_screwdriver())
+ to_chat(user, "You unfasten the bolts.")
playsound(src.loc, P.usesound, 50, 1)
construct_op ++
if(1)
- if(istype(P, /obj/item/weapon/screwdriver))
- user << "You fasten the bolts."
+ if(P.is_screwdriver())
+ to_chat(user, "You fasten the bolts.")
playsound(src.loc, P.usesound, 50, 1)
construct_op --
- if(istype(P, /obj/item/weapon/wrench))
- user << "You dislodge the external plating."
+ if(P.is_wrench())
+ to_chat(user, "You dislodge the external plating.")
playsound(src.loc, P.usesound, 75, 1)
construct_op ++
if(2)
- if(istype(P, /obj/item/weapon/wrench))
- user << "You secure the external plating."
+ if(P.is_wrench())
+ to_chat(user, "You secure the external plating.")
playsound(src.loc, P.usesound, 75, 1)
construct_op --
- if(istype(P, /obj/item/weapon/wirecutters))
+ if(P.is_wirecutter())
playsound(src.loc, P.usesound, 50, 1)
- user << "You remove the cables."
+ to_chat(user, "You remove the cables.")
construct_op ++
var/obj/item/stack/cable_coil/A = new /obj/item/stack/cable_coil( user.loc )
A.amount = 5
@@ -65,16 +65,16 @@
if(istype(P, /obj/item/stack/cable_coil))
var/obj/item/stack/cable_coil/A = P
if (A.use(5))
- user << "You insert the cables."
+ to_chat(user, "You insert the cables.")
construct_op--
stat &= ~BROKEN // the machine's not borked anymore!
else
- user << "You need five coils of wire for this."
- if(istype(P, /obj/item/weapon/crowbar))
- user << "You begin prying out the circuit board other components..."
+ to_chat(user, "You need five coils of wire for this.")
+ if(P.is_crowbar())
+ to_chat(user, "You begin prying out the circuit board other components...")
playsound(src.loc, P.usesound, 50, 1)
if(do_after(user,60 * P.toolspeed))
- user << "You finish prying out the components."
+ to_chat(user, "You finish prying out the components.")
// Drop all the component stuff
if(contents.len > 0)
@@ -172,7 +172,7 @@
dat += ""
temp = ""
- user << browse(dat, "window=tcommachine;size=520x500;can_resize=0")
+ to_chat(user, browse(dat, "window=tcommachine;size=520x500;can_resize=0"))
onclose(user, "dormitory")
diff --git a/code/game/machinery/turret_control.dm b/code/game/machinery/turret_control.dm
index fa75864b01..d99795e6b3 100644
--- a/code/game/machinery/turret_control.dm
+++ b/code/game/machinery/turret_control.dm
@@ -137,7 +137,7 @@
data["settings"] = settings
- ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
+ ui = GLOB.nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if(!ui)
ui = new(user, src, ui_key, "turret_control.tmpl", "Turret Controls", 500, 300)
ui.set_initial_data(data)
diff --git a/code/game/machinery/vending.dm b/code/game/machinery/vending.dm
index 87fbc4dcfd..66cd186fc4 100644
--- a/code/game/machinery/vending.dm
+++ b/code/game/machinery/vending.dm
@@ -173,13 +173,13 @@
vend(currently_vending, usr)
return
else if(handled)
- nanomanager.update_uis(src)
+ GLOB.nanomanager.update_uis(src)
return // don't smack that machine with your 2 thalers
if(I || istype(W, /obj/item/weapon/spacecash))
attack_hand(user)
return
- else if(istype(W, /obj/item/weapon/screwdriver))
+ else if(W.is_screwdriver())
panel_open = !panel_open
to_chat(user, "You [panel_open ? "open" : "close"] the maintenance panel.")
playsound(src, W.usesound, 50, 1)
@@ -187,9 +187,9 @@
if(panel_open)
overlays += image(icon, "[initial(icon_state)]-panel")
- nanomanager.update_uis(src) // Speaker switch is on the main UI, not wires UI
+ GLOB.nanomanager.update_uis(src) // Speaker switch is on the main UI, not wires UI
return
- else if(istype(W, /obj/item/device/multitool)||istype(W, /obj/item/weapon/wirecutters))
+ else if(istype(W, /obj/item/device/multitool) || W.is_wirecutter())
if(panel_open)
attack_hand(user)
return
@@ -199,9 +199,9 @@
coin = W
categories |= CAT_COIN
to_chat(user, "You insert \the [W] into \the [src].")
- nanomanager.update_uis(src)
+ GLOB.nanomanager.update_uis(src)
return
- else if(istype(W, /obj/item/weapon/wrench))
+ else if(W.is_wrench())
playsound(src, W.usesound, 100, 1)
if(anchored)
user.visible_message("[user] begins unsecuring \the [src] from the floor.", "You start unsecuring \the [src] from the floor.")
@@ -403,7 +403,7 @@
else
data["panel"] = 0
- ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
+ ui = GLOB.nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if(!ui)
ui = new(user, src, ui_key, "vending_machine.tmpl", name, 440, 600)
ui.set_initial_data(data)
@@ -463,7 +463,7 @@
shut_up = !shut_up
add_fingerprint(usr)
- nanomanager.update_uis(src)
+ GLOB.nanomanager.update_uis(src)
/obj/machinery/vending/proc/vend(datum/stored_item/vending_product/R, mob/user)
if((!allowed(usr)) && !emagged && scan_id) //For SECURE VENDING MACHINES YEAH
@@ -474,7 +474,7 @@
vend_ready = 0 //One thing at a time!!
status_message = "Vending..."
status_error = 0
- nanomanager.update_uis(src)
+ GLOB.nanomanager.update_uis(src)
if(R.category & CAT_COIN)
if(!coin)
@@ -516,7 +516,8 @@
status_error = 0
vend_ready = 1
currently_vending = null
- nanomanager.update_uis(src)
+ GLOB.nanomanager.update_uis(src)
+
return 1
/obj/machinery/vending/proc/do_logging(datum/stored_item/vending_product/R, mob/user, var/vending = 0)
@@ -566,12 +567,12 @@
if(!user.unEquip(W))
return
- user << "You insert \the [W] in the product receptor."
+ to_chat(user, "You insert \the [W] in the product receptor.")
R.add_product(W)
if(has_logs)
do_logging(R, user)
- nanomanager.update_uis(src)
+ GLOB.nanomanager.update_uis(src)
/obj/machinery/vending/process()
if(stat & (BROKEN|NOPOWER))
@@ -736,7 +737,7 @@
/obj/machinery/vending/assist
products = list( /obj/item/device/assembly/prox_sensor = 5,/obj/item/device/assembly/igniter = 3,/obj/item/device/assembly/signaler = 4,
- /obj/item/weapon/wirecutters = 1, /obj/item/weapon/cartridge/signal = 4)
+ /obj/item/weapon/tool/wirecutters = 1, /obj/item/weapon/cartridge/signal = 4)
contraband = list(/obj/item/device/flashlight = 5,/obj/item/device/assembly/timer = 2)
product_ads = "Only the finest!;Have some tools.;The most robust equipment.;The finest gear in space!"
@@ -1025,8 +1026,8 @@
icon_state = "tool"
icon_deny = "tool-deny"
//req_access = list(access_maint_tunnels) //Maintenance access
- products = list(/obj/item/stack/cable_coil/random = 10,/obj/item/weapon/crowbar = 5,/obj/item/weapon/weldingtool = 3,/obj/item/weapon/wirecutters = 5,
- /obj/item/weapon/wrench = 5,/obj/item/device/analyzer = 5,/obj/item/device/t_scanner = 5,/obj/item/weapon/screwdriver = 5,
+ products = list(/obj/item/stack/cable_coil/random = 10,/obj/item/weapon/tool/crowbar = 5,/obj/item/weapon/weldingtool = 3,/obj/item/weapon/tool/wirecutters = 5,
+ /obj/item/weapon/tool/wrench = 5,/obj/item/device/analyzer = 5,/obj/item/device/t_scanner = 5,/obj/item/weapon/tool/screwdriver = 5,
/obj/item/device/flashlight/glowstick = 3, /obj/item/device/flashlight/glowstick/red = 3, /obj/item/device/flashlight/glowstick/blue = 3,
/obj/item/device/flashlight/glowstick/orange =3, /obj/item/device/flashlight/glowstick/yellow = 3)
contraband = list(/obj/item/weapon/weldingtool/hugetank = 2,/obj/item/clothing/gloves/fyellow = 2,)
@@ -1064,8 +1065,8 @@
icon_deny = "engi-deny"
req_access = list(access_engine_equip)
products = list(/obj/item/clothing/under/rank/chief_engineer = 4,/obj/item/clothing/under/rank/engineer = 4,/obj/item/clothing/shoes/orange = 4,/obj/item/clothing/head/hardhat = 4,
- /obj/item/weapon/storage/belt/utility = 4,/obj/item/clothing/glasses/meson = 4,/obj/item/clothing/gloves/yellow = 4, /obj/item/weapon/screwdriver = 12,
- /obj/item/weapon/crowbar = 12,/obj/item/weapon/wirecutters = 12,/obj/item/device/multitool = 12,/obj/item/weapon/wrench = 12,/obj/item/device/t_scanner = 12,
+ /obj/item/weapon/storage/belt/utility = 4,/obj/item/clothing/glasses/meson = 4,/obj/item/clothing/gloves/yellow = 4, /obj/item/weapon/tool/screwdriver = 12,
+ /obj/item/weapon/tool/crowbar = 12,/obj/item/weapon/tool/wirecutters = 12,/obj/item/device/multitool = 12,/obj/item/weapon/tool/wrench = 12,/obj/item/device/t_scanner = 12,
/obj/item/stack/cable_coil/heavyduty = 8, /obj/item/weapon/cell = 8, /obj/item/weapon/weldingtool = 8,/obj/item/clothing/head/welding = 8,
/obj/item/weapon/light/tube = 10,/obj/item/clothing/suit/fire = 4, /obj/item/weapon/stock_parts/scanning_module = 5,/obj/item/weapon/stock_parts/micro_laser = 5,
/obj/item/weapon/stock_parts/matter_bin = 5,/obj/item/weapon/stock_parts/manipulator = 5,/obj/item/weapon/stock_parts/console_screen = 5)
@@ -1084,7 +1085,7 @@
products = list(/obj/item/clothing/suit/storage/toggle/labcoat = 4,/obj/item/clothing/under/rank/roboticist = 4,/obj/item/stack/cable_coil = 4,/obj/item/device/flash = 4,
/obj/item/weapon/cell/high = 12, /obj/item/device/assembly/prox_sensor = 3,/obj/item/device/assembly/signaler = 3,/obj/item/device/healthanalyzer = 3,
/obj/item/weapon/surgical/scalpel = 2,/obj/item/weapon/surgical/circular_saw = 2,/obj/item/weapon/tank/anesthetic = 2,/obj/item/clothing/mask/breath/medical = 5,
- /obj/item/weapon/screwdriver = 5,/obj/item/weapon/crowbar = 5)
+ /obj/item/weapon/tool/screwdriver = 5,/obj/item/weapon/tool/crowbar = 5)
//everything after the power cell had no amounts, I improvised. -Sayu
req_log_access = access_rd
has_logs = 1
diff --git a/code/game/machinery/wall_frames.dm b/code/game/machinery/wall_frames.dm
index 0d3c3bcd2c..dd75e2d8e9 100644
--- a/code/game/machinery/wall_frames.dm
+++ b/code/game/machinery/wall_frames.dm
@@ -18,7 +18,7 @@
frame_types_wall = construction_frame_wall
/obj/item/frame/attackby(obj/item/weapon/W as obj, mob/user as mob)
- if(istype(W, /obj/item/weapon/wrench))
+ if(W.is_wrench())
new refund_type(get_turf(src.loc), refund_amt)
qdel(src)
return
diff --git a/code/game/machinery/washing_machine.dm b/code/game/machinery/washing_machine.dm
index 309c9cf2a4..672b0a2c4e 100644
--- a/code/game/machinery/washing_machine.dm
+++ b/code/game/machinery/washing_machine.dm
@@ -90,7 +90,7 @@
return
if(default_unfasten_wrench(user, W, 40))
return
- /*if(istype(W,/obj/item/weapon/screwdriver))
+ /*if(W.is_screwdriver())
panel = !panel
user << "You [panel ? "open" : "close"] the [src]'s maintenance panel"*/
if(istype(W,/obj/item/weapon/pen/crayon) || istype(W,/obj/item/weapon/stamp))
diff --git a/code/game/mecha/combat/combat.dm b/code/game/mecha/combat/combat.dm
index 5d692b39b9..54e2b9c87b 100644
--- a/code/game/mecha/combat/combat.dm
+++ b/code/game/mecha/combat/combat.dm
@@ -10,6 +10,13 @@
damage_absorption = list("brute"=0.7,"fire"=1,"bullet"=0.7,"laser"=0.85,"energy"=1,"bomb"=0.8)
var/am = "d3c2fbcadca903a41161ccc9df9cf948"
+ max_hull_equip = 2
+ max_weapon_equip = 2
+ max_utility_equip = 1
+ max_universal_equip = 1
+ max_special_equip = 1
+ cargo_capacity = 1
+
/*
/obj/mecha/combat/range_action(target as obj|mob|turf)
if(internal_damage&MECHA_INT_CONTROL_LOST)
diff --git a/code/game/mecha/combat/durand.dm b/code/game/mecha/combat/durand.dm
index 2d3034573a..7b9eb67691 100644
--- a/code/game/mecha/combat/durand.dm
+++ b/code/game/mecha/combat/durand.dm
@@ -6,6 +6,7 @@
step_in = 4
dir_in = 1 //Facing North.
health = 400
+ maxhealth = 400
deflect_chance = 20
damage_absorption = list("brute"=0.5,"fire"=1.1,"bullet"=0.65,"laser"=0.85,"energy"=0.9,"bomb"=0.8)
max_temperature = 30000
@@ -15,6 +16,12 @@
var/defence_deflect = 35
wreckage = /obj/effect/decal/mecha_wreckage/durand
+ max_hull_equip = 2
+ max_weapon_equip = 1
+ max_utility_equip = 2
+ max_universal_equip = 1
+ max_special_equip = 1
+
/*
/obj/mecha/combat/durand/New()
..()
diff --git a/code/game/mecha/combat/gorilla.dm b/code/game/mecha/combat/gorilla.dm
index cc5dacebc3..100bae9f19 100644
--- a/code/game/mecha/combat/gorilla.dm
+++ b/code/game/mecha/combat/gorilla.dm
@@ -64,6 +64,7 @@
pixel_x = -16
step_in = 10
health = 5000
+ maxhealth = 5000
opacity = 0 // Because there's big tall legs to look through. Also it looks fucky if this is set to 1.
deflect_chance = 50
damage_absorption = list("brute"=0.1,"fire"=0.8,"bullet"=0.1,"laser"=0.6,"energy"=0.7,"bomb"=0.7) //values show how much damage will pass through, not how much will be absorbed.
@@ -79,6 +80,12 @@
internal_damage_threshold = 25
force = 60
max_equip = 5
+//This will (Should) never be in the hands of players. If it is, the one who inflicted this monster upon the server can edit these vars to not be insane.
+ max_hull_equip = 5
+ max_weapon_equip = 5
+ max_utility_equip = 5
+ max_universal_equip = 5
+ max_special_equip = 2
/obj/mecha/combat/gorilla/New()
..()
diff --git a/code/game/mecha/combat/gygax.dm b/code/game/mecha/combat/gygax.dm
index eadc96aadd..591351032b 100644
--- a/code/game/mecha/combat/gygax.dm
+++ b/code/game/mecha/combat/gygax.dm
@@ -6,6 +6,7 @@
step_in = 3
dir_in = 1 //Facing North.
health = 300
+ maxhealth = 300
deflect_chance = 15
damage_absorption = list("brute"=0.75,"fire"=1,"bullet"=0.8,"laser"=0.7,"energy"=0.85,"bomb"=1)
max_temperature = 25000
@@ -16,12 +17,19 @@
internal_damage_threshold = 35
max_equip = 3
+ max_hull_equip = 1
+ max_weapon_equip = 2
+ max_utility_equip = 2
+ max_universal_equip = 1
+ max_special_equip = 1
+
/obj/mecha/combat/gygax/dark
desc = "A lightweight exosuit used by Heavy Asset Protection. A significantly upgraded Gygax security mech."
name = "Dark Gygax"
icon_state = "darkgygax"
initial_icon = "darkgygax"
health = 400
+ maxhealth = 400
deflect_chance = 25
damage_absorption = list("brute"=0.6,"fire"=0.8,"bullet"=0.6,"laser"=0.5,"energy"=0.65,"bomb"=0.8)
max_temperature = 45000
@@ -30,11 +38,17 @@
max_equip = 4
step_energy_drain = 5
+ max_hull_equip = 1
+ max_weapon_equip = 2
+ max_utility_equip = 2
+ max_universal_equip = 1
+ max_special_equip = 2
+
/obj/mecha/combat/gygax/dark/New()
..()
var/obj/item/mecha_parts/mecha_equipment/ME = new /obj/item/mecha_parts/mecha_equipment/weapon/ballistic/scattershot
ME.attach(src)
- ME = new /obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/flashbang/clusterbang
+ ME = new /obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/grenade/clusterbang
ME.attach(src)
ME = new /obj/item/mecha_parts/mecha_equipment/teleporter
ME.attach(src)
diff --git a/code/game/mecha/combat/marauder.dm b/code/game/mecha/combat/marauder.dm
index 5b456e0900..3236600309 100644
--- a/code/game/mecha/combat/marauder.dm
+++ b/code/game/mecha/combat/marauder.dm
@@ -5,6 +5,7 @@
initial_icon = "marauder"
step_in = 5
health = 500
+ maxhealth = 500
deflect_chance = 25
damage_absorption = list("brute"=0.5,"fire"=0.7,"bullet"=0.45,"laser"=0.6,"energy"=0.7,"bomb"=0.7)
max_temperature = 60000
@@ -22,6 +23,12 @@
force = 45
max_equip = 4
+ max_hull_equip = 3
+ max_weapon_equip = 3
+ max_utility_equip = 3
+ max_universal_equip = 1
+ max_special_equip = 1
+
/obj/mecha/combat/marauder/seraph
desc = "Heavy-duty, command-type exosuit. This is a custom model, utilized only by high-ranking military personnel."
name = "Seraph"
@@ -62,7 +69,7 @@
var/obj/item/mecha_parts/mecha_equipment/ME
if(equipment.len)//Now to remove it and equip anew.
for(ME in equipment)
- equipment -= ME
+ ME.detach()
qdel(ME)
ME = new /obj/item/mecha_parts/mecha_equipment/weapon/ballistic/scattershot(src)
ME.attach(src)
diff --git a/code/game/mecha/combat/phazon.dm b/code/game/mecha/combat/phazon.dm
index b98f4697e5..77ce768fc8 100644
--- a/code/game/mecha/combat/phazon.dm
+++ b/code/game/mecha/combat/phazon.dm
@@ -7,6 +7,7 @@
dir_in = 1 //Facing North.
step_energy_drain = 3
health = 200
+ maxhealth = 200
deflect_chance = 30
damage_absorption = list("brute"=0.7,"fire"=0.7,"bullet"=0.7,"laser"=0.7,"energy"=0.7,"bomb"=0.7)
max_temperature = 25000
@@ -20,6 +21,11 @@
var/phasing_energy_drain = 200
max_equip = 4
+ max_hull_equip = 3
+ max_weapon_equip = 3
+ max_utility_equip = 3
+ max_universal_equip = 3
+ max_special_equip = 4
/obj/mecha/combat/phazon/New()
..()
diff --git a/code/game/mecha/equipment/mecha_equipment.dm b/code/game/mecha/equipment/mecha_equipment.dm
index db1cb3d004..fec8c18e1d 100644
--- a/code/game/mecha/equipment/mecha_equipment.dm
+++ b/code/game/mecha/equipment/mecha_equipment.dm
@@ -1,5 +1,9 @@
//DO NOT ADD MECHA PARTS TO THE GAME WITH THE DEFAULT "SPRITE ME" SPRITE!
//I'm annoyed I even have to tell you this! SPRITE FIRST, then commit.
+#define EQUIP_HULL 1
+#define EQUIP_WEAPON 2
+#define EQUIP_UTILITY 3
+#define EQUIP_SPECIAL 4
/obj/item/mecha_parts/mecha_equipment
name = "mecha equipment"
@@ -14,7 +18,8 @@
var/range = MELEE //bitflags
var/salvageable = 1
var/required_type = /obj/mecha //may be either a type or a list of allowed types
-
+ var/equip_type = null //mechaequip2
+ var/allow_duplicate = FALSE
/obj/item/mecha_parts/mecha_equipment/proc/do_after_cooldown(target=1)
sleep(equip_cooldown)
@@ -43,6 +48,20 @@
/obj/item/mecha_parts/mecha_equipment/proc/destroy()//missiles detonating, teleporter creating singularity?
if(chassis)
+ if(equip_type)
+ if(equip_type == EQUIP_HULL)
+ chassis.hull_equipment -= src
+ listclearnulls(chassis.hull_equipment)
+ if(equip_type == EQUIP_WEAPON)
+ chassis.weapon_equipment -= src
+ listclearnulls(chassis.weapon_equipment)
+ if(equip_type == EQUIP_UTILITY)
+ chassis.utility_equipment -= src
+ listclearnulls(chassis.utility_equipment)
+ if(equip_type == EQUIP_SPECIAL)
+ chassis.special_equipment -= src
+ listclearnulls(chassis.special_equipment)
+ chassis.universal_equipment -= src
chassis.equipment -= src
listclearnulls(chassis.equipment)
if(chassis.selected == src)
@@ -85,23 +104,57 @@
return 0
return 1
+/obj/item/mecha_parts/mecha_equipment/proc/handle_movement_action() //Any modules that have special effects or needs when taking a step or floating through space.
+ return
+
/obj/item/mecha_parts/mecha_equipment/proc/action(atom/target)
return
/obj/item/mecha_parts/mecha_equipment/proc/can_attach(obj/mecha/M as obj)
- if(M.equipment.len >= M.max_equip)
- return 0
-
- if (ispath(required_type))
+ //if(M.equipment.len >= M.max_equip)
+ // return 0
+ if(!allow_duplicate)
+ for(var/obj/item/mecha_parts/mecha_equipment/ME in M.equipment) //Exact duplicate components aren't allowed.
+ if(ME.type == src.type)
+ return 0
+ if(equip_type == EQUIP_HULL && M.hull_equipment.len < M.max_hull_equip)
+ return 1
+ if(equip_type == EQUIP_WEAPON && M.weapon_equipment.len < M.max_weapon_equip)
+ return 1
+ if(equip_type == EQUIP_UTILITY && M.utility_equipment.len < M.max_utility_equip)
+ return 1
+ if(equip_type == EQUIP_SPECIAL && M.special_equipment.len < M.max_special_equip)
+ return 1
+ if(equip_type != EQUIP_SPECIAL && M.universal_equipment.len < M.max_universal_equip) //The exosuit needs to be military grade to actually have a universal slot capable of accepting a true weapon.
+ if(equip_type == EQUIP_WEAPON && !istype(M, /obj/mecha/combat))
+ return 0
+ return 1
+ /*if (ispath(required_type))
return istype(M, required_type)
for (var/path in required_type)
if (istype(M, path))
return 1
-
+ */
return 0
/obj/item/mecha_parts/mecha_equipment/proc/attach(obj/mecha/M as obj)
+ //M.equipment += src
+ var/has_equipped = 0
+ if(equip_type == EQUIP_HULL && M.hull_equipment.len < M.max_hull_equip && !has_equipped)
+ M.hull_equipment += src
+ has_equipped = 1
+ if(equip_type == EQUIP_WEAPON && M.weapon_equipment.len < M.max_weapon_equip && !has_equipped)
+ M.weapon_equipment += src
+ has_equipped = 1
+ if(equip_type == EQUIP_UTILITY && M.utility_equipment.len < M.max_utility_equip && !has_equipped)
+ M.utility_equipment += src
+ has_equipped = 1
+ if(equip_type == EQUIP_SPECIAL && M.special_equipment.len < M.max_special_equip && !has_equipped)
+ M.special_equipment += src
+ has_equipped = 1
+ if(equip_type != EQUIP_SPECIAL && M.universal_equipment.len < M.max_universal_equip && !has_equipped)
+ M.universal_equipment += src
M.equipment += src
chassis = M
src.loc = M
@@ -115,6 +168,17 @@
moveto = moveto || get_turf(chassis)
if(src.Move(moveto))
chassis.equipment -= src
+ chassis.universal_equipment -= src
+ if(equip_type)
+ switch(equip_type)
+ if(EQUIP_HULL)
+ chassis.hull_equipment -= src
+ if(EQUIP_WEAPON)
+ chassis.weapon_equipment -= src
+ if(EQUIP_UTILITY)
+ chassis.utility_equipment -= src
+ if(EQUIP_SPECIAL)
+ chassis.special_equipment -= src
if(chassis.selected == src)
chassis.selected = null
update_chassis_page()
diff --git a/code/game/mecha/equipment/tools/medical_tools.dm b/code/game/mecha/equipment/tools/medical_tools.dm
index d33570cd9c..2fb2538cfb 100644
--- a/code/game/mecha/equipment/tools/medical_tools.dm
+++ b/code/game/mecha/equipment/tools/medical_tools.dm
@@ -12,197 +12,198 @@
var/inject_amount = 5
required_type = /obj/mecha/medical
salvageable = 0
+ allow_duplicate = TRUE
- New()
- ..()
- pr_mech_sleeper = new /datum/global_iterator/mech_sleeper(list(src),0)
- pr_mech_sleeper.set_delay(equip_cooldown)
+/obj/item/mecha_parts/mecha_equipment/tool/sleeper/New()
+ ..()
+ pr_mech_sleeper = new /datum/global_iterator/mech_sleeper(list(src),0)
+ pr_mech_sleeper.set_delay(equip_cooldown)
+ return
+
+/obj/item/mecha_parts/mecha_equipment/tool/sleeper/Destroy()
+ qdel(pr_mech_sleeper)
+ for(var/atom/movable/AM in src)
+ AM.forceMove(get_turf(src))
+ return ..()
+
+/obj/item/mecha_parts/mecha_equipment/tool/sleeper/Exit(atom/movable/O)
+ return 0
+
+/obj/item/mecha_parts/mecha_equipment/tool/sleeper/action(var/mob/living/carbon/human/target)
+ if(!action_checks(target))
return
-
- Destroy()
- qdel(pr_mech_sleeper)
- for(var/atom/movable/AM in src)
- AM.forceMove(get_turf(src))
- return ..()
-
- Exit(atom/movable/O)
- return 0
-
- action(var/mob/living/carbon/human/target)
- if(!action_checks(target))
+ if(!istype(target))
+ return
+ if(target.buckled)
+ occupant_message("[target] will not fit into the sleeper because they are buckled to [target.buckled].")
+ return
+ if(occupant)
+ occupant_message("The sleeper is already occupied")
+ return
+ for(var/mob/living/simple_animal/slime/M in range(1,target))
+ if(M.victim == target)
+ occupant_message("[target] will not fit into the sleeper because they have a slime latched onto their head.")
return
- if(!istype(target))
- return
- if(target.buckled)
- occupant_message("[target] will not fit into the sleeper because they are buckled to [target.buckled].")
+ occupant_message("You start putting [target] into [src].")
+ chassis.visible_message("[chassis] starts putting [target] into the [src].")
+ var/C = chassis.loc
+ var/T = target.loc
+ if(do_after_cooldown(target))
+ if(chassis.loc!=C || target.loc!=T)
return
if(occupant)
- occupant_message("The sleeper is already occupied")
+ occupant_message("The sleeper is already occupied!")
return
- for(var/mob/living/simple_animal/slime/M in range(1,target))
- if(M.victim == target)
- occupant_message("[target] will not fit into the sleeper because they have a slime latched onto their head.")
- return
- occupant_message("You start putting [target] into [src].")
- chassis.visible_message("[chassis] starts putting [target] into the [src].")
- var/C = chassis.loc
- var/T = target.loc
- if(do_after_cooldown(target))
- if(chassis.loc!=C || target.loc!=T)
- return
- if(occupant)
- occupant_message("The sleeper is already occupied!")
- return
- target.forceMove(src)
- occupant = target
- target.reset_view(src)
- occupant.Stasis(3)
- /*
- if(target.client)
- target.client.perspective = EYE_PERSPECTIVE
- target.client.eye = chassis
- */
- set_ready_state(0)
- pr_mech_sleeper.start()
- occupant_message("[target] successfully loaded into [src]. Life support functions engaged.")
- chassis.visible_message("[chassis] loads [target] into [src].")
- log_message("[target] loaded. Life support functions engaged.")
- return
-
- proc/go_out()
- if(!occupant)
- return
- occupant.forceMove(get_turf(src))
- occupant_message("[occupant] ejected. Life support functions disabled.")
- log_message("[occupant] ejected. Life support functions disabled.")
- occupant.reset_view()
+ target.forceMove(src)
+ occupant = target
+ target.reset_view(src)
+ occupant.Stasis(3)
/*
- if(occupant.client)
- occupant.client.eye = occupant.client.mob
- occupant.client.perspective = MOB_PERSPECTIVE
+ if(target.client)
+ target.client.perspective = EYE_PERSPECTIVE
+ target.client.eye = chassis
*/
- occupant.Stasis(0)
- occupant = null
- pr_mech_sleeper.stop()
- set_ready_state(1)
- return
+ set_ready_state(0)
+ pr_mech_sleeper.start()
+ occupant_message("[target] successfully loaded into [src]. Life support functions engaged.")
+ chassis.visible_message("[chassis] loads [target] into [src].")
+ log_message("[target] loaded. Life support functions engaged.")
+ return
- detach()
+/obj/item/mecha_parts/mecha_equipment/tool/sleeper/proc/go_out()
+ if(!occupant)
+ return
+ occupant.forceMove(get_turf(src))
+ occupant_message("[occupant] ejected. Life support functions disabled.")
+ log_message("[occupant] ejected. Life support functions disabled.")
+ occupant.reset_view()
+ /*
+ if(occupant.client)
+ occupant.client.eye = occupant.client.mob
+ occupant.client.perspective = MOB_PERSPECTIVE
+ */
+ occupant.Stasis(0)
+ occupant = null
+ pr_mech_sleeper.stop()
+ set_ready_state(1)
+ return
+
+/obj/item/mecha_parts/mecha_equipment/tool/sleeper/detach()
+ if(occupant)
+ occupant_message("Unable to detach [src] - equipment occupied.")
+ return
+ pr_mech_sleeper.stop()
+ return ..()
+
+/obj/item/mecha_parts/mecha_equipment/tool/sleeper/get_equip_info()
+ var/output = ..()
+ if(output)
+ var/temp = ""
if(occupant)
- occupant_message("Unable to detach [src] - equipment occupied.")
- return
- pr_mech_sleeper.stop()
- return ..()
+ temp = "
\[Occupant: [occupant] (Health: [occupant.health]%)\]
View stats|Eject"
+ return "[output] [temp]"
+ return
- get_equip_info()
- var/output = ..()
- if(output)
- var/temp = ""
- if(occupant)
- temp = "
\[Occupant: [occupant] (Health: [occupant.health]%)\]
View stats|Eject"
- return "[output] [temp]"
+/obj/item/mecha_parts/mecha_equipment/tool/sleeper/Topic(href,href_list)
+ ..()
+ var/datum/topic_input/top_filter = new /datum/topic_input(href,href_list)
+ if(top_filter.get("eject"))
+ go_out()
+ if(top_filter.get("view_stats"))
+ chassis.occupant << browse(get_occupant_stats(),"window=msleeper")
+ onclose(chassis.occupant, "msleeper")
return
+ if(top_filter.get("inject"))
+ inject_reagent(top_filter.getType("inject",/datum/reagent),top_filter.getObj("source"))
+ return
- Topic(href,href_list)
- ..()
- var/datum/topic_input/top_filter = new /datum/topic_input(href,href_list)
- if(top_filter.get("eject"))
- go_out()
- if(top_filter.get("view_stats"))
- chassis.occupant << browse(get_occupant_stats(),"window=msleeper")
- onclose(chassis.occupant, "msleeper")
- return
- if(top_filter.get("inject"))
- inject_reagent(top_filter.getType("inject",/datum/reagent),top_filter.getObj("source"))
+/obj/item/mecha_parts/mecha_equipment/tool/sleeper/proc/get_occupant_stats()
+ if(!occupant)
return
+ return {"
+
+ [occupant] statistics
+
+
+
+
+ Health statistics
+
+ [get_occupant_dam()]
+
+ Reagents in bloodstream
+
+ [get_occupant_reagents()]
+
+
+ [get_available_reagents()]
+
+
+ "}
- proc/get_occupant_stats()
- if(!occupant)
- return
- return {"
-
- [occupant] statistics
-
-
-
-
- Health statistics
-
- [get_occupant_dam()]
-
- Reagents in bloodstream
-
- [get_occupant_reagents()]
-
-
- [get_available_reagents()]
-
-
- "}
-
- proc/get_occupant_dam()
- var/t1
- switch(occupant.stat)
- if(0)
- t1 = "Conscious"
- if(1)
- t1 = "Unconscious"
- if(2)
- t1 = "*dead*"
- else
- t1 = "Unknown"
- return {"Health: [occupant.health]% ([t1])
- Core Temperature: [src.occupant.bodytemperature-T0C]°C ([src.occupant.bodytemperature*1.8-459.67]°F)
- Brute Damage: [occupant.getBruteLoss()]%
- Respiratory Damage: [occupant.getOxyLoss()]%
- Toxin Content: [occupant.getToxLoss()]%
- Burn Severity: [occupant.getFireLoss()]%
- "}
-
- proc/get_occupant_reagents()
- if(occupant.reagents)
- for(var/datum/reagent/R in occupant.reagents.reagent_list)
- if(R.volume > 0)
- . += "[R]: [round(R.volume,0.01)]
"
- return . || "None"
-
- proc/get_available_reagents()
- var/output
- var/obj/item/mecha_parts/mecha_equipment/tool/syringe_gun/SG = locate(/obj/item/mecha_parts/mecha_equipment/tool/syringe_gun) in chassis
- if(SG && SG.reagents && islist(SG.reagents.reagent_list))
- for(var/datum/reagent/R in SG.reagents.reagent_list)
- if(R.volume > 0)
- output += "Inject [R.name]
"
- return output
-
-
- proc/inject_reagent(var/datum/reagent/R,var/obj/item/mecha_parts/mecha_equipment/tool/syringe_gun/SG)
- if(!R || !occupant || !SG || !(SG in chassis.equipment))
- return 0
- var/to_inject = min(R.volume, inject_amount)
- if(to_inject && occupant.reagents.get_reagent_amount(R.id) + to_inject > inject_amount*4)
- occupant_message("Sleeper safeties prohibit you from injecting more than [inject_amount*4] units of [R.name].")
+/obj/item/mecha_parts/mecha_equipment/tool/sleeper/proc/get_occupant_dam()
+ var/t1
+ switch(occupant.stat)
+ if(0)
+ t1 = "Conscious"
+ if(1)
+ t1 = "Unconscious"
+ if(2)
+ t1 = "*dead*"
else
- occupant_message("Injecting [occupant] with [to_inject] units of [R.name].")
- log_message("Injecting [occupant] with [to_inject] units of [R.name].")
- //SG.reagents.trans_id_to(occupant,R.id,to_inject)
- SG.reagents.remove_reagent(R.id,to_inject)
- occupant.reagents.add_reagent(R.id,to_inject)
- update_equip_info()
- return
+ t1 = "Unknown"
+ return {"Health: [occupant.health]% ([t1])
+ Core Temperature: [src.occupant.bodytemperature-T0C]°C ([src.occupant.bodytemperature*1.8-459.67]°F)
+ Brute Damage: [occupant.getBruteLoss()]%
+ Respiratory Damage: [occupant.getOxyLoss()]%
+ Toxin Content: [occupant.getToxLoss()]%
+ Burn Severity: [occupant.getFireLoss()]%
+ "}
- update_equip_info()
- if(..())
- send_byjax(chassis.occupant,"msleeper.browser","lossinfo",get_occupant_dam())
- send_byjax(chassis.occupant,"msleeper.browser","reagents",get_occupant_reagents())
- send_byjax(chassis.occupant,"msleeper.browser","injectwith",get_available_reagents())
- return 1
- return
+/obj/item/mecha_parts/mecha_equipment/tool/sleeper/proc/get_occupant_reagents()
+ if(occupant.reagents)
+ for(var/datum/reagent/R in occupant.reagents.reagent_list)
+ if(R.volume > 0)
+ . += "[R]: [round(R.volume,0.01)]
"
+ return . || "None"
+
+/obj/item/mecha_parts/mecha_equipment/tool/sleeper/proc/get_available_reagents()
+ var/output
+ var/obj/item/mecha_parts/mecha_equipment/tool/syringe_gun/SG = locate(/obj/item/mecha_parts/mecha_equipment/tool/syringe_gun) in chassis
+ if(SG && SG.reagents && islist(SG.reagents.reagent_list))
+ for(var/datum/reagent/R in SG.reagents.reagent_list)
+ if(R.volume > 0)
+ output += "Inject [R.name]
"
+ return output
+
+
+/obj/item/mecha_parts/mecha_equipment/tool/sleeper/proc/inject_reagent(var/datum/reagent/R,var/obj/item/mecha_parts/mecha_equipment/tool/syringe_gun/SG)
+ if(!R || !occupant || !SG || !(SG in chassis.equipment))
+ return 0
+ var/to_inject = min(R.volume, inject_amount)
+ if(to_inject && occupant.reagents.get_reagent_amount(R.id) + to_inject > inject_amount*4)
+ occupant_message("Sleeper safeties prohibit you from injecting more than [inject_amount*4] units of [R.name].")
+ else
+ occupant_message("Injecting [occupant] with [to_inject] units of [R.name].")
+ log_message("Injecting [occupant] with [to_inject] units of [R.name].")
+ //SG.reagents.trans_id_to(occupant,R.id,to_inject)
+ SG.reagents.remove_reagent(R.id,to_inject)
+ occupant.reagents.add_reagent(R.id,to_inject)
+ update_equip_info()
+ return
+
+/obj/item/mecha_parts/mecha_equipment/tool/sleeper/update_equip_info()
+ if(..())
+ send_byjax(chassis.occupant,"msleeper.browser","lossinfo",get_occupant_dam())
+ send_byjax(chassis.occupant,"msleeper.browser","reagents",get_occupant_reagents())
+ send_byjax(chassis.occupant,"msleeper.browser","injectwith",get_available_reagents())
+ return 1
+ return
/obj/item/mecha_parts/mecha_equipment/tool/sleeper/verb/eject()
set name = "Sleeper Eject"
@@ -219,32 +220,32 @@
/datum/global_iterator/mech_sleeper
- process(var/obj/item/mecha_parts/mecha_equipment/tool/sleeper/S)
- if(!S.chassis)
- S.set_ready_state(1)
- return stop()
- if(!S.chassis.has_charge(S.energy_drain))
- S.set_ready_state(1)
- S.log_message("Deactivated.")
- S.occupant_message("[src] deactivated - no power.")
- return stop()
- var/mob/living/carbon/M = S.occupant
- if(!M)
- return
- if(M.health > 0)
- M.adjustOxyLoss(-1)
- M.updatehealth()
- M.AdjustStunned(-4)
- M.AdjustWeakened(-4)
- M.AdjustStunned(-4)
- M.Paralyse(2)
- M.Weaken(2)
- M.Stun(2)
- if(M.reagents.get_reagent_amount("inaprovaline") < 5)
- M.reagents.add_reagent("inaprovaline", 5)
- S.chassis.use_power(S.energy_drain)
- S.update_equip_info()
+/datum/global_iterator/mech_sleeper/process(var/obj/item/mecha_parts/mecha_equipment/tool/sleeper/S)
+ if(!S.chassis)
+ S.set_ready_state(1)
+ return stop()
+ if(!S.chassis.has_charge(S.energy_drain))
+ S.set_ready_state(1)
+ S.log_message("Deactivated.")
+ S.occupant_message("[src] deactivated - no power.")
+ return stop()
+ var/mob/living/carbon/M = S.occupant
+ if(!M)
return
+ if(M.health > 0)
+ M.adjustOxyLoss(-1)
+ M.updatehealth()
+ M.AdjustStunned(-4)
+ M.AdjustWeakened(-4)
+ M.AdjustStunned(-4)
+ M.Paralyse(2)
+ M.Weaken(2)
+ M.Stun(2)
+ if(M.reagents.get_reagent_amount("inaprovaline") < 5)
+ M.reagents.add_reagent("inaprovaline", 5)
+ S.chassis.use_power(S.energy_drain)
+ S.update_equip_info()
+ return
/obj/item/mecha_parts/mecha_equipment/tool/cable_layer
@@ -257,133 +258,133 @@
var/max_cable = 1000
required_type = /obj/mecha/working
- New()
- cable = new(src)
- cable.amount = 0
- ..()
+/obj/item/mecha_parts/mecha_equipment/tool/cable_layer/New()
+ cable = new(src)
+ cable.amount = 0
+ ..()
- attach()
- ..()
- event = chassis.events.addEvent("onMove",src,"layCable")
+/obj/item/mecha_parts/mecha_equipment/tool/cable_layer/attach()
+ ..()
+ event = chassis.events.addEvent("onMove",src,"layCable")
+ return
+
+/obj/item/mecha_parts/mecha_equipment/tool/cable_layer/detach()
+ chassis.events.clearEvent("onMove",event)
+ return ..()
+
+/obj/item/mecha_parts/mecha_equipment/tool/cable_layer/destroy()
+ chassis.events.clearEvent("onMove",event)
+ return ..()
+
+/obj/item/mecha_parts/mecha_equipment/tool/cable_layer/action(var/obj/item/stack/cable_coil/target)
+ if(!action_checks(target))
return
+ var/result = load_cable(target)
+ var/message
+ if(isnull(result))
+ message = "Unable to load [target] - no cable found."
+ else if(!result)
+ message = "Reel is full."
+ else
+ message = "[result] meters of cable successfully loaded."
+ send_byjax(chassis.occupant,"exosuit.browser","\ref[src]",src.get_equip_info())
+ occupant_message(message)
+ return
- detach()
- chassis.events.clearEvent("onMove",event)
- return ..()
-
- destroy()
- chassis.events.clearEvent("onMove",event)
- return ..()
-
- action(var/obj/item/stack/cable_coil/target)
- if(!action_checks(target))
- return
- var/result = load_cable(target)
- var/message
- if(isnull(result))
- message = "Unable to load [target] - no cable found."
- else if(!result)
- message = "Reel is full."
+/obj/item/mecha_parts/mecha_equipment/tool/cable_layer/Topic(href,href_list)
+ ..()
+ if(href_list["toggle"])
+ set_ready_state(!equip_ready)
+ occupant_message("[src] [equip_ready?"dea":"a"]ctivated.")
+ log_message("[equip_ready?"Dea":"A"]ctivated.")
+ return
+ if(href_list["cut"])
+ if(cable && cable.amount)
+ var/m = round(input(chassis.occupant,"Please specify the length of cable to cut","Cut cable",min(cable.amount,30)) as num, 1)
+ m = min(m, cable.amount)
+ if(m)
+ use_cable(m)
+ var/obj/item/stack/cable_coil/CC = new (get_turf(chassis))
+ CC.amount = m
else
- message = "[result] meters of cable successfully loaded."
- send_byjax(chassis.occupant,"exosuit.browser","\ref[src]",src.get_equip_info())
- occupant_message(message)
+ occupant_message("There's no more cable on the reel.")
+ return
+
+/obj/item/mecha_parts/mecha_equipment/tool/cable_layer/get_equip_info()
+ var/output = ..()
+ if(output)
+ return "[output] \[Cable: [cable ? cable.amount : 0] m\][(cable && cable.amount) ? "- [!equip_ready?"Dea":"A"]ctivate|Cut" : null]"
+ return
+
+/obj/item/mecha_parts/mecha_equipment/tool/cable_layer/proc/load_cable(var/obj/item/stack/cable_coil/CC)
+ if(istype(CC) && CC.amount)
+ var/cur_amount = cable? cable.amount : 0
+ var/to_load = max(max_cable - cur_amount,0)
+ if(to_load)
+ to_load = min(CC.amount, to_load)
+ if(!cable)
+ cable = new(src)
+ cable.amount = 0
+ cable.amount += to_load
+ CC.use(to_load)
+ return to_load
+ else
+ return 0
+ return
+
+/obj/item/mecha_parts/mecha_equipment/tool/cable_layer/proc/use_cable(amount)
+ if(!cable || cable.amount<1)
+ set_ready_state(1)
+ occupant_message("Cable depleted, [src] deactivated.")
+ log_message("Cable depleted, [src] deactivated.")
return
-
- Topic(href,href_list)
- ..()
- if(href_list["toggle"])
- set_ready_state(!equip_ready)
- occupant_message("[src] [equip_ready?"dea":"a"]ctivated.")
- log_message("[equip_ready?"Dea":"A"]ctivated.")
- return
- if(href_list["cut"])
- if(cable && cable.amount)
- var/m = round(input(chassis.occupant,"Please specify the length of cable to cut","Cut cable",min(cable.amount,30)) as num, 1)
- m = min(m, cable.amount)
- if(m)
- use_cable(m)
- var/obj/item/stack/cable_coil/CC = new (get_turf(chassis))
- CC.amount = m
- else
- occupant_message("There's no more cable on the reel.")
+ if(cable.amount < amount)
+ occupant_message("No enough cable to finish the task.")
return
+ cable.use(amount)
+ update_equip_info()
+ return 1
- get_equip_info()
- var/output = ..()
- if(output)
- return "[output] \[Cable: [cable ? cable.amount : 0] m\][(cable && cable.amount) ? "- [!equip_ready?"Dea":"A"]ctivate|Cut" : null]"
- return
+/obj/item/mecha_parts/mecha_equipment/tool/cable_layer/proc/reset()
+ last_piece = null
- proc/load_cable(var/obj/item/stack/cable_coil/CC)
- if(istype(CC) && CC.amount)
- var/cur_amount = cable? cable.amount : 0
- var/to_load = max(max_cable - cur_amount,0)
- if(to_load)
- to_load = min(CC.amount, to_load)
- if(!cable)
- cable = new(src)
- cable.amount = 0
- cable.amount += to_load
- CC.use(to_load)
- return to_load
- else
- return 0
- return
+/obj/item/mecha_parts/mecha_equipment/tool/cable_layer/proc/dismantleFloor(var/turf/new_turf)
+ if(istype(new_turf, /turf/simulated/floor))
+ var/turf/simulated/floor/T = new_turf
+ if(!T.is_plating())
+ T.make_plating(!(T.broken || T.burnt))
+ return new_turf.is_plating()
- proc/use_cable(amount)
- if(!cable || cable.amount<1)
- set_ready_state(1)
- occupant_message("Cable depleted, [src] deactivated.")
- log_message("Cable depleted, [src] deactivated.")
- return
- if(cable.amount < amount)
- occupant_message("No enough cable to finish the task.")
- return
- cable.use(amount)
- update_equip_info()
- return 1
-
- proc/reset()
- last_piece = null
-
- proc/dismantleFloor(var/turf/new_turf)
- if(istype(new_turf, /turf/simulated/floor))
- var/turf/simulated/floor/T = new_turf
- if(!T.is_plating())
- T.make_plating(!(T.broken || T.burnt))
- return new_turf.is_plating()
-
- proc/layCable(var/turf/new_turf)
- if(equip_ready || !istype(new_turf) || !dismantleFloor(new_turf))
+/obj/item/mecha_parts/mecha_equipment/tool/cable_layer/proc/layCable(var/turf/new_turf)
+ if(equip_ready || !istype(new_turf) || !dismantleFloor(new_turf))
+ return reset()
+ var/fdirn = turn(chassis.dir,180)
+ for(var/obj/structure/cable/LC in new_turf) // check to make sure there's not a cable there already
+ if(LC.d1 == fdirn || LC.d2 == fdirn)
return reset()
- var/fdirn = turn(chassis.dir,180)
- for(var/obj/structure/cable/LC in new_turf) // check to make sure there's not a cable there already
- if(LC.d1 == fdirn || LC.d2 == fdirn)
- return reset()
- if(!use_cable(1))
- return reset()
- var/obj/structure/cable/NC = new(new_turf)
- NC.cableColor("red")
- NC.d1 = 0
- NC.d2 = fdirn
- NC.update_icon()
+ if(!use_cable(1))
+ return reset()
+ var/obj/structure/cable/NC = new(new_turf)
+ NC.cableColor("red")
+ NC.d1 = 0
+ NC.d2 = fdirn
+ NC.update_icon()
- var/datum/powernet/PN
- if(last_piece && last_piece.d2 != chassis.dir)
- last_piece.d1 = min(last_piece.d2, chassis.dir)
- last_piece.d2 = max(last_piece.d2, chassis.dir)
- last_piece.update_icon()
- PN = last_piece.powernet
+ var/datum/powernet/PN
+ if(last_piece && last_piece.d2 != chassis.dir)
+ last_piece.d1 = min(last_piece.d2, chassis.dir)
+ last_piece.d2 = max(last_piece.d2, chassis.dir)
+ last_piece.update_icon()
+ PN = last_piece.powernet
- if(!PN)
- PN = new()
- PN.add_cable(NC)
- NC.mergeConnectedNetworks(NC.d2)
+ if(!PN)
+ PN = new()
+ PN.add_cable(NC)
+ NC.mergeConnectedNetworks(NC.d2)
- //NC.mergeConnectedNetworksOnTurf()
- last_piece = NC
- return 1
+ //NC.mergeConnectedNetworksOnTurf()
+ last_piece = NC
+ return 1
/obj/item/mecha_parts/mecha_equipment/tool/syringe_gun
name = "syringe gun"
@@ -697,16 +698,16 @@
/datum/global_iterator/mech_synth
delay = 100
- process(var/obj/item/mecha_parts/mecha_equipment/tool/syringe_gun/S)
- if(!S.chassis)
- return stop()
- var/energy_drain = S.energy_drain*10
- if(!S.processed_reagents.len || S.reagents.total_volume >= S.reagents.maximum_volume || !S.chassis.has_charge(energy_drain))
- S.occupant_message("Reagent processing stopped.")
- S.log_message("Reagent processing stopped.")
- return stop()
- var/amount = S.synth_speed / S.processed_reagents.len
- for(var/reagent in S.processed_reagents)
- S.reagents.add_reagent(reagent,amount)
- S.chassis.use_power(energy_drain)
- return 1
+/datum/global_iterator/mech_synth/process(var/obj/item/mecha_parts/mecha_equipment/tool/syringe_gun/S)
+ if(!S.chassis)
+ return stop()
+ var/energy_drain = S.energy_drain*10
+ if(!S.processed_reagents.len || S.reagents.total_volume >= S.reagents.maximum_volume || !S.chassis.has_charge(energy_drain))
+ S.occupant_message("Reagent processing stopped.")
+ S.log_message("Reagent processing stopped.")
+ return stop()
+ var/amount = S.synth_speed / S.processed_reagents.len
+ for(var/reagent in S.processed_reagents)
+ S.reagents.add_reagent(reagent,amount)
+ S.chassis.use_power(energy_drain)
+ return 1
diff --git a/code/game/mecha/equipment/tools/tools.dm b/code/game/mecha/equipment/tools/tools.dm
index 164140583f..dd4472282c 100644
--- a/code/game/mecha/equipment/tools/tools.dm
+++ b/code/game/mecha/equipment/tools/tools.dm
@@ -1,3 +1,6 @@
+/obj/item/mecha_parts/mecha_equipment/tool
+ equip_type = EQUIP_UTILITY
+
/obj/item/mecha_parts/mecha_equipment/tool/hydraulic_clamp
name = "hydraulic clamp"
icon_state = "mecha_clamp"
@@ -7,66 +10,66 @@
var/obj/mecha/working/ripley/cargo_holder
required_type = /obj/mecha/working
- attach(obj/mecha/M as obj)
- ..()
- cargo_holder = M
- return
+/obj/item/mecha_parts/mecha_equipment/tool/hydraulic_clamp/attach(obj/mecha/M as obj)
+ ..()
+ cargo_holder = M
+ return
- action(atom/target)
- if(!action_checks(target)) return
- if(!cargo_holder) return
+/obj/item/mecha_parts/mecha_equipment/tool/hydraulic_clamp/action(atom/target)
+ if(!action_checks(target)) return
+ if(!cargo_holder) return
- //loading
- if(istype(target,/obj))
- var/obj/O = target
- if(O.has_buckled_mobs())
- return
- if(locate(/mob/living) in O)
- occupant_message("You can't load living things into the cargo compartment.")
- return
- if(O.anchored)
- occupant_message("[target] is firmly secured.")
- return
- if(cargo_holder.cargo.len >= cargo_holder.cargo_capacity)
- occupant_message("Not enough room in cargo compartment.")
- return
+ //loading
+ if(istype(target,/obj))
+ var/obj/O = target
+ if(O.has_buckled_mobs())
+ return
+ if(locate(/mob/living) in O)
+ occupant_message("You can't load living things into the cargo compartment.")
+ return
+ if(O.anchored)
+ occupant_message("[target] is firmly secured.")
+ return
+ if(cargo_holder.cargo.len >= cargo_holder.cargo_capacity)
+ occupant_message("Not enough room in cargo compartment.")
+ return
- occupant_message("You lift [target] and start to load it into cargo compartment.")
- chassis.visible_message("[chassis] lifts [target] and starts to load it into cargo compartment.")
- set_ready_state(0)
- chassis.use_power(energy_drain)
- O.anchored = 1
- var/T = chassis.loc
- if(do_after_cooldown(target))
- if(T == chassis.loc && src == chassis.selected)
- cargo_holder.cargo += O
- O.loc = chassis
- O.anchored = 0
- occupant_message("[target] succesfully loaded.")
- log_message("Loaded [O]. Cargo compartment capacity: [cargo_holder.cargo_capacity - cargo_holder.cargo.len]")
- else
- occupant_message("You must hold still while handling objects.")
- O.anchored = initial(O.anchored)
-
- //attacking
- else if(istype(target,/mob/living))
- var/mob/living/M = target
- if(M.stat>1) return
- if(chassis.occupant.a_intent == I_HURT || istype(chassis.occupant,/mob/living/carbon/brain)) //No tactile feedback for brains
- M.take_overall_damage(dam_force)
- M.adjustOxyLoss(round(dam_force/2))
- M.updatehealth()
- occupant_message("You squeeze [target] with [src.name]. Something cracks.")
- playsound(src.loc, "fracture", 5, 1, -2) //CRACK
- chassis.visible_message("[chassis] squeezes [target].")
+ occupant_message("You lift [target] and start to load it into cargo compartment.")
+ chassis.visible_message("[chassis] lifts [target] and starts to load it into cargo compartment.")
+ set_ready_state(0)
+ chassis.use_power(energy_drain)
+ O.anchored = 1
+ var/T = chassis.loc
+ if(do_after_cooldown(target))
+ if(T == chassis.loc && src == chassis.selected)
+ cargo_holder.cargo += O
+ O.loc = chassis
+ O.anchored = 0
+ occupant_message("[target] succesfully loaded.")
+ log_message("Loaded [O]. Cargo compartment capacity: [cargo_holder.cargo_capacity - cargo_holder.cargo.len]")
else
- step_away(M,chassis)
- occupant_message("You push [target] out of the way.")
- chassis.visible_message("[chassis] pushes [target] out of the way.")
- set_ready_state(0)
- chassis.use_power(energy_drain)
- do_after_cooldown()
- return 1
+ occupant_message("You must hold still while handling objects.")
+ O.anchored = initial(O.anchored)
+
+ //attacking
+ else if(istype(target,/mob/living))
+ var/mob/living/M = target
+ if(M.stat>1) return
+ if(chassis.occupant.a_intent == I_HURT || istype(chassis.occupant,/mob/living/carbon/brain)) //No tactile feedback for brains
+ M.take_overall_damage(dam_force)
+ M.adjustOxyLoss(round(dam_force/2))
+ M.updatehealth()
+ occupant_message("You squeeze [target] with [src.name]. Something cracks.")
+ playsound(src.loc, "fracture", 5, 1, -2) //CRACK
+ chassis.visible_message("[chassis] squeezes [target].")
+ else
+ step_away(M,chassis)
+ occupant_message("You push [target] out of the way.")
+ chassis.visible_message("[chassis] pushes [target] out of the way.")
+ set_ready_state(0)
+ chassis.use_power(energy_drain)
+ do_after_cooldown()
+ return 1
/obj/item/mecha_parts/mecha_equipment/tool/drill
name = "drill"
@@ -77,48 +80,48 @@
force = 15
required_type = list(/obj/mecha/working/ripley, /obj/mecha/combat)
- action(atom/target)
- if(!action_checks(target)) return
- if(isobj(target))
- var/obj/target_obj = target
- if(!target_obj.vars.Find("unacidable") || target_obj.unacidable) return
- set_ready_state(0)
- chassis.use_power(energy_drain)
- chassis.visible_message("[chassis] starts to drill [target]", "You hear the drill.")
- occupant_message("You start to drill [target]")
- var/T = chassis.loc
- var/C = target.loc //why are these backwards? we may never know -Pete
- if(do_after_cooldown(target))
- if(T == chassis.loc && src == chassis.selected)
- if(istype(target, /turf/simulated/wall))
- var/turf/simulated/wall/W = target
- if(W.reinf_material)
- occupant_message("[target] is too durable to drill through.")
- else
- log_message("Drilled through [target]")
- target.ex_act(2)
- else if(istype(target, /turf/simulated/mineral))
- for(var/turf/simulated/mineral/M in range(chassis,1))
- if(get_dir(chassis,M)&chassis.dir)
- M.GetDrilled()
- log_message("Drilled through [target]")
- if(locate(/obj/item/mecha_parts/mecha_equipment/tool/hydraulic_clamp) in chassis.equipment)
- var/obj/structure/ore_box/ore_box = locate(/obj/structure/ore_box) in chassis:cargo
- if(ore_box)
- for(var/obj/item/weapon/ore/ore in range(chassis,1))
- if(get_dir(chassis,ore)&chassis.dir)
- ore.Move(ore_box)
- log_message("Drilled through [target]")
- if(locate(/obj/item/mecha_parts/mecha_equipment/tool/hydraulic_clamp) in chassis.equipment)
- var/obj/structure/ore_box/ore_box = locate(/obj/structure/ore_box) in chassis:cargo
- if(ore_box)
- for(var/obj/item/weapon/ore/ore in range(chassis,1))
- if(get_dir(chassis,ore)&chassis.dir)
- ore.Move(ore_box)
- else if(target.loc == C)
+/obj/item/mecha_parts/mecha_equipment/tool/drill/action(atom/target)
+ if(!action_checks(target)) return
+ if(isobj(target))
+ var/obj/target_obj = target
+ if(!target_obj.vars.Find("unacidable") || target_obj.unacidable) return
+ set_ready_state(0)
+ chassis.use_power(energy_drain)
+ chassis.visible_message("[chassis] starts to drill [target]", "You hear the drill.")
+ occupant_message("You start to drill [target]")
+ var/T = chassis.loc
+ var/C = target.loc //why are these backwards? we may never know -Pete
+ if(do_after_cooldown(target))
+ if(T == chassis.loc && src == chassis.selected)
+ if(istype(target, /turf/simulated/wall))
+ var/turf/simulated/wall/W = target
+ if(W.reinf_material)
+ occupant_message("[target] is too durable to drill through.")
+ else
log_message("Drilled through [target]")
target.ex_act(2)
- return 1
+ else if(istype(target, /turf/simulated/mineral))
+ for(var/turf/simulated/mineral/M in range(chassis,1))
+ if(get_dir(chassis,M)&chassis.dir)
+ M.GetDrilled()
+ log_message("Drilled through [target]")
+ if(locate(/obj/item/mecha_parts/mecha_equipment/tool/hydraulic_clamp) in chassis.equipment)
+ var/obj/structure/ore_box/ore_box = locate(/obj/structure/ore_box) in chassis:cargo
+ if(ore_box)
+ for(var/obj/item/weapon/ore/ore in range(chassis,1))
+ if(get_dir(chassis,ore)&chassis.dir)
+ ore.Move(ore_box)
+ log_message("Drilled through [target]")
+ if(locate(/obj/item/mecha_parts/mecha_equipment/tool/hydraulic_clamp) in chassis.equipment)
+ var/obj/structure/ore_box/ore_box = locate(/obj/structure/ore_box) in chassis:cargo
+ if(ore_box)
+ for(var/obj/item/weapon/ore/ore in range(chassis,1))
+ if(get_dir(chassis,ore)&chassis.dir)
+ ore.Move(ore_box)
+ else if(target.loc == C)
+ log_message("Drilled through [target]")
+ target.ex_act(2)
+ return 1
/obj/item/mecha_parts/mecha_equipment/tool/drill/diamonddrill
name = "diamond drill"
@@ -128,39 +131,39 @@
equip_cooldown = 20
force = 15
- action(atom/target)
- if(!action_checks(target)) return
- if(isobj(target))
- var/obj/target_obj = target
- if(target_obj.unacidable) return
- set_ready_state(0)
- chassis.use_power(energy_drain)
- chassis.visible_message("[chassis] starts to drill [target]", "You hear the drill.")
- occupant_message("You start to drill [target]")
- var/T = chassis.loc
- var/C = target.loc //why are these backwards? we may never know -Pete
- if(do_after_cooldown(target))
- if(T == chassis.loc && src == chassis.selected)
- if(istype(target, /turf/simulated/wall))
- var/turf/simulated/wall/W = target
- if(!W.reinf_material || do_after_cooldown(target))//To slow down how fast mechs can drill through the station
- log_message("Drilled through [target]")
- target.ex_act(3)
- else if(istype(target, /turf/simulated/mineral))
- for(var/turf/simulated/mineral/M in range(chassis,1))
- if(get_dir(chassis,M)&chassis.dir)
- M.GetDrilled()
+/obj/item/mecha_parts/mecha_equipment/tool/drill/diamonddrill/action(atom/target)
+ if(!action_checks(target)) return
+ if(isobj(target))
+ var/obj/target_obj = target
+ if(target_obj.unacidable) return
+ set_ready_state(0)
+ chassis.use_power(energy_drain)
+ chassis.visible_message("[chassis] starts to drill [target]", "You hear the drill.")
+ occupant_message("You start to drill [target]")
+ var/T = chassis.loc
+ var/C = target.loc //why are these backwards? we may never know -Pete
+ if(do_after_cooldown(target))
+ if(T == chassis.loc && src == chassis.selected)
+ if(istype(target, /turf/simulated/wall))
+ var/turf/simulated/wall/W = target
+ if(!W.reinf_material || do_after_cooldown(target))//To slow down how fast mechs can drill through the station
log_message("Drilled through [target]")
- if(locate(/obj/item/mecha_parts/mecha_equipment/tool/hydraulic_clamp) in chassis.equipment)
- var/obj/structure/ore_box/ore_box = locate(/obj/structure/ore_box) in chassis:cargo
- if(ore_box)
- for(var/obj/item/weapon/ore/ore in range(chassis,1))
- if(get_dir(chassis,ore)&chassis.dir)
- ore.Move(ore_box)
- else if(target.loc == C)
- log_message("Drilled through [target]")
- target.ex_act(2)
- return 1
+ target.ex_act(3)
+ else if(istype(target, /turf/simulated/mineral))
+ for(var/turf/simulated/mineral/M in range(chassis,1))
+ if(get_dir(chassis,M)&chassis.dir)
+ M.GetDrilled()
+ log_message("Drilled through [target]")
+ if(locate(/obj/item/mecha_parts/mecha_equipment/tool/hydraulic_clamp) in chassis.equipment)
+ var/obj/structure/ore_box/ore_box = locate(/obj/structure/ore_box) in chassis:cargo
+ if(ore_box)
+ for(var/obj/item/weapon/ore/ore in range(chassis,1))
+ if(get_dir(chassis,ore)&chassis.dir)
+ ore.Move(ore_box)
+ else if(target.loc == C)
+ log_message("Drilled through [target]")
+ target.ex_act(2)
+ return 1
/obj/item/mecha_parts/mecha_equipment/tool/extinguisher
name = "extinguisher"
@@ -174,65 +177,64 @@
var/spray_amount = 5 //units of liquid per particle. 5 is enough to wet the floor - it's a big fire extinguisher, so should be fine
var/max_water = 1000
- New()
- reagents = new/datum/reagents(max_water)
- reagents.my_atom = src
- reagents.add_reagent("water", max_water)
- ..()
- return
+/obj/item/mecha_parts/mecha_equipment/tool/extinguisher/New()
+ reagents = new/datum/reagents(max_water)
+ reagents.my_atom = src
+ reagents.add_reagent("water", max_water)
+ ..()
+ return
- action(atom/target) //copypasted from extinguisher. TODO: Rewrite from scratch.
- if(!action_checks(target) || get_dist(chassis, target)>3) return
- if(get_dist(chassis, target)>2) return
- set_ready_state(0)
- if(do_after_cooldown(target))
- if( istype(target, /obj/structure/reagent_dispensers/watertank) && get_dist(chassis,target) <= 1)
- var/obj/o = target
- var/amount = o.reagents.trans_to_obj(src, 200)
- occupant_message("[amount] units transferred into internal tank.")
- playsound(chassis, 'sound/effects/refill.ogg', 50, 1, -6)
- return
+/obj/item/mecha_parts/mecha_equipment/tool/extinguisher/action(atom/target) //copypasted from extinguisher. TODO: Rewrite from scratch.
+ if(!action_checks(target) || get_dist(chassis, target)>3) return
+ if(get_dist(chassis, target)>2) return
+ set_ready_state(0)
+ if(do_after_cooldown(target))
+ if( istype(target, /obj/structure/reagent_dispensers/watertank) && get_dist(chassis,target) <= 1)
+ var/obj/o = target
+ var/amount = o.reagents.trans_to_obj(src, 200)
+ occupant_message("[amount] units transferred into internal tank.")
+ playsound(chassis, 'sound/effects/refill.ogg', 50, 1, -6)
+ return
- if (src.reagents.total_volume < 1)
- occupant_message("\The [src] is empty.")
- return
+ if (src.reagents.total_volume < 1)
+ occupant_message("\The [src] is empty.")
+ return
- playsound(chassis, 'sound/effects/extinguish.ogg', 75, 1, -3)
+ playsound(chassis, 'sound/effects/extinguish.ogg', 75, 1, -3)
- var/direction = get_dir(chassis,target)
+ var/direction = get_dir(chassis,target)
- var/turf/T = get_turf(target)
- var/turf/T1 = get_step(T,turn(direction, 90))
- var/turf/T2 = get_step(T,turn(direction, -90))
+ var/turf/T = get_turf(target)
+ var/turf/T1 = get_step(T,turn(direction, 90))
+ var/turf/T2 = get_step(T,turn(direction, -90))
- var/list/the_targets = list(T,T1,T2)
+ var/list/the_targets = list(T,T1,T2)
- for(var/a = 1 to 5)
- spawn(0)
- var/obj/effect/effect/water/W = new /obj/effect/effect/water(get_turf(chassis))
- var/turf/my_target
- if(a == 1)
- my_target = T
- else if(a == 2)
- my_target = T1
- else if(a == 3)
- my_target = T2
- else
- my_target = pick(the_targets)
- W.create_reagents(5)
- if(!W || !src)
- return
- reagents.trans_to_obj(W, spray_amount)
- W.set_color()
- W.set_up(my_target)
- return 1
+ for(var/a = 1 to 5)
+ spawn(0)
+ var/obj/effect/effect/water/W = new /obj/effect/effect/water(get_turf(chassis))
+ var/turf/my_target
+ if(a == 1)
+ my_target = T
+ else if(a == 2)
+ my_target = T1
+ else if(a == 3)
+ my_target = T2
+ else
+ my_target = pick(the_targets)
+ W.create_reagents(5)
+ if(!W || !src)
+ return
+ reagents.trans_to_obj(W, spray_amount)
+ W.set_color()
+ W.set_up(my_target)
+ return 1
- get_equip_info()
- return "[..()] \[[src.reagents.total_volume]\]"
-
- on_reagent_change()
- return
+/obj/item/mecha_parts/mecha_equipment/tool/extinguisher/get_equip_info()
+ return "[..()] \[[src.reagents.total_volume]\]"
+/obj/item/mecha_parts/mecha_equipment/tool/extinguisher/on_reagent_change()
+ return
/obj/item/mecha_parts/mecha_equipment/tool/rcd
name = "mounted RCD"
@@ -245,94 +247,95 @@
var/mode = 0 //0 - deconstruct, 1 - wall or floor, 2 - airlock.
var/disabled = 0 //malf
- action(atom/target)
- if(istype(target,/area/shuttle)||istype(target, /turf/space/transit))//>implying these are ever made -Sieve
- disabled = 1
- else
- disabled = 0
- if(!istype(target, /turf) && !istype(target, /obj/machinery/door/airlock))
- target = get_turf(target)
- if(!action_checks(target) || disabled || get_dist(chassis, target)>3) return
- playsound(chassis, 'sound/machines/click.ogg', 50, 1)
- //meh
+ equip_type = EQUIP_SPECIAL
+
+/obj/item/mecha_parts/mecha_equipment/tool/rcd/action(atom/target)
+ if(istype(target,/area/shuttle)||istype(target, /turf/space/transit))//>implying these are ever made -Sieve
+ disabled = 1
+ else
+ disabled = 0
+ if(!istype(target, /turf) && !istype(target, /obj/machinery/door/airlock))
+ target = get_turf(target)
+ if(!action_checks(target) || disabled || get_dist(chassis, target)>3) return
+ playsound(chassis, 'sound/machines/click.ogg', 50, 1)
+ //meh
+ switch(mode)
+ if(0)
+ if (istype(target, /turf/simulated/wall))
+ occupant_message("Deconstructing [target]...")
+ set_ready_state(0)
+ if(do_after_cooldown(target))
+ if(disabled) return
+ chassis.spark_system.start()
+ target:ChangeTurf(/turf/simulated/floor/plating)
+ playsound(target, 'sound/items/Deconstruct.ogg', 50, 1)
+ chassis.use_power(energy_drain)
+ else if (istype(target, /turf/simulated/floor))
+ occupant_message("Deconstructing [target]...")
+ set_ready_state(0)
+ if(do_after_cooldown(target))
+ if(disabled) return
+ chassis.spark_system.start()
+ target:ChangeTurf(get_base_turf_by_area(target))
+ playsound(target, 'sound/items/Deconstruct.ogg', 50, 1)
+ chassis.use_power(energy_drain)
+ else if (istype(target, /obj/machinery/door/airlock))
+ occupant_message("Deconstructing [target]...")
+ set_ready_state(0)
+ if(do_after_cooldown(target))
+ if(disabled) return
+ chassis.spark_system.start()
+ qdel(target)
+ playsound(target, 'sound/items/Deconstruct.ogg', 50, 1)
+ chassis.use_power(energy_drain)
+ if(1)
+ if(istype(target, /turf/space) || istype(target,get_base_turf_by_area(target)))
+ occupant_message("Building Floor...")
+ set_ready_state(0)
+ if(do_after_cooldown(target))
+ if(disabled) return
+ target:ChangeTurf(/turf/simulated/floor/plating)
+ playsound(target, 'sound/items/Deconstruct.ogg', 50, 1)
+ chassis.spark_system.start()
+ chassis.use_power(energy_drain*2)
+ else if(istype(target, /turf/simulated/floor))
+ occupant_message("Building Wall...")
+ set_ready_state(0)
+ if(do_after_cooldown(target))
+ if(disabled) return
+ target:ChangeTurf(/turf/simulated/wall)
+ playsound(target, 'sound/items/Deconstruct.ogg', 50, 1)
+ chassis.spark_system.start()
+ chassis.use_power(energy_drain*2)
+ if(2)
+ if(istype(target, /turf/simulated/floor))
+ occupant_message("Building Airlock...")
+ set_ready_state(0)
+ if(do_after_cooldown(target))
+ if(disabled) return
+ chassis.spark_system.start()
+ var/obj/machinery/door/airlock/T = new /obj/machinery/door/airlock(target)
+ T.autoclose = 1
+ playsound(target, 'sound/items/Deconstruct.ogg', 50, 1)
+ playsound(target, 'sound/effects/sparks2.ogg', 50, 1)
+ chassis.use_power(energy_drain*2)
+ return
+
+/obj/item/mecha_parts/mecha_equipment/tool/rcd/Topic(href,href_list)
+ ..()
+ if(href_list["mode"])
+ mode = text2num(href_list["mode"])
switch(mode)
if(0)
- if (istype(target, /turf/simulated/wall))
- occupant_message("Deconstructing [target]...")
- set_ready_state(0)
- if(do_after_cooldown(target))
- if(disabled) return
- chassis.spark_system.start()
- target:ChangeTurf(/turf/simulated/floor/plating)
- playsound(target, 'sound/items/Deconstruct.ogg', 50, 1)
- chassis.use_power(energy_drain)
- else if (istype(target, /turf/simulated/floor))
- occupant_message("Deconstructing [target]...")
- set_ready_state(0)
- if(do_after_cooldown(target))
- if(disabled) return
- chassis.spark_system.start()
- target:ChangeTurf(get_base_turf_by_area(target))
- playsound(target, 'sound/items/Deconstruct.ogg', 50, 1)
- chassis.use_power(energy_drain)
- else if (istype(target, /obj/machinery/door/airlock))
- occupant_message("Deconstructing [target]...")
- set_ready_state(0)
- if(do_after_cooldown(target))
- if(disabled) return
- chassis.spark_system.start()
- qdel(target)
- playsound(target, 'sound/items/Deconstruct.ogg', 50, 1)
- chassis.use_power(energy_drain)
+ occupant_message("Switched RCD to Deconstruct.")
if(1)
- if(istype(target, /turf/space) || istype(target,get_base_turf_by_area(target)))
- occupant_message("Building Floor...")
- set_ready_state(0)
- if(do_after_cooldown(target))
- if(disabled) return
- target:ChangeTurf(/turf/simulated/floor/plating)
- playsound(target, 'sound/items/Deconstruct.ogg', 50, 1)
- chassis.spark_system.start()
- chassis.use_power(energy_drain*2)
- else if(istype(target, /turf/simulated/floor))
- occupant_message("Building Wall...")
- set_ready_state(0)
- if(do_after_cooldown(target))
- if(disabled) return
- target:ChangeTurf(/turf/simulated/wall)
- playsound(target, 'sound/items/Deconstruct.ogg', 50, 1)
- chassis.spark_system.start()
- chassis.use_power(energy_drain*2)
+ occupant_message("Switched RCD to Construct.")
if(2)
- if(istype(target, /turf/simulated/floor))
- occupant_message("Building Airlock...")
- set_ready_state(0)
- if(do_after_cooldown(target))
- if(disabled) return
- chassis.spark_system.start()
- var/obj/machinery/door/airlock/T = new /obj/machinery/door/airlock(target)
- T.autoclose = 1
- playsound(target, 'sound/items/Deconstruct.ogg', 50, 1)
- playsound(target, 'sound/effects/sparks2.ogg', 50, 1)
- chassis.use_power(energy_drain*2)
- return
+ occupant_message("Switched RCD to Construct Airlock.")
+ return
-
- Topic(href,href_list)
- ..()
- if(href_list["mode"])
- mode = text2num(href_list["mode"])
- switch(mode)
- if(0)
- occupant_message("Switched RCD to Deconstruct.")
- if(1)
- occupant_message("Switched RCD to Construct.")
- if(2)
- occupant_message("Switched RCD to Construct Airlock.")
- return
-
- get_equip_info()
- return "[..()] \[D|C|A\]"
+/obj/item/mecha_parts/mecha_equipment/tool/rcd/get_equip_info()
+ return "[..()] \[D|C|A\]"
@@ -346,15 +349,17 @@
energy_drain = 1000
range = RANGED
- action(atom/target)
- if(!action_checks(target) || src.loc.z == 2) return
- var/turf/T = get_turf(target)
- if(T)
- set_ready_state(0)
- chassis.use_power(energy_drain)
- do_teleport(chassis, T, 4)
- do_after_cooldown()
- return
+ equip_type = EQUIP_SPECIAL
+
+/obj/item/mecha_parts/mecha_equipment/teleporter/action(atom/target)
+ if(!action_checks(target) || src.loc.z == 2) return
+ var/turf/T = get_turf(target)
+ if(T)
+ set_ready_state(0)
+ chassis.use_power(energy_drain)
+ do_teleport(chassis, T, 4)
+ do_after_cooldown()
+ return
/obj/item/mecha_parts/mecha_equipment/wormhole_generator
@@ -366,46 +371,47 @@
energy_drain = 300
range = RANGED
+ equip_type = EQUIP_SPECIAL
- action(atom/target)
- if(!action_checks(target) || src.loc.z == 2) return
- var/list/theareas = list()
- for(var/area/AR in orange(100, chassis))
- if(AR in theareas) continue
- theareas += AR
- if(!theareas.len)
- return
- var/area/thearea = pick(theareas)
- var/list/L = list()
- var/turf/pos = get_turf(src)
- for(var/turf/T in get_area_turfs(thearea.type))
- if(!T.density && pos.z == T.z)
- var/clear = 1
- for(var/obj/O in T)
- if(O.density)
- clear = 0
- break
- if(clear)
- L+=T
- if(!L.len)
- return
- var/turf/target_turf = pick(L)
- if(!target_turf)
- return
- chassis.use_power(energy_drain)
- set_ready_state(0)
- var/obj/effect/portal/P = new /obj/effect/portal(get_turf(target))
- P.target = target_turf
- P.creator = null
- P.icon = 'icons/obj/objects.dmi'
- P.failchance = 0
- P.icon_state = "anom"
- P.name = "wormhole"
- do_after_cooldown()
- src = null
- spawn(rand(150,300))
- qdel(P)
+/obj/item/mecha_parts/mecha_equipment/wormhole_generator/action(atom/target)
+ if(!action_checks(target) || src.loc.z == 2) return
+ var/list/theareas = list()
+ for(var/area/AR in orange(100, chassis))
+ if(AR in theareas) continue
+ theareas += AR
+ if(!theareas.len)
return
+ var/area/thearea = pick(theareas)
+ var/list/L = list()
+ var/turf/pos = get_turf(src)
+ for(var/turf/T in get_area_turfs(thearea.type))
+ if(!T.density && pos.z == T.z)
+ var/clear = 1
+ for(var/obj/O in T)
+ if(O.density)
+ clear = 0
+ break
+ if(clear)
+ L+=T
+ if(!L.len)
+ return
+ var/turf/target_turf = pick(L)
+ if(!target_turf)
+ return
+ chassis.use_power(energy_drain)
+ set_ready_state(0)
+ var/obj/effect/portal/P = new /obj/effect/portal(get_turf(target))
+ P.target = target_turf
+ P.creator = null
+ P.icon = 'icons/obj/objects.dmi'
+ P.failchance = 0
+ P.icon_state = "anom"
+ P.name = "wormhole"
+ do_after_cooldown()
+ src = null
+ spawn(rand(150,300))
+ qdel(P)
+ return
/obj/item/mecha_parts/mecha_equipment/gravcatapult
name = "gravitational catapult"
@@ -421,66 +427,68 @@
var/last_fired = 0 //Concept stolen from guns.
var/fire_delay = 10 //Used to prevent spam-brute against humans.
- action(atom/movable/target)
+ equip_type = EQUIP_UTILITY
- if(world.time >= last_fired + fire_delay)
- last_fired = world.time
- else
- if (world.time % 3)
- occupant_message("[src] is not ready to fire again!")
- return 0
+/obj/item/mecha_parts/mecha_equipment/gravcatapult/action(atom/movable/target)
- switch(mode)
- if(1)
- if(!action_checks(target) && !locked) return
- if(!locked)
- if(!istype(target) || target.anchored)
- occupant_message("Unable to lock on [target]")
- return
- locked = target
- occupant_message("Locked on [target]")
- send_byjax(chassis.occupant,"exosuit.browser","\ref[src]",src.get_equip_info())
+ if(world.time >= last_fired + fire_delay)
+ last_fired = world.time
+ else
+ if (world.time % 3)
+ occupant_message("[src] is not ready to fire again!")
+ return 0
+
+ switch(mode)
+ if(1)
+ if(!action_checks(target) && !locked) return
+ if(!locked)
+ if(!istype(target) || target.anchored)
+ occupant_message("Unable to lock on [target]")
return
- else if(target!=locked)
- if(locked in view(chassis))
- locked.throw_at(target, 14, 1.5, chassis)
- locked = null
- send_byjax(chassis.occupant,"exosuit.browser","\ref[src]",src.get_equip_info())
- set_ready_state(0)
- chassis.use_power(energy_drain)
- do_after_cooldown()
- else
- locked = null
- occupant_message("Lock on [locked] disengaged.")
- send_byjax(chassis.occupant,"exosuit.browser","\ref[src]",src.get_equip_info())
- if(2)
- if(!action_checks(target)) return
- var/list/atoms = list()
- if(isturf(target))
- atoms = range(target,3)
+ locked = target
+ occupant_message("Locked on [target]")
+ send_byjax(chassis.occupant,"exosuit.browser","\ref[src]",src.get_equip_info())
+ return
+ else if(target!=locked)
+ if(locked in view(chassis))
+ locked.throw_at(target, 14, 1.5, chassis)
+ locked = null
+ send_byjax(chassis.occupant,"exosuit.browser","\ref[src]",src.get_equip_info())
+ set_ready_state(0)
+ chassis.use_power(energy_drain)
+ do_after_cooldown()
else
- atoms = orange(target,3)
- for(var/atom/movable/A in atoms)
- if(A.anchored) continue
- spawn(0)
- var/iter = 5-get_dist(A,target)
- for(var/i=0 to iter)
- step_away(A,target)
- sleep(2)
- set_ready_state(0)
- chassis.use_power(energy_drain)
- do_after_cooldown()
- return
+ locked = null
+ occupant_message("Lock on [locked] disengaged.")
+ send_byjax(chassis.occupant,"exosuit.browser","\ref[src]",src.get_equip_info())
+ if(2)
+ if(!action_checks(target)) return
+ var/list/atoms = list()
+ if(isturf(target))
+ atoms = range(target,3)
+ else
+ atoms = orange(target,3)
+ for(var/atom/movable/A in atoms)
+ if(A.anchored) continue
+ spawn(0)
+ var/iter = 5-get_dist(A,target)
+ for(var/i=0 to iter)
+ step_away(A,target)
+ sleep(2)
+ set_ready_state(0)
+ chassis.use_power(energy_drain)
+ do_after_cooldown()
+ return
- get_equip_info()
- return "[..()] [mode==1?"([locked||"Nothing"])":null] \[S|P\]"
+/obj/item/mecha_parts/mecha_equipment/gravcatapult/get_equip_info()
+ return "[..()] [mode==1?"([locked||"Nothing"])":null] \[S|P\]"
- Topic(href, href_list)
- ..()
- if(href_list["mode"])
- mode = text2num(href_list["mode"])
- send_byjax(chassis.occupant,"exosuit.browser","\ref[src]",src.get_equip_info())
- return
+/obj/item/mecha_parts/mecha_equipment/gravcatapult/Topic(href, href_list)
+ ..()
+ if(href_list["mode"])
+ mode = text2num(href_list["mode"])
+ send_byjax(chassis.occupant,"exosuit.browser","\ref[src]",src.get_equip_info())
+ return
/obj/item/mecha_parts/mecha_equipment/anticcw_armor_booster //what is that noise? A BAWWW from TK mutants.
@@ -494,42 +502,44 @@
var/deflect_coeff = 1.15
var/damage_coeff = 0.8
- can_attach(obj/mecha/M as obj)
- if(..())
- if(!M.proc_res["dynattackby"])
- return 1
- return 0
+ equip_type = EQUIP_HULL
- attach(obj/mecha/M as obj)
- ..()
- chassis.proc_res["dynattackby"] = src
- return
+/obj/item/mecha_parts/mecha_equipment/anticcw_armor_booster/can_attach(obj/mecha/M as obj)
+ if(..())
+ if(!M.proc_res["dynattackby"])
+ return 1
+ return 0
- detach()
- chassis.proc_res["dynattackby"] = null
- ..()
- return
+/obj/item/mecha_parts/mecha_equipment/anticcw_armor_booster/attach(obj/mecha/M as obj)
+ ..()
+ chassis.proc_res["dynattackby"] = src
+ return
- get_equip_info()
- if(!chassis) return
- return "* [src.name]"
+/obj/item/mecha_parts/mecha_equipment/anticcw_armor_booster/detach()
+ chassis.proc_res["dynattackby"] = null
+ ..()
+ return
- proc/dynattackby(obj/item/weapon/W as obj, mob/user as mob)
- if(!action_checks(user))
- return chassis.dynattackby(W,user)
- chassis.log_message("Attacked by [W]. Attacker - [user]")
- if(prob(chassis.deflect_chance*deflect_coeff))
- user << "\The [W] bounces off [chassis] armor."
- chassis.log_append_to_last("Armor saved.")
- else
- chassis.occupant_message("\The [user] hits [chassis] with [W].")
- user.visible_message("\The [user] hits [chassis] with [W].", "You hit [src] with [W].")
- chassis.take_damage(round(W.force*damage_coeff),W.damtype)
- chassis.check_for_internal_damage(list(MECHA_INT_TEMP_CONTROL,MECHA_INT_TANK_BREACH,MECHA_INT_CONTROL_LOST))
- set_ready_state(0)
- chassis.use_power(energy_drain)
- do_after_cooldown()
- return
+/obj/item/mecha_parts/mecha_equipment/anticcw_armor_booster/get_equip_info()
+ if(!chassis) return
+ return "* [src.name]"
+
+/obj/item/mecha_parts/mecha_equipment/anticcw_armor_booster/proc/dynattackby(obj/item/weapon/W as obj, mob/user as mob)
+ if(!action_checks(user))
+ return chassis.dynattackby(W,user)
+ chassis.log_message("Attacked by [W]. Attacker - [user]")
+ if(prob(chassis.deflect_chance*deflect_coeff))
+ user << "\The [W] bounces off [chassis] armor."
+ chassis.log_append_to_last("Armor saved.")
+ else
+ chassis.occupant_message("\The [user] hits [chassis] with [W].")
+ user.visible_message("\The [user] hits [chassis] with [W].", "You hit [src] with [W].")
+ chassis.take_damage(round(W.force*damage_coeff),W.damtype)
+ chassis.check_for_internal_damage(list(MECHA_INT_TEMP_CONTROL,MECHA_INT_TANK_BREACH,MECHA_INT_CONTROL_LOST))
+ set_ready_state(0)
+ chassis.use_power(energy_drain)
+ do_after_cooldown()
+ return
/obj/item/mecha_parts/mecha_equipment/antiproj_armor_booster
@@ -543,63 +553,65 @@
var/deflect_coeff = 1.15
var/damage_coeff = 0.8
- can_attach(obj/mecha/M as obj)
- if(..())
- if(!M.proc_res["dynbulletdamage"] && !M.proc_res["dynhitby"])
- return 1
- return 0
+ equip_type = EQUIP_HULL
- attach(obj/mecha/M as obj)
- ..()
- chassis.proc_res["dynbulletdamage"] = src
- chassis.proc_res["dynhitby"] = src
- return
+/obj/item/mecha_parts/mecha_equipment/antiproj_armor_booster/can_attach(obj/mecha/M as obj)
+ if(..())
+ if(!M.proc_res["dynbulletdamage"] && !M.proc_res["dynhitby"])
+ return 1
+ return 0
- detach()
- chassis.proc_res["dynbulletdamage"] = null
- chassis.proc_res["dynhitby"] = null
- ..()
- return
+/obj/item/mecha_parts/mecha_equipment/antiproj_armor_booster/attach(obj/mecha/M as obj)
+ ..()
+ chassis.proc_res["dynbulletdamage"] = src
+ chassis.proc_res["dynhitby"] = src
+ return
- get_equip_info()
- if(!chassis) return
- return "* [src.name]"
+/obj/item/mecha_parts/mecha_equipment/antiproj_armor_booster/detach()
+ chassis.proc_res["dynbulletdamage"] = null
+ chassis.proc_res["dynhitby"] = null
+ ..()
+ return
- proc/dynbulletdamage(var/obj/item/projectile/Proj)
- if(!action_checks(src))
- return chassis.dynbulletdamage(Proj)
- if(prob(chassis.deflect_chance*deflect_coeff))
- chassis.occupant_message("The armor deflects incoming projectile.")
- chassis.visible_message("The [chassis.name] armor deflects the projectile")
- chassis.log_append_to_last("Armor saved.")
- else
- chassis.take_damage(round(Proj.damage*src.damage_coeff),Proj.check_armour)
- chassis.check_for_internal_damage(list(MECHA_INT_FIRE,MECHA_INT_TEMP_CONTROL,MECHA_INT_TANK_BREACH,MECHA_INT_CONTROL_LOST))
- Proj.on_hit(chassis)
- set_ready_state(0)
- chassis.use_power(energy_drain)
- do_after_cooldown()
- return
+/obj/item/mecha_parts/mecha_equipment/antiproj_armor_booster/get_equip_info()
+ if(!chassis) return
+ return "* [src.name]"
- proc/dynhitby(atom/movable/A)
- if(!action_checks(A))
- return chassis.dynhitby(A)
- if(prob(chassis.deflect_chance*deflect_coeff) || istype(A, /mob/living) || istype(A, /obj/item/mecha_parts/mecha_tracking))
- chassis.occupant_message("The [A] bounces off the armor.")
- chassis.visible_message("The [A] bounces off the [chassis] armor")
- chassis.log_append_to_last("Armor saved.")
- if(istype(A, /mob/living))
- var/mob/living/M = A
- M.take_organ_damage(10)
- else if(istype(A, /obj))
- var/obj/O = A
- if(O.throwforce)
- chassis.take_damage(round(O.throwforce*damage_coeff))
- chassis.check_for_internal_damage(list(MECHA_INT_TEMP_CONTROL,MECHA_INT_TANK_BREACH,MECHA_INT_CONTROL_LOST))
- set_ready_state(0)
- chassis.use_power(energy_drain)
- do_after_cooldown()
- return
+/obj/item/mecha_parts/mecha_equipment/antiproj_armor_booster/proc/dynbulletdamage(var/obj/item/projectile/Proj)
+ if(!action_checks(src))
+ return chassis.dynbulletdamage(Proj)
+ if(prob(chassis.deflect_chance*deflect_coeff))
+ chassis.occupant_message("The armor deflects incoming projectile.")
+ chassis.visible_message("The [chassis.name] armor deflects the projectile")
+ chassis.log_append_to_last("Armor saved.")
+ else
+ chassis.take_damage(round(Proj.damage*src.damage_coeff),Proj.check_armour)
+ chassis.check_for_internal_damage(list(MECHA_INT_FIRE,MECHA_INT_TEMP_CONTROL,MECHA_INT_TANK_BREACH,MECHA_INT_CONTROL_LOST))
+ Proj.on_hit(chassis)
+ set_ready_state(0)
+ chassis.use_power(energy_drain)
+ do_after_cooldown()
+ return
+
+/obj/item/mecha_parts/mecha_equipment/antiproj_armor_booster/proc/dynhitby(atom/movable/A)
+ if(!action_checks(A))
+ return chassis.dynhitby(A)
+ if(prob(chassis.deflect_chance*deflect_coeff) || istype(A, /mob/living) || istype(A, /obj/item/mecha_parts/mecha_tracking))
+ chassis.occupant_message("The [A] bounces off the armor.")
+ chassis.visible_message("The [A] bounces off the [chassis] armor")
+ chassis.log_append_to_last("Armor saved.")
+ if(istype(A, /mob/living))
+ var/mob/living/M = A
+ M.take_organ_damage(10)
+ else if(istype(A, /obj))
+ var/obj/O = A
+ if(O.throwforce)
+ chassis.take_damage(round(O.throwforce*damage_coeff))
+ chassis.check_for_internal_damage(list(MECHA_INT_TEMP_CONTROL,MECHA_INT_TANK_BREACH,MECHA_INT_CONTROL_LOST))
+ set_ready_state(0)
+ chassis.use_power(energy_drain)
+ do_after_cooldown()
+ return
/obj/item/mecha_parts/mecha_equipment/repair_droid
@@ -615,85 +627,87 @@
var/icon/droid_overlay
var/list/repairable_damage = list(MECHA_INT_TEMP_CONTROL,MECHA_INT_TANK_BREACH)
- New()
- ..()
- pr_repair_droid = new /datum/global_iterator/mecha_repair_droid(list(src),0)
- pr_repair_droid.set_delay(equip_cooldown)
- return
+ equip_type = EQUIP_HULL
- Destroy()
- qdel(pr_repair_droid)
- pr_repair_droid = null
- ..()
+/obj/item/mecha_parts/mecha_equipment/repair_droid/New()
+ ..()
+ pr_repair_droid = new /datum/global_iterator/mecha_repair_droid(list(src),0)
+ pr_repair_droid.set_delay(equip_cooldown)
+ return
- attach(obj/mecha/M as obj)
- ..()
- droid_overlay = new(src.icon, icon_state = "repair_droid")
- M.overlays += droid_overlay
- return
+/obj/item/mecha_parts/mecha_equipment/repair_droid/Destroy()
+ qdel(pr_repair_droid)
+ pr_repair_droid = null
+ ..()
- destroy()
+/obj/item/mecha_parts/mecha_equipment/repair_droid/attach(obj/mecha/M as obj)
+ ..()
+ droid_overlay = new(src.icon, icon_state = "repair_droid")
+ M.overlays += droid_overlay
+ return
+
+/obj/item/mecha_parts/mecha_equipment/repair_droid/destroy()
+ chassis.overlays -= droid_overlay
+ ..()
+ return
+
+/obj/item/mecha_parts/mecha_equipment/repair_droid/detach()
+ chassis.overlays -= droid_overlay
+ pr_repair_droid.stop()
+ ..()
+ return
+
+/obj/item/mecha_parts/mecha_equipment/repair_droid/get_equip_info()
+ if(!chassis) return
+ return "* [src.name] - [pr_repair_droid.active()?"Dea":"A"]ctivate"
+
+
+/obj/item/mecha_parts/mecha_equipment/repair_droid/Topic(href, href_list)
+ ..()
+ if(href_list["toggle_repairs"])
chassis.overlays -= droid_overlay
- ..()
- return
-
- detach()
- chassis.overlays -= droid_overlay
- pr_repair_droid.stop()
- ..()
- return
-
- get_equip_info()
- if(!chassis) return
- return "* [src.name] - [pr_repair_droid.active()?"Dea":"A"]ctivate"
-
-
- Topic(href, href_list)
- ..()
- if(href_list["toggle_repairs"])
- chassis.overlays -= droid_overlay
- if(pr_repair_droid.toggle())
- droid_overlay = new(src.icon, icon_state = "repair_droid_a")
- log_message("Activated.")
- else
- droid_overlay = new(src.icon, icon_state = "repair_droid")
- log_message("Deactivated.")
- set_ready_state(1)
- chassis.overlays += droid_overlay
- send_byjax(chassis.occupant,"exosuit.browser","\ref[src]",src.get_equip_info())
- return
+ if(pr_repair_droid.toggle())
+ droid_overlay = new(src.icon, icon_state = "repair_droid_a")
+ log_message("Activated.")
+ else
+ droid_overlay = new(src.icon, icon_state = "repair_droid")
+ log_message("Deactivated.")
+ set_ready_state(1)
+ chassis.overlays += droid_overlay
+ send_byjax(chassis.occupant,"exosuit.browser","\ref[src]",src.get_equip_info())
+ return
/datum/global_iterator/mecha_repair_droid
- process(var/obj/item/mecha_parts/mecha_equipment/repair_droid/RD as obj)
- if(!RD.chassis)
+/datum/global_iterator/mecha_repair_droid/process(var/obj/item/mecha_parts/mecha_equipment/repair_droid/RD as obj)
+ if(!RD.chassis)
+ stop()
+ RD.set_ready_state(1)
+ return
+ var/health_boost = RD.health_boost
+ var/repaired = 0
+ if(RD.chassis.hasInternalDamage(MECHA_INT_SHORT_CIRCUIT))
+ health_boost *= -2
+ else if(RD.chassis.hasInternalDamage() && prob(15))
+ for(var/int_dam_flag in RD.repairable_damage)
+ if(RD.chassis.hasInternalDamage(int_dam_flag))
+ RD.chassis.clearInternalDamage(int_dam_flag)
+ repaired = 1
+ break
+ if(health_boost<0 || RD.chassis.health < initial(RD.chassis.health))
+ RD.chassis.health += min(health_boost, initial(RD.chassis.health)-RD.chassis.health)
+ repaired = 1
+ if(repaired)
+ if(RD.chassis.use_power(RD.energy_drain))
+ RD.set_ready_state(0)
+ else
stop()
RD.set_ready_state(1)
return
- var/health_boost = RD.health_boost
- var/repaired = 0
- if(RD.chassis.hasInternalDamage(MECHA_INT_SHORT_CIRCUIT))
- health_boost *= -2
- else if(RD.chassis.hasInternalDamage() && prob(15))
- for(var/int_dam_flag in RD.repairable_damage)
- if(RD.chassis.hasInternalDamage(int_dam_flag))
- RD.chassis.clearInternalDamage(int_dam_flag)
- repaired = 1
- break
- if(health_boost<0 || RD.chassis.health < initial(RD.chassis.health))
- RD.chassis.health += min(health_boost, initial(RD.chassis.health)-RD.chassis.health)
- repaired = 1
- if(repaired)
- if(RD.chassis.use_power(RD.energy_drain))
- RD.set_ready_state(0)
- else
- stop()
- RD.set_ready_state(1)
- return
- else
- RD.set_ready_state(1)
- return
+ else
+ RD.set_ready_state(1)
+ return
/obj/item/mecha_parts/mecha_equipment/tesla_energy_relay
@@ -708,71 +722,73 @@
var/coeff = 100
var/list/use_channels = list(EQUIP,ENVIRON,LIGHT)
- New()
- ..()
- pr_energy_relay = new /datum/global_iterator/mecha_energy_relay(list(src),0)
- pr_energy_relay.set_delay(equip_cooldown)
- return
+ equip_type = EQUIP_UTILITY
- Destroy()
- qdel(pr_energy_relay)
- pr_energy_relay = null
- ..()
+/obj/item/mecha_parts/mecha_equipment/tesla_energy_relay/New()
+ ..()
+ pr_energy_relay = new /datum/global_iterator/mecha_energy_relay(list(src),0)
+ pr_energy_relay.set_delay(equip_cooldown)
+ return
- detach()
- pr_energy_relay.stop()
-// chassis.proc_res["dynusepower"] = null
- chassis.proc_res["dyngetcharge"] = null
- ..()
- return
+/obj/item/mecha_parts/mecha_equipment/tesla_energy_relay/Destroy()
+ qdel(pr_energy_relay)
+ pr_energy_relay = null
+ ..()
- attach(obj/mecha/M)
- ..()
- chassis.proc_res["dyngetcharge"] = src
-// chassis.proc_res["dynusepower"] = src
- return
+/obj/item/mecha_parts/mecha_equipment/tesla_energy_relay/detach()
+ pr_energy_relay.stop()
+// chassis.proc_res["dynusepower"] = null
+ chassis.proc_res["dyngetcharge"] = null
+ ..()
+ return
- can_attach(obj/mecha/M)
- if(..())
- if(!M.proc_res["dyngetcharge"])// && !M.proc_res["dynusepower"])
- return 1
- return 0
+/obj/item/mecha_parts/mecha_equipment/tesla_energy_relay/attach(obj/mecha/M)
+ ..()
+ chassis.proc_res["dyngetcharge"] = src
+// chassis.proc_res["dynusepower"] = src
+ return
- proc/dyngetcharge()
- if(equip_ready) //disabled
- return chassis.dyngetcharge()
- var/area/A = get_area(chassis)
- var/pow_chan = get_power_channel(A)
- var/charge = 0
- if(pow_chan)
- charge = 1000 //making magic
+/obj/item/mecha_parts/mecha_equipment/tesla_energy_relay/can_attach(obj/mecha/M)
+ if(..())
+ if(!M.proc_res["dyngetcharge"])// && !M.proc_res["dynusepower"])
+ return 1
+ return 0
+
+/obj/item/mecha_parts/mecha_equipment/tesla_energy_relay/proc/dyngetcharge()
+ if(equip_ready) //disabled
+ return chassis.dyngetcharge()
+ var/area/A = get_area(chassis)
+ var/pow_chan = get_power_channel(A)
+ var/charge = 0
+ if(pow_chan)
+ charge = 1000 //making magic
+ else
+ return chassis.dyngetcharge()
+ return charge
+
+/obj/item/mecha_parts/mecha_equipment/tesla_energy_relay/proc/get_power_channel(var/area/A)
+ var/pow_chan
+ if(A)
+ for(var/c in use_channels)
+ if(A.powered(c))
+ pow_chan = c
+ break
+ return pow_chan
+
+/obj/item/mecha_parts/mecha_equipment/tesla_energy_relay/Topic(href, href_list)
+ ..()
+ if(href_list["toggle_relay"])
+ if(pr_energy_relay.toggle())
+ set_ready_state(0)
+ log_message("Activated.")
else
- return chassis.dyngetcharge()
- return charge
+ set_ready_state(1)
+ log_message("Deactivated.")
+ return
- proc/get_power_channel(var/area/A)
- var/pow_chan
- if(A)
- for(var/c in use_channels)
- if(A.powered(c))
- pow_chan = c
- break
- return pow_chan
-
- Topic(href, href_list)
- ..()
- if(href_list["toggle_relay"])
- if(pr_energy_relay.toggle())
- set_ready_state(0)
- log_message("Activated.")
- else
- set_ready_state(1)
- log_message("Deactivated.")
- return
-
- get_equip_info()
- if(!chassis) return
- return "* [src.name] - [pr_energy_relay.active()?"Dea":"A"]ctivate"
+/obj/item/mecha_parts/mecha_equipment/tesla_energy_relay/get_equip_info()
+ if(!chassis) return
+ return "* [src.name] - [pr_energy_relay.active()?"Dea":"A"]ctivate"
/* proc/dynusepower(amount)
if(!equip_ready) //enabled
@@ -785,31 +801,113 @@
/datum/global_iterator/mecha_energy_relay
- process(var/obj/item/mecha_parts/mecha_equipment/tesla_energy_relay/ER)
- if(!ER.chassis || ER.chassis.hasInternalDamage(MECHA_INT_SHORT_CIRCUIT))
- stop()
- ER.set_ready_state(1)
- return
- var/cur_charge = ER.chassis.get_charge()
- if(isnull(cur_charge) || !ER.chassis.cell)
- stop()
- ER.set_ready_state(1)
- ER.occupant_message("No powercell detected.")
- return
- if(cur_charge* [src.name] - [my_shield.active?"Dea":"A"]ctivate"
/obj/item/mecha_parts/mecha_equipment/generator
@@ -828,125 +926,127 @@
var/fuel_per_cycle_active = 500
var/power_per_cycle = 20
- New()
- ..()
- init()
- return
+ equip_type = EQUIP_UTILITY
- Destroy()
- qdel(pr_mech_generator)
- pr_mech_generator = null
- ..()
+/obj/item/mecha_parts/mecha_equipment/generator/New()
+ ..()
+ init()
+ return
- proc/init()
- fuel = new /obj/item/stack/material/phoron(src)
- fuel.amount = 0
- pr_mech_generator = new /datum/global_iterator/mecha_generator(list(src),0)
- pr_mech_generator.set_delay(equip_cooldown)
- return
+/obj/item/mecha_parts/mecha_equipment/generator/Destroy()
+ qdel(pr_mech_generator)
+ pr_mech_generator = null
+ ..()
- detach()
- pr_mech_generator.stop()
- ..()
- return
+/obj/item/mecha_parts/mecha_equipment/generator/proc/init()
+ fuel = new /obj/item/stack/material/phoron(src)
+ fuel.amount = 0
+ pr_mech_generator = new /datum/global_iterator/mecha_generator(list(src),0)
+ pr_mech_generator.set_delay(equip_cooldown)
+ return
+
+/obj/item/mecha_parts/mecha_equipment/generator/detach()
+ pr_mech_generator.stop()
+ ..()
+ return
- Topic(href, href_list)
- ..()
- if(href_list["toggle"])
- if(pr_mech_generator.toggle())
- set_ready_state(0)
- log_message("Activated.")
- else
- set_ready_state(1)
- log_message("Deactivated.")
- return
+/obj/item/mecha_parts/mecha_equipment/generator/Topic(href, href_list)
+ ..()
+ if(href_list["toggle"])
+ if(pr_mech_generator.toggle())
+ set_ready_state(0)
+ log_message("Activated.")
+ else
+ set_ready_state(1)
+ log_message("Deactivated.")
+ return
- get_equip_info()
- var/output = ..()
- if(output)
- return "[output] \[[fuel]: [round(fuel.amount*fuel.perunit,0.1)] cm3\] - [pr_mech_generator.active()?"Dea":"A"]ctivate"
- return
+/obj/item/mecha_parts/mecha_equipment/generator/get_equip_info()
+ var/output = ..()
+ if(output)
+ return "[output] \[[fuel]: [round(fuel.amount*fuel.perunit,0.1)] cm3\] - [pr_mech_generator.active()?"Dea":"A"]ctivate"
+ return
- action(target)
- if(chassis)
- var/result = load_fuel(target)
- var/message
- if(isnull(result))
- message = "[fuel] traces in target minimal. [target] cannot be used as fuel."
- else if(!result)
- message = "Unit is full."
- else
- message = "[result] unit\s of [fuel] successfully loaded."
- send_byjax(chassis.occupant,"exosuit.browser","\ref[src]",src.get_equip_info())
- occupant_message(message)
- return
-
- proc/load_fuel(var/obj/item/stack/material/P)
- if(P.type == fuel.type && P.amount)
- var/to_load = max(max_fuel - fuel.amount*fuel.perunit,0)
- if(to_load)
- var/units = min(max(round(to_load / P.perunit),1),P.amount)
- if(units)
- fuel.amount += units
- P.use(units)
- return units
- else
- return 0
- return
-
- attackby(weapon,mob/user)
- var/result = load_fuel(weapon)
+/obj/item/mecha_parts/mecha_equipment/generator/action(target)
+ if(chassis)
+ var/result = load_fuel(target)
+ var/message
if(isnull(result))
- user.visible_message("[user] tries to shove [weapon] into [src]. What a dumb-ass.","[fuel] traces minimal. [weapon] cannot be used as fuel.")
+ message = "[fuel] traces in target minimal. [target] cannot be used as fuel."
else if(!result)
- user << "Unit is full."
+ message = "Unit is full."
else
- user.visible_message("[user] loads [src] with [fuel].","[result] unit\s of [fuel] successfully loaded.")
- return
+ message = "[result] unit\s of [fuel] successfully loaded."
+ send_byjax(chassis.occupant,"exosuit.browser","\ref[src]",src.get_equip_info())
+ occupant_message(message)
+ return
- critfail()
- ..()
- var/turf/simulated/T = get_turf(src)
- if(!T)
- return
- var/datum/gas_mixture/GM = new
- if(prob(10))
- T.assume_gas("phoron", 100, 1500+T0C)
- T.visible_message("The [src] suddenly disgorges a cloud of heated phoron.")
- destroy()
+/obj/item/mecha_parts/mecha_equipment/generator/proc/load_fuel(var/obj/item/stack/material/P)
+ if(P.type == fuel.type && P.amount)
+ var/to_load = max(max_fuel - fuel.amount*fuel.perunit,0)
+ if(to_load)
+ var/units = min(max(round(to_load / P.perunit),1),P.amount)
+ if(units)
+ fuel.amount += units
+ P.use(units)
+ return units
else
- T.assume_gas("phoron", 5, istype(T) ? T.air.temperature : T20C)
- T.visible_message("The [src] suddenly disgorges a cloud of phoron.")
- T.assume_air(GM)
+ return 0
+ return
+
+/obj/item/mecha_parts/mecha_equipment/generator/attackby(weapon,mob/user)
+ var/result = load_fuel(weapon)
+ if(isnull(result))
+ user.visible_message("[user] tries to shove [weapon] into [src]. What a dumb-ass.","[fuel] traces minimal. [weapon] cannot be used as fuel.")
+ else if(!result)
+ user << "Unit is full."
+ else
+ user.visible_message("[user] loads [src] with [fuel].","[result] unit\s of [fuel] successfully loaded.")
+ return
+
+/obj/item/mecha_parts/mecha_equipment/generator/critfail()
+ ..()
+ var/turf/simulated/T = get_turf(src)
+ if(!T)
return
+ var/datum/gas_mixture/GM = new
+ if(prob(10))
+ T.assume_gas("phoron", 100, 1500+T0C)
+ T.visible_message("The [src] suddenly disgorges a cloud of heated phoron.")
+ destroy()
+ else
+ T.assume_gas("phoron", 5, istype(T) ? T.air.temperature : T20C)
+ T.visible_message("The [src] suddenly disgorges a cloud of phoron.")
+ T.assume_air(GM)
+ return
/datum/global_iterator/mecha_generator
- process(var/obj/item/mecha_parts/mecha_equipment/generator/EG)
- if(!EG.chassis)
- stop()
- EG.set_ready_state(1)
- return 0
- if(EG.fuel.amount<=0)
- stop()
- EG.log_message("Deactivated - no fuel.")
- EG.set_ready_state(1)
- return 0
- var/cur_charge = EG.chassis.get_charge()
- if(isnull(cur_charge))
- EG.set_ready_state(1)
- EG.occupant_message("No powercell detected.")
- EG.log_message("Deactivated.")
- stop()
- return 0
- var/use_fuel = EG.fuel_per_cycle_idle
- if(cur_charge[target] succesfully loaded.")
- chassis.log_message("Loaded [O]. Cargo compartment capacity: [cargo_holder.cargo_capacity - cargo_holder.cargo.len]")
- else
- chassis.occupant_message("You must hold still while handling objects.")
- O.anchored = initial(O.anchored)
- else
- chassis.occupant_message("Not enough room in cargo compartment.")
- else
- chassis.occupant_message("[target] is firmly secured.")
+/obj/item/mecha_parts/mecha_equipment/tool/safety_clamp/attach(obj/mecha/M as obj)
+ ..()
+ cargo_holder = M
+ return
- else if(istype(target,/mob/living))
- var/mob/living/M = target
- if(M.stat>1) return
- if(chassis.occupant.a_intent == I_HURT)
- chassis.occupant_message("You obliterate [target] with [src.name], leaving blood and guts everywhere.")
- chassis.visible_message("[chassis] destroys [target] in an unholy fury.")
- if(chassis.occupant.a_intent == I_DISARM)
- chassis.occupant_message("You tear [target]'s limbs off with [src.name].")
- chassis.visible_message("[chassis] rips [target]'s arms off.")
+/obj/item/mecha_parts/mecha_equipment/tool/safety_clamp/action(atom/target)
+ if(!action_checks(target)) return
+ if(!cargo_holder) return
+ if(istype(target,/obj))
+ var/obj/O = target
+ if(!O.anchored)
+ if(cargo_holder.cargo.len < cargo_holder.cargo_capacity)
+ chassis.occupant_message("You lift [target] and start to load it into cargo compartment.")
+ chassis.visible_message("[chassis] lifts [target] and starts to load it into cargo compartment.")
+ set_ready_state(0)
+ chassis.use_power(energy_drain)
+ O.anchored = 1
+ var/T = chassis.loc
+ if(do_after_cooldown(target))
+ if(T == chassis.loc && src == chassis.selected)
+ cargo_holder.cargo += O
+ O.loc = chassis
+ O.anchored = 0
+ chassis.occupant_message("[target] succesfully loaded.")
+ chassis.log_message("Loaded [O]. Cargo compartment capacity: [cargo_holder.cargo_capacity - cargo_holder.cargo.len]")
+ else
+ chassis.occupant_message("You must hold still while handling objects.")
+ O.anchored = initial(O.anchored)
else
- step_away(M,chassis)
- chassis.occupant_message("You smash into [target], sending them flying.")
- chassis.visible_message("[chassis] tosses [target] like a piece of paper.")
- set_ready_state(0)
- chassis.use_power(energy_drain)
- do_after_cooldown()
- return 1
+ chassis.occupant_message("Not enough room in cargo compartment.")
+ else
+ chassis.occupant_message("[target] is firmly secured.")
+
+ else if(istype(target,/mob/living))
+ var/mob/living/M = target
+ if(M.stat>1) return
+ if(chassis.occupant.a_intent == I_HURT)
+ chassis.occupant_message("You obliterate [target] with [src.name], leaving blood and guts everywhere.")
+ chassis.visible_message("[chassis] destroys [target] in an unholy fury.")
+ if(chassis.occupant.a_intent == I_DISARM)
+ chassis.occupant_message("You tear [target]'s limbs off with [src.name].")
+ chassis.visible_message("[chassis] rips [target]'s arms off.")
+ else
+ step_away(M,chassis)
+ chassis.occupant_message("You smash into [target], sending them flying.")
+ chassis.visible_message("[chassis] tosses [target] like a piece of paper.")
+ set_ready_state(0)
+ chassis.use_power(energy_drain)
+ do_after_cooldown()
+ return 1
/obj/item/mecha_parts/mecha_equipment/tool/passenger
name = "passenger compartment"
@@ -1051,6 +1153,9 @@
var/mob/living/carbon/occupant = null
var/door_locked = 1
salvageable = 0
+ allow_duplicate = TRUE
+
+ equip_type = EQUIP_HULL
/obj/item/mecha_parts/mecha_equipment/tool/passenger/destroy()
for(var/atom/movable/AM in src)
diff --git a/code/game/mecha/equipment/weapons/weapons.dm b/code/game/mecha/equipment/weapons/weapons.dm
index e980c8261c..a53c471eb3 100644
--- a/code/game/mecha/equipment/weapons/weapons.dm
+++ b/code/game/mecha/equipment/weapons/weapons.dm
@@ -12,6 +12,8 @@
var/auto_rearm = 0 //Does the weapon reload itself after each shot?
required_type = list(/obj/mecha/combat, /obj/mecha/working/hoverpod/combatpod)
+ equip_type = EQUIP_WEAPON
+
/obj/item/mecha_parts/mecha_equipment/weapon/action_checks(atom/target)
if(projectiles <= 0)
return 0
@@ -45,13 +47,39 @@
if(auto_rearm)
projectiles = projectiles_per_shot
// set_ready_state(0)
+
+ var/target_for_log
+ if(ismob(target))
+ target_for_log = target
+ else
+ target_for_log = "[target.name]"
+
+ add_attack_logs(chassis.occupant,target_for_log,"Fired exosuit weapon [src.name] (MANUAL)")
+
do_after_cooldown()
+
return
/obj/item/mecha_parts/mecha_equipment/weapon/proc/Fire(atom/A, atom/target)
var/obj/item/projectile/P = A
+ P.dispersion = deviation
+ process_accuracy(P, chassis.occupant, target)
P.launch(target)
+/obj/item/mecha_parts/mecha_equipment/weapon/proc/process_accuracy(obj/projectile, mob/living/user, atom/target)
+ var/obj/item/projectile/P = projectile
+ if(!istype(P))
+ return
+
+ P.accuracy -= user.get_accuracy_penalty()
+
+ // Some modifiers make it harder or easier to hit things.
+ for(var/datum/modifier/M in user.modifiers)
+ if(!isnull(M.accuracy))
+ P.accuracy += M.accuracy
+ if(!isnull(M.accuracy_dispersion))
+ P.dispersion = max(P.dispersion + M.accuracy_dispersion, 0)
+
/obj/item/mecha_parts/mecha_equipment/weapon/energy
name = "general energy weapon"
auto_rearm = 1
@@ -59,40 +87,111 @@
/obj/item/mecha_parts/mecha_equipment/weapon/energy/laser
equip_cooldown = 8
name = "\improper CH-PS \"Immolator\" laser"
+ desc = "A laser carbine's firing system mounted on a high-powered exosuit weapon socket."
icon_state = "mecha_laser"
energy_drain = 30
projectile = /obj/item/projectile/beam
fire_sound = 'sound/weapons/Laser.ogg'
+ origin_tech = list(TECH_MATERIAL = 2, TECH_COMBAT = 3, TECH_MAGNET = 3)
+
+/obj/item/mecha_parts/mecha_equipment/weapon/energy/laser/xray
+ equip_cooldown = 6
+ name = "\improper CH-XS \"Penetrator\" laser"
+ desc = "A large, mounted variant of the anti-armor xray rifle."
+ icon_state = "mecha_xray"
+ energy_drain = 150
+ projectile = /obj/item/projectile/beam/xray
+ fire_sound = 'sound/weapons/eluger.ogg'
+
+ origin_tech = list(TECH_MATERIAL = 3, TECH_COMBAT = 3, TECH_PHORON = 3, TECH_POWER = 3)
+
+/obj/item/mecha_parts/mecha_equipment/weapon/energy/laser/xray/rigged
+ equip_cooldown = 12
+ name = "jury-rigged xray rifle"
+ desc = "A modified wormhole modulation array and meson-scanning control system allow this abomination to produce concentrated blasts of xrays."
+ energy_drain = 175
+ icon_state = "mecha_xray-rig"
+
+ equip_type = EQUIP_UTILITY
+
/obj/item/mecha_parts/mecha_equipment/weapon/energy/riggedlaser
- equip_cooldown = 30
+ equip_cooldown = 15
name = "jury-rigged welder-laser"
desc = "While not regulation, this inefficient weapon can be attached to working exo-suits in desperate, or malicious, times."
- icon_state = "mecha_laser"
- energy_drain = 80
+ icon_state = "mecha_laser-rig"
+ energy_drain = 60
projectile = /obj/item/projectile/beam
fire_sound = 'sound/weapons/Laser.ogg'
required_type = list(/obj/mecha/combat, /obj/mecha/working)
+ equip_type = EQUIP_UTILITY
+
+ origin_tech = list(TECH_MATERIAL = 2, TECH_COMBAT = 2, TECH_MAGNET = 2)
+
/obj/item/mecha_parts/mecha_equipment/weapon/energy/laser/heavy
equip_cooldown = 15
name = "\improper CH-LC \"Solaris\" laser cannon"
+ desc = "In the Solaris, the lasing medium is enclosed in a tube lined with plutonium-239 and subjected to extreme neutron flux in a nuclear reactor core. This incredible technology may help YOU achieve high excitation rates with massive laser volumes!"
icon_state = "mecha_laser"
energy_drain = 60
projectile = /obj/item/projectile/beam/heavylaser
fire_sound = 'sound/weapons/lasercannonfire.ogg'
+ origin_tech = list(TECH_MATERIAL = 3, TECH_COMBAT = 4, TECH_MAGNET = 4)
+
+/obj/item/mecha_parts/mecha_equipment/weapon/energy/laser/heavy/rigged
+ equip_cooldown = 25
+ name = "jury-rigged emitter cannon"
+ desc = "While not regulation, this mining tool can be used as an inefficient weapon on working exo-suits in desperate, or malicious, times."
+ icon_state = "mecha_emitter"
+ energy_drain = 80
+ projectile = /obj/item/projectile/beam/heavylaser/fakeemitter
+ fire_sound = 'sound/weapons/emitter.ogg'
+
+ equip_type = EQUIP_UTILITY
+
+ origin_tech = list(TECH_COMBAT = 4, TECH_MAGNET = 4, TECH_PHORON = 3, TECH_ILLEGAL = 1)
+
+/obj/item/mecha_parts/mecha_equipment/weapon/energy/phase
+ equip_cooldown = 6
+ name = "\improper NT-PE \"Scorpio\" phase-emitter"
+ desc = "A specialist energy weapon intended for use against hostile wildlife."
+ description_fluff = "Essentially an Orion mounted inside a modified Gaia case."
+ icon_state = "mecha_phase"
+ energy_drain = 25
+ projectile = /obj/item/projectile/energy/phase/heavy
+ fire_sound = 'sound/weapons/Taser.ogg'
+
+ equip_type = EQUIP_UTILITY
+
+ origin_tech = list(TECH_MATERIAL = 1, TECH_COMBAT = 2, TECH_MAGNET = 2)
+
/obj/item/mecha_parts/mecha_equipment/weapon/energy/ion
equip_cooldown = 40
name = "mkIV ion heavy cannon"
+ desc = "An upscaled variant of anti-mechanical weaponry constructed by NT, such as the EW Halicon."
icon_state = "mecha_ion"
energy_drain = 120
projectile = /obj/item/projectile/ion
fire_sound = 'sound/weapons/Laser.ogg'
+ origin_tech = list(TECH_MATERIAL = 3, TECH_COMBAT = 4, TECH_MAGNET = 4)
+
+/obj/item/mecha_parts/mecha_equipment/weapon/energy/ion/rigged
+ equip_cooldown = 30
+ name = "jury-rigged ion cannon"
+ desc = "A tesla coil modified to amplify an ionic wave, and use it as a projectile."
+ icon_state = "mecha_ion-rig"
+ energy_drain = 100
+ projectile = /obj/item/projectile/ion/pistol
+
+ equip_type = EQUIP_UTILITY
+
/obj/item/mecha_parts/mecha_equipment/weapon/energy/pulse
equip_cooldown = 30
name = "eZ-13 mk2 heavy pulse rifle"
+ desc = "An experimental Anti-Everything weapon."
icon_state = "mecha_pulse"
energy_drain = 120
origin_tech = list(TECH_MATERIAL = 3, TECH_COMBAT = 6, TECH_POWER = 4)
@@ -104,30 +203,42 @@
icon_state = "pulse1_bl"
var/life = 20
- Bump(atom/A)
- A.bullet_act(src, def_zone)
- src.life -= 10
- if(life <= 0)
- qdel(src)
- return
+/obj/item/projectile/beam/pulse/heavy/Bump(atom/A)
+ A.bullet_act(src, def_zone)
+ src.life -= 10
+ if(life <= 0)
+ qdel(src)
+ return
/obj/item/mecha_parts/mecha_equipment/weapon/energy/taser
name = "\improper PBT \"Pacifier\" mounted taser"
+ desc = "A large taser of similar design as those used in standard NT turrets, for use on an Exosuit."
icon_state = "mecha_taser"
energy_drain = 20
equip_cooldown = 8
projectile = /obj/item/projectile/beam/stun
fire_sound = 'sound/weapons/Taser.ogg'
+/obj/item/mecha_parts/mecha_equipment/weapon/energy/taser/rigged
+ name = "jury-rigged static rifle"
+ desc = "A vaguely functional taser analog, inside an extinguisher casing."
+ icon_state = "mecha_taser-rig"
+ energy_drain = 30
+ projectile = /obj/item/projectile/beam/stun/weak
+
+ equip_type = EQUIP_UTILITY
/obj/item/mecha_parts/mecha_equipment/weapon/honker
name = "sound emission device"
+ desc = "A perfectly normal bike-horn, for your exosuit."
icon_state = "mecha_honker"
energy_drain = 300
equip_cooldown = 150
origin_tech = list(TECH_MATERIAL = 2, TECH_COMBAT = 4, TECH_ILLEGAL = 1)
-/obj/item/mecha_parts/mecha_equipment/honker/action(target)
+ equip_type = EQUIP_SPECIAL
+
+/obj/item/mecha_parts/mecha_equipment/weapon/honker/action(target)
if(!chassis)
return 0
if(energy_drain && chassis.get_charge() < energy_drain)
@@ -159,51 +270,98 @@
name = "general ballisic weapon"
var/projectile_energy_cost
- get_equip_info()
- return "[..()]\[[src.projectiles]\][(src.projectiles < initial(src.projectiles))?" - Rearm":null]"
+/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/get_equip_info()
+ return "[..()]\[[src.projectiles]\][(src.projectiles < initial(src.projectiles))?" - Rearm":null]"
- proc/rearm()
- if(projectiles < initial(projectiles))
- var/projectiles_to_add = initial(projectiles) - projectiles
- while(chassis.get_charge() >= projectile_energy_cost && projectiles_to_add)
- projectiles++
- projectiles_to_add--
- chassis.use_power(projectile_energy_cost)
- send_byjax(chassis.occupant,"exosuit.browser","\ref[src]",src.get_equip_info())
- log_message("Rearmed [src.name].")
- return
+/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/proc/rearm()
+ if(projectiles < initial(projectiles))
+ var/projectiles_to_add = initial(projectiles) - projectiles
+ while(chassis.get_charge() >= projectile_energy_cost && projectiles_to_add)
+ projectiles++
+ projectiles_to_add--
+ chassis.use_power(projectile_energy_cost)
+ send_byjax(chassis.occupant,"exosuit.browser","\ref[src]",src.get_equip_info())
+ log_message("Rearmed [src.name].")
+ return
- Topic(href, href_list)
- ..()
- if (href_list["rearm"])
- src.rearm()
- return
+/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/Topic(href, href_list)
+ ..()
+ if (href_list["rearm"])
+ src.rearm()
+ return
+/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/mortar
+ name = "\improper HEP RC 4 \"Skyfall\""
+ desc = "A Hephaestus exosuit-mounted mortar for use on planetary-or-similar bodies."
+ description_info = "This weapon cannot be fired indoors, underground, or on-station."
+ icon_state = "mecha_mortar"
+ equip_cooldown = 30
+ fire_sound = 'sound/weapons/cannon.ogg'
+ fire_volume = 100
+ projectiles = 3
+ deviation = 0.6
+ projectile = /obj/item/projectile/arc/fragmentation/mortar
+ projectile_energy_cost = 600
+
+ origin_tech = list(TECH_MATERIAL = 4, TECH_COMBAT = 5, TECH_ILLEGAL = 3)
+
+/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/mortar/action_checks(atom/target)
+ var/turf/MT = get_turf(chassis)
+ var/turf/TT = get_turf(target)
+ if(!MT.outdoors || !TT.outdoors)
+ to_chat(chassis.occupant, "\The [src]'s control system prevents you from firing due to a blocked firing arc.")
+ return 0
+ return ..()
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/scattershot
name = "\improper LBX AC 10 \"Scattershot\""
+ desc = "A massive shotgun designed to fill a large area with pellets."
icon_state = "mecha_scatter"
equip_cooldown = 20
- projectile = /obj/item/projectile/bullet/pistol/medium
- fire_sound = 'sound/weapons/Gunshot.ogg'
+ projectile = /obj/item/projectile/bullet/pellet/shotgun/flak
+ fire_sound = 'sound/weapons/gunshot/shotgun.ogg'
fire_volume = 80
projectiles = 40
projectiles_per_shot = 4
deviation = 0.7
projectile_energy_cost = 25
+ origin_tech = list(TECH_MATERIAL = 3, TECH_COMBAT = 4)
+
+/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/scattershot/rigged
+ name = "jury-rigged shrapnel cannon"
+ desc = "The remains of some unfortunate RCD now doomed to kill, rather than construct."
+ icon_state = "mecha_scatter-rig"
+ equip_cooldown = 30
+ fire_volume = 100
+ projectiles = 20
+ deviation = 1
+
+ equip_type = EQUIP_UTILITY
+
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/lmg
name = "\improper Ultra AC 2"
+ desc = "A superior version of the standard Solgov Autocannon MK2 design."
icon_state = "mecha_uac2"
equip_cooldown = 10
projectile = /obj/item/projectile/bullet/pistol/medium
fire_sound = 'sound/weapons/machinegun.ogg'
- projectiles = 300
+ projectiles = 30 //10 bursts, matching the Scattershot's 10. Also, conveniently, doesn't eat your powercell when reloading like 300 bullets does.
projectiles_per_shot = 3
deviation = 0.3
projectile_energy_cost = 20
fire_cooldown = 2
+/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/lmg/rigged
+ name = "jury-rigged machinegun"
+ desc = "The cross between a jackhammer and a whole lot of zipguns."
+ icon_state = "mecha_uac2-rig"
+ equip_cooldown = 12
+ projectile = /obj/item/projectile/bullet/pistol
+ deviation = 0.5
+
+ equip_type = EQUIP_UTILITY
+
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack
var/missile_speed = 2
var/missile_range = 30
@@ -213,6 +371,7 @@
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/flare
name = "\improper BNI Flare Launcher"
+ desc = "A flare-gun, but bigger."
icon_state = "mecha_flaregun"
projectile = /obj/item/device/flashlight/flare
fire_sound = 'sound/weapons/tablehit1.ogg'
@@ -224,6 +383,8 @@
missile_range = 15
required_type = /obj/mecha //Why restrict it to just mining or combat mechs?
+ equip_type = EQUIP_UTILITY
+
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/flare/Fire(atom/movable/AM, atom/target, turf/aimloc)
var/obj/item/device/flashlight/flare/fired = AM
fired.ignite()
@@ -231,6 +392,7 @@
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/explosive
name = "\improper SRM-8 missile rack"
+ desc = "A missile battery that holds eight missiles."
icon_state = "mecha_missilerack"
projectile = /obj/item/missile
fire_sound = 'sound/weapons/rpg.ogg'
@@ -248,17 +410,40 @@
icon_state = "missile"
var/primed = null
throwforce = 15
+ var/devastation = 0
+ var/heavy_blast = 1
+ var/light_blast = 2
+ var/flash_blast = 4
- throw_impact(atom/hit_atom)
- if(primed)
- explosion(hit_atom, 0, 1, 2, 4)
- qdel(src)
- else
- ..()
- return
+/obj/item/missile/proc/warhead_special(var/target)
+ explosion(target, devastation, heavy_blast, light_blast, flash_blast)
+ return
-/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/flashbang
+/obj/item/missile/throw_impact(atom/hit_atom)
+ if(primed)
+ warhead_special(hit_atom)
+ qdel(src)
+ else
+ ..()
+ return
+
+/obj/item/missile/light
+ throwforce = 10
+ heavy_blast = 0
+
+/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/explosive/rigged
+ name = "jury-rigged rocket pod"
+ desc = "A series of pipes, tubes, and cables that resembles a rocket pod."
+ icon_state = "mecha_missilerack-rig"
+ projectile = /obj/item/missile/light
+ projectiles = 3
+ projectile_energy_cost = 800
+
+ equip_type = EQUIP_UTILITY
+
+/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/grenade
name = "\improper SGL-6 grenade launcher"
+ desc = "A grenade launcher produced for SWAT use; fires flashbangs."
icon_state = "mecha_grenadelnchr"
projectile = /obj/item/weapon/grenade/flashbang
fire_sound = 'sound/effects/bang.ogg'
@@ -268,22 +453,65 @@
equip_cooldown = 60
var/det_time = 20
-/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/flashbang/Fire(atom/movable/AM, atom/target, turf/aimloc)
- ..()
- var/obj/item/weapon/grenade/flashbang/F = AM
- spawn(det_time)
- F.prime()
+/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/grenade/rigged
+ name = "jury-rigged pneumatic flashlauncher"
+ desc = "A grenade launcher constructed out of estranged blueprints; fires flashbangs."
+ icon_state = "mecha_grenadelnchr-rig"
+ projectiles = 3
+ missile_speed = 1
+ det_time = 25
-/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/flashbang/clusterbang//Because I am a heartless bastard -Sieve
+/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/grenade/Fire(atom/movable/AM, atom/target, turf/aimloc)
+ var/obj/item/weapon/grenade/G = AM
+ if(istype(G))
+ G.det_time = det_time
+ G.activate(chassis.occupant) //Grenades actually look primed and dangerous, handle their own stuff.
+ AM.throw_at(target,missile_range, missile_speed, chassis)
+
+/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/grenade/clusterbang//Because I am a heartless bastard -Sieve
name = "\improper SOP-6 grenade launcher"
+ desc = "A grenade launcher produced for use by government uprising subjugation forces, or that's what you might guess; fires matryoshka flashbangs."
projectile = /obj/item/weapon/grenade/flashbang/clusterbang
-/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/flashbang/clusterbang/limited/get_equip_info()//Limited version of the clusterbang launcher that can't reload
+ origin_tech = list(TECH_COMBAT= 5, TECH_MATERIAL = 5, TECH_ILLEGAL = 3)
+
+/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/grenade/clusterbang/limited/get_equip_info()//Limited version of the clusterbang launcher that can't reload
return "* [chassis.selected==src?"":""][src.name][chassis.selected==src?"":""]\[[src.projectiles]\]"
-/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/flashbang/clusterbang/limited/rearm()
+/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/grenade/clusterbang/limited/rearm()
return//Extra bit of security
+/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/grenade/concussion
+ name = "\improper SGL-9 grenade launcher"
+ desc = "A military-grade grenade launcher that fires disorienting concussion grenades."
+ icon_state = "mecha_grenadelnchr"
+ projectile = /obj/item/weapon/grenade/concussion
+ missile_speed = 1
+ projectile_energy_cost = 900
+ equip_cooldown = 50
+ det_time = 25
+
+ origin_tech = list(TECH_COMBAT = 3, TECH_MATERIAL = 4, TECH_ILLEGAL = 1)
+
+/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/grenade/frag
+ name = "\improper HEP-I 5 grenade launcher"
+ desc = "A military-grade grenade launcher that fires anti-personnel fragmentation grenades."
+ icon_state = "mecha_fraglnchr"
+ projectile = /obj/item/weapon/grenade/explosive
+ projectiles = 4
+ missile_speed = 1
+
+ origin_tech = list(TECH_COMBAT = 5, TECH_ENGINEERING = 5, TECH_MATERIAL = 5, TECH_ILLEGAL = 3)
+
+/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/grenade/frag/mini
+ name = "\improper HEP-MI 6 grenade launcher"
+ desc = "A military-grade grenade launcher that fires miniaturized anti-personnel fragmentation grenades."
+ projectile = /obj/item/weapon/grenade/explosive/mini
+ projectile_energy_cost = 500
+ equip_cooldown = 25
+
+ origin_tech = list(TECH_COMBAT = 4, TECH_ENGINEERING = 2, TECH_MATERIAL = 3, TECH_ILLEGAL = 2)
+
//////////////
//Fire-based//
//////////////
@@ -320,6 +548,7 @@
/obj/item/mecha_parts/mecha_equipment/weapon/energy/flamer/rigged
name = "\improper AA-CR-1 Mark 4"
description_fluff = "A firefighting tool maintained by Aether Atmospherics, whose initial design originated from a small Earth company. This one seems to have been jury rigged."
+ icon_state = "mecha_cremate-rig"
energy_drain = 50
required_type = list(/obj/mecha/combat, /obj/mecha/working)
@@ -328,6 +557,8 @@
origin_tech = list(TECH_MATERIAL = 3, TECH_COMBAT = 3, TECH_PHORON = 3, TECH_ILLEGAL = 2)
+ equip_type = EQUIP_UTILITY
+
//////////////
//Defensive//
//////////////
@@ -343,6 +574,8 @@
var/shock_damage = 15
var/active
+ equip_type = EQUIP_HULL
+
/obj/item/mecha_parts/mecha_equipment/shocker/can_attach(obj/mecha/M as obj)
if(..())
if(!M.proc_res["dynattackby"] && !M.proc_res["dynattackhand"] && !M.proc_res["dynattackalien"])
diff --git a/code/game/mecha/mech_fabricator.dm b/code/game/mecha/mech_fabricator.dm
index 958f31bbd2..c289d79c69 100644
--- a/code/game/mecha/mech_fabricator.dm
+++ b/code/game/mecha/mech_fabricator.dm
@@ -103,7 +103,7 @@
if(current)
data["builtperc"] = round((progress / current.time) * 100)
- ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
+ ui = GLOB.nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if(!ui)
ui = new(user, src, ui_key, "mechfab.tmpl", "Exosuit Fabricator UI", 800, 600)
ui.set_initial_data(data)
diff --git a/code/game/mecha/mech_prosthetics.dm b/code/game/mecha/mech_prosthetics.dm
index c8e1d61179..f6872478e0 100644
--- a/code/game/mecha/mech_prosthetics.dm
+++ b/code/game/mecha/mech_prosthetics.dm
@@ -113,7 +113,7 @@
if(current)
data["builtperc"] = round((progress / current.time) * 100)
- ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
+ ui = GLOB.nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if(!ui)
ui = new(user, src, ui_key, "mechfab.tmpl", "Prosthetics Fab UI", 800, 600)
ui.set_initial_data(data)
@@ -150,7 +150,7 @@
/obj/machinery/pros_fabricator/attackby(var/obj/item/I, var/mob/user)
if(busy)
- user << "\The [src] is busy. Please wait for completion of previous operation."
+ to_chat(user, "\The [src] is busy. Please wait for completion of previous operation.")
return 1
if(default_deconstruction_screwdriver(user, I))
return
@@ -162,20 +162,20 @@
if(istype(I,/obj/item/weapon/disk/limb))
var/obj/item/weapon/disk/limb/D = I
if(!D.company || !(D.company in all_robolimbs))
- user << "This disk seems to be corrupted!"
+ to_chat(user, "This disk seems to be corrupted!")
else
- user << "Installing blueprint files for [D.company]..."
+ to_chat(user, "Installing blueprint files for [D.company]...")
if(do_after(user,50,src))
var/datum/robolimb/R = all_robolimbs[D.company]
R.unavailable_to_build = 0
- user << "Installed [D.company] blueprints!"
+ to_chat(user, "Installed [D.company] blueprints!")
qdel(I)
return
if(istype(I,/obj/item/stack/material))
var/obj/item/stack/material/S = I
if(!(S.material.name in materials))
- user << "The [src] doesn't accept [S.material]!"
+ to_chat(user, "The [src] doesn't accept [S.material]!")
return
var/sname = "[S.name]"
@@ -190,10 +190,10 @@
materials[S.material.name] += amnt
S.use(1)
count++
- user << "You insert [count] [sname] into the fabricator."
+ to_chat(user, "You insert [count] [sname] into the fabricator.")
update_busy()
else
- user << "The fabricator cannot hold more [sname]."
+ to_chat(user, "The fabricator cannot hold more [sname].")
return
diff --git a/code/game/mecha/mech_sensor.dm b/code/game/mecha/mech_sensor.dm
index 5173f182ce..eee1ecefdb 100644
--- a/code/game/mecha/mech_sensor.dm
+++ b/code/game/mecha/mech_sensor.dm
@@ -45,8 +45,8 @@
var/obj/mecha/R = O
if(R && R.occupant)
R.occupant << block_message
- else if(istype(O, /obj/vehicle/train/cargo/engine))
- var/obj/vehicle/train/cargo/engine/E = O
+ else if(istype(O, /obj/vehicle/train/engine))
+ var/obj/vehicle/train/engine/E = O
if(E && E.load && E.is_train_head())
E.load << block_message
diff --git a/code/game/mecha/mecha.dm b/code/game/mecha/mecha.dm
index 360c9e1bbf..d3bdbb4158 100644
--- a/code/game/mecha/mecha.dm
+++ b/code/game/mecha/mecha.dm
@@ -24,6 +24,7 @@
var/dir_in = 2//What direction will the mech face when entered/powered on? Defaults to South.
var/step_energy_drain = 10
var/health = 300 //health is health
+ var/maxhealth = 300 //maxhealth is maxhealth.
var/deflect_chance = 10 //chance to deflect the incoming projectiles, hits, or lesser the effect of ex_act.
//the values in this list show how much damage will pass through, not how much will be absorbed.
var/list/damage_absorption = list("brute"=0.8,"fire"=1.2,"bullet"=0.9,"laser"=1,"energy"=1,"bomb"=1)
@@ -66,8 +67,23 @@
var/list/equipment = new
var/obj/item/mecha_parts/mecha_equipment/selected
- var/max_equip = 3
+ var/max_equip = 2
var/datum/events/events
+//mechaequipt2 stuffs
+ var/list/hull_equipment = new
+ var/list/weapon_equipment = new
+ var/list/utility_equipment = new
+ var/list/universal_equipment = new
+ var/list/special_equipment = new
+ var/max_hull_equip = 2
+ var/max_weapon_equip = 2
+ var/max_utility_equip = 2
+ var/max_universal_equip = 2
+ var/max_special_equip = 1
+//Working exosuit vars
+ var/list/cargo = list()
+ var/cargo_capacity = 3
+
/obj/mecha/drain_power(var/drain_check)
@@ -99,10 +115,24 @@
mechas_list += src //global mech list
return
+/obj/mecha/Exit(atom/movable/O)
+ if(O in cargo)
+ return 0
+ return ..()
+
/obj/mecha/Destroy()
src.go_out()
- for(var/mob/M in src) //Let's just be ultra sure
- M.Move(loc)
+ for(var/mob/M in src) //Be Extra Sure
+ M.forceMove(get_turf(src))
+ M.loc.Entered(M)
+ if(M != src.occupant)
+ step_rand(M)
+ for(var/atom/movable/A in src.cargo)
+ A.forceMove(get_turf(src))
+ var/turf/T = get_turf(A)
+ if(T)
+ T.Entered(A)
+ step_rand(A)
if(loc)
loc.Exited(src)
@@ -112,6 +142,11 @@
if(wreckage)
var/obj/effect/decal/mecha_wreckage/WR = new wreckage(loc)
+ hull_equipment.Cut()
+ weapon_equipment.Cut()
+ utility_equipment.Cut()
+ universal_equipment.Cut()
+ special_equipment.Cut()
for(var/obj/item/mecha_parts/mecha_equipment/E in equipment)
if(E.salvageable && prob(30))
WR.crowbar_salvage += E
@@ -139,11 +174,11 @@
cell = null
internal_tank = null
- qdel_null(pr_int_temp_processor)
- qdel_null(pr_inertial_movement)
- qdel_null(pr_give_air)
- qdel_null(pr_internal_damage)
- qdel_null(spark_system)
+ QDEL_NULL(pr_int_temp_processor)
+ QDEL_NULL(pr_inertial_movement)
+ QDEL_NULL(pr_give_air)
+ QDEL_NULL(pr_internal_damage)
+ QDEL_NULL(spark_system)
mechas_list -= src //global mech list
. = ..()
@@ -360,6 +395,7 @@
return domove(direction)
/obj/mecha/proc/domove(direction)
+
return call((proc_res["dyndomove"]||src), "dyndomove")(direction)
/obj/mecha/proc/dyndomove(direction)
@@ -388,6 +424,12 @@
return 1
return 0
+/obj/mecha/proc/handle_equipment_movement()
+ for(var/obj/item/mecha_parts/mecha_equipment/ME in equipment)
+ if(ME.chassis == src) //Sanity
+ ME.handle_movement_action()
+ return
+
/obj/mecha/proc/mechturn(direction)
set_dir(direction)
playsound(src,'sound/mecha/mechturn.ogg',40,1)
@@ -397,6 +439,7 @@
var/result = step(src,direction)
if(result)
playsound(src,"mechstep",40,1)
+ handle_equipment_movement()
return result
@@ -404,6 +447,7 @@
var/result = step_rand(src)
if(result)
playsound(src,"mechstep",40,1)
+ handle_equipment_movement()
return result
/obj/mecha/Bump(var/atom/obstacle)
@@ -719,7 +763,7 @@
user << "Invalid ID: Access denied."
else
user << "Maintenance protocols disabled by operator."
- else if(istype(W, /obj/item/weapon/wrench))
+ else if(W.is_wrench())
if(state==1)
state = 2
user << "You undo the securing bolts."
@@ -727,7 +771,7 @@
state = 1
user << "You tighten the securing bolts."
return
- else if(istype(W, /obj/item/weapon/crowbar))
+ else if(W.is_crowbar())
if(state==2)
state = 3
user << "You open the hatch to the power unit"
@@ -744,7 +788,7 @@
else
user << "There's not enough wire to finish the task."
return
- else if(istype(W, /obj/item/weapon/screwdriver))
+ else if(W.is_screwdriver())
if(hasInternalDamage(MECHA_INT_TEMP_CONTROL))
clearInternalDamage(MECHA_INT_TEMP_CONTROL)
user << "You repair the damaged temperature controller."
@@ -1348,6 +1392,14 @@
Lights: [lights?"on":"off"]
[src.dna?"DNA-locked:
[src.dna] \[Reset\]
":null]
"}
+//Cargo components.
+ output += "Cargo Compartment Contents:"
+ if(src.cargo.len)
+ for(var/obj/O in src.cargo)
+ output += "
Unload : [O]
"
+ else
+ output += "Nothing"
+ output += "
"
return output
/obj/mecha/proc/get_commands()
@@ -1396,10 +1448,23 @@
output += {"
"}
- for(var/obj/item/mecha_parts/mecha_equipment/W in equipment)
- output += "[W.name]
Detach"
- output += "
Available equipment slots: [max_equip-equipment.len]"
- output += "
"
+ for(var/obj/item/mecha_parts/mecha_equipment/W in hull_equipment)
+ output += "Hull Module: [W.name] Detach
"
+ for(var/obj/item/mecha_parts/mecha_equipment/W in weapon_equipment)
+ output += "Weapon Module: [W.name] Detach
"
+ for(var/obj/item/mecha_parts/mecha_equipment/W in utility_equipment)
+ output += "Utility Module: [W.name] Detach
"
+ for(var/obj/item/mecha_parts/mecha_equipment/W in universal_equipment)
+ output += "Universal Module: [W.name] Detach
"
+ for(var/obj/item/mecha_parts/mecha_equipment/W in special_equipment)
+ output += "Special Module: [W.name] Detach
"
+ output += {"Available hull slots: [max_hull_equip-hull_equipment.len]
+ Available weapon slots: [max_weapon_equip-weapon_equipment.len]
+ Available utility slots: [max_utility_equip-utility_equipment.len]
+ Available universal slots: [max_universal_equip-universal_equipment.len]
+ Available special slots: [max_special_equip-special_equipment.len]
+
+ "}
return output
/obj/mecha/proc/get_equipment_list() //outputs mecha equipment list in html
@@ -1673,6 +1738,17 @@
else
src.occupant_message("Recalibration failed.")
src.log_message("Recalibration of coordination system failed with 1 error.",1)
+ if(href_list["drop_from_cargo"])
+ var/obj/O = locate(href_list["drop_from_cargo"])
+ if(O && O in src.cargo)
+ src.occupant_message("You unload [O].")
+ O.forceMove(get_turf(src))
+ src.cargo -= O
+ var/turf/T = get_turf(O)
+ if(T)
+ T.Entered(O)
+ src.log_message("Unloaded [O]. Cargo compartment capacity: [cargo_capacity - src.cargo.len]")
+ return
//debug
/*
@@ -1810,81 +1886,82 @@
/datum/global_iterator/mecha_tank_give_air
delay = 15
- process(var/obj/mecha/mecha)
- if(mecha.internal_tank)
- var/datum/gas_mixture/tank_air = mecha.internal_tank.return_air()
- var/datum/gas_mixture/cabin_air = mecha.cabin_air
+/datum/global_iterator/mecha_tank_give_air/process(var/obj/mecha/mecha)
+ if(mecha.internal_tank)
+ var/datum/gas_mixture/tank_air = mecha.internal_tank.return_air()
+ var/datum/gas_mixture/cabin_air = mecha.cabin_air
- var/release_pressure = mecha.internal_tank_valve
- var/cabin_pressure = cabin_air.return_pressure()
- var/pressure_delta = min(release_pressure - cabin_pressure, (tank_air.return_pressure() - cabin_pressure)/2)
- var/transfer_moles = 0
- if(pressure_delta > 0) //cabin pressure lower than release pressure
- if(tank_air.temperature > 0)
- transfer_moles = pressure_delta*cabin_air.volume/(cabin_air.temperature * R_IDEAL_GAS_EQUATION)
- var/datum/gas_mixture/removed = tank_air.remove(transfer_moles)
- cabin_air.merge(removed)
- else if(pressure_delta < 0) //cabin pressure higher than release pressure
- var/datum/gas_mixture/t_air = mecha.get_turf_air()
- pressure_delta = cabin_pressure - release_pressure
+ var/release_pressure = mecha.internal_tank_valve
+ var/cabin_pressure = cabin_air.return_pressure()
+ var/pressure_delta = min(release_pressure - cabin_pressure, (tank_air.return_pressure() - cabin_pressure)/2)
+ var/transfer_moles = 0
+ if(pressure_delta > 0) //cabin pressure lower than release pressure
+ if(tank_air.temperature > 0)
+ transfer_moles = pressure_delta*cabin_air.volume/(cabin_air.temperature * R_IDEAL_GAS_EQUATION)
+ var/datum/gas_mixture/removed = tank_air.remove(transfer_moles)
+ cabin_air.merge(removed)
+ else if(pressure_delta < 0) //cabin pressure higher than release pressure
+ var/datum/gas_mixture/t_air = mecha.get_turf_air()
+ pressure_delta = cabin_pressure - release_pressure
+ if(t_air)
+ pressure_delta = min(cabin_pressure - t_air.return_pressure(), pressure_delta)
+ if(pressure_delta > 0) //if location pressure is lower than cabin pressure
+ transfer_moles = pressure_delta*cabin_air.volume/(cabin_air.temperature * R_IDEAL_GAS_EQUATION)
+ var/datum/gas_mixture/removed = cabin_air.remove(transfer_moles)
if(t_air)
- pressure_delta = min(cabin_pressure - t_air.return_pressure(), pressure_delta)
- if(pressure_delta > 0) //if location pressure is lower than cabin pressure
- transfer_moles = pressure_delta*cabin_air.volume/(cabin_air.temperature * R_IDEAL_GAS_EQUATION)
- var/datum/gas_mixture/removed = cabin_air.remove(transfer_moles)
- if(t_air)
- t_air.merge(removed)
- else //just delete the cabin gas, we're in space or some shit
- qdel(removed)
- else
- return stop()
- return
+ t_air.merge(removed)
+ else //just delete the cabin gas, we're in space or some shit
+ qdel(removed)
+ else
+ return stop()
+ return
/datum/global_iterator/mecha_intertial_movement //inertial movement in space
delay = 7
- process(var/obj/mecha/mecha as obj,direction)
- if(direction)
- if(!step(mecha, direction)||mecha.check_for_support())
- src.stop()
- else
+/datum/global_iterator/mecha_intertial_movement/process(var/obj/mecha/mecha as obj,direction)
+ if(direction)
+ if(!step(mecha, direction)||mecha.check_for_support())
src.stop()
- return
+ mecha.handle_equipment_movement()
+ else
+ src.stop()
+ return
/datum/global_iterator/mecha_internal_damage // processing internal damage
- process(var/obj/mecha/mecha)
- if(!mecha.hasInternalDamage())
- return stop()
- if(mecha.hasInternalDamage(MECHA_INT_FIRE))
- if(!mecha.hasInternalDamage(MECHA_INT_TEMP_CONTROL) && prob(5))
- mecha.clearInternalDamage(MECHA_INT_FIRE)
- if(mecha.internal_tank)
- if(mecha.internal_tank.return_pressure()>mecha.internal_tank.maximum_pressure && !(mecha.hasInternalDamage(MECHA_INT_TANK_BREACH)))
- mecha.setInternalDamage(MECHA_INT_TANK_BREACH)
- var/datum/gas_mixture/int_tank_air = mecha.internal_tank.return_air()
- if(int_tank_air && int_tank_air.volume>0) //heat the air_contents
- int_tank_air.temperature = min(6000+T0C, int_tank_air.temperature+rand(10,15))
- if(mecha.cabin_air && mecha.cabin_air.volume>0)
- mecha.cabin_air.temperature = min(6000+T0C, mecha.cabin_air.temperature+rand(10,15))
- if(mecha.cabin_air.temperature>mecha.max_temperature/2)
- mecha.take_damage(4/round(mecha.max_temperature/mecha.cabin_air.temperature,0.1),"fire")
- if(mecha.hasInternalDamage(MECHA_INT_TEMP_CONTROL)) //stop the mecha_preserve_temp loop datum
- mecha.pr_int_temp_processor.stop()
- if(mecha.hasInternalDamage(MECHA_INT_TANK_BREACH)) //remove some air from internal tank
- if(mecha.internal_tank)
- var/datum/gas_mixture/int_tank_air = mecha.internal_tank.return_air()
- var/datum/gas_mixture/leaked_gas = int_tank_air.remove_ratio(0.10)
- if(mecha.loc && hascall(mecha.loc,"assume_air"))
- mecha.loc.assume_air(leaked_gas)
- else
- qdel(leaked_gas)
- if(mecha.hasInternalDamage(MECHA_INT_SHORT_CIRCUIT))
- if(mecha.get_charge())
- mecha.spark_system.start()
- mecha.cell.charge -= min(20,mecha.cell.charge)
- mecha.cell.maxcharge -= min(20,mecha.cell.maxcharge)
- return
+/datum/global_iterator/mecha_internal_damage/process(var/obj/mecha/mecha)
+ if(!mecha.hasInternalDamage())
+ return stop()
+ if(mecha.hasInternalDamage(MECHA_INT_FIRE))
+ if(!mecha.hasInternalDamage(MECHA_INT_TEMP_CONTROL) && prob(5))
+ mecha.clearInternalDamage(MECHA_INT_FIRE)
+ if(mecha.internal_tank)
+ if(mecha.internal_tank.return_pressure()>mecha.internal_tank.maximum_pressure && !(mecha.hasInternalDamage(MECHA_INT_TANK_BREACH)))
+ mecha.setInternalDamage(MECHA_INT_TANK_BREACH)
+ var/datum/gas_mixture/int_tank_air = mecha.internal_tank.return_air()
+ if(int_tank_air && int_tank_air.volume>0) //heat the air_contents
+ int_tank_air.temperature = min(6000+T0C, int_tank_air.temperature+rand(10,15))
+ if(mecha.cabin_air && mecha.cabin_air.volume>0)
+ mecha.cabin_air.temperature = min(6000+T0C, mecha.cabin_air.temperature+rand(10,15))
+ if(mecha.cabin_air.temperature>mecha.max_temperature/2)
+ mecha.take_damage(4/round(mecha.max_temperature/mecha.cabin_air.temperature,0.1),"fire")
+ if(mecha.hasInternalDamage(MECHA_INT_TEMP_CONTROL)) //stop the mecha_preserve_temp loop datum
+ mecha.pr_int_temp_processor.stop()
+ if(mecha.hasInternalDamage(MECHA_INT_TANK_BREACH)) //remove some air from internal tank
+ if(mecha.internal_tank)
+ var/datum/gas_mixture/int_tank_air = mecha.internal_tank.return_air()
+ var/datum/gas_mixture/leaked_gas = int_tank_air.remove_ratio(0.10)
+ if(mecha.loc && hascall(mecha.loc,"assume_air"))
+ mecha.loc.assume_air(leaked_gas)
+ else
+ qdel(leaked_gas)
+ if(mecha.hasInternalDamage(MECHA_INT_SHORT_CIRCUIT))
+ if(mecha.get_charge())
+ mecha.spark_system.start()
+ mecha.cell.charge -= min(20,mecha.cell.charge)
+ mecha.cell.maxcharge -= min(20,mecha.cell.maxcharge)
+ return
/////////////
diff --git a/code/game/mecha/mecha_construction_paths.dm b/code/game/mecha/mecha_construction_paths.dm
index 98e81cb83f..ce5b751e55 100644
--- a/code/game/mecha/mecha_construction_paths.dm
+++ b/code/game/mecha/mecha_construction_paths.dm
@@ -2,71 +2,73 @@
///// Construction datums //////
////////////////////////////////
-/datum/construction/mecha/custom_action(step, atom/used_atom, mob/user)
- if(istype(used_atom, /obj/item/weapon/weldingtool))
- var/obj/item/weapon/weldingtool/W = used_atom
+/datum/construction/mecha/custom_action(step, obj/item/I, mob/user)
+ if(istype(I, /obj/item/weapon/weldingtool))
+ var/obj/item/weapon/weldingtool/W = I
if (W.remove_fuel(0, user))
playsound(holder, 'sound/items/Welder2.ogg', 50, 1)
else
return 0
- else if(istype(used_atom, /obj/item/weapon/wrench))
+ else if(I.is_wrench())
playsound(holder, 'sound/items/Ratchet.ogg', 50, 1)
- else if(istype(used_atom, /obj/item/weapon/screwdriver))
+ else if(I.is_screwdriver())
playsound(holder, 'sound/items/Screwdriver.ogg', 50, 1)
- else if(istype(used_atom, /obj/item/weapon/wirecutters))
+ else if(I.is_wirecutter())
playsound(holder, 'sound/items/Wirecutter.ogg', 50, 1)
- else if(istype(used_atom, /obj/item/stack/cable_coil))
- var/obj/item/stack/cable_coil/C = used_atom
+ else if(istype(I, /obj/item/stack/cable_coil))
+ var/obj/item/stack/cable_coil/C = I
if(C.use(4))
playsound(holder, 'sound/items/Deconstruct.ogg', 50, 1)
else
- user << ("There's not enough cable to finish the task.")
+ to_chat(user, "There's not enough cable to finish the task.")
return 0
- else if(istype(used_atom, /obj/item/stack))
- var/obj/item/stack/S = used_atom
+ else if(istype(I, /obj/item/stack))
+ var/obj/item/stack/S = I
if(S.get_amount() < 5)
- user << ("There's not enough material in this stack.")
+ to_chat(user, "There's not enough material in this stack.")
return 0
else
S.use(5)
return 1
-/datum/construction/reversible/mecha/custom_action(index as num, diff as num, atom/used_atom, mob/user as mob)
- if(istype(used_atom, /obj/item/weapon/weldingtool))
- var/obj/item/weapon/weldingtool/W = used_atom
+/datum/construction/reversible/mecha/custom_action(index as num, diff as num, obj/item/I, mob/user as mob)
+ if(istype(I, /obj/item/weapon/weldingtool))
+ var/obj/item/weapon/weldingtool/W = I
if (W.remove_fuel(0, user))
playsound(holder, 'sound/items/Welder2.ogg', 50, 1)
else
return 0
- else if(istype(used_atom, /obj/item/weapon/wrench))
+ else if(I.is_wrench())
playsound(holder, 'sound/items/Ratchet.ogg', 50, 1)
- else if(istype(used_atom, /obj/item/weapon/screwdriver))
+ else if(I.is_screwdriver())
playsound(holder, 'sound/items/Screwdriver.ogg', 50, 1)
- else if(istype(used_atom, /obj/item/weapon/wirecutters))
+ else if(I.is_wirecutter())
playsound(holder, 'sound/items/Wirecutter.ogg', 50, 1)
- else if(istype(used_atom, /obj/item/stack/cable_coil))
- var/obj/item/stack/cable_coil/C = used_atom
+ else if(istype(I, /obj/item/stack/cable_coil))
+ var/obj/item/stack/cable_coil/C = I
if(C.use(4))
playsound(holder, 'sound/items/Deconstruct.ogg', 50, 1)
else
- user << ("There's not enough cable to finish the task.")
+ to_chat(user, "There's not enough cable to finish the task.")
return 0
- else if(istype(used_atom, /obj/item/stack))
- var/obj/item/stack/S = used_atom
+ else if(istype(I, /obj/item/stack))
+ var/obj/item/stack/S = I
if(S.get_amount() < 5)
- user << ("There's not enough material in this stack.")
+ to_chat(user, "There's not enough material in this stack.")
return 0
else
S.use(5)
return 1
-
+//////////////////////
+// Ripley
+//////////////////////
/datum/construction/mecha/ripley_chassis
steps = list(list("key"=/obj/item/mecha_parts/part/ripley_torso),//1
list("key"=/obj/item/mecha_parts/part/ripley_left_arm),//2
@@ -75,25 +77,25 @@
list("key"=/obj/item/mecha_parts/part/ripley_right_leg)//5
)
- custom_action(step, atom/used_atom, mob/user)
- user.visible_message("[user] has connected [used_atom] to [holder].", "You connect [used_atom] to [holder]")
- holder.overlays += used_atom.icon_state+"+o"
- qdel(used_atom)
- return 1
+/datum/construction/mecha/ripley_chassis/custom_action(step, obj/item/I, mob/user)
+ user.visible_message("[user] has connected [I] to [holder].", "You connect [I] to [holder]")
+ holder.overlays += I.icon_state+"+o"
+ qdel(I)
+ return 1
- action(atom/used_atom,mob/user as mob)
- return check_all_steps(used_atom,user)
+/datum/construction/mecha/ripley_chassis/action(obj/item/I,mob/user as mob)
+ return check_all_steps(I,user)
- spawn_result()
- var/obj/item/mecha_parts/chassis/const_holder = holder
- const_holder.construct = new /datum/construction/reversible/mecha/ripley(const_holder)
- const_holder.icon = 'icons/mecha/mech_construction.dmi'
- const_holder.icon_state = "ripley0"
- const_holder.density = 1
- const_holder.overlays.len = 0
- spawn()
- qdel(src)
- return
+/datum/construction/mecha/ripley_chassis/spawn_result()
+ var/obj/item/mecha_parts/chassis/const_holder = holder
+ const_holder.construct = new /datum/construction/reversible/mecha/ripley(const_holder)
+ const_holder.icon = 'icons/mecha/mech_construction.dmi'
+ const_holder.icon_state = "ripley0"
+ const_holder.density = 1
+ const_holder.overlays.len = 0
+ spawn()
+ qdel(src)
+ return
/datum/construction/reversible/mecha/ripley
@@ -101,11 +103,11 @@
steps = list(
//1
list("key"=/obj/item/weapon/weldingtool,
- "backkey"=/obj/item/weapon/wrench,
+ "backkey"=IS_WRENCH,
"desc"="External armor is wrenched."),
//2
- list("key"=/obj/item/weapon/wrench,
- "backkey"=/obj/item/weapon/crowbar,
+ list("key"=IS_WRENCH,
+ "backkey"=IS_CROWBAR,
"desc"="External armor is installed."),
//3
list("key"=/obj/item/stack/material/plasteel,
@@ -113,170 +115,171 @@
"desc"="Internal armor is welded."),
//4
list("key"=/obj/item/weapon/weldingtool,
- "backkey"=/obj/item/weapon/wrench,
+ "backkey"=IS_WRENCH,
"desc"="Internal armor is wrenched"),
//5
- list("key"=/obj/item/weapon/wrench,
- "backkey"=/obj/item/weapon/crowbar,
+ list("key"=IS_WRENCH,
+ "backkey"=IS_CROWBAR,
"desc"="Internal armor is installed"),
//6
list("key"=/obj/item/stack/material/steel,
- "backkey"=/obj/item/weapon/screwdriver,
+ "backkey"=IS_SCREWDRIVER,
"desc"="Peripherals control module is secured"),
//7
- list("key"=/obj/item/weapon/screwdriver,
- "backkey"=/obj/item/weapon/crowbar,
+ list("key"=IS_SCREWDRIVER,
+ "backkey"=IS_CROWBAR,
"desc"="Peripherals control module is installed"),
//8
list("key"=/obj/item/weapon/circuitboard/mecha/ripley/peripherals,
- "backkey"=/obj/item/weapon/screwdriver,
+ "backkey"=IS_SCREWDRIVER,
"desc"="Central control module is secured"),
//9
- list("key"=/obj/item/weapon/screwdriver,
- "backkey"=/obj/item/weapon/crowbar,
+ list("key"=IS_SCREWDRIVER,
+ "backkey"=IS_CROWBAR,
"desc"="Central control module is installed"),
//10
list("key"=/obj/item/weapon/circuitboard/mecha/ripley/main,
- "backkey"=/obj/item/weapon/screwdriver,
+ "backkey"=IS_SCREWDRIVER,
"desc"="The wiring is adjusted"),
//11
- list("key"=/obj/item/weapon/wirecutters,
- "backkey"=/obj/item/weapon/screwdriver,
+ list("key"=IS_WIRECUTTER,
+ "backkey"=IS_SCREWDRIVER,
"desc"="The wiring is added"),
//12
list("key"=/obj/item/stack/cable_coil,
- "backkey"=/obj/item/weapon/screwdriver,
+ "backkey"=IS_SCREWDRIVER,
"desc"="The hydraulic systems are active."),
//13
- list("key"=/obj/item/weapon/screwdriver,
- "backkey"=/obj/item/weapon/wrench,
+ list("key"=IS_SCREWDRIVER,
+ "backkey"=IS_WRENCH,
"desc"="The hydraulic systems are connected."),
//14
- list("key"=/obj/item/weapon/wrench,
+ list("key"=IS_WRENCH,
"desc"="The hydraulic systems are disconnected.")
)
- action(atom/used_atom,mob/user as mob)
- return check_step(used_atom,user)
+/datum/construction/reversible/mecha/ripley/action(obj/item/I,mob/user as mob)
+ return check_step(I,user)
- custom_action(index, diff, atom/used_atom, mob/user)
- if(!..())
- return 0
+/datum/construction/reversible/mecha/ripley/custom_action(index, diff, obj/item/I, mob/user)
+ if(!..())
+ return 0
- //TODO: better messages.
- switch(index)
- if(14)
- user.visible_message("[user] connects [holder] hydraulic systems", "You connect [holder] hydraulic systems.")
+ //TODO: better messages.
+ switch(index)
+ if(14)
+ user.visible_message("[user] connects [holder] hydraulic systems", "You connect [holder] hydraulic systems.")
+ holder.icon_state = "ripley1"
+ if(13)
+ if(diff==FORWARD)
+ user.visible_message("[user] activates [holder] hydraulic systems.", "You activate [holder] hydraulic systems.")
+ holder.icon_state = "ripley2"
+ else
+ user.visible_message("[user] disconnects [holder] hydraulic systems", "You disconnect [holder] hydraulic systems.")
+ holder.icon_state = "ripley0"
+ if(12)
+ if(diff==FORWARD)
+ user.visible_message("[user] adds the wiring to [holder].", "You add the wiring to [holder].")
+ holder.icon_state = "ripley3"
+ else
+ user.visible_message("[user] deactivates [holder] hydraulic systems.", "You deactivate [holder] hydraulic systems.")
holder.icon_state = "ripley1"
- if(13)
- if(diff==FORWARD)
- user.visible_message("[user] activates [holder] hydraulic systems.", "You activate [holder] hydraulic systems.")
- holder.icon_state = "ripley2"
- else
- user.visible_message("[user] disconnects [holder] hydraulic systems", "You disconnect [holder] hydraulic systems.")
- holder.icon_state = "ripley0"
- if(12)
- if(diff==FORWARD)
- user.visible_message("[user] adds the wiring to [holder].", "You add the wiring to [holder].")
- holder.icon_state = "ripley3"
- else
- user.visible_message("[user] deactivates [holder] hydraulic systems.", "You deactivate [holder] hydraulic systems.")
- holder.icon_state = "ripley1"
- if(11)
- if(diff==FORWARD)
- user.visible_message("[user] adjusts the wiring of [holder].", "You adjust the wiring of [holder].")
- holder.icon_state = "ripley4"
- else
- user.visible_message("[user] removes the wiring from [holder].", "You remove the wiring from [holder].")
- var/obj/item/stack/cable_coil/coil = new /obj/item/stack/cable_coil(get_turf(holder))
- coil.amount = 4
- holder.icon_state = "ripley2"
- if(10)
- if(diff==FORWARD)
- user.visible_message("[user] installs the central control module into [holder].", "You install the central computer mainboard into [holder].")
- qdel(used_atom)
- holder.icon_state = "ripley5"
- else
- user.visible_message("[user] disconnects the wiring of [holder].", "You disconnect the wiring of [holder].")
- holder.icon_state = "ripley3"
- if(9)
- if(diff==FORWARD)
- user.visible_message("[user] secures the mainboard.", "You secure the mainboard.")
- holder.icon_state = "ripley6"
- else
- user.visible_message("[user] removes the central control module from [holder].", "You remove the central computer mainboard from [holder].")
- new /obj/item/weapon/circuitboard/mecha/ripley/main(get_turf(holder))
- holder.icon_state = "ripley4"
- if(8)
- if(diff==FORWARD)
- user.visible_message("[user] installs the peripherals control module into [holder].", "You install the peripherals control module into [holder].")
- qdel(used_atom)
- holder.icon_state = "ripley7"
- else
- user.visible_message("[user] unfastens the mainboard.", "You unfasten the mainboard.")
- holder.icon_state = "ripley5"
- if(7)
- if(diff==FORWARD)
- user.visible_message("[user] secures the peripherals control module.", "You secure the peripherals control module.")
- holder.icon_state = "ripley8"
- else
- user.visible_message("[user] removes the peripherals control module from [holder].", "You remove the peripherals control module from [holder].")
- new /obj/item/weapon/circuitboard/mecha/ripley/peripherals(get_turf(holder))
- holder.icon_state = "ripley6"
- if(6)
- if(diff==FORWARD)
- user.visible_message("[user] installs internal armor layer to [holder].", "You install internal armor layer to [holder].")
- holder.icon_state = "ripley9"
- else
- user.visible_message("[user] unfastens the peripherals control module.", "You unfasten the peripherals control module.")
- holder.icon_state = "ripley7"
- if(5)
- if(diff==FORWARD)
- user.visible_message("[user] secures internal armor layer.", "You secure internal armor layer.")
- holder.icon_state = "ripley10"
- else
- user.visible_message("[user] pries internal armor layer from [holder].", "You prie internal armor layer from [holder].")
- var/obj/item/stack/material/steel/MS = new /obj/item/stack/material/steel(get_turf(holder))
- MS.amount = 5
- holder.icon_state = "ripley8"
- if(4)
- if(diff==FORWARD)
- user.visible_message("[user] welds internal armor layer to [holder].", "You weld the internal armor layer to [holder].")
- holder.icon_state = "ripley11"
- else
- user.visible_message("[user] unfastens the internal armor layer.", "You unfasten the internal armor layer.")
- holder.icon_state = "ripley9"
- if(3)
- if(diff==FORWARD)
- user.visible_message("[user] installs external reinforced armor layer to [holder].", "You install external reinforced armor layer to [holder].")
- holder.icon_state = "ripley12"
- else
- user.visible_message("[user] cuts internal armor layer from [holder].", "You cut the internal armor layer from [holder].")
- holder.icon_state = "ripley10"
- if(2)
- if(diff==FORWARD)
- user.visible_message("[user] secures external armor layer.", "You secure external reinforced armor layer.")
- holder.icon_state = "ripley13"
- else
- user.visible_message("[user] pries external armor layer from [holder].", "You prie external armor layer from [holder].")
- var/obj/item/stack/material/plasteel/MS = new /obj/item/stack/material/plasteel(get_turf(holder))
- MS.amount = 5
- holder.icon_state = "ripley11"
- if(1)
- if(diff==FORWARD)
- user.visible_message("[user] welds external armor layer to [holder].", "You weld external armor layer to [holder].")
- else
- user.visible_message("[user] unfastens the external armor layer.", "You unfasten the external armor layer.")
- holder.icon_state = "ripley12"
- return 1
-
- spawn_result()
- ..()
- feedback_inc("mecha_ripley_created",1)
- return
-
+ if(11)
+ if(diff==FORWARD)
+ user.visible_message("[user] adjusts the wiring of [holder].", "You adjust the wiring of [holder].")
+ holder.icon_state = "ripley4"
+ else
+ user.visible_message("[user] removes the wiring from [holder].", "You remove the wiring from [holder].")
+ var/obj/item/stack/cable_coil/coil = new /obj/item/stack/cable_coil(get_turf(holder))
+ coil.amount = 4
+ holder.icon_state = "ripley2"
+ if(10)
+ if(diff==FORWARD)
+ user.visible_message("[user] installs the central control module into [holder].", "You install the central computer mainboard into [holder].")
+ qdel(I)
+ holder.icon_state = "ripley5"
+ else
+ user.visible_message("[user] disconnects the wiring of [holder].", "You disconnect the wiring of [holder].")
+ holder.icon_state = "ripley3"
+ if(9)
+ if(diff==FORWARD)
+ user.visible_message("[user] secures the mainboard.", "You secure the mainboard.")
+ holder.icon_state = "ripley6"
+ else
+ user.visible_message("[user] removes the central control module from [holder].", "You remove the central computer mainboard from [holder].")
+ new /obj/item/weapon/circuitboard/mecha/ripley/main(get_turf(holder))
+ holder.icon_state = "ripley4"
+ if(8)
+ if(diff==FORWARD)
+ user.visible_message("[user] installs the peripherals control module into [holder].", "You install the peripherals control module into [holder].")
+ qdel(I)
+ holder.icon_state = "ripley7"
+ else
+ user.visible_message("[user] unfastens the mainboard.", "You unfasten the mainboard.")
+ holder.icon_state = "ripley5"
+ if(7)
+ if(diff==FORWARD)
+ user.visible_message("[user] secures the peripherals control module.", "You secure the peripherals control module.")
+ holder.icon_state = "ripley8"
+ else
+ user.visible_message("[user] removes the peripherals control module from [holder].", "You remove the peripherals control module from [holder].")
+ new /obj/item/weapon/circuitboard/mecha/ripley/peripherals(get_turf(holder))
+ holder.icon_state = "ripley6"
+ if(6)
+ if(diff==FORWARD)
+ user.visible_message("[user] installs internal armor layer to [holder].", "You install internal armor layer to [holder].")
+ holder.icon_state = "ripley9"
+ else
+ user.visible_message("[user] unfastens the peripherals control module.", "You unfasten the peripherals control module.")
+ holder.icon_state = "ripley7"
+ if(5)
+ if(diff==FORWARD)
+ user.visible_message("[user] secures internal armor layer.", "You secure internal armor layer.")
+ holder.icon_state = "ripley10"
+ else
+ user.visible_message("[user] pries internal armor layer from [holder].", "You prie internal armor layer from [holder].")
+ var/obj/item/stack/material/steel/MS = new /obj/item/stack/material/steel(get_turf(holder))
+ MS.amount = 5
+ holder.icon_state = "ripley8"
+ if(4)
+ if(diff==FORWARD)
+ user.visible_message("[user] welds internal armor layer to [holder].", "You weld the internal armor layer to [holder].")
+ holder.icon_state = "ripley11"
+ else
+ user.visible_message("[user] unfastens the internal armor layer.", "You unfasten the internal armor layer.")
+ holder.icon_state = "ripley9"
+ if(3)
+ if(diff==FORWARD)
+ user.visible_message("[user] installs external reinforced armor layer to [holder].", "You install external reinforced armor layer to [holder].")
+ holder.icon_state = "ripley12"
+ else
+ user.visible_message("[user] cuts internal armor layer from [holder].", "You cut the internal armor layer from [holder].")
+ holder.icon_state = "ripley10"
+ if(2)
+ if(diff==FORWARD)
+ user.visible_message("[user] secures external armor layer.", "You secure external reinforced armor layer.")
+ holder.icon_state = "ripley13"
+ else
+ user.visible_message("[user] pries external armor layer from [holder].", "You prie external armor layer from [holder].")
+ var/obj/item/stack/material/plasteel/MS = new /obj/item/stack/material/plasteel(get_turf(holder))
+ MS.amount = 5
+ holder.icon_state = "ripley11"
+ if(1)
+ if(diff==FORWARD)
+ user.visible_message("[user] welds external armor layer to [holder].", "You weld external armor layer to [holder].")
+ else
+ user.visible_message("[user] unfastens the external armor layer.", "You unfasten the external armor layer.")
+ holder.icon_state = "ripley12"
+ return 1
+/datum/construction/reversible/mecha/ripley/spawn_result()
+ ..()
+ feedback_inc("mecha_ripley_created",1)
+ return
+//////////////////////
+// Gygax
+//////////////////////
/datum/construction/mecha/gygax_chassis
steps = list(list("key"=/obj/item/mecha_parts/part/gygax_torso),//1
list("key"=/obj/item/mecha_parts/part/gygax_left_arm),//2
@@ -286,24 +289,24 @@
list("key"=/obj/item/mecha_parts/part/gygax_head)
)
- custom_action(step, atom/used_atom, mob/user)
- user.visible_message("[user] has connected [used_atom] to [holder].", "You connect [used_atom] to [holder]")
- holder.overlays += used_atom.icon_state+"+o"
- qdel(used_atom)
- return 1
+/datum/construction/mecha/gygax_chassis/custom_action(step, obj/item/I, mob/user)
+ user.visible_message("[user] has connected [I] to [holder].", "You connect [I] to [holder]")
+ holder.overlays += I.icon_state+"+o"
+ qdel(I)
+ return 1
- action(atom/used_atom,mob/user as mob)
- return check_all_steps(used_atom,user)
+/datum/construction/mecha/gygax_chassis/action(obj/item/I,mob/user as mob)
+ return check_all_steps(I,user)
- spawn_result()
- var/obj/item/mecha_parts/chassis/const_holder = holder
- const_holder.construct = new /datum/construction/reversible/mecha/gygax(const_holder)
- const_holder.icon = 'icons/mecha/mech_construction.dmi'
- const_holder.icon_state = "gygax0"
- const_holder.density = 1
- spawn()
- qdel(src)
- return
+/datum/construction/mecha/gygax_chassis/spawn_result()
+ var/obj/item/mecha_parts/chassis/const_holder = holder
+ const_holder.construct = new /datum/construction/reversible/mecha/gygax(const_holder)
+ const_holder.icon = 'icons/mecha/mech_construction.dmi'
+ const_holder.icon_state = "gygax0"
+ const_holder.density = 1
+ spawn()
+ qdel(src)
+ return
/datum/construction/reversible/mecha/gygax
@@ -311,11 +314,11 @@
steps = list(
//1
list("key"=/obj/item/weapon/weldingtool,
- "backkey"=/obj/item/weapon/wrench,
+ "backkey"=IS_WRENCH,
"desc"="External armor is wrenched."),
//2
- list("key"=/obj/item/weapon/wrench,
- "backkey"=/obj/item/weapon/crowbar,
+ list("key"=IS_WRENCH,
+ "backkey"=IS_CROWBAR,
"desc"="External armor is installed."),
//3
list("key"=/obj/item/mecha_parts/part/gygax_armour,
@@ -323,240 +326,243 @@
"desc"="Internal armor is welded."),
//4
list("key"=/obj/item/weapon/weldingtool,
- "backkey"=/obj/item/weapon/wrench,
+ "backkey"=IS_WRENCH,
"desc"="Internal armor is wrenched"),
//5
- list("key"=/obj/item/weapon/wrench,
- "backkey"=/obj/item/weapon/crowbar,
+ list("key"=IS_WRENCH,
+ "backkey"=IS_CROWBAR,
"desc"="Internal armor is installed"),
//6
list("key"=/obj/item/stack/material/steel,
- "backkey"=/obj/item/weapon/screwdriver,
+ "backkey"=IS_SCREWDRIVER,
"desc"="Advanced capacitor is secured"),
//7
- list("key"=/obj/item/weapon/screwdriver,
- "backkey"=/obj/item/weapon/crowbar,
+ list("key"=IS_SCREWDRIVER,
+ "backkey"=IS_CROWBAR,
"desc"="Advanced capacitor is installed"),
//8
list("key"=/obj/item/weapon/stock_parts/capacitor/adv,
- "backkey"=/obj/item/weapon/screwdriver,
+ "backkey"=IS_SCREWDRIVER,
"desc"="Advanced scanner module is secured"),
//9
- list("key"=/obj/item/weapon/screwdriver,
- "backkey"=/obj/item/weapon/crowbar,
+ list("key"=IS_SCREWDRIVER,
+ "backkey"=IS_CROWBAR,
"desc"="Advanced scanner module is installed"),
//10
list("key"=/obj/item/weapon/stock_parts/scanning_module/adv,
- "backkey"=/obj/item/weapon/screwdriver,
+ "backkey"=IS_SCREWDRIVER,
"desc"="Targeting module is secured"),
//11
- list("key"=/obj/item/weapon/screwdriver,
- "backkey"=/obj/item/weapon/crowbar,
+ list("key"=IS_SCREWDRIVER,
+ "backkey"=IS_CROWBAR,
"desc"="Targeting module is installed"),
//12
list("key"=/obj/item/weapon/circuitboard/mecha/gygax/targeting,
- "backkey"=/obj/item/weapon/screwdriver,
+ "backkey"=IS_SCREWDRIVER,
"desc"="Peripherals control module is secured"),
//13
- list("key"=/obj/item/weapon/screwdriver,
- "backkey"=/obj/item/weapon/crowbar,
+ list("key"=IS_SCREWDRIVER,
+ "backkey"=IS_CROWBAR,
"desc"="Peripherals control module is installed"),
//14
list("key"=/obj/item/weapon/circuitboard/mecha/gygax/peripherals,
- "backkey"=/obj/item/weapon/screwdriver,
+ "backkey"=IS_SCREWDRIVER,
"desc"="Central control module is secured"),
//15
- list("key"=/obj/item/weapon/screwdriver,
- "backkey"=/obj/item/weapon/crowbar,
+ list("key"=IS_SCREWDRIVER,
+ "backkey"=IS_CROWBAR,
"desc"="Central control module is installed"),
//16
list("key"=/obj/item/weapon/circuitboard/mecha/gygax/main,
- "backkey"=/obj/item/weapon/screwdriver,
+ "backkey"=IS_SCREWDRIVER,
"desc"="The wiring is adjusted"),
//17
- list("key"=/obj/item/weapon/wirecutters,
- "backkey"=/obj/item/weapon/screwdriver,
+ list("key"=/obj/item/weapon/tool/wirecutters,
+ "backkey"=IS_SCREWDRIVER,
"desc"="The wiring is added"),
//18
list("key"=/obj/item/stack/cable_coil,
- "backkey"=/obj/item/weapon/screwdriver,
+ "backkey"=IS_SCREWDRIVER,
"desc"="The hydraulic systems are active."),
//19
- list("key"=/obj/item/weapon/screwdriver,
- "backkey"=/obj/item/weapon/wrench,
+ list("key"=IS_SCREWDRIVER,
+ "backkey"=IS_WRENCH,
"desc"="The hydraulic systems are connected."),
//20
- list("key"=/obj/item/weapon/wrench,
+ list("key"=IS_WRENCH,
"desc"="The hydraulic systems are disconnected.")
)
- action(atom/used_atom,mob/user as mob)
- return check_step(used_atom,user)
+/datum/construction/reversible/mecha/gygax/action(obj/item/I,mob/user as mob)
+ return check_step(I,user)
- custom_action(index, diff, atom/used_atom, mob/user)
- if(!..())
- return 0
+/datum/construction/reversible/mecha/gygax/custom_action(index, diff, obj/item/I, mob/user)
+ if(!..())
+ return 0
- //TODO: better messages.
- switch(index)
- if(20)
- user.visible_message("[user] connects [holder] hydraulic systems", "You connect [holder] hydraulic systems.")
+ //TODO: better messages.
+ switch(index)
+ if(20)
+ user.visible_message("[user] connects [holder] hydraulic systems", "You connect [holder] hydraulic systems.")
+ holder.icon_state = "gygax1"
+ if(19)
+ if(diff==FORWARD)
+ user.visible_message("[user] activates [holder] hydraulic systems.", "You activate [holder] hydraulic systems.")
+ holder.icon_state = "gygax2"
+ else
+ user.visible_message("[user] disconnects [holder] hydraulic systems", "You disconnect [holder] hydraulic systems.")
+ holder.icon_state = "gygax0"
+ if(18)
+ if(diff==FORWARD)
+ user.visible_message("[user] adds the wiring to [holder].", "You add the wiring to [holder].")
+ holder.icon_state = "gygax3"
+ else
+ user.visible_message("[user] deactivates [holder] hydraulic systems.", "You deactivate [holder] hydraulic systems.")
holder.icon_state = "gygax1"
- if(19)
- if(diff==FORWARD)
- user.visible_message("[user] activates [holder] hydraulic systems.", "You activate [holder] hydraulic systems.")
- holder.icon_state = "gygax2"
- else
- user.visible_message("[user] disconnects [holder] hydraulic systems", "You disconnect [holder] hydraulic systems.")
- holder.icon_state = "gygax0"
- if(18)
- if(diff==FORWARD)
- user.visible_message("[user] adds the wiring to [holder].", "You add the wiring to [holder].")
- holder.icon_state = "gygax3"
- else
- user.visible_message("[user] deactivates [holder] hydraulic systems.", "You deactivate [holder] hydraulic systems.")
- holder.icon_state = "gygax1"
- if(17)
- if(diff==FORWARD)
- user.visible_message("[user] adjusts the wiring of [holder].", "You adjust the wiring of [holder].")
- holder.icon_state = "gygax4"
- else
- user.visible_message("[user] removes the wiring from [holder].", "You remove the wiring from [holder].")
- var/obj/item/stack/cable_coil/coil = new /obj/item/stack/cable_coil(get_turf(holder))
- coil.amount = 4
- holder.icon_state = "gygax2"
- if(16)
- if(diff==FORWARD)
- user.visible_message("[user] installs the central control module into [holder].", "You install the central computer mainboard into [holder].")
- qdel(used_atom)
- holder.icon_state = "gygax5"
- else
- user.visible_message("[user] disconnects the wiring of [holder].", "You disconnect the wiring of [holder].")
- holder.icon_state = "gygax3"
- if(15)
- if(diff==FORWARD)
- user.visible_message("[user] secures the mainboard.", "You secure the mainboard.")
- holder.icon_state = "gygax6"
- else
- user.visible_message("[user] removes the central control module from [holder].", "You remove the central computer mainboard from [holder].")
- new /obj/item/weapon/circuitboard/mecha/gygax/main(get_turf(holder))
- holder.icon_state = "gygax4"
- if(14)
- if(diff==FORWARD)
- user.visible_message("[user] installs the peripherals control module into [holder].", "You install the peripherals control module into [holder].")
- qdel(used_atom)
- holder.icon_state = "gygax7"
- else
- user.visible_message("[user] unfastens the mainboard.", "You unfasten the mainboard.")
- holder.icon_state = "gygax5"
- if(13)
- if(diff==FORWARD)
- user.visible_message("[user] secures the peripherals control module.", "You secure the peripherals control module.")
- holder.icon_state = "gygax8"
- else
- user.visible_message("[user] removes the peripherals control module from [holder].", "You remove the peripherals control module from [holder].")
- new /obj/item/weapon/circuitboard/mecha/gygax/peripherals(get_turf(holder))
- holder.icon_state = "gygax6"
- if(12)
- if(diff==FORWARD)
- user.visible_message("[user] installs the weapon control module into [holder].", "You install the weapon control module into [holder].")
- qdel(used_atom)
- holder.icon_state = "gygax9"
- else
- user.visible_message("[user] unfastens the peripherals control module.", "You unfasten the peripherals control module.")
- holder.icon_state = "gygax7"
- if(11)
- if(diff==FORWARD)
- user.visible_message("[user] secures the weapon control module.", "You secure the weapon control module.")
- holder.icon_state = "gygax10"
- else
- user.visible_message("[user] removes the weapon control module from [holder].", "You remove the weapon control module from [holder].")
- new /obj/item/weapon/circuitboard/mecha/gygax/targeting(get_turf(holder))
- holder.icon_state = "gygax8"
- if(10)
- if(diff==FORWARD)
- user.visible_message("[user] installs advanced scanner module to [holder].", "You install advanced scanner module to [holder].")
- qdel(used_atom)
- holder.icon_state = "gygax11"
- else
- user.visible_message("[user] unfastens the weapon control module.", "You unfasten the weapon control module.")
- holder.icon_state = "gygax9"
- if(9)
- if(diff==FORWARD)
- user.visible_message("[user] secures the advanced scanner module.", "You secure the advanced scanner module.")
- holder.icon_state = "gygax12"
- else
- user.visible_message("[user] removes the advanced scanner module from [holder].", "You remove the advanced scanner module from [holder].")
- new /obj/item/weapon/stock_parts/scanning_module/adv(get_turf(holder))
- holder.icon_state = "gygax10"
- if(8)
- if(diff==FORWARD)
- user.visible_message("[user] installs advanced capacitor to [holder].", "You install advanced capacitor to [holder].")
- qdel(used_atom)
- holder.icon_state = "gygax13"
- else
- user.visible_message("[user] unfastens the advanced scanner module.", "You unfasten the advanced scanner module.")
- holder.icon_state = "gygax11"
- if(7)
- if(diff==FORWARD)
- user.visible_message("[user] secures the advanced capacitor.", "You secure the advanced capacitor.")
- holder.icon_state = "gygax14"
- else
- user.visible_message("[user] removes the advanced capacitor from [holder].", "You remove the advanced capacitor from [holder].")
- new /obj/item/weapon/stock_parts/capacitor/adv(get_turf(holder))
- holder.icon_state = "gygax12"
- if(6)
- if(diff==FORWARD)
- user.visible_message("[user] installs internal armor layer to [holder].", "You install internal armor layer to [holder].")
- holder.icon_state = "gygax15"
- else
- user.visible_message("[user] unfastens the advanced capacitor.", "You unfasten the advanced capacitor.")
- holder.icon_state = "gygax13"
- if(5)
- if(diff==FORWARD)
- user.visible_message("[user] secures internal armor layer.", "You secure internal armor layer.")
- holder.icon_state = "gygax16"
- else
- user.visible_message("[user] pries internal armor layer from [holder].", "You prie internal armor layer from [holder].")
- var/obj/item/stack/material/steel/MS = new /obj/item/stack/material/steel(get_turf(holder))
- MS.amount = 5
- holder.icon_state = "gygax14"
- if(4)
- if(diff==FORWARD)
- user.visible_message("[user] welds internal armor layer to [holder].", "You weld the internal armor layer to [holder].")
- holder.icon_state = "gygax17"
- else
- user.visible_message("[user] unfastens the internal armor layer.", "You unfasten the internal armor layer.")
- holder.icon_state = "gygax15"
- if(3)
- if(diff==FORWARD)
- user.visible_message("[user] installs Gygax Armour Plates to [holder].", "You install Gygax Armour Plates to [holder].")
- qdel(used_atom)
- holder.icon_state = "gygax18"
- else
- user.visible_message("[user] cuts internal armor layer from [holder].", "You cut the internal armor layer from [holder].")
- holder.icon_state = "gygax16"
- if(2)
- if(diff==FORWARD)
- user.visible_message("[user] secures Gygax Armour Plates.", "You secure Gygax Armour Plates.")
- holder.icon_state = "gygax19"
- else
- user.visible_message("[user] pries Gygax Armour Plates from [holder].", "You prie Gygax Armour Plates from [holder].")
- new /obj/item/mecha_parts/part/gygax_armour(get_turf(holder))
- holder.icon_state = "gygax17"
- if(1)
- if(diff==FORWARD)
- user.visible_message("[user] welds Gygax Armour Plates to [holder].", "You weld Gygax Armour Plates to [holder].")
- else
- user.visible_message("[user] unfastens Gygax Armour Plates.", "You unfasten Gygax Armour Plates.")
- holder.icon_state = "gygax18"
- return 1
+ if(17)
+ if(diff==FORWARD)
+ user.visible_message("[user] adjusts the wiring of [holder].", "You adjust the wiring of [holder].")
+ holder.icon_state = "gygax4"
+ else
+ user.visible_message("[user] removes the wiring from [holder].", "You remove the wiring from [holder].")
+ var/obj/item/stack/cable_coil/coil = new /obj/item/stack/cable_coil(get_turf(holder))
+ coil.amount = 4
+ holder.icon_state = "gygax2"
+ if(16)
+ if(diff==FORWARD)
+ user.visible_message("[user] installs the central control module into [holder].", "You install the central computer mainboard into [holder].")
+ qdel(I)
+ holder.icon_state = "gygax5"
+ else
+ user.visible_message("[user] disconnects the wiring of [holder].", "You disconnect the wiring of [holder].")
+ holder.icon_state = "gygax3"
+ if(15)
+ if(diff==FORWARD)
+ user.visible_message("[user] secures the mainboard.", "You secure the mainboard.")
+ holder.icon_state = "gygax6"
+ else
+ user.visible_message("[user] removes the central control module from [holder].", "You remove the central computer mainboard from [holder].")
+ new /obj/item/weapon/circuitboard/mecha/gygax/main(get_turf(holder))
+ holder.icon_state = "gygax4"
+ if(14)
+ if(diff==FORWARD)
+ user.visible_message("[user] installs the peripherals control module into [holder].", "You install the peripherals control module into [holder].")
+ qdel(I)
+ holder.icon_state = "gygax7"
+ else
+ user.visible_message("[user] unfastens the mainboard.", "You unfasten the mainboard.")
+ holder.icon_state = "gygax5"
+ if(13)
+ if(diff==FORWARD)
+ user.visible_message("[user] secures the peripherals control module.", "You secure the peripherals control module.")
+ holder.icon_state = "gygax8"
+ else
+ user.visible_message("[user] removes the peripherals control module from [holder].", "You remove the peripherals control module from [holder].")
+ new /obj/item/weapon/circuitboard/mecha/gygax/peripherals(get_turf(holder))
+ holder.icon_state = "gygax6"
+ if(12)
+ if(diff==FORWARD)
+ user.visible_message("[user] installs the weapon control module into [holder].", "You install the weapon control module into [holder].")
+ qdel(I)
+ holder.icon_state = "gygax9"
+ else
+ user.visible_message("[user] unfastens the peripherals control module.", "You unfasten the peripherals control module.")
+ holder.icon_state = "gygax7"
+ if(11)
+ if(diff==FORWARD)
+ user.visible_message("[user] secures the weapon control module.", "You secure the weapon control module.")
+ holder.icon_state = "gygax10"
+ else
+ user.visible_message("[user] removes the weapon control module from [holder].", "You remove the weapon control module from [holder].")
+ new /obj/item/weapon/circuitboard/mecha/gygax/targeting(get_turf(holder))
+ holder.icon_state = "gygax8"
+ if(10)
+ if(diff==FORWARD)
+ user.visible_message("[user] installs advanced scanner module to [holder].", "You install advanced scanner module to [holder].")
+ qdel(I)
+ holder.icon_state = "gygax11"
+ else
+ user.visible_message("[user] unfastens the weapon control module.", "You unfasten the weapon control module.")
+ holder.icon_state = "gygax9"
+ if(9)
+ if(diff==FORWARD)
+ user.visible_message("[user] secures the advanced scanner module.", "You secure the advanced scanner module.")
+ holder.icon_state = "gygax12"
+ else
+ user.visible_message("[user] removes the advanced scanner module from [holder].", "You remove the advanced scanner module from [holder].")
+ new /obj/item/weapon/stock_parts/scanning_module/adv(get_turf(holder))
+ holder.icon_state = "gygax10"
+ if(8)
+ if(diff==FORWARD)
+ user.visible_message("[user] installs advanced capacitor to [holder].", "You install advanced capacitor to [holder].")
+ qdel(I)
+ holder.icon_state = "gygax13"
+ else
+ user.visible_message("[user] unfastens the advanced scanner module.", "You unfasten the advanced scanner module.")
+ holder.icon_state = "gygax11"
+ if(7)
+ if(diff==FORWARD)
+ user.visible_message("[user] secures the advanced capacitor.", "You secure the advanced capacitor.")
+ holder.icon_state = "gygax14"
+ else
+ user.visible_message("[user] removes the advanced capacitor from [holder].", "You remove the advanced capacitor from [holder].")
+ new /obj/item/weapon/stock_parts/capacitor/adv(get_turf(holder))
+ holder.icon_state = "gygax12"
+ if(6)
+ if(diff==FORWARD)
+ user.visible_message("[user] installs internal armor layer to [holder].", "You install internal armor layer to [holder].")
+ holder.icon_state = "gygax15"
+ else
+ user.visible_message("[user] unfastens the advanced capacitor.", "You unfasten the advanced capacitor.")
+ holder.icon_state = "gygax13"
+ if(5)
+ if(diff==FORWARD)
+ user.visible_message("[user] secures internal armor layer.", "You secure internal armor layer.")
+ holder.icon_state = "gygax16"
+ else
+ user.visible_message("[user] pries internal armor layer from [holder].", "You prie internal armor layer from [holder].")
+ var/obj/item/stack/material/steel/MS = new /obj/item/stack/material/steel(get_turf(holder))
+ MS.amount = 5
+ holder.icon_state = "gygax14"
+ if(4)
+ if(diff==FORWARD)
+ user.visible_message("[user] welds internal armor layer to [holder].", "You weld the internal armor layer to [holder].")
+ holder.icon_state = "gygax17"
+ else
+ user.visible_message("[user] unfastens the internal armor layer.", "You unfasten the internal armor layer.")
+ holder.icon_state = "gygax15"
+ if(3)
+ if(diff==FORWARD)
+ user.visible_message("[user] installs Gygax Armour Plates to [holder].", "You install Gygax Armour Plates to [holder].")
+ qdel(I)
+ holder.icon_state = "gygax18"
+ else
+ user.visible_message("[user] cuts internal armor layer from [holder].", "You cut the internal armor layer from [holder].")
+ holder.icon_state = "gygax16"
+ if(2)
+ if(diff==FORWARD)
+ user.visible_message("[user] secures Gygax Armour Plates.", "You secure Gygax Armour Plates.")
+ holder.icon_state = "gygax19"
+ else
+ user.visible_message("[user] pries Gygax Armour Plates from [holder].", "You prie Gygax Armour Plates from [holder].")
+ new /obj/item/mecha_parts/part/gygax_armour(get_turf(holder))
+ holder.icon_state = "gygax17"
+ if(1)
+ if(diff==FORWARD)
+ user.visible_message("[user] welds Gygax Armour Plates to [holder].", "You weld Gygax Armour Plates to [holder].")
+ else
+ user.visible_message("[user] unfastens Gygax Armour Plates.", "You unfasten Gygax Armour Plates.")
+ holder.icon_state = "gygax18"
+ return 1
- spawn_result()
- ..()
- feedback_inc("mecha_gygax_created",1)
- return
+/datum/construction/reversible/mecha/gygax/spawn_result()
+ ..()
+ feedback_inc("mecha_gygax_created",1)
+ return
+////////////////////////
+// Firfighter
+////////////////////////
/datum/construction/mecha/firefighter_chassis
steps = list(list("key"=/obj/item/mecha_parts/part/ripley_torso),//1
list("key"=/obj/item/mecha_parts/part/ripley_left_arm),//2
@@ -566,25 +572,25 @@
list("key"=/obj/item/clothing/suit/fire)//6
)
- custom_action(step, atom/used_atom, mob/user)
- user.visible_message("[user] has connected [used_atom] to [holder].", "You connect [used_atom] to [holder]")
- holder.overlays += used_atom.icon_state+"+o"
- user.drop_item()
- qdel(used_atom)
- return 1
+/datum/construction/mecha/firefighter_chassis/custom_action(step, obj/item/I, mob/user)
+ user.visible_message("[user] has connected [I] to [holder].", "You connect [I] to [holder]")
+ holder.overlays += I.icon_state+"+o"
+ user.drop_item()
+ qdel(I)
+ return 1
- action(atom/used_atom,mob/user as mob)
- return check_all_steps(used_atom,user)
+/datum/construction/mecha/firefighter_chassis/action(obj/item/I,mob/user as mob)
+ return check_all_steps(I,user)
- spawn_result()
- var/obj/item/mecha_parts/chassis/const_holder = holder
- const_holder.construct = new /datum/construction/reversible/mecha/firefighter(const_holder)
- const_holder.icon = 'icons/mecha/mech_construction.dmi'
- const_holder.icon_state = "fireripley0"
- const_holder.density = 1
- spawn()
- qdel(src)
- return
+/datum/construction/mecha/firefighter_chassis/spawn_result()
+ var/obj/item/mecha_parts/chassis/const_holder = holder
+ const_holder.construct = new /datum/construction/reversible/mecha/firefighter(const_holder)
+ const_holder.icon = 'icons/mecha/mech_construction.dmi'
+ const_holder.icon_state = "fireripley0"
+ const_holder.density = 1
+ spawn()
+ qdel(src)
+ return
/datum/construction/reversible/mecha/firefighter
@@ -592,15 +598,15 @@
steps = list(
//1
list("key"=/obj/item/weapon/weldingtool,
- "backkey"=/obj/item/weapon/wrench,
+ "backkey"=IS_WRENCH,
"desc"="External armor is wrenched."),
//2
- list("key"=/obj/item/weapon/wrench,
- "backkey"=/obj/item/weapon/crowbar,
+ list("key"=IS_WRENCH,
+ "backkey"=IS_CROWBAR,
"desc"="External armor is installed."),
//3
list("key"=/obj/item/stack/material/plasteel,
- "backkey"=/obj/item/weapon/crowbar,
+ "backkey"=IS_CROWBAR,
"desc"="External armor is being installed."),
//4
list("key"=/obj/item/stack/material/plasteel,
@@ -608,179 +614,180 @@
"desc"="Internal armor is welded."),
//5
list("key"=/obj/item/weapon/weldingtool,
- "backkey"=/obj/item/weapon/wrench,
+ "backkey"=IS_WRENCH,
"desc"="Internal armor is wrenched"),
//6
- list("key"=/obj/item/weapon/wrench,
- "backkey"=/obj/item/weapon/crowbar,
+ list("key"=IS_WRENCH,
+ "backkey"=IS_CROWBAR,
"desc"="Internal armor is installed"),
-
//7
list("key"=/obj/item/stack/material/plasteel,
- "backkey"=/obj/item/weapon/screwdriver,
+ "backkey"=IS_SCREWDRIVER,
"desc"="Peripherals control module is secured"),
//8
- list("key"=/obj/item/weapon/screwdriver,
- "backkey"=/obj/item/weapon/crowbar,
+ list("key"=IS_SCREWDRIVER,
+ "backkey"=IS_CROWBAR,
"desc"="Peripherals control module is installed"),
//9
list("key"=/obj/item/weapon/circuitboard/mecha/ripley/peripherals,
- "backkey"=/obj/item/weapon/screwdriver,
+ "backkey"=IS_SCREWDRIVER,
"desc"="Central control module is secured"),
//10
- list("key"=/obj/item/weapon/screwdriver,
- "backkey"=/obj/item/weapon/crowbar,
+ list("key"=IS_SCREWDRIVER,
+ "backkey"=IS_CROWBAR,
"desc"="Central control module is installed"),
//11
list("key"=/obj/item/weapon/circuitboard/mecha/ripley/main,
- "backkey"=/obj/item/weapon/screwdriver,
+ "backkey"=IS_SCREWDRIVER,
"desc"="The wiring is adjusted"),
//12
- list("key"=/obj/item/weapon/wirecutters,
- "backkey"=/obj/item/weapon/screwdriver,
+ list("key"=/obj/item/weapon/tool/wirecutters,
+ "backkey"=IS_SCREWDRIVER,
"desc"="The wiring is added"),
//13
list("key"=/obj/item/stack/cable_coil,
- "backkey"=/obj/item/weapon/screwdriver,
+ "backkey"=IS_SCREWDRIVER,
"desc"="The hydraulic systems are active."),
//14
- list("key"=/obj/item/weapon/screwdriver,
- "backkey"=/obj/item/weapon/wrench,
+ list("key"=IS_SCREWDRIVER,
+ "backkey"=IS_WRENCH,
"desc"="The hydraulic systems are connected."),
//15
- list("key"=/obj/item/weapon/wrench,
+ list("key"=IS_WRENCH,
"desc"="The hydraulic systems are disconnected.")
)
- action(atom/used_atom,mob/user as mob)
- return check_step(used_atom,user)
+/datum/construction/reversible/mecha/firefighter/action(obj/item/I,mob/user as mob)
+ return check_step(I,user)
- custom_action(index, diff, atom/used_atom, mob/user)
- if(!..())
- return 0
+/datum/construction/reversible/mecha/firefighter/custom_action(index, diff, obj/item/I, mob/user)
+ if(!..())
+ return 0
- //TODO: better messages.
- switch(index)
- if(15)
- user.visible_message("[user] connects [holder] hydraulic systems", "You connect [holder] hydraulic systems.")
+ //TODO: better messages.
+ switch(index)
+ if(15)
+ user.visible_message("[user] connects [holder] hydraulic systems", "You connect [holder] hydraulic systems.")
+ holder.icon_state = "fireripley1"
+ if(14)
+ if(diff==FORWARD)
+ user.visible_message("[user] activates [holder] hydraulic systems.", "You activate [holder] hydraulic systems.")
+ holder.icon_state = "fireripley2"
+ else
+ user.visible_message("[user] disconnects [holder] hydraulic systems", "You disconnect [holder] hydraulic systems.")
+ holder.icon_state = "fireripley0"
+ if(13)
+ if(diff==FORWARD)
+ user.visible_message("[user] adds the wiring to [holder].", "You add the wiring to [holder].")
+ holder.icon_state = "fireripley3"
+ else
+ user.visible_message("[user] deactivates [holder] hydraulic systems.", "You deactivate [holder] hydraulic systems.")
holder.icon_state = "fireripley1"
- if(14)
- if(diff==FORWARD)
- user.visible_message("[user] activates [holder] hydraulic systems.", "You activate [holder] hydraulic systems.")
- holder.icon_state = "fireripley2"
- else
- user.visible_message("[user] disconnects [holder] hydraulic systems", "You disconnect [holder] hydraulic systems.")
- holder.icon_state = "fireripley0"
- if(13)
- if(diff==FORWARD)
- user.visible_message("[user] adds the wiring to [holder].", "You add the wiring to [holder].")
- holder.icon_state = "fireripley3"
- else
- user.visible_message("[user] deactivates [holder] hydraulic systems.", "You deactivate [holder] hydraulic systems.")
- holder.icon_state = "fireripley1"
- if(12)
- if(diff==FORWARD)
- user.visible_message("[user] adjusts the wiring of [holder].", "You adjust the wiring of [holder].")
- holder.icon_state = "fireripley4"
- else
- user.visible_message("[user] removes the wiring from [holder].", "You remove the wiring from [holder].")
- var/obj/item/stack/cable_coil/coil = new /obj/item/stack/cable_coil(get_turf(holder))
- coil.amount = 4
- holder.icon_state = "fireripley2"
- if(11)
- if(diff==FORWARD)
- user.visible_message("[user] installs the central control module into [holder].", "You install the central computer mainboard into [holder].")
- qdel(used_atom)
- holder.icon_state = "fireripley5"
- else
- user.visible_message("[user] disconnects the wiring of [holder].", "You disconnect the wiring of [holder].")
- holder.icon_state = "fireripley3"
- if(10)
- if(diff==FORWARD)
- user.visible_message("[user] secures the mainboard.", "You secure the mainboard.")
- holder.icon_state = "fireripley6"
- else
- user.visible_message("[user] removes the central control module from [holder].", "You remove the central computer mainboard from [holder].")
- new /obj/item/weapon/circuitboard/mecha/ripley/main(get_turf(holder))
- holder.icon_state = "fireripley4"
- if(9)
- if(diff==FORWARD)
- user.visible_message("[user] installs the peripherals control module into [holder].", "You install the peripherals control module into [holder].")
- qdel(used_atom)
- holder.icon_state = "fireripley7"
- else
- user.visible_message("[user] unfastens the mainboard.", "You unfasten the mainboard.")
- holder.icon_state = "fireripley5"
- if(8)
- if(diff==FORWARD)
- user.visible_message("[user] secures the peripherals control module.", "You secure the peripherals control module.")
- holder.icon_state = "fireripley8"
- else
- user.visible_message("[user] removes the peripherals control module from [holder].", "You remove the peripherals control module from [holder].")
- new /obj/item/weapon/circuitboard/mecha/ripley/peripherals(get_turf(holder))
- holder.icon_state = "fireripley6"
- if(7)
- if(diff==FORWARD)
- user.visible_message("[user] installs internal armor layer to [holder].", "You install internal armor layer to [holder].")
- holder.icon_state = "fireripley9"
- else
- user.visible_message("[user] unfastens the peripherals control module.", "You unfasten the peripherals control module.")
- holder.icon_state = "fireripley7"
+ if(12)
+ if(diff==FORWARD)
+ user.visible_message("[user] adjusts the wiring of [holder].", "You adjust the wiring of [holder].")
+ holder.icon_state = "fireripley4"
+ else
+ user.visible_message("[user] removes the wiring from [holder].", "You remove the wiring from [holder].")
+ var/obj/item/stack/cable_coil/coil = new /obj/item/stack/cable_coil(get_turf(holder))
+ coil.amount = 4
+ holder.icon_state = "fireripley2"
+ if(11)
+ if(diff==FORWARD)
+ user.visible_message("[user] installs the central control module into [holder].", "You install the central computer mainboard into [holder].")
+ qdel(I)
+ holder.icon_state = "fireripley5"
+ else
+ user.visible_message("[user] disconnects the wiring of [holder].", "You disconnect the wiring of [holder].")
+ holder.icon_state = "fireripley3"
+ if(10)
+ if(diff==FORWARD)
+ user.visible_message("[user] secures the mainboard.", "You secure the mainboard.")
+ holder.icon_state = "fireripley6"
+ else
+ user.visible_message("[user] removes the central control module from [holder].", "You remove the central computer mainboard from [holder].")
+ new /obj/item/weapon/circuitboard/mecha/ripley/main(get_turf(holder))
+ holder.icon_state = "fireripley4"
+ if(9)
+ if(diff==FORWARD)
+ user.visible_message("[user] installs the peripherals control module into [holder].", "You install the peripherals control module into [holder].")
+ qdel(I)
+ holder.icon_state = "fireripley7"
+ else
+ user.visible_message("[user] unfastens the mainboard.", "You unfasten the mainboard.")
+ holder.icon_state = "fireripley5"
+ if(8)
+ if(diff==FORWARD)
+ user.visible_message("[user] secures the peripherals control module.", "You secure the peripherals control module.")
+ holder.icon_state = "fireripley8"
+ else
+ user.visible_message("[user] removes the peripherals control module from [holder].", "You remove the peripherals control module from [holder].")
+ new /obj/item/weapon/circuitboard/mecha/ripley/peripherals(get_turf(holder))
+ holder.icon_state = "fireripley6"
+ if(7)
+ if(diff==FORWARD)
+ user.visible_message("[user] installs internal armor layer to [holder].", "You install internal armor layer to [holder].")
+ holder.icon_state = "fireripley9"
+ else
+ user.visible_message("[user] unfastens the peripherals control module.", "You unfasten the peripherals control module.")
+ holder.icon_state = "fireripley7"
+ if(6)
+ if(diff==FORWARD)
+ user.visible_message("[user] secures internal armor layer.", "You secure internal armor layer.")
+ holder.icon_state = "fireripley10"
+ else
+ user.visible_message("[user] pries internal armor layer from [holder].", "You prie internal armor layer from [holder].")
+ var/obj/item/stack/material/plasteel/MS = new /obj/item/stack/material/plasteel(get_turf(holder))
+ MS.amount = 5
+ holder.icon_state = "fireripley8"
+ if(5)
+ if(diff==FORWARD)
+ user.visible_message("[user] welds internal armor layer to [holder].", "You weld the internal armor layer to [holder].")
+ holder.icon_state = "fireripley11"
+ else
+ user.visible_message("[user] unfastens the internal armor layer.", "You unfasten the internal armor layer.")
+ holder.icon_state = "fireripley9"
+ if(4)
+ if(diff==FORWARD)
+ user.visible_message("[user] starts to install the external armor layer to [holder].", "You start to install the external armor layer to [holder].")
+ holder.icon_state = "fireripley12"
+ else
+ user.visible_message("[user] cuts internal armor layer from [holder].", "You cut the internal armor layer from [holder].")
+ holder.icon_state = "fireripley10"
+ if(3)
+ if(diff==FORWARD)
+ user.visible_message("[user] installs external reinforced armor layer to [holder].", "You install external reinforced armor layer to [holder].")
+ holder.icon_state = "fireripley13"
+ else
+ user.visible_message("[user] removes the external armor from [holder].", "You remove the external armor from [holder].")
+ var/obj/item/stack/material/plasteel/MS = new /obj/item/stack/material/plasteel(get_turf(holder))
+ MS.amount = 5
+ holder.icon_state = "fireripley11"
+ if(2)
+ if(diff==FORWARD)
+ user.visible_message("[user] secures external armor layer.", "You secure external reinforced armor layer.")
+ holder.icon_state = "fireripley14"
+ else
+ user.visible_message("[user] pries external armor layer from [holder].", "You prie external armor layer from [holder].")
+ var/obj/item/stack/material/plasteel/MS = new /obj/item/stack/material/plasteel(get_turf(holder))
+ MS.amount = 5
+ holder.icon_state = "fireripley12"
+ if(1)
+ if(diff==FORWARD)
+ user.visible_message("[user] welds external armor layer to [holder].", "You weld external armor layer to [holder].")
+ else
+ user.visible_message("[user] unfastens the external armor layer.", "You unfasten the external armor layer.")
+ holder.icon_state = "fireripley13"
+ return 1
- if(6)
- if(diff==FORWARD)
- user.visible_message("[user] secures internal armor layer.", "You secure internal armor layer.")
- holder.icon_state = "fireripley10"
- else
- user.visible_message("[user] pries internal armor layer from [holder].", "You prie internal armor layer from [holder].")
- var/obj/item/stack/material/plasteel/MS = new /obj/item/stack/material/plasteel(get_turf(holder))
- MS.amount = 5
- holder.icon_state = "fireripley8"
- if(5)
- if(diff==FORWARD)
- user.visible_message("[user] welds internal armor layer to [holder].", "You weld the internal armor layer to [holder].")
- holder.icon_state = "fireripley11"
- else
- user.visible_message("[user] unfastens the internal armor layer.", "You unfasten the internal armor layer.")
- holder.icon_state = "fireripley9"
- if(4)
- if(diff==FORWARD)
- user.visible_message("[user] starts to install the external armor layer to [holder].", "You start to install the external armor layer to [holder].")
- holder.icon_state = "fireripley12"
- else
- user.visible_message("[user] cuts internal armor layer from [holder].", "You cut the internal armor layer from [holder].")
- holder.icon_state = "fireripley10"
- if(3)
- if(diff==FORWARD)
- user.visible_message("[user] installs external reinforced armor layer to [holder].", "You install external reinforced armor layer to [holder].")
- holder.icon_state = "fireripley13"
- else
- user.visible_message("[user] removes the external armor from [holder].", "You remove the external armor from [holder].")
- var/obj/item/stack/material/plasteel/MS = new /obj/item/stack/material/plasteel(get_turf(holder))
- MS.amount = 5
- holder.icon_state = "fireripley11"
- if(2)
- if(diff==FORWARD)
- user.visible_message("[user] secures external armor layer.", "You secure external reinforced armor layer.")
- holder.icon_state = "fireripley14"
- else
- user.visible_message("[user] pries external armor layer from [holder].", "You prie external armor layer from [holder].")
- var/obj/item/stack/material/plasteel/MS = new /obj/item/stack/material/plasteel(get_turf(holder))
- MS.amount = 5
- holder.icon_state = "fireripley12"
- if(1)
- if(diff==FORWARD)
- user.visible_message("[user] welds external armor layer to [holder].", "You weld external armor layer to [holder].")
- else
- user.visible_message("[user] unfastens the external armor layer.", "You unfasten the external armor layer.")
- holder.icon_state = "fireripley13"
- return 1
-
- spawn_result()
- ..()
- feedback_inc("mecha_firefighter_created",1)
- return
+/datum/construction/reversible/mecha/firefighter/spawn_result()
+ ..()
+ feedback_inc("mecha_firefighter_created",1)
+ return
+//////////////////////
+// Durand
+//////////////////////
/datum/construction/mecha/durand_chassis
steps = list(list("key"=/obj/item/mecha_parts/part/durand_torso),//1
list("key"=/obj/item/mecha_parts/part/durand_left_arm),//2
@@ -790,35 +797,36 @@
list("key"=/obj/item/mecha_parts/part/durand_head)
)
- custom_action(step, atom/used_atom, mob/user)
- user.visible_message("[user] has connected [used_atom] to [holder].", "You connect [used_atom] to [holder]")
- holder.overlays += used_atom.icon_state+"+o"
- qdel(used_atom)
- return 1
+/datum/construction/mecha/durand_chassis/custom_action(step, obj/item/I, mob/user)
+ user.visible_message("[user] has connected [I] to [holder].", "You connect [I] to [holder]")
+ holder.overlays += I.icon_state+"+o"
+ qdel(I)
+ return 1
- action(atom/used_atom,mob/user as mob)
- return check_all_steps(used_atom,user)
+/datum/construction/mecha/durand_chassis/action(obj/item/I,mob/user as mob)
+ return check_all_steps(I,user)
+
+/datum/construction/mecha/durand_chassis/spawn_result()
+ var/obj/item/mecha_parts/chassis/const_holder = holder
+ const_holder.construct = new /datum/construction/reversible/mecha/durand(const_holder)
+ const_holder.icon = 'icons/mecha/mech_construction.dmi'
+ const_holder.icon_state = "durand0"
+ const_holder.density = 1
+ spawn()
+ qdel(src)
+ return
- spawn_result()
- var/obj/item/mecha_parts/chassis/const_holder = holder
- const_holder.construct = new /datum/construction/reversible/mecha/durand(const_holder)
- const_holder.icon = 'icons/mecha/mech_construction.dmi'
- const_holder.icon_state = "durand0"
- const_holder.density = 1
- spawn()
- qdel(src)
- return
/datum/construction/reversible/mecha/durand
result = "/obj/mecha/combat/durand"
steps = list(
//1
list("key"=/obj/item/weapon/weldingtool,
- "backkey"=/obj/item/weapon/wrench,
+ "backkey"=IS_WRENCH,
"desc"="External armor is wrenched."),
//2
- list("key"=/obj/item/weapon/wrench,
- "backkey"=/obj/item/weapon/crowbar,
+ list("key"=IS_WRENCH,
+ "backkey"=IS_CROWBAR,
"desc"="External armor is installed."),
//3
list("key"=/obj/item/mecha_parts/part/durand_armour,
@@ -826,242 +834,456 @@
"desc"="Internal armor is welded."),
//4
list("key"=/obj/item/weapon/weldingtool,
- "backkey"=/obj/item/weapon/wrench,
+ "backkey"=IS_WRENCH,
"desc"="Internal armor is wrenched"),
//5
- list("key"=/obj/item/weapon/wrench,
- "backkey"=/obj/item/weapon/crowbar,
+ list("key"=IS_WRENCH,
+ "backkey"=IS_CROWBAR,
"desc"="Internal armor is installed"),
//6
list("key"=/obj/item/stack/material/steel,
- "backkey"=/obj/item/weapon/screwdriver,
+ "backkey"=IS_SCREWDRIVER,
"desc"="Advanced capacitor is secured"),
//7
- list("key"=/obj/item/weapon/screwdriver,
- "backkey"=/obj/item/weapon/crowbar,
+ list("key"=IS_SCREWDRIVER,
+ "backkey"=IS_CROWBAR,
"desc"="Advanced capacitor is installed"),
//8
list("key"=/obj/item/weapon/stock_parts/capacitor/adv,
- "backkey"=/obj/item/weapon/screwdriver,
+ "backkey"=IS_SCREWDRIVER,
"desc"="Advanced scanner module is secured"),
//9
- list("key"=/obj/item/weapon/screwdriver,
- "backkey"=/obj/item/weapon/crowbar,
+ list("key"=IS_SCREWDRIVER,
+ "backkey"=IS_CROWBAR,
"desc"="Advanced scanner module is installed"),
//10
list("key"=/obj/item/weapon/stock_parts/scanning_module/adv,
- "backkey"=/obj/item/weapon/screwdriver,
+ "backkey"=IS_SCREWDRIVER,
"desc"="Targeting module is secured"),
//11
- list("key"=/obj/item/weapon/screwdriver,
- "backkey"=/obj/item/weapon/crowbar,
+ list("key"=IS_SCREWDRIVER,
+ "backkey"=IS_CROWBAR,
"desc"="Targeting module is installed"),
//12
list("key"=/obj/item/weapon/circuitboard/mecha/durand/targeting,
- "backkey"=/obj/item/weapon/screwdriver,
+ "backkey"=IS_SCREWDRIVER,
"desc"="Peripherals control module is secured"),
//13
- list("key"=/obj/item/weapon/screwdriver,
- "backkey"=/obj/item/weapon/crowbar,
+ list("key"=IS_SCREWDRIVER,
+ "backkey"=IS_CROWBAR,
"desc"="Peripherals control module is installed"),
//14
list("key"=/obj/item/weapon/circuitboard/mecha/durand/peripherals,
- "backkey"=/obj/item/weapon/screwdriver,
+ "backkey"=IS_SCREWDRIVER,
"desc"="Central control module is secured"),
//15
- list("key"=/obj/item/weapon/screwdriver,
- "backkey"=/obj/item/weapon/crowbar,
+ list("key"=IS_SCREWDRIVER,
+ "backkey"=IS_CROWBAR,
"desc"="Central control module is installed"),
//16
list("key"=/obj/item/weapon/circuitboard/mecha/durand/main,
- "backkey"=/obj/item/weapon/screwdriver,
+ "backkey"=IS_SCREWDRIVER,
"desc"="The wiring is adjusted"),
//17
- list("key"=/obj/item/weapon/wirecutters,
- "backkey"=/obj/item/weapon/screwdriver,
+ list("key"=/obj/item/weapon/tool/wirecutters,
+ "backkey"=IS_SCREWDRIVER,
"desc"="The wiring is added"),
//18
list("key"=/obj/item/stack/cable_coil,
- "backkey"=/obj/item/weapon/screwdriver,
+ "backkey"=IS_SCREWDRIVER,
"desc"="The hydraulic systems are active."),
//19
- list("key"=/obj/item/weapon/screwdriver,
- "backkey"=/obj/item/weapon/wrench,
+ list("key"=IS_SCREWDRIVER,
+ "backkey"=IS_WRENCH,
"desc"="The hydraulic systems are connected."),
//20
- list("key"=/obj/item/weapon/wrench,
+ list("key"=IS_WRENCH,
"desc"="The hydraulic systems are disconnected.")
)
- action(atom/used_atom,mob/user as mob)
- return check_step(used_atom,user)
+/datum/construction/reversible/mecha/durand/action(obj/item/I,mob/user as mob)
+ return check_step(I,user)
- custom_action(index, diff, atom/used_atom, mob/user)
- if(!..())
- return 0
+/datum/construction/reversible/mecha/durand/custom_action(index, diff, obj/item/I, mob/user)
+ if(!..())
+ return 0
- //TODO: better messages.
- switch(index)
- if(20)
- user.visible_message("[user] connects [holder] hydraulic systems", "You connect [holder] hydraulic systems.")
+ //TODO: better messages.
+ switch(index)
+ if(20)
+ user.visible_message("[user] connects [holder] hydraulic systems", "You connect [holder] hydraulic systems.")
+ holder.icon_state = "durand1"
+ if(19)
+ if(diff==FORWARD)
+ user.visible_message("[user] activates [holder] hydraulic systems.", "You activate [holder] hydraulic systems.")
+ holder.icon_state = "durand2"
+ else
+ user.visible_message("[user] disconnects [holder] hydraulic systems", "You disconnect [holder] hydraulic systems.")
+ holder.icon_state = "durand0"
+ if(18)
+ if(diff==FORWARD)
+ user.visible_message("[user] adds the wiring to [holder].", "You add the wiring to [holder].")
+ holder.icon_state = "durand3"
+ else
+ user.visible_message("[user] deactivates [holder] hydraulic systems.", "You deactivate [holder] hydraulic systems.")
holder.icon_state = "durand1"
- if(19)
- if(diff==FORWARD)
- user.visible_message("[user] activates [holder] hydraulic systems.", "You activate [holder] hydraulic systems.")
- holder.icon_state = "durand2"
- else
- user.visible_message("[user] disconnects [holder] hydraulic systems", "You disconnect [holder] hydraulic systems.")
- holder.icon_state = "durand0"
- if(18)
- if(diff==FORWARD)
- user.visible_message("[user] adds the wiring to [holder].", "You add the wiring to [holder].")
- holder.icon_state = "durand3"
- else
- user.visible_message("[user] deactivates [holder] hydraulic systems.", "You deactivate [holder] hydraulic systems.")
- holder.icon_state = "durand1"
- if(17)
- if(diff==FORWARD)
- user.visible_message("[user] adjusts the wiring of [holder].", "You adjust the wiring of [holder].")
- holder.icon_state = "durand4"
- else
- user.visible_message("[user] removes the wiring from [holder].", "You remove the wiring from [holder].")
- var/obj/item/stack/cable_coil/coil = new /obj/item/stack/cable_coil(get_turf(holder))
- coil.amount = 4
- holder.icon_state = "durand2"
- if(16)
- if(diff==FORWARD)
- user.visible_message("[user] installs the central control module into [holder].", "You install the central computer mainboard into [holder].")
- qdel(used_atom)
- holder.icon_state = "durand5"
- else
- user.visible_message("[user] disconnects the wiring of [holder].", "You disconnect the wiring of [holder].")
- holder.icon_state = "durand3"
- if(15)
- if(diff==FORWARD)
- user.visible_message("[user] secures the mainboard.", "You secure the mainboard.")
- holder.icon_state = "durand6"
- else
- user.visible_message("[user] removes the central control module from [holder].", "You remove the central computer mainboard from [holder].")
- new /obj/item/weapon/circuitboard/mecha/durand/main(get_turf(holder))
- holder.icon_state = "durand4"
- if(14)
- if(diff==FORWARD)
- user.visible_message("[user] installs the peripherals control module into [holder].", "You install the peripherals control module into [holder].")
- qdel(used_atom)
- holder.icon_state = "durand7"
- else
- user.visible_message("[user] unfastens the mainboard.", "You unfasten the mainboard.")
- holder.icon_state = "durand5"
- if(13)
- if(diff==FORWARD)
- user.visible_message("[user] secures the peripherals control module.", "You secure the peripherals control module.")
- holder.icon_state = "durand8"
- else
- user.visible_message("[user] removes the peripherals control module from [holder].", "You remove the peripherals control module from [holder].")
- new /obj/item/weapon/circuitboard/mecha/durand/peripherals(get_turf(holder))
- holder.icon_state = "durand6"
- if(12)
- if(diff==FORWARD)
- user.visible_message("[user] installs the weapon control module into [holder].", "You install the weapon control module into [holder].")
- qdel(used_atom)
- holder.icon_state = "durand9"
- else
- user.visible_message("[user] unfastens the peripherals control module.", "You unfasten the peripherals control module.")
- holder.icon_state = "durand7"
- if(11)
- if(diff==FORWARD)
- user.visible_message("[user] secures the weapon control module.", "You secure the weapon control module.")
- holder.icon_state = "durand10"
- else
- user.visible_message("[user] removes the weapon control module from [holder].", "You remove the weapon control module from [holder].")
- new /obj/item/weapon/circuitboard/mecha/durand/targeting(get_turf(holder))
- holder.icon_state = "durand8"
- if(10)
- if(diff==FORWARD)
- user.visible_message("[user] installs advanced scanner module to [holder].", "You install advanced scanner module to [holder].")
- qdel(used_atom)
- holder.icon_state = "durand11"
- else
- user.visible_message("[user] unfastens the weapon control module.", "You unfasten the weapon control module.")
- holder.icon_state = "durand9"
- if(9)
- if(diff==FORWARD)
- user.visible_message("[user] secures the advanced scanner module.", "You secure the advanced scanner module.")
- holder.icon_state = "durand12"
- else
- user.visible_message("[user] removes the advanced scanner module from [holder].", "You remove the advanced scanner module from [holder].")
- new /obj/item/weapon/stock_parts/scanning_module/adv(get_turf(holder))
- holder.icon_state = "durand10"
- if(8)
- if(diff==FORWARD)
- user.visible_message("[user] installs advanced capacitor to [holder].", "You install advanced capacitor to [holder].")
- qdel(used_atom)
- holder.icon_state = "durand13"
- else
- user.visible_message("[user] unfastens the advanced scanner module.", "You unfasten the advanced scanner module.")
- holder.icon_state = "durand11"
- if(7)
- if(diff==FORWARD)
- user.visible_message("[user] secures the advanced capacitor.", "You secure the advanced capacitor.")
- holder.icon_state = "durand14"
- else
- user.visible_message("[user] removes the advanced capacitor from [holder].", "You remove the advanced capacitor from [holder].")
- new /obj/item/weapon/stock_parts/capacitor/adv(get_turf(holder))
- holder.icon_state = "durand12"
- if(6)
- if(diff==FORWARD)
- user.visible_message("[user] installs internal armor layer to [holder].", "You install internal armor layer to [holder].")
- holder.icon_state = "durand15"
- else
- user.visible_message("[user] unfastens the advanced capacitor.", "You unfasten the advanced capacitor.")
- holder.icon_state = "durand13"
- if(5)
- if(diff==FORWARD)
- user.visible_message("[user] secures internal armor layer.", "You secure internal armor layer.")
- holder.icon_state = "durand16"
- else
- user.visible_message("[user] pries internal armor layer from [holder].", "You prie internal armor layer from [holder].")
- var/obj/item/stack/material/steel/MS = new /obj/item/stack/material/steel(get_turf(holder))
- MS.amount = 5
- holder.icon_state = "durand14"
- if(4)
- if(diff==FORWARD)
- user.visible_message("[user] welds internal armor layer to [holder].", "You weld the internal armor layer to [holder].")
- holder.icon_state = "durand17"
- else
- user.visible_message("[user] unfastens the internal armor layer.", "You unfasten the internal armor layer.")
- holder.icon_state = "durand15"
- if(3)
- if(diff==FORWARD)
- user.visible_message("[user] installs Durand Armour Plates to [holder].", "You install Durand Armour Plates to [holder].")
- qdel(used_atom)
- holder.icon_state = "durand18"
- else
- user.visible_message("[user] cuts internal armor layer from [holder].", "You cut the internal armor layer from [holder].")
- holder.icon_state = "durand16"
- if(2)
- if(diff==FORWARD)
- user.visible_message("[user] secures Durand Armour Plates.", "You secure Durand Armour Plates.")
- holder.icon_state = "durand19"
- else
- user.visible_message("[user] pries Durand Armour Plates from [holder].", "You prie Durand Armour Plates from [holder].")
- new /obj/item/mecha_parts/part/durand_armour(get_turf(holder))
- holder.icon_state = "durand17"
- if(1)
- if(diff==FORWARD)
- user.visible_message("[user] welds Durand Armour Plates to [holder].", "You weld Durand Armour Plates to [holder].")
- else
- user.visible_message("[user] unfastens Durand Armour Plates.", "You unfasten Durand Armour Plates.")
- holder.icon_state = "durand18"
- return 1
+ if(17)
+ if(diff==FORWARD)
+ user.visible_message("[user] adjusts the wiring of [holder].", "You adjust the wiring of [holder].")
+ holder.icon_state = "durand4"
+ else
+ user.visible_message("[user] removes the wiring from [holder].", "You remove the wiring from [holder].")
+ var/obj/item/stack/cable_coil/coil = new /obj/item/stack/cable_coil(get_turf(holder))
+ coil.amount = 4
+ holder.icon_state = "durand2"
+ if(16)
+ if(diff==FORWARD)
+ user.visible_message("[user] installs the central control module into [holder].", "You install the central computer mainboard into [holder].")
+ qdel(I)
+ holder.icon_state = "durand5"
+ else
+ user.visible_message("[user] disconnects the wiring of [holder].", "You disconnect the wiring of [holder].")
+ holder.icon_state = "durand3"
+ if(15)
+ if(diff==FORWARD)
+ user.visible_message("[user] secures the mainboard.", "You secure the mainboard.")
+ holder.icon_state = "durand6"
+ else
+ user.visible_message("[user] removes the central control module from [holder].", "You remove the central computer mainboard from [holder].")
+ new /obj/item/weapon/circuitboard/mecha/durand/main(get_turf(holder))
+ holder.icon_state = "durand4"
+ if(14)
+ if(diff==FORWARD)
+ user.visible_message("[user] installs the peripherals control module into [holder].", "You install the peripherals control module into [holder].")
+ qdel(I)
+ holder.icon_state = "durand7"
+ else
+ user.visible_message("[user] unfastens the mainboard.", "You unfasten the mainboard.")
+ holder.icon_state = "durand5"
+ if(13)
+ if(diff==FORWARD)
+ user.visible_message("[user] secures the peripherals control module.", "You secure the peripherals control module.")
+ holder.icon_state = "durand8"
+ else
+ user.visible_message("[user] removes the peripherals control module from [holder].", "You remove the peripherals control module from [holder].")
+ new /obj/item/weapon/circuitboard/mecha/durand/peripherals(get_turf(holder))
+ holder.icon_state = "durand6"
+ if(12)
+ if(diff==FORWARD)
+ user.visible_message("[user] installs the weapon control module into [holder].", "You install the weapon control module into [holder].")
+ qdel(I)
+ holder.icon_state = "durand9"
+ else
+ user.visible_message("[user] unfastens the peripherals control module.", "You unfasten the peripherals control module.")
+ holder.icon_state = "durand7"
+ if(11)
+ if(diff==FORWARD)
+ user.visible_message("[user] secures the weapon control module.", "You secure the weapon control module.")
+ holder.icon_state = "durand10"
+ else
+ user.visible_message("[user] removes the weapon control module from [holder].", "You remove the weapon control module from [holder].")
+ new /obj/item/weapon/circuitboard/mecha/durand/targeting(get_turf(holder))
+ holder.icon_state = "durand8"
+ if(10)
+ if(diff==FORWARD)
+ user.visible_message("[user] installs advanced scanner module to [holder].", "You install advanced scanner module to [holder].")
+ qdel(I)
+ holder.icon_state = "durand11"
+ else
+ user.visible_message("[user] unfastens the weapon control module.", "You unfasten the weapon control module.")
+ holder.icon_state = "durand9"
+ if(9)
+ if(diff==FORWARD)
+ user.visible_message("[user] secures the advanced scanner module.", "You secure the advanced scanner module.")
+ holder.icon_state = "durand12"
+ else
+ user.visible_message("[user] removes the advanced scanner module from [holder].", "You remove the advanced scanner module from [holder].")
+ new /obj/item/weapon/stock_parts/scanning_module/adv(get_turf(holder))
+ holder.icon_state = "durand10"
+ if(8)
+ if(diff==FORWARD)
+ user.visible_message("[user] installs advanced capacitor to [holder].", "You install advanced capacitor to [holder].")
+ qdel(I)
+ holder.icon_state = "durand13"
+ else
+ user.visible_message("[user] unfastens the advanced scanner module.", "You unfasten the advanced scanner module.")
+ holder.icon_state = "durand11"
+ if(7)
+ if(diff==FORWARD)
+ user.visible_message("[user] secures the advanced capacitor.", "You secure the advanced capacitor.")
+ holder.icon_state = "durand14"
+ else
+ user.visible_message("[user] removes the advanced capacitor from [holder].", "You remove the advanced capacitor from [holder].")
+ new /obj/item/weapon/stock_parts/capacitor/adv(get_turf(holder))
+ holder.icon_state = "durand12"
+ if(6)
+ if(diff==FORWARD)
+ user.visible_message("[user] installs internal armor layer to [holder].", "You install internal armor layer to [holder].")
+ holder.icon_state = "durand15"
+ else
+ user.visible_message("[user] unfastens the advanced capacitor.", "You unfasten the advanced capacitor.")
+ holder.icon_state = "durand13"
+ if(5)
+ if(diff==FORWARD)
+ user.visible_message("[user] secures internal armor layer.", "You secure internal armor layer.")
+ holder.icon_state = "durand16"
+ else
+ user.visible_message("[user] pries internal armor layer from [holder].", "You prie internal armor layer from [holder].")
+ var/obj/item/stack/material/steel/MS = new /obj/item/stack/material/steel(get_turf(holder))
+ MS.amount = 5
+ holder.icon_state = "durand14"
+ if(4)
+ if(diff==FORWARD)
+ user.visible_message("[user] welds internal armor layer to [holder].", "You weld the internal armor layer to [holder].")
+ holder.icon_state = "durand17"
+ else
+ user.visible_message("[user] unfastens the internal armor layer.", "You unfasten the internal armor layer.")
+ holder.icon_state = "durand15"
+ if(3)
+ if(diff==FORWARD)
+ user.visible_message("[user] installs Durand Armour Plates to [holder].", "You install Durand Armour Plates to [holder].")
+ qdel(I)
+ holder.icon_state = "durand18"
+ else
+ user.visible_message("[user] cuts internal armor layer from [holder].", "You cut the internal armor layer from [holder].")
+ holder.icon_state = "durand16"
+ if(2)
+ if(diff==FORWARD)
+ user.visible_message("[user] secures Durand Armour Plates.", "You secure Durand Armour Plates.")
+ holder.icon_state = "durand19"
+ else
+ user.visible_message("[user] pries Durand Armour Plates from [holder].", "You prie Durand Armour Plates from [holder].")
+ new /obj/item/mecha_parts/part/durand_armour(get_turf(holder))
+ holder.icon_state = "durand17"
+ if(1)
+ if(diff==FORWARD)
+ user.visible_message("[user] welds Durand Armour Plates to [holder].", "You weld Durand Armour Plates to [holder].")
+ else
+ user.visible_message("[user] unfastens Durand Armour Plates.", "You unfasten Durand Armour Plates.")
+ holder.icon_state = "durand18"
+ return 1
- spawn_result()
- ..()
- feedback_inc("mecha_durand_created",1)
- return
+/datum/construction/reversible/mecha/durand/spawn_result()
+ ..()
+ feedback_inc("mecha_durand_created",1)
+ return
+
+////////////////////////
+// Odysseus
+////////////////////////
+/datum/construction/mecha/odysseus_chassis
+ steps = list(list("key"=/obj/item/mecha_parts/part/odysseus_torso),//1
+ list("key"=/obj/item/mecha_parts/part/odysseus_head),//2
+ list("key"=/obj/item/mecha_parts/part/odysseus_left_arm),//3
+ list("key"=/obj/item/mecha_parts/part/odysseus_right_arm),//4
+ list("key"=/obj/item/mecha_parts/part/odysseus_left_leg),//5
+ list("key"=/obj/item/mecha_parts/part/odysseus_right_leg)//6
+ )
+
+/datum/construction/mecha/odysseus_chassis/custom_action(step, obj/item/I, mob/user)
+ user.visible_message("[user] has connected [I] to [holder].", "You connect [I] to [holder]")
+ holder.overlays += I.icon_state+"+o"
+ qdel(I)
+ return 1
+
+/datum/construction/mecha/odysseus_chassis/action(obj/item/I,mob/user as mob)
+ return check_all_steps(I,user)
+
+/datum/construction/mecha/odysseus_chassis/spawn_result()
+ var/obj/item/mecha_parts/chassis/const_holder = holder
+ const_holder.construct = new /datum/construction/reversible/mecha/odysseus(const_holder)
+ const_holder.icon = 'icons/mecha/mech_construction.dmi'
+ const_holder.icon_state = "odysseus0"
+ const_holder.density = 1
+ spawn()
+ qdel(src)
+ return
+/datum/construction/reversible/mecha/odysseus
+ result = "/obj/mecha/medical/odysseus"
+ steps = list(
+ //1
+ list("key"=/obj/item/weapon/weldingtool,
+ "backkey"=IS_WRENCH,
+ "desc"="External armor is wrenched."),
+ //2
+ list("key"=IS_WRENCH,
+ "backkey"=IS_CROWBAR,
+ "desc"="External armor is installed."),
+ //3
+ list("key"=/obj/item/stack/material/plasteel,
+ "backkey"=/obj/item/weapon/weldingtool,
+ "desc"="Internal armor is welded."),
+ //4
+ list("key"=/obj/item/weapon/weldingtool,
+ "backkey"=IS_WRENCH,
+ "desc"="Internal armor is wrenched"),
+ //5
+ list("key"=IS_WRENCH,
+ "backkey"=IS_CROWBAR,
+ "desc"="Internal armor is installed"),
+ //6
+ list("key"=/obj/item/stack/material/steel,
+ "backkey"=IS_SCREWDRIVER,
+ "desc"="Peripherals control module is secured"),
+ //7
+ list("key"=IS_SCREWDRIVER,
+ "backkey"=IS_CROWBAR,
+ "desc"="Peripherals control module is installed"),
+ //8
+ list("key"=/obj/item/weapon/circuitboard/mecha/odysseus/peripherals,
+ "backkey"=IS_SCREWDRIVER,
+ "desc"="Central control module is secured"),
+ //9
+ list("key"=IS_SCREWDRIVER,
+ "backkey"=IS_CROWBAR,
+ "desc"="Central control module is installed"),
+ //10
+ list("key"=/obj/item/weapon/circuitboard/mecha/odysseus/main,
+ "backkey"=IS_SCREWDRIVER,
+ "desc"="The wiring is adjusted"),
+ //11
+ list("key"=/obj/item/weapon/tool/wirecutters,
+ "backkey"=IS_SCREWDRIVER,
+ "desc"="The wiring is added"),
+ //12
+ list("key"=/obj/item/stack/cable_coil,
+ "backkey"=IS_SCREWDRIVER,
+ "desc"="The hydraulic systems are active."),
+ //13
+ list("key"=IS_SCREWDRIVER,
+ "backkey"=IS_WRENCH,
+ "desc"="The hydraulic systems are connected."),
+ //14
+ list("key"=IS_WRENCH,
+ "desc"="The hydraulic systems are disconnected.")
+ )
+
+/datum/construction/reversible/mecha/odysseus/action(obj/item/I,mob/user as mob)
+ return check_step(I,user)
+
+/datum/construction/reversible/mecha/odysseus/custom_action(index, diff, obj/item/I, mob/user)
+ if(!..())
+ return 0
+
+ //TODO: better messages.
+ switch(index)
+ if(14)
+ user.visible_message("[user] connects [holder] hydraulic systems", "You connect [holder] hydraulic systems.")
+ holder.icon_state = "odysseus1"
+ if(13)
+ if(diff==FORWARD)
+ user.visible_message("[user] activates [holder] hydraulic systems.", "You activate [holder] hydraulic systems.")
+ holder.icon_state = "odysseus2"
+ else
+ user.visible_message("[user] disconnects [holder] hydraulic systems", "You disconnect [holder] hydraulic systems.")
+ holder.icon_state = "odysseus0"
+ if(12)
+ if(diff==FORWARD)
+ user.visible_message("[user] adds the wiring to [holder].", "You add the wiring to [holder].")
+ holder.icon_state = "odysseus3"
+ else
+ user.visible_message("[user] deactivates [holder] hydraulic systems.", "You deactivate [holder] hydraulic systems.")
+ holder.icon_state = "odysseus1"
+ if(11)
+ if(diff==FORWARD)
+ user.visible_message("[user] adjusts the wiring of [holder].", "You adjust the wiring of [holder].")
+ holder.icon_state = "odysseus4"
+ else
+ user.visible_message("[user] removes the wiring from [holder].", "You remove the wiring from [holder].")
+ var/obj/item/stack/cable_coil/coil = new /obj/item/stack/cable_coil(get_turf(holder))
+ coil.amount = 4
+ holder.icon_state = "odysseus2"
+ if(10)
+ if(diff==FORWARD)
+ user.visible_message("[user] installs the central control module into [holder].", "You install the central computer mainboard into [holder].")
+ qdel(I)
+ holder.icon_state = "odysseus5"
+ else
+ user.visible_message("[user] disconnects the wiring of [holder].", "You disconnect the wiring of [holder].")
+ holder.icon_state = "odysseus3"
+ if(9)
+ if(diff==FORWARD)
+ user.visible_message("[user] secures the mainboard.", "You secure the mainboard.")
+ holder.icon_state = "odysseus6"
+ else
+ user.visible_message("[user] removes the central control module from [holder].", "You remove the central computer mainboard from [holder].")
+ new /obj/item/weapon/circuitboard/mecha/odysseus/main(get_turf(holder))
+ holder.icon_state = "odysseus4"
+ if(8)
+ if(diff==FORWARD)
+ user.visible_message("[user] installs the peripherals control module into [holder].", "You install the peripherals control module into [holder].")
+ qdel(I)
+ holder.icon_state = "odysseus7"
+ else
+ user.visible_message("[user] unfastens the mainboard.", "You unfasten the mainboard.")
+ holder.icon_state = "odysseus5"
+ if(7)
+ if(diff==FORWARD)
+ user.visible_message("[user] secures the peripherals control module.", "You secure the peripherals control module.")
+ holder.icon_state = "odysseus8"
+ else
+ user.visible_message("[user] removes the peripherals control module from [holder].", "You remove the peripherals control module from [holder].")
+ new /obj/item/weapon/circuitboard/mecha/odysseus/peripherals(get_turf(holder))
+ holder.icon_state = "odysseus6"
+ if(6)
+ if(diff==FORWARD)
+ user.visible_message("[user] installs internal armor layer to [holder].", "You install internal armor layer to [holder].")
+ holder.icon_state = "odysseus9"
+ else
+ user.visible_message("[user] unfastens the peripherals control module.", "You unfasten the peripherals control module.")
+ holder.icon_state = "odysseus7"
+ if(5)
+ if(diff==FORWARD)
+ user.visible_message("[user] secures internal armor layer.", "You secure internal armor layer.")
+ holder.icon_state = "odysseus10"
+ else
+ user.visible_message("[user] pries internal armor layer from [holder].", "You prie internal armor layer from [holder].")
+ var/obj/item/stack/material/steel/MS = new /obj/item/stack/material/steel(get_turf(holder))
+ MS.amount = 5
+ holder.icon_state = "odysseus8"
+ if(4)
+ if(diff==FORWARD)
+ user.visible_message("[user] welds internal armor layer to [holder].", "You weld the internal armor layer to [holder].")
+ holder.icon_state = "odysseus11"
+ else
+ user.visible_message("[user] unfastens the internal armor layer.", "You unfasten the internal armor layer.")
+ holder.icon_state = "odysseus9"
+ if(3)
+ if(diff==FORWARD)
+ user.visible_message("[user] installs [I] layer to [holder].", "You install external reinforced armor layer to [holder].")
+ holder.icon_state = "odysseus12"
+ else
+ user.visible_message("[user] cuts internal armor layer from [holder].", "You cut the internal armor layer from [holder].")
+ holder.icon_state = "odysseus10"
+ if(2)
+ if(diff==FORWARD)
+ user.visible_message("[user] secures external armor layer.", "You secure external reinforced armor layer.")
+ holder.icon_state = "odysseus13"
+ else
+ var/obj/item/stack/material/plasteel/MS = new /obj/item/stack/material/plasteel(get_turf(holder))
+ MS.amount = 5
+ user.visible_message("[user] pries [MS] from [holder].", "You prie [MS] from [holder].")
+ holder.icon_state = "odysseus11"
+ if(1)
+ if(diff==FORWARD)
+ user.visible_message("[user] welds external armor layer to [holder].", "You weld external armor layer to [holder].")
+ holder.icon_state = "odysseus14"
+ else
+ user.visible_message("[user] unfastens the external armor layer.", "You unfasten the external armor layer.")
+ holder.icon_state = "odysseus12"
+ return 1
+
+/datum/construction/reversible/mecha/odysseus/spawn_result()
+ ..()
+ feedback_inc("mecha_odysseus_created",1)
+ return
+
+//////////////////////
+// Phazon
+//////////////////////
/datum/construction/mecha/phazon_chassis
result = "/obj/mecha/combat/phazon"
steps = list(list("key"=/obj/item/mecha_parts/part/phazon_torso),//1
@@ -1072,224 +1294,11 @@
list("key"=/obj/item/mecha_parts/part/phazon_head)
)
- custom_action(step, atom/used_atom, mob/user)
- user.visible_message("[user] has connected [used_atom] to [holder].", "You connect [used_atom] to [holder]")
- holder.overlays += used_atom.icon_state+"+o"
- qdel(used_atom)
- return 1
+/datum/construction/mecha/phazon_chassis/custom_action(step, obj/item/I, mob/user)
+ user.visible_message("[user] has connected [I] to [holder].", "You connect [I] to [holder]")
+ holder.overlays += I.icon_state+"+o"
+ qdel(I)
+ return 1
- action(atom/used_atom,mob/user as mob)
- return check_all_steps(used_atom,user)
-
-
-
-
-/datum/construction/mecha/odysseus_chassis
- steps = list(list("key"=/obj/item/mecha_parts/part/odysseus_torso),//1
- list("key"=/obj/item/mecha_parts/part/odysseus_head),//2
- list("key"=/obj/item/mecha_parts/part/odysseus_left_arm),//3
- list("key"=/obj/item/mecha_parts/part/odysseus_right_arm),//4
- list("key"=/obj/item/mecha_parts/part/odysseus_left_leg),//5
- list("key"=/obj/item/mecha_parts/part/odysseus_right_leg)//6
- )
-
- custom_action(step, atom/used_atom, mob/user)
- user.visible_message("[user] has connected [used_atom] to [holder].", "You connect [used_atom] to [holder]")
- holder.overlays += used_atom.icon_state+"+o"
- qdel(used_atom)
- return 1
-
- action(atom/used_atom,mob/user as mob)
- return check_all_steps(used_atom,user)
-
- spawn_result()
- var/obj/item/mecha_parts/chassis/const_holder = holder
- const_holder.construct = new /datum/construction/reversible/mecha/odysseus(const_holder)
- const_holder.icon = 'icons/mecha/mech_construction.dmi'
- const_holder.icon_state = "odysseus0"
- const_holder.density = 1
- spawn()
- qdel(src)
- return
-
-
-/datum/construction/reversible/mecha/odysseus
- result = "/obj/mecha/medical/odysseus"
- steps = list(
- //1
- list("key"=/obj/item/weapon/weldingtool,
- "backkey"=/obj/item/weapon/wrench,
- "desc"="External armor is wrenched."),
- //2
- list("key"=/obj/item/weapon/wrench,
- "backkey"=/obj/item/weapon/crowbar,
- "desc"="External armor is installed."),
- //3
- list("key"=/obj/item/stack/material/plasteel,
- "backkey"=/obj/item/weapon/weldingtool,
- "desc"="Internal armor is welded."),
- //4
- list("key"=/obj/item/weapon/weldingtool,
- "backkey"=/obj/item/weapon/wrench,
- "desc"="Internal armor is wrenched"),
- //5
- list("key"=/obj/item/weapon/wrench,
- "backkey"=/obj/item/weapon/crowbar,
- "desc"="Internal armor is installed"),
- //6
- list("key"=/obj/item/stack/material/steel,
- "backkey"=/obj/item/weapon/screwdriver,
- "desc"="Peripherals control module is secured"),
- //7
- list("key"=/obj/item/weapon/screwdriver,
- "backkey"=/obj/item/weapon/crowbar,
- "desc"="Peripherals control module is installed"),
- //8
- list("key"=/obj/item/weapon/circuitboard/mecha/odysseus/peripherals,
- "backkey"=/obj/item/weapon/screwdriver,
- "desc"="Central control module is secured"),
- //9
- list("key"=/obj/item/weapon/screwdriver,
- "backkey"=/obj/item/weapon/crowbar,
- "desc"="Central control module is installed"),
- //10
- list("key"=/obj/item/weapon/circuitboard/mecha/odysseus/main,
- "backkey"=/obj/item/weapon/screwdriver,
- "desc"="The wiring is adjusted"),
- //11
- list("key"=/obj/item/weapon/wirecutters,
- "backkey"=/obj/item/weapon/screwdriver,
- "desc"="The wiring is added"),
- //12
- list("key"=/obj/item/stack/cable_coil,
- "backkey"=/obj/item/weapon/screwdriver,
- "desc"="The hydraulic systems are active."),
- //13
- list("key"=/obj/item/weapon/screwdriver,
- "backkey"=/obj/item/weapon/wrench,
- "desc"="The hydraulic systems are connected."),
- //14
- list("key"=/obj/item/weapon/wrench,
- "desc"="The hydraulic systems are disconnected.")
- )
-
- action(atom/used_atom,mob/user as mob)
- return check_step(used_atom,user)
-
- custom_action(index, diff, atom/used_atom, mob/user)
- if(!..())
- return 0
-
- //TODO: better messages.
- switch(index)
- if(14)
- user.visible_message("[user] connects [holder] hydraulic systems", "You connect [holder] hydraulic systems.")
- holder.icon_state = "odysseus1"
- if(13)
- if(diff==FORWARD)
- user.visible_message("[user] activates [holder] hydraulic systems.", "You activate [holder] hydraulic systems.")
- holder.icon_state = "odysseus2"
- else
- user.visible_message("[user] disconnects [holder] hydraulic systems", "You disconnect [holder] hydraulic systems.")
- holder.icon_state = "odysseus0"
- if(12)
- if(diff==FORWARD)
- user.visible_message("[user] adds the wiring to [holder].", "You add the wiring to [holder].")
- holder.icon_state = "odysseus3"
- else
- user.visible_message("[user] deactivates [holder] hydraulic systems.", "You deactivate [holder] hydraulic systems.")
- holder.icon_state = "odysseus1"
- if(11)
- if(diff==FORWARD)
- user.visible_message("[user] adjusts the wiring of [holder].", "You adjust the wiring of [holder].")
- holder.icon_state = "odysseus4"
- else
- user.visible_message("[user] removes the wiring from [holder].", "You remove the wiring from [holder].")
- var/obj/item/stack/cable_coil/coil = new /obj/item/stack/cable_coil(get_turf(holder))
- coil.amount = 4
- holder.icon_state = "odysseus2"
- if(10)
- if(diff==FORWARD)
- user.visible_message("[user] installs the central control module into [holder].", "You install the central computer mainboard into [holder].")
- qdel(used_atom)
- holder.icon_state = "odysseus5"
- else
- user.visible_message("[user] disconnects the wiring of [holder].", "You disconnect the wiring of [holder].")
- holder.icon_state = "odysseus3"
- if(9)
- if(diff==FORWARD)
- user.visible_message("[user] secures the mainboard.", "You secure the mainboard.")
- holder.icon_state = "odysseus6"
- else
- user.visible_message("[user] removes the central control module from [holder].", "You remove the central computer mainboard from [holder].")
- new /obj/item/weapon/circuitboard/mecha/odysseus/main(get_turf(holder))
- holder.icon_state = "odysseus4"
- if(8)
- if(diff==FORWARD)
- user.visible_message("[user] installs the peripherals control module into [holder].", "You install the peripherals control module into [holder].")
- qdel(used_atom)
- holder.icon_state = "odysseus7"
- else
- user.visible_message("[user] unfastens the mainboard.", "You unfasten the mainboard.")
- holder.icon_state = "odysseus5"
- if(7)
- if(diff==FORWARD)
- user.visible_message("[user] secures the peripherals control module.", "You secure the peripherals control module.")
- holder.icon_state = "odysseus8"
- else
- user.visible_message("[user] removes the peripherals control module from [holder].", "You remove the peripherals control module from [holder].")
- new /obj/item/weapon/circuitboard/mecha/odysseus/peripherals(get_turf(holder))
- holder.icon_state = "odysseus6"
- if(6)
- if(diff==FORWARD)
- user.visible_message("[user] installs internal armor layer to [holder].", "You install internal armor layer to [holder].")
- holder.icon_state = "odysseus9"
- else
- user.visible_message("[user] unfastens the peripherals control module.", "You unfasten the peripherals control module.")
- holder.icon_state = "odysseus7"
- if(5)
- if(diff==FORWARD)
- user.visible_message("[user] secures internal armor layer.", "You secure internal armor layer.")
- holder.icon_state = "odysseus10"
- else
- user.visible_message("[user] pries internal armor layer from [holder].", "You prie internal armor layer from [holder].")
- var/obj/item/stack/material/steel/MS = new /obj/item/stack/material/steel(get_turf(holder))
- MS.amount = 5
- holder.icon_state = "odysseus8"
- if(4)
- if(diff==FORWARD)
- user.visible_message("[user] welds internal armor layer to [holder].", "You weld the internal armor layer to [holder].")
- holder.icon_state = "odysseus11"
- else
- user.visible_message("[user] unfastens the internal armor layer.", "You unfasten the internal armor layer.")
- holder.icon_state = "odysseus9"
- if(3)
- if(diff==FORWARD)
- user.visible_message("[user] installs [used_atom] layer to [holder].", "You install external reinforced armor layer to [holder].")
-
- holder.icon_state = "odysseus12"
- else
- user.visible_message("[user] cuts internal armor layer from [holder].", "You cut the internal armor layer from [holder].")
- holder.icon_state = "odysseus10"
- if(2)
- if(diff==FORWARD)
- user.visible_message("[user] secures external armor layer.", "You secure external reinforced armor layer.")
- holder.icon_state = "odysseus13"
- else
- var/obj/item/stack/material/plasteel/MS = new /obj/item/stack/material/plasteel(get_turf(holder))
- MS.amount = 5
- user.visible_message("[user] pries [MS] from [holder].", "You prie [MS] from [holder].")
- holder.icon_state = "odysseus11"
- if(1)
- if(diff==FORWARD)
- user.visible_message("[user] welds external armor layer to [holder].", "You weld external armor layer to [holder].")
- holder.icon_state = "odysseus14"
- else
- user.visible_message("[user] unfastens the external armor layer.", "You unfasten the external armor layer.")
- holder.icon_state = "odysseus12"
- return 1
-
- spawn_result()
- ..()
- feedback_inc("mecha_odysseus_created",1)
- return
+/datum/construction/mecha/phazon_chassis/action(obj/item/I,mob/user as mob)
+ return check_all_steps(I,user)
\ No newline at end of file
diff --git a/code/game/mecha/mecha_wreckage.dm b/code/game/mecha/mecha_wreckage.dm
index 39620c4742..73cee1223b 100644
--- a/code/game/mecha/mecha_wreckage.dm
+++ b/code/game/mecha/mecha_wreckage.dm
@@ -34,7 +34,7 @@
if(istype(W, /obj/item/weapon/weldingtool))
var/obj/item/weapon/weldingtool/WT = W
if(salvage_num <= 0)
- user << "You don't see anything that can be cut with [W]."
+ to_chat(user, "You don't see anything that can be cut with [W].")
return
if (!isemptylist(welder_salvage) && WT.remove_fuel(0,user))
var/type = prob(70)?pick(welder_salvage):null
@@ -45,13 +45,13 @@
welder_salvage -= type
salvage_num--
else
- user << "You failed to salvage anything valuable from [src]."
+ to_chat(user, "You failed to salvage anything valuable from [src].")
else
- user << "You need more welding fuel to complete this task."
+ to_chat(user, "You need more welding fuel to complete this task.")
return
- if(istype(W, /obj/item/weapon/wirecutters))
+ if(W.is_wirecutter())
if(salvage_num <= 0)
- user << "You don't see anything that can be cut with [W]."
+ to_chat(user, "You don't see anything that can be cut with [W].")
return
else if(!isemptylist(wirecutters_salvage))
var/type = prob(70)?pick(wirecutters_salvage):null
@@ -60,8 +60,8 @@
user.visible_message("[user] cuts [N] from [src].", "You cut [N] from [src].")
salvage_num--
else
- user << "You failed to salvage anything valuable from [src]."
- if(istype(W, /obj/item/weapon/crowbar))
+ to_chat(user, "You failed to salvage anything valuable from [src].")
+ if(W.is_crowbar())
if(!isemptylist(crowbar_salvage))
var/obj/S = pick(crowbar_salvage)
if(S)
@@ -70,7 +70,7 @@
user.visible_message("[user] pries [S] from [src].", "You pry [S] from [src].")
return
else
- user << "You don't see anything that can be pried with [W]."
+ to_chat(user, "You don't see anything that can be pried with [W].")
else
..()
return
diff --git a/code/game/mecha/medical/medical.dm b/code/game/mecha/medical/medical.dm
index e112f7a232..adb75800ea 100644
--- a/code/game/mecha/medical/medical.dm
+++ b/code/game/mecha/medical/medical.dm
@@ -1,3 +1,12 @@
+/obj/mecha/medical
+ max_hull_equip = 1
+ max_weapon_equip = 0
+ max_utility_equip = 2
+ max_universal_equip = 1
+ max_special_equip = 1
+
+ cargo_capacity = 1
+
/obj/mecha/medical/initialize()
. = ..()
var/turf/T = get_turf(src)
diff --git a/code/game/mecha/medical/odysseus.dm b/code/game/mecha/medical/odysseus.dm
index 90577eaf64..8a1242d1a2 100644
--- a/code/game/mecha/medical/odysseus.dm
+++ b/code/game/mecha/medical/odysseus.dm
@@ -1,4 +1,4 @@
-/obj/mecha/medical/odysseus
+/obj/mecha/medical/odysseus/
desc = "These exosuits are developed and produced by Vey-Med. (© All rights reserved)."
name = "Odysseus"
icon_state = "odysseus"
@@ -6,36 +6,37 @@
step_in = 2
max_temperature = 15000
health = 120
+ maxhealth = 120
wreckage = /obj/effect/decal/mecha_wreckage/odysseus
internal_damage_threshold = 35
deflect_chance = 15
step_energy_drain = 6
var/obj/item/clothing/glasses/hud/health/mech/hud
- New()
- ..()
- hud = new /obj/item/clothing/glasses/hud/health/mech(src)
- return
+/obj/mecha/medical/odysseus/New()
+ ..()
+ hud = new /obj/item/clothing/glasses/hud/health/mech(src)
+ return
- moved_inside(var/mob/living/carbon/human/H as mob)
- if(..())
- if(H.glasses)
- occupant_message("[H.glasses] prevent you from using [src] [hud]")
- else
- H.glasses = hud
- H.recalculate_vis()
- return 1
+/obj/mecha/medical/odysseus/moved_inside(var/mob/living/carbon/human/H as mob)
+ if(..())
+ if(H.glasses)
+ occupant_message("[H.glasses] prevent you from using [src] [hud]")
else
- return 0
+ H.glasses = hud
+ H.recalculate_vis()
+ return 1
+ else
+ return 0
- go_out()
- if(ishuman(occupant))
- var/mob/living/carbon/human/H = occupant
- if(H.glasses == hud)
- H.glasses = null
- H.recalculate_vis()
- ..()
- return
+/obj/mecha/medical/odysseus/go_out()
+ if(ishuman(occupant))
+ var/mob/living/carbon/human/H = occupant
+ if(H.glasses == hud)
+ H.glasses = null
+ H.recalculate_vis()
+ ..()
+ return
/*
verb/set_perspective()
set name = "Set client perspective."
diff --git a/code/game/mecha/micro/mecha_construction_paths_vr.dm b/code/game/mecha/micro/mecha_construction_paths_vr.dm
index 305cdfcf92..6857d7b1c4 100644
--- a/code/game/mecha/micro/mecha_construction_paths_vr.dm
+++ b/code/game/mecha/micro/mecha_construction_paths_vr.dm
@@ -33,11 +33,11 @@
steps = list(
//1
list("key"=/obj/item/weapon/weldingtool,
- "backkey"=/obj/item/weapon/wrench,
+ "backkey"=IS_WRENCH,
"desc"="External armor is wrenched."),
//2
- list("key"=/obj/item/weapon/wrench,
- "backkey"=/obj/item/weapon/crowbar,
+ list("key"=IS_WRENCH,
+ "backkey"=IS_CROWBAR,
"desc"="External armor is installed."),
//3
list("key"=/obj/item/mecha_parts/micro/part/polecat_armour,
@@ -45,70 +45,70 @@
"desc"="Internal armor is welded."),
//4
list("key"=/obj/item/weapon/weldingtool,
- "backkey"=/obj/item/weapon/wrench,
+ "backkey"=IS_WRENCH,
"desc"="Internal armor is wrenched"),
//5
- list("key"=/obj/item/weapon/wrench,
- "backkey"=/obj/item/weapon/crowbar,
+ list("key"=IS_WRENCH,
+ "backkey"=IS_CROWBAR,
"desc"="Internal armor is installed"),
//6
list("key"=/obj/item/stack/material/steel,
- "backkey"=/obj/item/weapon/screwdriver,
+ "backkey"=IS_SCREWDRIVER,
"desc"="Advanced capacitor is secured"),
//7
- list("key"=/obj/item/weapon/screwdriver,
- "backkey"=/obj/item/weapon/crowbar,
+ list("key"=IS_SCREWDRIVER,
+ "backkey"=IS_CROWBAR,
"desc"="Advanced capacitor is installed"),
//8
list("key"=/obj/item/weapon/stock_parts/capacitor/adv,
- "backkey"=/obj/item/weapon/screwdriver,
+ "backkey"=IS_SCREWDRIVER,
"desc"="Advanced scanner module is secured"),
//9
- list("key"=/obj/item/weapon/screwdriver,
- "backkey"=/obj/item/weapon/crowbar,
+ list("key"=IS_SCREWDRIVER,
+ "backkey"=IS_CROWBAR,
"desc"="Advanced scanner module is installed"),
//10
list("key"=/obj/item/weapon/stock_parts/scanning_module/adv,
- "backkey"=/obj/item/weapon/screwdriver,
+ "backkey"=IS_SCREWDRIVER,
"desc"="Targeting module is secured"),
//11
- list("key"=/obj/item/weapon/screwdriver,
- "backkey"=/obj/item/weapon/crowbar,
+ list("key"=IS_SCREWDRIVER,
+ "backkey"=IS_CROWBAR,
"desc"="Targeting module is installed"),
//12
list("key"=/obj/item/weapon/circuitboard/mecha/polecat/targeting,
- "backkey"=/obj/item/weapon/screwdriver,
+ "backkey"=IS_SCREWDRIVER,
"desc"="Peripherals control module is secured"),
//13
- list("key"=/obj/item/weapon/screwdriver,
- "backkey"=/obj/item/weapon/crowbar,
+ list("key"=IS_SCREWDRIVER,
+ "backkey"=IS_CROWBAR,
"desc"="Peripherals control module is installed"),
//14
list("key"=/obj/item/weapon/circuitboard/mecha/polecat/peripherals,
- "backkey"=/obj/item/weapon/screwdriver,
+ "backkey"=IS_SCREWDRIVER,
"desc"="Central control module is secured"),
//15
- list("key"=/obj/item/weapon/screwdriver,
- "backkey"=/obj/item/weapon/crowbar,
+ list("key"=IS_SCREWDRIVER,
+ "backkey"=IS_CROWBAR,
"desc"="Central control module is installed"),
//16
list("key"=/obj/item/weapon/circuitboard/mecha/polecat/main,
- "backkey"=/obj/item/weapon/screwdriver,
+ "backkey"=IS_SCREWDRIVER,
"desc"="The wiring is adjusted"),
//17
- list("key"=/obj/item/weapon/wirecutters,
- "backkey"=/obj/item/weapon/screwdriver,
+ list("key"=IS_WIRECUTTER,
+ "backkey"=IS_SCREWDRIVER,
"desc"="The wiring is added"),
//18
list("key"=/obj/item/stack/cable_coil,
- "backkey"=/obj/item/weapon/screwdriver,
+ "backkey"=IS_SCREWDRIVER,
"desc"="The hydraulic systems are active."),
//19
- list("key"=/obj/item/weapon/screwdriver,
- "backkey"=/obj/item/weapon/wrench,
+ list("key"=IS_SCREWDRIVER,
+ "backkey"=IS_WRENCH,
"desc"="The hydraulic systems are connected."),
//20
- list("key"=/obj/item/weapon/wrench,
+ list("key"=IS_WRENCH,
"desc"="The hydraulic systems are disconnected.")
)
@@ -313,11 +313,11 @@
steps = list(
//1
list("key"=/obj/item/weapon/weldingtool,
- "backkey"=/obj/item/weapon/wrench,
+ "backkey"=IS_WRENCH,
"desc"="External armor is wrenched."),
//2
- list("key"=/obj/item/weapon/wrench,
- "backkey"=/obj/item/weapon/crowbar,
+ list("key"=IS_WRENCH,
+ "backkey"=IS_CROWBAR,
"desc"="External armor is installed."),
//3
list("key"=/obj/item/stack/material/plasteel,
@@ -325,46 +325,46 @@
"desc"="Internal armor is welded."),
//4
list("key"=/obj/item/weapon/weldingtool,
- "backkey"=/obj/item/weapon/wrench,
+ "backkey"=IS_WRENCH,
"desc"="Internal armor is wrenched"),
//5
- list("key"=/obj/item/weapon/wrench,
- "backkey"=/obj/item/weapon/crowbar,
+ list("key"=IS_WRENCH,
+ "backkey"=IS_CROWBAR,
"desc"="Internal armor is installed"),
//6
list("key"=/obj/item/stack/material/steel,
- "backkey"=/obj/item/weapon/screwdriver,
+ "backkey"=IS_SCREWDRIVER,
"desc"="Peripherals control module is secured"),
//7
- list("key"=/obj/item/weapon/screwdriver,
- "backkey"=/obj/item/weapon/crowbar,
+ list("key"=IS_SCREWDRIVER,
+ "backkey"=IS_CROWBAR,
"desc"="Peripherals control module is installed"),
//8
list("key"=/obj/item/weapon/circuitboard/mecha/gopher/peripherals,
- "backkey"=/obj/item/weapon/screwdriver,
+ "backkey"=IS_SCREWDRIVER,
"desc"="Central control module is secured"),
//9
- list("key"=/obj/item/weapon/screwdriver,
- "backkey"=/obj/item/weapon/crowbar,
+ list("key"=IS_SCREWDRIVER,
+ "backkey"=IS_CROWBAR,
"desc"="Central control module is installed"),
//10
list("key"=/obj/item/weapon/circuitboard/mecha/gopher/main,
- "backkey"=/obj/item/weapon/screwdriver,
+ "backkey"=IS_SCREWDRIVER,
"desc"="The wiring is adjusted"),
//11
- list("key"=/obj/item/weapon/wirecutters,
- "backkey"=/obj/item/weapon/screwdriver,
+ list("key"=IS_WIRECUTTER,
+ "backkey"=IS_SCREWDRIVER,
"desc"="The wiring is added"),
//12
list("key"=/obj/item/stack/cable_coil,
- "backkey"=/obj/item/weapon/screwdriver,
+ "backkey"=IS_SCREWDRIVER,
"desc"="The hydraulic systems are active."),
//13
- list("key"=/obj/item/weapon/screwdriver,
- "backkey"=/obj/item/weapon/wrench,
+ list("key"=IS_SCREWDRIVER,
+ "backkey"=IS_WRENCH,
"desc"="The hydraulic systems are connected."),
//14
- list("key"=/obj/item/weapon/wrench,
+ list("key"=IS_WRENCH,
"desc"="The hydraulic systems are disconnected.")
)
@@ -521,11 +521,11 @@
steps = list(
//1
list("key"=/obj/item/weapon/weldingtool,
- "backkey"=/obj/item/weapon/wrench,
+ "backkey"=IS_WRENCH,
"desc"="External armor is wrenched."),
//2
- list("key"=/obj/item/weapon/wrench,
- "backkey"=/obj/item/weapon/crowbar,
+ list("key"=IS_WRENCH,
+ "backkey"=IS_CROWBAR,
"desc"="External armor is installed."),
//3
list("key"=/obj/item/stack/material/plasteel,
@@ -533,70 +533,70 @@
"desc"="Internal armor is welded."),
//4
list("key"=/obj/item/weapon/weldingtool,
- "backkey"=/obj/item/weapon/wrench,
+ "backkey"=IS_WRENCH,
"desc"="Internal armor is wrenched"),
//5
- list("key"=/obj/item/weapon/wrench,
- "backkey"=/obj/item/weapon/crowbar,
+ list("key"=IS_WRENCH,
+ "backkey"=IS_CROWBAR,
"desc"="Internal armor is installed"),
//6
list("key"=/obj/item/stack/material/steel,
- "backkey"=/obj/item/weapon/screwdriver,
+ "backkey"=IS_SCREWDRIVER,
"desc"="Advanced capacitor is secured"),
//7
- list("key"=/obj/item/weapon/screwdriver,
- "backkey"=/obj/item/weapon/crowbar,
+ list("key"=IS_SCREWDRIVER,
+ "backkey"=IS_CROWBAR,
"desc"="Advanced capacitor is installed"),
//8
list("key"=/obj/item/weapon/stock_parts/capacitor/adv,
- "backkey"=/obj/item/weapon/screwdriver,
+ "backkey"=IS_SCREWDRIVER,
"desc"="Advanced scanner module is secured"),
//9
- list("key"=/obj/item/weapon/screwdriver,
- "backkey"=/obj/item/weapon/crowbar,
+ list("key"=IS_SCREWDRIVER,
+ "backkey"=IS_CROWBAR,
"desc"="Advanced scanner module is installed"),
//10
list("key"=/obj/item/weapon/stock_parts/scanning_module/adv,
- "backkey"=/obj/item/weapon/screwdriver,
+ "backkey"=IS_SCREWDRIVER,
"desc"="Targeting module is secured"),
//11
- list("key"=/obj/item/weapon/screwdriver,
- "backkey"=/obj/item/weapon/crowbar,
+ list("key"=IS_SCREWDRIVER,
+ "backkey"=IS_CROWBAR,
"desc"="Targeting module is installed"),
//12
list("key"=/obj/item/weapon/circuitboard/mecha/weasel/targeting,
- "backkey"=/obj/item/weapon/screwdriver,
+ "backkey"=IS_SCREWDRIVER,
"desc"="Peripherals control module is secured"),
//13
- list("key"=/obj/item/weapon/screwdriver,
- "backkey"=/obj/item/weapon/crowbar,
+ list("key"=IS_SCREWDRIVER,
+ "backkey"=IS_CROWBAR,
"desc"="Peripherals control module is installed"),
//14
list("key"=/obj/item/weapon/circuitboard/mecha/weasel/peripherals,
- "backkey"=/obj/item/weapon/screwdriver,
+ "backkey"=IS_SCREWDRIVER,
"desc"="Central control module is secured"),
//15
- list("key"=/obj/item/weapon/screwdriver,
- "backkey"=/obj/item/weapon/crowbar,
+ list("key"=IS_SCREWDRIVER,
+ "backkey"=IS_CROWBAR,
"desc"="Central control module is installed"),
//16
list("key"=/obj/item/weapon/circuitboard/mecha/weasel/main,
- "backkey"=/obj/item/weapon/screwdriver,
+ "backkey"=IS_SCREWDRIVER,
"desc"="The wiring is adjusted"),
//17
- list("key"=/obj/item/weapon/wirecutters,
- "backkey"=/obj/item/weapon/screwdriver,
+ list("key"=IS_WIRECUTTER,
+ "backkey"=IS_SCREWDRIVER,
"desc"="The wiring is added"),
//18
list("key"=/obj/item/stack/cable_coil,
- "backkey"=/obj/item/weapon/screwdriver,
+ "backkey"=IS_SCREWDRIVER,
"desc"="The hydraulic systems are active."),
//19
- list("key"=/obj/item/weapon/screwdriver,
- "backkey"=/obj/item/weapon/wrench,
+ list("key"=IS_SCREWDRIVER,
+ "backkey"=IS_WRENCH,
"desc"="The hydraulic systems are connected."),
//20
- list("key"=/obj/item/weapon/wrench,
+ list("key"=IS_WRENCH,
"desc"="The hydraulic systems are disconnected.")
)
diff --git a/code/game/mecha/micro/mechfab_designs_vr.dm b/code/game/mecha/micro/mechfab_designs_vr.dm
index 940d7607e3..7a86d8d9ec 100644
--- a/code/game/mecha/micro/mechfab_designs_vr.dm
+++ b/code/game/mecha/micro/mechfab_designs_vr.dm
@@ -124,7 +124,7 @@
name = "\improper FP-20 mounted grenade launcher"
id = "micro_flashbang_launcher"
// req_tech = list(TECH_COMBAT = 3)
- build_path = /obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/flashbang/microflashbang
+ build_path = /obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/grenade/microflashbang
/datum/design/item/mecha/weapon/scattershot/micro
name = "\improper Remington C-12 \"Boomstick\""
diff --git a/code/game/mecha/micro/micro_equipment.dm b/code/game/mecha/micro/micro_equipment.dm
index b7892c32c7..805148512d 100644
--- a/code/game/mecha/micro/micro_equipment.dm
+++ b/code/game/mecha/micro/micro_equipment.dm
@@ -78,7 +78,7 @@
return "[..()] \[BS|BB|S\]"
-/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/flashbang/microflashbang
+/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/grenade/microflashbang
w_class = ITEMSIZE_LARGE
desc = "A mounted grenade launcher for smaller mechs."
name = "\improper FP-20 mounted grenade launcher"
diff --git a/code/game/mecha/working/hoverpod.dm b/code/game/mecha/working/hoverpod.dm
index b0448c69a0..8a79b5a8ac 100644
--- a/code/game/mecha/working/hoverpod.dm
+++ b/code/game/mecha/working/hoverpod.dm
@@ -8,6 +8,7 @@
step_energy_drain = 10
max_temperature = 20000
health = 150
+ maxhealth = 150
infra_luminosity = 6
wreckage = /obj/effect/decal/mecha_wreckage/hoverpod
cargo_capacity = 5
@@ -15,6 +16,12 @@
var/datum/effect/effect/system/ion_trail_follow/ion_trail
var/stabilization_enabled = 1
+ max_hull_equip = 2
+ max_weapon_equip = 0
+ max_utility_equip = 2
+ max_universal_equip = 1
+ max_special_equip = 1
+
/obj/mecha/working/hoverpod/New()
..()
ion_trail = new /datum/effect/effect/system/ion_trail_follow()
@@ -51,7 +58,7 @@
ion_trail.start()
if (stabilization_enabled)
return 1
-
+
return ..()
//these three procs overriden to play different sounds
@@ -79,9 +86,15 @@
desc = "An ancient, run-down combat spacecraft." // Ideally would have a seperate icon.
name = "Combat Hoverpod"
health = 200
+ maxhealth = 200
internal_damage_threshold = 35
cargo_capacity = 2
max_equip = 2
+ max_hull_equip = 2
+ max_weapon_equip = 2
+ max_utility_equip = 2
+ max_universal_equip = 1
+ max_special_equip = 1
/obj/mecha/working/hoverpod/combatpod/New()
..()
diff --git a/code/game/mecha/working/ripley.dm b/code/game/mecha/working/ripley.dm
index 868429095a..c4813bb0dd 100644
--- a/code/game/mecha/working/ripley.dm
+++ b/code/game/mecha/working/ripley.dm
@@ -7,6 +7,7 @@
step_energy_drain = 5 // vorestation edit because 10 drained a significant chunk of its cell before you even got out the airlock
max_temperature = 20000
health = 200
+ maxhealth = 200
wreckage = /obj/effect/decal/mecha_wreckage/ripley
cargo_capacity = 10
var/obj/item/weapon/mining_scanner/orescanner // vorestation addition
@@ -22,7 +23,7 @@
..()
/obj/mecha/working/ripley/firefighter
- desc = "Standart APLU chassis was refitted with additional thermal protection and cistern."
+ desc = "Standard APLU chassis was refitted with additional thermal protection and cistern."
name = "APLU \"Firefighter\""
icon_state = "firefighter"
initial_icon = "firefighter"
@@ -31,6 +32,11 @@
lights_power = 8
damage_absorption = list("fire"=0.5,"bullet"=0.8,"bomb"=0.5)
wreckage = /obj/effect/decal/mecha_wreckage/ripley/firefighter
+ max_hull_equip = 2
+ max_weapon_equip = 0
+ max_utility_equip = 2
+ max_universal_equip = 1
+ max_special_equip = 1
/obj/mecha/working/ripley/deathripley
desc = "OH SHIT IT'S THE DEATHSQUAD WE'RE ALL GONNA DIE"
@@ -42,6 +48,11 @@
lights_power = 60
wreckage = /obj/effect/decal/mecha_wreckage/ripley/deathripley
step_energy_drain = 0
+ max_hull_equip = 1
+ max_weapon_equip = 1
+ max_utility_equip = 3
+ max_universal_equip = 1
+ max_special_equip = 1
/obj/mecha/working/ripley/deathripley/New()
..()
diff --git a/code/game/mecha/working/working.dm b/code/game/mecha/working/working.dm
index c890746e5b..dbdf68ce5b 100644
--- a/code/game/mecha/working/working.dm
+++ b/code/game/mecha/working/working.dm
@@ -1,7 +1,10 @@
/obj/mecha/working
internal_damage_threshold = 60
- var/list/cargo = new
- var/cargo_capacity = 5
+ max_hull_equip = 1
+ max_weapon_equip = 0
+ max_utility_equip = 3
+ max_universal_equip = 1
+ max_special_equip = 1
/obj/mecha/working/initialize()
. = ..()
@@ -9,6 +12,7 @@
if(isPlayerLevel(T.z))
new /obj/item/mecha_parts/mecha_tracking(src)
+/* This stuff has been generalized!
/obj/mecha/working/Destroy()
for(var/mob/M in src)
if(M==src.occupant)
@@ -54,6 +58,6 @@
output += "Nothing"
output += ""
return output
-
+*/
/obj/mecha/working/range_action(atom/target as obj|mob|turf)
return
diff --git a/code/game/objects/effects/decals/Cleanable/humans.dm b/code/game/objects/effects/decals/Cleanable/humans.dm
index 0369b91d63..69d875d977 100644
--- a/code/game/objects/effects/decals/Cleanable/humans.dm
+++ b/code/game/objects/effects/decals/Cleanable/humans.dm
@@ -216,17 +216,17 @@ var/global/list/image/splatter_cache=list()
/obj/effect/decal/cleanable/blood/gibs/proc/streak(var/list/directions)
- spawn (0)
- var/direction = pick(directions)
- for (var/i = 0, i < pick(1, 200; 2, 150; 3, 50; 4), i++)
- sleep(3)
- if (i > 0)
- var/obj/effect/decal/cleanable/blood/b = new /obj/effect/decal/cleanable/blood/splatter(src.loc)
- b.basecolor = src.basecolor
- b.update_icon()
+ spawn (0)
+ var/direction = pick(directions)
+ for (var/i = 0, i < pick(1, 200; 2, 150; 3, 50; 4), i++)
+ sleep(3)
+ if (i > 0)
+ var/obj/effect/decal/cleanable/blood/b = new /obj/effect/decal/cleanable/blood/splatter(src.loc)
+ b.basecolor = src.basecolor
+ b.update_icon()
- if (step_to(src, get_step(src, direction), 0))
- break
+ if (step_to(src, get_step(src, direction), 0))
+ break
/obj/effect/decal/cleanable/mucus
@@ -249,5 +249,5 @@ var/global/list/image/splatter_cache=list()
//This version should be used for admin spawns and pre-mapped virus vectors (e.g. in PoIs), this version does not dry
/obj/effect/decal/cleanable/mucus/mapped/New()
..()
- virus2 = new /datum/disease2/disease
+ virus2 |= new /datum/disease2/disease
virus2.makerandom()
diff --git a/code/game/objects/effects/decals/contraband.dm b/code/game/objects/effects/decals/contraband.dm
index 695f8d3b79..0d7370d269 100644
--- a/code/game/objects/effects/decals/contraband.dm
+++ b/code/game/objects/effects/decals/contraband.dm
@@ -122,7 +122,7 @@
icon_state = design.icon_state // poster[serial_number]
/obj/structure/sign/poster/attackby(obj/item/weapon/W as obj, mob/user as mob)
- if(istype(W, /obj/item/weapon/wirecutters))
+ if(W.is_wirecutter())
playsound(src.loc, W.usesound, 100, 1)
if(ruined)
user << "You remove the remnants of the poster."
diff --git a/code/game/objects/effects/mines.dm b/code/game/objects/effects/mines.dm
index a1a6623ff1..9ea690318b 100644
--- a/code/game/objects/effects/mines.dm
+++ b/code/game/objects/effects/mines.dm
@@ -47,13 +47,13 @@
explode(M)
/obj/effect/mine/attackby(obj/item/W as obj, mob/living/user as mob)
- if(isscrewdriver(W))
+ if(W.is_screwdriver())
panel_open = !panel_open
user.visible_message("[user] very carefully screws the mine's panel [panel_open ? "open" : "closed"].",
"You very carefully screw the mine's panel [panel_open ? "open" : "closed"].")
playsound(src.loc, W.usesound, 50, 1)
- else if((iswirecutter(W) || ismultitool(W)) && panel_open)
+ else if((W.is_wirecutter() || istype(W, /obj/item/device/multitool)) && panel_open)
interact(user)
else
..()
diff --git a/code/game/objects/effects/misc.dm b/code/game/objects/effects/misc.dm
index aaebab4355..d7db6f2a0c 100644
--- a/code/game/objects/effects/misc.dm
+++ b/code/game/objects/effects/misc.dm
@@ -46,4 +46,21 @@
/obj/effect/temporary_effect/shuttle_landing/initialize()
flick("shuttle_warning", src) // flick() forces the animation to always begin at the start.
+ . = ..()
+
+// The manifestation of Zeus's might. Or just a really unlucky day.
+// This is purely a visual effect, this isn't the part of the code that hurts things.
+/obj/effect/temporary_effect/lightning_strike
+ name = "lightning"
+ desc = "How shocked you must be, to see this text. You must have lightning reflexes. \
+ The humor in this description is just so electrifying."
+ icon = 'icons/effects/96x256.dmi'
+ icon_state = "lightning_strike"
+ plane = PLANE_LIGHTING_ABOVE
+ time_to_die = 1 SECOND
+ pixel_x = -32
+
+/obj/effect/temporary_effect/lightning_strike/initialize()
+ icon_state += "[rand(1,2)]" // To have two variants of lightning sprites.
+ animate(src, alpha = 0, time = time_to_die - 1)
. = ..()
\ No newline at end of file
diff --git a/code/game/objects/effects/overlays.dm b/code/game/objects/effects/overlays.dm
index 9f4f0fa118..7504b6e65f 100644
--- a/code/game/objects/effects/overlays.dm
+++ b/code/game/objects/effects/overlays.dm
@@ -94,3 +94,8 @@
icon_state = "snowwall"
plane = MOB_PLANE
layer = ABOVE_MOB_LAYER
+
+/obj/effect/overlay/holographic
+ mouse_opacity = FALSE
+ anchored = TRUE
+ plane = ABOVE_PLANE
diff --git a/code/game/objects/effects/step_triggers.dm b/code/game/objects/effects/step_triggers.dm
index a58241ada2..febfff6d0f 100644
--- a/code/game/objects/effects/step_triggers.dm
+++ b/code/game/objects/effects/step_triggers.dm
@@ -158,7 +158,14 @@ var/global/list/tele_landmarks = list() // Terrible, but the alternative is loop
/obj/effect/step_trigger/teleporter/planetary_fall
var/datum/planet/planet = null
+// First time setup, which planet are we aiming for?
+/obj/effect/step_trigger/teleporter/planetary_fall/proc/find_planet()
+ return
+
/obj/effect/step_trigger/teleporter/planetary_fall/Trigger(var/atom/movable/A)
+ if(!planet)
+ find_planet()
+
if(planet)
if(!planet.planet_floors.len)
message_admins("ERROR: planetary_fall step trigger's list of outdoor floors was empty.")
diff --git a/code/game/objects/effects/temporary_visuals/miscellaneous.dm b/code/game/objects/effects/temporary_visuals/miscellaneous.dm
new file mode 100644
index 0000000000..4e28a370f7
--- /dev/null
+++ b/code/game/objects/effects/temporary_visuals/miscellaneous.dm
@@ -0,0 +1,46 @@
+/obj/effect/temp_visual/decoy
+ desc = "It's a decoy!"
+ duration = 15
+
+/obj/effect/temp_visual/decoy/initialize(mapload, atom/mimiced_atom, var/customappearance)
+ . = ..()
+ alpha = initial(alpha)
+ if(mimiced_atom)
+ name = mimiced_atom.name
+ appearance = mimiced_atom.appearance
+ set_dir(mimiced_atom.dir)
+ mouse_opacity = 0
+ if(customappearance)
+ appearance = customappearance
+
+/obj/effect/temp_visual/decoy/fading/initialize(mapload, atom/mimiced_atom)
+ . = ..()
+ animate(src, alpha = 0, time = duration)
+
+/obj/effect/temp_visual/decoy/fading/fivesecond
+ duration = 50
+
+/obj/effect/temp_visual/small_smoke
+ icon_state = "smoke"
+ duration = 50
+
+// VOREStation Add - Used by Kinetic Accelerator
+/obj/effect/temp_visual/kinetic_blast
+ name = "kinetic explosion"
+ icon = 'icons/obj/projectiles.dmi'
+ icon_state = "kinetic_blast"
+ layer = ABOVE_MOB_LAYER
+ duration = 4
+
+/obj/effect/temp_visual/explosion
+ name = "explosion"
+ icon = 'icons/effects/96x96.dmi'
+ icon_state = "explosion"
+ pixel_x = -32
+ pixel_y = -32
+ duration = 8
+
+/obj/effect/temp_visual/explosion/fast
+ icon_state = "explosionfast"
+ duration = 4
+// VOREStation Add End
diff --git a/code/game/objects/effects/temporary_visuals/temproary_visual.dm b/code/game/objects/effects/temporary_visuals/temproary_visual.dm
new file mode 100644
index 0000000000..79a8797bae
--- /dev/null
+++ b/code/game/objects/effects/temporary_visuals/temproary_visual.dm
@@ -0,0 +1,36 @@
+//temporary visual effects
+/obj/effect/temp_visual
+ icon = 'icons/effects/effects.dmi'
+ icon_state = "nothing"
+ anchored = TRUE
+ layer = ABOVE_MOB_LAYER
+ mouse_opacity = 0
+ var/duration = 10 //in deciseconds
+ var/randomdir = TRUE
+
+/obj/effect/temp_visual/initialize()
+ . = ..()
+ if(randomdir)
+ set_dir(pick(cardinal))
+
+ spawn(duration)
+ qdel(src)
+
+/obj/effect/temp_visual/singularity_act()
+ return
+
+/obj/effect/temp_visual/singularity_pull()
+ return
+
+/obj/effect/temp_visual/ex_act()
+ return
+
+/*
+/obj/effect/temp_visual/dir_setting
+ randomdir = FALSE
+
+/obj/effect/temp_visual/dir_setting/Initialize(mapload, set_dir)
+ if(set_dir)
+ setDir(set_dir)
+ . = ..()
+*/ //More tg stuff that might be useful later
diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm
index f214242746..48b4ab08ee 100644
--- a/code/game/objects/items.dm
+++ b/code/game/objects/items.dm
@@ -207,6 +207,9 @@
/obj/item/attack_hand(mob/living/user as mob)
if (!user) return
+ if(anchored)
+ to_chat(user, span("notice", "\The [src] won't budge, you can't pick it up!"))
+ return
if (hasorgans(user))
var/mob/living/carbon/human/H = user
var/obj/item/organ/external/temp = H.organs_by_name["r_hand"]
@@ -813,3 +816,27 @@ modules/mob/living/carbon/human/life.dm if you die, you will be zoomed out.
/obj/item/proc/apply_accessories(var/image/standing)
return standing
+/*
+ * Assorted tool procs, so any item can emulate any tool, if coded
+*/
+/obj/item/proc/is_screwdriver()
+ return FALSE
+
+/obj/item/proc/is_wrench()
+ return FALSE
+
+/obj/item/proc/is_crowbar()
+ return FALSE
+
+/obj/item/proc/is_wirecutter()
+ return FALSE
+
+// These next three might bug out or runtime, unless someone goes back and finds a way to generalize their specific code
+/obj/item/proc/is_cable_coil()
+ return FALSE
+
+/obj/item/proc/is_multitool()
+ return FALSE
+
+/obj/item/proc/is_welder()
+ return FALSE
\ No newline at end of file
diff --git a/code/game/objects/items/antag_spawners.dm b/code/game/objects/items/antag_spawners.dm
index 100c113994..0d8e18373a 100644
--- a/code/game/objects/items/antag_spawners.dm
+++ b/code/game/objects/items/antag_spawners.dm
@@ -12,7 +12,7 @@
sparks.attach(loc)
/obj/item/weapon/antag_spawner/Destroy()
- qdel_null(sparks)
+ QDEL_NULL(sparks)
return ..()
/obj/item/weapon/antag_spawner/proc/spawn_antag(client/C, turf/T)
diff --git a/code/game/objects/items/apc_frame.dm b/code/game/objects/items/apc_frame.dm
index fd2ea3e94b..fe40f772dd 100644
--- a/code/game/objects/items/apc_frame.dm
+++ b/code/game/objects/items/apc_frame.dm
@@ -9,7 +9,7 @@
/obj/item/frame/apc/attackby(obj/item/weapon/W as obj, mob/user as mob)
..()
- if (istype(W, /obj/item/weapon/wrench))
+ if (W.is_wrench())
new /obj/item/stack/material/steel( get_turf(src.loc), 2 )
qdel(src)
diff --git a/code/game/objects/items/bodybag.dm b/code/game/objects/items/bodybag.dm
index 302c7df568..f79ac478b2 100644
--- a/code/game/objects/items/bodybag.dm
+++ b/code/game/objects/items/bodybag.dm
@@ -42,7 +42,7 @@
storage_capacity = (MOB_MEDIUM * 2) - 1
var/contains_body = 0
-/obj/structure/closet/body_bag/attackby(W as obj, mob/user as mob)
+/obj/structure/closet/body_bag/attackby(var/obj/item/W as obj, mob/user as mob)
if (istype(W, /obj/item/weapon/pen))
var/t = input(user, "What would you like the label to be?", text("[]", src.name), null) as text
if (user.get_active_hand() != W)
@@ -58,7 +58,7 @@
src.name = "body bag"
//..() //Doesn't need to run the parent. Since when can fucking bodybags be welded shut? -Agouri
return
- else if(istype(W, /obj/item/weapon/wirecutters))
+ else if(W.is_wirecutter())
to_chat(user, "You cut the tag off the bodybag")
src.name = "body bag"
src.overlays.Cut()
@@ -149,8 +149,8 @@
..()
/obj/structure/closet/body_bag/cryobag/Destroy()
- qdel_null(syringe)
- qdel_null(tank)
+ QDEL_NULL(syringe)
+ QDEL_NULL(tank)
return ..()
/obj/structure/closet/body_bag/cryobag/open()
@@ -239,7 +239,7 @@
inject_occupant(H)
break
- else if(istype(W,/obj/item/weapon/screwdriver))
+ else if(W.is_screwdriver())
if(syringe)
if(used)
to_chat(user,"The injector cannot be removed now that the stasis bag has been used!")
diff --git a/code/game/objects/items/devices/PDA/PDA.dm b/code/game/objects/items/devices/PDA/PDA.dm
index 968861f1e4..14c341ce34 100644
--- a/code/game/objects/items/devices/PDA/PDA.dm
+++ b/code/game/objects/items/devices/PDA/PDA.dm
@@ -467,7 +467,7 @@ var/global/list/obj/item/device/pda/PDAs = list()
/obj/item/device/pda/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
ui_tick++
- var/datum/nanoui/old_ui = nanomanager.get_open_ui(user, src, "main")
+ var/datum/nanoui/old_ui = GLOB.nanomanager.get_open_ui(user, src, "main")
var/auto_update = 1
if(mode in no_auto_update)
auto_update = 0
@@ -647,7 +647,7 @@ var/global/list/obj/item/device/pda/PDAs = list()
nanoUI = data
// update the ui if it exists, returns null if no ui is passed/found
- ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
+ ui = GLOB.nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
// the ui does not exist, so we'll create a new() one
@@ -655,6 +655,7 @@ var/global/list/obj/item/device/pda/PDAs = list()
ui = new(user, src, ui_key, "pda.tmpl", title, 520, 400, state = inventory_state)
// add templates for screens in common with communicator.
ui.add_template("atmosphericScan", "atmospheric_scan.tmpl")
+ ui.add_template("crewManifest", "crew_manifest.tmpl")
// when the ui is first opened this is the data it will use
ui.set_initial_data(data)
// open the new ui window
@@ -684,7 +685,7 @@ var/global/list/obj/item/device/pda/PDAs = list()
..()
var/mob/user = usr
- var/datum/nanoui/ui = nanomanager.get_open_ui(user, src, "main")
+ var/datum/nanoui/ui = GLOB.nanomanager.get_open_ui(user, src, "main")
var/mob/living/U = usr
//Looking for master was kind of pointless since PDAs don't appear to have one.
//if ((src in U.contents) || ( istype(loc, /turf) && in_range(src, U) ) )
@@ -1129,7 +1130,7 @@ var/global/list/obj/item/device/pda/PDAs = list()
ai.show_message("Intercepted message from [who]: [t]")
P.new_message_from_pda(src, t)
- nanomanager.update_user_uis(U, src) // Update the sending user's PDA UI so that they can see the new message
+ GLOB.nanomanager.update_user_uis(U, src) // Update the sending user's PDA UI so that they can see the new message
else
to_chat(U, "ERROR: Messaging server is not responding.")
@@ -1149,7 +1150,7 @@ var/global/list/obj/item/device/pda/PDAs = list()
if(L)
if(reception_message)
L << reception_message
- nanomanager.update_user_uis(L, src) // Update the receiving user's PDA UI so that they can see the new message
+ GLOB.nanomanager.update_user_uis(L, src) // Update the receiving user's PDA UI so that they can see the new message
/obj/item/device/pda/proc/new_news(var/message)
new_info(news_silent, newstone, news_silent ? "" : "\icon[src] [message]")
@@ -1195,7 +1196,7 @@ var/global/list/obj/item/device/pda/PDAs = list()
if(can_use(usr))
mode = 0
- nanomanager.update_uis(src)
+ GLOB.nanomanager.update_uis(src)
to_chat(usr, "You press the reset button on \the [src].")
else
to_chat(usr, "You cannot do this while restrained.")
@@ -1296,7 +1297,7 @@ var/global/list/obj/item/device/pda/PDAs = list()
user.drop_item()
cartridge.loc = src
to_chat(usr, "You insert [cartridge] into [src].")
- nanomanager.update_uis(src) // update all UIs attached to src
+ GLOB.nanomanager.update_uis(src) // update all UIs attached to src
if(cartridge.radio)
cartridge.radio.hostpda = src
@@ -1324,7 +1325,7 @@ var/global/list/obj/item/device/pda/PDAs = list()
C.loc = src
pai = C
to_chat(user, "You slot \the [C] into \the [src].")
- nanomanager.update_uis(src) // update all UIs attached to src
+ GLOB.nanomanager.update_uis(src) // update all UIs attached to src
else if(istype(C, /obj/item/weapon/pen))
var/obj/item/weapon/pen/O = locate() in src
if(O)
@@ -1470,15 +1471,12 @@ var/global/list/obj/item/device/pda/PDAs = list()
/obj/item/device/pda/Destroy()
PDAs -= src
- // VOREStation Edit - Always destroy IDs
- // if (src.id && prob(90)) //IDs are kept in 90% of the cases
- // src.id.forceMove(get_turf(src.loc))
- // else
- // qdel_null(src.id)
- qdel_null(src.id)
- // VOREStation Edit End
- qdel_null(src.cartridge)
- qdel_null(src.pai)
+ if (src.id && prob(100)) //IDs are kept in 90% of the cases //VOREStation Edit - 100% of the cases
+ src.id.forceMove(get_turf(src.loc))
+ else
+ QDEL_NULL(src.id)
+ QDEL_NULL(src.cartridge)
+ QDEL_NULL(src.pai)
return ..()
/obj/item/device/pda/clown/Crossed(AM as mob|obj) //Clown PDA is slippery.
diff --git a/code/game/objects/items/devices/PDA/cart.dm b/code/game/objects/items/devices/PDA/cart.dm
index e13324a5f0..cf91bbef3b 100644
--- a/code/game/objects/items/devices/PDA/cart.dm
+++ b/code/game/objects/items/devices/PDA/cart.dm
@@ -79,7 +79,7 @@ var/list/civilian_cartridges = list(
var/list/stored_data = list()
/obj/item/weapon/cartridge/Destroy()
- qdel_null(radio)
+ QDEL_NULL(radio)
return ..()
/obj/item/weapon/cartridge/engineering
@@ -434,7 +434,7 @@ var/list/civilian_cartridges = list(
for(var/S in supply_controller.shoppinglist)
var/datum/supply_order/SO = S
- supplyOrderData[++supplyOrderData.len] = list("Number" = SO.ordernum, "Name" = html_encode(SO.object.name), "ApprovedBy" = SO.orderedby, "Comment" = html_encode(SO.comment))
+ supplyOrderData[++supplyOrderData.len] = list("Number" = SO.ordernum, "Name" = html_encode(SO.object.name), "ApprovedBy" = SO.ordered_by, "Comment" = html_encode(SO.comment))
if(!supplyOrderData.len)
supplyOrderData[++supplyOrderData.len] = list("Number" = null, "Name" = null, "OrderedBy"=null)
@@ -443,10 +443,13 @@ var/list/civilian_cartridges = list(
var/requestCount = 0
var/requestData[0]
- for(var/S in supply_controller.requestlist)
+ for(var/S in supply_controller.order_history)
var/datum/supply_order/SO = S
+ if(SO.status != SUP_ORDER_REQUESTED)
+ continue
+
requestCount++
- requestData[++requestData.len] = list("Number" = SO.ordernum, "Name" = html_encode(SO.object.name), "OrderedBy" = SO.orderedby, "Comment" = html_encode(SO.comment))
+ requestData[++requestData.len] = list("Number" = SO.ordernum, "Name" = html_encode(SO.object.name), "OrderedBy" = SO.ordered_by, "Comment" = html_encode(SO.comment))
if(!requestData.len)
requestData[++requestData.len] = list("Number" = null, "Name" = null, "orderedBy" = null, "Comment" = null)
diff --git a/code/game/objects/items/devices/aicard.dm b/code/game/objects/items/devices/aicard.dm
index 7e288dbadc..c2af338521 100644
--- a/code/game/objects/items/devices/aicard.dm
+++ b/code/game/objects/items/devices/aicard.dm
@@ -43,7 +43,7 @@
data["laws"] = laws
data["has_laws"] = laws.len
- ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
+ ui = GLOB.nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, "aicard.tmpl", "[name]", 600, 400, state = state)
ui.set_initial_data(data)
diff --git a/code/game/objects/items/devices/communicator/UI.dm b/code/game/objects/items/devices/communicator/UI.dm
index fca4cf4866..d414232a80 100644
--- a/code/game/objects/items/devices/communicator/UI.dm
+++ b/code/game/objects/items/devices/communicator/UI.dm
@@ -14,7 +14,6 @@
var/im_list_ui[0] //List of messages.
var/weather[0]
- var/injection = null
var/modules_ui[0] //Home screen info.
//First we add other 'local' communicators.
@@ -77,15 +76,19 @@
"Weather" = planet.weather_holder.current_weather.name,
"Temperature" = planet.weather_holder.temperature - T0C,
"High" = planet.weather_holder.current_weather.temp_high - T0C,
- "Low" = planet.weather_holder.current_weather.temp_low - T0C)
+ "Low" = planet.weather_holder.current_weather.temp_low - T0C,
+ "Forecast" = english_list(planet.weather_holder.forecast, and_text = "→", comma_text = "→", final_comma_text = "→") // Unicode RIGHTWARDS ARROW.
+ )
weather[++weather.len] = W
- injection = "Test
"
+ // Update manifest
+ data_core.get_manifest_list()
//Modules for homescreen.
for(var/list/R in modules)
modules_ui[++modules_ui.len] = R
+ data["user"] = "\ref[user]" // For receiving input() via topic, because input(usr,...) wasn't working on cartridges
data["owner"] = owner ? owner : "Unset"
data["occupation"] = occupation ? occupation : "Swipe ID to set."
data["connectionStatus"] = get_connection_to_tcomms()
@@ -109,16 +112,29 @@
data["weather"] = weather
data["aircontents"] = src.analyze_air()
data["flashlight"] = fon
- data["injection"] = injection
+ data["manifest"] = PDA_Manifest
+ data["feeds"] = compile_news()
+ data["latest_news"] = get_recent_news()
+ if(cartridge) // If there's a cartridge, we need to grab the information from it
+ data["cart_devices"] = cartridge.get_device_status()
+ data["cart_templates"] = cartridge.ui_templates
+ for(var/list/L in cartridge.get_data())
+ data[L["field"]] = L["value"]
+ // cartridge.get_data() returns a list of tuples:
+ // The field element is the tag used to access the information by the template
+ // The value element is the actual data, and can take any form necessary for the template
// update the ui if it exists, returns null if no ui is passed/found
- ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
+ ui = GLOB.nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if(!ui)
// the ui does not exist, so we'll create a new() one
// for a list of parameters and their descriptions see the code docs in \code\modules\nano\nanoui.dm
- ui = new(user, src, ui_key, "communicator.tmpl", "Communicator", 475, 700, state = key_state)
+ data["currentTab"] = 1 // Reset the current tab, because we're going to home page
+ ui = new(user, src, ui_key, "communicator_header.tmpl", "Communicator", 475, 700, state = key_state)
// add templates for screens in common with communicator.
ui.add_template("atmosphericScan", "atmospheric_scan.tmpl")
+ ui.add_template("crewManifest", "crew_manifest.tmpl")
+ ui.add_template("Body", "communicator.tmpl") // Main body
// when the ui is first opened this is the data it will use
ui.set_initial_data(data)
// open the new ui window
@@ -166,7 +182,7 @@
if(href_list["dial"])
if(!get_connection_to_tcomms())
- usr << "Error: Cannot connect to Exonet node."
+ to_chat(usr, "Error: Cannot connect to Exonet node.")
return
var/their_address = href_list["dial"]
exonet.send_message(their_address, "voice")
@@ -179,7 +195,7 @@
if(href_list["message"])
if(!get_connection_to_tcomms())
- usr << "Error: Cannot connect to Exonet node."
+ to_chat(usr, "Error: Cannot connect to Exonet node.")
return
var/their_address = href_list["message"]
var/text = sanitizeSafe(input(usr,"Enter your message.","Text Message"))
@@ -244,9 +260,21 @@
note = ""
notehtml = note
+ if(href_list["switch_template"])
+ var/datum/nanoui/ui = GLOB.nanomanager.get_open_ui(usr, src, "main")
+ if(ui)
+ ui.add_template("Body", href_list["switch_template"])
+
if(href_list["Light"])
fon = !fon
set_light(fon * flum)
- nanomanager.update_uis(src)
+ if(href_list["toggle_device"])
+ var/obj/O = cartridge.internal_devices[text2num(href_list["toggle_device"])]
+ cartridge.active_devices ^= list(O) // Exclusive or, will toggle its presence
+
+ if(href_list["cartridge_topic"] && cartridge) // Has to have a cartridge to perform these functions
+ cartridge.Topic(href, href_list)
+
+ GLOB.nanomanager.update_uis(src)
add_fingerprint(usr)
diff --git a/code/game/objects/items/devices/communicator/cartridge.dm b/code/game/objects/items/devices/communicator/cartridge.dm
index e69de29bb2..6b29f1121e 100644
--- a/code/game/objects/items/devices/communicator/cartridge.dm
+++ b/code/game/objects/items/devices/communicator/cartridge.dm
@@ -0,0 +1,952 @@
+// Communicator peripheral devices
+// Internal devices that attack() can be relayed to
+// Additional UI menus for added functionality
+/obj/item/weapon/commcard
+ name = "generic commcard"
+ desc = "A peripheral plug-in for personal communicators."
+ icon = 'icons/obj/pda.dmi'
+ icon_state = "cart"
+ item_state = "electronic"
+ w_class = ITEMSIZE_TINY
+
+ var/list/internal_devices = list() // Devices that can be toggled on to trigger on attack()
+ var/list/active_devices = list() // Devices that will be triggered on attack()
+ var/list/ui_templates = list() // List of ui templates the commcard can access
+ var/list/internal_data = list() // Data that shouldn't be updated every time nanoUI updates, or needs to persist between updates
+
+
+/obj/item/weapon/commcard/proc/get_device_status()
+ var/list/L = list()
+ var/i = 1
+ for(var/obj/I in internal_devices)
+ if(I in active_devices)
+ L[++L.len] = list("name" = "\proper[I.name]", "active" = 1, "index" = i++)
+ else
+ L[++L.len] = list("name" = I.name, "active" = 0, "index" = i++)
+ return L
+
+
+// cartridge.get_data() returns a list of tuples:
+// The field element is the tag used to access the information by the template
+// The value element is the actual data, and can take any form necessary for the template
+/obj/item/weapon/commcard/proc/get_data()
+ return list()
+
+// Handles cartridge-specific functions
+// The helper.link() MUST HAVE 'cartridge_topic' passed into the href in order for cartridge functions to be processed.
+// Doesn't matter what the value of it is for now, it's just a flag to say, "Hey, there's cartridge data to change!"
+/obj/item/weapon/commcard/Topic(href, href_list)
+
+ // Signalers
+ if(href_list["signaler_target"])
+
+ var/obj/item/device/assembly/signaler/S = locate(href_list["signaler_target"]) // Should locate the correct signaler
+
+ if(!istype(S)) // Ref is no longer valid
+ return
+
+ if(S.loc != src) // No longer within the cartridge
+ return
+
+ switch(href_list["signaler_action"])
+ if("Pulse")
+ S.activate()
+
+ if("Edit")
+ var/mob/user = locate(href_list["user"])
+ if(!istype(user)) // Ref no longer valid
+ return
+
+ var/newVal = input(user, "Input a new [href_list["signaler_value"]].", href_list["signaler_value"], (href_list["signaler_value"] == "Code" ? S.code : S.frequency)) as num|null
+ if(newVal)
+ switch(href_list["signaler_value"])
+ if("Code")
+ S.code = newVal
+
+ if("Frequency")
+ S.frequency = newVal
+
+ // Refresh list of powernet sensors
+ if(href_list["powernet_refresh"])
+ internal_data["grid_sensors"] = find_powernet_sensors()
+
+ // Load apc's on targeted powernet
+ if(href_list["powernet_target"])
+ internal_data["powernet_target"] = href_list["powernet_target"]
+
+ // GPS units
+ if(href_list["gps_target"])
+ var/obj/item/device/gps/G = locate(href_list["gps_target"])
+
+ if(!istype(G)) // Ref is no longer valid
+ return
+
+ if(G.loc != src) // No longer within the cartridge
+ return
+
+ switch(href_list["gps_action"])
+ if("Power")
+ G.tracking = text2num(href_list["value"])
+
+ if("Long_Range")
+ G.local_mode = text2num(href_list["value"])
+
+ if("Hide_Signal")
+ G.hide_signal = text2num(href_list["value"])
+
+ if("Tag")
+ var/mob/user = locate(href_list["user"])
+ if(!istype(user)) // Ref no longer valid
+ return
+
+ var/newTag = input(user, "Please enter desired tag.", G.tag) as text|null
+
+ if(newTag)
+ G.tag = newTag
+
+ if(href_list["active_category"])
+ internal_data["supply_category"] = href_list["active_category"]
+
+ // Supply topic
+ // Copied from /obj/machinery/computer/supplycomp/Topic()
+ // code\game\machinery\computer\supply.dm, line 188
+ // Unfortunately, in order to support complete functionality, the whole thing is necessary
+ if(href_list["pack_ref"])
+ var/datum/supply_pack/S = locate(href_list["pack_ref"])
+
+ // Invalid ref
+ if(!istype(S))
+ return
+
+ // Expand the supply pack's contents
+ if(href_list["expand"])
+ internal_data["supply_pack_expanded"] ^= S
+
+ // Make a request for the pack
+ if(href_list["request"])
+ var/mob/user = locate(href_list["user"])
+ if(!istype(user)) // Invalid ref
+ return
+
+ if(world.time < internal_data["supply_reqtime"])
+ visible_message("[src] flashes, \"[internal_data["supply_reqtime"] - world.time] seconds remaining until another requisition form may be printed.\"")
+ return
+
+ var/timeout = world.time + 600
+ var/reason = sanitize(input(user, "Reason:","Why do you require this item?","") as null|text)
+ if(world.time > timeout)
+ to_chat(user, "Error. Request timed out.")
+ return
+ if(!reason)
+ return
+
+ supply_controller.create_order(S, user, reason)
+ internal_data["supply_reqtime"] = (world.time + 5) % 1e5
+
+ if(href_list["order_ref"])
+ var/datum/supply_order/O = locate(href_list["order_ref"])
+
+ // Invalid ref
+ if(!istype(O))
+ return
+
+ var/mob/user = locate(href_list["user"])
+ if(!istype(user)) // Invalid ref
+ return
+
+ if(href_list["edit"])
+ var/new_val = sanitize(input(user, href_list["edit"], "Enter the new value for this field:", href_list["default"]) as null|text)
+ if(!new_val)
+ return
+
+ switch(href_list["edit"])
+ if("Supply Pack")
+ O.name = new_val
+
+ if("Cost")
+ var/num = text2num(new_val)
+ if(num)
+ O.cost = num
+
+ if("Index")
+ var/num = text2num(new_val)
+ if(num)
+ O.index = num
+
+ if("Reason")
+ O.comment = new_val
+
+ if("Ordered by")
+ O.ordered_by = new_val
+
+ if("Ordered at")
+ O.ordered_at = new_val
+
+ if("Approved by")
+ O.approved_by = new_val
+
+ if("Approved at")
+ O.approved_at = new_val
+
+ if(href_list["approve"])
+ supply_controller.approve_order(O, user)
+
+ if(href_list["deny"])
+ supply_controller.deny_order(O, user)
+
+ if(href_list["delete"])
+ supply_controller.delete_order(O, user)
+
+ if(href_list["clear_all_requests"])
+ var/mob/user = locate(href_list["user"])
+ if(!istype(user)) // Invalid ref
+ return
+
+ supply_controller.deny_all_pending(user)
+
+ if(href_list["export_ref"])
+ var/datum/exported_crate/E = locate(href_list["export_ref"])
+
+ // Invalid ref
+ if(!istype(E))
+ return
+
+ var/mob/user = locate(href_list["user"])
+ if(!istype(user)) // Invalid ref
+ return
+
+ if(href_list["index"])
+ var/list/L = E.contents[href_list["index"]]
+
+ if(href_list["edit"])
+ var/field = alert(user, "Select which field to edit", , "Name", "Quantity", "Value")
+
+ var/new_val = sanitize(input(user, href_list["edit"], "Enter the new value for this field:", href_list["default"]) as null|text)
+ if(!new_val)
+ return
+
+ switch(field)
+ if("Name")
+ L["object"] = new_val
+
+ if("Quantity")
+ var/num = text2num(new_val)
+ if(num)
+ L["quantity"] = num
+
+ if("Value")
+ var/num = text2num(new_val)
+ if(num)
+ L["value"] = num
+
+ if(href_list["delete"])
+ E.contents.Cut(href_list["index"], href_list["index"] + 1)
+
+ // Else clause means they're editing/deleting the whole export report, rather than a specific item in it
+ else if(href_list["edit"])
+ var/new_val = sanitize(input(user, href_list["edit"], "Enter the new value for this field:", href_list["default"]) as null|text)
+ if(!new_val)
+ return
+
+ switch(href_list["edit"])
+ if("Name")
+ E.name = new_val
+
+ if("Value")
+ var/num = text2num(new_val)
+ if(num)
+ E.value = num
+
+ else if(href_list["delete"])
+ supply_controller.delete_export(E, user)
+
+ else if(href_list["add_item"])
+ supply_controller.add_export_item(E, user)
+
+ if(supply_controller && supply_controller.shuttle)
+ switch(href_list["send_shuttle"])
+ if("send_away")
+ if(supply_controller.shuttle.forbidden_atoms_check())
+ to_chat(usr, "For safety reasons the automated supply shuttle cannot transport live organisms, classified nuclear weaponry or homing beacons.")
+ else
+ supply_controller.shuttle.launch(src)
+ to_chat(usr, "Initiating launch sequence.")
+
+ if("send_to_station")
+ supply_controller.shuttle.launch(src)
+ to_chat(usr, "The supply shuttle has been called and will arrive in approximately [round(supply_controller.movetime/600,1)] minutes.")
+
+ if("cancel_shuttle")
+ supply_controller.shuttle.cancel_launch(src)
+
+ if("force_shuttle")
+ supply_controller.shuttle.force_launch(src)
+
+ // Status display
+ switch(href_list["stat_display"])
+ if("message")
+ post_status("message", internal_data["stat_display_line1"], internal_data["stat_display_line2"])
+ internal_data["stat_display_special"] = "message"
+ if("alert")
+ post_status("alert", href_list["alert"])
+ internal_data["stat_display_special"] = href_list["alert"]
+ if("setmsg")
+ internal_data["stat_display_line[href_list["line"]]"] = reject_bad_text(sanitize(input("Line 1", "Enter Message Text", internal_data["stat_display_line[href_list["line"]]"]) as text|null, 40), 40)
+ else
+ post_status(href_list["stat_display"])
+ internal_data["stat_display_special"] = href_list["stat_display"]
+
+ // Merc shuttle blast door controls
+ switch(href_list["all_blast_doors"])
+ if("open")
+ for(var/obj/machinery/door/blast/B in internal_data["shuttle_doors"])
+ B.open()
+ if("close")
+ for(var/obj/machinery/door/blast/B in internal_data["shuttle_doors"])
+ B.close()
+
+ if(href_list["scan_blast_doors"])
+ internal_data["shuttle_doors"] = find_blast_doors()
+
+ if(href_list["toggle_blast_door"])
+ var/obj/machinery/door/blast/B = locate(href_list["toggle_blast_door"])
+ if(!B)
+ return
+ spawn(0)
+ if(B.density)
+ B.open()
+ else
+ B.close()
+
+
+// Updates status displays with a new message
+// Copied from /obj/item/weapon/cartridge/proc/post_status(),
+// code/game/objects/items/devices/PDA/cart.dm, line 251
+/obj/item/weapon/commcard/proc/post_status(var/command, var/data1, var/data2)
+ var/datum/radio_frequency/frequency = radio_controller.return_frequency(1435)
+ if(!frequency)
+ return
+
+ var/datum/signal/status_signal = new
+ status_signal.source = src
+ status_signal.transmission_method = 1
+ status_signal.data["command"] = command
+
+ switch(command)
+ if("message")
+ status_signal.data["msg1"] = data1
+ status_signal.data["msg2"] = data2
+ internal_data["stat_display_active1"] = data1 // Update the internally stored message, we won't get receive_signal if we're the sender
+ internal_data["stat_display_active2"] = data2
+ if(loc)
+ var/obj/item/PDA = loc
+ var/mob/user = PDA.fingerprintslast
+ log_admin("STATUS: [user] set status screen with [src]. Message: [data1] [data2]")
+ message_admins("STATUS: [user] set status screen with [src]. Message: [data1] [data2]")
+
+ if("alert")
+ status_signal.data["picture_state"] = data1
+
+ frequency.post_signal(src, status_signal)
+
+// Receives updates by external devices to the status displays
+/obj/item/weapon/commcard/receive_signal(var/datum/signal/signal, var/receive_method, var/receive_param)
+ internal_data["stat_display_special"] = signal.data["command"]
+ switch(signal.data["command"])
+ if("message")
+ internal_data["stat_display_active1"] = signal.data["msg1"]
+ internal_data["stat_display_active2"] = signal.data["msg2"]
+ if("alert")
+ internal_data["stat_display_special"] = signal.data["picture_state"]
+
+
+///////////////////////////
+// SUBTYPES
+///////////////////////////
+
+
+// Engineering Cartridge:
+// Devices
+// *- Halogen Counter
+// Templates
+// *- Power Monitor
+/obj/item/weapon/commcard/engineering
+ name = "\improper Power-ON cartridge"
+ icon_state = "cart-e"
+ ui_templates = list(list("name" = "Power Monitor", "template" = "comm_power_monitor.tmpl"))
+
+/obj/item/weapon/commcard/engineering/New()
+ ..()
+ internal_devices |= new /obj/item/device/halogen_counter(src)
+
+/obj/item/weapon/commcard/engineering/initialize()
+ internal_data["grid_sensors"] = find_powernet_sensors()
+ internal_data["powernet_target"] = ""
+
+/obj/item/weapon/commcard/engineering/get_data()
+ return list(
+ list("field" = "powernet_monitoring", "value" = get_powernet_monitoring_list()),
+ list("field" = "powernet_target", "value" = get_powernet_target(internal_data["powernet_target"]))
+ )
+
+// Atmospherics Cartridge:
+// Devices
+// *- Gas scanner
+/obj/item/weapon/commcard/atmos
+ name = "\improper BreatheDeep cartridge"
+ icon_state = "cart-a"
+
+/obj/item/weapon/commcard/atmos/New()
+ ..()
+ internal_devices |= new /obj/item/device/analyzer(src)
+
+
+// Medical Cartridge:
+// Devices
+// *- Halogen Counter
+// *- Health Analyzer
+// Templates
+// *- Medical Records
+/obj/item/weapon/commcard/medical
+ name = "\improper Med-U cartridge"
+ icon_state = "cart-m"
+ ui_templates = list(list("name" = "Medical Records", "template" = "med_records.tmpl"))
+
+/obj/item/weapon/commcard/medical/New()
+ ..()
+ internal_devices |= new /obj/item/device/healthanalyzer(src)
+ internal_devices |= new /obj/item/device/halogen_counter(src)
+
+/obj/item/weapon/commcard/medical/get_data()
+ return list(list("field" = "med_records", "value" = get_med_records()))
+
+
+// Chemistry Cartridge:
+// Devices
+// *- Halogen Counter
+// *- Health Analyzer
+// *- Reagent Scanner
+// Templates
+// *- Medical Records
+/obj/item/weapon/commcard/medical/chemistry
+ name = "\improper ChemWhiz cartridge"
+ icon_state = "cart-chem"
+
+/obj/item/weapon/commcard/medical/chemistry/New()
+ ..()
+ internal_devices |= new /obj/item/device/reagent_scanner(src)
+
+
+// Detective Cartridge:
+// Devices
+// *- Halogen Counter
+// *- Health Analyzer
+// Templates
+// *- Medical Records
+// *- Security Records
+/obj/item/weapon/commcard/medical/detective
+ name = "\improper D.E.T.E.C.T. cartridge"
+ icon_state = "cart-s"
+ ui_templates = list(
+ list("name" = "Medical Records", "template" = "med_records.tmpl"),
+ list("name" = "Security Records", "template" = "sec_records.tmpl")
+ )
+
+/obj/item/weapon/commcard/medical/detective/get_data()
+ var/list/data = ..()
+ data[++data.len] = list("field" = "sec_records", "value" = get_sec_records())
+ return data
+
+
+// Internal Affairs Cartridge:
+// Templates
+// *- Security Records
+// *- Employment Records
+/obj/item/weapon/commcard/int_aff
+ name = "\improper P.R.O.V.E. cartridge"
+ icon_state = "cart-s"
+ ui_templates = list(
+ list("name" = "Employment Records", "template" = "emp_records.tmpl"),
+ list("name" = "Security Records", "template" = "sec_records.tmpl")
+ )
+
+/obj/item/weapon/commcard/int_aff/get_data()
+ return list(
+ list("field" = "emp_records", "value" = get_emp_records()),
+ list("field" = "sec_records", "value" = get_sec_records())
+ )
+
+
+// Security Cartridge:
+// Templates
+// *- Security Records
+// *- Security Bot Access
+/obj/item/weapon/commcard/security
+ name = "\improper R.O.B.U.S.T. cartridge"
+ icon_state = "cart-s"
+ ui_templates = list(
+ list("name" = "Security Records", "template" = "sec_records.tmpl"),
+ list("name" = "Security Bot Control", "template" = "sec_bot_access.tmpl")
+ )
+
+/obj/item/weapon/commcard/security/get_data()
+ return list(
+ list("field" = "sec_records", "value" = get_sec_records()),
+ list("field" = "sec_bot_access", "value" = get_sec_bot_access())
+ )
+
+
+// Janitor Cartridge:
+// Templates
+// *- Janitorial Locator Magicbox
+/obj/item/weapon/commcard/janitor
+ name = "\improper CustodiPRO cartridge"
+ desc = "The ultimate in clean-room design."
+ ui_templates = list(
+ list("name" = "Janitorial Supply Locator", "template" = "janitorialLocator.tmpl")
+ )
+
+/obj/item/weapon/commcard/janitor/get_data()
+ return list(
+ list("field" = "janidata", "value" = get_janitorial_locations())
+ )
+
+
+// Signal Cartridge:
+// Devices
+// *- Signaler
+// Templates
+// *- Signaler Access
+/obj/item/weapon/commcard/signal
+ name = "generic signaler cartridge"
+ desc = "A data cartridge with an integrated radio signaler module."
+ ui_templates = list(
+ list("name" = "Integrated Signaler Control", "template" = "signaler_access.tmpl")
+ )
+
+/obj/item/weapon/commcard/signal/New()
+ ..()
+ internal_devices |= new /obj/item/device/assembly/signaler(src)
+
+/obj/item/weapon/commcard/signal/get_data()
+ return list(
+ list("field" = "signaler_access", "value" = get_int_signalers())
+ )
+
+
+// Science Cartridge:
+// Devices
+// *- Signaler
+// *- Reagent Scanner
+// *- Gas Scanner
+// Templates
+// *- Signaler Access
+/obj/item/weapon/commcard/signal/science
+ name = "\improper Signal Ace 2 cartridge"
+ desc = "Complete with integrated radio signaler!"
+ icon_state = "cart-tox"
+ // UI templates inherited
+
+/obj/item/weapon/commcard/signal/science/New()
+ ..()
+ internal_devices |= new /obj/item/device/reagent_scanner(src)
+ internal_devices |= new /obj/item/device/analyzer(src)
+
+
+// Supply Cartridge:
+// Templates
+// *- Supply Records
+/obj/item/weapon/commcard/supply
+ name = "\improper Space Parts & Space Vendors cartridge"
+ desc = "Perfect for the Quartermaster on the go!"
+ icon_state = "cart-q"
+ ui_templates = list(
+ list("name" = "Supply Records", "template" = "supply_records.tmpl")
+ )
+
+/obj/item/weapon/commcard/supply/New()
+ ..()
+ internal_data["supply_category"] = null
+ internal_data["supply_controls"] = FALSE // Cannot control the supply shuttle, cannot accept orders
+ internal_data["supply_pack_expanded"] = list()
+ internal_data["supply_reqtime"] = -1
+
+/obj/item/weapon/commcard/supply/get_data()
+ // Supply records data
+ var/list/shuttle_status = get_supply_shuttle_status()
+ var/list/orders = get_supply_orders()
+ var/list/receipts = get_supply_receipts()
+ var/list/misc_supply_data = get_misc_supply_data() // Packaging this stuff externally so it's less hardcoded into the specific cartridge
+ var/list/pack_list = list() // List of supply packs within the currently selected category
+
+ if(internal_data["supply_category"])
+ pack_list = get_supply_pack_list()
+
+ return list(
+ list("field" = "shuttle_auth", "value" = misc_supply_data["shuttle_auth"]),
+ list("field" = "order_auth", "value" = misc_supply_data["order_auth"]),
+ list("field" = "supply_points", "value" = misc_supply_data["supply_points"]),
+ list("field" = "categories", "value" = misc_supply_data["supply_categories"]),
+ list("field" = "contraband", "value" = misc_supply_data["contraband"]),
+ list("field" = "active_category", "value" = internal_data["supply_category"]),
+ list("field" = "shuttle", "value" = shuttle_status),
+ list("field" = "orders", "value" = orders),
+ list("field" = "receipts", "value" = receipts),
+ list("field" = "supply_packs", "value" = pack_list)
+ )
+
+
+// Command Cartridge:
+// Templates
+// *- Status Display Access
+// *- Employment Records
+/obj/item/weapon/commcard/head
+ name = "\improper Easy-Record DELUXE"
+ icon_state = "cart-h"
+ ui_templates = list(
+ list("name" = "Status Display Access", "template" = "stat_display_access.tmpl"),
+ list("name" = "Employment Records", "template" = "emp_records.tmpl")
+ )
+
+/obj/item/weapon/commcard/head/New()
+ ..()
+ internal_data["stat_display_line1"] = null
+ internal_data["stat_display_line2"] = null
+ internal_data["stat_display_active1"] = null
+ internal_data["stat_display_active2"] = null
+ internal_data["stat_display_special"] = null
+
+/obj/item/weapon/commcard/head/initialize()
+ // Have to register the commcard with the Radio controller to receive updates to the status displays
+ radio_controller.add_object(src, 1435)
+ ..()
+
+/obj/item/weapon/commcard/head/Destroy()
+ // Have to unregister the commcard for proper bookkeeping
+ radio_controller.remove_object(src, 1435)
+ ..()
+
+/obj/item/weapon/commcard/head/get_data()
+ return list(
+ list("field" = "emp_records", "value" = get_emp_records()),
+ list("field" = "stat_display", "value" = get_status_display())
+ )
+
+// Head of Personnel Cartridge:
+// Templates
+// *- Status Display Access
+// *- Employment Records
+// *- Security Records
+// *- Supply Records
+// ?- Supply Bot Access
+// *- Janitorial Locator Magicbox
+/obj/item/weapon/commcard/head/hop
+ name = "\improper HumanResources9001 cartridge"
+ icon_state = "cart-h"
+ ui_templates = list(
+ list("name" = "Status Display Access", "template" = "stat_display_access.tmpl"),
+ list("name" = "Employment Records", "template" = "emp_records.tmpl"),
+ list("name" = "Security Records", "template" = "sec_records.tmpl"),
+ list("name" = "Supply Records", "template" = "supply_records.tmpl"),
+ list("name" = "Janitorial Supply Locator", "template" = "janitorialLocator.tmpl")
+ )
+
+
+/obj/item/weapon/commcard/head/hop/get_data()
+ var/list/data = ..()
+
+ // Sec records
+ data[++data.len] = list("field" = "sec_records", "value" = get_sec_records())
+
+ // Supply records data
+ var/list/shuttle_status = get_supply_shuttle_status()
+ var/list/orders = get_supply_orders()
+ var/list/receipts = get_supply_receipts()
+ var/list/misc_supply_data = get_misc_supply_data() // Packaging this stuff externally so it's less hardcoded into the specific cartridge
+ var/list/pack_list = list() // List of supply packs within the currently selected category
+
+ if(internal_data["supply_category"])
+ pack_list = get_supply_pack_list()
+
+ data[++data.len] = list("field" = "shuttle_auth", "value" = misc_supply_data["shuttle_auth"])
+ data[++data.len] = list("field" = "order_auth", "value" = misc_supply_data["order_auth"])
+ data[++data.len] = list("field" = "supply_points", "value" = misc_supply_data["supply_points"])
+ data[++data.len] = list("field" = "categories", "value" = misc_supply_data["supply_categories"])
+ data[++data.len] = list("field" = "contraband", "value" = misc_supply_data["contraband"])
+ data[++data.len] = list("field" = "active_category", "value" = internal_data["supply_category"])
+ data[++data.len] = list("field" = "shuttle", "value" = shuttle_status)
+ data[++data.len] = list("field" = "orders", "value" = orders)
+ data[++data.len] = list("field" = "receipts", "value" = receipts)
+ data[++data.len] = list("field" = "supply_packs", "value" = pack_list)
+
+ // Janitorial locator magicbox
+ data[++data.len] = list("field" = "janidata", "value" = get_janitorial_locations())
+
+ return data
+
+
+// Head of Security Cartridge:
+// Templates
+// *- Status Display Access
+// *- Employment Records
+// *- Security Records
+// *- Security Bot Access
+/obj/item/weapon/commcard/head/hos
+ name = "\improper R.O.B.U.S.T. DELUXE"
+ icon_state = "cart-hos"
+ ui_templates = list(
+ list("name" = "Status Display Access", "template" = "stat_display_access.tmpl"),
+ list("name" = "Employment Records", "template" = "emp_records.tmpl"),
+ list("name" = "Security Records", "template" = "sec_records.tmpl"),
+ list("name" = "Security Bot Control", "template" = "sec_bot_access.tmpl")
+ )
+
+/obj/item/weapon/commcard/head/hos/get_data()
+ var/list/data = ..()
+ // Sec records
+ data[++data.len] = list("field" = "sec_records", "value" = get_sec_records())
+ // Sec bot access
+ data[++data.len] = list("field" = "sec_bot_access", "value" = get_sec_bot_access())
+ return data
+
+
+// Research Director Cartridge:
+// Devices
+// *- Signaler
+// *- Gas Scanner
+// *- Reagent Scanner
+// Templates
+// *- Status Display Access
+// *- Employment Records
+// *- Signaler Access
+/obj/item/weapon/commcard/head/rd
+ name = "\improper Signal Ace DELUXE"
+ icon_state = "cart-rd"
+ ui_templates = list(
+ list("name" = "Status Display Access", "template" = "stat_display_access.tmpl"),
+ list("name" = "Employment Records", "template" = "emp_records.tmpl"),
+ list("name" = "Integrated Signaler Control", "template" = "signaler_access.tmpl")
+ )
+
+/obj/item/weapon/commcard/head/rd/New()
+ ..()
+ internal_devices |= new /obj/item/device/analyzer(src)
+ internal_devices |= new /obj/item/device/reagent_scanner(src)
+ internal_devices |= new /obj/item/device/assembly/signaler(src)
+
+/obj/item/weapon/commcard/head/rd/get_data()
+ var/list/data = ..()
+ // Signaler access
+ data[++data.len] = list("field" = "signaler_access", "value" = get_int_signalers())
+ return data
+
+
+// Chief Medical Officer Cartridge:
+// Devices
+// *- Health Analyzer
+// *- Reagent Scanner
+// *- Halogen Counter
+// Templates
+// *- Status Display Access
+// *- Employment Records
+// *- Medical Records
+/obj/item/weapon/commcard/head/cmo
+ name = "\improper Med-U DELUXE"
+ icon_state = "cart-cmo"
+ ui_templates = list(
+ list("name" = "Status Display Access", "template" = "stat_display_access.tmpl"),
+ list("name" = "Employment Records", "template" = "emp_records.tmpl"),
+ list("name" = "Medical Records", "template" = "med_records.tmpl")
+ )
+
+/obj/item/weapon/commcard/head/cmo/New()
+ ..()
+ internal_devices |= new /obj/item/device/healthanalyzer(src)
+ internal_devices |= new /obj/item/device/reagent_scanner(src)
+ internal_devices |= new /obj/item/device/halogen_counter(src)
+
+/obj/item/weapon/commcard/head/cmo/get_data()
+ var/list/data = ..()
+ // Med records
+ data[++data.len] = list("field" = "med_records", "value" = get_med_records())
+ return data
+
+// Chief Engineer Cartridge:
+// Devices
+// *- Gas Scanner
+// *- Halogen Counter
+// Templates
+// *- Status Display Access
+// *- Employment Records
+// *- Power Monitoring
+/obj/item/weapon/commcard/head/ce
+ name = "\improper Power-On DELUXE"
+ icon_state = "cart-ce"
+ ui_templates = list(
+ list("name" = "Status Display Access", "template" = "stat_display_access.tmpl"),
+ list("name" = "Employment Records", "template" = "emp_records.tmpl"),
+ list("name" = "Power Monitor", "template" = "comm_power_monitor.tmpl")
+ )
+
+/obj/item/weapon/commcard/head/ce/New()
+ ..()
+ internal_devices |= new /obj.item/device/analyzer(src)
+ internal_devices |= new /obj/item/device/halogen_counter(src)
+
+/obj/item/weapon/commcard/head/ce/initialize()
+ internal_data["grid_sensors"] = find_powernet_sensors()
+ internal_data["powernet_target"] = ""
+
+/obj/item/weapon/commcard/head/ce/get_data()
+ var/list/data = ..()
+ // Add power monitoring data
+ data[++data.len] = list("field" = "powernet_monitoring", "value" = get_powernet_monitoring_list())
+ data[++data.len] = list("field" = "powernet_target", "value" = get_powernet_target(internal_data["powernet_target"]))
+ return data
+
+
+// Captain Cartridge:
+// Devices
+// *- Health analyzer
+// *- Gas Scanner
+// *- Reagent Scanner
+// *- Halogen Counter
+// X- GPS - Balance
+// *- Signaler
+// Templates
+// *- Status Display Access
+// *- Employment Records
+// *- Medical Records
+// *- Security Records
+// *- Power Monitoring
+// *- Supply Records
+// X- Supply Bot Access - Mulebots usually break when used
+// *- Security Bot Access
+// *- Janitorial Locator Magicbox
+// X- GPS Access - Balance
+// *- Signaler Access
+/obj/item/weapon/commcard/head/captain
+ name = "\improper Value-PAK cartridge"
+ desc = "Now with 200% more value!"
+ icon_state = "cart-c"
+ ui_templates = list(
+ list("name" = "Status Display Access", "template" = "stat_display_access.tmpl"),
+ list("name" = "Employment Records", "template" = "emp_records.tmpl"),
+ list("name" = "Medical Records", "template" = "med_records.tmpl"),
+ list("name" = "Security Records", "template" = "sec_records.tmpl"),
+ list("name" = "Security Bot Control", "template" = "sec_bot_access.tmpl"),
+ list("name" = "Power Monitor", "template" = "comm_power_monitor.tmpl"),
+ list("name" = "Supply Records", "template" = "supply_records.tmpl"),
+ list("name" = "Janitorial Supply Locator", "template" = "janitorialLocator.tmpl"),
+ list("name" = "Integrated Signaler Control", "template" = "signaler_access.tmpl")
+ )
+
+/obj/item/weapon/commcard/head/captain/New()
+ ..()
+ internal_devices |= new /obj.item/device/analyzer(src)
+ internal_devices |= new /obj/item/device/healthanalyzer(src)
+ internal_devices |= new /obj/item/device/reagent_scanner(src)
+ internal_devices |= new /obj/item/device/halogen_counter(src)
+ internal_devices |= new /obj/item/device/assembly/signaler(src)
+
+/obj/item/weapon/commcard/head/captain/get_data()
+ var/list/data = ..()
+ //Med records
+ data[++data.len] = list("field" = "med_records", "value" = get_med_records())
+
+ // Sec records
+ data[++data.len] = list("field" = "sec_records", "value" = get_sec_records())
+
+ // Sec bot access
+ data[++data.len] = list("field" = "sec_bot_access", "value" = get_sec_bot_access())
+
+ // Power Monitoring
+ data[++data.len] = list("field" = "powernet_monitoring", "value" = get_powernet_monitoring_list())
+ data[++data.len] = list("field" = "powernet_target", "value" = get_powernet_target(internal_data["powernet_target"]))
+
+ // Supply records data
+ var/list/shuttle_status = get_supply_shuttle_status()
+ var/list/orders = get_supply_orders()
+ var/list/receipts = get_supply_receipts()
+ var/list/misc_supply_data = get_misc_supply_data() // Packaging this stuff externally so it's less hardcoded into the specific cartridge
+ var/list/pack_list = list() // List of supply packs within the currently selected category
+
+ if(internal_data["supply_category"])
+ pack_list = get_supply_pack_list()
+
+ data[++data.len] = list("field" = "shuttle_auth", "value" = misc_supply_data["shuttle_auth"])
+ data[++data.len] = list("field" = "order_auth", "value" = misc_supply_data["order_auth"])
+ data[++data.len] = list("field" = "supply_points", "value" = misc_supply_data["supply_points"])
+ data[++data.len] = list("field" = "categories", "value" = misc_supply_data["supply_categories"])
+ data[++data.len] = list("field" = "contraband", "value" = misc_supply_data["contraband"])
+ data[++data.len] = list("field" = "active_category", "value" = internal_data["supply_category"])
+ data[++data.len] = list("field" = "shuttle", "value" = shuttle_status)
+ data[++data.len] = list("field" = "orders", "value" = orders)
+ data[++data.len] = list("field" = "receipts", "value" = receipts)
+ data[++data.len] = list("field" = "supply_packs", "value" = pack_list)
+
+ // Janitorial locator magicbox
+ data[++data.len] = list("field" = "janidata", "value" = get_janitorial_locations())
+
+ // Signaler access
+ data[++data.len] = list("field" = "signaler_access", "value" = get_int_signalers())
+
+ return data
+
+
+// Mercenary Cartridge
+// Templates
+// *- Merc Shuttle Door Controller
+/obj/item/weapon/commcard/mercenary
+ name = "\improper Detomatix cartridge"
+ icon_state = "cart"
+ ui_templates = list(
+ list("name" = "Shuttle Blast Door Control", "template" = "merc_blast_door_control.tmpl")
+ )
+
+/obj/item/weapon/commcard/mercenary/initialize()
+ internal_data["shuttle_door_code"] = "smindicate" // Copied from PDA code
+ internal_data["shuttle_doors"] = find_blast_doors()
+
+/obj/item/weapon/commcard/mercenary/get_data()
+ var/door_status[0]
+ for(var/obj/machinery/door/blast/B in internal_data["shuttle_doors"])
+ door_status[++door_status.len] += list(
+ "open" = B.density,
+ "name" = B.name,
+ "ref" = "\ref[B]"
+ )
+
+ return list(
+ list("field" = "blast_door", "value" = door_status)
+ )
+
+
+// Explorer Cartridge
+// Devices
+// *- GPS
+// Templates
+// *- GPS Access
+
+// IMPORTANT: NOT MAPPED IN DUE TO BALANCE CONCERNS RE: FINDING THE VICTIMS OF ANTAGS.
+// See suit sensors, specifically ease of turning them off, and variable level of settings which may or may not give location
+// A GPS in your phone that is either broadcasting position or totally off, and can be hidden in pockets, coats, bags, boxes, etc, is much harder to disable
+/obj/item/weapon/commcard/explorer
+ name = "\improper Explorator cartridge"
+ icon_state = "cart-tox"
+ ui_templates = list(
+ list("name" = "Integrated GPS", "template" = "gps_access.tmpl")
+ )
+
+/obj/item/weapon/commcard/explorer/New()
+ ..()
+ internal_devices |= new /obj/item/device/gps/explorer(src)
+
+/obj/item/weapon/commcard/explorer/get_data()
+ var/list/GPS = get_GPS_lists()
+
+ return list(
+ list("field" = "gps_access", "value" = GPS[1]),
+ list("field" = "gps_signal", "value" = GPS[2]),
+ list("field" = "gps_status", "value" = GPS[3])
+ )
\ No newline at end of file
diff --git a/code/game/objects/items/devices/communicator/communicator.dm b/code/game/objects/items/devices/communicator/communicator.dm
index 7342988916..ec9c09c161 100644
--- a/code/game/objects/items/devices/communicator/communicator.dm
+++ b/code/game/objects/items/devices/communicator/communicator.dm
@@ -4,6 +4,18 @@
var/global/list/obj/item/device/communicator/all_communicators = list()
+// List of core tabs the communicator can switch to
+#define HOMETAB 1
+#define PHONTAB 2
+#define CONTTAB 3
+#define MESSTAB 4
+#define NEWSTAB 5
+#define NOTETAB 6
+#define WTHRTAB 7
+#define MANITAB 8
+#define SETTTAB 9
+#define EXTRTAB 10
+
/obj/item/device/communicator
name = "communicator"
desc = "A personal device used to enable long range dialog between two people, utilizing existing telecommunications infrastructure to allow \
@@ -31,20 +43,22 @@ var/global/list/obj/item/device/communicator/all_communicators = list()
var/note = "Thank you for choosing the T-14.2 Communicator, this is your notepad!" //Current note in the notepad function
var/notehtml = ""
- var/obj/item/weapon/cartridge/cartridge = null //current cartridge
+ var/obj/item/weapon/commcard/cartridge = null //current cartridge
var/fon = 0 // Internal light
var/flum = 2 // Brightness
var/list/modules = list(
- list("module" = "Phone", "icon" = "phone64", "number" = 2),
- list("module" = "Contacts", "icon" = "person64", "number" = 3),
- list("module" = "Messaging", "icon" = "comment64", "number" = 4),
- list("module" = "Note", "icon" = "note64", "number" = 5),
- list("module" = "Weather", "icon" = "sun64", "number" = 6),
- list("module" = "Settings", "icon" = "gear64", "number" = 7)
+ list("module" = "Phone", "icon" = "phone64", "number" = PHONTAB),
+ list("module" = "Contacts", "icon" = "person64", "number" = CONTTAB),
+ list("module" = "Messaging", "icon" = "comment64", "number" = MESSTAB),
+ list("module" = "News", "icon" = "note64", "number" = NEWSTAB), // Need a different icon,
+ list("module" = "Note", "icon" = "note64", "number" = NOTETAB),
+ list("module" = "Weather", "icon" = "sun64", "number" = WTHRTAB),
+ list("module" = "Crew Manifest", "icon" = "note64", "number" = MANITAB), // Need a different icon,
+ list("module" = "Settings", "icon" = "gear64", "number" = SETTTAB),
) //list("module" = "Name of Module", "icon" = "icon name64", "number" = "what tab is the module")
- var/selected_tab = 1
+ var/selected_tab = HOMETAB
var/owner = ""
var/occupation = ""
var/alert_called = 0
@@ -89,7 +103,7 @@ var/global/list/obj/item/device/communicator/all_communicators = list()
/obj/item/device/communicator/examine(mob/user)
. = ..(user, 1)
if(. && video_source)
- user << "It looks like it's on a video call: \[view\]"
+ to_chat(user, "It looks like it's on a video call: \[view\]")
// Proc: initialize_exonet()
// Parameters: 1 (user - the person the communicator belongs to)
@@ -130,7 +144,7 @@ var/global/list/obj/item/device/communicator/all_communicators = list()
else
msg += "The device doesn't appear to be transmitting any data.\n"
msg += ""
- user << msg
+ to_chat(user, msg)
return
// Proc: emp_act()
@@ -188,10 +202,22 @@ var/global/list/obj/item/device/communicator/all_communicators = list()
if(!get_connection_to_tcomms())
close_connection(reason = "Connection timed out")
+// Proc: attack()
+// Parameters: 2 (M - what is being attacked. user - the mob that has the communicator)
+// Description: When the communicator has an attached commcard with internal devices, relay the attack() through to those devices.
+// Contents of the for loop are copied from gripper code, because that does approximately what we want to do.
+/obj/item/device/communicator/attack(mob/living/carbon/M as mob, mob/living/carbon/user as mob)
+ if(cartridge && cartridge.active_devices)
+ for(var/obj/item/wrapped in cartridge.active_devices)
+ if(wrapped) //The force of the wrapped obj gets set to zero during the attack() and afterattack().
+ wrapped.attack(M,user)
+ return 0
+
// Proc: attackby()
// Parameters: 2 (C - what is used on the communicator. user - the mob that has the communicator)
// Description: When an ID is swiped on the communicator, the communicator reads the job and checks it against the Owner name, if success, the occupation is added.
/obj/item/device/communicator/attackby(obj/item/C as obj, mob/user as mob)
+ ..()
if(istype(C, /obj/item/weapon/card/id))
var/obj/item/weapon/card/id/idcard = C
if(!idcard.registered_name || !idcard.assignment)
@@ -201,12 +227,14 @@ var/global/list/obj/item/device/communicator/all_communicators = list()
else if(owner == idcard.registered_name)
occupation = idcard.assignment
to_chat(user, "Occupation updated.")
-// else if(istype(C, /obj/item/weapon/cartridge))
-// if(cartridge)
-// to_chat(user, "\The [src] already has an external device attached!")
-// else
-// modules.Add(list("module" = "External Device", "icon = external64", "number" = 8))
-// cartridge = C
+
+ if(istype(C, /obj/item/weapon/commcard) && !cartridge)
+ cartridge = C
+ user.drop_item()
+ cartridge.forceMove(src)
+ to_chat(usr, "You slot \the [cartridge] into \the [src].")
+ modules[++modules.len] = list("module" = "External Device", "icon" = "external64", "number" = EXTRTAB)
+ GLOB.nanomanager.update_uis(src) // update all UIs attached to src
return
// Proc: attack_self()
@@ -298,8 +326,8 @@ var/global/list/obj/item/device/communicator/all_communicators = list()
all_communicators -= src
processing_objects -= src
listening_objects.Remove(src)
- qdel_null(camera)
- qdel_null(exonet)
+ QDEL_NULL(camera)
+ QDEL_NULL(exonet)
return ..()
@@ -330,6 +358,38 @@ var/global/list/obj/item/device/communicator/all_communicators = list()
client_huds |= global_hud.whitense
client_huds |= global_hud.darkMask
+/obj/item/device/communicator/verb/verb_remove_cartridge()
+ set category = "Object"
+ set name = "Remove commcard"
+ set src in usr
+
+ // Can't remove what isn't there
+ if(!cartridge)
+ to_chat(usr, "There isn't a commcard to remove!")
+ return
+
+ // Can't remove if you're physically unable to
+ if(usr.stat || usr.restrained() || usr.paralysis || usr.stunned || usr.weakened)
+ to_chat(usr, "You cannot do this while restrained.")
+ return
+
+ var/turf/T = get_turf(src)
+ cartridge.loc = T
+ // If it's in someone, put the cartridge in their hands
+ if (ismob(loc))
+ var/mob/M = loc
+ M.put_in_hands(cartridge)
+ // Else just set it on the ground
+ else
+ cartridge.loc = get_turf(src)
+ cartridge = null
+ // We have to iterate through the modules to find EXTRTAB, because list procs don't play nice with a list of lists
+ for(var/i = 1, i <= modules.len, i++)
+ if(modules[i]["number"] == EXTRTAB)
+ modules.Cut(i, i+1)
+ break
+ to_chat(usr, "You remove \the [cartridge] from the [name].")
+
//It's the 26th century. We should have smart watches by now.
/obj/item/device/communicator/watch
name = "communicator watch"
diff --git a/code/game/objects/items/devices/communicator/helper.dm b/code/game/objects/items/devices/communicator/helper.dm
index 9c121112ac..b7a3b752d9 100644
--- a/code/game/objects/items/devices/communicator/helper.dm
+++ b/code/game/objects/items/devices/communicator/helper.dm
@@ -11,17 +11,532 @@
var/co2_level = environment.gas["carbon_dioxide"]/total_moles
var/phoron_level = environment.gas["phoron"]/total_moles
var/unknown_level = 1-(o2_level+n2_level+co2_level+phoron_level)
+
+ // Label is what the entry is describing
+ // Type identifies which unit or other special characters to use
+ // Val is the information reported
+ // Bad_high/_low are the values outside of which the entry reports as dangerous
+ // Poor_high/_low are the values outside of which the entry reports as unideal
+ // Values were extracted from the template itself
results = list(
- "pressure" = "[round(pressure,0.1)]",
- "nitrogen" = "[round(n2_level*100,0.1)]",
- "oxygen" = "[round(o2_level*100,0.1)]",
- "carbon_dioxide" = "[round(co2_level*100,0.1)]",
- "phoron" = "[round(phoron_level*100,0.01)]",
- "other" = "[round(unknown_level, 0.01)]",
- "temp" = "[round(environment.temperature-T0C,0.1)]",
- "reading" = 1
+ list("entry" = "Pressure", "type" = "pressure", "val" = "[round(pressure,0.1)]", "bad_high" = 120, "poor_high" = 110, "poor_low" = 95, "bad_low" = 80),
+ list("entry" = "Temperature", "type" = "temp", "val" = "[round(environment.temperature-T0C,0.1)]", "bad_high" = 35, "poor_high" = 25, "poor_low" = 15, "bad_low" = 5),
+ list("entry" = "Oxygen", "type" = "pressure", "val" = "[round(o2_level*100,0.1)]", "bad_high" = 140, "poor_high" = 135, "poor_low" = 19, "bad_low" = 17),
+ list("entry" = "Nitrogen", "type" = "pressure", "val" = "[round(n2_level*100,0.1)]", "bad_high" = 105, "poor_high" = 85, "poor_low" = 50, "bad_low" = 40),
+ list("entry" = "Carbon Dioxide", "type" = "pressure", "val" = "[round(co2_level*100,0.1)]", "bad_high" = 10, "poor_high" = 5, "poor_low" = 0, "bad_low" = 0),
+ list("entry" = "Phoron", "type" = "pressure", "val" = "[round(phoron_level*100,0.01)]", "bad_high" = 0.5, "poor_high" = 0, "poor_low" = 0, "bad_low" = 0),
+ list("entry" = "Other", "type" = "pressure", "val" = "[round(unknown_level, 0.01)]", "bad_high" = 1, "poor_high" = 0.5, "poor_low" = 0, "bad_low" = 0)
)
if(isnull(results))
- results = list("reading" = 0)
- return results
\ No newline at end of file
+ results = list(list("entry" = "pressure", "val" = "0"))
+ return results
+
+
+// Proc - compile_news()
+// Parameters - none
+// Description - Returns the list of newsfeeds, compiled for template processing
+/obj/item/device/communicator/proc/compile_news()
+ var/list/feeds = list()
+ for(var/datum/feed_channel/channel in news_network.network_channels)
+ var/list/messages = list()
+ if(!channel.censored)
+ var/index = 0
+ for(var/datum/feed_message/FM in channel.messages)
+ index++
+ if(FM.img)
+ usr << browse_rsc(FM.img, "pda_news_tmp_photo_[feeds["channel"]]_[index].png")
+ // News stories are HTML-stripped but require newline replacement to be properly displayed in NanoUI
+ var/body = replacetext(FM.body, "\n", "
")
+ messages[++messages.len] = list(
+ "author" = FM.author,
+ "body" = body,
+ "message_type" = FM.message_type,
+ "time_stamp" = FM.time_stamp,
+ "has_image" = (FM.img != null),
+ "caption" = FM.caption,
+ "index" = index
+ )
+
+ feeds[++feeds.len] = list(
+ "name" = channel.channel_name,
+ "censored" = channel.censored,
+ "author" = channel.author,
+ "messages" = messages
+ )
+ return feeds
+
+// Proc - get_recent_news()
+// Parameters - none
+// Description - Returns the latest three newscasts, compiled for template processing
+/obj/item/device/communicator/proc/get_recent_news()
+ var/list/news = list()
+
+ // Compile all the newscasts
+ for(var/datum/feed_channel/channel in news_network.network_channels)
+ if(!channel.censored)
+ for(var/datum/feed_message/FM in channel.messages)
+ var/body = replacetext(FM.body, "\n", "
")
+ news[++news.len] = list(
+ "channel" = channel.channel_name,
+ "author" = FM.author,
+ "body" = body,
+ "message_type" = FM.message_type,
+ "time_stamp" = FM.time_stamp,
+ "has_image" = (FM.img != null),
+ "caption" = FM.caption,
+ )
+
+ // Cut out all but the youngest three
+ while(news.len > 3)
+ var/oldest = min(news[0]["time_stamp"], news[1]["time_stamp"], news[2]["time_stamp"], news[3]["time_stamp"])
+ for(var/i = 0, i < 4, i++)
+ if(news[i]["time_stamp"] == oldest)
+ news.Remove(news[i])
+
+ return news
+
+
+
+// Putting the commcard data harvesting helpers here
+// Not ideal to put all the procs on the base type
+// but it may open options for adminbus,
+// And it saves duplicated code
+
+
+// Medical records
+/obj/item/weapon/commcard/proc/get_med_records()
+ var/med_records[0]
+ for(var/datum/data/record/M in sortRecord(data_core.medical))
+ var/record[0]
+ record[++record.len] = list("tab" = "Name", "val" = M.fields["name"])
+ record[++record.len] = list("tab" = "ID", "val" = M.fields["id"])
+ record[++record.len] = list("tab" = "Blood Type", "val" = M.fields["b_type"])
+ record[++record.len] = list("tab" = "DNA #", "val" = M.fields["b_dna"])
+ record[++record.len] = list("tab" = "Gender", "val" = M.fields["id_gender"])
+ record[++record.len] = list("tab" = "Entity Classification", "val" = M.fields["brain_type"])
+ record[++record.len] = list("tab" = "Minor Disorders", "val" = M.fields["mi_dis"])
+ record[++record.len] = list("tab" = "Major Disorders", "val" = M.fields["ma_dis"])
+ record[++record.len] = list("tab" = "Allergies", "val" = M.fields["alg"])
+ record[++record.len] = list("tab" = "Condition", "val" = M.fields["cdi"])
+ record[++record.len] = list("tab" = "Notes", "val" = M.fields["notes"])
+
+ med_records[++med_records.len] = list("name" = M.fields["name"], "record" = record)
+ return med_records
+
+
+// Employment records
+/obj/item/weapon/commcard/proc/get_emp_records()
+ var/emp_records[0]
+ for(var/datum/data/record/G in sortRecord(data_core.general))
+ var/record[0]
+ record[++record.len] = list("tab" = "Name", "val" = G.fields["name"])
+ record[++record.len] = list("tab" = "ID", "val" = G.fields["id"])
+ record[++record.len] = list("tab" = "Rank", "val" = G.fields["rank"])
+ record[++record.len] = list("tab" = "Fingerprint", "val" = G.fields["fingerprint"])
+ record[++record.len] = list("tab" = "Entity Classification", "val" = G.fields["brain_type"])
+ record[++record.len] = list("tab" = "Sex", "val" = G.fields["sex"])
+ record[++record.len] = list("tab" = "Species", "val" = G.fields["species"])
+ record[++record.len] = list("tab" = "Age", "val" = G.fields["age"])
+ record[++record.len] = list("tab" = "Notes", "val" = G.fields["notes"])
+
+ emp_records[++emp_records.len] = list("name" = G.fields["name"], "record" = record)
+ return emp_records
+
+
+// Security records
+/obj/item/weapon/commcard/proc/get_sec_records()
+ var/sec_records[0]
+ for(var/datum/data/record/G in sortRecord(data_core.general))
+ var/record[0]
+ record[++record.len] = list("tab" = "Name", "val" = G.fields[""])
+ record[++record.len] = list("tab" = "Sex", "val" = G.fields[""])
+ record[++record.len] = list("tab" = "Species", "val" = G.fields[""])
+ record[++record.len] = list("tab" = "Age", "val" = G.fields[""])
+ record[++record.len] = list("tab" = "Rank", "val" = G.fields[""])
+ record[++record.len] = list("tab" = "Fingerprint", "val" = G.fields[""])
+ record[++record.len] = list("tab" = "Physical Status", "val" = G.fields[""])
+ record[++record.len] = list("tab" = "Mental Status", "val" = G.fields[""])
+ record[++record.len] = list("tab" = "Criminal Status", "val" = G.fields[""])
+ record[++record.len] = list("tab" = "Major Crimes", "val" = G.fields[""])
+ record[++record.len] = list("tab" = "Minor Crimes", "val" = G.fields[""])
+ record[++record.len] = list("tab" = "Notes", "val" = G.fields["notes"])
+
+ sec_records[++sec_records.len] = list("name" = G.fields["name"], "record" = record)
+ return sec_records
+
+
+// Status of all secbots
+// Weaker than what PDAs appear to do, but as of 7/1/2018 PDA secbot access is nonfunctional
+/obj/item/weapon/commcard/proc/get_sec_bot_access()
+ var/sec_bots[0]
+ for(var/mob/living/bot/secbot/S in mob_list)
+ // Get new bot
+ var/status[0]
+ status[++status.len] = list("tab" = "Name", "val" = sanitize(S.name))
+
+ // If it's turned off, then it shouldn't be broadcasting any further info
+ if(!S.on)
+ status[++status.len] = list("tab" = "Power", "val" = "Off") // Encoding the span classes here so I don't have to do complicated switches in the ui template
+ continue
+ status[++status.len] = list("tab" = "Power", "val" = "On")
+
+ // -- What it's doing
+ // If it's engaged, then say who it thinks it's engaging
+ if(S.target)
+ status[++status.len] = list("tab" = "Status", "val" = "Apprehending Target")
+ status[++status.len] = list("tab" = "Target", "val" = S.target_name(S.target))
+ // Else if it's patrolling
+ else if(S.will_patrol)
+ status[++status.len] = list("tab" = "Status", "val" = "Patrolling")
+ // Otherwise we don't know what it's doing
+ else
+ status[++status.len] = list("tab" = "Status", "val" = "Idle")
+
+ // Where it is
+ status[++status.len] = list("tab" = "Location", "val" = sanitize("[get_area(S.loc)]"))
+
+ // Append bot to the list
+ sec_bots[++sec_bots.len] = list("bot" = S.name, "status" = status)
+ return sec_bots
+
+
+// Code and frequency of stored signalers
+// Supports multiple signalers within the device
+/obj/item/weapon/commcard/proc/get_int_signalers()
+ var/signalers[0]
+ for(var/obj/item/device/assembly/signaler/S in internal_devices)
+ var/unit[0]
+ unit[++unit.len] = list("tab" = "Code", "val" = S.code)
+ unit[++unit.len] = list("tab" = "Frequency", "val" = S.frequency)
+
+ signalers[++signalers.len] = list("ref" = "\ref[S]", "status" = unit)
+
+ return signalers
+
+// Returns list of all powernet sensors currently visible to the commcard
+/obj/item/weapon/commcard/proc/find_powernet_sensors()
+ var/grid_sensors[0]
+
+ // Find all the powernet sensors we need to pull data from
+ // Copied from /datum/nano_module/power_monitor/proc/refresh_sensors(),
+ // located in '/code/modules/nano/modules/power_monitor.dm'
+ // Minor tweaks for efficiency and cleanliness
+ var/turf/T = get_turf(src)
+ if(T)
+ var/list/levels = using_map.get_map_levels(T.z, FALSE)
+ for(var/obj/machinery/power/sensor/S in machines)
+ if((S.long_range) || (S.loc.z in levels) || (S.loc.z == T.z)) // Consoles have range on their Z-Level. Sensors with long_range var will work between Z levels.
+ if(S.name_tag == "#UNKN#") // Default name. Shouldn't happen!
+ warning("Powernet sensor with unset ID Tag! [S.x]X [S.y]Y [S.z]Z")
+ else
+ grid_sensors += S
+ return grid_sensors
+
+// List of powernets
+/obj/item/weapon/commcard/proc/get_powernet_monitoring_list()
+ // Fetch power monitor data
+ var/sensors[0]
+
+ for(var/obj/machinery/power/sensor/S in internal_data["grid_sensors"])
+ var/list/focus = S.return_reading_data()
+
+ sensors[++sensors.len] = list(
+ "name" = S.name_tag,
+ "alarm" = focus["alarm"]
+ )
+
+ return sensors
+
+// Information about the targeted powernet
+/obj/item/weapon/commcard/proc/get_powernet_target(var/target_sensor)
+ if(!target_sensor)
+ return
+
+ var/powernet_target[0]
+
+ for(var/obj/machinery/power/sensor/S in internal_data["grid_sensors"])
+ var/list/focus = S.return_reading_data()
+
+ // Packages the span class here so it doesn't need to be interpreted w/in the for loop in the ui template
+ var/load_stat = "Optimal"
+ if(focus["load_percentage"] >= 95)
+ load_stat = "DANGER: Overload"
+ else if(focus["load_percentage"] >= 85)
+ load_stat = "WARNING: High Load"
+
+ var/alarm_stat = focus["alarm"] ? "WARNING: Abnormal activity detected!" : "Secure"
+
+ if(target_sensor == S.name_tag)
+ powernet_target = list(
+ "name" = S.name_tag,
+ "alarm" = focus["alarm"],
+ "error" = focus["error"],
+ "apc_data" = focus["apc_data"],
+ "status" = list(
+ list("field" = "Network Load Status", "statval" = load_stat),
+ list("field" = "Network Security Status", "statval" = alarm_stat),
+ list("field" = "Load Percentage", "statval" = focus["load_percentage"]),
+ list("field" = "Available Power", "statval" = focus["total_avail"]),
+ list("field" = "APC Power Usage", "statval" = focus["total_used_apc"]),
+ list("field" = "Other Power Usage", "statval" = focus["total_used_other"]),
+ list("field" = "Total Usage", "statval" = focus["total_used_all"])
+ )
+ )
+
+ return powernet_target
+
+// Compiles the locations of all janitorial paraphernalia, as used by janitorialLocator.tmpl
+/obj/item/weapon/commcard/proc/get_janitorial_locations()
+ // Fetch janitorial locator
+ var/janidata[0]
+ var/list/cleaningList = list()
+ cleaningList += all_mops + all_mopbuckets + all_janitorial_carts
+
+ // User's location
+ var/turf/userloc = get_turf(src)
+ if(isturf(userloc))
+ janidata[++janidata.len] = list("field" = "Current Location", "val" = "[userloc.x], [userloc.y], [using_map.get_zlevel_name(userloc.z)]")
+ else
+ janidata[++janidata.len] = list("field" = "Current Location", "val" = "Unknown")
+ return janidata // If the user isn't on a valid turf, then it shouldn't be able to find anything anyways
+
+ // Mops, mop buckets, janitorial carts.
+ for(var/obj/C in cleaningList)
+ var/turf/T = get_turf(C)
+ if(isturf(T) )//&& T.z in using_map.get_map_levels(userloc, FALSE))
+ if(T.z == userloc.z)
+ janidata[++janidata.len] = list("field" = apply_text_macros("\proper [C.name]"), "val" = "[T.x], [T.y], [using_map.get_zlevel_name(T.z)]")
+ else
+ janidata[++janidata.len] = list("field" = apply_text_macros("\proper [C.name]"), "val" = "[T.x], [T.y], [using_map.get_zlevel_name(T.z)]")
+
+ // Cleanbots
+ for(var/mob/living/bot/cleanbot/B in living_mob_list)
+ var/turf/T = get_turf(B)
+ if(isturf(T) )//&& T.z in using_map.get_map_levels(userloc, FALSE))
+ var/textout = ""
+ if(B.on)
+ textout += "Status: Online
"
+ if(T.z == userloc.z)
+ textout += "[T.x], [T.y], [using_map.get_zlevel_name(T.z)]"
+ else
+ textout += "[T.x], [T.y], [using_map.get_zlevel_name(T.z)]"
+ else
+ textout += "Status: Offline"
+
+ janidata[++janidata.len] = list("field" = "[B.name]", "val" = textout)
+
+ return janidata
+
+// Compiles the three lists used by GPS_access.tmpl
+// The contents of the three lists are inherently related, so separating them into different procs would be largely redundant
+/obj/item/weapon/commcard/proc/get_GPS_lists()
+ // GPS Access
+ var/intgps[0] // Gps devices within the commcard -- Allow tag edits, turning on/off, etc
+ var/extgps[0] // Gps devices not inside the commcard -- Print locations if a gps is on
+ var/stagps[0] // Gps net status, location, whether it's on, if it's got long range
+ var/obj/item/device/gps/cumulative = new(src)
+ cumulative.tracking = FALSE
+ cumulative.local_mode = TRUE // Won't detect long-range signals automatically
+ cumulative.long_range = FALSE
+ var/list/toggled_gps = list() // List of GPS units that are turned off before display_list() is called
+
+ for(var/obj/item/device/gps/G in internal_devices)
+ var/gpsdata[0]
+ if(G.tracking && !G.emped)
+ cumulative.tracking = TRUE // Turn it on
+ if(G.long_range)
+ cumulative.long_range = TRUE // It can detect long-range
+ if(!G.local_mode)
+ cumulative.local_mode = FALSE // It is detecting long-range
+
+ gpsdata["ref"] = "\ref[G]"
+ gpsdata["tag"] = G.gps_tag
+ gpsdata["power"] = G.tracking
+ gpsdata["local_mode"] = G.local_mode
+ gpsdata["long_range"] = G.long_range
+ gpsdata["hide_signal"] = G.hide_signal
+ gpsdata["can_hide"] = G.can_hide_signal
+
+ intgps[++intgps.len] = gpsdata // Add it to the list
+
+ if(G.tracking)
+ G.tracking = FALSE // Disable the internal gps units so they don't show up in the report
+ toggled_gps += G
+
+ var/list/remote_gps = cumulative.display_list() // Fetch information for all units except the ones inside of this device
+
+ for(var/obj/item/device/gps/G in toggled_gps) // Reenable any internal GPS units
+ G.tracking = TRUE
+
+ stagps["enabled"] = cumulative.tracking
+ stagps["long_range_en"] = (cumulative.long_range && !cumulative.local_mode)
+
+ stagps["my_area_name"] = remote_gps["my_area_name"]
+ stagps["curr_x"] = remote_gps["curr_x"]
+ stagps["curr_y"] = remote_gps["curr_y"]
+ stagps["curr_z"] = remote_gps["curr_z"]
+ stagps["curr_z_name"] = remote_gps["curr_z_name"]
+
+ extgps = remote_gps["gps_list"] // Compiled by the GPS
+
+ qdel(cumulative) // Don't want spare GPS units building up in the contents
+
+ return list(
+ intgps,
+ extgps,
+ stagps
+ )
+
+// Collects the current status of the supply shuttle
+// Copied from /obj/machinery/computer/supplycomp/ui_interact(),
+// code\game\machinery\computer\supply.dm, starting at line 55
+/obj/item/weapon/commcard/proc/get_supply_shuttle_status()
+ var/shuttle_status[0]
+ var/datum/shuttle/ferry/supply/shuttle = supply_controller.shuttle
+ if(shuttle)
+ if(shuttle.has_arrive_time())
+ shuttle_status["location"] = "In transit"
+ shuttle_status["mode"] = SUP_SHUTTLE_TRANSIT
+ shuttle_status["time"] = shuttle.eta_minutes()
+
+ else
+ shuttle_status["time"] = 0
+ if(shuttle.at_station())
+ if(shuttle.docking_controller)
+ switch(shuttle.docking_controller.get_docking_status())
+ if("docked")
+ shuttle_status["location"] = "Docked"
+ shuttle_status["mode"] = SUP_SHUTTLE_DOCKED
+ if("undocked")
+ shuttle_status["location"] = "Undocked"
+ shuttle_status["mode"] = SUP_SHUTTLE_UNDOCKED
+ if("docking")
+ shuttle_status["location"] = "Docking"
+ shuttle_status["mode"] = SUP_SHUTTLE_DOCKING
+ shuttle_status["force"] = shuttle.can_force()
+ if("undocking")
+ shuttle_status["location"] = "Undocking"
+ shuttle_status["mode"] = SUP_SHUTTLE_UNDOCKING
+ shuttle_status["force"] = shuttle.can_force()
+
+ else
+ shuttle_status["location"] = "Station"
+ shuttle_status["mode"] = SUP_SHUTTLE_DOCKED
+
+ else
+ shuttle_status["location"] = "Away"
+ shuttle_status["mode"] = SUP_SHUTTLE_AWAY
+
+ if(shuttle.can_launch())
+ shuttle_status["launch"] = 1
+ else if(shuttle.can_cancel())
+ shuttle_status["launch"] = 2
+ else
+ shuttle_status["launch"] = 0
+
+ switch(shuttle.moving_status)
+ if(SHUTTLE_IDLE)
+ shuttle_status["engine"] = "Idle"
+ if(SHUTTLE_WARMUP)
+ shuttle_status["engine"] = "Warming up"
+ if(SHUTTLE_INTRANSIT)
+ shuttle_status["engine"] = "Engaged"
+
+ else
+ shuttle["mode"] = SUP_SHUTTLE_ERROR
+
+ return shuttle_status
+
+// Compiles the list of supply orders
+// Copied from /obj/machinery/computer/supplycomp/ui_interact(),
+// code\game\machinery\computer\supply.dm, starting at line 130
+/obj/item/weapon/commcard/proc/get_supply_orders()
+ var/orders[0]
+ for(var/datum/supply_order/S in supply_controller.order_history)
+ orders[++orders.len] = list(
+ "ref" = "\ref[S]",
+ "status" = S.status,
+ "entries" = list(
+ list("field" = "Supply Pack", "entry" = S.name),
+ list("field" = "Cost", "entry" = S.cost),
+ list("field" = "Index", "entry" = S.index),
+ list("field" = "Reason", "entry" = S.comment),
+ list("field" = "Ordered by", "entry" = S.ordered_by),
+ list("field" = "Ordered at", "entry" = S.ordered_at),
+ list("field" = "Approved by", "entry" = S.approved_by),
+ list("field" = "Approved at", "entry" = S.approved_at)
+ )
+ )
+
+ return orders
+
+// Compiles the list of supply export receipts
+// Copied from /obj/machinery/computer/supplycomp/ui_interact(),
+// code\game\machinery\computer\supply.dm, starting at line 147
+/obj/item/weapon/commcard/proc/get_supply_receipts()
+ var/receipts[0]
+ for(var/datum/exported_crate/E in supply_controller.exported_crates)
+ receipts[++receipts.len] = list(
+ "ref" = "\ref[E]",
+ "contents" = E.contents,
+ "error" = E.contents["error"],
+ "title" = list(
+ list("field" = "Name", "entry" = E.name),
+ list("field" = "Value", "entry" = E.value)
+ )
+ )
+ return receipts
+
+
+// Compiles the list of supply packs for the category currently stored in internal_data["supply_category"]
+// Copied from /obj/machinery/computer/supplycomp/ui_interact(),
+// code\game\machinery\computer\supply.dm, starting at line 147
+/obj/item/weapon/commcard/proc/get_supply_pack_list()
+ var/supply_packs[0]
+ for(var/pack_name in supply_controller.supply_pack)
+ var/datum/supply_pack/P = supply_controller.supply_pack[pack_name]
+ if(P.group == internal_data["supply_category"])
+ var/list/pack = list(
+ "name" = P.name,
+ "cost" = P.cost,
+ "contraband" = P.contraband,
+ "manifest" = uniquelist(P.manifest),
+ "random" = P.num_contained,
+ "expand" = 0,
+ "ref" = "\ref[P]"
+ )
+
+ if(P in internal_data["supply_pack_expanded"])
+ pack["expand"] = 1
+
+ supply_packs[++supply_packs.len] = pack
+
+ return supply_packs
+
+
+// Compiles miscellaneous data and permissions used by the supply template
+/obj/item/weapon/commcard/proc/get_misc_supply_data()
+ return list(
+ "shuttle_auth" = (internal_data["supply_controls"] & SUP_SEND_SHUTTLE),
+ "order_auth" = (internal_data["supply_controls"] & SUP_ACCEPT_ORDERS),
+ "supply_points" = supply_controller.points,
+ "supply_categories" = all_supply_groups
+ )
+
+/obj/item/weapon/commcard/proc/get_status_display()
+ return list(
+ "line1" = internal_data["stat_display_line1"],
+ "line2" = internal_data["stat_display_line2"],
+ "active_line1" = internal_data["stat_display_active1"],
+ "active_line2" = internal_data["stat_display_active2"],
+ "active" = internal_data["stat_display_special"]
+ )
+
+/obj/item/weapon/commcard/proc/find_blast_doors()
+ var/target_doors[0]
+ for(var/obj/machinery/door/blast/B in machines)
+ if(B.id == internal_data["shuttle_door_code"])
+ target_doors += B
+
+ return target_doors
\ No newline at end of file
diff --git a/code/game/objects/items/devices/defib.dm b/code/game/objects/items/devices/defib.dm
index af9d697d63..1ddfa04bf0 100644
--- a/code/game/objects/items/devices/defib.dm
+++ b/code/game/objects/items/devices/defib.dm
@@ -32,8 +32,8 @@
/obj/item/device/defib_kit/Destroy()
. = ..()
- qdel_null(paddles)
- qdel_null(bcell)
+ QDEL_NULL(paddles)
+ QDEL_NULL(bcell)
/obj/item/device/defib_kit/loaded //starts with a cell
bcell = /obj/item/weapon/cell/apc
@@ -94,7 +94,7 @@
to_chat(user, "You install a cell in \the [src].")
update_icon()
- else if(isscrewdriver(W))
+ else if(W.is_screwdriver())
if(bcell)
bcell.update_icon()
bcell.forceMove(get_turf(src.loc))
diff --git a/code/game/objects/items/devices/gps.dm b/code/game/objects/items/devices/gps.dm
index 78f385a8aa..c62cb541ce 100644
--- a/code/game/objects/items/devices/gps.dm
+++ b/code/game/objects/items/devices/gps.dm
@@ -68,6 +68,55 @@ var/list/GPS_list = list()
/obj/item/device/gps/attack_self(mob/user)
display(user)
+ // Compiles all the data not available directly from the GPS
+ // Like the positions and directions to all other GPS units
+/obj/item/device/gps/proc/display_list()
+ var/list/dat = list()
+
+ var/turf/curr = get_turf(src)
+ var/area/my_area = get_area(src)
+
+ dat["my_area_name"] = my_area.name
+ dat["curr_x"] = curr.x
+ dat["curr_y"] = curr.y
+ dat["curr_z"] = curr.z
+ dat["curr_z_name"] = using_map.get_zlevel_name(curr.z)
+ dat["gps_list"] = list()
+ dat["z_level_detection"] = using_map.get_map_levels(curr.z, long_range)
+
+ for(var/obj/item/device/gps/G in GPS_list - src)
+ if(!G.tracking || G.emped || G.hide_signal)
+ continue
+
+ var/turf/T = get_turf(G)
+ if(local_mode && curr.z != T.z)
+ continue
+ if(!(T.z in dat["z_level_detection"]))
+ continue
+
+ var/gps_data[0]
+ gps_data["ref"] = G
+ gps_data["gps_tag"] = G.gps_tag
+
+ var/area/A = get_area(G)
+ gps_data["area_name"] = A.name
+ if(istype(A, /area/submap))
+ gps_data["area_name"] = "Unknown Area" // Avoid spoilers.
+
+ gps_data["z_name"] = using_map.get_zlevel_name(T.z)
+ gps_data["direction"] = get_adir(curr, T)
+ gps_data["degrees"] = round(Get_Angle(curr,T))
+ gps_data["distX"] = T.x - curr.x
+ gps_data["distY"] = T.y - curr.y
+ gps_data["distance"] = get_dist(curr, T)
+ gps_data["local"] = (curr.z == T.z)
+ gps_data["x"] = T.x
+ gps_data["y"] = T.y
+
+ dat["gps_list"][++dat["gps_list"].len] = gps_data
+
+ return dat
+
/obj/item/device/gps/proc/display(mob/user)
if(!tracking)
to_chat(user, "The device is off. Alt-click it to turn it on.")
@@ -77,48 +126,20 @@ var/list/GPS_list = list()
return
var/list/dat = list()
+ var/list/gps_data = display_list()
- var/turf/curr = get_turf(src)
- var/area/my_area = get_area(src)
- dat += "Current location: [my_area.name] ([curr.x], [curr.y], [using_map.get_zlevel_name(curr.z)])"
+ dat += "Current location: [gps_data["my_area_name"]] ([gps_data["curr_x"]], [gps_data["curr_y"]], [gps_data["curr_z_name"]])"
dat += "[hide_signal ? "Tagged" : "Broadcasting"] as '[gps_tag]'. \[Change Tag\] \
\[Toggle Scan Range\] \
[can_hide_signal ? "\[Toggle Signal Visibility\]":""]"
- var/list/signals = list()
-
- for(var/gps in GPS_list)
- var/obj/item/device/gps/G = gps
- if(G.emped || !G.tracking || G.hide_signal || G == src) // Their GPS isn't on or functional.
- continue
- var/turf/T = get_turf(G)
- var/z_level_detection = using_map.get_map_levels(curr.z, long_range)
-
- if(local_mode && T.z != curr.z) // Only care about the current z-level.
- continue
- else if(!(T.z in z_level_detection)) // Too far away.
- continue
-
- var/area/their_area = get_area(G)
- var/area_name = their_area.name
- if(istype(their_area, /area/submap))
- area_name = "Unknown Area" // Avoid spoilers.
- var/Z_name = using_map.get_zlevel_name(T.z)
- var/direction = get_adir(curr, T)
- var/distX = T.x - curr.x
- var/distY = T.y - curr.y
- var/distance = get_dist(curr, T)
- var/local = curr.z == T.z ? TRUE : FALSE
-
- if(istype(gps, /obj/item/device/gps/internal/poi))
- signals += " [G.gps_tag]: [area_name] - [local ? "[direction] Dist: [round(distance, 10)]m" : "in \the [Z_name]"]"
- else
- signals += " [G.gps_tag]: [area_name], ([T.x], [T.y]) - [local ? "[direction] Dist: [distX ? "[abs(round(distX, 1))]m [(distX > 0) ? "E" : "W"], " : ""][distY ? "[abs(round(distY, 1))]m [(distY > 0) ? "N" : "S"]" : ""]" : "in \the [Z_name]"]"
-
- if(signals.len)
+ if(gps_data["gps_list"].len)
dat += "Detected signals;"
- for(var/line in signals)
- dat += line
+ for(var/gps in gps_data["gps_list"])
+ if(istype(gps_data["ref"], /obj/item/device/gps/internal/poi))
+ dat += " [gps["gps_tag"]]: [gps["area_name"]] - [gps["local"] ? "[gps["direction"]] Dist: [round(gps["distance"], 10)]m" : "in \the [gps["z_name"]]"]"
+ else
+ dat += " [gps["gps_tag"]]: [gps["area_name"]], ([gps["x"]], [gps["y"]]) - [gps["local"] ? "[gps["direction"]] Dist: [gps["distX"] ? "[abs(round(gps["distX"], 1))]m [(gps["distX"] > 0) ? "E" : "W"], " : ""][gps["distY"] ? "[abs(round(gps["distY"], 1))]m [(gps["distY"] > 0) ? "N" : "S"]" : ""]" : "in \the [gps["z_name"]]"]"
else
dat += "No other signals detected."
@@ -221,45 +242,17 @@ var/list/GPS_list = list()
return
var/list/dat = list()
+ var/list/gps_data = display_list()
- var/turf/curr = get_turf(src)
- var/area/my_area = get_area(src)
- dat += "Current location: [my_area.name] ([curr.x], [curr.y], [using_map.get_zlevel_name(curr.z)])"
+ dat += "Current location: [gps_data["my_area_name"]] ([gps_data["curr_x"]], [gps_data["curr_y"]], [gps_data["curr_z_name"]])"
dat += "[hide_signal ? "Tagged" : "Broadcasting"] as '[gps_tag]'. \[Change Tag\] \
\[Toggle Scan Range\] \
[can_hide_signal ? "\[Toggle Signal Visibility\]":""]"
- var/list/signals = list()
-
- for(var/gps in GPS_list)
- var/obj/item/device/gps/G = gps
- if(G.emped || !G.tracking || G.hide_signal || G == src) // Their GPS isn't on or functional.
- continue
- var/turf/T = get_turf(G)
- var/z_level_detection = using_map.get_map_levels(curr.z, long_range)
-
- if(local_mode && T.z != curr.z) // Only care about the current z-level.
- continue
- else if(!(T.z in z_level_detection)) // Too far away.
- continue
-
- var/area/their_area = get_area(G)
- var/area_name = their_area.name
- if(istype(their_area, /area/submap))
- area_name = "Unknown Area" // Avoid spoilers.
- var/Z_name = using_map.get_zlevel_name(T.z)
- var/coord = "[T.x], [T.y], [Z_name]"
- var/degrees = round(Get_Angle(curr, T))
- var/direction = get_adir(curr, T)
- var/distance = get_dist(curr, T)
- var/local = curr.z == T.z ? TRUE : FALSE
-
- signals += " [G.gps_tag]: [area_name] ([coord]) [local ? "Dist: [distance]m Dir: [degrees]° ([direction])":""]"
-
- if(signals.len)
+ if(gps_data["gps_list"].len)
dat += "Detected signals;"
- for(var/line in signals)
- dat += line
+ for(var/gps in gps_data["gps_list"])
+ dat += " [gps["gps_tag"]]: [gps["area_name"]] ([gps["x"]], [gps["y"]], [gps["z_name"]]) [gps["local"] ? "Dist: [gps["distance"]]m Dir: [gps["degrees"]]° ([gps["direction"]])" :""]"
else
dat += "No other signals detected."
diff --git a/code/game/objects/items/devices/hacktool.dm b/code/game/objects/items/devices/hacktool.dm
index 9ae5f62732..fb3d8d9bcc 100644
--- a/code/game/objects/items/devices/hacktool.dm
+++ b/code/game/objects/items/devices/hacktool.dm
@@ -24,7 +24,7 @@
return ..()
/obj/item/device/multitool/hacktool/attackby(var/obj/item/W, var/mob/user)
- if(isscrewdriver(W))
+ if(W.is_screwdriver())
in_hack_mode = !in_hack_mode
playsound(src.loc, W.usesound, 50, 1)
else
@@ -62,7 +62,7 @@
if(hack_result && in_hack_mode)
user << "Your hacking attempt was succesful!"
- user.playsound_local(get_turf(src), 'sound/piano/A#6.ogg', 50)
+ user.playsound_local(get_turf(src), 'sound/instruments/piano/An6.ogg', 50)
else
user << "Your hacking attempt failed!"
return 0
diff --git a/code/game/objects/items/devices/laserpointer.dm b/code/game/objects/items/devices/laserpointer.dm
index 69905f0cb8..343a58ce1a 100644
--- a/code/game/objects/items/devices/laserpointer.dm
+++ b/code/game/objects/items/devices/laserpointer.dm
@@ -54,7 +54,7 @@
else
to_chat(user, "[src] already has a diode.")
- else if(istype(W, /obj/item/weapon/screwdriver))
+ else if(W.is_screwdriver())
if(diode)
to_chat(user, "You remove the [diode.name] from the [src].")
diode.loc = get_turf(src.loc)
diff --git a/code/game/objects/items/devices/megaphone.dm b/code/game/objects/items/devices/megaphone.dm
index fc3c03518b..9c9f1aba59 100644
--- a/code/game/objects/items/devices/megaphone.dm
+++ b/code/game/objects/items/devices/megaphone.dm
@@ -91,12 +91,12 @@
to_chat(user, "You re-scramble \the [src]'s voice synthesizer.")
return 1
-/obj/item/device/megaphone/super/verb/turn_volume_dial(mob/living/user)
+/obj/item/device/megaphone/super/verb/turn_volume_dial()
set name = "Change Volume"
set desc = "Allows you to change the megaphone's volume."
set category = "Object"
- adjust_volume(user)
+ adjust_volume(usr)
/obj/item/device/megaphone/super/proc/adjust_volume(var/mob/living/user)
var/new_volume = input(user, "Set Volume") as null|anything in volume_options
@@ -104,12 +104,12 @@
if(new_volume && Adjacent(user))
broadcast_size = new_volume
-/obj/item/device/megaphone/super/verb/change_font(mob/living/user)
+/obj/item/device/megaphone/super/verb/change_font()
set name = "Change... Pronunciation?"
set desc = "Allows you to change the megaphone's font."
set category = "Object"
- adjust_font(user)
+ adjust_font(usr)
/obj/item/device/megaphone/super/proc/adjust_font(var/mob/living/user)
var/new_font = input(user, "Set Volume") as null|anything in font_options
@@ -117,12 +117,12 @@
if(new_font && Adjacent(user))
broadcast_font = new_font
-/obj/item/device/megaphone/super/verb/change_color(mob/living/user)
+/obj/item/device/megaphone/super/verb/change_color()
set name = "Change... Tune?"
set desc = "Allows you to change the megaphone's color."
set category = "Object"
- adjust_color(user)
+ adjust_color(usr)
/obj/item/device/megaphone/super/proc/adjust_color(var/mob/living/user)
var/new_color = input(user, "Set Volume") as null|anything in color_options
diff --git a/code/game/objects/items/devices/paicard.dm b/code/game/objects/items/devices/paicard.dm
index 8f2827c7ab..2ffebcb81a 100644
--- a/code/game/objects/items/devices/paicard.dm
+++ b/code/game/objects/items/devices/paicard.dm
@@ -30,7 +30,7 @@ GLOBAL_LIST_BOILERPLATE(all_pai_cards, /obj/item/device/paicard)
//Will stop people throwing friend pAIs into the singularity so they can respawn
if(!isnull(pai))
pai.death(0)
- qdel_null(radio)
+ QDEL_NULL(radio)
return ..()
/obj/item/device/paicard/attack_self(mob/user)
diff --git a/code/game/objects/items/devices/powersink.dm b/code/game/objects/items/devices/powersink.dm
index f3bc620d08..6ea73e8c78 100644
--- a/code/game/objects/items/devices/powersink.dm
+++ b/code/game/objects/items/devices/powersink.dm
@@ -30,13 +30,13 @@
..()
/obj/item/device/powersink/attackby(var/obj/item/I, var/mob/user)
- if(istype(I, /obj/item/weapon/screwdriver))
+ if(I.is_screwdriver())
if(mode == 0)
var/turf/T = loc
if(isturf(T) && !!T.is_plating())
attached = locate() in T
if(!attached)
- user << "No exposed cable here to attach to."
+ to_chat(user, "No exposed cable here to attach to.")
return
else
anchored = 1
@@ -45,7 +45,7 @@
playsound(src, I.usesound, 50, 1)
return
else
- user << "Device must be placed over an exposed cable to attach to it."
+ to_chat(user, "Device must be placed over an exposed cable to attach to it.")
return
else
if (mode == 2)
diff --git a/code/game/objects/items/devices/radio/headset.dm b/code/game/objects/items/devices/radio/headset.dm
index 105eb3aa8f..a67a2bef7b 100644
--- a/code/game/objects/items/devices/radio/headset.dm
+++ b/code/game/objects/items/devices/radio/headset.dm
@@ -40,8 +40,8 @@
if(!(..(user, 1) && radio_desc))
return
- user << "The following channels are available:"
- user << radio_desc
+ to_chat(user, "The following channels are available:")
+ to_chat(user, radio_desc)
/obj/item/device/radio/headset/handle_message_mode(mob/living/M as mob, message, channel)
if (channel == "special")
@@ -326,10 +326,10 @@
/obj/item/device/radio/headset/attackby(obj/item/weapon/W as obj, mob/user as mob)
// ..()
user.set_machine(src)
- if (!( istype(W, /obj/item/weapon/screwdriver) || (istype(W, /obj/item/device/encryptionkey/ ))))
+ if(!(W.is_screwdriver() || istype(W, /obj/item/device/encryptionkey)))
return
- if(istype(W, /obj/item/weapon/screwdriver))
+ if(W.is_screwdriver())
if(keyslot1 || keyslot2)
@@ -353,15 +353,15 @@
keyslot2 = null
recalculateChannels()
- user << "You pop out the encryption keys in the headset!"
+ to_chat(user, "You pop out the encryption keys in the headset!")
playsound(src, W.usesound, 50, 1)
else
- user << "This headset doesn't have any encryption keys! How useless..."
+ to_chat(user, "This headset doesn't have any encryption keys! How useless...")
if(istype(W, /obj/item/device/encryptionkey/))
if(keyslot1 && keyslot2)
- user << "The headset can't hold another key!"
+ to_chat(user, "The headset can't hold another key!")
return
if(!keyslot1)
diff --git a/code/game/objects/items/devices/radio/intercom.dm b/code/game/objects/items/devices/radio/intercom.dm
index 5bc75ca2a0..d462b670f9 100644
--- a/code/game/objects/items/devices/radio/intercom.dm
+++ b/code/game/objects/items/devices/radio/intercom.dm
@@ -119,9 +119,9 @@
/obj/item/device/radio/intercom/attackby(obj/item/W as obj, mob/user as mob)
add_fingerprint(user)
- if(istype(W, /obj/item/weapon/screwdriver)) // Opening the intercom up.
+ if(W.is_screwdriver()) // Opening the intercom up.
wiresexposed = !wiresexposed
- user << "The wires have been [wiresexposed ? "exposed" : "unexposed"]"
+ to_chat(user, "The wires have been [wiresexposed ? "exposed" : "unexposed"]")
playsound(src, W.usesound, 50, 1)
if(wiresexposed)
if(!on)
@@ -131,7 +131,7 @@
else
icon_state = "intercom"
return
- if(wiresexposed && istype(W, /obj/item/weapon/wirecutters))
+ if(wiresexposed && W.is_wirecutter())
user.visible_message("[user] has cut the wires inside \the [src]!", "You have cut the wires inside \the [src].")
playsound(src, W.usesound, 50, 1)
new/obj/item/stack/cable_coil(get_turf(src), 5)
diff --git a/code/game/objects/items/devices/radio/jammer.dm b/code/game/objects/items/devices/radio/jammer.dm
index cc6554ea7c..b129657d19 100644
--- a/code/game/objects/items/devices/radio/jammer.dm
+++ b/code/game/objects/items/devices/radio/jammer.dm
@@ -35,7 +35,7 @@ var/global/list/active_radio_jammers = list()
/obj/item/device/radio_jammer/Destroy()
if(on)
turn_off()
- qdel_null(power_source)
+ QDEL_NULL(power_source)
return ..()
/obj/item/device/radio_jammer/get_cell()
diff --git a/code/game/objects/items/devices/radio/radio.dm b/code/game/objects/items/devices/radio/radio.dm
index 716bbff1b8..6061cbf7d5 100644
--- a/code/game/objects/items/devices/radio/radio.dm
+++ b/code/game/objects/items/devices/radio/radio.dm
@@ -119,7 +119,7 @@ var/global/list/default_medbay_channels = list(
if(syndie)
data["useSyndMode"] = 1
- ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
+ ui = GLOB.nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if(!ui)
ui = new(user, src, ui_key, "radio_basic.tmpl", "[name]", 400, 430)
ui.set_initial_data(data)
@@ -230,7 +230,7 @@ var/global/list/default_medbay_channels = list(
return 1
if(.)
- nanomanager.update_uis(src)
+ GLOB.nanomanager.update_uis(src)
/obj/item/device/radio/proc/autosay(var/message, var/from, var/channel) //BS12 EDIT
var/datum/radio_frequency/connection = null
@@ -561,7 +561,7 @@ var/global/list/default_medbay_channels = list(
/obj/item/device/radio/attackby(obj/item/weapon/W as obj, mob/user as mob)
..()
user.set_machine(src)
- if (!( istype(W, /obj/item/weapon/screwdriver) ))
+ if (!W.is_screwdriver())
return
b_stat = !( b_stat )
if(!istype(src, /obj/item/device/radio/beacon))
@@ -613,10 +613,10 @@ var/global/list/default_medbay_channels = list(
/obj/item/device/radio/borg/attackby(obj/item/weapon/W as obj, mob/user as mob)
// ..()
user.set_machine(src)
- if (!( istype(W, /obj/item/weapon/screwdriver) || (istype(W, /obj/item/device/encryptionkey/ ))))
+ if (!(W.is_screwdriver() || istype(W, /obj/item/device/encryptionkey)))
return
- if(istype(W, /obj/item/weapon/screwdriver))
+ if(W.is_screwdriver())
if(keyslot)
@@ -632,15 +632,15 @@ var/global/list/default_medbay_channels = list(
keyslot = null
recalculateChannels()
- user << "You pop out the encryption key in the radio!"
+ to_chat(user, "You pop out the encryption key in the radio!")
playsound(src, W.usesound, 50, 1)
else
- user << "This radio doesn't have any encryption keys!"
+ to_chat(user, "This radio doesn't have any encryption keys!")
if(istype(W, /obj/item/device/encryptionkey/))
if(keyslot)
- user << "The radio can't hold another key!"
+ to_chat(user, "The radio can't hold another key!")
return
if(!keyslot)
@@ -692,9 +692,9 @@ var/global/list/default_medbay_channels = list(
if(enable_subspace_transmission != subspace_transmission)
subspace_transmission = !subspace_transmission
if(subspace_transmission)
- usr << "Subspace Transmission is enabled"
+ to_chat(usr, "Subspace Transmission is enabled")
else
- usr << "Subspace Transmission is disabled"
+ to_chat(usr, "Subspace Transmission is disabled")
if(subspace_transmission == 0)//Simple as fuck, clears the channel list to prevent talking/listening over them if subspace transmission is disabled
channels = list()
@@ -707,14 +707,14 @@ var/global/list/default_medbay_channels = list(
shut_up = !shut_up
if(shut_up)
canhear_range = 0
- usr << "Loadspeaker disabled."
+ to_chat(usr, "Loadspeaker disabled.")
else
canhear_range = 3
- usr << "Loadspeaker enabled."
+ to_chat(usr, "Loadspeaker enabled.")
. = 1
if(.)
- nanomanager.update_uis(src)
+ GLOB.nanomanager.update_uis(src)
/obj/item/device/radio/borg/interact(mob/user as mob)
if(!on)
@@ -743,7 +743,7 @@ var/global/list/default_medbay_channels = list(
data["has_subspace"] = 1
data["subspace"] = subspace_transmission
- ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
+ ui = GLOB.nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if(!ui)
ui = new(user, src, ui_key, "radio_basic.tmpl", "[name]", 400, 430)
ui.set_initial_data(data)
diff --git a/code/game/objects/items/devices/suit_cooling.dm b/code/game/objects/items/devices/suit_cooling.dm
index 2040f22a99..6efc045785 100644
--- a/code/game/objects/items/devices/suit_cooling.dm
+++ b/code/game/objects/items/devices/suit_cooling.dm
@@ -122,7 +122,7 @@
cell.add_fingerprint(user)
cell.update_icon()
- user << "You remove \the [src.cell]."
+ to_chat(user, "You remove \the [src.cell].")
src.cell = null
updateicon()
return
@@ -134,16 +134,16 @@
turn_off()
else
turn_on()
- user << "You switch \the [src] [on ? "on" : "off"]."
+ to_chat(user, "You switch \the [src] [on ? "on" : "off"].")
/obj/item/device/suit_cooling_unit/attackby(obj/item/weapon/W as obj, mob/user as mob)
- if (istype(W, /obj/item/weapon/screwdriver))
+ if (W.is_screwdriver())
if(cover_open)
cover_open = 0
- user << "You screw the panel into place."
+ to_chat(user, "You screw the panel into place.")
else
cover_open = 1
- user << "You unscrew the panel."
+ to_chat(user, "You unscrew the panel.")
playsound(src, W.usesound, 50, 1)
updateicon()
return
@@ -151,12 +151,12 @@
if (istype(W, /obj/item/weapon/cell))
if(cover_open)
if(cell)
- user << "There is a [cell] already installed here."
+ to_chat(user, "There is a [cell] already installed here.")
else
user.drop_item()
W.loc = src
cell = W
- user << "You insert the [cell]."
+ to_chat(user, "You insert the [cell].")
updateicon()
return
@@ -177,19 +177,19 @@
if (on)
if (attached_to_suit(src.loc))
- user << "It's switched on and running."
+ to_chat(user, "It's switched on and running.")
else
- user << "It's switched on, but not attached to anything."
+ to_chat(user, "It's switched on, but not attached to anything.")
else
- user << "It is switched off."
+ to_chat(user, "It is switched off.")
if (cover_open)
if(cell)
- user << "The panel is open, exposing the [cell]."
+ to_chat(user, "The panel is open, exposing the [cell].")
else
- user << "The panel is open."
+ to_chat(user, "The panel is open.")
if (cell)
- user << "The charge meter reads [round(cell.percent())]%."
+ to_chat(user, "The charge meter reads [round(cell.percent())]%.")
else
- user << "It doesn't have a power cell installed."
+ to_chat(user, "It doesn't have a power cell installed.")
diff --git a/code/game/objects/items/devices/taperecorder.dm b/code/game/objects/items/devices/taperecorder.dm
index 791725c14b..841bcc18ed 100644
--- a/code/game/objects/items/devices/taperecorder.dm
+++ b/code/game/objects/items/devices/taperecorder.dm
@@ -414,7 +414,7 @@
/obj/item/device/tape/attackby(obj/item/I, mob/user, params)
- if(ruined && istype(I, /obj/item/weapon/screwdriver))
+ if(ruined && I.is_screwdriver())
to_chat(user, "You start winding the tape back in...")
playsound(src, I.usesound, 50, 1)
if(do_after(user, 120 * I.toolspeed, target = src))
diff --git a/code/game/objects/items/devices/text_to_speech.dm b/code/game/objects/items/devices/text_to_speech.dm
index bc0c9d5304..47dfc256fc 100644
--- a/code/game/objects/items/devices/text_to_speech.dm
+++ b/code/game/objects/items/devices/text_to_speech.dm
@@ -1,7 +1,7 @@
/obj/item/device/text_to_speech
name = "TTS device"
desc = "A device that speaks an inputted message. Given to crew which can not speak properly or at all."
- icon = 'icons/obj/electronic_assemblies.dmi'
+ icon = 'icons/obj/integrated_electronics/electronic_setups.dmi'
icon_state = "setup_small"
w_class = ITEMSIZE_SMALL
var/named
diff --git a/code/game/objects/items/devices/transfer_valve.dm b/code/game/objects/items/devices/transfer_valve.dm
index 35697914ee..8abc2eabc2 100644
--- a/code/game/objects/items/devices/transfer_valve.dm
+++ b/code/game/objects/items/devices/transfer_valve.dm
@@ -37,7 +37,7 @@
log_game("[key_name_admin(user)] attached both tanks to a transfer valve.")
update_icon()
- nanomanager.update_uis(src) // update all UIs attached to src
+ GLOB.nanomanager.update_uis(src) // update all UIs attached to src
//TODO: Have this take an assemblyholder
else if(isassembly(item))
var/obj/item/device/assembly/A = item
@@ -58,7 +58,7 @@
message_admins("[key_name_admin(user)] attached a [item] to a transfer valve. (JMP)")
log_game("[key_name_admin(user)] attached a [item] to a transfer valve.")
attacher = user
- nanomanager.update_uis(src) // update all UIs attached to src
+ GLOB.nanomanager.update_uis(src) // update all UIs attached to src
return
@@ -81,7 +81,7 @@
data["valveOpen"] = valve_open ? 1 : 0
// update the ui if it exists, returns null if no ui is passed/found
- ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
+ ui = GLOB.nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
// the ui does not exist, so we'll create a new() one
// for a list of parameters and their descriptions see the code docs in \code\modules\nano\nanoui.dm
@@ -150,7 +150,7 @@
tank_two = null
else
return
-
+
T.loc = get_turf(src)
update_icon()
@@ -166,18 +166,18 @@
/obj/item/device/transfer_valve/proc/split_gases()
if(!valve_open)
return
-
+
valve_open = 0
-
- if(QDELETED(tank_one) || QDELETED(tank_two))
+
+ if(QDELETED(tank_one) || QDELETED(tank_two))
return
-
+
var/ratio1 = tank_one.air_contents.volume/tank_two.air_contents.volume
var/datum/gas_mixture/temp
temp = tank_two.air_contents.remove_ratio(ratio1)
tank_one.air_contents.merge(temp)
tank_two.air_contents.volume -= tank_one.air_contents.volume
-
+
/*
Exadv1: I know this isn't how it's going to work, but this was just to check
diff --git a/code/game/objects/items/devices/uplink.dm b/code/game/objects/items/devices/uplink.dm
index 83024e16e2..2778f46b03 100644
--- a/code/game/objects/items/devices/uplink.dm
+++ b/code/game/objects/items/devices/uplink.dm
@@ -72,7 +72,7 @@
discount_amount = pick(90;0.9, 80;0.8, 70;0.7, 60;0.6, 50;0.5, 40;0.4, 30;0.3, 20;0.2, 10;0.1)
next_offer_time = world.time + offer_time
update_nano_data()
- nanomanager.update_uis(src)
+ GLOB.nanomanager.update_uis(src)
// Toggles the uplink on and off. Normally this will bypass the item's normal functions and go to the uplink menu, if activated.
/obj/item/device/uplink/hidden/proc/toggle()
@@ -110,7 +110,7 @@
data += nanoui_data
// update the ui if it exists, returns null if no ui is passed/found
- ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
+ ui = GLOB.nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui) // No auto-refresh
ui = new(user, src, ui_key, "uplink.tmpl", title, 450, 600, state = inventory_state)
data["menu"] = 0
@@ -138,7 +138,7 @@
UI.buy(src, usr)
else if(href_list["lock"])
toggle()
- var/datum/nanoui/ui = nanomanager.get_open_ui(user, src, "main")
+ var/datum/nanoui/ui = GLOB.nanomanager.get_open_ui(user, src, "main")
ui.close()
else if(href_list["return"])
nanoui_menu = round(nanoui_menu/10)
diff --git a/code/game/objects/items/devices/violin.dm b/code/game/objects/items/devices/violin.dm
index 683c74bd02..5dc215cf91 100644
--- a/code/game/objects/items/devices/violin.dm
+++ b/code/game/objects/items/devices/violin.dm
@@ -1,392 +1,41 @@
//copy pasta of the space piano, don't hurt me -Pete
-
-/obj/item/device/violin
- name = "space violin"
- desc = "A wooden musical instrument with four strings and a bow. \"The devil went down to space, he was looking for an assistant to grief.\""
+/obj/item/device/instrument
+ name = "generic instrument"
+ var/datum/song/handheld/song
+ var/instrumentId = "generic"
+ var/instrumentExt = "mid"
icon = 'icons/obj/musician.dmi'
- icon_state = "violin"
force = 10
- var/datum/song/song
- var/playing = 0
- var/help = 0
- var/edit = 1
- var/repeat = 0
-/obj/item/device/violin/proc/playnote(var/note as text)
- //world << "Note: [note]"
- var/soundfile
- /*BYOND loads resource files at compile time if they are ''. This means you can't really manipulate them dynamically.
- Tried doing it dynamically at first but its more trouble than its worth. Would have saved many lines tho.*/
- switch(note)
- if("Cn1") soundfile = 'sound/violin/Cn1.mid'
- if("C#1") soundfile = 'sound/violin/C#1.mid'
- if("Db1") soundfile = 'sound/violin/Db1.mid'
- if("Dn1") soundfile = 'sound/violin/Dn1.mid'
- if("D#1") soundfile = 'sound/violin/D#1.mid'
- if("Eb1") soundfile = 'sound/violin/Eb1.mid'
- if("En1") soundfile = 'sound/violin/En1.mid'
- if("E#1") soundfile = 'sound/violin/E#1.mid'
- if("Fb1") soundfile = 'sound/violin/Fb1.mid'
- if("Fn1") soundfile = 'sound/violin/Fn1.mid'
- if("F#1") soundfile = 'sound/violin/F#1.mid'
- if("Gb1") soundfile = 'sound/violin/Gb1.mid'
- if("Gn1") soundfile = 'sound/violin/Gn1.mid'
- if("G#1") soundfile = 'sound/violin/G#1.mid'
- if("Ab1") soundfile = 'sound/violin/Ab1.mid'
- if("An1") soundfile = 'sound/violin/An1.mid'
- if("A#1") soundfile = 'sound/violin/A#1.mid'
- if("Bb1") soundfile = 'sound/violin/Bb1.mid'
- if("Bn1") soundfile = 'sound/violin/Bn1.mid'
- if("B#1") soundfile = 'sound/violin/B#1.mid'
- if("Cb2") soundfile = 'sound/violin/Cb2.mid'
- if("Cn2") soundfile = 'sound/violin/Cn2.mid'
- if("C#2") soundfile = 'sound/violin/C#2.mid'
- if("Db2") soundfile = 'sound/violin/Db2.mid'
- if("Dn2") soundfile = 'sound/violin/Dn2.mid'
- if("D#2") soundfile = 'sound/violin/D#2.mid'
- if("Eb2") soundfile = 'sound/violin/Eb2.mid'
- if("En2") soundfile = 'sound/violin/En2.mid'
- if("E#2") soundfile = 'sound/violin/E#2.mid'
- if("Fb2") soundfile = 'sound/violin/Fb2.mid'
- if("Fn2") soundfile = 'sound/violin/Fn2.mid'
- if("F#2") soundfile = 'sound/violin/F#2.mid'
- if("Gb2") soundfile = 'sound/violin/Gb2.mid'
- if("Gn2") soundfile = 'sound/violin/Gn2.mid'
- if("G#2") soundfile = 'sound/violin/G#2.mid'
- if("Ab2") soundfile = 'sound/violin/Ab2.mid'
- if("An2") soundfile = 'sound/violin/An2.mid'
- if("A#2") soundfile = 'sound/violin/A#2.mid'
- if("Bb2") soundfile = 'sound/violin/Bb2.mid'
- if("Bn2") soundfile = 'sound/violin/Bn2.mid'
- if("B#2") soundfile = 'sound/violin/B#2.mid'
- if("Cb3") soundfile = 'sound/violin/Cb3.mid'
- if("Cn3") soundfile = 'sound/violin/Cn3.mid'
- if("C#3") soundfile = 'sound/violin/C#3.mid'
- if("Db3") soundfile = 'sound/violin/Db3.mid'
- if("Dn3") soundfile = 'sound/violin/Dn3.mid'
- if("D#3") soundfile = 'sound/violin/D#3.mid'
- if("Eb3") soundfile = 'sound/violin/Eb3.mid'
- if("En3") soundfile = 'sound/violin/En3.mid'
- if("E#3") soundfile = 'sound/violin/E#3.mid'
- if("Fb3") soundfile = 'sound/violin/Fb3.mid'
- if("Fn3") soundfile = 'sound/violin/Fn3.mid'
- if("F#3") soundfile = 'sound/violin/F#3.mid'
- if("Gb3") soundfile = 'sound/violin/Gb3.mid'
- if("Gn3") soundfile = 'sound/violin/Gn3.mid'
- if("G#3") soundfile = 'sound/violin/G#3.mid'
- if("Ab3") soundfile = 'sound/violin/Ab3.mid'
- if("An3") soundfile = 'sound/violin/An3.mid'
- if("A#3") soundfile = 'sound/violin/A#3.mid'
- if("Bb3") soundfile = 'sound/violin/Bb3.mid'
- if("Bn3") soundfile = 'sound/violin/Bn3.mid'
- if("B#3") soundfile = 'sound/violin/B#3.mid'
- if("Cb4") soundfile = 'sound/violin/Cb4.mid'
- if("Cn4") soundfile = 'sound/violin/Cn4.mid'
- if("C#4") soundfile = 'sound/violin/C#4.mid'
- if("Db4") soundfile = 'sound/violin/Db4.mid'
- if("Dn4") soundfile = 'sound/violin/Dn4.mid'
- if("D#4") soundfile = 'sound/violin/D#4.mid'
- if("Eb4") soundfile = 'sound/violin/Eb4.mid'
- if("En4") soundfile = 'sound/violin/En4.mid'
- if("E#4") soundfile = 'sound/violin/E#4.mid'
- if("Fb4") soundfile = 'sound/violin/Fb4.mid'
- if("Fn4") soundfile = 'sound/violin/Fn4.mid'
- if("F#4") soundfile = 'sound/violin/F#4.mid'
- if("Gb4") soundfile = 'sound/violin/Gb4.mid'
- if("Gn4") soundfile = 'sound/violin/Gn4.mid'
- if("G#4") soundfile = 'sound/violin/G#4.mid'
- if("Ab4") soundfile = 'sound/violin/Ab4.mid'
- if("An4") soundfile = 'sound/violin/An4.mid'
- if("A#4") soundfile = 'sound/violin/A#4.mid'
- if("Bb4") soundfile = 'sound/violin/Bb4.mid'
- if("Bn4") soundfile = 'sound/violin/Bn4.mid'
- if("B#4") soundfile = 'sound/violin/B#4.mid'
- if("Cb5") soundfile = 'sound/violin/Cb5.mid'
- if("Cn5") soundfile = 'sound/violin/Cn5.mid'
- if("C#5") soundfile = 'sound/violin/C#5.mid'
- if("Db5") soundfile = 'sound/violin/Db5.mid'
- if("Dn5") soundfile = 'sound/violin/Dn5.mid'
- if("D#5") soundfile = 'sound/violin/D#5.mid'
- if("Eb5") soundfile = 'sound/violin/Eb5.mid'
- if("En5") soundfile = 'sound/violin/En5.mid'
- if("E#5") soundfile = 'sound/violin/E#5.mid'
- if("Fb5") soundfile = 'sound/violin/Fb5.mid'
- if("Fn5") soundfile = 'sound/violin/Fn5.mid'
- if("F#5") soundfile = 'sound/violin/F#5.mid'
- if("Gb5") soundfile = 'sound/violin/Gb5.mid'
- if("Gn5") soundfile = 'sound/violin/Gn5.mid'
- if("G#5") soundfile = 'sound/violin/G#5.mid'
- if("Ab5") soundfile = 'sound/violin/Ab5.mid'
- if("An5") soundfile = 'sound/violin/An5.mid'
- if("A#5") soundfile = 'sound/violin/A#5.mid'
- if("Bb5") soundfile = 'sound/violin/Bb5.mid'
- if("Bn5") soundfile = 'sound/violin/Bn5.mid'
- if("B#5") soundfile = 'sound/violin/B#5.mid'
- if("Cb6") soundfile = 'sound/violin/Cb6.mid'
- if("Cn6") soundfile = 'sound/violin/Cn6.mid'
- if("C#6") soundfile = 'sound/violin/C#6.mid'
- if("Db6") soundfile = 'sound/violin/Db6.mid'
- if("Dn6") soundfile = 'sound/violin/Dn6.mid'
- if("D#6") soundfile = 'sound/violin/D#6.mid'
- if("Eb6") soundfile = 'sound/violin/Eb6.mid'
- if("En6") soundfile = 'sound/violin/En6.mid'
- if("E#6") soundfile = 'sound/violin/E#6.mid'
- if("Fb6") soundfile = 'sound/violin/Fb6.mid'
- if("Fn6") soundfile = 'sound/violin/Fn6.mid'
- if("F#6") soundfile = 'sound/violin/F#6.mid'
- if("Gb6") soundfile = 'sound/violin/Gb6.mid'
- if("Gn6") soundfile = 'sound/violin/Gn6.mid'
- if("G#6") soundfile = 'sound/violin/G#6.mid'
- if("Ab6") soundfile = 'sound/violin/Ab6.mid'
- if("An6") soundfile = 'sound/violin/An6.mid'
- if("A#6") soundfile = 'sound/violin/A#6.mid'
- if("Bb6") soundfile = 'sound/violin/Bb6.mid'
- if("Bn6") soundfile = 'sound/violin/Bn6.mid'
- if("B#6") soundfile = 'sound/violin/B#6.mid'
- if("Cb7") soundfile = 'sound/violin/Cb7.mid'
- if("Cn7") soundfile = 'sound/violin/Cn7.mid'
- if("C#7") soundfile = 'sound/violin/C#7.mid'
- if("Db7") soundfile = 'sound/violin/Db7.mid'
- if("Dn7") soundfile = 'sound/violin/Dn7.mid'
- if("D#7") soundfile = 'sound/violin/D#7.mid'
- if("Eb7") soundfile = 'sound/violin/Eb7.mid'
- if("En7") soundfile = 'sound/violin/En7.mid'
- if("E#7") soundfile = 'sound/violin/E#7.mid'
- if("Fb7") soundfile = 'sound/violin/Fb7.mid'
- if("Fn7") soundfile = 'sound/violin/Fn7.mid'
- if("F#7") soundfile = 'sound/violin/F#7.mid'
- if("Gb7") soundfile = 'sound/violin/Gb7.mid'
- if("Gn7") soundfile = 'sound/violin/Gn7.mid'
- if("G#7") soundfile = 'sound/violin/G#7.mid'
- if("Ab7") soundfile = 'sound/violin/Ab7.mid'
- if("An7") soundfile = 'sound/violin/An7.mid'
- if("A#7") soundfile = 'sound/violin/A#7.mid'
- if("Bb7") soundfile = 'sound/violin/Bb7.mid'
- if("Bn7") soundfile = 'sound/violin/Bn7.mid'
- if("B#7") soundfile = 'sound/violin/B#7.mid'
- if("Cb8") soundfile = 'sound/violin/Cb8.mid'
- if("Cn8") soundfile = 'sound/violin/Cn8.mid'
- if("C#8") soundfile = 'sound/violin/C#8.mid'
- if("Db8") soundfile = 'sound/violin/Db8.mid'
- if("Dn8") soundfile = 'sound/violin/Dn8.mid'
- if("D#8") soundfile = 'sound/violin/D#8.mid'
- if("Eb8") soundfile = 'sound/violin/Eb8.mid'
- if("En8") soundfile = 'sound/violin/En8.mid'
- if("E#8") soundfile = 'sound/violin/E#8.mid'
- if("Fb8") soundfile = 'sound/violin/Fb8.mid'
- if("Fn8") soundfile = 'sound/violin/Fn8.mid'
- if("F#8") soundfile = 'sound/violin/F#8.mid'
- if("Gb8") soundfile = 'sound/violin/Gb8.mid'
- if("Gn8") soundfile = 'sound/violin/Gn8.mid'
- if("G#8") soundfile = 'sound/violin/G#8.mid'
- if("Ab8") soundfile = 'sound/violin/Ab8.mid'
- if("An8") soundfile = 'sound/violin/An8.mid'
- if("A#8") soundfile = 'sound/violin/A#8.mid'
- if("Bb8") soundfile = 'sound/violin/Bb8.mid'
- if("Bn8") soundfile = 'sound/violin/Bn8.mid'
- if("B#8") soundfile = 'sound/violin/B#8.mid'
- if("Cb9") soundfile = 'sound/violin/Cb9.mid'
- if("Cn9") soundfile = 'sound/violin/Cn9.mid'
- else return
+/obj/item/device/instrument/New()
+ ..()
+ song = new(instrumentId, src)
+ song.instrumentExt = instrumentExt
- hearers(15, get_turf(src)) << sound(soundfile)
+/obj/item/device/instrument/Destroy()
+ qdel(song)
+ song = null
+ ..()
-/obj/item/device/violin/proc/playsong()
- do
- var/cur_oct[7]
- var/cur_acc[7]
- for(var/i = 1 to 7)
- cur_oct[i] = "3"
- cur_acc[i] = "n"
+/obj/item/device/instrument/attack_self(mob/user as mob)
+ if(!user.IsAdvancedToolUser())
+ to_chat(user, "You don't have the dexterity to do this!")
+ return 1
+ interact(user)
- for(var/line in song.lines)
- //world << line
- for(var/beat in splittext(lowertext(line), ","))
- //world << "beat: [beat]"
- var/list/notes = splittext(beat, "/")
- for(var/note in splittext(notes[1], "-"))
- //world << "note: [note]"
- if(!playing || !isliving(loc))//If the violin is playing, or isn't held by a person
- playing = 0
- return
- if(lentext(note) == 0)
- continue
- //world << "Parse: [copytext(note,1,2)]"
- var/cur_note = text2ascii(note) - 96
- if(cur_note < 1 || cur_note > 7)
- continue
- for(var/i=2 to lentext(note))
- var/ni = copytext(note,i,i+1)
- if(!text2num(ni))
- if(ni == "#" || ni == "b" || ni == "n")
- cur_acc[cur_note] = ni
- else if(ni == "s")
- cur_acc[cur_note] = "#" // so shift is never required
- else
- cur_oct[cur_note] = ni
- playnote(uppertext(copytext(note,1,2)) + cur_acc[cur_note] + cur_oct[cur_note])
- if(notes.len >= 2 && text2num(notes[2]))
- sleep(song.tempo / text2num(notes[2]))
- else
- sleep(song.tempo)
- if(repeat > 0)
- repeat-- //Infinite loops are baaaad.
- while(repeat > 0)
- playing = 0
-
-/obj/item/device/violin/attack_self(mob/user as mob)
- if(!isliving(user) || user.stat || user.restrained() || user.lying) return
- user.set_machine(src)
-
- var/dat = "Violin"
-
- if(song)
- if(song.lines.len > 0 && !(playing))
- dat += "Play Song
"
- dat += "Repeat Song: [repeat] times.
"
- if(playing)
- dat += "Stop Playing
"
- dat += "Repeats left: [repeat].
"
- if(!edit)
- dat += "Show Editor
"
- else
- dat += "Hide Editor
"
- dat += "Start a New Song
"
- dat += "Import a Song
"
- if(song)
- var/calctempo = (10/song.tempo)*60
- dat += "Tempo : -- [calctempo] BPM ++
"
- var/linecount = 0
- for(var/line in song.lines)
- linecount += 1
- dat += "Line [linecount]: [line] Delete Line Modify Line
"
- dat += "Add Line
"
- if(help)
- dat += "Hide Help
"
- dat += {"
- Lines are a series of chords, separated by commas (,), each with notes seperated by hyphens (-).
- Every note in a chord will play together, with chord timed by the tempo.
-
- Notes are played by the names of the note, and optionally, the accidental, and/or the octave number.
- By default, every note is natural and in octave 3. Defining otherwise is remembered for each note.
- Example: C,D,E,F,G,A,B will play a C major scale.
- After a note has an accidental placed, it will be remembered: C,C4,C,C3 is C3,C4,C4,C3
- Chords can be played simply by seperating each note with a hyphon: A-C#,Cn-E,E-G#,Gn-B
- A pause may be denoted by an empty chord: C,E,,C,G
- To make a chord be a different time, end it with /x, where the chord length will be length
- defined by tempo / x: C,G/2,E/4
- Combined, an example is: E-E4/4,/2,G#/8,B/8,E3-E4/4
-
- Lines may be up to 50 characters.
- A song may only contain up to 50 lines.
- "}
- else
- dat += "Show Help
"
- dat += "