diff --git a/code/__DEFINES/misc.dm b/code/__DEFINES/misc.dm
index bbd068ce96c..deb19083e0c 100644
--- a/code/__DEFINES/misc.dm
+++ b/code/__DEFINES/misc.dm
@@ -151,7 +151,6 @@
#define DEFAULT_TABLE_MATERIAL "plastic"
#define DEFAULT_TABLE_REINF_MATERIAL "plasteel"
#define DEFAULT_TABLE_FLIP_WEIGHT 22
-#define DEFAULT_WALL_MATERIAL "steel"
#define SHARD_SHARD "shard"
#define SHARD_SHRAPNEL "shrapnel"
diff --git a/code/__DEFINES/research.dm b/code/__DEFINES/research.dm
index eb09a947089..09fa607650c 100644
--- a/code/__DEFINES/research.dm
+++ b/code/__DEFINES/research.dm
@@ -12,9 +12,11 @@
#define TECH_ILLEGAL "syndicate"
#define TECH_ARCANE "arcane"
-#define IMPRINTER 0x1 //For circuits. Uses glass/chemicals.
-#define PROTOLATHE 0x2 //New stuff. Uses glass/metal/chemicals
-#define MECHFAB 0x4 //Mechfab
-#define CHASSIS 0x8 //For protolathe, but differently
+/// For circuits. Uses glass/chemicals.
+#define IMPRINTER 0x1
+/// New stuff. Uses glass/metal/chemicals
+#define PROTOLATHE 0x2
+/// Mechfab
+#define MECHFAB 0x4
#define MAX_TECH_LEVEL 15
diff --git a/code/controllers/subsystems/materials.dm b/code/controllers/subsystems/materials.dm
index 75b9b4ba344..cb38d6e0051 100644
--- a/code/controllers/subsystems/materials.dm
+++ b/code/controllers/subsystems/materials.dm
@@ -38,7 +38,7 @@ SUBSYSTEM_DEF(materials)
material_name = lowertext(material_name)
if(material_name == "metal")
- material_name = DEFAULT_WALL_MATERIAL
+ material_name = "steel" // old DEFAULT_WALL_MATERIAL_NAME
. = materials_by_name[material_name]
if(!. && log_missing)
diff --git a/code/datums/helper_datums/teleport.dm b/code/datums/helper_datums/teleport.dm
index bd1d7edef08..2178f38c2e4 100644
--- a/code/datums/helper_datums/teleport.dm
+++ b/code/datums/helper_datums/teleport.dm
@@ -48,13 +48,24 @@
var/list/turf/good_turfs = list()
var/list/turf/bad_turfs = list()
var/turf/T = get_turf(adestination)
+ if(!T)
+ return adestination
+ var/list/invalid_inhibitors
for(var/found_inhibitor in GLOB.bluespace_inhibitors)
+ if(!istype(found_inhibitor, /obj/structure/machinery/anti_bluespace))
+ LAZYADD(invalid_inhibitors, found_inhibitor)
+ continue
var/obj/structure/machinery/anti_bluespace/AB = found_inhibitor
+ if(QDELETED(AB))
+ LAZYADD(invalid_inhibitors, found_inhibitor)
+ continue
if(T.z != AB.z || get_dist(adestination, AB) > 8 || (AB.stat & (NOPOWER | BROKEN)))
continue
AB.use_power_oneoff(AB.active_power_usage)
bad_turfs += circle_range_turfs(get_turf(AB),8)
good_turfs += circle_range_turfs(get_turf(AB),9)
+ if(invalid_inhibitors)
+ GLOB.bluespace_inhibitors -= invalid_inhibitors
if(length(good_turfs) && length(bad_turfs))
good_turfs -= bad_turfs
if(length(good_turfs))
diff --git a/code/defines/obj/weapon.dm b/code/defines/obj/weapon.dm
index 6a64545f853..ba6ae4b4f93 100644
--- a/code/defines/obj/weapon.dm
+++ b/code/defines/obj/weapon.dm
@@ -54,7 +54,7 @@
force = 15
throwforce = 7.0
w_class = WEIGHT_CLASS_BULKY
- matter = list(DEFAULT_WALL_MATERIAL = 50)
+ matter = list(MATERIAL_STEEL = 50)
attack_verb = list("bludgeoned", "whacked", "disciplined", "thrashed")
var/can_support = TRUE
@@ -447,7 +447,7 @@
name = "power control module"
icon_state = "power_mod"
desc = "Heavy-duty switching circuits for power control."
- matter = list(DEFAULT_WALL_MATERIAL = 50, MATERIAL_GLASS = 50)
+ matter = list(MATERIAL_STEEL = 50, MATERIAL_GLASS = 50)
/obj/item/module/power_control/attackby(obj/item/attacking_item, mob/user)
if(attacking_item.tool_behaviour == TOOL_MULTITOOL)
diff --git a/code/game/area/areas.dm b/code/game/area/areas.dm
index 80ab726e83f..a224e9b7498 100644
--- a/code/game/area/areas.dm
+++ b/code/game/area/areas.dm
@@ -206,14 +206,24 @@
/area/proc/get_cameras()
. = list()
+ var/list/invalid_cameras
for (var/thing in SSmachinery.all_cameras)
+ if(!istype(thing, /obj/structure/machinery/camera))
+ LAZYADD(invalid_cameras, thing)
+ continue
var/obj/structure/machinery/camera/C = thing
+ if(QDELETED(C))
+ LAZYADD(invalid_cameras, thing)
+ continue
if (!isturf(C.loc))
continue
if (C.loc.loc == src) // What the fuck is this?
. += C
+ if(invalid_cameras)
+ SSmachinery.all_cameras -= invalid_cameras
+
/area/proc/atmosalert(danger_level, var/alarm_source)
if (danger_level == 0)
GLOB.atmosphere_alarm.clearAlarm(src, alarm_source)
diff --git a/code/game/gamemodes/nuclear/pinpointer.dm b/code/game/gamemodes/nuclear/pinpointer.dm
index 3c68835a5ec..4a4ad5b2d06 100644
--- a/code/game/gamemodes/nuclear/pinpointer.dm
+++ b/code/game/gamemodes/nuclear/pinpointer.dm
@@ -9,7 +9,7 @@
w_class = WEIGHT_CLASS_SMALL
throw_speed = 4
throw_range = 20
- matter = list(DEFAULT_WALL_MATERIAL = 500)
+ matter = list(MATERIAL_STEEL = 500)
var/obj/item/disk/nuclear/the_disk = null
var/active = 0
diff --git a/code/game/gamemodes/objective.dm b/code/game/gamemodes/objective.dm
index 3927c27a492..e931955bd6b 100644
--- a/code/game/gamemodes/objective.dm
+++ b/code/game/gamemodes/objective.dm
@@ -726,31 +726,31 @@ GLOBAL_LIST_EMPTY(process_objectives)
/datum/objective/heist/salvage/choose_target()
switch(rand(1,8))
if(1)
- target = DEFAULT_WALL_MATERIAL
+ target = MATERIAL_STEEL
target_amount = 300
if(2)
- target = "glass"
+ target = MATERIAL_GLASS
target_amount = 200
if(3)
- target = "plasteel"
+ target = MATERIAL_PLASTEEL
target_amount = 100
if(4)
target = MATERIAL_PHORON
target_amount = 100
if(5)
- target = "silver"
+ target = MATERIAL_SILVER
target_amount = 50
if(6)
- target = "gold"
+ target = MATERIAL_GOLD
target_amount = 20
if(7)
- target = "uranium"
+ target = MATERIAL_URANIUM
target_amount = 20
if(8)
- target = "diamond"
+ target = MATERIAL_DIAMOND
target_amount = 20
- explanation_text = "Ransack the [SSatlas.current_map.station_name] and escape with [target_amount] [target]."
+ explanation_text = "Ransack the [SSatlas.current_map.station_name] and escape with [target_amount] [lowertext(SSmaterials.material_display_name(target))]."
/datum/objective/heist/salvage/check_completion()
var/total_amount = 0
@@ -759,21 +759,24 @@ GLOBAL_LIST_EMPTY(process_objectives)
var/obj/item/stack/material/S
if(istype(O,/obj/item/stack/material))
- if(O.name == target)
- S = O
+ S = O
+ var/singleton/material/held_material = S.get_material()
+ if(held_material?.type == target)
total_amount += S.get_amount()
for(var/obj/I in O.contents)
if(istype(I,/obj/item/stack/material))
- if(I.name == target)
- S = I
+ S = I
+ var/singleton/material/contained_material = S.get_material()
+ if(contained_material?.type == target)
total_amount += S.get_amount()
for(var/datum/mind/raider in GLOB.raiders.current_antagonists)
if(raider.current)
for(var/obj/item/O in raider.current.get_contents())
if(istype(O,/obj/item/stack/material))
- if(O.name == target)
- var/obj/item/stack/material/S = O
+ var/obj/item/stack/material/S = O
+ var/singleton/material/raider_material = S.get_material()
+ if(raider_material?.type == target)
total_amount += S.get_amount()
if(total_amount >= target_amount) return 1
diff --git a/code/game/objects/effects/burnt_wall.dm b/code/game/objects/effects/burnt_wall.dm
index c73c5e9399b..c5eb8f5bc26 100644
--- a/code/game/objects/effects/burnt_wall.dm
+++ b/code/game/objects/effects/burnt_wall.dm
@@ -9,9 +9,9 @@
/obj/effect/overlay/burnt_wall/Initialize(mapload, new_name, new_mat, new_reinf_mat)
. = ..()
name = "burnt [new_name]"
- material = GET_SINGLETON(new_mat)
+ material = SSmaterials.get_material_by_id(new_mat)
if(new_reinf_mat)
- reinf_material = GET_SINGLETON(new_reinf_mat)
+ reinf_material = SSmaterials.get_material_by_id(new_reinf_mat)
color = material.icon_colour
if(material.opacity < 0.5)
alpha = 125
diff --git a/code/game/objects/explosion.dm b/code/game/objects/explosion.dm
index 718a767d62b..4acad5a9b37 100644
--- a/code/game/objects/explosion.dm
+++ b/code/game/objects/explosion.dm
@@ -17,9 +17,18 @@
SSexplosives.queue(data)
//Machines which report explosions.
+ var/list/invalid_doppler_arrays
for(var/thing in GLOB.doppler_arrays)
+ if(!istype(thing, /obj/structure/machinery/doppler_array))
+ LAZYADD(invalid_doppler_arrays, thing)
+ continue
var/obj/structure/machinery/doppler_array/Array = thing
+ if(QDELETED(Array))
+ LAZYADD(invalid_doppler_arrays, thing)
+ continue
Array.sense_explosion(epicenter.x,epicenter.y,epicenter.z,devastation_range,heavy_impact_range,light_impact_range)
+ if(invalid_doppler_arrays)
+ GLOB.doppler_arrays -= invalid_doppler_arrays
// == Recursive Explosions stuff ==
diff --git a/code/game/objects/items/devices/debugger.dm b/code/game/objects/items/devices/debugger.dm
index 6cee693d1ad..f765a839c0c 100644
--- a/code/game/objects/items/devices/debugger.dm
+++ b/code/game/objects/items/devices/debugger.dm
@@ -12,7 +12,7 @@
throw_speed = 3
hitsound = SFX_SWITCH
- matter = list(MATERIAL_PLASTIC = 50, DEFAULT_WALL_MATERIAL = 50, MATERIAL_GLASS = 20)
+ matter = list(MATERIAL_PLASTIC = 50, MATERIAL_STEEL = 50, MATERIAL_GLASS = 20)
origin_tech = list(TECH_MAGNET = 1, TECH_ENGINEERING = 1)
contained_sprite = TRUE
diff --git a/code/game/objects/items/devices/geiger.dm b/code/game/objects/items/devices/geiger.dm
index dbee043112f..2df5849a332 100644
--- a/code/game/objects/items/devices/geiger.dm
+++ b/code/game/objects/items/devices/geiger.dm
@@ -7,7 +7,7 @@
contained_sprite = TRUE
w_class = WEIGHT_CLASS_SMALL
action_button_name = "Toggle geiger counter"
- matter = list(MATERIAL_PLASTIC = 100, DEFAULT_WALL_MATERIAL = 100, MATERIAL_GLASS = 50)
+ matter = list(MATERIAL_PLASTIC = 100, MATERIAL_STEEL = 100, MATERIAL_GLASS = 50)
origin_tech = list(TECH_MAGNET = 1, TECH_ENGINEERING = 1)
var/scanning = 0
var/radiation_count = 0
@@ -95,7 +95,7 @@
item_state = "dosimeter"
slot_flags = SLOT_WRISTS
action_button_name = "Toggle dosimeter counter"
- matter = list(DEFAULT_WALL_MATERIAL = 100, MATERIAL_GLASS = 50)
+ matter = list(MATERIAL_STEEL = 100, MATERIAL_GLASS = 50)
origin_tech = list(TECH_MAGNET = 4, TECH_ENGINEERING = 4)
///The amount of rads the dosimeter has detected after armor mitigation.
diff --git a/code/game/objects/items/devices/lighting/lamp.dm b/code/game/objects/items/devices/lighting/lamp.dm
index 04ac0b19271..7c4901451c5 100644
--- a/code/game/objects/items/devices/lighting/lamp.dm
+++ b/code/game/objects/items/devices/lighting/lamp.dm
@@ -50,7 +50,7 @@
icon_state = "lavalamp"
light_range = 3
flashlight_power = 0.5
- matter = list(DEFAULT_WALL_MATERIAL = 250, MATERIAL_GLASS = 200)
+ matter = list(MATERIAL_STEEL = 250, MATERIAL_GLASS = 200)
/obj/item/flashlight/lamp/lava/update_icon()
if(on)
diff --git a/code/game/objects/items/devices/lightreplacer.dm b/code/game/objects/items/devices/lightreplacer.dm
index 7393cddec71..684133a1d30 100644
--- a/code/game/objects/items/devices/lightreplacer.dm
+++ b/code/game/objects/items/devices/lightreplacer.dm
@@ -80,8 +80,10 @@
..()
/obj/item/lightreplacer/attackby(obj/item/attacking_item, mob/user)
- if(istype(attacking_item, /obj/item/stack/material) && attacking_item.get_material_name() == "glass")
- var/obj/item/stack/G = attacking_item
+ var/obj/item/stack/material/glass_stack = attacking_item
+ var/singleton/material/glass_material = glass_stack?.get_material()
+ if(istype(glass_stack) && glass_material?.type == MATERIAL_GLASS)
+ var/obj/item/stack/G = glass_stack
if(uses >= max_uses)
to_chat(user, SPAN_WARNING("[src.name] is full."))
else if(G.use(5))
diff --git a/code/game/objects/items/devices/multitool.dm b/code/game/objects/items/devices/multitool.dm
index a42afdbc302..d2639bd9046 100644
--- a/code/game/objects/items/devices/multitool.dm
+++ b/code/game/objects/items/devices/multitool.dm
@@ -19,12 +19,14 @@
drop_sound = 'sound/items/drop/multitool.ogg'
pickup_sound = 'sound/items/pickup/multitool.ogg'
- matter = list(MATERIAL_PLASTIC = 50, MATERIAL_GLASS = 20, DEFAULT_WALL_MATERIAL = 5)
+ matter = list(MATERIAL_PLASTIC = 50, MATERIAL_GLASS = 20, MATERIAL_STEEL = 5)
origin_tech = list(TECH_MAGNET = 1, TECH_ENGINEERING = 1)
- var/obj/structure/machinery/buffer // simple machine buffer for device linkage
- var/obj/structure/machinery/clonepod/connecting //same for cryopod linkage
+ /// simple machine buffer for device linkage
+ var/obj/structure/machinery/buffer
+ /// same for cryopod linkage. legacy as fuck.
+ var/obj/structure/machinery/clonepod/connecting
var/buffer_name
var/atom/buffer_object
diff --git a/code/game/objects/items/devices/powersink.dm b/code/game/objects/items/devices/powersink.dm
index 9b9a150aa47..18c75fd5c94 100644
--- a/code/game/objects/items/devices/powersink.dm
+++ b/code/game/objects/items/devices/powersink.dm
@@ -12,30 +12,34 @@
throw_speed = 1
throw_range = 2
- matter = list(DEFAULT_WALL_MATERIAL = 750)
+ matter = list(MATERIAL_STEEL = 750)
origin_tech = list(TECH_POWER = 3, TECH_ILLEGAL = 5)
- ///Amount of power to drain per second, in watts
+ /// Amount of power to drain per second, in watts
var/drain_rate = 1.5 MEGA WATTS
- ///Maximum amount of power to drain from a single APW, in watts
+ /// Maximum amount of power to drain from a single APW, in watts
var/apc_drain_rate = 50 KILO WATTS
- ///Passive dissipation of drained power in Watts
+ /// Passive dissipation of drained power in Watts
var/dissipation_rate = 20000
- ///Amount of power drained, in watts
+ /// Amount of power drained, in watts
var/power_drained = 04
- ///Power at which the sink will explode (after having absorbed that), in watts
+ /// Power at which the sink will explode (after having absorbed that), in watts
var/max_power = 800 MEGA WATTS
- var/mode = 0 // 0 = off, 1=clamped (off), 2=operating
- var/drained_this_tick = 0 // This is unfortunately necessary to ensure we process powersinks BEFORE other machinery such as APCs.
+ /// 0 = off, 1=clamped (off), 2=operating
+ var/mode = 0
+ /// This is unfortunately necessary to ensure we process powersinks BEFORE other machinery such as APCs.
+ var/drained_this_tick = 0
- var/datum/powernet/PN // Our powernet
- var/obj/structure/cable/attached // the attached cable
+ /// Our powernet
+ var/datum/powernet/PN
+ /// the attached cable
+ var/obj/structure/cable/attached
/obj/item/powersink/antagonist_hints(mob/user, distance, is_adjacent)
. += ..()
diff --git a/code/game/objects/items/devices/radio/electropack.dm b/code/game/objects/items/devices/radio/electropack.dm
index d68fbbc6cbd..3369d011cda 100644
--- a/code/game/objects/items/devices/radio/electropack.dm
+++ b/code/game/objects/items/devices/radio/electropack.dm
@@ -7,7 +7,7 @@
slot_flags = SLOT_BACK
w_class = WEIGHT_CLASS_HUGE
- matter = list(DEFAULT_WALL_MATERIAL = 10000, MATERIAL_GLASS = 2500)
+ matter = list(MATERIAL_STEEL = 10000, MATERIAL_GLASS = 2500)
var/code = 2
diff --git a/code/game/objects/items/devices/scanners.dm b/code/game/objects/items/devices/scanners.dm
index 3056f0cf18a..edf0dd05f5a 100644
--- a/code/game/objects/items/devices/scanners.dm
+++ b/code/game/objects/items/devices/scanners.dm
@@ -318,7 +318,7 @@ BREATH ANALYZER
throwforce = 0
throw_speed = 3
throw_range = 3
- matter = list(DEFAULT_WALL_MATERIAL = 25, MATERIAL_GLASS = 25)
+ matter = list(MATERIAL_STEEL = 25, MATERIAL_GLASS = 25)
/obj/item/price_scanner/afterattack(atom/movable/target, mob/user as mob, proximity)
if(!proximity)
diff --git a/code/game/objects/items/stacks/barricades.dm b/code/game/objects/items/stacks/barricades.dm
index 66453b564b4..3be47ff58ff 100644
--- a/code/game/objects/items/stacks/barricades.dm
+++ b/code/game/objects/items/stacks/barricades.dm
@@ -6,7 +6,7 @@
icon = 'icons/obj/barricade_stacks.dmi'
icon_state = "steel-kit"
w_class = WEIGHT_CLASS_SMALL
- matter = list(DEFAULT_WALL_MATERIAL = 650, MATERIAL_PHORON = 100, MATERIAL_PLASTEEL = 150)
+ matter = list(MATERIAL_STEEL = 650, MATERIAL_PHORON = 100, MATERIAL_PLASTEEL = 150)
var/barricade_name = "steel"
var/barricade_type = /obj/structure/barricade/metal
var/build_sound = 'sound/effects/clang.ogg'
diff --git a/code/game/objects/items/stacks/nanopaste.dm b/code/game/objects/items/stacks/nanopaste.dm
index a1d06949fb6..b0398e7b0c5 100644
--- a/code/game/objects/items/stacks/nanopaste.dm
+++ b/code/game/objects/items/stacks/nanopaste.dm
@@ -14,7 +14,7 @@
desc_extended = "It takes significantly longer to apply nanopaste to yourself than it does to apply it to others. Nanites are best enjoyed with a friend!"
/// What materials does it take to fabricate nanopaste?
- var/list/construction_cost = list(DEFAULT_WALL_MATERIAL = 7000, MATERIAL_GLASS = 7000)
+ var/list/construction_cost = list(MATERIAL_STEEL = 7000, MATERIAL_GLASS = 7000)
/// How long does it take to apply nanopaste?
var/time_to_apply = 2 SECONDS
/// Multiplier applied to time_to_apply, if we want it to take longer in some situations.
diff --git a/code/game/objects/items/stacks/rods.dm b/code/game/objects/items/stacks/rods.dm
index 174c6da2565..fe798793237 100644
--- a/code/game/objects/items/stacks/rods.dm
+++ b/code/game/objects/items/stacks/rods.dm
@@ -29,7 +29,7 @@ GLOBAL_LIST_INIT_TYPED(rod_recipes, /datum/stack_recipe, list(
throw_range = 20
drop_sound = 'sound/items/drop/metal_rod.ogg'
pickup_sound = 'sound/items/pickup/metal_rod.ogg'
- matter = list(DEFAULT_WALL_MATERIAL = 937.5)
+ matter = list(MATERIAL_STEEL = 937.5)
recyclable = TRUE
max_amount = 60
attack_verb = list("hit", "bludgeoned", "whacked")
@@ -112,7 +112,7 @@ GLOBAL_LIST_INIT_TYPED(rod_recipes, /datum/stack_recipe, list(
singular_name = "length"
max_amount = 50
w_class = WEIGHT_CLASS_SMALL
- matter = list(DEFAULT_WALL_MATERIAL = 937.5)
+ matter = list(MATERIAL_STEEL = 937.5)
attack_verb = list("hit", "whacked", "sliced")
/obj/item/stack/barbed_wire/assembly_hints(mob/user, distance, is_adjacent)
@@ -133,7 +133,7 @@ GLOBAL_LIST_INIT_TYPED(rod_recipes, /datum/stack_recipe, list(
icon = 'icons/obj/barricades.dmi'
icon_state = "liquidbags"
w_class = WEIGHT_CLASS_SMALL
- matter = list(DEFAULT_WALL_MATERIAL = 650, MATERIAL_PHORON = 100, MATERIAL_PLASTEEL = 150)
+ matter = list(MATERIAL_STEEL = 650, MATERIAL_PHORON = 100, MATERIAL_PLASTEEL = 150)
/obj/item/stack/liquidbags/half_full
amount = 25
diff --git a/code/game/objects/items/stacks/tiles/tile_types.dm b/code/game/objects/items/stacks/tiles/tile_types.dm
index 971a416dbc2..9f508339bdd 100644
--- a/code/game/objects/items/stacks/tiles/tile_types.dm
+++ b/code/game/objects/items/stacks/tiles/tile_types.dm
@@ -188,7 +188,7 @@
desc = "An advanced tile covered in various circuitry and wiring."
icon_state = "tile_bcircuit"
force = 14
- matter = list(DEFAULT_WALL_MATERIAL = TILE_MATERIAL_AMOUNT, MATERIAL_GLASS = TILE_MATERIAL_AMOUNT)
+ matter = list(MATERIAL_STEEL = TILE_MATERIAL_AMOUNT, MATERIAL_GLASS = TILE_MATERIAL_AMOUNT)
throwforce = 15.0
throw_speed = 5
throw_range = 20
@@ -200,7 +200,7 @@
desc = "An advanced tile covered in various circuitry and wiring."
icon_state = "tile_gcircuit"
force = 14
- matter = list(DEFAULT_WALL_MATERIAL = TILE_MATERIAL_AMOUNT, MATERIAL_GLASS = TILE_MATERIAL_AMOUNT)
+ matter = list(MATERIAL_STEEL = TILE_MATERIAL_AMOUNT, MATERIAL_GLASS = TILE_MATERIAL_AMOUNT)
throwforce = 15.0
throw_speed = 5
throw_range = 20
@@ -212,7 +212,7 @@
desc = "An advanced tile covered in various circuitry and wiring."
icon_state = "tile_rcircuit"
force = 14
- matter = list(DEFAULT_WALL_MATERIAL = TILE_MATERIAL_AMOUNT, MATERIAL_GLASS = TILE_MATERIAL_AMOUNT)
+ matter = list(MATERIAL_STEEL = TILE_MATERIAL_AMOUNT, MATERIAL_GLASS = TILE_MATERIAL_AMOUNT)
throwforce = 15.0
throw_speed = 5
throw_range = 20
@@ -228,7 +228,7 @@
desc = "A set of steel floor tiles."
icon_state = "tile"
force = 14
- matter = list(DEFAULT_WALL_MATERIAL = TILE_MATERIAL_AMOUNT)
+ matter = list(MATERIAL_STEEL = TILE_MATERIAL_AMOUNT)
throwforce = 6
throw_speed = 5
throw_range = 10
diff --git a/code/game/objects/items/tools/crowbar.dm b/code/game/objects/items/tools/crowbar.dm
index 4fc2304bd4a..52e803c9ac3 100644
--- a/code/game/objects/items/tools/crowbar.dm
+++ b/code/game/objects/items/tools/crowbar.dm
@@ -18,7 +18,7 @@
usesound = SFX_CROWBAR
surgerysound = 'sound/items/surgery/retractor.ogg'
origin_tech = list(TECH_ENGINEERING = 1)
- matter = list(DEFAULT_WALL_MATERIAL = 50)
+ matter = list(MATERIAL_STEEL = 50)
attack_verb = list("attacked", "bashed", "battered", "bludgeoned", "whacked")
tool_behaviour = TOOL_CROWBAR
toolspeed = 1
@@ -77,7 +77,7 @@
drop_sound = 'sound/items/drop/crowbar.ogg'
pickup_sound = 'sound/items/pickup/crowbar.ogg'
origin_tech = list(TECH_ENGINEERING = 1)
- matter = list(DEFAULT_WALL_MATERIAL = 50)
+ matter = list(MATERIAL_STEEL = 50)
attack_verb = list("attacked", "rammed", "battered", "bludgeoned")
toolspeed = 0.7
force_opens = TRUE
diff --git a/code/game/objects/items/tools/tools.dm b/code/game/objects/items/tools/tools.dm
index 4592d665f45..85a53a8d476 100644
--- a/code/game/objects/items/tools/tools.dm
+++ b/code/game/objects/items/tools/tools.dm
@@ -31,7 +31,7 @@
throwforce = 7
w_class = WEIGHT_CLASS_SMALL
origin_tech = list(TECH_MATERIAL = 1, TECH_ENGINEERING = 1)
- matter = list(DEFAULT_WALL_MATERIAL = 150)
+ matter = list(MATERIAL_STEEL = 150)
attack_verb = list("bashed", "battered", "bludgeoned", "whacked")
usesound = 'sound/items/wrench.ogg'
surgerysound = 'sound/items/surgery/bonesetter.ogg'
@@ -59,7 +59,7 @@
throw_speed = 3
throw_range = 5
w_class = WEIGHT_CLASS_TINY
- matter = list(DEFAULT_WALL_MATERIAL = 75)
+ matter = list(MATERIAL_STEEL = 75)
attack_verb = list("stabbed")
usesound = 'sound/items/Screwdriver.ogg'
surgerysound = 'sound/items/Screwdriver.ogg'
@@ -134,7 +134,7 @@
throw_range = 9
w_class = WEIGHT_CLASS_SMALL
origin_tech = list(TECH_MATERIAL = 1, TECH_ENGINEERING = 1)
- matter = list(DEFAULT_WALL_MATERIAL = 80)
+ matter = list(MATERIAL_STEEL = 80)
attack_verb = list("pinched", "nipped")
sharp = TRUE
edge = TRUE
@@ -243,7 +243,7 @@
w_class = WEIGHT_CLASS_SMALL
/// Cost to make in the autolathe
- matter = list(DEFAULT_WALL_MATERIAL = 70, MATERIAL_GLASS = 30)
+ matter = list(MATERIAL_STEEL = 70, MATERIAL_GLASS = 30)
/// R&D tech level
origin_tech = list(TECH_ENGINEERING = 1)
@@ -271,7 +271,7 @@
icon_state = "indwelder"
item_state = "welder"
max_fuel = 40
- matter = list(DEFAULT_WALL_MATERIAL = 100, MATERIAL_GLASS = 60)
+ matter = list(MATERIAL_STEEL = 100, MATERIAL_GLASS = 60)
origin_tech = list(TECH_ENGINEERING = 2)
/obj/item/weldingtool/hugetank
@@ -280,7 +280,7 @@
icon_state = "advwelder"
item_state = "advwelder"
max_fuel = 80
- matter = list(DEFAULT_WALL_MATERIAL = 200, MATERIAL_GLASS = 120)
+ matter = list(MATERIAL_STEEL = 200, MATERIAL_GLASS = 120)
origin_tech = list(TECH_ENGINEERING = 3)
/obj/item/weldingtool/emergency
@@ -297,7 +297,7 @@
icon_state = "expwelder"
item_state = "expwelder"
max_fuel = 40
- matter = list(DEFAULT_WALL_MATERIAL = 100, MATERIAL_GLASS = 120)
+ matter = list(MATERIAL_STEEL = 100, MATERIAL_GLASS = 120)
origin_tech = list(TECH_ENGINEERING = 4, TECH_BIO = 4)
light_color = LIGHT_COLOR_BLUE
@@ -706,7 +706,7 @@
throwforce = 7
w_class = WEIGHT_CLASS_SMALL
origin_tech = list(TECH_MATERIAL = 1, TECH_ENGINEERING = 2)
- matter = list(DEFAULT_WALL_MATERIAL = 150)
+ matter = list(MATERIAL_STEEL = 150)
attack_verb = list("bashed", "battered", "bludgeoned", "whacked")
tool_behaviour = TOOL_PIPEWRENCH
@@ -942,7 +942,7 @@
throw_speed = 3
throw_range = 3
w_class = WEIGHT_CLASS_SMALL
- matter = list(DEFAULT_WALL_MATERIAL = 75)
+ matter = list(MATERIAL_STEEL = 75)
attack_verb = list("smashed", "hammered")
drop_sound = 'sound/items/drop/crowbar.ogg'
pickup_sound = 'sound/items/pickup/crowbar.ogg'
diff --git a/code/game/objects/items/weapons/RFD.dm b/code/game/objects/items/weapons/RFD.dm
index 3e7324df989..4c46352fbbe 100644
--- a/code/game/objects/items/weapons/RFD.dm
+++ b/code/game/objects/items/weapons/RFD.dm
@@ -30,7 +30,7 @@ ABSTRACT_TYPE(/obj/item/rfd)
throw_range = 5
w_class = WEIGHT_CLASS_NORMAL
origin_tech = list(TECH_ENGINEERING = 4, TECH_MATERIAL = 2)
- matter = list(DEFAULT_WALL_MATERIAL = 50000)
+ matter = list(MATERIAL_STEEL = 50000)
drop_sound = 'sound/items/drop/gun.ogg'
pickup_sound = 'sound/items/pickup/gun.ogg'
@@ -180,7 +180,7 @@ ABSTRACT_TYPE(/obj/item/rfd)
item_state = "rfdammo"
w_class = WEIGHT_CLASS_SMALL
origin_tech = list(TECH_MATERIAL = 2)
- matter = list(DEFAULT_WALL_MATERIAL = 2000, MATERIAL_GLASS = 2000)
+ matter = list(MATERIAL_STEEL = 2000, MATERIAL_GLASS = 2000)
recyclable = TRUE
diff --git a/code/game/objects/items/weapons/cloaking_device.dm b/code/game/objects/items/weapons/cloaking_device.dm
index cc545e74e79..f4e73297532 100644
--- a/code/game/objects/items/weapons/cloaking_device.dm
+++ b/code/game/objects/items/weapons/cloaking_device.dm
@@ -181,12 +181,23 @@
/datum/modifier/cloaking_device/deactivate()
..()
+ var/list/invalid_cloaking_devices
for (var/a in GLOB.cloaking_devices)//Check for any other cloaks
if (a != source)
+ if(!istype(a, /obj/item/cloaking_device))
+ LAZYADD(invalid_cloaking_devices, a)
+ continue
var/obj/item/cloaking_device/CD = a
+ if(QDELETED(CD))
+ LAZYADD(invalid_cloaking_devices, a)
+ continue
if (CD.get_holding_mob() == target)
if (CD.active)//If target is holding another active cloak then we wont remove their stealth
+ if(invalid_cloaking_devices)
+ GLOB.cloaking_devices -= invalid_cloaking_devices
return
+ if(invalid_cloaking_devices)
+ GLOB.cloaking_devices -= invalid_cloaking_devices
var/mob/living/L = target
L.cloaked = 0
L.mouse_opacity = MOUSE_OPACITY_ICON
diff --git a/code/game/objects/items/weapons/extinguisher.dm b/code/game/objects/items/weapons/extinguisher.dm
index a28bf9f13c5..70ea909cb82 100644
--- a/code/game/objects/items/weapons/extinguisher.dm
+++ b/code/game/objects/items/weapons/extinguisher.dm
@@ -12,7 +12,7 @@
throw_speed = 2
throw_range = 10
force = 18
- matter = list(DEFAULT_WALL_MATERIAL = 90)
+ matter = list(MATERIAL_STEEL = 90)
attack_verb = list("slammed", "whacked", "bashed", "thunked", "battered", "bludgeoned", "thrashed")
amount_per_transfer_from_this = 150
possible_transfer_amounts = null
@@ -96,7 +96,7 @@
throw_speed = 2
throw_range = 10
force = 15
- matter = list(DEFAULT_WALL_MATERIAL = 90)
+ matter = list(MATERIAL_STEEL = 90)
attack_verb = list("slammed", "whacked", "bashed", "thunked", "battered", "bludgeoned", "thrashed")
drop_sound = 'sound/items/drop/gas_tank.ogg'
pickup_sound = 'sound/items/pickup/gas_tank.ogg'
diff --git a/code/game/objects/items/weapons/flamethrower.dm b/code/game/objects/items/weapons/flamethrower.dm
index 14db93c96eb..09827cbec6b 100644
--- a/code/game/objects/items/weapons/flamethrower.dm
+++ b/code/game/objects/items/weapons/flamethrower.dm
@@ -16,7 +16,7 @@
light_color = LIGHT_COLOR_FIRE
origin_tech = list(TECH_COMBAT = 1, TECH_PHORON = 1)
- matter = list(DEFAULT_WALL_MATERIAL = 500)
+ matter = list(MATERIAL_STEEL = 500)
var/secured = FALSE // Whether we have an igniter secured (screwdrivered) to us or not
var/throw_amount = 100
diff --git a/code/game/objects/items/weapons/grenades/chem_grenade.dm b/code/game/objects/items/weapons/grenades/chem_grenade.dm
index 2ce95daf84f..5a87d2bfa98 100644
--- a/code/game/objects/items/weapons/grenades/chem_grenade.dm
+++ b/code/game/objects/items/weapons/grenades/chem_grenade.dm
@@ -15,7 +15,7 @@
var/list/allowed_containers = list(/obj/item/reagent_containers/glass/beaker, /obj/item/reagent_containers/glass/bottle)
var/affected_area = 3
- matter = list(DEFAULT_WALL_MATERIAL = 700, MATERIAL_GLASS = 300)
+ matter = list(MATERIAL_STEEL = 700, MATERIAL_GLASS = 300)
/obj/item/grenade/chem_grenade/feedback_hints(mob/user, distance, is_adjacent)
. += ..()
@@ -199,7 +199,7 @@
origin_tech = list(TECH_COMBAT = 3, TECH_MATERIAL = 3)
affected_area = 4
- matter = list(DEFAULT_WALL_MATERIAL = 1000, MATERIAL_GLASS = 500)
+ matter = list(MATERIAL_STEEL = 1000, MATERIAL_GLASS = 500)
/obj/item/grenade/chem_grenade/metalfoam
name = "metal-foam grenade"
diff --git a/code/game/objects/items/weapons/handcuffs.dm b/code/game/objects/items/weapons/handcuffs.dm
index 0bded6a5ba4..f1ff18548df 100644
--- a/code/game/objects/items/weapons/handcuffs.dm
+++ b/code/game/objects/items/weapons/handcuffs.dm
@@ -14,7 +14,7 @@
throw_speed = 2
throw_range = 5
origin_tech = list(TECH_MATERIAL = 1)
- matter = list(DEFAULT_WALL_MATERIAL = 500)
+ matter = list(MATERIAL_STEEL = 500)
recyclable = TRUE
var/legcuff = FALSE
var/elastic = FALSE
diff --git a/code/game/objects/items/weapons/implants/implanter.dm b/code/game/objects/items/weapons/implants/implanter.dm
index 995437c007d..a1723e79085 100644
--- a/code/game/objects/items/weapons/implants/implanter.dm
+++ b/code/game/objects/items/weapons/implants/implanter.dm
@@ -6,7 +6,7 @@
throw_speed = 1
throw_range = 5
w_class = WEIGHT_CLASS_SMALL
- matter = list(DEFAULT_WALL_MATERIAL = 320, MATERIAL_GLASS = 800)
+ matter = list(MATERIAL_STEEL = 320, MATERIAL_GLASS = 800)
var/obj/item/implant/imp = null
/obj/item/implanter/New()
diff --git a/code/game/objects/items/weapons/ipc_scanner.dm b/code/game/objects/items/weapons/ipc_scanner.dm
index 0cda9477b08..c58c06c9664 100644
--- a/code/game/objects/items/weapons/ipc_scanner.dm
+++ b/code/game/objects/items/weapons/ipc_scanner.dm
@@ -19,7 +19,7 @@
throw_speed = 5
throw_range = 10
origin_tech = list(TECH_MAGNET = 2, TECH_BIO = 1, TECH_ENGINEERING = 2)
- matter = list(DEFAULT_WALL_MATERIAL = 500, MATERIAL_GLASS = 200)
+ matter = list(MATERIAL_STEEL = 500, MATERIAL_GLASS = 200)
/obj/item/ipc_tag_scanner/Initialize(mapload, ...)
. = ..()
diff --git a/code/game/objects/items/weapons/material/knives.dm b/code/game/objects/items/weapons/material/knives.dm
index 89a981c1cd3..26020c3b2df 100644
--- a/code/game/objects/items/weapons/material/knives.dm
+++ b/code/game/objects/items/weapons/material/knives.dm
@@ -13,7 +13,7 @@
edge = TRUE
var/active = 1 // For butterfly knives
force_divisor = 0.15 // 9 when wielded with hardness 60 (steel)
- matter = list(DEFAULT_WALL_MATERIAL = 12000)
+ matter = list(MATERIAL_STEEL = 12000)
origin_tech = list(TECH_MATERIAL = 1)
attack_verb = list("slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut")
unbreakable = 1
diff --git a/code/game/objects/items/weapons/material/material_weapons.dm b/code/game/objects/items/weapons/material/material_weapons.dm
index 4a5ea938519..3784e4dd4bb 100644
--- a/code/game/objects/items/weapons/material/material_weapons.dm
+++ b/code/game/objects/items/weapons/material/material_weapons.dm
@@ -59,7 +59,7 @@
throwforce = round(material.get_blunt_damage()*thrown_force_divisor)
/obj/item/material/proc/set_material(var/new_material)
- material = GET_SINGLETON(new_material)
+ material = SSmaterials.get_material_by_id(new_material)
if(!material)
qdel(src)
else
diff --git a/code/game/objects/items/weapons/paint.dm b/code/game/objects/items/weapons/paint.dm
index 93b9eea7f63..00513e685a1 100644
--- a/code/game/objects/items/weapons/paint.dm
+++ b/code/game/objects/items/weapons/paint.dm
@@ -7,7 +7,7 @@
icon = 'icons/obj/items.dmi'
icon_state = "paint_empty"
item_state = "paintcan"
- matter = list(DEFAULT_WALL_MATERIAL = 200)
+ matter = list(MATERIAL_STEEL = 200)
w_class = WEIGHT_CLASS_NORMAL
amount_per_transfer_from_this = 10
possible_transfer_amounts = list(10,20,30,60)
diff --git a/code/game/objects/items/weapons/power_cells.dm b/code/game/objects/items/weapons/power_cells.dm
index ba4bfdf4b56..cb8f8624e98 100644
--- a/code/game/objects/items/weapons/power_cells.dm
+++ b/code/game/objects/items/weapons/power_cells.dm
@@ -11,7 +11,7 @@
throw_speed = 3
throw_range = 5
w_class = WEIGHT_CLASS_NORMAL
- matter = list(DEFAULT_WALL_MATERIAL = 700, MATERIAL_GLASS = 50)
+ matter = list(MATERIAL_STEEL = 700, MATERIAL_GLASS = 50)
recyclable = TRUE
/// Note %age converted to actual charge in New()
@@ -55,7 +55,7 @@
icon_state = "ocell"
origin_tech = list(TECH_POWER = 0)
maxcharge = 900
- matter = list(DEFAULT_WALL_MATERIAL = 700, MATERIAL_GLASS = 40)
+ matter = list(MATERIAL_STEEL = 700, MATERIAL_GLASS = 40)
/obj/item/cell/crap/Initialize()
. = ..()
@@ -77,7 +77,7 @@
name = "security borg rechargable D battery"
origin_tech = list(TECH_POWER = 0)
maxcharge = 600 //600 max charge / 100 charge per shot = six shots
- matter = list(DEFAULT_WALL_MATERIAL = 700, MATERIAL_GLASS = 40)
+ matter = list(MATERIAL_STEEL = 700, MATERIAL_GLASS = 40)
/obj/item/cell/secborg/empty/Initialize()
. = ..()
@@ -90,14 +90,14 @@
origin_tech = list(TECH_POWER = 1)
icon_state = "hcell"
maxcharge = 15000
- matter = list(DEFAULT_WALL_MATERIAL = 700, MATERIAL_GLASS = 50)
+ matter = list(MATERIAL_STEEL = 700, MATERIAL_GLASS = 50)
/obj/item/cell/high
name = "high-capacity power cell"
origin_tech = list(TECH_POWER = 2)
icon_state = "h+cell"
maxcharge = 30000
- matter = list(DEFAULT_WALL_MATERIAL = 700, MATERIAL_GLASS = 60)
+ matter = list(MATERIAL_STEEL = 700, MATERIAL_GLASS = 60)
/obj/item/cell/high/empty/Initialize()
. = ..()
@@ -109,7 +109,7 @@
origin_tech = list(TECH_POWER = 5)
icon_state = "scell"
maxcharge = 60000
- matter = list(DEFAULT_WALL_MATERIAL = 700, MATERIAL_GLASS = 70)
+ matter = list(MATERIAL_STEEL = 700, MATERIAL_GLASS = 70)
/obj/item/cell/super/empty/Initialize()
. = ..()
@@ -121,7 +121,7 @@
origin_tech = list(TECH_POWER = 6)
icon_state = "hpcell"
maxcharge = 90000
- matter = list(DEFAULT_WALL_MATERIAL = 200, MATERIAL_GOLD = 50, MATERIAL_SILVER = 50, MATERIAL_GLASS = 40)
+ matter = list(MATERIAL_STEEL = 200, MATERIAL_GOLD = 50, MATERIAL_SILVER = 50, MATERIAL_GLASS = 40)
/obj/item/cell/hyper/empty/Initialize()
. = ..()
@@ -133,7 +133,7 @@
icon_state = "icell"
origin_tech = null
maxcharge = 180000 //determines how badly mobs get shocked
- matter = list(DEFAULT_WALL_MATERIAL = 700, MATERIAL_GLASS = 80)
+ matter = list(MATERIAL_STEEL = 700, MATERIAL_GLASS = 80)
/obj/item/cell/infinite/check_charge()
return 1
@@ -212,7 +212,7 @@
icon_state = "hycell"
/// Hydrogen is actually used today in electric cars
maxcharge = 10000
- matter = list(DEFAULT_WALL_MATERIAL = 700, MATERIAL_GLASS = 70)
+ matter = list(MATERIAL_STEEL = 700, MATERIAL_GLASS = 70)
w_class = WEIGHT_CLASS_SMALL
drop_sound = 'sound/items/drop/gas_tank.ogg'
pickup_sound = 'sound/items/pickup/gas_tank.ogg'
@@ -224,14 +224,14 @@
icon_state = "core"
w_class = WEIGHT_CLASS_BULKY
maxcharge = 20000
- matter = list(DEFAULT_WALL_MATERIAL = 20000, MATERIAL_GLASS = 10000)
+ matter = list(MATERIAL_STEEL = 20000, MATERIAL_GLASS = 10000)
/obj/item/cell/mecha/nuclear
name = "nuclear power core"
origin_tech = list(TECH_POWER = 3, TECH_MATERIAL = 3)
icon_state = "nuclear_core"
maxcharge = 30000
- matter = list(DEFAULT_WALL_MATERIAL = 20000, MATERIAL_GLASS = 10000, MATERIAL_URANIUM = 10000)
+ matter = list(MATERIAL_STEEL = 20000, MATERIAL_GLASS = 10000, MATERIAL_URANIUM = 10000)
/// Nuclear mecha cores recharges 5% every one minute
self_charge_percentage = 5
@@ -241,7 +241,7 @@
origin_tech = list(TECH_POWER = 5, TECH_MATERIAL = 5)
icon_state = "phoron_core"
maxcharge = 50000
- matter = list(DEFAULT_WALL_MATERIAL = 20000, MATERIAL_GLASS = 10000, MATERIAL_PHORON = 5000)
+ matter = list(MATERIAL_STEEL = 20000, MATERIAL_GLASS = 10000, MATERIAL_PHORON = 5000)
/// Phoron mecha cores recharges 10% every one minute
self_charge_percentage = 10
diff --git a/code/game/objects/items/weapons/shields.dm b/code/game/objects/items/weapons/shields.dm
index 5243824df79..f860d1fa496 100644
--- a/code/game/objects/items/weapons/shields.dm
+++ b/code/game/objects/items/weapons/shields.dm
@@ -68,7 +68,7 @@
throw_range = 4
w_class = WEIGHT_CLASS_BULKY
origin_tech = list(TECH_MATERIAL = 2)
- matter = list(DEFAULT_WALL_MATERIAL = 1000, MATERIAL_GLASS = 7500)
+ matter = list(MATERIAL_STEEL = 1000, MATERIAL_GLASS = 7500)
attack_verb = list("shoved", "bashed")
var/cooldown = 0 //shield bash cooldown. based on world.time
@@ -109,7 +109,7 @@
throw_range = 20
w_class = WEIGHT_CLASS_BULKY
origin_tech = list(TECH_MATERIAL = 1)
- matter = list(DEFAULT_WALL_MATERIAL = 1000, MATERIAL_WOOD = 1000)
+ matter = list(MATERIAL_STEEL = 1000, MATERIAL_WOOD = 1000)
attack_verb = list("shoved", "bashed")
/obj/item/shield/buckler/handle_shield(mob/user)
diff --git a/code/game/objects/items/weapons/surgery_tools.dm b/code/game/objects/items/weapons/surgery_tools.dm
index fe19cdb433c..784d839b6c9 100644
--- a/code/game/objects/items/weapons/surgery_tools.dm
+++ b/code/game/objects/items/weapons/surgery_tools.dm
@@ -31,7 +31,7 @@
icon_state = "retractor"
item_state = "retractor"
surgerysound = 'sound/items/surgery/retractor.ogg'
- matter = list(DEFAULT_WALL_MATERIAL = 10000, MATERIAL_GLASS = 5000)
+ matter = list(MATERIAL_STEEL = 10000, MATERIAL_GLASS = 5000)
obj_flags = OBJ_FLAG_CONDUCTABLE
origin_tech = list(TECH_MATERIAL = 1, TECH_BIO = 1)
tool_behaviour = TOOL_RETRACTOR
@@ -45,7 +45,7 @@
icon_state = "hemostat"
item_state = "hemostat"
surgerysound = 'sound/items/surgery/hemostat.ogg'
- matter = list(DEFAULT_WALL_MATERIAL = 5000, MATERIAL_GLASS = 2500)
+ matter = list(MATERIAL_STEEL = 5000, MATERIAL_GLASS = 2500)
obj_flags = OBJ_FLAG_CONDUCTABLE
origin_tech = list(TECH_MATERIAL = 1, TECH_BIO = 1)
attack_verb = list("attacked", "pinched")
@@ -60,7 +60,7 @@
icon_state = "cautery"
item_state = "cautery"
surgerysound = 'sound/items/surgery/cautery.ogg'
- matter = list(DEFAULT_WALL_MATERIAL = 5000, MATERIAL_GLASS = 2500)
+ matter = list(MATERIAL_STEEL = 5000, MATERIAL_GLASS = 2500)
obj_flags = OBJ_FLAG_CONDUCTABLE
origin_tech = list(TECH_MATERIAL = 1, TECH_BIO = 1)
attack_verb = list("burnt")
@@ -76,7 +76,7 @@
item_state = "drill"
surgerysound = 'sound/items/surgery/surgicaldrill.ogg'
hitsound = SFX_DRILL_HIT
- matter = list(DEFAULT_WALL_MATERIAL = 15000, MATERIAL_GLASS = 10000)
+ matter = list(MATERIAL_STEEL = 15000, MATERIAL_GLASS = 10000)
obj_flags = OBJ_FLAG_CONDUCTABLE
force = 22
w_class = WEIGHT_CLASS_NORMAL
@@ -105,7 +105,7 @@
throw_speed = 3
throw_range = 5
origin_tech = list(TECH_MATERIAL = 1, TECH_BIO = 1)
- matter = list(DEFAULT_WALL_MATERIAL = 10000, MATERIAL_GLASS = 5000)
+ matter = list(MATERIAL_STEEL = 10000, MATERIAL_GLASS = 5000)
attack_verb = list("attacked", "slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut")
drop_sound = 'sound/items/drop/knife.ogg'
pickup_sound = 'sound/items/pickup/knife.ogg'
@@ -120,7 +120,7 @@
desc = "A scalpel augmented with a directed laser, for more precise cutting without blood entering the field."
icon_state = "scalpel_laser"
surgerysound = 'sound/items/surgery/cautery.ogg'
- matter = list(DEFAULT_WALL_MATERIAL = 12500, MATERIAL_GLASS = 7500)
+ matter = list(MATERIAL_STEEL = 12500, MATERIAL_GLASS = 7500)
damtype = "fire"
force = 18
tool_quality = STANDARD_TOOL_LEVEL + 1
@@ -130,7 +130,7 @@
desc = "A true extension of the surgeon's body, this marvel instantly and completely prepares an incision allowing for the immediate commencement of therapeutic steps."
icon_state = "scalpel_manager"
surgerysound = 'sound/items/surgery/cautery.ogg'
- matter = list (DEFAULT_WALL_MATERIAL = 12500, MATERIAL_GLASS = 7500, MATERIAL_SILVER = 1500, MATERIAL_GOLD = 1500, MATERIAL_DIAMOND = 750)
+ matter = list (MATERIAL_STEEL = 12500, MATERIAL_GLASS = 7500, MATERIAL_SILVER = 1500, MATERIAL_GOLD = 1500, MATERIAL_DIAMOND = 750)
force = 8
tool_quality = STANDARD_TOOL_LEVEL + 2
@@ -151,7 +151,7 @@
throw_speed = 3
throw_range = 5
origin_tech = list(TECH_MATERIAL = 1, TECH_BIO = 1)
- matter = list(DEFAULT_WALL_MATERIAL = 20000, MATERIAL_GLASS = 10000)
+ matter = list(MATERIAL_STEEL = 20000, MATERIAL_GLASS = 10000)
attack_verb = list("attacked", "slashed", "sawed", "cut")
sharp = TRUE
edge = TRUE
diff --git a/code/game/objects/items/weapons/teleportation.dm b/code/game/objects/items/weapons/teleportation.dm
index f42542ad0b5..7041397668f 100644
--- a/code/game/objects/items/weapons/teleportation.dm
+++ b/code/game/objects/items/weapons/teleportation.dm
@@ -10,12 +10,25 @@
* Special inhibitor handling. Different from the one used by teleport datums.
*/
/proc/check_inhibitors(var/turf/T)
+ if(!istype(T))
+ return TRUE
+ var/list/invalid_inhibitors
for(var/found_inhibitor in GLOB.bluespace_inhibitors)
+ if(!istype(found_inhibitor, /obj/structure/machinery/anti_bluespace))
+ LAZYADD(invalid_inhibitors, found_inhibitor)
+ continue
var/obj/structure/machinery/anti_bluespace/AB = found_inhibitor
+ if(QDELETED(AB))
+ LAZYADD(invalid_inhibitors, found_inhibitor)
+ continue
if(T.z != AB.z || get_dist(T, AB) > 8 || (AB.stat & (NOPOWER | BROKEN)))
continue
else
+ if(invalid_inhibitors)
+ GLOB.bluespace_inhibitors -= invalid_inhibitors
return FALSE
+ if(invalid_inhibitors)
+ GLOB.bluespace_inhibitors -= invalid_inhibitors
return TRUE
/*
@@ -38,7 +51,7 @@
throw_speed = 4
throw_range = 20
origin_tech = list(TECH_MAGNET = 1)
- matter = list(DEFAULT_WALL_MATERIAL = 400)
+ matter = list(MATERIAL_STEEL = 400)
/obj/item/locator/attack_self(mob/user as mob)
user.set_machine(src)
@@ -150,7 +163,7 @@ Frequency:
throw_speed = 3
throw_range = 5
origin_tech = list(TECH_MAGNET = 1, TECH_BLUESPACE = 3)
- matter = list(DEFAULT_WALL_MATERIAL = 10000)
+ matter = list(MATERIAL_STEEL = 10000)
var/obj/structure/machinery/teleport/pad/linked_pad
var/list/active_teleporters
@@ -278,7 +291,7 @@ Frequency:
obj_flags = OBJ_FLAG_CONDUCTABLE
w_class = WEIGHT_CLASS_SMALL
origin_tech = list(TECH_MAGNET = 2, TECH_BLUESPACE = 3)
- matter = list(DEFAULT_WALL_MATERIAL = 400)
+ matter = list(MATERIAL_STEEL = 400)
var/obj/structure/closet/attached_closet
var/obj/item/closet_teleporter/linked_teleporter
var/last_use = 0
diff --git a/code/game/objects/items/weapons/traps.dm b/code/game/objects/items/weapons/traps.dm
index 491a25407d5..556feae70a5 100644
--- a/code/game/objects/items/weapons/traps.dm
+++ b/code/game/objects/items/weapons/traps.dm
@@ -11,7 +11,7 @@
throwforce = 0
w_class = WEIGHT_CLASS_NORMAL
origin_tech = list(TECH_ENGINEERING = 2)
- matter = list(DEFAULT_WALL_MATERIAL = 18750)
+ matter = list(MATERIAL_STEEL = 18750)
can_buckle = list(/mob/living)
update_icon_on_init = TRUE
@@ -419,7 +419,7 @@
force = 1
w_class = WEIGHT_CLASS_SMALL
origin_tech = list(TECH_ENGINEERING = 1)
- matter = list(DEFAULT_WALL_MATERIAL = 1750)
+ matter = list(MATERIAL_STEEL = 1750)
health = 100
can_astar_pass = CANASTARPASS_ALWAYS_PROC
time_to_escape = 3 MINUTES
@@ -829,7 +829,7 @@
force = 11
w_class = WEIGHT_CLASS_BULKY
origin_tech = list(TECH_ENGINEERING = 3)
- matter = list(DEFAULT_WALL_MATERIAL = 5750)
+ matter = list(MATERIAL_STEEL = 5750)
max_mob_size = MOB_SMALL
resources = list(/obj/item/stack/rods = 12)
@@ -848,7 +848,7 @@
w_class = 6
density = TRUE
origin_tech = list(TECH_ENGINEERING = 3)
- matter = list(DEFAULT_WALL_MATERIAL = 15750)
+ matter = list(MATERIAL_STEEL = 15750)
max_mob_size = 20
resources = list(/obj/item/stack/rods = 12, /obj/item/stack/material/steel = 4)
diff --git a/code/game/objects/structures.dm b/code/game/objects/structures.dm
index f30bf7e2197..7aa7cff3b68 100644
--- a/code/game/objects/structures.dm
+++ b/code/game/objects/structures.dm
@@ -23,7 +23,7 @@
/obj/structure/Initialize(mapload)
. = ..()
if(!isnull(material) && !istype(material))
- material = GET_SINGLETON(material)
+ material = SSmaterials.get_material_by_id(material)
if (!mapload)
updateVisibility(src) // No point checking this before visualnet initializes.
if(climbable)
diff --git a/code/game/objects/structures/_machinery.dm b/code/game/objects/structures/_machinery.dm
index 24fbd4672e7..5b46b762635 100644
--- a/code/game/objects/structures/_machinery.dm
+++ b/code/game/objects/structures/_machinery.dm
@@ -251,7 +251,7 @@ Class Procs:
if(prob(50))
metal_to_spawn++
else
- new /obj/item/material/shard(current_turf, DEFAULT_WALL_MATERIAL)
+ new /obj/item/material/shard(current_turf, MATERIAL_STEEL)
if(metal_to_spawn)
new /obj/item/stack/material/steel(get_turf(src), metal_to_spawn)
if(!should_use_health)
diff --git a/code/game/objects/structures/bonfire.dm b/code/game/objects/structures/bonfire.dm
index 1e24ebb972e..503e16b4469 100644
--- a/code/game/objects/structures/bonfire.dm
+++ b/code/game/objects/structures/bonfire.dm
@@ -359,7 +359,7 @@ GLOBAL_LIST_EMPTY(total_active_bonfires)
fuel = 0 //don't start with fuel
if(!material_name)
material_name = MATERIAL_MARBLE
- material = GET_SINGLETON(material_name)
+ material = SSmaterials.get_material_by_id(material_name)
if(!material)
qdel(src)
return
diff --git a/code/game/objects/structures/crates_lockers/closets.dm b/code/game/objects/structures/crates_lockers/closets.dm
index 4a92d811ed9..22bd7e30f9b 100644
--- a/code/game/objects/structures/crates_lockers/closets.dm
+++ b/code/game/objects/structures/crates_lockers/closets.dm
@@ -880,7 +880,7 @@
icon = 'icons/obj/item/scanner.dmi'
icon_state = "crate_scanner"
item_state = "crate_scanner"
- matter = list(DEFAULT_WALL_MATERIAL = 250, MATERIAL_GLASS = 140)
+ matter = list(MATERIAL_STEEL = 250, MATERIAL_GLASS = 140)
w_class = WEIGHT_CLASS_SMALL
obj_flags = OBJ_FLAG_CONDUCTABLE
slot_flags = SLOT_BELT
diff --git a/code/game/objects/structures/curtains.dm b/code/game/objects/structures/curtains.dm
index a6f56f5d9d8..515294569f0 100644
--- a/code/game/objects/structures/curtains.dm
+++ b/code/game/objects/structures/curtains.dm
@@ -12,7 +12,7 @@
/obj/structure/curtain/Initialize()
. = ..()
- material = GET_SINGLETON(curtain_material)
+ material = SSmaterials.get_material_by_id(curtain_material)
AddComponent(/datum/component/turf_hand)
/obj/structure/curtain/open
diff --git a/code/game/objects/structures/door_assembly.dm b/code/game/objects/structures/door_assembly.dm
index 143092b5493..cac2b39dbca 100644
--- a/code/game/objects/structures/door_assembly.dm
+++ b/code/game/objects/structures/door_assembly.dm
@@ -261,13 +261,13 @@
if(glass)
to_chat(user, SPAN_WARNING("\The [src] already has glass installed."))
return
- var/obj/item/stack/S = attacking_item
- var/material_name = S.get_material_name()
+ var/obj/item/stack/material/S = attacking_item
+ var/singleton/material/glass_material = S.get_material()
if(S.get_amount() >= 2)
- if(material_name != MATERIAL_GLASS_REINFORCED)
+ if(glass_material?.type != MATERIAL_GLASS_REINFORCED)
to_chat(user, SPAN_WARNING("You can only use reinforced glass to install a window into an airlock assembly."))
return
- if(material_name == MATERIAL_GLASS_REINFORCED)
+ if(glass_material.type == MATERIAL_GLASS_REINFORCED)
user.visible_message("[user] starts installing \the [S] into the airlock assembly.", SPAN_WARNING("You start installing \the [S] into the airlock assembly."))
if(attacking_item.use_tool(src, user, 40, volume = 50) && !glass)
if(S.use(2))
diff --git a/code/game/objects/structures/full_window_frame.dm b/code/game/objects/structures/full_window_frame.dm
index 9e4e414d438..2eb0d2eb3c9 100644
--- a/code/game/objects/structures/full_window_frame.dm
+++ b/code/game/objects/structures/full_window_frame.dm
@@ -118,27 +118,26 @@
to_chat(user, SPAN_NOTICE("\The [src] needs to be anchored."))
return
- var/material_name = attacking_item.get_material_name()
- if(material_name in list(MATERIAL_GLASS_REINFORCED, MATERIAL_GLASS_REINFORCED_PHORON))
+ var/obj/item/stack/material/glass_stack = attacking_item
+ var/singleton/material/glass_material = glass_stack.get_material()
+ if(glass_material?.type in list(MATERIAL_GLASS_REINFORCED, MATERIAL_GLASS_REINFORCED_PHORON))
if(has_glass_installed)
to_chat(user, SPAN_NOTICE("\The [src] already has glass installed."))
return
- var/obj/item/stack/material/glass_stack = attacking_item
-
if(!do_after(user, 2 SECONDS))
return
if(!glass_stack.use(glass_needed))
var/message = "You need at least [glass_needed] sheets of " \
- + "[material_name] to install a window in \the [src]."
+ + "[glass_material.use_name] to install a window in \the [src]."
to_chat(user, SPAN_NOTICE(message))
return
playsound(src, 'sound/items/Deconstruct.ogg', 50, 1)
- to_chat(user, SPAN_NOTICE("You place the [material_name] in the window frame."))
+ to_chat(user, SPAN_NOTICE("You place the [glass_material.use_name] in the window frame."))
- switch(material_name)
+ switch(glass_material.type)
if(MATERIAL_GLASS_REINFORCED)
new /obj/structure/window/full/reinforced(get_turf(src), constructed = TRUE)
if(MATERIAL_GLASS_REINFORCED_PHORON)
diff --git a/code/game/objects/structures/girders.dm b/code/game/objects/structures/girders.dm
index 2bf23a6a45d..a6c263ff09a 100644
--- a/code/game/objects/structures/girders.dm
+++ b/code/game/objects/structures/girders.dm
@@ -38,7 +38,7 @@
/obj/structure/girder/assembly_hints(mob/user, distance, is_adjacent)
. += ..()
- if (health < initial(health))
+ if (health < maxhealth)
. += "It could be repaired with a few choice welds."
if (anchored)
@@ -232,7 +232,7 @@
to_chat(user, SPAN_NOTICE("There isn't enough material here to construct a wall."))
return 0
- var/singleton/material/material = GET_SINGLETON(mat_stack.default_type)
+ var/singleton/material/material = mat_stack.get_material()
if(!istype(material))
return 0
@@ -282,7 +282,7 @@
to_chat(user, SPAN_NOTICE("There isn't enough material here to reinforce the girder."))
return 0
- var/singleton/material/material = GET_SINGLETON(mat_stack.default_type)
+ var/singleton/material/material = mat_stack.get_material()
if(!istype(material) || material.integrity < 50)
to_chat(user, "You cannot reinforce \the [src] with that; it is too soft.")
return 0
diff --git a/code/game/objects/structures/grille.dm b/code/game/objects/structures/grille.dm
index 65a82cc687e..9060a4a19a7 100644
--- a/code/game/objects/structures/grille.dm
+++ b/code/game/objects/structures/grille.dm
@@ -18,9 +18,9 @@
var/destroyed = 0
/obj/structure/grille/get_damage_condition_hints(mob/user, distance, is_adjacent)
- if(health < initial(health))
+ if(health < maxhealth)
var/state
- var/current_damage = health / initial(health)
+ var/current_damage = health / maxhealth
switch(current_damage)
if(0 to 0.3)
state = SPAN_DANGER("The grille is barely in one piece!")
diff --git a/code/game/objects/structures/machinery/alarm.dm b/code/game/objects/structures/machinery/alarm.dm
index a34f6978d47..9d96006ebc8 100644
--- a/code/game/objects/structures/machinery/alarm.dm
+++ b/code/game/objects/structures/machinery/alarm.dm
@@ -1073,7 +1073,7 @@ Just a object used in constructing air alarms
icon_state = "door_electronics"
desc = "Looks like a circuit. Probably is."
w_class = WEIGHT_CLASS_SMALL
- matter = list(DEFAULT_WALL_MATERIAL = 50, MATERIAL_GLASS = 50)
+ matter = list(MATERIAL_STEEL = 50, MATERIAL_GLASS = 50)
#undef AALARM_MODE_SCRUBBING
#undef AALARM_MODE_REPLACEMENT
diff --git a/code/game/objects/structures/machinery/bioprinter.dm b/code/game/objects/structures/machinery/bioprinter.dm
index 20f94225ee4..23427db6b14 100644
--- a/code/game/objects/structures/machinery/bioprinter.dm
+++ b/code/game/objects/structures/machinery/bioprinter.dm
@@ -74,8 +74,10 @@
qdel(attacking_item)
return TRUE
// Steel for matter.
- if(prints_prosthetics && istype(attacking_item, /obj/item/stack/material) && attacking_item.get_material_name() == DEFAULT_WALL_MATERIAL)
- var/obj/item/stack/S = attacking_item
+ var/obj/item/stack/material/metal_stack = attacking_item
+ var/singleton/material/metal_material = metal_stack?.get_material()
+ if(prints_prosthetics && istype(metal_stack) && metal_material?.type == MATERIAL_STEEL)
+ var/obj/item/stack/S = metal_stack
stored_matter += S.amount * 10
user.drop_from_inventory(attacking_item, src)
to_chat(user, "\The [src] processes \the [attacking_item]. Levels of stored matter now: [stored_matter]")
diff --git a/code/game/objects/structures/machinery/computer/ai_core.dm b/code/game/objects/structures/machinery/computer/ai_core.dm
index 3625ca2e276..1a0225a3259 100644
--- a/code/game/objects/structures/machinery/computer/ai_core.dm
+++ b/code/game/objects/structures/machinery/computer/ai_core.dm
@@ -94,19 +94,21 @@
A.amount = 5
return TRUE
- if(istype(attacking_item, /obj/item/stack/material) && attacking_item.get_material_name() == MATERIAL_GLASS_REINFORCED)
- var/obj/item/stack/RG = attacking_item
- if (RG.get_amount() < 2)
- to_chat(user, SPAN_WARNING("You need two sheets of glass to put in the glass panel."))
- return
- to_chat(user, SPAN_NOTICE("You start to put in the glass panel."))
- playsound(loc, 'sound/items/Deconstruct.ogg', 50, 1)
- if (do_after(user, 2 SECONDS, src, DO_REPAIR_CONSTRUCT) && state == 3)
- if(RG.use(2))
- to_chat(user, SPAN_NOTICE("You put in the glass panel."))
- state = 4
- icon_state = "4"
- return TRUE
+ var/obj/item/stack/material/RG = attacking_item
+ if(istype(RG))
+ var/singleton/material/RG_material = RG.get_material()
+ if(RG_material.type == MATERIAL_GLASS_REINFORCED)
+ if (RG.get_amount() < 2)
+ to_chat(user, SPAN_WARNING("You need two sheets of glass to put in the glass panel."))
+ return
+ to_chat(user, SPAN_NOTICE("You start to put in the glass panel."))
+ playsound(loc, 'sound/items/Deconstruct.ogg', 50, 1)
+ if (do_after(user, 2 SECONDS, src, DO_REPAIR_CONSTRUCT) && state == 3)
+ if(RG.use(2))
+ to_chat(user, SPAN_NOTICE("You put in the glass panel."))
+ state = 4
+ icon_state = "4"
+ return TRUE
if(istype(attacking_item, /obj/item/aiModule/asimov))
laws.add_inherent_law("You may not injure a human being or, through inaction, allow a human being to come to harm.")
diff --git a/code/game/objects/structures/machinery/computer/buildandrepair.dm b/code/game/objects/structures/machinery/computer/buildandrepair.dm
index 9a863b95b79..cc73fd980d9 100644
--- a/code/game/objects/structures/machinery/computer/buildandrepair.dm
+++ b/code/game/objects/structures/machinery/computer/buildandrepair.dm
@@ -94,8 +94,10 @@
A.amount = 5
return TRUE
- if(istype(attacking_item, /obj/item/stack/material) && attacking_item.get_material_name() == "glass")
- var/obj/item/stack/G = attacking_item
+ var/obj/item/stack/material/glass_stack = attacking_item
+ var/singleton/material/glass_material = glass_stack?.get_material()
+ if(istype(glass_stack) && glass_material?.type == MATERIAL_GLASS)
+ var/obj/item/stack/G = glass_stack
if (G.get_amount() < 2)
to_chat(user, SPAN_WARNING("You need two sheets of glass to put in the glass panel."))
return TRUE
diff --git a/code/game/objects/structures/machinery/computer/camera.dm b/code/game/objects/structures/machinery/computer/camera.dm
index cf7bfc62896..ba2ed581292 100644
--- a/code/game/objects/structures/machinery/computer/camera.dm
+++ b/code/game/objects/structures/machinery/computer/camera.dm
@@ -175,8 +175,15 @@
if (!check_area)
return
+ var/list/invalid_cameras
for(var/cc in SSmachinery.all_cameras)
+ if(!istype(cc, /obj/structure/machinery/camera))
+ LAZYADD(invalid_cameras, cc)
+ continue
var/obj/structure/machinery/camera/camera = cc
+ if(QDELETED(camera))
+ LAZYADD(invalid_cameras, cc)
+ continue
if(!camera.loc)
continue
if (camera.loc.loc != check_area)
@@ -189,6 +196,8 @@
if(dist < best_dist)
best_dist = dist
jump_to = camera
+ if(invalid_cameras)
+ SSmachinery.all_cameras -= invalid_cameras
if(isnull(jump_to))
return
if(can_access_camera(jump_to))
diff --git a/code/game/objects/structures/machinery/deployable.dm b/code/game/objects/structures/machinery/deployable.dm
index 5292769d5f8..cc66b945da8 100644
--- a/code/game/objects/structures/machinery/deployable.dm
+++ b/code/game/objects/structures/machinery/deployable.dm
@@ -31,7 +31,7 @@ Deployable Kits
/obj/structure/blocker/proc/set_material(var/material_name)
if(force_material)
material_name = force_material
- material = GET_SINGLETON(material_name)
+ material = SSmaterials.get_material_by_id(material_name)
if(!material)
qdel(src)
return
@@ -61,7 +61,7 @@ Deployable Kits
var/obj/item/I = usr.get_inactive_hand()
if(I && istype(I, /obj/item/stack))
var/obj/item/stack/D = I
- if(D.get_material_name() != material.name)
+ if(D.get_material() != material)
to_chat(user, SPAN_WARNING("You need one sheet of [material.display_name] to repair \the [src]."))
return ..()
if(health < maxhealth)
diff --git a/code/game/objects/structures/machinery/doors/airlock.dm b/code/game/objects/structures/machinery/doors/airlock.dm
index c059488cac0..afd413f2332 100644
--- a/code/game/objects/structures/machinery/doors/airlock.dm
+++ b/code/game/objects/structures/machinery/doors/airlock.dm
@@ -241,7 +241,7 @@
if (glass)
paintable |= AIRLOCK_PAINTABLE_WINDOW
- window_material = GET_SINGLETON(init_material_window)
+ window_material = SSmaterials.get_material_by_id(init_material_window)
opacity = FALSE
update_icon()
@@ -283,8 +283,8 @@
/obj/structure/machinery/door/airlock/get_material()
if(material)
- return GET_SINGLETON(material)
- return GET_SINGLETON(MATERIAL_STEEL)
+ return SSmaterials.get_material_by_id(material)
+ return SSmaterials.get_material_by_id(MATERIAL_STEEL)
/obj/structure/machinery/door/airlock/external//External airlocks start here
name = "external airlock"
diff --git a/code/game/objects/structures/machinery/doors/airlock_electronics.dm b/code/game/objects/structures/machinery/doors/airlock_electronics.dm
index a9076a40ed6..6a1c5ca65fe 100644
--- a/code/game/objects/structures/machinery/doors/airlock_electronics.dm
+++ b/code/game/objects/structures/machinery/doors/airlock_electronics.dm
@@ -3,7 +3,7 @@
icon = 'icons/obj/module.dmi'
icon_state = "door_electronics"
- matter = list(DEFAULT_WALL_MATERIAL = 50, MATERIAL_GLASS = 50)
+ matter = list(MATERIAL_STEEL = 50, MATERIAL_GLASS = 50)
req_access = list(ACCESS_ENGINE)
/// If set, then wires will be randomized and bolts will drop if the door is broken
diff --git a/code/game/objects/structures/machinery/doors/blast_door.dm b/code/game/objects/structures/machinery/doors/blast_door.dm
index 7f836409c61..87c2f692e0d 100644
--- a/code/game/objects/structures/machinery/doors/blast_door.dm
+++ b/code/game/objects/structures/machinery/doors/blast_door.dm
@@ -150,12 +150,14 @@
return TRUE
- if(istype(attacking_item, /obj/item/stack/material) && attacking_item.get_material_name() == "plasteel")
+ var/obj/item/stack/material/plasteel_stack = attacking_item
+ var/singleton/material/plasteel_material = plasteel_stack?.get_material()
+ if(istype(plasteel_stack) && plasteel_material?.type == MATERIAL_PLASTEEL)
var/amt = Ceiling((maxhealth - health)/150)
if(!amt)
to_chat(usr, SPAN_NOTICE("\The [src] is already fully repaired."))
return TRUE
- var/obj/item/stack/P = attacking_item
+ var/obj/item/stack/P = plasteel_stack
if(P.amount < amt)
to_chat(usr, SPAN_WARNING("You don't have enough sheets to repair this! You need at least [amt] sheets."))
return TRUE
diff --git a/code/game/objects/structures/machinery/doors/door.dm b/code/game/objects/structures/machinery/doors/door.dm
index 1de42cda807..353cc3aff03 100644
--- a/code/game/objects/structures/machinery/doors/door.dm
+++ b/code/game/objects/structures/machinery/doors/door.dm
@@ -316,7 +316,7 @@
if(attacking_item.tool_behaviour == TOOL_HAMMER && user.a_intent != I_HURT)
var/obj/item/stack/stack = usr.get_inactive_hand()
- if(istype(stack) && stack.get_material_name() == get_material_name())
+ if(istype(stack) && stack.get_material() == get_material())
if(stat & BROKEN)
to_chat(user, SPAN_NOTICE("It looks like \the [src] is pretty busted. It's going to need more than just patching up now."))
return TRUE
diff --git a/code/game/objects/structures/machinery/doors/firedoor.dm b/code/game/objects/structures/machinery/doors/firedoor.dm
index 6538fc754a9..ae666fa495e 100644
--- a/code/game/objects/structures/machinery/doors/firedoor.dm
+++ b/code/game/objects/structures/machinery/doors/firedoor.dm
@@ -204,7 +204,7 @@
..()
/obj/structure/machinery/door/firedoor/get_material()
- return GET_SINGLETON(DEFAULT_WALL_MATERIAL)
+ return SSmaterials.get_material_by_id(MATERIAL_STEEL)
/obj/structure/machinery/door/firedoor/CollidedWith(atom/bumped_atom)
if(p_open || operating)
diff --git a/code/game/objects/structures/machinery/firealarm.dm b/code/game/objects/structures/machinery/firealarm.dm
index af0b3312ec8..29338acd4ce 100644
--- a/code/game/objects/structures/machinery/firealarm.dm
+++ b/code/game/objects/structures/machinery/firealarm.dm
@@ -305,4 +305,4 @@ Just a object used in constructing fire alarms
icon_state = "door_electronics"
desc = "A circuit. It has a label on it, it says \"Can handle heat levels up to 40 degrees celsius!\""
w_class = WEIGHT_CLASS_SMALL
- matter = list(DEFAULT_WALL_MATERIAL = 50, MATERIAL_GLASS = 50)
+ matter = list(MATERIAL_STEEL = 50, MATERIAL_GLASS = 50)
diff --git a/code/game/objects/structures/machinery/floor_light.dm b/code/game/objects/structures/machinery/floor_light.dm
index 83bbf59acda..290bf145f6c 100644
--- a/code/game/objects/structures/machinery/floor_light.dm
+++ b/code/game/objects/structures/machinery/floor_light.dm
@@ -9,7 +9,7 @@
idle_power_usage = 2
active_power_usage = 20
power_channel = AREA_USAGE_LIGHT
- matter = list(DEFAULT_WALL_MATERIAL = 2500, MATERIAL_GLASS = 2750)
+ matter = list(MATERIAL_STEEL = 2500, MATERIAL_GLASS = 2750)
recyclable = TRUE
var/on
diff --git a/code/game/objects/structures/machinery/mecha_fabricator.dm b/code/game/objects/structures/machinery/mecha_fabricator.dm
index f2f8d8011be..645cf90dd78 100644
--- a/code/game/objects/structures/machinery/mecha_fabricator.dm
+++ b/code/game/objects/structures/machinery/mecha_fabricator.dm
@@ -95,7 +95,7 @@
/obj/structure/machinery/mecha_part_fabricator/dismantle()
SSmaterials.normalize_material_amounts(materials)
- for(var/f in materials)
+ for(var/f in materials.Copy())
eject_materials(f, materials[f])
//Stop the queue building if you're dismantling
diff --git a/code/game/objects/structures/machinery/portable_turret.dm b/code/game/objects/structures/machinery/portable_turret.dm
index 23bb7631700..ad83d2988c8 100644
--- a/code/game/objects/structures/machinery/portable_turret.dm
+++ b/code/game/objects/structures/machinery/portable_turret.dm
@@ -899,8 +899,10 @@
return TRUE
if(1)
- if(istype(attacking_item, /obj/item/stack/material) && attacking_item.get_material_name() == DEFAULT_WALL_MATERIAL)
- var/obj/item/stack/M = attacking_item
+ var/obj/item/stack/material/interior_metal_stack = attacking_item
+ var/singleton/material/interior_metal_material = interior_metal_stack?.get_material()
+ if(istype(interior_metal_stack) && interior_metal_material?.type == MATERIAL_STEEL)
+ var/obj/item/stack/M = interior_metal_stack
if(M.use(2))
to_chat(user, SPAN_NOTICE("You add some metal armor to the interior frame."))
build_step = 2
@@ -994,8 +996,10 @@
//attack_hand() removes the prox sensor
if(6)
- if(istype(attacking_item, /obj/item/stack/material) && attacking_item.get_material_name() == DEFAULT_WALL_MATERIAL)
- var/obj/item/stack/M = attacking_item
+ var/obj/item/stack/material/exterior_metal_stack = attacking_item
+ var/singleton/material/exterior_metal_material = exterior_metal_stack?.get_material()
+ if(istype(exterior_metal_stack) && exterior_metal_material?.type == MATERIAL_STEEL)
+ var/obj/item/stack/M = exterior_metal_stack
if(M.use(2))
to_chat(user, SPAN_NOTICE("You add some metal armor to the exterior frame."))
ClearOverlays()
diff --git a/code/game/objects/structures/railing.dm b/code/game/objects/structures/railing.dm
index 2e0313a7cf6..a17926dbba5 100644
--- a/code/game/objects/structures/railing.dm
+++ b/code/game/objects/structures/railing.dm
@@ -81,7 +81,7 @@
if(!non_material_object)
if(!isnull(material) && !istype(material))
- material = GET_SINGLETON(material)
+ material = SSmaterials.get_material_by_id(material)
if(!istype(material))
return INITIALIZE_HINT_QDEL
diff --git a/code/game/objects/structures/simple_doors.dm b/code/game/objects/structures/simple_doors.dm
index 05d4f70965b..77e99d49236 100644
--- a/code/game/objects/structures/simple_doors.dm
+++ b/code/game/objects/structures/simple_doors.dm
@@ -34,7 +34,7 @@
..()
if(!newmaterial)
newmaterial = MATERIAL_STEEL
- material = GET_SINGLETON(newmaterial)
+ material = SSmaterials.get_material_by_id(newmaterial)
if(!material)
qdel(src)
return
diff --git a/code/game/objects/structures/stool_bed_chair_nest/bed.dm b/code/game/objects/structures/stool_bed_chair_nest/bed.dm
index edda12325a5..af1c0fba964 100644
--- a/code/game/objects/structures/stool_bed_chair_nest/bed.dm
+++ b/code/game/objects/structures/stool_bed_chair_nest/bed.dm
@@ -80,12 +80,12 @@
/obj/structure/bed/New(newloc, new_material = MATERIAL_STEEL, new_padding_material, new_painted_colour)
..(newloc)
- material = GET_SINGLETON(new_material)
+ material = SSmaterials.get_material_by_id(new_material)
if(!istype(material))
qdel(src)
return
if(new_padding_material)
- padding_material = GET_SINGLETON(new_padding_material)
+ padding_material = SSmaterials.get_material_by_id(new_padding_material)
if(new_painted_colour)
painted_colour = new_painted_colour
update_icon()
@@ -254,7 +254,7 @@
update_icon()
/obj/structure/bed/proc/add_padding(var/padding_type)
- padding_material = GET_SINGLETON(padding_type)
+ padding_material = SSmaterials.get_material_by_id(padding_type)
generate_strings(TRUE)
update_icon()
diff --git a/code/game/objects/structures/stool_bed_chair_nest/stools.dm b/code/game/objects/structures/stool_bed_chair_nest/stools.dm
index 1fe9be35c11..1baa974bde7 100644
--- a/code/game/objects/structures/stool_bed_chair_nest/stools.dm
+++ b/code/game/objects/structures/stool_bed_chair_nest/stools.dm
@@ -194,7 +194,7 @@
/obj/item/material/stool/New(var/newloc, var/new_material, var/new_padding_material, var/new_painted_colour)
..(newloc, new_material) // new_material handled in material_weapons.dm
if(new_padding_material)
- padding_material = GET_SINGLETON(new_padding_material)
+ padding_material = SSmaterials.get_material_by_id(new_padding_material)
if(new_painted_colour)
painted_colour = new_painted_colour
update_icon()
diff --git a/code/game/turfs/simulated/walls.dm b/code/game/turfs/simulated/walls.dm
index 3d0a6a21812..99f9ed3a042 100644
--- a/code/game/turfs/simulated/walls.dm
+++ b/code/game/turfs/simulated/walls.dm
@@ -101,9 +101,9 @@
icon_state = "blank"
if(!materialtype)
materialtype = MATERIAL_STEEL
- material = GET_SINGLETON(materialtype)
+ material = SSmaterials.get_material_by_id(materialtype)
if(!isnull(rmaterialtype))
- reinf_material = GET_SINGLETON(rmaterialtype)
+ reinf_material = SSmaterials.get_material_by_id(rmaterialtype)
update_material()
hitsound = material.hitsound
set_maxhealth(material.integrity + (reinf_material ? reinf_material.integrity : 0), TRUE)
diff --git a/code/modules/assembly/assembly.dm b/code/modules/assembly/assembly.dm
index 299423792fb..3e44f46c0dc 100644
--- a/code/modules/assembly/assembly.dm
+++ b/code/modules/assembly/assembly.dm
@@ -5,7 +5,7 @@
icon_state = ""
obj_flags = OBJ_FLAG_CONDUCTABLE
w_class = WEIGHT_CLASS_SMALL
- matter = list(DEFAULT_WALL_MATERIAL = 100)
+ matter = list(MATERIAL_STEEL = 100)
recyclable = TRUE
throwforce = 2
throw_speed = 3
diff --git a/code/modules/assembly/igniter.dm b/code/modules/assembly/igniter.dm
index 3065eaff186..9c0ea4aaece 100644
--- a/code/modules/assembly/igniter.dm
+++ b/code/modules/assembly/igniter.dm
@@ -5,7 +5,7 @@
drop_sound = 'sound/items/drop/component.ogg'
pickup_sound = 'sound/items/pickup/component.ogg'
origin_tech = list(TECH_MAGNET = 1)
- matter = list(DEFAULT_WALL_MATERIAL = 500, MATERIAL_GLASS = 50)
+ matter = list(MATERIAL_STEEL = 500, MATERIAL_GLASS = 50)
secured = TRUE
wires = WIRE_RECEIVE_ASSEMBLY
diff --git a/code/modules/assembly/infrared.dm b/code/modules/assembly/infrared.dm
index acb69d7b9b0..5e8ef90422c 100644
--- a/code/modules/assembly/infrared.dm
+++ b/code/modules/assembly/infrared.dm
@@ -5,7 +5,7 @@
drop_sound = 'sound/items/drop/component.ogg'
pickup_sound = 'sound/items/pickup/component.ogg'
origin_tech = list(TECH_MAGNET = 2)
- matter = list(DEFAULT_WALL_MATERIAL = 1000, MATERIAL_GLASS = 500)
+ matter = list(MATERIAL_STEEL = 1000, MATERIAL_GLASS = 500)
secured = FALSE
obj_flags = OBJ_FLAG_ROTATABLE
diff --git a/code/modules/assembly/mousetrap.dm b/code/modules/assembly/mousetrap.dm
index d0bebc6b6af..ff1710bd5f1 100644
--- a/code/modules/assembly/mousetrap.dm
+++ b/code/modules/assembly/mousetrap.dm
@@ -10,7 +10,7 @@
pickup_sound = 'sound/items/pickup/component.ogg'
surgerysound = 'sound/items/surgery/fixovein.ogg'
origin_tech = list(TECH_COMBAT = 1)
- matter = list(DEFAULT_WALL_MATERIAL = 100)
+ matter = list(MATERIAL_STEEL = 100)
var/armed = FALSE
/obj/item/assembly/mousetrap/Initialize(mapload)
diff --git a/code/modules/assembly/proximity.dm b/code/modules/assembly/proximity.dm
index 3c6ceaa1491..2afaccc677b 100644
--- a/code/modules/assembly/proximity.dm
+++ b/code/modules/assembly/proximity.dm
@@ -5,7 +5,7 @@
drop_sound = 'sound/items/drop/component.ogg'
pickup_sound = 'sound/items/pickup/component.ogg'
origin_tech = list(TECH_MAGNET = 1)
- matter = list(DEFAULT_WALL_MATERIAL = 800, MATERIAL_GLASS = 200)
+ matter = list(MATERIAL_STEEL = 800, MATERIAL_GLASS = 200)
movable_flags = MOVABLE_FLAG_PROXMOVE
wires = WIRE_PULSE_ASSEMBLY
diff --git a/code/modules/assembly/signaler.dm b/code/modules/assembly/signaler.dm
index 33de10ab473..85f4f0e2346 100644
--- a/code/modules/assembly/signaler.dm
+++ b/code/modules/assembly/signaler.dm
@@ -6,7 +6,7 @@
drop_sound = 'sound/items/drop/component.ogg'
pickup_sound = 'sound/items/pickup/component.ogg'
origin_tech = list(TECH_MAGNET = 1)
- matter = list(DEFAULT_WALL_MATERIAL = 1000, MATERIAL_GLASS = 200)
+ matter = list(MATERIAL_STEEL = 1000, MATERIAL_GLASS = 200)
wires = WIRE_RECEIVE_ASSEMBLY | WIRE_PULSE_ASSEMBLY | WIRE_RADIO_PULSE | WIRE_RADIO_RECEIVE
secured = TRUE
diff --git a/code/modules/assembly/timer.dm b/code/modules/assembly/timer.dm
index 4d1df6ca29d..578a7264355 100644
--- a/code/modules/assembly/timer.dm
+++ b/code/modules/assembly/timer.dm
@@ -5,7 +5,7 @@
drop_sound = 'sound/items/drop/component.ogg'
pickup_sound = 'sound/items/pickup/component.ogg'
origin_tech = list(TECH_MAGNET = 1)
- matter = list(DEFAULT_WALL_MATERIAL = 500, MATERIAL_GLASS = 50)
+ matter = list(MATERIAL_STEEL = 500, MATERIAL_GLASS = 50)
wires = WIRE_PULSE_ASSEMBLY
secured = FALSE
diff --git a/code/modules/assembly/voice.dm b/code/modules/assembly/voice.dm
index 7a52d08ae97..9876dc3705a 100644
--- a/code/modules/assembly/voice.dm
+++ b/code/modules/assembly/voice.dm
@@ -5,7 +5,7 @@
drop_sound = 'sound/items/drop/component.ogg'
pickup_sound = 'sound/items/pickup/component.ogg'
origin_tech = list(TECH_MAGNET = 1)
- matter = list(DEFAULT_WALL_MATERIAL = 500, MATERIAL_GLASS = 50)
+ matter = list(MATERIAL_STEEL = 500, MATERIAL_GLASS = 50)
var/listening = FALSE
var/recorded //the activation message
diff --git a/code/modules/cargo/exports/materials.dm b/code/modules/cargo/exports/materials.dm
index 634e785bc0d..1c143c7fd0d 100644
--- a/code/modules/cargo/exports/materials.dm
+++ b/code/modules/cargo/exports/materials.dm
@@ -2,6 +2,7 @@
cost = 5 // Cost per MINERAL_MATERIAL_AMOUNT, which is 2000cm3 as of April 2016.
k_elasticity = 0
message = "cm3 of developer's tears. Please, report this on github"
+ /// Singleton material path to match against.
var/material_id = null
export_types = list(/obj/item/stack/material/)
// Yes, it's a base type containing export_types.
@@ -11,7 +12,11 @@
if(!material_id)
return 0
var/obj/item/stack/material/M = O
- if(!M || M.material.name != material_id)
+ if(!M)
+ return 0
+ var/material_path = SSmaterials.material_to_path(material_id, FALSE)
+ var/singleton/material/material = M.get_material()
+ if(!material_path || material?.type != material_path)
return 0
return M.amount
@@ -22,91 +27,89 @@
/datum/export/material/diamond
cost = 20
- material_id = "diamond"
+ material_id = MATERIAL_DIAMOND
message = "diamond sheets"
/datum/export/material/phoron
cost = 175
- material_id = "phoron"
+ material_id = MATERIAL_PHORON
message = "phoron sheets"
/datum/export/material/uranium
cost = 8
- material_id = "uranium"
+ material_id = MATERIAL_URANIUM
message = "uranium sheets"
/datum/export/material/gold
cost = 12
- material_id = "gold"
+ material_id = MATERIAL_GOLD
message = "gold sheets"
/datum/export/material/silver
cost = 8
- material_id = "silver"
+ material_id = MATERIAL_SILVER
message = "silver sheets"
/datum/export/material/platinum
cost = 12
- material_id = "platinum"
+ material_id = MATERIAL_PLATINUM
message = "platinum sheets"
/datum/export/material/osmium
cost = 24
- material_id = "osmium"
+ material_id = MATERIAL_OSMIUM
message = "osmium bars"
/datum/export/material/metal
cost = 2
- material_id = "metal"
message = "metal sheets"
/datum/export/material/steel
cost = 1
- material_id = "steel"
+ material_id = MATERIAL_STEEL
message = "steel sheets"
/datum/export/material/plasteel
cost = 20
- material_id = "plasteel"
+ material_id = MATERIAL_PLASTEEL
message = "plasteel sheets"
/datum/export/material/iron
cost = 1
- material_id = "iron"
+ material_id = MATERIAL_IRON
message = "iron ingots"
/datum/export/material/plastic
cost = 1
- material_id = "plastic"
+ material_id = MATERIAL_PLASTIC
message = "plastic sheets"
/datum/export/material/graphite
cost = 2
- material_id = "graphite"
+ material_id = MATERIAL_GRAPHITE
message = "graphite bars"
/datum/export/material/glass
cost = 1
- material_id = "glass"
+ material_id = MATERIAL_GLASS
message = "glass sheets"
/datum/export/material/tritium
cost = 5
- material_id = "tritium"
+ material_id = MATERIAL_TRITIUM
message = "tritium ingots"
/datum/export/material/mhydrogen
cost = 10
- material_id = "metallic hydrogen"
+ material_id = MATERIAL_HYDROGEN_METALLIC
message = "metallic hydrogen sheets"
/datum/export/material/aluminium
cost = 3
- material_id = "aluminium"
+ material_id = MATERIAL_ALUMINIUM
message = "aluminium sheets"
/datum/export/material/lead
cost = 3
- material_id = "lead"
+ material_id = MATERIAL_LEAD
message = "lead sheets"
-
diff --git a/code/modules/clothing/clothing.dm b/code/modules/clothing/clothing.dm
index a938aac4d42..2b55c627108 100644
--- a/code/modules/clothing/clothing.dm
+++ b/code/modules/clothing/clothing.dm
@@ -287,7 +287,7 @@
return material
/obj/item/clothing/proc/set_material(var/new_material)
- material = GET_SINGLETON(new_material)
+ material = SSmaterials.get_material_by_id(new_material)
if(!material)
qdel(src)
else
diff --git a/code/modules/clothing/ears/antennae.dm b/code/modules/clothing/ears/antennae.dm
index 4a6e4cde122..d13b3f381d5 100644
--- a/code/modules/clothing/ears/antennae.dm
+++ b/code/modules/clothing/ears/antennae.dm
@@ -4,7 +4,7 @@
name = "antenna"
slot_flags = SLOT_HEAD | SLOT_EARS
body_parts_covered = 0
- matter = list(DEFAULT_WALL_MATERIAL = 10)
+ matter = list(MATERIAL_STEEL = 10)
drop_sound = 'sound/items/drop/component.ogg'
pickup_sound = 'sound/items/pickup/component.ogg'
diff --git a/code/modules/clothing/gloves/miscellaneous.dm b/code/modules/clothing/gloves/miscellaneous.dm
index 6c75f3cb85d..1581f96b0e8 100644
--- a/code/modules/clothing/gloves/miscellaneous.dm
+++ b/code/modules/clothing/gloves/miscellaneous.dm
@@ -223,7 +223,7 @@
force = 11
punch_force = 5
clipped = 1
- matter = list(DEFAULT_WALL_MATERIAL = 1000)
+ matter = list(MATERIAL_STEEL = 1000)
drop_sound = 'sound/items/drop/sword.ogg'
pickup_sound = SFX_PICKUP_SWORD
diff --git a/code/modules/clothing/head/misc.dm b/code/modules/clothing/head/misc.dm
index 4d8c9936b6b..ae64c6a2b88 100644
--- a/code/modules/clothing/head/misc.dm
+++ b/code/modules/clothing/head/misc.dm
@@ -38,7 +38,7 @@
name = "magnetic 'pin'"
desc = "Finally, a hair pin even a robot chassis can use."
slot_flags = SLOT_HEAD
- matter = list(DEFAULT_WALL_MATERIAL = 10)
+ matter = list(MATERIAL_STEEL = 10)
/obj/item/clothing/head/pin/flower
name = "red flower pin"
diff --git a/code/modules/clothing/head/misc_special.dm b/code/modules/clothing/head/misc_special.dm
index 5d1cca4d435..44b013ea4bd 100644
--- a/code/modules/clothing/head/misc_special.dm
+++ b/code/modules/clothing/head/misc_special.dm
@@ -20,7 +20,7 @@
slot_l_hand_str = "welding",
slot_r_hand_str = "welding"
)
- matter = list(DEFAULT_WALL_MATERIAL = 3000, MATERIAL_GLASS = 1000)
+ matter = list(MATERIAL_STEEL = 3000, MATERIAL_GLASS = 1000)
var/up = 0
armor = list(
MELEE = ARMOR_MELEE_SMALL
diff --git a/code/modules/clothing/rings/material.dm b/code/modules/clothing/rings/material.dm
index 7bd50514d5a..57853543a3a 100644
--- a/code/modules/clothing/rings/material.dm
+++ b/code/modules/clothing/rings/material.dm
@@ -7,7 +7,7 @@
. = ..(mapload)
if(!new_material)
new_material = MATERIAL_STEEL
- material = GET_SINGLETON(new_material)
+ material = SSmaterials.get_material_by_id(new_material)
if(!istype(material))
qdel(src)
return
diff --git a/code/modules/clothing/spacesuits/breaches.dm b/code/modules/clothing/spacesuits/breaches.dm
index 097cf3cf777..af0fd5785fd 100644
--- a/code/modules/clothing/spacesuits/breaches.dm
+++ b/code/modules/clothing/spacesuits/breaches.dm
@@ -176,11 +176,12 @@ GLOBAL_LIST_INIT(breach_burn_descriptors, list(
/obj/item/clothing/suit/space/attackby(obj/item/attacking_item, mob/user)
if(istype(attacking_item, /obj/item/stack/material))
var/repair_power = 0
- switch(attacking_item.get_material_name())
- if(DEFAULT_WALL_MATERIAL)
- repair_power = 2
- if("plastic")
- repair_power = 1
+ var/obj/item/stack/material/repair_stack = attacking_item
+ var/singleton/material/repair_material = repair_stack.get_material()
+ if(repair_material?.type == MATERIAL_STEEL)
+ repair_power = 2
+ else if(repair_material?.type == MATERIAL_PLASTIC)
+ repair_power = 1
if(!repair_power)
return
diff --git a/code/modules/clothing/spacesuits/rig/modules/combat.dm b/code/modules/clothing/spacesuits/rig/modules/combat.dm
index b8e3db68846..efb4ac97f1c 100644
--- a/code/modules/clothing/spacesuits/rig/modules/combat.dm
+++ b/code/modules/clothing/spacesuits/rig/modules/combat.dm
@@ -155,7 +155,7 @@
name = "mounted energy gun"
desc = "A forearm-mounted energy projector."
icon_state = "egun"
- construction_cost= list(DEFAULT_WALL_MATERIAL = 7000, MATERIAL_GLASS = 2250, MATERIAL_URANIUM = 3250, MATERIAL_GOLD = 2500)
+ construction_cost= list(MATERIAL_STEEL = 7000, MATERIAL_GLASS = 2250, MATERIAL_URANIUM = 3250, MATERIAL_GOLD = 2500)
construction_time = 300
suit_overlay_active = "mounted-lascannon"
@@ -171,7 +171,7 @@
name = "mounted taser"
desc = "A palm-mounted nonlethal energy projector."
icon_state = "taser"
- construction_cost = list(DEFAULT_WALL_MATERIAL = 7000, MATERIAL_GLASS = 5250)
+ construction_cost = list(MATERIAL_STEEL = 7000, MATERIAL_GLASS = 5250)
construction_time = 300
suit_overlay_active = "mounted-taser"
@@ -261,7 +261,7 @@
interface_name = "plasma cutter"
interface_desc = "A self-sustaining plasma arc capable of cutting through walls."
suit_overlay_active = "mounted-plasmacutter"
- construction_cost = list(MATERIAL_GLASS = 5250, DEFAULT_WALL_MATERIAL = 30000, MATERIAL_SILVER = 5250, MATERIAL_PHORON = 7250)
+ construction_cost = list(MATERIAL_GLASS = 5250, MATERIAL_STEEL = 30000, MATERIAL_SILVER = 5250, MATERIAL_PHORON = 7250)
activates_on_touch = TRUE
construction_time = 300
use_power_cost = 15
diff --git a/code/modules/clothing/spacesuits/rig/modules/computer.dm b/code/modules/clothing/spacesuits/rig/modules/computer.dm
index c48572fcd67..579f97bcdf7 100644
--- a/code/modules/clothing/spacesuits/rig/modules/computer.dm
+++ b/code/modules/clothing/spacesuits/rig/modules/computer.dm
@@ -33,7 +33,7 @@
activates_on_touch = TRUE
confined_use = TRUE
- construction_cost = list(DEFAULT_WALL_MATERIAL = 5000, MATERIAL_GLASS = 7500)
+ construction_cost = list(MATERIAL_STEEL = 5000, MATERIAL_GLASS = 7500)
construction_time = 300
engage_string = "Eject AI"
@@ -356,7 +356,7 @@
activates_on_touch = TRUE
disruptive = FALSE
- construction_cost = list(DEFAULT_WALL_MATERIAL=10000, MATERIAL_GOLD =2000, MATERIAL_SILVER =3000, MATERIAL_GLASS =2000)
+ construction_cost = list(MATERIAL_STEEL=10000, MATERIAL_GOLD =2000, MATERIAL_SILVER =3000, MATERIAL_GLASS =2000)
construction_time = 500
activate_string = "Enable Power Sink"
diff --git a/code/modules/clothing/spacesuits/rig/modules/modules.dm b/code/modules/clothing/spacesuits/rig/modules/modules.dm
index 460319ab452..489a42f9c5a 100644
--- a/code/modules/clothing/spacesuits/rig/modules/modules.dm
+++ b/code/modules/clothing/spacesuits/rig/modules/modules.dm
@@ -13,10 +13,10 @@
desc = "It looks pretty sciency."
icon = 'icons/obj/rig_modules.dmi'
icon_state = "generic"
- matter = list(DEFAULT_WALL_MATERIAL = 20000, MATERIAL_PLASTIC = 30000, MATERIAL_GLASS = 5000)
+ matter = list(MATERIAL_STEEL = 20000, MATERIAL_PLASTIC = 30000, MATERIAL_GLASS = 5000)
/// This is literally never read anywhere. All construction cost info lives within the /design. Due for removal.
- var/list/construction_cost = list(DEFAULT_WALL_MATERIAL=7000, MATERIAL_GLASS =7000)
+ var/list/construction_cost = list(MATERIAL_STEEL=7000, MATERIAL_GLASS =7000)
/// This is literally never read anywhere. All construction cost info lives within the /design. Due for removal.
var/construction_time = 100
diff --git a/code/modules/clothing/spacesuits/rig/modules/utility.dm b/code/modules/clothing/spacesuits/rig/modules/utility.dm
index 6d76f923b3d..b472928ddf7 100644
--- a/code/modules/clothing/spacesuits/rig/modules/utility.dm
+++ b/code/modules/clothing/spacesuits/rig/modules/utility.dm
@@ -57,7 +57,7 @@
icon_state = "scanner"
interface_name = "health scanner"
interface_desc = "Shows an informative health readout when used on a subject."
- construction_cost = list("$glass" = 5250, DEFAULT_WALL_MATERIAL = 2500)
+ construction_cost = list(MATERIAL_GLASS = 5250, MATERIAL_STEEL = 2500)
construction_time = 300
engage_string = "Run Diagnostic"
@@ -89,7 +89,7 @@
interface_desc = "A diamond-tipped industrial drill."
suit_overlay_active = "mounted-drill"
use_power_cost = 0.2
- construction_cost = list(DEFAULT_WALL_MATERIAL = 55000, MATERIAL_GLASS = 2250, MATERIAL_SILVER = 5250, MATERIAL_DIAMOND = 3750)
+ construction_cost = list(MATERIAL_STEEL = 55000, MATERIAL_GLASS = 2250, MATERIAL_SILVER = 5250, MATERIAL_DIAMOND = 3750)
construction_time = 350
device_type = /obj/item/pickaxe/diamonddrill
@@ -140,7 +140,7 @@
interface_desc = "A device for building or removing walls. Cell-powered."
module_type = MODULETYPE_USABLE_ACTIVE
engage_string = "Configure RFD-C"
- construction_cost = list(DEFAULT_WALL_MATERIAL = 30000, MATERIAL_PHORON = 12500, MATERIAL_SILVER = 10000, MATERIAL_GOLD = 10000)
+ construction_cost = list(MATERIAL_STEEL = 30000, MATERIAL_PHORON = 12500, MATERIAL_SILVER = 10000, MATERIAL_GOLD = 10000)
construction_time = 1000
device_type = /obj/item/rfd/construction/mounted
@@ -201,7 +201,7 @@
module_type = MODULETYPE_USABLE_ACTIVE
disruptive = TRUE
confined_use = TRUE
- construction_cost = list(DEFAULT_WALL_MATERIAL=10000, MATERIAL_GLASS =9250, MATERIAL_GOLD =2500, MATERIAL_SILVER =4250,"phoron"=5500)
+ construction_cost = list(MATERIAL_STEEL=10000, MATERIAL_GLASS =9250, MATERIAL_GOLD =2500, MATERIAL_SILVER =4250, MATERIAL_PHORON=5500)
construction_time = 400
engage_string = "Inject"
@@ -374,7 +374,7 @@
name = "mounted chemical injector"
desc = "A complex web of tubing and a large needle suitable for hardsuit use."
module_type = MODULETYPE_USABLE_ACTIVE
- construction_cost = list(DEFAULT_WALL_MATERIAL = 10000, MATERIAL_GLASS = 9250, MATERIAL_GOLD = 2500, MATERIAL_SILVER = 4250, MATERIAL_PHORON = 5500)
+ construction_cost = list(MATERIAL_STEEL = 10000, MATERIAL_GLASS = 9250, MATERIAL_GOLD = 2500, MATERIAL_SILVER = 4250, MATERIAL_PHORON = 5500)
construction_time = 400
interface_name = "mounted chem injector"
@@ -474,7 +474,7 @@
icon_state = "thrusters"
module_type = MODULETYPE_TOGGLE
disruptive = FALSE
- construction_cost = list(DEFAULT_WALL_MATERIAL = 15000, MATERIAL_GLASS = 4250, MATERIAL_SILVER = 4250, MATERIAL_URANIUM = 5250)
+ construction_cost = list(MATERIAL_STEEL = 15000, MATERIAL_GLASS = 4250, MATERIAL_SILVER = 4250, MATERIAL_URANIUM = 5250)
construction_time = 300
interface_name = "maneuvering jets"
@@ -617,7 +617,7 @@
interface_name = "leg actuators"
interface_desc = "Allows you to fall from heights and dash up to 4 tiles at once. To jump onto ledges, stand adjacent and facing a climbable wall (one with a walkable turf above it), then target your own turf to rapidly climb to the turf above!"
- construction_cost = list(DEFAULT_WALL_MATERIAL=15000, MATERIAL_GLASS = 1250, MATERIAL_SILVER =5250)
+ construction_cost = list(MATERIAL_STEEL=15000, MATERIAL_GLASS = 1250, MATERIAL_SILVER =5250)
construction_time = 300
disruptive = FALSE
diff --git a/code/modules/clothing/spacesuits/rig/modules/vision.dm b/code/modules/clothing/spacesuits/rig/modules/vision.dm
index 01922a2595d..095c43f3d48 100644
--- a/code/modules/clothing/spacesuits/rig/modules/vision.dm
+++ b/code/modules/clothing/spacesuits/rig/modules/vision.dm
@@ -165,7 +165,7 @@
desc = "A layered, translucent visor system for a hardsuit."
icon_state = "meson"
- construction_cost = list(DEFAULT_WALL_MATERIAL = 1500, MATERIAL_GLASS = 5000)
+ construction_cost = list(MATERIAL_STEEL = 1500, MATERIAL_GLASS = 5000)
construction_time = 300
active_power_cost = 2
@@ -197,7 +197,7 @@
desc = "A multi input night vision system for a hardsuit."
icon_state = "night"
- construction_cost = list(DEFAULT_WALL_MATERIAL = 1500, MATERIAL_GLASS = 5000, MATERIAL_URANIUM = 5000)
+ construction_cost = list(MATERIAL_STEEL = 1500, MATERIAL_GLASS = 5000, MATERIAL_URANIUM = 5000)
construction_time = 300
active_power_cost = 2
@@ -214,7 +214,7 @@
desc = "A simple tactical information system for a hardsuit."
icon_state = "securityhud"
- construction_cost = list(DEFAULT_WALL_MATERIAL = 1500, MATERIAL_GLASS = 5000)
+ construction_cost = list(MATERIAL_STEEL = 1500, MATERIAL_GLASS = 5000)
construction_time = 300
interface_name = "security HUD"
@@ -229,7 +229,7 @@
desc = "A simple medical status indicator for a hardsuit."
icon_state = "healthhud"
- construction_cost = list(DEFAULT_WALL_MATERIAL = 1500, MATERIAL_GLASS = 5000)
+ construction_cost = list(MATERIAL_STEEL = 1500, MATERIAL_GLASS = 5000)
construction_time = 300
interface_name = "medical HUD"
diff --git a/code/modules/cooking/machinery/cooking_machines/container.dm b/code/modules/cooking/machinery/cooking_machines/container.dm
index f70fe1ab2c4..963808d409c 100644
--- a/code/modules/cooking/machinery/cooking_machines/container.dm
+++ b/code/modules/cooking/machinery/cooking_machines/container.dm
@@ -184,7 +184,7 @@
/obj/item/reagent_containers/cooking_container/skillet/Initialize(var/mapload, var/mat_key)
. = ..(mapload)
- var/singleton/material/material = GET_SINGLETON(mat_key || MATERIAL_STEEL)
+ var/singleton/material/material = SSmaterials.get_material_by_id(mat_key || MATERIAL_STEEL)
if(!material)
return
if(material.type != MATERIAL_STEEL)
@@ -205,7 +205,7 @@
/obj/item/reagent_containers/cooking_container/saucepan/Initialize(var/mapload, var/mat_key)
. = ..(mapload)
- var/singleton/material/material = GET_SINGLETON(mat_key || MATERIAL_STEEL)
+ var/singleton/material/material = SSmaterials.get_material_by_id(mat_key || MATERIAL_STEEL)
if(!material)
return
if(material.type != MATERIAL_STEEL)
@@ -227,7 +227,7 @@
/obj/item/reagent_containers/cooking_container/pot/Initialize(mapload, mat_key)
. = ..(mapload)
- var/singleton/material/material = GET_SINGLETON(mat_key || MATERIAL_STEEL)
+ var/singleton/material/material = SSmaterials.get_material_by_id(mat_key || MATERIAL_STEEL)
if(!material)
return
if(mat_key && mat_key != MATERIAL_STEEL)
@@ -342,7 +342,7 @@
filling_states = "-10;10;25;50;75;80;100"
center_of_mass = list("x" = 17,"y" = 7)
max_space = 30
- matter = list(DEFAULT_WALL_MATERIAL = 300)
+ matter = list(MATERIAL_STEEL = 300)
volume = 180
amount_per_transfer_from_this = 10
possible_transfer_amounts = list(5,10,15,25,30,60,180)
diff --git a/code/modules/cooking/trays.dm b/code/modules/cooking/trays.dm
index cbfb6914e01..1c0cda28d47 100644
--- a/code/modules/cooking/trays.dm
+++ b/code/modules/cooking/trays.dm
@@ -18,7 +18,7 @@
throw_range = 5
w_class = 3.0
obj_flags = OBJ_FLAG_CONDUCTABLE
- matter = list(DEFAULT_WALL_MATERIAL = 3000)
+ matter = list(MATERIAL_STEEL = 3000)
recyclable = TRUE
hitsound = SFX_BOTTLE_HIT_BROKEN
drop_sound = SFX_BOTTLE_HIT_BROKEN
diff --git a/code/modules/custom_ka/core.dm b/code/modules/custom_ka/core.dm
index 76c2d024ee8..c3fe810d424 100644
--- a/code/modules/custom_ka/core.dm
+++ b/code/modules/custom_ka/core.dm
@@ -9,7 +9,7 @@
contained_sprite = 1
obj_flags = OBJ_FLAG_CONDUCTABLE
slot_flags = SLOT_BELT
- matter = list(DEFAULT_WALL_MATERIAL = 2000)
+ matter = list(MATERIAL_STEEL = 2000)
w_class = WEIGHT_CLASS_NORMAL
origin_tech = list(TECH_MATERIAL = 2,TECH_ENGINEERING = 2)
diff --git a/code/modules/detectivework/tools/uvlight.dm b/code/modules/detectivework/tools/uvlight.dm
index 181d3a2dfd2..569e31c0cda 100644
--- a/code/modules/detectivework/tools/uvlight.dm
+++ b/code/modules/detectivework/tools/uvlight.dm
@@ -6,7 +6,7 @@
item_state = "electronic"
slot_flags = SLOT_BELT
w_class = WEIGHT_CLASS_SMALL
- matter = list(DEFAULT_WALL_MATERIAL = 150)
+ matter = list(MATERIAL_STEEL = 150)
origin_tech = list(TECH_MAGNET = 1, TECH_ENGINEERING = 1)
var/list/scanned = list()
var/list/stored_alpha = list()
diff --git a/code/modules/effects/map_effects/portal.dm b/code/modules/effects/map_effects/portal.dm
index 15c2f5d59ad..87699af4ec7 100644
--- a/code/modules/effects/map_effects/portal.dm
+++ b/code/modules/effects/map_effects/portal.dm
@@ -179,8 +179,15 @@ when portals are shortly lived, or when portals are made to be obvious with spec
// Connects both sides of a portal together.
/obj/effect/map_effect/portal/master/proc/find_counterparts()
+ var/list/invalid_portal_masters
for(var/thing in GLOB.all_portal_masters)
+ if(!istype(thing, /obj/effect/map_effect/portal/master))
+ LAZYADD(invalid_portal_masters, thing)
+ continue
var/obj/effect/map_effect/portal/master/M = thing
+ if(QDELETED(M))
+ LAZYADD(invalid_portal_masters, thing)
+ continue
if(M == src)
continue
if(M.counterpart)
@@ -197,6 +204,9 @@ when portals are shortly lived, or when portals are made to be obvious with spec
their_line.counterpart = our_line
break
+ if(invalid_portal_masters)
+ GLOB.all_portal_masters -= invalid_portal_masters
+
if(!counterpart)
crash_with("Portal master [type] ([x],[y],[z]) could not find another portal master with a matching portal_id ([portal_id]).")
diff --git a/code/modules/heavy_vehicle/components/_components.dm b/code/modules/heavy_vehicle/components/_components.dm
index bf3ac8791f5..2aa5239d741 100644
--- a/code/modules/heavy_vehicle/components/_components.dm
+++ b/code/modules/heavy_vehicle/components/_components.dm
@@ -16,7 +16,7 @@
var/damage_state = 1
var/list/has_hardpoints = list()
var/power_use = 0
- matter = list(DEFAULT_WALL_MATERIAL = 15000, MATERIAL_PLASTIC = 1000, MATERIAL_OSMIUM = 500)
+ matter = list(MATERIAL_STEEL = 15000, MATERIAL_PLASTIC = 1000, MATERIAL_OSMIUM = 500)
dir = SOUTH
/// Half of the baseline chance that attempting to use these arms will create sparks. Actual chance is twice this since the motivator damage contributes to the ratio.
diff --git a/code/modules/heavy_vehicle/components/frame.dm b/code/modules/heavy_vehicle/components/frame.dm
index 7948d669bcb..55292c23cdb 100644
--- a/code/modules/heavy_vehicle/components/frame.dm
+++ b/code/modules/heavy_vehicle/components/frame.dm
@@ -1,5 +1,5 @@
/obj/item/frame_holder
- matter = list(DEFAULT_WALL_MATERIAL = 65000, MATERIAL_PLASTIC = 10000, MATERIAL_OSMIUM = 10000)
+ matter = list(MATERIAL_STEEL = 65000, MATERIAL_PLASTIC = 10000, MATERIAL_OSMIUM = 10000)
/obj/item/frame_holder/Initialize(mapload, var/newloc)
..()
diff --git a/code/modules/heavy_vehicle/equipment/_equipment.dm b/code/modules/heavy_vehicle/equipment/_equipment.dm
index edee00efdef..1737135917a 100644
--- a/code/modules/heavy_vehicle/equipment/_equipment.dm
+++ b/code/modules/heavy_vehicle/equipment/_equipment.dm
@@ -5,7 +5,7 @@
icon = 'icons/mecha/mech_equipment.dmi'
icon_state = ""
var/on_mech_icon_state
- matter = list(DEFAULT_WALL_MATERIAL = 10000, MATERIAL_PLASTIC = 5000, MATERIAL_OSMIUM = 500)
+ matter = list(MATERIAL_STEEL = 10000, MATERIAL_PLASTIC = 5000, MATERIAL_OSMIUM = 500)
force = 15
var/restricted_hardpoints
var/mob/living/heavy_vehicle/owner
diff --git a/code/modules/hydroponics/trays/tray_tools.dm b/code/modules/hydroponics/trays/tray_tools.dm
index e3d78cce700..27dc353a7ff 100644
--- a/code/modules/hydroponics/trays/tray_tools.dm
+++ b/code/modules/hydroponics/trays/tray_tools.dm
@@ -30,7 +30,7 @@
item_state = "hydro"
var/form_title
var/last_data
- matter = list(DEFAULT_WALL_MATERIAL = 80, MATERIAL_GLASS = 20)
+ matter = list(MATERIAL_STEEL = 80, MATERIAL_GLASS = 20)
origin_tech = list(TECH_MAGNET = 1, TECH_BIO = 1)
/obj/item/analyzer/plant_analyzer/proc/print_report_verb()
diff --git a/code/modules/item_worth/Value_procs/obj/items.dm b/code/modules/item_worth/Value_procs/obj/items.dm
index fbeb6aa5375..73f8f650a52 100644
--- a/code/modules/item_worth/Value_procs/obj/items.dm
+++ b/code/modules/item_worth/Value_procs/obj/items.dm
@@ -23,7 +23,7 @@
return material.value * amount
/obj/item/ore/Value()
- var/singleton/material/mat = GET_SINGLETON(material)
+ var/singleton/material/mat = SSmaterials.get_material_by_id(material)
if(mat)
return mat.value
return 0
diff --git a/code/modules/materials/material_sheets.dm b/code/modules/materials/material_sheets.dm
index 8dcca387c45..0041e26f242 100644
--- a/code/modules/materials/material_sheets.dm
+++ b/code/modules/materials/material_sheets.dm
@@ -1,4 +1,4 @@
-// Stacked resources. They use a material datum for a lot of inherited values.
+/// Stacked resources. They use a material datum for a lot of inherited values.
/obj/item/stack/material
force = 11
throwforce = 5
@@ -6,7 +6,8 @@
throw_speed = 3
throw_range = 3
max_amount = 50
- recyclable = TRUE // Pretty much all materials should be recyclable
+ /// Pretty much all materials should be recyclable
+ recyclable = TRUE
var/default_type = MATERIAL_STEEL
var/singleton/material/material
@@ -26,7 +27,7 @@
if(!default_type)
default_type = MATERIAL_STEEL
- material = GET_SINGLETON(default_type)
+ material = SSmaterials.get_material_by_id(default_type)
if(!material)
return INITIALIZE_HINT_QDEL
@@ -283,7 +284,7 @@
update_icon()
/obj/item/stack/material/steel
- name = DEFAULT_WALL_MATERIAL
+ name = "steel"
icon_state = "sheet-metal"
default_type = MATERIAL_STEEL
icon_has_variants = TRUE
diff --git a/code/modules/materials/materials.dm b/code/modules/materials/materials.dm
index 4159a3f67e1..342e8c5c02d 100644
--- a/code/modules/materials/materials.dm
+++ b/code/modules/materials/materials.dm
@@ -250,10 +250,13 @@
/singleton/material/proc/get_matter()
var/list/temp_matter = list()
if(islist(composite_material))
- for(var/material_string in composite_material)
- temp_matter[material_string] = composite_material[material_string]
+ for(var/material_id in composite_material)
+ var/material_path = SSmaterials.material_to_path(material_id, FALSE)
+ if(!material_path)
+ material_path = material_id
+ temp_matter[material_path] = (temp_matter[material_path] || 0) + composite_material[material_id]
else
- temp_matter[name] = SHEET_MATERIAL_AMOUNT
+ temp_matter[type] = SHEET_MATERIAL_AMOUNT
return temp_matter
// As above.
@@ -533,7 +536,7 @@
protectiveness = 20 // 50%
conductivity = 10
stack_origin_tech = list(TECH_MATERIAL = 2)
- composite_material = list(DEFAULT_WALL_MATERIAL = 3750, "platinum" = 3750) //todo
+ composite_material = list(MATERIAL_STEEL = 3750, MATERIAL_PLATINUM = 3750) //todo
golem = SPECIES_GOLEM_PLASTEEL
hitsound = 'sound/weapons/smash.ogg'
weapon_hitsound = 'sound/weapons/metalhit.ogg'
@@ -662,7 +665,7 @@
hardness = 40
weight = 30
stack_origin_tech = list(TECH_MATERIAL = 2)
- composite_material = list(DEFAULT_WALL_MATERIAL = 1875, MATERIAL_GLASS = 3750)
+ composite_material = list(MATERIAL_STEEL = 1875, MATERIAL_GLASS = 3750)
window_options = list()
created_window = null
wire_product = null
@@ -682,7 +685,7 @@
weight = 30
value = 2
stack_origin_tech = list(TECH_MATERIAL = 2)
- composite_material = list(DEFAULT_WALL_MATERIAL = 1875, MATERIAL_GLASS = 3750)
+ composite_material = list(MATERIAL_STEEL = 1875, MATERIAL_GLASS = 3750)
window_options = list("One Direction" = 1, "Full Window" = 4, "Windoor" = 5)
created_window = /obj/structure/window/reinforced
wire_product = null
diff --git a/code/modules/mining/alloys.dm b/code/modules/mining/alloys.dm
index 0166c13919e..c61fbcc4616 100644
--- a/code/modules/mining/alloys.dm
+++ b/code/modules/mining/alloys.dm
@@ -1,6 +1,7 @@
-//Alloys that contain subsets of each other's ingredients must be ordered in the desired sequence
-//eg. steel comes after plasteel because plasteel's ingredients contain the ingredients for steel and
-//it would be impossible to produce.
+/// MATERIALS-REWORK-TODO
+/// /// Alloys that contain subsets of each other's ingredients must be ordered in the desired sequence
+/// eg. steel comes after plasteel because plasteel's ingredients contain the ingredients for steel and
+/// it would be impossible to produce.
/datum/alloy
var/list/requires
@@ -19,7 +20,7 @@
product = /obj/item/stack/material/plasteel
/datum/alloy/steel
- metaltag = DEFAULT_WALL_MATERIAL
+ metaltag = "steel"
requires = list(
ORE_COAL = 1,
ORE_IRON = 1
diff --git a/code/modules/mining/drilling/scanner.dm b/code/modules/mining/drilling/scanner.dm
index 9c53c4e0fda..3fbe25f1735 100644
--- a/code/modules/mining/drilling/scanner.dm
+++ b/code/modules/mining/drilling/scanner.dm
@@ -6,7 +6,7 @@
item_state = "manual_mining"
contained_sprite = TRUE
origin_tech = list(TECH_MAGNET = 1, TECH_ENGINEERING = 1)
- matter = list(DEFAULT_WALL_MATERIAL = 150)
+ matter = list(MATERIAL_STEEL = 150)
/obj/item/mining_scanner/attack_self(mob/user)
to_chat(user, SPAN_NOTICE("You begin sweeping \the [src] about, scanning for metal deposits."))
diff --git a/code/modules/mining/mine_items.dm b/code/modules/mining/mine_items.dm
index 7b967ace984..689957bf9c4 100644
--- a/code/modules/mining/mine_items.dm
+++ b/code/modules/mining/mine_items.dm
@@ -15,7 +15,7 @@
throwforce = 4.0
force = 15
w_class = WEIGHT_CLASS_BULKY
- matter = list(DEFAULT_WALL_MATERIAL = 3750)
+ matter = list(MATERIAL_STEEL = 3750)
var/digspeed //moving the delay to an item var so R&D can make improved picks. --NEO
origin_tech = list(TECH_MATERIAL = 1, TECH_ENGINEERING = 1)
attack_verb = list("hit", "pierced", "sliced", "attacked")
@@ -331,7 +331,7 @@
throwforce = 4.0
w_class = WEIGHT_CLASS_NORMAL
origin_tech = list(TECH_MATERIAL = 1, TECH_ENGINEERING = 1)
- matter = list(DEFAULT_WALL_MATERIAL = 50)
+ matter = list(MATERIAL_STEEL = 50)
attack_verb = list("bashed", "bludgeoned", "thrashed", "whacked")
sharp = FALSE
edge = TRUE
@@ -621,7 +621,7 @@
item_state = "electronic"
throw_speed = 4
throw_range = 20
- matter = list(DEFAULT_WALL_MATERIAL = 500)
+ matter = list(MATERIAL_STEEL = 500)
var/turf/simulated/mineral/random/sonar
var/active = 0
@@ -933,13 +933,26 @@ GLOBAL_LIST_INIT_TYPED(total_extraction_beacons, /obj/structure/extraction_point
if(A.anchored)
return
var/turf/T = get_turf(A)
+ if(!T)
+ return
+ var/list/invalid_inhibitors
for(var/found_inhibitor in GLOB.bluespace_inhibitors)
+ if(!istype(found_inhibitor, /obj/structure/machinery/anti_bluespace))
+ LAZYADD(invalid_inhibitors, found_inhibitor)
+ continue
var/obj/structure/machinery/anti_bluespace/AB = found_inhibitor
+ if(QDELETED(AB))
+ LAZYADD(invalid_inhibitors, found_inhibitor)
+ continue
if(T.z != AB.z || get_dist(T, AB) > 8 || (AB.stat & (NOPOWER | BROKEN)))
continue
AB.use_power_oneoff(AB.active_power_usage)
to_chat(user, SPAN_WARNING("A nearby bluespace inhibitor interferes with \the [src]!"))
+ if(invalid_inhibitors)
+ GLOB.bluespace_inhibitors -= invalid_inhibitors
return
+ if(invalid_inhibitors)
+ GLOB.bluespace_inhibitors -= invalid_inhibitors
to_chat(user, SPAN_NOTICE("You start attaching the pack to \the [A]..."))
if(do_after(user,50))
to_chat(user, SPAN_NOTICE("You attach the pack to \the [A] and activate it."))
diff --git a/code/modules/mining/mint.dm b/code/modules/mining/mint.dm
index edc56564cc0..5d661d43808 100644
--- a/code/modules/mining/mint.dm
+++ b/code/modules/mining/mint.dm
@@ -1,21 +1,21 @@
-/**********************Mint**************************/
-
-
+/// This is 2011 code. Treat warily.
/obj/structure/machinery/mineral/mint
name = "coin press"
icon = 'icons/obj/stationobjs.dmi'
icon_state = "coinpress0"
density = TRUE
anchored = TRUE
- var/amt_silver = 0 //amount of silver
- var/amt_gold = 0 //amount of gold
+ var/amt_silver = 0
+ var/amt_gold = 0
var/amt_diamond = 0
var/amt_iron = 0
var/amt_phoron = 0
var/amt_uranium = 0
- var/newCoins = 0 //how many coins the machine made in it's last load
+ /// How many coins the machine made in its last load.
+ var/newCoins = 0
var/processing = 0
- var/chosen = DEFAULT_WALL_MATERIAL //which material will be used to make coins
+ /// Which material will be used to make coins.
+ var/chosen = MATERIAL_STEEL
var/coinsToProduce = 10
/obj/structure/machinery/mineral/mint/Initialize()
@@ -25,22 +25,23 @@
/obj/structure/machinery/mineral/mint/process()
if(input_turf)
- var/obj/item/stack/O
- O = locate(/obj/item/stack, get_turf(input_turf))
+ var/obj/item/stack/material/O
+ O = locate(/obj/item/stack/material, get_turf(input_turf))
if(O)
var/processed = TRUE
- switch(O.get_material_name())
- if("gold")
+ var/singleton/material/stack_material = O.get_material()
+ switch(stack_material?.type)
+ if(MATERIAL_GOLD)
amt_gold += 100 * O.get_amount()
- if("silver")
+ if(MATERIAL_SILVER)
amt_silver += 100 * O.get_amount()
- if("diamond")
+ if(MATERIAL_DIAMOND)
amt_diamond += 100 * O.get_amount()
- if("phoron")
+ if(MATERIAL_PHORON)
amt_phoron += 100 * O.get_amount()
- if("uranium")
+ if(MATERIAL_URANIUM)
amt_uranium += 100 * O.get_amount()
- if("steel")
+ if(MATERIAL_STEEL)
amt_iron += 100 * O.get_amount()
else
processed = FALSE
@@ -58,37 +59,37 @@
dat += "NOT CONNECTED
"
dat += "
Gold inserted: [amt_gold] "
- if(chosen == "gold")
+ if(chosen == MATERIAL_GOLD)
dat += "chosen"
else
dat += "Choose"
dat += "
Silver inserted: [amt_silver] "
- if(chosen == "silver")
+ if(chosen == MATERIAL_SILVER)
dat += "chosen"
else
dat += "Choose"
dat += "
Iron inserted: [amt_iron] "
- if(chosen == DEFAULT_WALL_MATERIAL)
+ if(chosen == MATERIAL_STEEL)
dat += "chosen"
else
dat += "Choose"
dat += "
Diamond inserted: [amt_diamond] "
- if(chosen == "diamond")
+ if(chosen == MATERIAL_DIAMOND)
dat += "chosen"
else
dat += "Choose"
dat += "
Phoron inserted: [amt_phoron] "
- if(chosen == "phoron")
+ if(chosen == MATERIAL_PHORON)
dat += "chosen"
else
dat += "Choose"
dat += "
Uranium inserted: [amt_uranium] "
- if(chosen == "uranium")
+ if(chosen == MATERIAL_URANIUM)
dat += "chosen"
else
dat += "Choose"
- dat += "
Will produce [coinsToProduce] [chosen] coins if enough materials are available.
"
+ dat += "
Will produce [coinsToProduce] [lowertext(SSmaterials.material_display_name(chosen))] coins if enough materials are available.
"
dat += "-10 "
dat += "-5 "
dat += "-1 "
@@ -109,7 +110,19 @@
to_chat(usr, SPAN_WARNING("The machine is busy processing."))
return
if(href_list["choose"])
- chosen = href_list["choose"]
+ switch(href_list["choose"])
+ if("gold")
+ chosen = MATERIAL_GOLD
+ if("silver")
+ chosen = MATERIAL_SILVER
+ if("steel")
+ chosen = MATERIAL_STEEL
+ if("diamond")
+ chosen = MATERIAL_DIAMOND
+ if("phoron")
+ chosen = MATERIAL_PHORON
+ if("uranium")
+ chosen = MATERIAL_URANIUM
if(href_list["chooseAmt"])
coinsToProduce = between(0, coinsToProduce + text2num(href_list["chooseAmt"]), 1000)
if(href_list["makeCoins"])
@@ -119,7 +132,7 @@
icon_state = "coinpress1"
var/obj/item/storage/bag/money/M
switch(chosen)
- if(DEFAULT_WALL_MATERIAL)
+ if(MATERIAL_STEEL)
while(amt_iron && coinsToProduce)
if(locate(/obj/item/storage/bag/money, get_turf(output_turf)))
M = locate(/obj/item/storage/bag/money, get_turf(output_turf))
@@ -131,7 +144,7 @@
newCoins++
src.updateUsrDialog()
sleep(5)
- if("gold")
+ if(MATERIAL_GOLD)
while(amt_gold && coinsToProduce)
if(locate(/obj/item/storage/bag/money, get_turf(output_turf)))
M = locate(/obj/item/storage/bag/money, get_turf(output_turf))
@@ -143,7 +156,7 @@
newCoins++
src.updateUsrDialog()
sleep(5)
- if("silver")
+ if(MATERIAL_SILVER)
while(amt_silver && coinsToProduce)
if(locate(/obj/item/storage/bag/money, get_turf(output_turf)))
M = locate(/obj/item/storage/bag/money, get_turf(output_turf))
@@ -155,7 +168,7 @@
newCoins++
src.updateUsrDialog()
sleep(5)
- if("diamond")
+ if(MATERIAL_DIAMOND)
while(amt_diamond && coinsToProduce)
if(locate(/obj/item/storage/bag/money, get_turf(output_turf)))
M = locate(/obj/item/storage/bag/money, get_turf(output_turf))
@@ -167,7 +180,7 @@
newCoins++
src.updateUsrDialog()
sleep(5)
- if("phoron")
+ if(MATERIAL_PHORON)
while(amt_phoron && coinsToProduce)
if(locate(/obj/item/storage/bag/money, get_turf(output_turf)))
M = locate(/obj/item/storage/bag/money, get_turf(output_turf))
@@ -179,7 +192,7 @@
newCoins++
src.updateUsrDialog()
sleep(5)
- if("uranium")
+ if(MATERIAL_URANIUM)
while(amt_uranium && coinsToProduce)
if(locate(/obj/item/storage/bag/money, get_turf(output_turf)))
M = locate(/obj/item/storage/bag/money, get_turf(output_turf))
diff --git a/code/modules/mob/living/silicon/robot/analyzer.dm b/code/modules/mob/living/silicon/robot/analyzer.dm
index 272001219ed..fe5cc3a8415 100644
--- a/code/modules/mob/living/silicon/robot/analyzer.dm
+++ b/code/modules/mob/living/silicon/robot/analyzer.dm
@@ -16,7 +16,7 @@
throw_speed = 5
throw_range = 10
origin_tech = list(TECH_MAGNET = 2, TECH_BIO = 1, TECH_ENGINEERING = 2)
- matter = list(DEFAULT_WALL_MATERIAL = 500, MATERIAL_GLASS = 200)
+ matter = list(MATERIAL_STEEL = 500, MATERIAL_GLASS = 200)
/obj/item/robotanalyzer/attack(mob/living/target_mob, mob/living/user, target_zone)
robotic_analyze_mob(target_mob, user)
diff --git a/code/modules/paperwork/handlabeler.dm b/code/modules/paperwork/handlabeler.dm
index 4e6684977af..bae90459fd5 100644
--- a/code/modules/paperwork/handlabeler.dm
+++ b/code/modules/paperwork/handlabeler.dm
@@ -36,7 +36,7 @@
var/label = null
var/labels_left = 30
var/mode = 0 //off or on.
- matter = list(DEFAULT_WALL_MATERIAL = 120, MATERIAL_GLASS = 80)
+ matter = list(MATERIAL_STEEL = 120, MATERIAL_GLASS = 80)
/obj/item/hand_labeler/attack(mob/living/target_mob, mob/living/user, target_zone)
return
diff --git a/code/modules/paperwork/pen.dm b/code/modules/paperwork/pen.dm
index 7a06e4ef945..54af515d874 100644
--- a/code/modules/paperwork/pen.dm
+++ b/code/modules/paperwork/pen.dm
@@ -49,7 +49,7 @@
w_class = WEIGHT_CLASS_TINY
throw_speed = 7
throw_range = 15
- matter = list(DEFAULT_WALL_MATERIAL = 10)
+ matter = list(MATERIAL_STEEL = 10)
drop_sound = 'sound/items/drop/accessory.ogg'
pickup_sound = 'sound/items/pickup/accessory.ogg'
diff --git a/code/modules/paperwork/photography.dm b/code/modules/paperwork/photography.dm
index 7e3694eb47f..bdb60275fad 100644
--- a/code/modules/paperwork/photography.dm
+++ b/code/modules/paperwork/photography.dm
@@ -162,7 +162,7 @@ GLOBAL_VAR_INIT(photo_count, 1)
w_class = WEIGHT_CLASS_SMALL
obj_flags = OBJ_FLAG_CONDUCTABLE
slot_flags = SLOT_BELT
- matter = list(DEFAULT_WALL_MATERIAL = 2000)
+ matter = list(MATERIAL_STEEL = 2000)
var/black_white = FALSE
var/pictures_max = 10
var/pictures_left = 10
diff --git a/code/modules/paperwork/stamps.dm b/code/modules/paperwork/stamps.dm
index c0b57d6a609..5c340172b0b 100644
--- a/code/modules/paperwork/stamps.dm
+++ b/code/modules/paperwork/stamps.dm
@@ -8,7 +8,7 @@
w_class = WEIGHT_CLASS_TINY
throw_speed = 7
throw_range = 15
- matter = list(DEFAULT_WALL_MATERIAL = 60)
+ matter = list(MATERIAL_STEEL = 60)
attack_verb = list("stamped")
/obj/item/stamp/captain
diff --git a/code/modules/power/cable.dm b/code/modules/power/cable.dm
index e21de4e0216..536008c6eea 100644
--- a/code/modules/power/cable.dm
+++ b/code/modules/power/cable.dm
@@ -504,7 +504,7 @@ By design, d1 is the smallest direction and d2 is the highest
w_class = WEIGHT_CLASS_SMALL
throw_speed = 2
throw_range = 5
- matter = list(DEFAULT_WALL_MATERIAL = 50, MATERIAL_GLASS = 20, MATERIAL_PHORON = 3)
+ matter = list(MATERIAL_STEEL = 50, MATERIAL_GLASS = 20, MATERIAL_PHORON = 3)
recyclable = TRUE
obj_flags = OBJ_FLAG_CONDUCTABLE
item_flags = ITEM_FLAG_HELD_MAP_TEXT
diff --git a/code/modules/power/fusion/fuel_assembly/fuel_assembly.dm b/code/modules/power/fusion/fuel_assembly/fuel_assembly.dm
index 85a3ee0bb0c..20e50c426a2 100644
--- a/code/modules/power/fusion/fuel_assembly/fuel_assembly.dm
+++ b/code/modules/power/fusion/fuel_assembly/fuel_assembly.dm
@@ -21,14 +21,15 @@
/obj/item/fuel_assembly/Initialize()
. = ..()
- if(ispath(fuel_type, /singleton/reagent))
+ if(ispath(fuel_type) && ispath(fuel_type, /singleton/reagent))
var/singleton/reagent/R = GET_SINGLETON(fuel_type)
fuel_type = lowertext(initial(R.name))
fuel_colour = initial(R.color)
initial_amount = 50000
- var/singleton/material/material = GET_SINGLETON(fuel_type)
+ var/singleton/material/material = SSmaterials.get_material_by_id(fuel_type, FALSE)
if(istype(material))
+ material_name = material.type
initial_amount = SHEET_MATERIAL_AMOUNT * 5 // Fuel compressor eats 5 sheets.
name = "[material.use_name] fuel rod assembly"
desc = "A fuel rod for a fusion reactor. This one is made from [material.use_name]."
diff --git a/code/modules/power/fusion/fuel_assembly/fuel_compressor.dm b/code/modules/power/fusion/fuel_assembly/fuel_compressor.dm
index dccd415468b..36cb9244244 100644
--- a/code/modules/power/fusion/fuel_assembly/fuel_compressor.dm
+++ b/code/modules/power/fusion/fuel_assembly/fuel_compressor.dm
@@ -48,7 +48,7 @@
if(!M.use(5))
to_chat(user, SPAN_WARNING("You need at least five [mat.sheet_plural_name] to make a fuel rod."))
return
- var/obj/item/fuel_assembly/F = new(get_turf(src), mat.name)
+ var/obj/item/fuel_assembly/F = new(get_turf(src), mat.type)
visible_message(SPAN_NOTICE("\The [src] compresses the [mat.use_name] into a new fuel assembly."))
user.put_in_hands(F)
return 1
diff --git a/code/modules/power/fusion/fuel_assembly/fuel_injector.dm b/code/modules/power/fusion/fuel_assembly/fuel_injector.dm
index 87e020390e0..243c4489e25 100644
--- a/code/modules/power/fusion/fuel_assembly/fuel_injector.dm
+++ b/code/modules/power/fusion/fuel_assembly/fuel_injector.dm
@@ -112,6 +112,7 @@
var/amount = cur_assembly.rod_quantities[reagent] * fuel_usage * injection_rate
if(amount < 1)
amount = 1
+ amount = min(amount, cur_assembly.rod_quantities[reagent])
var/obj/effect/accelerated_particle/A = new/obj/effect/accelerated_particle(get_turf(src), dir)
A.particle_type = reagent
A.additional_particles = amount
@@ -120,7 +121,11 @@
cur_assembly.rod_quantities[reagent] -= amount
amount_left += cur_assembly.rod_quantities[reagent]
if(cur_assembly)
- cur_assembly.percent_depleted = amount_left / cur_assembly.initial_amount
+ if(cur_assembly.initial_amount > 0)
+ cur_assembly.percent_depleted = amount_left / cur_assembly.initial_amount
+ else
+ cur_assembly.percent_depleted = 0
+ StopInjecting()
flick("injector-emitting",src)
else
StopInjecting()
diff --git a/code/modules/power/fusion/fusion_reactions.dm b/code/modules/power/fusion/fusion_reactions.dm
index 85e52766561..a61273069be 100644
--- a/code/modules/power/fusion/fusion_reactions.dm
+++ b/code/modules/power/fusion/fusion_reactions.dm
@@ -324,7 +324,7 @@ GLOBAL_LIST(fusion_reactions)
H.add_hallucinate(rand(100,150))
for(var/obj/structure/machinery/fusion_fuel_injector/I in range(world.view, origin))
- if(I.cur_assembly && I.cur_assembly.fuel_type == MATERIAL_SUPERMATTER)
+ if(I.cur_assembly && I.cur_assembly.material_name == MATERIAL_SUPERMATTER)
explosion(get_turf(I), 6)
if(I && I.loc)
qdel(I)
diff --git a/code/modules/power/fusion/kinetic_harvester.dm b/code/modules/power/fusion/kinetic_harvester.dm
index 7ae8827f253..b589612c296 100644
--- a/code/modules/power/fusion/kinetic_harvester.dm
+++ b/code/modules/power/fusion/kinetic_harvester.dm
@@ -14,7 +14,15 @@
var/obj/structure/machinery/power/fusion_core/harvest_from
/obj/structure/machinery/kinetic_harvester/Initialize()
- can_harvest = list("gold","silver","lead","platinum","uranium","osmium","borosilicate glass")
+ can_harvest = list(
+ MATERIAL_GOLD = TRUE,
+ MATERIAL_SILVER = TRUE,
+ MATERIAL_LEAD = TRUE,
+ MATERIAL_PLATINUM = TRUE,
+ MATERIAL_URANIUM = TRUE,
+ MATERIAL_OSMIUM = TRUE,
+ MATERIAL_GLASS_PHORON = TRUE
+ )
AddComponent(/datum/component/local_network_member, initial_id_tag)
find_core()
queue_icon_update()
@@ -47,6 +55,40 @@
harvest_from = fusion_cores[1]
return harvest_from
+/obj/structure/machinery/kinetic_harvester/proc/get_harvest_material(var/mat)
+ return SSmaterials.get_material_by_id(mat, FALSE)
+
+/obj/structure/machinery/kinetic_harvester/proc/get_harvest_material_path(var/mat)
+ return SSmaterials.material_to_path(mat, FALSE)
+
+/obj/structure/machinery/kinetic_harvester/proc/normalize_harvest_storage()
+ SSmaterials.normalize_material_amounts(stored)
+
+ var/list/normalized_harvesting = list()
+ for(var/mat in harvesting)
+ var/material_path = get_harvest_material_path(mat)
+ if(material_path && can_harvest[material_path])
+ normalized_harvesting[material_path] = TRUE
+ harvesting = normalized_harvesting
+
+/obj/structure/machinery/kinetic_harvester/proc/sync_harvestable_reactants()
+ normalize_harvest_storage()
+ if(!harvest_from || !harvest_from.owned_field)
+ return
+
+ for(var/reactant in harvest_from.owned_field.reactants)
+ var/material_path = get_harvest_material_path(reactant)
+ if(material_path && can_harvest[material_path] && isnull(stored[material_path]))
+ stored[material_path] = 0
+
+/obj/structure/machinery/kinetic_harvester/proc/get_reactant_key(var/material_path)
+ if(!harvest_from || !harvest_from.owned_field || !material_path)
+ return
+
+ for(var/reactant in harvest_from.owned_field.reactants)
+ if(get_harvest_material_path(reactant) == material_path)
+ return reactant
+
/obj/structure/machinery/kinetic_harvester/ui_interact(mob/user, datum/tgui/ui)
if(!harvest_from && !find_core())
@@ -63,16 +105,17 @@
var/datum/component/local_network_member/fusion = GetComponent(/datum/component/local_network_member)
var/datum/local_network/plant = fusion.get_local_network()
var/list/data = list()
+ sync_harvestable_reactants()
data["manufacturer"] = manufacturer
data["id"] = plant ? plant.id_tag : null
data["status"] = (use_power >= POWER_USE_ACTIVE)
data["materials"] = list()
for(var/mat in stored)
- var/singleton/material/material = GET_SINGLETON(mat)
+ var/singleton/material/material = get_harvest_material(mat)
if(material)
var/sheets = FLOOR(stored[mat]/(SHEET_MATERIAL_AMOUNT * 2), 1)
- data["materials"] += list(list("material" = mat, "rawamount" = stored[mat], "amount" = sheets, "harvest" = harvesting[mat]))
+ data["materials"] += list(list("id" = "[material.type]", "material" = SSmaterials.material_display_name(mat), "rawamount" = stored[mat], "amount" = sheets, "harvest" = harvesting[mat]))
return data
/obj/structure/machinery/kinetic_harvester/process()
@@ -81,17 +124,20 @@
if(use_power >= POWER_USE_ACTIVE)
if(harvest_from && harvest_from.owned_field)
+ sync_harvestable_reactants()
for(var/mat in harvest_from.owned_field.reactants)
- if((mat in can_harvest) && !stored[mat])
- stored[mat] = 0
+ var/material_path = get_harvest_material_path(mat)
+ if(material_path && can_harvest[material_path] && isnull(stored[material_path]))
+ stored[material_path] = 0
for(var/mat in harvesting)
- if(mat in can_harvest)
- if(mat in harvest_from.owned_field.reactants)
- var/harvest = min(harvest_from.owned_field.reactants[mat], rand(100,200))
+ if(can_harvest[mat])
+ var/reactant = get_reactant_key(mat)
+ if(!isnull(reactant))
+ var/harvest = min(harvest_from.owned_field.reactants[reactant], rand(100,200))
// Leave a few counts of the reactant to avoid deactivating harvest mode
- harvest_from.owned_field.reactants[mat] -= (harvest - rand(0,5))
- if(harvest_from.owned_field.reactants[mat] <= 0)
- harvest_from.owned_field.reactants -= mat
+ harvest_from.owned_field.reactants[reactant] -= (harvest - rand(0,5))
+ if(harvest_from.owned_field.reactants[reactant] <= 0)
+ harvest_from.owned_field.reactants -= reactant
stored[mat] += harvest
else
harvesting.Cut()
@@ -110,11 +156,14 @@
return
switch(action)
if("remove_mat")
- var/mat = params["remove_mat"]
- var/singleton/material/material = GET_SINGLETON(mat)
+ var/mat = get_harvest_material_path(params["remove_mat"])
+ if(!mat || !can_harvest[mat])
+ return
+ var/singleton/material/material = get_harvest_material(mat)
if(material)
var/sheet_cost = (SHEET_MATERIAL_AMOUNT * 1.5)
- var/sheets = min(FLOOR(stored[mat]/sheet_cost, 1), 50)
+ var/stored_amount = stored[mat] || 0
+ var/sheets = min(FLOOR(stored_amount/sheet_cost, 1), 50)
if(sheets > 0)
var/obj/item/stack/material/M = new material.stack_type(get_turf(src), sheets)
M.update_icon()
@@ -125,11 +174,15 @@
if("toggle_power")
use_power = (use_power >= POWER_USE_ACTIVE ? POWER_USE_IDLE : POWER_USE_ACTIVE)
+ if(use_power >= POWER_USE_ACTIVE)
+ sync_harvestable_reactants()
queue_icon_update()
return TRUE
if("toggle_harvest")
- var/mat = params["toggle_harvest"]
+ var/mat = get_harvest_material_path(params["toggle_harvest"])
+ if(!mat || !can_harvest[mat])
+ return
if(harvesting[mat])
harvesting -= mat
else
diff --git a/code/modules/power/lights/bulbs.dm b/code/modules/power/lights/bulbs.dm
index 359d980e08e..2ad3e635234 100644
--- a/code/modules/power/lights/bulbs.dm
+++ b/code/modules/power/lights/bulbs.dm
@@ -8,7 +8,7 @@
force = 2
throwforce = 5
w_class = WEIGHT_CLASS_TINY
- matter = list(DEFAULT_WALL_MATERIAL = 60)
+ matter = list(MATERIAL_STEEL = 60)
drop_sound = 'sound/items/drop/drinkglass.ogg'
pickup_sound = 'sound/items/pickup/drinkglass.ogg'
var/status = 0 // LIGHT_OK, LIGHT_BURNED or LIGHT_BROKEN
diff --git a/code/modules/power/singularity/particle_accelerator/particle.dm b/code/modules/power/singularity/particle_accelerator/particle.dm
index 7153996c9af..cc7467fdd20 100644
--- a/code/modules/power/singularity/particle_accelerator/particle.dm
+++ b/code/modules/power/singularity/particle_accelerator/particle.dm
@@ -18,6 +18,7 @@
var/turf/target
var/turf/source
var/movetotarget = 1
+ var/list/irradiated_mobs
/obj/effect/accelerated_particle/weak
movement_range = 8
@@ -38,13 +39,21 @@
if(movement_range > 20)
movement_range = 20
active = TRUE
+ irradiate_living_on_turf()
move(1)
+/obj/effect/accelerated_particle/Destroy()
+ active = FALSE
+ target = null
+ source = null
+ irradiated_mobs = null
+ return ..()
+
/obj/effect/accelerated_particle/Collide(atom/A)
if (!active)
return
if (A)
- if(ismob(A))
+ if(isliving(A))
toxmob(A)
if((istype(A,/obj/structure/machinery/the_singularitygen))||(istype(A,/obj/singularity)))
var/obj/singularity/singulo = A
@@ -68,7 +77,7 @@
. = ..()
if (!active)
return
- if(ismob(bumped_atom))
+ if(isliving(bumped_atom))
toxmob(bumped_atom)
/obj/effect/accelerated_particle/ex_act(severity)
@@ -77,12 +86,24 @@
qdel(src)
/obj/effect/accelerated_particle/proc/toxmob(mob/living/M)
- if (!active)
+ if (!active || !istype(M))
return
+ LAZYINITLIST(irradiated_mobs)
+ var/datum/weakref/mob_ref = WEAKREF(M)
+ if(irradiated_mobs[mob_ref])
+ return
+ irradiated_mobs[mob_ref] = TRUE
var/radiation = (energy*2)
M.apply_damage((radiation*3), DAMAGE_RADIATION, damage_flags = DAMAGE_FLAG_DISPERSED)
M.updatehealth()
+/obj/effect/accelerated_particle/proc/irradiate_living_on_turf()
+ var/turf/current_turf = get_turf(src)
+ if(!current_turf)
+ return
+ for(var/mob/living/M in current_turf)
+ toxmob(M)
+
/obj/effect/accelerated_particle/proc/move(lag)
set waitfor = FALSE
if(QDELETED(src))
@@ -98,6 +119,7 @@
if(QDELETED(src))
return
forceMove(destination)
+ irradiate_living_on_turf()
if(target && movetotarget && (get_dist(src,target) < 1))
movetotarget = FALSE
movement_range--
diff --git a/code/modules/power/smes.dm b/code/modules/power/smes.dm
index bb7cbe461bc..b0d69799f65 100644
--- a/code/modules/power/smes.dm
+++ b/code/modules/power/smes.dm
@@ -103,7 +103,7 @@
/obj/structure/machinery/power/smes/assembly_hints(mob/user, distance, is_adjacent)
. += ..()
- if(health < initial(health))
+ if(health < maxhealth)
. += "It can be repaired with a welding tool."
/obj/structure/machinery/power/smes/feedback_hints(mob/user, distance, is_adjacent)
@@ -174,7 +174,7 @@
return TRUE
/obj/structure/machinery/power/smes/proc/is_badly_damaged()
- if(health < initial(health) / 5)
+ if(health < maxhealth / 5)
return TRUE
return FALSE
diff --git a/code/modules/power/smes_construction.dm b/code/modules/power/smes_construction.dm
index e9073258bac..8f42fade1d1 100644
--- a/code/modules/power/smes_construction.dm
+++ b/code/modules/power/smes_construction.dm
@@ -418,7 +418,7 @@
// - No action was taken in parent function (terminal de/construction atm).
if (..())
if(attacking_item.tool_behaviour == TOOL_WELDER)
- if(health == initial(health))
+ if(health == maxhealth)
to_chat(user, SPAN_WARNING("\The [src] is already repaired."))
return
var/obj/item/weldingtool/WT = attacking_item
@@ -429,9 +429,9 @@
to_chat(user, SPAN_WARNING("You don't have enough fuel to repair \the [src]."))
return
if(WT.use_tool(src, user, 50, volume = 50) && WT.use(2, user))
- health = min(health + 100, initial(health))
- to_chat(user, SPAN_NOTICE("You repair \the [src], it is now [round((health / initial(health)) * 100)]% repaired."))
- if(health == initial(health))
+ health = min(health + 100, maxhealth)
+ to_chat(user, SPAN_NOTICE("You repair \the [src], it is now [round((health / maxhealth) * 100)]% repaired."))
+ if(health == maxhealth)
busted = FALSE
return
// Multitool - change RCON tag
diff --git a/code/modules/power/solar.dm b/code/modules/power/solar.dm
index cf467f33509..71d6b526e9e 100644
--- a/code/modules/power/solar.dm
+++ b/code/modules/power/solar.dm
@@ -223,20 +223,22 @@
attacking_item.play_tool_sound(get_turf(src), 75)
return 1
- if(istype(attacking_item, /obj/item/stack/material) && (attacking_item.get_material_name() == "glass" || attacking_item.get_material_name() == MATERIAL_GLASS_REINFORCED))
- var/obj/item/stack/material/S = attacking_item
- if(S.use(2))
- glass_type = attacking_item.type
- playsound(src.loc, 'sound/machines/click.ogg', 50, 1)
- user.visible_message(SPAN_NOTICE("[user] places the glass on the solar assembly."))
- if(tracker)
- new /obj/structure/machinery/power/tracker(get_turf(src), src)
+ var/obj/item/stack/material/S = attacking_item
+ if(istype(S))
+ var/singleton/material/S_material = S.get_material()
+ if(S_material.type in list(MATERIAL_GLASS, MATERIAL_GLASS_REINFORCED))
+ if(S.use(2))
+ glass_type = attacking_item.type
+ playsound(src.loc, 'sound/machines/click.ogg', 50, 1)
+ user.visible_message(SPAN_NOTICE("[user] places the glass on the solar assembly."))
+ if(tracker)
+ new /obj/structure/machinery/power/tracker(get_turf(src), src)
+ else
+ new /obj/structure/machinery/power/solar(get_turf(src), src)
else
- new /obj/structure/machinery/power/solar(get_turf(src), src)
- else
- to_chat(user, SPAN_WARNING("You need two sheets of glass to put them into a solar panel."))
- return
- return 1
+ to_chat(user, SPAN_WARNING("You need two sheets of glass to put them into a solar panel."))
+ return
+ return 1
if(!tracker)
if(istype(attacking_item, /obj/item/tracker_electronics))
diff --git a/code/modules/projectiles/ammunition.dm b/code/modules/projectiles/ammunition.dm
index da53ee3ac7a..894455b8a35 100644
--- a/code/modules/projectiles/ammunition.dm
+++ b/code/modules/projectiles/ammunition.dm
@@ -97,7 +97,7 @@
obj_flags = OBJ_FLAG_CONDUCTABLE
slot_flags = SLOT_BELT
item_state = "box"
- matter = list(DEFAULT_WALL_MATERIAL = 500)
+ matter = list(MATERIAL_STEEL = 500)
throwforce = 5
w_class = WEIGHT_CLASS_SMALL
throw_speed = 4
diff --git a/code/modules/projectiles/ammunition/boxes.dm b/code/modules/projectiles/ammunition/boxes.dm
index 6c02f680f4c..35eb98bb549 100644
--- a/code/modules/projectiles/ammunition/boxes.dm
+++ b/code/modules/projectiles/ammunition/boxes.dm
@@ -17,7 +17,7 @@ If nothing is chosen, reload sounds revert to the default, which is metal_slide_
caliber = "357"
insert_sound = SFX_RELOAD_REVOLVER
ammo_type = /obj/item/ammo_casing/a357
- matter = list(DEFAULT_WALL_MATERIAL = 1260)
+ matter = list(MATERIAL_STEEL = 1260)
max_ammo = 8
multiple_sprites = TRUE
@@ -27,7 +27,7 @@ If nothing is chosen, reload sounds revert to the default, which is metal_slide_
caliber = "454"
insert_sound = SFX_RELOAD_REVOLVER
ammo_type = /obj/item/ammo_casing/a454
- matter = list(DEFAULT_WALL_MATERIAL = 1260)
+ matter = list(MATERIAL_STEEL = 1260)
max_ammo = 7
multiple_sprites = TRUE
@@ -36,7 +36,7 @@ If nothing is chosen, reload sounds revert to the default, which is metal_slide_
icon_state = "38"
caliber = "38"
insert_sound = SFX_RELOAD_REVOLVER
- matter = list(DEFAULT_WALL_MATERIAL = 360)
+ matter = list(MATERIAL_STEEL = 360)
ammo_type = /obj/item/ammo_casing/c38
max_ammo = 6
multiple_sprites = TRUE
@@ -48,7 +48,7 @@ If nothing is chosen, reload sounds revert to the default, which is metal_slide_
/obj/item/ammo_magazine/c38/emp
name = "speed loader (.38 haywire)"
ammo_type = /obj/item/ammo_casing/c38/emp
- matter = list(DEFAULT_WALL_MATERIAL = 360, MATERIAL_URANIUM = 600)
+ matter = list(MATERIAL_STEEL = 360, MATERIAL_URANIUM = 600)
/obj/item/ammo_magazine/c45/revolver
name = "speed loader (.45)"
@@ -78,7 +78,7 @@ If nothing is chosen, reload sounds revert to the default, which is metal_slide_
icon_state = "9mm"
origin_tech = list(TECH_COMBAT = 2)
caliber = ".45"
- matter = list(DEFAULT_WALL_MATERIAL = 2250)
+ matter = list(MATERIAL_STEEL = 2250)
ammo_type = /obj/item/ammo_casing/c45
max_ammo = 30
@@ -87,7 +87,7 @@ If nothing is chosen, reload sounds revert to the default, which is metal_slide_
icon_state = "45x"
origin_tech = list(TECH_COMBAT = 3)
mag_type = MAGAZINE
- matter = list(DEFAULT_WALL_MATERIAL = 600)
+ matter = list(MATERIAL_STEEL = 600)
caliber = ".45"
ammo_type = /obj/item/ammo_casing/c45
max_ammo = 16
@@ -99,7 +99,7 @@ If nothing is chosen, reload sounds revert to the default, which is metal_slide_
origin_tech = list(TECH_COMBAT = 2)
mag_type = MAGAZINE
caliber = ".50"
- matter = list(DEFAULT_WALL_MATERIAL = 1260)
+ matter = list(MATERIAL_STEEL = 1260)
ammo_type = /obj/item/ammo_casing/a50
max_ammo = 7
multiple_sprites = 1
@@ -112,7 +112,7 @@ If nothing is chosen, reload sounds revert to the default, which is metal_slide_
icon_state = "45"
mag_type = MAGAZINE
ammo_type = /obj/item/ammo_casing/c45
- matter = list(DEFAULT_WALL_MATERIAL = 525) //metal costs are very roughly based around 1 .45 casing = 75 metal
+ matter = list(MATERIAL_STEEL = 525) //metal costs are very roughly based around 1 .45 casing = 75 metal
caliber = ".45"
max_ammo = 9
multiple_sprites = 1
@@ -201,7 +201,7 @@ If nothing is chosen, reload sounds revert to the default, which is metal_slide_
icon_state = "12mm"
mag_type = MAGAZINE
ammo_type = /obj/item/ammo_casing/c10mm
- matter = list(DEFAULT_WALL_MATERIAL = 475) //metal costs are very roughly based around 1 .45 casing = 75 metal
+ matter = list(MATERIAL_STEEL = 475) //metal costs are very roughly based around 1 .45 casing = 75 metal
caliber = "10mm"
max_ammo = 12
multiple_sprites = 1
@@ -217,7 +217,7 @@ If nothing is chosen, reload sounds revert to the default, which is metal_slide_
name = "ammo clip (10mm)"
icon_state = "10mmclip"
mag_type = SPEEDLOADER
- matter = list(DEFAULT_WALL_MATERIAL = 1800)
+ matter = list(MATERIAL_STEEL = 1800)
max_ammo = 5
multiple_sprites = 1
insert_sound = 'sound/weapons/clip_insert.ogg'
@@ -227,7 +227,7 @@ If nothing is chosen, reload sounds revert to the default, which is metal_slide_
icon_state = "9x19p"
origin_tech = list(TECH_COMBAT = 2)
mag_type = MAGAZINE
- matter = list(DEFAULT_WALL_MATERIAL = 600)
+ matter = list(MATERIAL_STEEL = 600)
caliber = "9mm"
ammo_type = /obj/item/ammo_casing/c9mm
max_ammo = 12
@@ -256,7 +256,7 @@ If nothing is chosen, reload sounds revert to the default, which is metal_slide_
name = "ammunition box (9mm)"
icon_state = "9mm"
origin_tech = list(TECH_COMBAT = 2)
- matter = list(DEFAULT_WALL_MATERIAL = 1800)
+ matter = list(MATERIAL_STEEL = 1800)
caliber = "9mm"
insert_sound = SFX_RELOAD_POLYMER_SLIDE
ammo_type = /obj/item/ammo_casing/c9mm
@@ -270,7 +270,7 @@ If nothing is chosen, reload sounds revert to the default, which is metal_slide_
icon_state = "9mmt"
mag_type = MAGAZINE
ammo_type = /obj/item/ammo_casing/c9mm
- matter = list(DEFAULT_WALL_MATERIAL = 1200)
+ matter = list(MATERIAL_STEEL = 1200)
caliber = "9mm"
insert_sound = SFX_RELOAD_POLYMER_SLIDE
max_ammo = 20
@@ -292,7 +292,7 @@ If nothing is chosen, reload sounds revert to the default, which is metal_slide_
icon_state = "9mm"
origin_tech = list(TECH_COMBAT = 2)
caliber = ".45"
- matter = list(DEFAULT_WALL_MATERIAL = 2250)
+ matter = list(MATERIAL_STEEL = 2250)
ammo_type = /obj/item/ammo_casing/c45
max_ammo = 30
@@ -306,7 +306,7 @@ If nothing is chosen, reload sounds revert to the default, which is metal_slide_
mag_type = MAGAZINE
caliber = "10mm"
insert_sound = SFX_RELOAD_POLYMER_SLIDE
- matter = list(DEFAULT_WALL_MATERIAL = 1500)
+ matter = list(MATERIAL_STEEL = 1500)
ammo_type = /obj/item/ammo_casing/c10mm
max_ammo = 20
multiple_sprites = 1
@@ -319,7 +319,7 @@ If nothing is chosen, reload sounds revert to the default, which is metal_slide_
icon_state = "uzi45"
mag_type = MAGAZINE
ammo_type = /obj/item/ammo_casing/c45
- matter = list(DEFAULT_WALL_MATERIAL = 1200)
+ matter = list(MATERIAL_STEEL = 1200)
caliber = ".45"
max_ammo = 16
insert_sound = SFX_RELOAD_POLYMER_SLIDE
@@ -333,7 +333,7 @@ If nothing is chosen, reload sounds revert to the default, which is metal_slide_
icon_state = "tommy-mag"
mag_type = MAGAZINE
ammo_type = /obj/item/ammo_casing/c45
- matter = list(DEFAULT_WALL_MATERIAL = 1500)
+ matter = list(MATERIAL_STEEL = 1500)
caliber = ".45"
insert_sound = SFX_RELOAD_POLYMER_SLIDE
max_ammo = 20
@@ -346,7 +346,7 @@ If nothing is chosen, reload sounds revert to the default, which is metal_slide_
icon_state = "tommy-mag"
mag_type = MAGAZINE
ammo_type = /obj/item/ammo_casing/c6mm
- matter = list(DEFAULT_WALL_MATERIAL = 1500)
+ matter = list(MATERIAL_STEEL = 1500)
caliber = "6mm"
insert_sound = SFX_RELOAD_POLYMER_SLIDE
max_ammo = 30
@@ -357,7 +357,7 @@ If nothing is chosen, reload sounds revert to the default, which is metal_slide_
w_class = WEIGHT_CLASS_NORMAL // Bulky ammo doesn't fit in your pockets!
mag_type = MAGAZINE
ammo_type = /obj/item/ammo_casing/c45
- matter = list(DEFAULT_WALL_MATERIAL = 3750)
+ matter = list(MATERIAL_STEEL = 3750)
caliber = ".45"
insert_sound = SFX_RELOAD_POLYMER_SLIDE
max_ammo = 50
@@ -382,7 +382,7 @@ If nothing is chosen, reload sounds revert to the default, which is metal_slide_
mag_type = MAGAZINE
caliber = "a556"
insert_sound = SFX_RELOAD_RIFLE_SLIDE
- matter = list(DEFAULT_WALL_MATERIAL = 1800)
+ matter = list(MATERIAL_STEEL = 1800)
ammo_type = /obj/item/ammo_casing/a556
max_ammo = 30
multiple_sprites = 1
@@ -413,7 +413,7 @@ If nothing is chosen, reload sounds revert to the default, which is metal_slide_
name = "carbine magazine (5.56mm)"
icon_state = "5.56c"
desc = "A 5.56 ammo magazine fit for a carbine, not an assault rifle."
- matter = list(DEFAULT_WALL_MATERIAL = 1250)
+ matter = list(MATERIAL_STEEL = 1250)
max_ammo = 15
/obj/item/ammo_magazine/a556/carbine/empty
@@ -448,7 +448,7 @@ If nothing is chosen, reload sounds revert to the default, which is metal_slide_
name = "makeshift magazine (5.56mm)"
icon_state = "5.56m"
origin_tech = list(TECH_COMBAT = 1)
- matter = list(DEFAULT_WALL_MATERIAL = 600)
+ matter = list(MATERIAL_STEEL = 600)
max_ammo = 7
/obj/item/ammo_magazine/a556/makeshift/empty
@@ -467,7 +467,7 @@ If nothing is chosen, reload sounds revert to the default, which is metal_slide_
mag_type = MAGAZINE
caliber = "a65"
insert_sound = SFX_RELOAD_RIFLE_SLIDE
- matter = list(DEFAULT_WALL_MATERIAL = 1800)
+ matter = list(MATERIAL_STEEL = 1800)
ammo_type = /obj/item/ammo_casing/a65
max_ammo = 20
multiple_sprites = 1
@@ -508,7 +508,7 @@ If nothing is chosen, reload sounds revert to the default, which is metal_slide_
mag_type = MAGAZINE
caliber = "a762"
insert_sound = SFX_RELOAD_RIFLE_SLIDE
- matter = list(DEFAULT_WALL_MATERIAL = 4500)
+ matter = list(MATERIAL_STEEL = 4500)
ammo_type = /obj/item/ammo_casing/a762
max_ammo = 50
multiple_sprites = 1
@@ -522,7 +522,7 @@ If nothing is chosen, reload sounds revert to the default, which is metal_slide_
mag_type = MAGAZINE
caliber = "a762"
insert_sound = SFX_RELOAD_RIFLE_SLIDE
- matter = list(DEFAULT_WALL_MATERIAL = 1800)
+ matter = list(MATERIAL_STEEL = 1800)
ammo_type = /obj/item/ammo_casing/a762
max_ammo = 20
multiple_sprites = 1
@@ -544,7 +544,7 @@ If nothing is chosen, reload sounds revert to the default, which is metal_slide_
icon_state = "762"
ammo_type = /obj/item/ammo_casing/a762
caliber = "a762"
- matter = list(DEFAULT_WALL_MATERIAL = 1800)
+ matter = list(MATERIAL_STEEL = 1800)
max_ammo = 5
multiple_sprites = 1
insert_sound = 'sound/weapons/clip_insert.ogg'
@@ -571,7 +571,7 @@ If nothing is chosen, reload sounds revert to the default, which is metal_slide_
icon_state = "SVD"
mag_type = MAGAZINE
caliber = "a762"
- matter = list(DEFAULT_WALL_MATERIAL = 1200)
+ matter = list(MATERIAL_STEEL = 1200)
ammo_type = /obj/item/ammo_casing/a762
max_ammo = 10
multiple_sprites = 1
@@ -584,7 +584,7 @@ If nothing is chosen, reload sounds revert to the default, which is metal_slide_
icon_state = "a68"
mag_type = MAGAZINE
caliber = "6.8mm"
- matter = list(DEFAULT_WALL_MATERIAL = 1800)
+ matter = list(MATERIAL_STEEL = 1800)
ammo_type = /obj/item/ammo_casing/a68/
max_ammo = 25
multiple_sprites = 1
@@ -610,7 +610,7 @@ If nothing is chosen, reload sounds revert to the default, which is metal_slide_
mag_type = MAGAZINE
caliber = "flechette"
insert_sound = SFX_RELOAD_RIFLE_SLIDE
- matter = list(DEFAULT_WALL_MATERIAL = 1200)
+ matter = list(MATERIAL_STEEL = 1200)
ammo_type = /obj/item/ammo_casing/flechette
max_ammo = 40
multiple_sprites = 1
@@ -625,7 +625,7 @@ If nothing is chosen, reload sounds revert to the default, which is metal_slide_
icon_state = "flechette_e"
mag_type = MAGAZINE
caliber = "flechette"
- matter = list(DEFAULT_WALL_MATERIAL = 1200)
+ matter = list(MATERIAL_STEEL = 1200)
ammo_type = /obj/item/ammo_casing/flechette/explosive
max_ammo = 10
multiple_sprites = 1
@@ -653,13 +653,13 @@ If nothing is chosen, reload sounds revert to the default, which is metal_slide_
name = "magazine (incendiary shells)"
icon_state = "csmi"
ammo_type = /obj/item/ammo_casing/shotgun/incendiary
- matter = list(DEFAULT_WALL_MATERIAL = 3600)
+ matter = list(MATERIAL_STEEL = 3600)
/obj/item/ammo_magazine/assault_shotgun/stun
name = "magazine (stun shells)"
icon_state = "csms"
ammo_type = /obj/item/ammo_casing/shotgun/stunshell
- matter = list(DEFAULT_WALL_MATERIAL = 2880, MATERIAL_GLASS = 5760)
+ matter = list(MATERIAL_STEEL = 2880, MATERIAL_GLASS = 5760)
/obj/item/ammo_magazine/xanan_shotgun
name = "magazine"
@@ -772,7 +772,7 @@ If nothing is chosen, reload sounds revert to the default, which is metal_slide_
caliber = "caps"
color = "#FF0000"
ammo_type = /obj/item/ammo_casing/cap
- matter = list(DEFAULT_WALL_MATERIAL = 600)
+ matter = list(MATERIAL_STEEL = 600)
max_ammo = 7
multiple_sprites = 1
diff --git a/code/modules/projectiles/ammunition/bullets.dm b/code/modules/projectiles/ammunition/bullets.dm
index 39d1a726b9f..e043aa2abc8 100644
--- a/code/modules/projectiles/ammunition/bullets.dm
+++ b/code/modules/projectiles/ammunition/bullets.dm
@@ -35,7 +35,7 @@
desc = "A .38 bullet casing fitted with a single-use ion pulse generator."
projectile_type = /obj/projectile/ion/small
icon_state = "empcasing"
- matter = list(DEFAULT_WALL_MATERIAL = 130, MATERIAL_URANIUM = 100)
+ matter = list(MATERIAL_STEEL = 130, MATERIAL_URANIUM = 100)
/obj/item/ammo_casing/c38/spent/Initialize()
. = ..()
@@ -132,7 +132,7 @@
spent_icon = "slshell-spent"
caliber = "shotgun"
projectile_type = /obj/projectile/bullet/shotgun
- matter = list(DEFAULT_WALL_MATERIAL = 360)
+ matter = list(MATERIAL_STEEL = 360)
reload_sound = SFX_RELOAD_SHOTGUN
drop_sound = SFX_CASING_DROP_SHOTGUN
max_stack = 8
@@ -149,7 +149,7 @@
icon_state = "gshell"
spent_icon = "gshell-spent"
projectile_type = /obj/projectile/bullet/pellet/shotgun
- matter = list(DEFAULT_WALL_MATERIAL = 360)
+ matter = list(MATERIAL_STEEL = 360)
/obj/item/ammo_casing/shotgun/pellet/used/Initialize()
. = ..()
@@ -163,7 +163,7 @@
icon_state = "blshell"
spent_icon = "blshell-spent"
projectile_type = /obj/projectile/bullet/blank
- matter = list(DEFAULT_WALL_MATERIAL = 90)
+ matter = list(MATERIAL_STEEL = 90)
/obj/item/ammo_casing/shotgun/practice
name = "shotgun shell"
@@ -179,7 +179,7 @@
icon_state = "bshell"
spent_icon = "bshell-spent"
projectile_type = /obj/projectile/bullet/shotgun/beanbag
- matter = list(DEFAULT_WALL_MATERIAL = 180)
+ matter = list(MATERIAL_STEEL = 180)
//Can stun in one hit if aimed at the head, but
//is blocked by clothing that stops tasers and is vulnerable to EMP
@@ -189,7 +189,7 @@
icon_state = "stunshell"
spent_icon = "stunshell-spent"
projectile_type = /obj/projectile/energy/electrode/stunshot
- matter = list(DEFAULT_WALL_MATERIAL = 360, MATERIAL_GLASS = 720)
+ matter = list(MATERIAL_STEEL = 360, MATERIAL_GLASS = 720)
reload_sound = 'sound/weapons/reload_shell_emp.ogg'
/obj/item/ammo_casing/shotgun/stunshell/emp_act(severity)
@@ -207,7 +207,7 @@
icon_state = "fshell"
spent_icon = "fshell-spent"
projectile_type = /obj/projectile/energy/flash/flare
- matter = list(DEFAULT_WALL_MATERIAL = 90, MATERIAL_GLASS = 90)
+ matter = list(MATERIAL_STEEL = 90, MATERIAL_GLASS = 90)
reload_sound = 'sound/weapons/reload_shell_emp.ogg'
/obj/item/ammo_casing/shotgun/incendiary
@@ -216,7 +216,7 @@
icon_state = "ishell"
spent_icon = "ishell-spent"
projectile_type = /obj/projectile/bullet/shotgun/incendiary
- matter = list(DEFAULT_WALL_MATERIAL = 450)
+ matter = list(MATERIAL_STEEL = 450)
/obj/item/ammo_casing/shotgun/emp
name = "haywire slug"
@@ -224,7 +224,7 @@
icon_state = "empshell"
spent_icon = "empshell-spent"
projectile_type = /obj/projectile/ion
- matter = list(DEFAULT_WALL_MATERIAL = 260, MATERIAL_URANIUM = 200)
+ matter = list(MATERIAL_STEEL = 260, MATERIAL_URANIUM = 200)
reload_sound = 'sound/weapons/reload_shell_emp.ogg'
/obj/item/ammo_casing/shotgun/tracking
@@ -293,7 +293,7 @@
desc = "A 14.5mm shell."
caliber = "14.5mm"
projectile_type = /obj/projectile/bullet/rifle/a145
- matter = list(DEFAULT_WALL_MATERIAL = 1250)
+ matter = list(MATERIAL_STEEL = 1250)
icon_state = "lcasing"
spent_icon = "lcasing-spent"
max_stack = 2
@@ -441,7 +441,7 @@
icon_state = "cannonball"
caliber = "cannon"
projectile_type = /obj/projectile/bullet/cannonball
- matter = list(DEFAULT_WALL_MATERIAL = 800)
+ matter = list(MATERIAL_STEEL = 800)
w_class = WEIGHT_CLASS_NORMAL
slot_flags = null
max_stack = 1
diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm
index 93322adcb47..dc6d90585e0 100644
--- a/code/modules/projectiles/gun.dm
+++ b/code/modules/projectiles/gun.dm
@@ -50,7 +50,7 @@ ABSTRACT_TYPE(/obj/item/gun)
contained_sprite = TRUE
obj_flags = OBJ_FLAG_CONDUCTABLE
slot_flags = SLOT_BELT|SLOT_HOLSTER
- matter = list(DEFAULT_WALL_MATERIAL = 2000)
+ matter = list(MATERIAL_STEEL = 2000)
w_class = WEIGHT_CLASS_NORMAL
throwforce = 5
throw_speed = 4
diff --git a/code/modules/projectiles/guns/energy/blaster.dm b/code/modules/projectiles/guns/energy/blaster.dm
index 7e43700eb34..6d96ce8ee1f 100644
--- a/code/modules/projectiles/guns/energy/blaster.dm
+++ b/code/modules/projectiles/guns/energy/blaster.dm
@@ -10,7 +10,7 @@
w_class = WEIGHT_CLASS_SMALL
force = 11
origin_tech = list(TECH_COMBAT = 2, TECH_MAGNET = 2)
- matter = list(DEFAULT_WALL_MATERIAL = 2000)
+ matter = list(MATERIAL_STEEL = 2000)
offhand_accuracy = 1
projectile_type = /obj/projectile/energy/blaster
max_shots = 12
diff --git a/code/modules/projectiles/guns/energy/laser.dm b/code/modules/projectiles/guns/energy/laser.dm
index 16e48ce868a..33d4240278c 100644
--- a/code/modules/projectiles/guns/energy/laser.dm
+++ b/code/modules/projectiles/guns/energy/laser.dm
@@ -84,7 +84,7 @@
w_class = WEIGHT_CLASS_BULKY
accuracy = 0
force = 15
- matter = list(DEFAULT_WALL_MATERIAL = 2000)
+ matter = list(MATERIAL_STEEL = 2000)
origin_tech = list(TECH_COMBAT = 4, TECH_MAGNET = 2)
projectile_type = /obj/projectile/beam/shotgun
max_shots = 28
@@ -116,7 +116,7 @@ ABSTRACT_TYPE(/obj/item/gun/energy/lasertag)
origin_tech = list(TECH_COMBAT = 1, TECH_MAGNET = 2)
self_recharge = TRUE
recharge_time = 2
- matter = list(DEFAULT_WALL_MATERIAL = 2000)
+ matter = list(MATERIAL_STEEL = 2000)
fire_sound = 'sound/weapons/laser1.ogg'
projectile_type = /obj/projectile/beam/laser_tag
pin = /obj/item/firing_pin/tag/red
diff --git a/code/modules/projectiles/guns/energy/mining.dm b/code/modules/projectiles/guns/energy/mining.dm
index 87d70740098..ca4817d4000 100644
--- a/code/modules/projectiles/guns/energy/mining.dm
+++ b/code/modules/projectiles/guns/energy/mining.dm
@@ -15,7 +15,7 @@
sharp = TRUE
edge = TRUE
origin_tech = list(TECH_MATERIAL = 4, TECH_PHORON = 3, TECH_ENGINEERING = 3)
- matter = list(DEFAULT_WALL_MATERIAL = 4000, MATERIAL_GLASS = 2000)
+ matter = list(MATERIAL_STEEL = 4000, MATERIAL_GLASS = 2000)
projectile_type = /obj/projectile/beam/plasmacutter
cell_type = /obj/item/cell/high
charge_cost = 666.66 // 15 shots on a high cap cell
diff --git a/code/modules/projectiles/guns/energy/modular.dm b/code/modules/projectiles/guns/energy/modular.dm
index 5b5d8cb1539..28790a4e86f 100644
--- a/code/modules/projectiles/guns/energy/modular.dm
+++ b/code/modules/projectiles/guns/energy/modular.dm
@@ -12,7 +12,7 @@
w_class = WEIGHT_CLASS_NORMAL
force = 15
origin_tech = list(TECH_COMBAT = 3, TECH_MAGNET = 2)
- matter = list(DEFAULT_WALL_MATERIAL = 2000)
+ matter = list(MATERIAL_STEEL = 2000)
can_turret = TRUE
zoomdevicename = null
max_shots = 0
diff --git a/code/modules/projectiles/guns/energy/rifle.dm b/code/modules/projectiles/guns/energy/rifle.dm
index 36845d7c103..a0947c437e3 100644
--- a/code/modules/projectiles/guns/energy/rifle.dm
+++ b/code/modules/projectiles/guns/energy/rifle.dm
@@ -26,7 +26,7 @@
sel_mode = 1
projectile_type = /obj/projectile/beam/stun
- matter = list(DEFAULT_WALL_MATERIAL = 2000)
+ matter = list(MATERIAL_STEEL = 2000)
origin_tech = list(TECH_COMBAT = 3, TECH_MATERIAL = 2, TECH_MAGNET = 3)
modifystate = "eriflestun"
diff --git a/code/modules/projectiles/guns/energy/stun.dm b/code/modules/projectiles/guns/energy/stun.dm
index 65a261a19e5..ecea35d7657 100644
--- a/code/modules/projectiles/guns/energy/stun.dm
+++ b/code/modules/projectiles/guns/energy/stun.dm
@@ -41,7 +41,7 @@
has_item_ratio = FALSE
w_class = WEIGHT_CLASS_SMALL
origin_tech = list(TECH_COMBAT = 2, TECH_MAGNET = 2, TECH_ILLEGAL = 5)
- matter = list(DEFAULT_WALL_MATERIAL = 2000)
+ matter = list(MATERIAL_STEEL = 2000)
slot_flags = SLOT_BELT
suppressed = TRUE
can_unsuppress = FALSE
@@ -73,5 +73,5 @@
force = 15
icon_state = "crossbowlarge"
item_state = "crossbow"
- matter = list(DEFAULT_WALL_MATERIAL = 200000)
+ matter = list(MATERIAL_STEEL = 200000)
projectile_type = /obj/projectile/energy/bolt/large
diff --git a/code/modules/projectiles/guns/launcher/crossbow.dm b/code/modules/projectiles/guns/launcher/crossbow.dm
index cbc6deb9fbf..0487bda9678 100644
--- a/code/modules/projectiles/guns/launcher/crossbow.dm
+++ b/code/modules/projectiles/guns/launcher/crossbow.dm
@@ -259,9 +259,10 @@
else
to_chat(user, SPAN_NOTICE("You need at least five segments of cable coil to complete this task."))
return
- else if(istype(attacking_item,/obj/item/stack/material) && attacking_item.get_material_name() == MATERIAL_PLASTIC)
- if(buildstate == 3)
- var/obj/item/stack/material/P = attacking_item
+ else if(istype(attacking_item,/obj/item/stack/material))
+ var/obj/item/stack/material/P = attacking_item
+ var/singleton/material/P_material = P.get_material()
+ if(buildstate == 3 && P_material.type == MATERIAL_PLASTIC)
if(P.use(3))
to_chat(user, SPAN_NOTICE("You assemble and install heavy plastic limbs onto the crossbow."))
buildstate++
@@ -269,6 +270,7 @@
else
to_chat(user, SPAN_NOTICE("You need at least three plastic sheets to complete this task."))
return
+ return ..()
else if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER)
if(buildstate == 5)
to_chat(user, SPAN_NOTICE("You secure the crossbow's various parts."))
diff --git a/code/modules/projectiles/guns/launcher/grenade_launcher.dm b/code/modules/projectiles/guns/launcher/grenade_launcher.dm
index e78b0db9784..70e588cac74 100644
--- a/code/modules/projectiles/guns/launcher/grenade_launcher.dm
+++ b/code/modules/projectiles/guns/launcher/grenade_launcher.dm
@@ -23,7 +23,7 @@
var/obj/item/grenade/chambered
var/list/grenades = new/list()
var/max_grenades = 5 //holds this + one in the chamber
- matter = list(DEFAULT_WALL_MATERIAL = 2000)
+ matter = list(MATERIAL_STEEL = 2000)
/obj/item/gun/launcher/grenade/feedback_hints(mob/user, distance, is_adjacent)
diff --git a/code/modules/projectiles/guns/launcher/pneumatic.dm b/code/modules/projectiles/guns/launcher/pneumatic.dm
index 4967a4f30cb..8ce380b1ce5 100644
--- a/code/modules/projectiles/guns/launcher/pneumatic.dm
+++ b/code/modules/projectiles/guns/launcher/pneumatic.dm
@@ -178,9 +178,13 @@
buildstate++
update_icon()
return
- else if(istype(attacking_item, /obj/item/stack/material) && attacking_item.get_material_name() == DEFAULT_WALL_MATERIAL)
+ else if(istype(attacking_item, /obj/item/stack/material))
+ var/obj/item/stack/material/material_stack = attacking_item
+ var/singleton/material/stack_material = material_stack.get_material()
+ if(stack_material?.type != MATERIAL_STEEL)
+ return ..()
if(buildstate == 2)
- var/obj/item/stack/material/M = attacking_item
+ var/obj/item/stack/material/M = material_stack
if(M.use(5))
to_chat(user, SPAN_NOTICE("You assemble a chassis around the cannon frame."))
buildstate++
diff --git a/code/modules/projectiles/guns/launcher/syringe_gun.dm b/code/modules/projectiles/guns/launcher/syringe_gun.dm
index 9d5e656ef8a..5c2ef4f19fc 100644
--- a/code/modules/projectiles/guns/launcher/syringe_gun.dm
+++ b/code/modules/projectiles/guns/launcher/syringe_gun.dm
@@ -4,7 +4,7 @@
icon = 'icons/obj/ammo.dmi'
icon_state = "syringe-cartridge"
var/icon_flight = "syringe-cartridge-flight" //so it doesn't look so weird when shot
- matter = list(DEFAULT_WALL_MATERIAL = 125, MATERIAL_GLASS = 375)
+ matter = list(MATERIAL_STEEL = 125, MATERIAL_GLASS = 375)
obj_flags = OBJ_FLAG_CONDUCTABLE
slot_flags = SLOT_BELT | SLOT_EARS
throwforce = 3
@@ -69,7 +69,7 @@
item_state = "syringegun"
w_class = WEIGHT_CLASS_NORMAL
force = 16
- matter = list(DEFAULT_WALL_MATERIAL = 2000)
+ matter = list(MATERIAL_STEEL = 2000)
slot_flags = SLOT_BELT
fire_sound = 'sound/weapons/click.ogg'
diff --git a/code/modules/projectiles/guns/projectile.dm b/code/modules/projectiles/guns/projectile.dm
index e03cbfbf61c..74b4e17ed22 100644
--- a/code/modules/projectiles/guns/projectile.dm
+++ b/code/modules/projectiles/guns/projectile.dm
@@ -3,7 +3,7 @@ ABSTRACT_TYPE(/obj/item/gun/projectile)
desc = "A gun that fires bullets."
origin_tech = list(TECH_COMBAT = 2, TECH_MATERIAL = 2)
w_class = WEIGHT_CLASS_NORMAL
- matter = list(DEFAULT_WALL_MATERIAL = 1000)
+ matter = list(MATERIAL_STEEL = 1000)
recoil = 1
var/caliber = "357" //determines which casings will fit
diff --git a/code/modules/psionics/complexus/complexus_helpers.dm b/code/modules/psionics/complexus/complexus_helpers.dm
index 8cde41a9e39..870e98fe57e 100644
--- a/code/modules/psionics/complexus/complexus_helpers.dm
+++ b/code/modules/psionics/complexus/complexus_helpers.dm
@@ -20,6 +20,11 @@
if(!defer_update)
update()
+/datum/psi_complexus/proc/ensure_base_psi_points(var/point_total)
+ var/current_point_total = psi_points + spent_psi_points
+ if(point_total > current_point_total)
+ psi_points += point_total - current_point_total
+
/datum/psi_complexus/proc/get_rank()
return psionic_rank
diff --git a/code/modules/psionics/complexus/complexus_process.dm b/code/modules/psionics/complexus/complexus_process.dm
index 132357e3716..2ba6e6ac8d8 100644
--- a/code/modules/psionics/complexus/complexus_process.dm
+++ b/code/modules/psionics/complexus/complexus_process.dm
@@ -1,7 +1,8 @@
/datum/psi_complexus/proc/update(var/force)
set waitfor = FALSE
- if(force || last_psionic_rank != psionic_rank)
+ var/rank_changed = (get_rank() != last_psionic_rank)
+ if(force || rank_changed)
if(psionic_rank == 0)
qdel(src)
return
@@ -29,24 +30,27 @@
else if(psionic_rank == PSI_RANK_HARMONIOUS)
aura_color = "#64c464"
- if(psionic_rank > PSI_RANK_SENSITIVE && (get_rank() != last_psionic_rank))
+ if(psionic_rank > PSI_RANK_SENSITIVE && rank_changed)
+ var/base_psi_points = 0
switch(psionic_rank)
if(PSI_RANK_HARMONIOUS)
- psi_points = PSI_POINTS_HARMONIOUS
+ base_psi_points = PSI_POINTS_HARMONIOUS
if(PSI_RANK_APEX)
- psi_points = PSI_POINTS_APEX
+ base_psi_points = PSI_POINTS_APEX
if(PSI_RANK_LIMITLESS)
- psi_points = PSI_POINTS_LIMITLESS
- else
- psi_points = 0
+ base_psi_points = PSI_POINTS_LIMITLESS
+ ensure_base_psi_points(base_psi_points)
/// We had special abilities unique to our level, so get rid of 'em.
if(last_psionic_rank > PSI_RANK_HARMONIOUS)
wipe_user_abilities()
- if(last_psionic_rank > PSI_RANK_SENSITIVE && psionic_rank < PSI_RANK_HARMONIOUS && (get_rank() != last_psionic_rank))
+ if(last_psionic_rank > PSI_RANK_SENSITIVE && psionic_rank < PSI_RANK_HARMONIOUS && rank_changed)
psi_points = 0
wipe_user_abilities()
+ if(rank_changed)
+ last_psionic_rank = psionic_rank
+
if(!announced && owner && owner.client && !QDELETED(src))
announced = TRUE
to_chat(owner, "