From eebb8b971c339c5a965d9e49778d2e2ab373e8ac Mon Sep 17 00:00:00 2001 From: Batrachophreno Date: Fri, 10 Jul 2026 14:45:58 -0400 Subject: [PATCH] Materials Repath (#22388) Soft-ish port of https://github.com/NebulaSS13/Nebula/pull/540. Except we call them singletons. Repaths all materials as singletons instead of datums, and replaces material defines from strings to paths so that we can just run GET_SINGLETON instead of needing to use SSMaterials. This is Step One. This PR has no player-facing changes. changes: - refactor: "Repaths /material to /singleton/material." - refactor: "Replaces all material string defines to path defines, replacing SSmaterials procs w/ GET_SINGLETON instead." - refactor: "Removes all material var edited objects from all maps, adding new presets where necessary." - refactor: "Updates recipes unit test to run all recipes against all material singletons." --------- Signed-off-by: Batrachophreno Co-authored-by: kano-dot --- code/__DEFINES/materials.dm | 149 +++--- code/_onclick/item_attack.dm | 14 +- code/controllers/subsystems/materials.dm | 21 +- code/game/gamemodes/cult/cultify/obj.dm | 6 +- code/game/objects/effects/burnt_wall.dm | 8 +- code/game/objects/effects/chem/foam.dm | 2 +- code/game/objects/items/easel.dm | 2 +- .../game/objects/items/stacks/sheets/glass.dm | 10 +- .../objects/items/stacks/sheets/leather.dm | 14 +- .../items/weapons/improvised_components.dm | 19 +- .../objects/items/weapons/material/ashtray.dm | 2 +- .../objects/items/weapons/material/bats.dm | 2 +- .../objects/items/weapons/material/kitchen.dm | 2 +- .../items/weapons/material/material_armor.dm | 16 +- .../weapons/material/material_weapons.dm | 6 +- .../objects/items/weapons/material/shards.dm | 2 +- .../objects/items/weapons/material/swords.dm | 4 +- .../items/weapons/material/twohanded.dm | 16 +- code/game/objects/structures.dm | 9 +- code/game/objects/structures/_machinery.dm | 26 +- code/game/objects/structures/bonfire.dm | 4 +- code/game/objects/structures/carts/carts.dm | 2 +- code/game/objects/structures/curtains.dm | 2 +- .../objects/structures/fluff/evidenceshelf.dm | 2 +- code/game/objects/structures/girders.dm | 6 +- .../structures/machinery/deployable.dm | 2 +- .../structures/machinery/doors/airlock.dm | 29 +- .../structures/machinery/doors/firedoor.dm | 2 +- .../structures/machinery/mecha_fabricator.dm | 4 +- code/game/objects/structures/plasticflaps.dm | 2 +- code/game/objects/structures/railing.dm | 4 +- code/game/objects/structures/simple_doors.dm | 8 +- .../structures/stool_bed_chair_nest/bed.dm | 26 +- .../structures/stool_bed_chair_nest/stools.dm | 8 +- code/game/objects/structures/target_stake.dm | 2 +- code/game/turfs/simulated/floor.dm | 2 +- code/game/turfs/simulated/shuttle_turfs.dm | 2 +- code/game/turfs/simulated/wall_icon.dm | 4 +- code/game/turfs/simulated/wall_types.dm | 2 +- code/game/turfs/simulated/walls.dm | 12 +- .../binary_devices/oxyregenerator.dm | 2 +- code/modules/clothing/clothing.dm | 4 +- code/modules/clothing/rings/material.dm | 4 +- .../machinery/cooking_machines/container.dm | 10 +- code/modules/cooking/plates.dm | 2 +- code/modules/fabrication/_fabricator.dm | 10 +- .../modules/heavy_vehicle/components/frame.dm | 2 +- .../heavy_vehicle/equipment/utility.dm | 2 +- code/modules/heavy_vehicle/mecha.dm | 2 +- .../modules/heavy_vehicle/premade/_premade.dm | 2 +- .../heavy_vehicle/premade/powerloader.dm | 2 +- .../integrated_electronics/core/printer.dm | 2 +- .../item_worth/Value_procs/obj/items.dm | 2 +- code/modules/materials/material_recipes.dm | 91 ++-- code/modules/materials/material_sheets.dm | 14 +- code/modules/materials/materials.dm | 477 ++++++++++-------- code/modules/mining/machine_processing.dm | 8 +- code/modules/mining/mint.dm | 2 +- .../simple_animal/hostile/phoron_worm.dm | 2 +- .../overmap/ship_weaponry/_ship_ammunition.dm | 2 +- .../fusion/fuel_assembly/fuel_assembly.dm | 2 +- .../fusion/fuel_assembly/fuel_compressor.dm | 2 +- .../modules/power/fusion/kinetic_harvester.dm | 29 +- code/modules/radiation/radiation.dm | 2 +- code/modules/random_map/automata/diona.dm | 2 +- code/modules/reagents/reagent_containers.dm | 4 +- .../xenoarchaeology/finds/finds_special.dm | 4 +- .../artifacts/items/bone_spear.dm | 2 +- code/modules/tables/flipping.dm | 8 +- code/modules/tables/presets.dm | 20 +- code/modules/tables/rack.dm | 2 +- code/modules/tables/tables.dm | 16 +- code/modules/turbolift/turbolift_turfs.dm | 2 +- code/modules/weather/weather_fsm_states.dm | 4 +- code/unit_tests/recipe_tests.dm | 4 +- html/changelogs/Bat-MaterialSingletons.yml | 8 + .../abandoned_industrial_station.dmm | 16 +- .../abandoned_propellant_depot.dmm | 8 +- maps/away/away_site/cult_base/cult_base.dmm | 24 +- .../enviro_testing_facility_submaps_main.dmm | 92 +--- .../ruined_propellant_depot.dmm | 8 +- maps/event/generic_dock/generic_dock-1.dmm | 15 +- maps/sccv_horizon/sccv_horizon.dmm | 107 +--- 83 files changed, 696 insertions(+), 782 deletions(-) create mode 100644 html/changelogs/Bat-MaterialSingletons.yml diff --git a/code/__DEFINES/materials.dm b/code/__DEFINES/materials.dm index 2b1388ef4c2..40a92df4105 100644 --- a/code/__DEFINES/materials.dm +++ b/code/__DEFINES/materials.dm @@ -1,84 +1,85 @@ // Metals, glasses, rocks, and crystals. -#define MATERIAL_PLASTIC "plastic" -#define MATERIAL_PLASTIC_HOLO "holoplastic" -#define MATERIAL_PLASTEEL "plasteel" -#define MATERIAL_STEEL "steel" -#define MATERIAL_GLASS "glass" -#define MATERIAL_GLASS_REINFORCED "reinforced glass" -#define MATERIAL_GLASS_WIRED "wired glass" -#define MATERIAL_GLASS_PHORON "borosilicate glass" -#define MATERIAL_GLASS_REINFORCED_PHORON "reinforced borosilicate glass" -#define MATERIAL_GOLD "gold" -#define MATERIAL_SILVER "silver" -#define MATERIAL_DIAMOND "diamond" -#define MATERIAL_PHORON "phoron" -#define MATERIAL_URANIUM "uranium" -#define MATERIAL_SANDSTONE "sandstone" -#define MATERIAL_CONCRETE "concrete" -#define MATERIAL_IRON "iron" -#define MATERIAL_PLATINUM "platinum" -#define MATERIAL_BRONZE "bronze" -#define MATERIAL_OSMIUM "osmium" -#define MATERIAL_MARBLE "marble" -#define MATERIAL_BRICK "brick" -#define MATERIAL_CULT "cult" -#define MATERIAL_CULT_REINFORCED "cult_reinforced" -#define MATERIAL_TITANIUM "titanium" -#define MATERIAL_SAND "sand" -#define MATERIAL_DIONA "biomass" -#define MATERIAL_VAURCA "alien biomass" -#define MATERIAL_TRITIUM "tritium" -#define MATERIAL_HYDROGEN_METALLIC "metallic hydrogen" -#define MATERIAL_ELEVATOR "elevatorium" -#define MATERIAL_SHUTTLE "shuttle" -#define MATERIAL_SHUTTLE_SKRELL "skrell" -#define MATERIAL_RUST "rust" -#define MATERIAL_CARDBOARD "cardboard" -#define MATERIAL_GRAPHITE "graphite" -#define MATERIAL_DEUTERIUM "deuterium" -#define MATERIAL_SUPERMATTER "supermatter" -#define MATERIAL_ALUMINIUM "aluminium" -#define MATERIAL_LEAD "lead" -#define MATERIAL_BORON "boron" +#define MATERIAL_PLASTIC /singleton/material/plastic +#define MATERIAL_PLASTIC_HOLO /singleton/material/plastic/holographic +#define MATERIAL_PLASTEEL /singleton/material/plasteel +#define MATERIAL_STEEL /singleton/material/steel +#define MATERIAL_GLASS /singleton/material/glass +#define MATERIAL_GLASS_REINFORCED /singleton/material/glass/reinforced +#define MATERIAL_GLASS_WIRED /singleton/material/glass/wired +#define MATERIAL_GLASS_PHORON /singleton/material/glass/phoron +#define MATERIAL_GLASS_REINFORCED_PHORON /singleton/material/glass/phoron/reinforced +#define MATERIAL_GOLD /singleton/material/gold +#define MATERIAL_SILVER /singleton/material/silver +#define MATERIAL_DIAMOND /singleton/material/diamond +#define MATERIAL_PHORON /singleton/material/phoron +#define MATERIAL_URANIUM /singleton/material/uranium +#define MATERIAL_SANDSTONE /singleton/material/stone +#define MATERIAL_CONCRETE /singleton/material/concrete +#define MATERIAL_IRON /singleton/material/iron +#define MATERIAL_PLATINUM /singleton/material/platinum +#define MATERIAL_BRONZE /singleton/material/bronze +#define MATERIAL_OSMIUM /singleton/material/osmium +#define MATERIAL_MARBLE /singleton/material/stone/marble +#define MATERIAL_BRICK /singleton/material/stone/brick +#define MATERIAL_CULT /singleton/material/cult +#define MATERIAL_CULT_REINFORCED /singleton/material/cult/reinf +#define MATERIAL_TITANIUM /singleton/material/plasteel/titanium +#define MATERIAL_SAND /singleton/material/sand +#define MATERIAL_DIONA /singleton/material/diona +#define MATERIAL_VAURCA /singleton/material/vaurca +#define MATERIAL_TRITIUM /singleton/material/tritium +#define MATERIAL_HYDROGEN_METALLIC /singleton/material/mhydrogen +#define MATERIAL_ELEVATOR /singleton/material/elevatorium +#define MATERIAL_SHUTTLE /singleton/material/shuttle +#define MATERIAL_SHUTTLE_SKRELL /singleton/material/shuttle/skrell +#define MATERIAL_RUST /singleton/material/rust +#define MATERIAL_CARDBOARD /singleton/material/cardboard +#define MATERIAL_GRAPHITE /singleton/material/graphite +#define MATERIAL_DEUTERIUM /singleton/material/deuterium +#define MATERIAL_SUPERMATTER /singleton/material/phoron/supermatter +#define MATERIAL_ALUMINIUM /singleton/material/aluminium +#define MATERIAL_LEAD /singleton/material/lead +#define MATERIAL_BORON /singleton/material/boron // Leathers and related. -#define MATERIAL_RESIN "resin" -#define MATERIAL_LEATHER "leather" -#define MATERIAL_LEATHER_FINE "fine leather" -#define MATERIAL_BONE "bone" -#define MATERIAL_BONE_CURSED "cursed bone" -#define MATERIAL_HIDE "hide" -#define MATERIAL_HIDE_CORGI "corgi hide" -#define MATERIAL_HIDE_CAT "cat hide" -#define MATERIAL_HIDE_MONKEY "monkey hide" -#define MATERIAL_HIDE_LIZARD "lizard hide" -#define MATERIAL_HIDE_ALIEN "alien hide" -#define MATERIAL_HIDE_HUMAN "human hide" +#define MATERIAL_RESIN /singleton/material/resin +#define MATERIAL_LEATHER /singleton/material/leather +#define MATERIAL_LEATHER_FINE /singleton/material/leather/fine +#define MATERIAL_BONE /singleton/material/bone +#define MATERIAL_BONE_CURSED /singleton/material/bone/necromancer +#define MATERIAL_HIDE /singleton/material/hide +#define MATERIAL_HIDE_CORGI /singleton/material/hide/corgi +#define MATERIAL_HIDE_CAT /singleton/material/hide/cat +#define MATERIAL_HIDE_MONKEY /singleton/material/hide/monkey +#define MATERIAL_HIDE_LIZARD /singleton/material/hide/lizard +#define MATERIAL_HIDE_HUMAN /singleton/material/hide/human +#define MATERIAL_HIDE_BARE /singleton/material/hide/barehide +#define MATERIAL_WET_LEATHER /singleton/material/hide/wetleather // Wood. -#define MATERIAL_WOOD "wood" -#define MATERIAL_BIRCH "birch wood" -#define MATERIAL_MAHOGANY "mahogany wood" -#define MATERIAL_MAPLE "maple wood" -#define MATERIAL_BAMBOO "bamboo wood" -#define MATERIAL_EBONY "ebony wood" -#define MATERIAL_WALNUT "walnut wood" -#define MATERIAL_YEW "yew wood" -#define MATERIAL_WOOD_HOLO "holowood" -#define MATERIAL_WOOD_LOG "log" -#define MATERIAL_WOOD_BRANCH "branch" +#define MATERIAL_WOOD /singleton/material/wood +#define MATERIAL_BIRCH /singleton/material/wood/birch +#define MATERIAL_MAHOGANY /singleton/material/wood/mahogany +#define MATERIAL_MAPLE /singleton/material/wood/maple +#define MATERIAL_BAMBOO /singleton/material/wood/bamboo +#define MATERIAL_EBONY /singleton/material/wood/ebony +#define MATERIAL_WALNUT /singleton/material/wood/walnut +#define MATERIAL_YEW /singleton/material/wood/yew +#define MATERIAL_WOOD_HOLO /singleton/material/wood/holographic +#define MATERIAL_WOOD_LOG /singleton/material/wood/log +#define MATERIAL_WOOD_BRANCH /singleton/material/wood/branch // Cloth and related. -#define MATERIAL_CLOTH "cloth" -#define MATERIAL_COTTON "cotton" -#define MATERIAL_CARPET "carpet" -#define MATERIAL_CARPET_BLACK "carpet_black" -#define MATERIAL_CARPET_BLUE "carpet_blue" -#define MATERIAL_CARPET_CYAN "carpet_cyan" -#define MATERIAL_CARPET_GREEN "carpet_green" -#define MATERIAL_CARPET_ORANGE "carpet_orange" -#define MATERIAL_CARPET_PURPLE "carpet_purple" -#define MATERIAL_CARPET_RED "carpet_red" +#define MATERIAL_CLOTH /singleton/material/cloth +#define MATERIAL_COTTON /singleton/material/cotton +#define MATERIAL_CARPET /singleton/material/carpet +#define MATERIAL_CARPET_BLACK /singleton/material/carpet/black +#define MATERIAL_CARPET_BLUE /singleton/material/carpet/blue +#define MATERIAL_CARPET_CYAN /singleton/material/carpet/cyan +#define MATERIAL_CARPET_GREEN /singleton/material/carpet/green +#define MATERIAL_CARPET_ORANGE /singleton/material/carpet/orange +#define MATERIAL_CARPET_PURPLE /singleton/material/carpet/purple +#define MATERIAL_CARPET_RED /singleton/material/carpet/red #define MATERIAL_ALTERATION_NONE 0 #define MATERIAL_ALTERATION_NAME 1 diff --git a/code/_onclick/item_attack.dm b/code/_onclick/item_attack.dm index de3344d68d6..5144803061f 100644 --- a/code/_onclick/item_attack.dm +++ b/code/_onclick/item_attack.dm @@ -55,6 +55,14 @@ This calls [atom/proc/tool_act], among others. return TRUE return FALSE +/** + * Handles HARM intent attackbys, handling click cooldown, attack anim, visible messaging, and any sounds. + * + * When executed without the HARM intent, it calls base_item_interaction(), which generally handles tool use. + * + * This proc will always return FALSE, letting us proceed to execute child attackby code, except in the case of + * an ITEM_INTERACT_SUCCESS result. That is to say, if we successfully used a tool, we don't do anything else. + */ /atom/movable/attackby(obj/item/attacking_item, mob/user, params) if(..()) return TRUE @@ -77,6 +85,7 @@ This calls [atom/proc/tool_act], among others. if(item_interact_result & ITEM_INTERACT_BLOCKING) return FALSE +/// Handles surgery behaviors. /mob/living/attackby(obj/item/attacking_item, mob/user, params) if(..()) return TRUE @@ -99,6 +108,7 @@ This calls [atom/proc/tool_act], among others. else return attacking_item.attack(src, user, selected_zone) +/// Handles DEVOURING THINGS! Used when on Grab intent and targeting your own mouth! /mob/living/carbon/human/attackby(obj/item/attacking_item, mob/user, params) if(user == src && user.a_intent == I_GRAB && zone_sel?.selecting == BP_MOUTH && can_devour(attacking_item, silent = TRUE)) var/obj/item/blocked = src.check_mouth_coverage() @@ -109,8 +119,8 @@ This calls [atom/proc/tool_act], among others. return TRUE return ..() -// Proximity_flag is 1 if this afterattack was called on something adjacent, in your square, or on your person. -// Click parameters is the params string from byond Click() code, see that documentation. +/// Proximity_flag is 1 if this afterattack was called on something adjacent, in your square, or on your person. +/// Click parameters is the params string from byond Click() code, see that documentation. /obj/item/proc/afterattack(atom/target, mob/user, proximity_flag, click_parameters) return diff --git a/code/controllers/subsystems/materials.dm b/code/controllers/subsystems/materials.dm index aa6aabd1271..700d19e5da4 100644 --- a/code/controllers/subsystems/materials.dm +++ b/code/controllers/subsystems/materials.dm @@ -3,30 +3,25 @@ SUBSYSTEM_DEF(materials) init_order = INIT_ORDER_MISC_FIRST flags = SS_NO_FIRE - var/list/materials var/list/materials_by_name - var/list/autolathe_categories - /datum/controller/subsystem/materials/Initialize() - create_material_lists() + create_material_names_list() return SS_INIT_SUCCESS /** * Initialize the lists of materials, if they are not initialized already */ -/datum/controller/subsystem/materials/proc/create_material_lists() - if(LAZYLEN(materials)) +/datum/controller/subsystem/materials/proc/create_material_names_list() + if(LAZYLEN(materials_by_name)) return - materials = list() materials_by_name = list() - for(var/M in subtypesof(/material)) - var/material/material = new M + for(var/M in subtypesof(/singleton/material)) + var/singleton/material/material = new M if(material.name) - materials += material materials_by_name[lowertext(material.name)] = material /** @@ -36,7 +31,7 @@ SUBSYSTEM_DEF(materials) */ /datum/controller/subsystem/materials/proc/get_material_by_name(var/material_name) if(!materials_by_name) - create_material_lists() + create_material_names_list() . = materials_by_name[material_name] if(!.) stack_trace("SSmaterials received a request for a material that was not found: [material_name].") @@ -47,6 +42,6 @@ SUBSYSTEM_DEF(materials) * * material_name - A string, lowercase, representing the display name of the material */ /datum/controller/subsystem/materials/proc/material_display_name(var/material_name) - var/material/material = get_material_by_name(material_name) + var/singleton/material/material = get_material_by_name(material_name) if(material) - return material.display_name + return material diff --git a/code/game/gamemodes/cult/cultify/obj.dm b/code/game/gamemodes/cult/cultify/obj.dm index 361b3fccc68..1392bda687e 100644 --- a/code/game/gamemodes/cult/cultify/obj.dm +++ b/code/game/gamemodes/cult/cultify/obj.dm @@ -143,10 +143,10 @@ qdel(src) /obj/structure/table/cultify() - if(material == SSmaterials.get_material_by_name(MATERIAL_CULT) || reinforced == SSmaterials.get_material_by_name(MATERIAL_CULT)) + if(material == GET_SINGLETON(MATERIAL_CULT) || reinforced == GET_SINGLETON(MATERIAL_CULT)) return - material = SSmaterials.get_material_by_name(MATERIAL_CULT) - reinforced = SSmaterials.get_material_by_name(MATERIAL_CULT) + material = GET_SINGLETON(MATERIAL_CULT) + reinforced = GET_SINGLETON(MATERIAL_CULT) update_desc() update_connections(1) update_icon() diff --git a/code/game/objects/effects/burnt_wall.dm b/code/game/objects/effects/burnt_wall.dm index 57d7fbd1956..c73c5e9399b 100644 --- a/code/game/objects/effects/burnt_wall.dm +++ b/code/game/objects/effects/burnt_wall.dm @@ -3,15 +3,15 @@ desc = "A wall that had a hole burnt into it. Nasty." icon = 'icons/turf/flooring/plating.dmi' icon_state = "wall_thermite" - var/material/material - var/material/reinf_material + var/singleton/material/material + var/singleton/material/reinf_material /obj/effect/overlay/burnt_wall/Initialize(mapload, new_name, new_mat, new_reinf_mat) . = ..() name = "burnt [new_name]" - material = SSmaterials.get_material_by_name(new_mat) + material = GET_SINGLETON(new_mat) if(new_reinf_mat) - reinf_material = SSmaterials.get_material_by_name(new_reinf_mat) + reinf_material = GET_SINGLETON(new_reinf_mat) color = material.icon_colour if(material.opacity < 0.5) alpha = 125 diff --git a/code/game/objects/effects/chem/foam.dm b/code/game/objects/effects/chem/foam.dm index 6b93e7f42e3..0f89c51f9dd 100644 --- a/code/game/objects/effects/chem/foam.dm +++ b/code/game/objects/effects/chem/foam.dm @@ -208,7 +208,7 @@ to_chat(user, SPAN_NOTICE("There isn't enough material here to construct a wall.")) return TRUE - var/material/M = SSmaterials.get_material_by_name(S.default_type) + var/singleton/material/M = GET_SINGLETON(S.default_type) if(!istype(M)) return TRUE if(M.integrity < 50) diff --git a/code/game/objects/items/easel.dm b/code/game/objects/items/easel.dm index 0292fbf86af..9148c2a0ce2 100644 --- a/code/game/objects/items/easel.dm +++ b/code/game/objects/items/easel.dm @@ -10,7 +10,7 @@ /obj/structure/easel/Initialize(ml, _mat, _reinf_mat) . = ..() RegisterSignal(src, COMSIG_MOVABLE_MOVED, PROC_REF(move_painting)) - material = SSmaterials.get_material_by_name(MATERIAL_WOOD) + material = GET_SINGLETON(MATERIAL_WOOD) /obj/structure/easel/Destroy() painting = null diff --git a/code/game/objects/items/stacks/sheets/glass.dm b/code/game/objects/items/stacks/sheets/glass.dm index cb5c7ace11c..d4780722911 100644 --- a/code/game/objects/items/stacks/sheets/glass.dm +++ b/code/game/objects/items/stacks/sheets/glass.dm @@ -18,7 +18,7 @@ var/created_window = /obj/structure/window/basic var/is_reinforced = 0 var/list/construction_options = list("One Direction", "Full Window") - default_type = "glass" + default_type = MATERIAL_GLASS icon_has_variants = TRUE drop_sound = 'sound/items/drop/glass_sheet.ogg' pickup_sound = 'sound/items/pickup/glass_sheet.ogg' @@ -112,7 +112,7 @@ name = "reinforced glass" singular_name = "reinforced glass sheet" icon_state = "sheet-rglass" - default_type = "reinforced glass" + default_type = MATERIAL_GLASS_REINFORCED created_window = /obj/structure/window/reinforced is_reinforced = 1 construction_options = list("One Direction", "Full Window", "Windoor") @@ -127,7 +127,7 @@ icon = 'icons/obj/item/stacks/tiles.dmi' icon_state = "glass_wire" created_window = null - default_type = "wired glass" + default_type = MATERIAL_GLASS_WIRED construction_options = list() icon_has_variants = FALSE @@ -160,7 +160,7 @@ singular_name = "phoron glass sheet" icon_state = "sheet-phoronglass" created_window = /obj/structure/window/borosilicate - default_type = "phoron glass" + default_type = MATERIAL_GLASS_PHORON icon_has_variants = FALSE /* @@ -170,7 +170,7 @@ name = "reinforced phoron glass" singular_name = "reinforced phoron glass sheet" icon_state = "sheet-phoronrglass" - default_type = "reinforced phoron glass" + default_type = MATERIAL_GLASS_REINFORCED_PHORON created_window = /obj/structure/window/borosilicate/reinforced is_reinforced = 1 icon_has_variants = FALSE diff --git a/code/game/objects/items/stacks/sheets/leather.dm b/code/game/objects/items/stacks/sheets/leather.dm index 6ccc082879b..4edba7d40f0 100644 --- a/code/game/objects/items/stacks/sheets/leather.dm +++ b/code/game/objects/items/stacks/sheets/leather.dm @@ -19,14 +19,14 @@ name = "human skin" desc = "The by-product of human farming." singular_name = "human skin piece" - default_type = "human hide" + default_type = MATERIAL_HIDE_HUMAN /obj/item/stack/material/animalhide/corgi name = "corgi hide" desc = "The by-product of corgi farming." singular_name = "corgi hide piece" icon_state = "sheet-corgi" - default_type = "corgi hide" + default_type = MATERIAL_HIDE_CORGI icon_has_variants = FALSE /obj/item/stack/material/animalhide/cat @@ -34,7 +34,7 @@ desc = "The by-product of cat farming." icon_state = "sheet-cat" singular_name = "cat hide piece" - default_type = "cat hide" + default_type = MATERIAL_HIDE_CAT icon_has_variants = FALSE /obj/item/stack/material/animalhide/monkey @@ -42,7 +42,7 @@ desc = "The by-product of monkey farming." singular_name = "monkey hide piece" icon_state = "sheet-monkey" - default_type = "monkey hide" + default_type = MATERIAL_HIDE_MONKEY icon_has_variants = FALSE /obj/item/stack/material/animalhide/lizard @@ -50,7 +50,7 @@ desc = "Sssssss..." singular_name = "lizard skin piece" icon_state = "sheet-lizard" - default_type = "lizard hide" + default_type = MATERIAL_HIDE_LIZARD icon_has_variants = FALSE hide_type = "scales" @@ -59,7 +59,7 @@ desc = "A hide without fur or scales. Can be tanned into leather." singular_name = "bare hide piece" icon_state = "sheet-hairlesshide" - default_type = "bare hide" + default_type = MATERIAL_HIDE_BARE bare = TRUE /obj/item/stack/material/animalhide/barehide/mechanics_hints(mob/user, distance, is_adjacent) @@ -71,7 +71,7 @@ desc = "This leather has been cleaned but still needs to be dried." singular_name = "wet leather piece" icon_state = "sheet-wetleather" - default_type = "wet leather" + default_type = MATERIAL_WET_LEATHER icon_has_variants = TRUE bare = TRUE var/wetness = 30 //Reduced when exposed to high temperautres or manually dried with a welding tool. diff --git a/code/game/objects/items/weapons/improvised_components.dm b/code/game/objects/items/weapons/improvised_components.dm index 15d962e225e..b9bf070281e 100644 --- a/code/game/objects/items/weapons/improvised_components.dm +++ b/code/game/objects/items/weapons/improvised_components.dm @@ -10,7 +10,7 @@ /obj/item/material/butterflyconstruction/attackby(obj/item/attacking_item, mob/user) if(attacking_item.tool_behaviour == TOOL_SCREWDRIVER) to_chat(user, "You finish the concealed blade weapon.") - new /obj/item/material/knife/butterfly(user.loc, material.name) + new /obj/item/material/knife/butterfly(user.loc, material.type) qdel(src) return @@ -36,7 +36,7 @@ if(istype(attacking_item, /obj/item/material/butterflyblade)) var/obj/item/material/butterflyblade/B = attacking_item to_chat(user, "You attach the two concealed blade parts.") - var/finished = new /obj/item/material/butterflyconstruction(user.loc, B.material.name) + var/finished = new /obj/item/material/butterflyconstruction(user.loc, B.material.type) qdel(attacking_item) qdel(src) user.put_in_hands(finished) @@ -72,7 +72,7 @@ var/obj/item/finished if(istype(attacking_item, /obj/item/material/shard) || istype(attacking_item, /obj/item/material/spearhead)) var/obj/item/material/tmp_shard = attacking_item - finished = new /obj/item/material/twohanded/spear(get_turf(user), tmp_shard.material.name) + finished = new /obj/item/material/twohanded/spear(get_turf(user), tmp_shard.material.type) to_chat(user, SPAN_NOTICE("You fasten \the [attacking_item] to the top of the rod with the cable.")) else if(attacking_item.tool_behaviour == TOOL_WIRECUTTER) finished = new /obj/item/melee/baton/cattleprod(get_turf(user), forward_cable_color) @@ -101,14 +101,14 @@ attack_verb = list("hit", "bludgeoned", "whacked", "bonked") force_divisor = 0.1 thrown_force_divisor = 0.1 - default_material = "wood" + default_material = MATERIAL_WOOD /obj/item/material/shaft/attackby(obj/item/attacking_item, mob/user) ..() var/obj/item/finished if(istype(attacking_item, /obj/item/material/spearhead)) var/obj/item/material/spearhead/tip = attacking_item - finished = new /obj/item/material/twohanded/pike(get_turf(user), tip.material.name) + finished = new /obj/item/material/twohanded/pike(get_turf(user), tip.material.type) to_chat(user, SPAN_NOTICE("You attach \the [attacking_item] to the top of \the [src].")) if(finished) user.drop_from_inventory(src,finished) @@ -130,8 +130,7 @@ attack_verb = list("attacked", "poked") force_divisor = 0.1 thrown_force_divisor = 0.1 - default_material = "steel" - + default_material = MATERIAL_STEEL /obj/item/material/woodenshield name = "shield donut" @@ -140,14 +139,14 @@ icon_state = "shield_fitting_inner" force_divisor = 0.1 thrown_force_divisor = 0.1 - default_material = "wood" + default_material = MATERIAL_WOOD /obj/item/material/woodenshield/attackby(obj/item/attacking_item, mob/user) ..() var/obj/item/finished if(istype(attacking_item, /obj/item/material/shieldbits)) var/obj/item/material/woodenshield/donut = attacking_item - finished = new /obj/item/shield/buckler(get_turf(user), donut.material.name) + finished = new /obj/item/shield/buckler(get_turf(user), donut.material.type) to_chat(user, SPAN_NOTICE("You attach \the [attacking_item] to \the [src].")) if(finished) user.drop_from_inventory(src) @@ -164,7 +163,7 @@ icon_state = "shield_fitting_outer" force_divisor = 0.1 thrown_force_divisor = 0.1 - default_material = "steel" + default_material = MATERIAL_STEEL /obj/item/woodcirclet name = "wood circlet" diff --git a/code/game/objects/items/weapons/material/ashtray.dm b/code/game/objects/items/weapons/material/ashtray.dm index c6832f5e58f..2333f8a8cb0 100644 --- a/code/game/objects/items/weapons/material/ashtray.dm +++ b/code/game/objects/items/weapons/material/ashtray.dm @@ -20,7 +20,7 @@ /obj/item/material/ashtray/persistent_objects_get_content() var/list/content = list() content["fill_count"] = length(contents) - content["material"] = material.name + content["material"] = material.type return content /obj/item/material/ashtray/persistent_objects_apply_content(content, x, y, z) diff --git a/code/game/objects/items/weapons/material/bats.dm b/code/game/objects/items/weapons/material/bats.dm index b06377beeee..e00a4543b5a 100644 --- a/code/game/objects/items/weapons/material/bats.dm +++ b/code/game/objects/items/weapons/material/bats.dm @@ -6,7 +6,7 @@ item_state = "metalbat" throwforce = 7 attack_verb = list("smashed", "beaten", "slammed", "smacked", "struck", "battered", "bonked") - default_material = "wood" + default_material = MATERIAL_WOOD force_divisor = 1.1 // 22 when wielded with weight 20 (steel) unwielded_force_divisor = 0.7 // 15 when unwielded based on above. slot_flags = SLOT_BACK diff --git a/code/game/objects/items/weapons/material/kitchen.dm b/code/game/objects/items/weapons/material/kitchen.dm index d78f4d12138..5ca54d64797 100644 --- a/code/game/objects/items/weapons/material/kitchen.dm +++ b/code/game/objects/items/weapons/material/kitchen.dm @@ -224,7 +224,7 @@ icon_state = "rolling_pin" item_state = "rolling_pin" attack_verb = list("bashed", "battered", "bludgeoned", "thrashed", "whacked") - default_material = "wood" + default_material = MATERIAL_WOOD force_divisor = 0.7 // 10 when wielded with weight 15 (wood) thrown_force_divisor = 1 // as above use_material_name = TRUE diff --git a/code/game/objects/items/weapons/material/material_armor.dm b/code/game/objects/items/weapons/material/material_armor.dm index 88234b5798f..fbdb0116787 100644 --- a/code/game/objects/items/weapons/material/material_armor.dm +++ b/code/game/objects/items/weapons/material/material_armor.dm @@ -22,7 +22,7 @@ Protectiveness | Armor % /obj/item/clothing/suit/armor/material name = "armor" - default_material = DEFAULT_WALL_MATERIAL + default_material = MATERIAL_STEEL /obj/item/clothing/suit/armor/material/makeshift name = "sheet armor" @@ -37,10 +37,10 @@ Protectiveness | Armor % pocket_slots = 1 /obj/item/clothing/suit/armor/material/makeshift/plasteel - default_material = "plasteel" + default_material = MATERIAL_PLASTEEL /obj/item/clothing/suit/armor/material/makeshift/glass - default_material = "glass" + default_material = MATERIAL_GLASS /obj/item/material/armor_plating name = "armor plating" @@ -75,7 +75,7 @@ Protectiveness | Armor % to_chat(user, SPAN_WARNING("Both plates need to be the same type of material.")) return //TODO: Possible better animations - var/obj/item/clothing/suit/armor/material/makeshift/new_armor = new(src.loc, src.material.name) + var/obj/item/clothing/suit/armor/material/makeshift/new_armor = new(src.loc, src.material) user.drop_from_inventory(src,new_armor) user.drop_from_inventory(second_plate,new_armor) user.put_in_hands(new_armor) @@ -116,7 +116,7 @@ Protectiveness | Armor % var/obj/item/stack/material/S = attacking_item if(S.use(2)) to_chat(user, SPAN_NOTICE("You apply some [S.material.use_name] to \the [src]. ")) - var/obj/item/clothing/head/helmet/material/makeshift/helmet = new(null, S.material.name) + var/obj/item/clothing/head/helmet/material/makeshift/helmet = new(null, S.material.type) user.put_in_hands(helmet) user.drop_from_inventory(src) qdel(src) @@ -129,7 +129,7 @@ Protectiveness | Armor % /obj/item/clothing/head/helmet/material name = "helmet" flags_inv = HIDEEARS|HIDEEYES|BLOCKHAIR - default_material = DEFAULT_WALL_MATERIAL + default_material = MATERIAL_STEEL has_storage = FALSE /obj/item/clothing/head/helmet/material/makeshift @@ -141,7 +141,7 @@ Protectiveness | Armor % contained_sprite = 1 /obj/item/clothing/head/helmet/material/makeshift/plasteel - default_material = "plasteel" + default_material = MATERIAL_PLASTEEL /obj/item/clothing/suit/armor/material/makeshift/trenchcoat name = "armored trenchcoat" @@ -156,7 +156,7 @@ Protectiveness | Armor % var/obj/item/clothing/suit/storage/toggle/trench/kelly = attacking_item user.drop_from_inventory(src) user.drop_from_inventory(kelly) - var/obj/item/clothing/suit/armor/material/makeshift/trenchcoat/new_armor = new(null, src.material.name) + var/obj/item/clothing/suit/armor/material/makeshift/trenchcoat/new_armor = new(null, src.material.type) user.put_in_hands(new_armor) qdel(src) qdel(kelly) diff --git a/code/game/objects/items/weapons/material/material_weapons.dm b/code/game/objects/items/weapons/material/material_weapons.dm index 909e3e1f887..4a5ea938519 100644 --- a/code/game/objects/items/weapons/material/material_weapons.dm +++ b/code/game/objects/items/weapons/material/material_weapons.dm @@ -20,8 +20,8 @@ var/max_force = 40 //any damage above this is added to armor penetration value var/max_pen = 100 //any penetration above this value is ignored var/thrown_force_divisor = 0.5 - var/default_material = DEFAULT_WALL_MATERIAL - var/material/material + var/default_material = MATERIAL_STEEL + var/singleton/material/material var/drops_debris = TRUE /// Multiplies the amount this item is worth with the following calculation: material.value * worth_multiplier @@ -59,7 +59,7 @@ throwforce = round(material.get_blunt_damage()*thrown_force_divisor) /obj/item/material/proc/set_material(var/new_material) - material = SSmaterials.get_material_by_name(new_material) + material = GET_SINGLETON(new_material) if(!material) qdel(src) else diff --git a/code/game/objects/items/weapons/material/shards.dm b/code/game/objects/items/weapons/material/shards.dm index 94d48999bd5..00f8531500e 100644 --- a/code/game/objects/items/weapons/material/shards.dm +++ b/code/game/objects/items/weapons/material/shards.dm @@ -14,7 +14,7 @@ thrown_force_divisor = 0.4 // 4 with weight 15 (glass) item_state = "shard-glass" attack_verb = list("stabbed", "slashed", "sliced", "cut") - default_material = "glass" + default_material = MATERIAL_GLASS unbreakable = 1 //It's already broken. drops_debris = FALSE drop_sound = 'sound/effects/glass_step.ogg' diff --git a/code/game/objects/items/weapons/material/swords.dm b/code/game/objects/items/weapons/material/swords.dm index c2cfceb1b83..f8f109c0e36 100644 --- a/code/game/objects/items/weapons/material/swords.dm +++ b/code/game/objects/items/weapons/material/swords.dm @@ -196,7 +196,7 @@ /obj/item/material/sword_hilt/attackby(obj/item/attacking_item, mob/user) if(istype(attacking_item, /obj/item/material/sword_blade)) var/obj/item/material/sword_blade/blade = attacking_item - var/obj/item/material/sword/improvised_sword/new_sword = new(src.loc, blade.material.name) + var/obj/item/material/sword/improvised_sword/new_sword = new(src.loc, blade.material.type) new_sword.hilt = src user.drop_from_inventory(src,new_sword) user.drop_from_inventory(blade,new_sword) @@ -219,7 +219,7 @@ /obj/item/material/sword_blade/attackby(obj/item/attacking_item, mob/user) if(istype(attacking_item, /obj/item/material/sword_hilt)) var/obj/item/material/sword_hilt/hilt = attacking_item - var/obj/item/material/sword/improvised_sword/new_sword = new(src.loc, src.material.name) + var/obj/item/material/sword/improvised_sword/new_sword = new(src.loc, src.material.type) new_sword.hilt = hilt.material new_sword.assignDescription() user.drop_from_inventory(src,new_sword) diff --git a/code/game/objects/items/weapons/material/twohanded.dm b/code/game/objects/items/weapons/material/twohanded.dm index 3c327178ceb..bef52645314 100644 --- a/code/game/objects/items/weapons/material/twohanded.dm +++ b/code/game/objects/items/weapons/material/twohanded.dm @@ -172,7 +172,7 @@ w_class = WEIGHT_CLASS_HUGE icon_state = "offhand" name = "offhand" - default_material = "placeholder" + default_material = MATERIAL_STEEL drop_sound = null pickup_sound = null equip_sound = null @@ -258,7 +258,7 @@ sharp = 0 mob_throw_hit_sound = 'sound/weapons/pierce.ogg' attack_verb = list("attacked", "poked", "jabbed", "torn", "gored") - default_material = "glass" + default_material = MATERIAL_GLASS var/obj/item/grenade/explosive = null use_material_sound = FALSE worth_multiplier = 7 //blade + stuff @@ -290,7 +290,7 @@ MA.layer = FLOAT_LAYER HS.AddOverlays(MA) HS.name = "[attacking_item.name] on a spear" - HS.material = material.name + HS.material = material.type qdel(src) return @@ -374,7 +374,7 @@ attack_verb = list("chopped", "sliced", "shredded", "slashed", "cut", "ripped") can_embed = FALSE applies_material_colour = FALSE - default_material = "steel" + default_material = MATERIAL_STEEL parry_chance = 5 var/fuel_type = /singleton/reagent/fuel var/opendelay = 30 // How long it takes to perform a door opening action with this chainsaw, in seconds. @@ -418,7 +418,7 @@ fuel_cost = 0.5 unbreakable = TRUE parry_chance = 100 //Gotta punish those validhunters - default_material = "plasteel" + default_material = MATERIAL_PLASTEEL /obj/item/material/twohanded/chainsaw/op/Initialize() . = ..() @@ -560,7 +560,7 @@ w_class = WEIGHT_CLASS_BULKY slot_flags = SLOT_BACK attack_verb = list("attacked", "poked", "jabbed", "gored", "stabbed") - default_material = "steel" + default_material = MATERIAL_STEEL reach = 2 applies_material_colour = 0 can_embed = 0 @@ -599,7 +599,7 @@ desc = "For the republic!" icon_state = "flag_biesel0" base_icon = "flag_biesel" - default_material = "bronze" + default_material = MATERIAL_STEEL can_embed = 1 use_material_name = FALSE unbreakable = TRUE @@ -665,7 +665,7 @@ edge = TRUE sharp = 1 attack_verb = list("attacked", "chopped", "cleaved", "torn", "cut") - default_material = "steel" + default_material = MATERIAL_STEEL parry_chance = 60 can_embed = 0 worth_multiplier = 35 diff --git a/code/game/objects/structures.dm b/code/game/objects/structures.dm index 766a38cd711..f30bf7e2197 100644 --- a/code/game/objects/structures.dm +++ b/code/game/objects/structures.dm @@ -14,17 +14,16 @@ /// Footstep sounds when stepped on var/list/footstep_sound - var/material/material + var/singleton/material/material /// Used by some structures to determine into how many pieces they should disassemble into or be made with var/build_amt = 2 - /// Amount that pulling mobs have their movement delayed by var/slowdown = 0 /obj/structure/Initialize(mapload) . = ..() if(!isnull(material) && !istype(material)) - material = SSmaterials.get_material_by_name(material) + material = GET_SINGLETON(material) if (!mapload) updateVisibility(src) // No point checking this before visualnet initializes. if(climbable) @@ -101,9 +100,9 @@ add_damage(maxhealth * 0.25) /obj/structure/proc/dismantle() - var/material/dismantle_material + var/singleton/material/dismantle_material if(!get_material()) - dismantle_material = SSmaterials.get_material_by_name(DEFAULT_WALL_MATERIAL) //if there is no defined material, it will use steel + dismantle_material = GET_SINGLETON(MATERIAL_STEEL) else dismantle_material = get_material() if(should_use_health && health <= 0) diff --git a/code/game/objects/structures/_machinery.dm b/code/game/objects/structures/_machinery.dm index 574e007f162..24fbd4672e7 100644 --- a/code/game/objects/structures/_machinery.dm +++ b/code/game/objects/structures/_machinery.dm @@ -117,19 +117,19 @@ Class Procs: var/power_init_complete = FALSE /// What power channel does this fall under in APCs? Possible channels include: AREA_USAGE_EQUIP, AREA_USAGE_ENVIRON or AREA_USAGE_LIGHT var/power_channel = AREA_USAGE_EQUIP - - /* List of types that should be spawned as component_parts for this machine. - Structure: - type -> num_objects - - num_objects is optional, and will be treated as 1 if omitted. - - example: - component_types = list( - /obj/foo/bar, - /obj/baz = 2 - ) - */ + /** + * List of types that should be spawned as component_parts for this machine. + * Structure: + * type -> num_objects + * + * num_objects is optional, and will be treated as 1 if omitted. + * + * example: + * component_types = list( + * /obj/foo/bar, + * /obj/baz = 2 + * ) + **/ var/list/component_types /// List of all the parts used to build it, if made from certain kinds of frames. var/list/component_parts = null diff --git a/code/game/objects/structures/bonfire.dm b/code/game/objects/structures/bonfire.dm index 917c26fbf38..1e24ebb972e 100644 --- a/code/game/objects/structures/bonfire.dm +++ b/code/game/objects/structures/bonfire.dm @@ -102,7 +102,7 @@ GLOBAL_LIST_EMPTY(total_active_bonfires) return else if(istype(attacking_item, /obj/item/material)) var/obj/item/material/M = attacking_item - if(M.material.name in burnable_materials) + if(M.material.type in burnable_materials) var/fuel_add = burnable_materials[M.material] * (M.w_class / 5) //if you crafted a small item, it's not worth as much fuel fuel = min(fuel + fuel_add, max_fuel) user.visible_message(SPAN_NOTICE("\The [user] tosses \the [M] into \the [src].")) @@ -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 = SSmaterials.get_material_by_name(material_name) + material = GET_SINGLETON(material_name) if(!material) qdel(src) return diff --git a/code/game/objects/structures/carts/carts.dm b/code/game/objects/structures/carts/carts.dm index 762d9d34b6c..75edd5478e5 100644 --- a/code/game/objects/structures/carts/carts.dm +++ b/code/game/objects/structures/carts/carts.dm @@ -6,7 +6,7 @@ ABSTRACT_TYPE(/obj/structure/cart) density = TRUE climbable = TRUE build_amt = 15 - material = DEFAULT_WALL_MATERIAL + material = MATERIAL_STEEL slowdown = 0 atom_flags = CRITICAL_ATOM var/movesound = 'sound/effects/roll.ogg' diff --git a/code/game/objects/structures/curtains.dm b/code/game/objects/structures/curtains.dm index da8479faf2b..a6f56f5d9d8 100644 --- a/code/game/objects/structures/curtains.dm +++ b/code/game/objects/structures/curtains.dm @@ -12,7 +12,7 @@ /obj/structure/curtain/Initialize() . = ..() - material = SSmaterials.get_material_by_name(curtain_material) + material = GET_SINGLETON(curtain_material) AddComponent(/datum/component/turf_hand) /obj/structure/curtain/open diff --git a/code/game/objects/structures/fluff/evidenceshelf.dm b/code/game/objects/structures/fluff/evidenceshelf.dm index 4403b1cd0ad..4306b187816 100644 --- a/code/game/objects/structures/fluff/evidenceshelf.dm +++ b/code/game/objects/structures/fluff/evidenceshelf.dm @@ -7,7 +7,7 @@ anchored = TRUE opacity = TRUE climbable = TRUE - material = DEFAULT_WALL_MATERIAL + material = MATERIAL_STEEL /obj/structure/fluff/evidenceshelf/attackby(obj/item/attacking_item, mob/user) diff --git a/code/game/objects/structures/girders.dm b/code/game/objects/structures/girders.dm index 0962e89ba82..2bf23a6a45d 100644 --- a/code/game/objects/structures/girders.dm +++ b/code/game/objects/structures/girders.dm @@ -12,7 +12,7 @@ /// How much cover the girder provides against projectiles. var/cover = 50 build_amt = 2 - var/material/reinf_material + var/singleton/material/reinf_material var/reinforcing = 0 var/plating = FALSE @@ -232,7 +232,7 @@ to_chat(user, SPAN_NOTICE("There isn't enough material here to construct a wall.")) return 0 - var/material/material = SSmaterials.get_material_by_name(mat_stack.default_type) + var/singleton/material/material = GET_SINGLETON(mat_stack.default_type) 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/material/material = SSmaterials.get_material_by_name(mat_stack.default_type) + var/singleton/material/material = GET_SINGLETON(mat_stack.default_type) 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/machinery/deployable.dm b/code/game/objects/structures/machinery/deployable.dm index 057410ea2e2..5292769d5f8 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 = SSmaterials.get_material_by_name(material_name) + material = GET_SINGLETON(material_name) if(!material) qdel(src) return diff --git a/code/game/objects/structures/machinery/doors/airlock.dm b/code/game/objects/structures/machinery/doors/airlock.dm index 9a7530daa70..038e27ce9e7 100644 --- a/code/game/objects/structures/machinery/doors/airlock.dm +++ b/code/game/objects/structures/machinery/doors/airlock.dm @@ -54,8 +54,6 @@ var/obj/structure/machinery/door/airlock/close_other /// The ID of the connected door to close. var/close_other_id - /// String (One of `MATERIAL_*`). The material the door is made from. If not set, defaults to steel. - var/mineral /// Boolean. Whether or not the door's safeties are enabled. Tied to the safety wire. var/safe = TRUE /// Airlock electronics. @@ -127,7 +125,7 @@ /// String (One of `MATERIAL_*`). The material used for the door's window if `glass` is set. Used to set `window_material` during init. var/init_material_window = MATERIAL_GLASS /// The material of the door's window. - var/material/window_material + var/singleton/material/window_material hashatch = TRUE @@ -243,7 +241,7 @@ if (glass) paintable |= AIRLOCK_PAINTABLE_WINDOW - window_material = SSmaterials.get_material_by_name(init_material_window) + window_material = GET_SINGLETON(init_material_window) opacity = FALSE update_icon() @@ -284,9 +282,9 @@ ..() /obj/structure/machinery/door/airlock/get_material() - if(mineral) - return SSmaterials.get_material_by_name(mineral) - return SSmaterials.get_material_by_name(DEFAULT_WALL_MATERIAL) + if(material) + return GET_SINGLETON(material) + return GET_SINGLETON(MATERIAL_STEEL) /obj/structure/machinery/door/airlock/external//External airlocks start here name = "external airlock" @@ -718,23 +716,23 @@ /obj/structure/machinery/door/airlock/gold name = "Gold Airlock" door_color = COLOR_GOLD - mineral = "gold" + material = MATERIAL_GOLD /obj/structure/machinery/door/airlock/silver name = "Silver Airlock" door_color = COLOR_SILVER - mineral = "silver" + material = MATERIAL_SILVER /obj/structure/machinery/door/airlock/diamond name = "Diamond Airlock" door_color = COLOR_DIAMOND - mineral = "diamond" + material = MATERIAL_DIAMOND maxhealth = OBJECT_HEALTH_EXTREMELY_HIGH /obj/structure/machinery/door/airlock/sandstone name = "Sandstone Airlock" door_color = COLOR_BEIGE - mineral = "sandstone" + material = MATERIAL_SANDSTONE /obj/structure/machinery/door/airlock/palepurple door_color = COLOR_PURPLE @@ -784,6 +782,7 @@ MELEE = ARMOR_MELEE_MINOR, BULLET = ARMOR_BALLISTIC_MINOR ) + material = MATERIAL_DIONA /// Placeholder object until it gets new sprites. /obj/structure/machinery/door/airlock/diona/external @@ -794,7 +793,7 @@ name = "Uranium Airlock" desc = "And they said I was crazy." door_color = COLOR_GREEN - mineral = "uranium" + material = MATERIAL_URANIUM var/last_event = 0 /obj/structure/machinery/door/airlock/uranium/process() @@ -809,7 +808,7 @@ name = "Phoron Airlock" desc = "No way this can end badly." door_color = COLOR_VIOLET - mineral = MATERIAL_PHORON + material = MATERIAL_PHORON /obj/structure/machinery/door/airlock/phoron/fire_act(exposed_temperature, exposed_volume) . = ..() @@ -1719,8 +1718,8 @@ About the new airlock wires panel: da.set_dir(src.dir) da.anchored = 1 - if(mineral) - da.glass = mineral + if(material) + da.glass = material else if(glass && !da.glass) da.glass = 1 da.state = 1 diff --git a/code/game/objects/structures/machinery/doors/firedoor.dm b/code/game/objects/structures/machinery/doors/firedoor.dm index 363e7eb0730..6538fc754a9 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 SSmaterials.get_material_by_name(DEFAULT_WALL_MATERIAL) + return GET_SINGLETON(DEFAULT_WALL_MATERIAL) /obj/structure/machinery/door/firedoor/CollidedWith(atom/bumped_atom) if(p_open || operating) diff --git a/code/game/objects/structures/machinery/mecha_fabricator.dm b/code/game/objects/structures/machinery/mecha_fabricator.dm index 393cb48518f..d798d833035 100644 --- a/code/game/objects/structures/machinery/mecha_fabricator.dm +++ b/code/game/objects/structures/machinery/mecha_fabricator.dm @@ -231,7 +231,7 @@ var/obj/item/stack/material/M = attacking_item if(!M.material) return ..() - if(!(M.material.name in list(MATERIAL_STEEL, MATERIAL_GLASS, MATERIAL_GOLD, MATERIAL_SILVER, MATERIAL_DIAMOND, MATERIAL_PHORON, MATERIAL_URANIUM, MATERIAL_PLASTEEL, MATERIAL_ALUMINIUM, MATERIAL_LEAD))) + if(!(M.material.type in list(MATERIAL_STEEL, MATERIAL_GLASS, MATERIAL_GOLD, MATERIAL_SILVER, MATERIAL_DIAMOND, MATERIAL_PHORON, MATERIAL_URANIUM, MATERIAL_PLASTEEL, MATERIAL_ALUMINIUM, MATERIAL_LEAD))) to_chat(user, SPAN_WARNING("\The [src] cannot hold [M.material.name].")) return TRUE @@ -465,7 +465,7 @@ if(!amount) return material = lowertext(material) - var/material/mattype = SSmaterials.get_material_by_name(material) + var/singleton/material/mattype = GET_SINGLETON(material) var/stack_type = mattype.stack_type var/real_amount = round(amount / SHEET_MATERIAL_AMOUNT) diff --git a/code/game/objects/structures/plasticflaps.dm b/code/game/objects/structures/plasticflaps.dm index 30ed9983ea3..96f211e702f 100644 --- a/code/game/objects/structures/plasticflaps.dm +++ b/code/game/objects/structures/plasticflaps.dm @@ -23,7 +23,7 @@ /obj/structure/plasticflaps/Initialize() . = ..() - material = SSmaterials.get_material_by_name(MATERIAL_PLASTIC) + material = GET_SINGLETON(MATERIAL_PLASTIC) update_icon() /obj/structure/plasticflaps/update_icon() diff --git a/code/game/objects/structures/railing.dm b/code/game/objects/structures/railing.dm index 5350db06dcd..2e0313a7cf6 100644 --- a/code/game/objects/structures/railing.dm +++ b/code/game/objects/structures/railing.dm @@ -66,7 +66,7 @@ /obj/structure/railing/mapped/no_density/low icon_state = "railing0-0" -/obj/structure/railing/New(var/newloc, var/material_key = DEFAULT_WALL_MATERIAL) +/obj/structure/railing/New(var/newloc, var/material_key = MATERIAL_STEEL) material = material_key // Converted to datum in initialize(). ..(newloc) @@ -81,7 +81,7 @@ if(!non_material_object) if(!isnull(material) && !istype(material)) - material = SSmaterials.get_material_by_name(material) + material = GET_SINGLETON(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 6c3d00a8e1e..05d4f70965b 100644 --- a/code/game/objects/structures/simple_doors.dm +++ b/code/game/objects/structures/simple_doors.dm @@ -30,11 +30,11 @@ health -= material.combustion_effect(get_turf(src),temperature, 0.3) CheckHealth() -/obj/structure/simple_door/New(var/newloc, var/material_name, var/locked) +/obj/structure/simple_door/New(var/newloc, var/newmaterial, var/locked) ..() - if(!material_name) - material_name = DEFAULT_WALL_MATERIAL - material = SSmaterials.get_material_by_name(material_name) + if(!newmaterial) + newmaterial = MATERIAL_STEEL + material = GET_SINGLETON(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 d1a4c0e5612..edda12325a5 100644 --- a/code/game/objects/structures/stool_bed_chair_nest/bed.dm +++ b/code/game/objects/structures/stool_bed_chair_nest/bed.dm @@ -25,23 +25,27 @@ buckle_lying = 1 build_amt = 2 pass_flags_self = PASSTABLE - var/material/padding_material + var/singleton/material/padding_material var/base_icon = "bed" var/buckling_sound = 'sound/effects/buckle.ogg' - var/painted_colour // Used for paint gun and preset colours. I know this name sucks. + /// Used for paint gun and preset colours. I know this name sucks. + var/painted_colour var/can_dismantle = TRUE var/can_pad = TRUE var/makes_rolling_sound = FALSE - var/held_item = null // Set to null if you don't want people to pick this up. + /// Set to null if you don't want people to pick this up. + var/held_item = null slowdown = 2.5 - var/driving = FALSE // Shit for wheelchairs. Doesn't really get used here, but it's for code cleanliness. + /// Shit for wheelchairs. Doesn't really get used here, but it's for code cleanliness. + var/driving = FALSE var/mob/living/pulling = null - var/propelled = 0 // Check for fire-extinguisher-driven chairs + /// Check for fire-extinguisher-driven chairs + var/propelled = 0 /obj/structure/bed/mechanics_hints() . = list() @@ -76,12 +80,12 @@ /obj/structure/bed/New(newloc, new_material = MATERIAL_STEEL, new_padding_material, new_painted_colour) ..(newloc) - material = SSmaterials.get_material_by_name(new_material) + material = GET_SINGLETON(new_material) if(!istype(material)) qdel(src) return if(new_padding_material) - padding_material = SSmaterials.get_material_by_name(new_padding_material) + padding_material = GET_SINGLETON(new_padding_material) if(new_painted_colour) painted_colour = new_painted_colour update_icon() @@ -104,7 +108,7 @@ generate_overlay_cache(padding_material, CACHE_TYPE_PADDING, apply_painted_colour = TRUE) /obj/structure/bed/proc/generate_overlay_cache(var/new_material, var/cache_type, var/cache_layer = layer, var/apply_painted_colour = FALSE) // Cache type refers to what cache we're making. Material type refers if we're taking from the padding or the chair material itself. - var/material/overlay_material = new_material + var/singleton/material/overlay_material = new_material var/list/furniture_cache = SSicon_cache.furniture_cache var/cache_key = "[base_icon]-[overlay_material.name]" // Basically, generates a cache key for an overlay. if(cache_type) @@ -180,7 +184,7 @@ else if(istype(attacking_item,/obj/item/stack/material)) var/obj/item/stack/material/M = attacking_item if(M.material && (M.material.flags & MATERIAL_PADDING)) - padding_type = "[M.material.name]" + padding_type = M.material.type if(!padding_type) to_chat(user, "You cannot pad \the [src] with that.") return @@ -249,8 +253,8 @@ generate_strings(TRUE) update_icon() -/obj/structure/bed/proc/add_padding(padding_type) - padding_material = SSmaterials.get_material_by_name(padding_type) +/obj/structure/bed/proc/add_padding(var/padding_type) + padding_material = GET_SINGLETON(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 5cb671b89f4..1fe9be35c11 100644 --- a/code/game/objects/structures/stool_bed_chair_nest/stools.dm +++ b/code/game/objects/structures/stool_bed_chair_nest/stools.dm @@ -21,7 +21,7 @@ if(!held_item || use_check_and_message(user) || buckled || (anchored && padding_material)) // Make sure held_item = null if you don't want it to get picked up. return user.visible_message(SPAN_NOTICE("[user] [withdraw_verb]s \the [src.name]."), SPAN_NOTICE("You [withdraw_verb] \the [src.name].")) - var/obj/item/material/stool/S = new held_item(src.loc, material.name, padding_material?.name, painted_colour) // Handles all the material code so you don't have to. + var/obj/item/material/stool/S = new held_item(src.loc, material.type, padding_material?.type, painted_colour) // Handles all the material code so you don't have to. if(material_alteration & MATERIAL_ALTERATION_COLOR) // For snowflakes like wood chairs. S.color = material.icon_colour if(material_alteration & MATERIAL_ALTERATION_NAME) @@ -182,7 +182,7 @@ force_divisor = 0.4 w_class = WEIGHT_CLASS_HUGE contained_sprite = TRUE - var/material/padding_material + var/singleton/material/padding_material var/obj/structure/bed/stool/origin_type = /obj/structure/bed/stool var/deploy_verb = "right" var/painted_colour @@ -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 = SSmaterials.get_material_by_name(new_padding_material) + padding_material = GET_SINGLETON(new_padding_material) if(new_painted_colour) painted_colour = new_painted_colour update_icon() @@ -242,7 +242,7 @@ user.visible_message(SPAN_NOTICE("[user] [deploy_verb]s \the [src.name]."), SPAN_NOTICE("You [deploy_verb] \the [name].")) // playsound(src, deploy_sound ? deploy_sound : drop_sound, DROP_SOUND_VOLUME) user.drop_from_inventory(src) - var/obj/structure/bed/stool/S = new origin_type(get_turf(loc), material?.name, padding_material?.name, painted_colour) // Fuck me. + var/obj/structure/bed/stool/S = new origin_type(get_turf(loc), material?.type, padding_material?.type, painted_colour) // Fuck me. S.dir = user.dir // Plant it where the user's facing if(blood_DNA) S.blood_DNA |= blood_DNA // Transfer blood. diff --git a/code/game/objects/structures/target_stake.dm b/code/game/objects/structures/target_stake.dm index b636261e24c..11e302046e4 100644 --- a/code/game/objects/structures/target_stake.dm +++ b/code/game/objects/structures/target_stake.dm @@ -11,7 +11,7 @@ /obj/structure/target_stake/Initialize(mapload) . = ..() - material = SSmaterials.get_material_by_name(MATERIAL_STEEL) + material = GET_SINGLETON(MATERIAL_STEEL) /obj/structure/target_stake/attackby(obj/item/attacking_item, mob/user) if(istype(attacking_item, /obj/item/target)) diff --git a/code/game/turfs/simulated/floor.dm b/code/game/turfs/simulated/floor.dm index b86db50919a..0d89b1a29cf 100644 --- a/code/game/turfs/simulated/floor.dm +++ b/code/game/turfs/simulated/floor.dm @@ -17,7 +17,7 @@ var/flooring_override var/initial_flooring var/singleton/flooring/flooring - var/mineral = DEFAULT_WALL_MATERIAL + var/mineral = MATERIAL_STEEL thermal_conductivity = 0.040 heat_capacity = 10000 diff --git a/code/game/turfs/simulated/shuttle_turfs.dm b/code/game/turfs/simulated/shuttle_turfs.dm index 4ce0e424895..18ce86126f0 100644 --- a/code/game/turfs/simulated/shuttle_turfs.dm +++ b/code/game/turfs/simulated/shuttle_turfs.dm @@ -164,7 +164,7 @@ color = COLOR_MUTED_BROWN /turf/simulated/wall/shuttle/skrell/Initialize(mapload) - . = ..(mapload,"skrell") + . = ..(mapload, MATERIAL_SHUTTLE_SKRELL) /turf/simulated/wall/shuttle/scc color = "#AAAFC7" diff --git a/code/game/turfs/simulated/wall_icon.dm b/code/game/turfs/simulated/wall_icon.dm index 354b02315e5..a7e98ec6844 100644 --- a/code/game/turfs/simulated/wall_icon.dm +++ b/code/game/turfs/simulated/wall_icon.dm @@ -7,7 +7,7 @@ else construction_stage = null if(!material) - material = SSmaterials.get_material_by_name(DEFAULT_WALL_MATERIAL) + material = GET_SINGLETON(MATERIAL_STEEL) if(material) explosion_resistance = material.explosion_resistance if (material.wall_icon) @@ -38,7 +38,7 @@ update_icon() -/turf/simulated/wall/proc/set_material(var/material/newmaterial, var/material/newrmaterial) +/turf/simulated/wall/proc/set_material(var/singleton/material/newmaterial, var/singleton/material/newrmaterial) material = newmaterial reinf_material = newrmaterial update_material() diff --git a/code/game/turfs/simulated/wall_types.dm b/code/game/turfs/simulated/wall_types.dm index bef35dfa330..a67b5653056 100644 --- a/code/game/turfs/simulated/wall_types.dm +++ b/code/game/turfs/simulated/wall_types.dm @@ -11,7 +11,7 @@ Pry off the sheath with a crowbar to expose the girder." /turf/simulated/wall/r_wall/Initialize(mapload) - . = ..(mapload, "plasteel","plasteel") //3strong + . = ..(mapload, MATERIAL_PLASTEEL,MATERIAL_PLASTEEL) //3strong /turf/simulated/wall/cult icon_state = "cult" diff --git a/code/game/turfs/simulated/walls.dm b/code/game/turfs/simulated/walls.dm index 6ada1a0b148..3d0a6a21812 100644 --- a/code/game/turfs/simulated/walls.dm +++ b/code/game/turfs/simulated/walls.dm @@ -31,8 +31,8 @@ var/global/damage_overlays[16] var/active var/can_open = 0 - var/material/material - var/material/reinf_material + var/singleton/material/material + var/singleton/material/reinf_material var/last_state var/construction_stage var/use_set_icon_state @@ -100,10 +100,10 @@ if(!use_set_icon_state) icon_state = "blank" if(!materialtype) - materialtype = DEFAULT_WALL_MATERIAL - material = SSmaterials.get_material_by_name(materialtype) + materialtype = MATERIAL_STEEL + material = GET_SINGLETON(materialtype) if(!isnull(rmaterialtype)) - reinf_material = SSmaterials.get_material_by_name(rmaterialtype) + reinf_material = GET_SINGLETON(rmaterialtype) update_material() hitsound = material.hitsound set_maxhealth(material.integrity + (reinf_material ? reinf_material.integrity : 0), TRUE) @@ -233,7 +233,7 @@ INVOKE_ASYNC(src, PROC_REF(clear_plants)) clear_bulletholes() - material = SSmaterials.get_material_by_name("placeholder") + material = GET_SINGLETON(MATERIAL_STEEL) reinf_material = null if (!no_change) diff --git a/code/modules/atmospherics/components/binary_devices/oxyregenerator.dm b/code/modules/atmospherics/components/binary_devices/oxyregenerator.dm index 8a431ed01d1..c3eabe897b3 100644 --- a/code/modules/atmospherics/components/binary_devices/oxyregenerator.dm +++ b/code/modules/atmospherics/components/binary_devices/oxyregenerator.dm @@ -127,7 +127,7 @@ carbon_stored += co2_intake * carbon_efficiency while (carbon_stored >= carbon_moles_per_piece) carbon_stored -= carbon_moles_per_piece - var/material/M = SSmaterials.get_material_by_name(MATERIAL_GRAPHITE) + var/singleton/material/M = GET_SINGLETON(MATERIAL_GRAPHITE) M.place_sheet(get_turf(src), 1, M.name) power_draw = power_rating * co2_intake last_power_draw = power_draw diff --git a/code/modules/clothing/clothing.dm b/code/modules/clothing/clothing.dm index bb58a969f5a..a938aac4d42 100644 --- a/code/modules/clothing/clothing.dm +++ b/code/modules/clothing/clothing.dm @@ -25,7 +25,7 @@ var/list/refittable_species //used with modkits, which species it can be refit to //material things - var/material/material = null + var/singleton/material/material = null var/applies_material_color = TRUE var/unbreakable = FALSE var/default_material = null // Set this to something else if you want material attributes on init. @@ -287,7 +287,7 @@ return material /obj/item/clothing/proc/set_material(var/new_material) - material = SSmaterials.get_material_by_name(new_material) + material = GET_SINGLETON(new_material) if(!material) qdel(src) else diff --git a/code/modules/clothing/rings/material.dm b/code/modules/clothing/rings/material.dm index 2903a159996..7bd50514d5a 100644 --- a/code/modules/clothing/rings/material.dm +++ b/code/modules/clothing/rings/material.dm @@ -6,8 +6,8 @@ /obj/item/clothing/ring/material/Initialize(var/mapload, var/new_material) . = ..(mapload) if(!new_material) - new_material = DEFAULT_WALL_MATERIAL - material = SSmaterials.get_material_by_name(new_material) + new_material = MATERIAL_STEEL + material = GET_SINGLETON(new_material) if(!istype(material)) qdel(src) return diff --git a/code/modules/cooking/machinery/cooking_machines/container.dm b/code/modules/cooking/machinery/cooking_machines/container.dm index 719aa995fbb..f70fe1ab2c4 100644 --- a/code/modules/cooking/machinery/cooking_machines/container.dm +++ b/code/modules/cooking/machinery/cooking_machines/container.dm @@ -184,10 +184,10 @@ /obj/item/reagent_containers/cooking_container/skillet/Initialize(var/mapload, var/mat_key) . = ..(mapload) - var/material/material = SSmaterials.get_material_by_name(mat_key || MATERIAL_STEEL) + var/singleton/material/material = GET_SINGLETON(mat_key || MATERIAL_STEEL) if(!material) return - if(material.name != MATERIAL_STEEL) + if(material.type != MATERIAL_STEEL) color = material.icon_colour name = "[material.display_name] [initial(name)]" @@ -205,10 +205,10 @@ /obj/item/reagent_containers/cooking_container/saucepan/Initialize(var/mapload, var/mat_key) . = ..(mapload) - var/material/material = SSmaterials.get_material_by_name(mat_key || MATERIAL_STEEL) + var/singleton/material/material = GET_SINGLETON(mat_key || MATERIAL_STEEL) if(!material) return - if(material.name != MATERIAL_STEEL) + if(material.type != MATERIAL_STEEL) color = material.icon_colour name = "[material.display_name] [initial(name)]" @@ -227,7 +227,7 @@ /obj/item/reagent_containers/cooking_container/pot/Initialize(mapload, mat_key) . = ..(mapload) - var/material/material = SSmaterials.get_material_by_name(mat_key || MATERIAL_STEEL) + var/singleton/material/material = GET_SINGLETON(mat_key || MATERIAL_STEEL) if(!material) return if(mat_key && mat_key != MATERIAL_STEEL) diff --git a/code/modules/cooking/plates.dm b/code/modules/cooking/plates.dm index b8267e3f274..b125e4f3f4e 100644 --- a/code/modules/cooking/plates.dm +++ b/code/modules/cooking/plates.dm @@ -11,7 +11,7 @@ Plates that can hold your cooking stuff icon = 'icons/obj/kitchen.dmi' icon_state = "bowl" fragile = 3 - shatter_material = DEFAULT_TABLE_MATERIAL // Slight typecasting abuse here, gets converted to a material in Initialize(). + shatter_material = MATERIAL_PLASTIC can_be_placed_into = list() atom_flags = ATOM_FLAG_OPEN_CONTAINER var/grease = FALSE diff --git a/code/modules/fabrication/_fabricator.dm b/code/modules/fabrication/_fabricator.dm index 4f1f198597d..b8de820a2b5 100644 --- a/code/modules/fabrication/_fabricator.dm +++ b/code/modules/fabrication/_fabricator.dm @@ -19,7 +19,7 @@ ABSTRACT_TYPE(/obj/structure/machinery/fabricator) var/list/storage_capacity = list() /// Base storage capacity, which is modified by default by the amount and tier of matter bins. var/list/base_storage_capacity = list( - DEFAULT_WALL_MATERIAL = 25000, + MATERIAL_STEEL = 25000, MATERIAL_ALUMINIUM = 25000, MATERIAL_GLASS = 12500, MATERIAL_PLASTIC = 12500, @@ -82,9 +82,9 @@ ABSTRACT_TYPE(/obj/structure/machinery/fabricator) // Update global type to string cache. if(!stored_substances_to_names[mat]) - if(ispath(mat, /material)) - var/material/mat_instance = mat - mat_instance = SSmaterials.get_material_by_name(initial(mat_instance.name)) + if(ispath(mat, /singleton/material)) + var/singleton/material/mat_instance = mat + mat_instance = GET_SINGLETON(mat_instance) if(istype(mat_instance)) stored_substances_to_names[mat] = mat_instance.display_name else if(ispath(mat, /singleton/reagent)) @@ -275,7 +275,7 @@ ABSTRACT_TYPE(/obj/structure/machinery/fabricator) /obj/structure/machinery/fabricator/dismantle() for(var/mat in stored_material) - var/material/M = SSmaterials.get_material_by_name(mat) + var/singleton/material/M = GET_SINGLETON(mat) if(!istype(M)) continue var/obj/item/stack/material/S = new M.stack_type(get_turf(src)) diff --git a/code/modules/heavy_vehicle/components/frame.dm b/code/modules/heavy_vehicle/components/frame.dm index 5a82a773e8b..7948d669bcb 100644 --- a/code/modules/heavy_vehicle/components/frame.dm +++ b/code/modules/heavy_vehicle/components/frame.dm @@ -215,7 +215,7 @@ // Installing metal. else if(istype(attacking_item, /obj/item/stack/material)) var/obj/item/stack/material/M = attacking_item - if(M.material?.name == MATERIAL_STEEL) + if(M.material?.type == MATERIAL_STEEL) if(is_reinforced) to_chat(user, SPAN_WARNING("There is already metal reinforcement installed in \the [src].")) return diff --git a/code/modules/heavy_vehicle/equipment/utility.dm b/code/modules/heavy_vehicle/equipment/utility.dm index 60b6b8bc179..8a94a366d70 100644 --- a/code/modules/heavy_vehicle/equipment/utility.dm +++ b/code/modules/heavy_vehicle/equipment/utility.dm @@ -451,7 +451,7 @@ /obj/item/mecha_equipment/drill/Initialize() . = ..() - drill_head = new /obj/item/material/drill_head(src, DEFAULT_WALL_MATERIAL)//You start with a basic steel head + drill_head = new /obj/item/material/drill_head(src, MATERIAL_STEEL)//You start with a basic steel head /obj/item/mecha_equipment/drill/Destroy() QDEL_NULL(drill_head) diff --git a/code/modules/heavy_vehicle/mecha.dm b/code/modules/heavy_vehicle/mecha.dm index e15e46662e4..923fc664f0d 100644 --- a/code/modules/heavy_vehicle/mecha.dm +++ b/code/modules/heavy_vehicle/mecha.dm @@ -66,7 +66,7 @@ var/loudening = FALSE // whether we're increasing the speech volume of our pilot // Material - var/material/material + var/singleton/material/material // Cockpit access vars. var/hatch_closed = FALSE diff --git a/code/modules/heavy_vehicle/premade/_premade.dm b/code/modules/heavy_vehicle/premade/_premade.dm index e7338d7ac2d..87292d64e2f 100644 --- a/code/modules/heavy_vehicle/premade/_premade.dm +++ b/code/modules/heavy_vehicle/premade/_premade.dm @@ -28,7 +28,7 @@ add_parts() do_decals() if(!material) - material = SSmaterials.get_material_by_name(MATERIAL_STEEL) + material = GET_SINGLETON(MATERIAL_STEEL) update_icon() . = ..() INVOKE_ASYNC(src, PROC_REF(spawn_mech_equipment)) diff --git a/code/modules/heavy_vehicle/premade/powerloader.dm b/code/modules/heavy_vehicle/premade/powerloader.dm index f047f470d6e..1d444a47a19 100644 --- a/code/modules/heavy_vehicle/premade/powerloader.dm +++ b/code/modules/heavy_vehicle/premade/powerloader.dm @@ -123,7 +123,7 @@ /mob/living/heavy_vehicle/premade/firefighter/Initialize() . = ..() - material = SSmaterials.get_material_by_name(MATERIAL_PLASTEEL) + material = GET_SINGLETON(MATERIAL_PLASTEEL) /obj/item/mech_component/sensors/firefighter/prebuild() ..() diff --git a/code/modules/integrated_electronics/core/printer.dm b/code/modules/integrated_electronics/core/printer.dm index 7286ec6f653..c53bdca156c 100644 --- a/code/modules/integrated_electronics/core/printer.dm +++ b/code/modules/integrated_electronics/core/printer.dm @@ -19,7 +19,7 @@ /obj/item/integrated_circuit_printer/attackby(obj/item/attacking_item, mob/user) if(istype(attacking_item,/obj/item/stack/material)) var/obj/item/stack/material/stack = attacking_item - if(stack.material.name == DEFAULT_WALL_MATERIAL) + if(stack.material.type == MATERIAL_STEEL) var/num = min((max_metal - metal) / metal_per_sheet, stack.amount) if(num < 1) to_chat(user, SPAN_WARNING("\The [src] is too full to add more metal.")) diff --git a/code/modules/item_worth/Value_procs/obj/items.dm b/code/modules/item_worth/Value_procs/obj/items.dm index a023a7e2d6e..fbeb6aa5375 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/material/mat = SSmaterials.get_material_by_name(material) + var/singleton/material/mat = GET_SINGLETON(material) if(mat) return mat.value return 0 diff --git a/code/modules/materials/material_recipes.dm b/code/modules/materials/material_recipes.dm index 9ba5cd303ac..9067572b516 100644 --- a/code/modules/materials/material_recipes.dm +++ b/code/modules/materials/material_recipes.dm @@ -1,50 +1,51 @@ -/material/proc/get_recipes() +/singleton/material/proc/get_recipes() if(!recipes) generate_recipes() return recipes -/material/proc/generate_recipes() +/singleton/material/proc/generate_recipes() recipes = list() // If is_brittle() returns true, these are only good for a single strike. - recipes += new /datum/stack_recipe_list("generic crafts", - list( - new /datum/stack_recipe("[display_name] baseball bat", /obj/item/material/twohanded/baseballbat, 10, time = 20, one_per_turf = 0, on_floor = 1, supplied_material = "[name]", required_skills_soft = alist(MECHANICAL_ENGINEERING_SKILL_COMPONENT = SKILL_LEVEL_TRAINED)), - new /datum/stack_recipe("[display_name] sword hilt", /obj/item/material/sword_hilt, 10, time = 100, one_per_turf = 0, on_floor = 1, supplied_material = "[name]", required_skills_soft = alist(MECHANICAL_ENGINEERING_SKILL_COMPONENT = SKILL_LEVEL_TRAINED)), - new /datum/stack_recipe("[display_name] sword blade", /obj/item/material/sword_blade, 15, time = 100, one_per_turf = 0, on_floor = 1, supplied_material = "[name]", required_skills_soft = alist(MECHANICAL_ENGINEERING_SKILL_COMPONENT = SKILL_LEVEL_TRAINED)), - new /datum/stack_recipe("[display_name] ring", /obj/item/clothing/ring/material, 1, on_floor = 1, supplied_material = "[name]", required_skills_soft = alist(MECHANICAL_ENGINEERING_SKILL_COMPONENT = SKILL_LEVEL_TRAINED)), - new /datum/stack_recipe("[display_name] armor plating", /obj/item/material/armor_plating, 3, time = 20, on_floor = 1, supplied_material = "[name]", required_skills_soft = alist(MECHANICAL_ENGINEERING_SKILL_COMPONENT = SKILL_LEVEL_TRAINED)) - )) + if(integrity >= 15 && hardness >= 10) + recipes += new /datum/stack_recipe_list("generic crafts", + list( + new /datum/stack_recipe("[display_name] baseball bat", /obj/item/material/twohanded/baseballbat, 10, time = 20, one_per_turf = 0, on_floor = 1, supplied_material = src.type, required_skills_soft = alist(MECHANICAL_ENGINEERING_SKILL_COMPONENT = SKILL_LEVEL_TRAINED)), + new /datum/stack_recipe("[display_name] sword hilt", /obj/item/material/sword_hilt, 10, time = 100, one_per_turf = 0, on_floor = 1, supplied_material = src.type, required_skills_soft = alist(MECHANICAL_ENGINEERING_SKILL_COMPONENT = SKILL_LEVEL_TRAINED)), + new /datum/stack_recipe("[display_name] sword blade", /obj/item/material/sword_blade, 15, time = 100, one_per_turf = 0, on_floor = 1, supplied_material = src.type, required_skills_soft = alist(MECHANICAL_ENGINEERING_SKILL_COMPONENT = SKILL_LEVEL_TRAINED)), + new /datum/stack_recipe("[display_name] ring", /obj/item/clothing/ring/material, 1, on_floor = 1, supplied_material = src.type, required_skills_soft = alist(MECHANICAL_ENGINEERING_SKILL_COMPONENT = SKILL_LEVEL_TRAINED)), + new /datum/stack_recipe("[display_name] armor plating", /obj/item/material/armor_plating, 3, time = 20, on_floor = 1, supplied_material = src.type, required_skills_soft = alist(MECHANICAL_ENGINEERING_SKILL_COMPONENT = SKILL_LEVEL_TRAINED)) + )) - if(integrity >= 50) + if(integrity >= 50 && hardness >= 10) recipes += new /datum/stack_recipe_list("generic construction", list( - new /datum/stack_recipe("[display_name] door", /obj/structure/simple_door, BUILD_AMT, time = 50, one_per_turf = 1, on_floor = 1, supplied_material = "[name]", required_skills_soft = alist(MECHANICAL_ENGINEERING_SKILL_COMPONENT = SKILL_LEVEL_FAMILIAR)), - new /datum/stack_recipe("[display_name] blocker", /obj/structure/blocker, BUILD_AMT, time = 50, one_per_turf = 1, on_floor = 1, supplied_material = "[name]", required_skills_soft = alist(MECHANICAL_ENGINEERING_SKILL_COMPONENT = SKILL_LEVEL_FAMILIAR)), - new /datum/stack_recipe("[display_name] railing", /obj/structure/railing, BUILD_AMT, time = 25, one_per_turf = FALSE, on_floor = TRUE, supplied_material = "[name]", required_skills_soft = alist(MECHANICAL_ENGINEERING_SKILL_COMPONENT = SKILL_LEVEL_FAMILIAR)), - new /datum/stack_recipe("[display_name] stool", /obj/structure/bed/stool, BUILD_AMT, one_per_turf = 1, on_floor = 1, supplied_material = "[name]", required_skills_soft = alist(MECHANICAL_ENGINEERING_SKILL_COMPONENT = SKILL_LEVEL_FAMILIAR)), - new /datum/stack_recipe("[display_name] chair", /obj/structure/bed/stool/chair, BUILD_AMT, one_per_turf = 1, on_floor = 1, supplied_material = "[name]", required_skills_soft = alist(MECHANICAL_ENGINEERING_SKILL_COMPONENT = SKILL_LEVEL_FAMILIAR)), - new /datum/stack_recipe("[display_name] bed", /obj/structure/bed, BUILD_AMT, one_per_turf = 1, on_floor = 1, supplied_material = "[name]", required_skills_soft = alist(MECHANICAL_ENGINEERING_SKILL_COMPONENT = SKILL_LEVEL_FAMILIAR)), - new /datum/stack_recipe("[display_name] lock", /obj/item/material/lock_construct, 1, time = 20, one_per_turf = 0, on_floor = 1, supplied_material = "[name]", required_skills_soft = alist(MECHANICAL_ENGINEERING_SKILL_COMPONENT = SKILL_LEVEL_FAMILIAR)), - new /datum/stack_recipe("[display_name] urn", /obj/item/material/urn, 10, time = 30, one_per_turf = FALSE, on_floor = 1, supplied_material = "[name]", required_skills_soft = alist(MECHANICAL_ENGINEERING_SKILL_COMPONENT = SKILL_LEVEL_FAMILIAR)) + new /datum/stack_recipe("[display_name] door", /obj/structure/simple_door, BUILD_AMT, time = 50, one_per_turf = 1, on_floor = 1, supplied_material = src.type, required_skills_soft = alist(MECHANICAL_ENGINEERING_SKILL_COMPONENT = SKILL_LEVEL_FAMILIAR)), + new /datum/stack_recipe("[display_name] blocker", /obj/structure/blocker, BUILD_AMT, time = 50, one_per_turf = 1, on_floor = 1, supplied_material = src.type, required_skills_soft = alist(MECHANICAL_ENGINEERING_SKILL_COMPONENT = SKILL_LEVEL_FAMILIAR)), + new /datum/stack_recipe("[display_name] railing", /obj/structure/railing, BUILD_AMT, time = 25, one_per_turf = FALSE, on_floor = TRUE, supplied_material = src.type, required_skills_soft = alist(MECHANICAL_ENGINEERING_SKILL_COMPONENT = SKILL_LEVEL_FAMILIAR)), + new /datum/stack_recipe("[display_name] stool", /obj/structure/bed/stool, BUILD_AMT, one_per_turf = 1, on_floor = 1, supplied_material = src.type, required_skills_soft = alist(MECHANICAL_ENGINEERING_SKILL_COMPONENT = SKILL_LEVEL_FAMILIAR)), + new /datum/stack_recipe("[display_name] chair", /obj/structure/bed/stool/chair, BUILD_AMT, one_per_turf = 1, on_floor = 1, supplied_material = src.type, required_skills_soft = alist(MECHANICAL_ENGINEERING_SKILL_COMPONENT = SKILL_LEVEL_FAMILIAR)), + new /datum/stack_recipe("[display_name] bed", /obj/structure/bed, BUILD_AMT, one_per_turf = 1, on_floor = 1, supplied_material = src.type, required_skills_soft = alist(MECHANICAL_ENGINEERING_SKILL_COMPONENT = SKILL_LEVEL_FAMILIAR)), + new /datum/stack_recipe("[display_name] lock", /obj/item/material/lock_construct, 1, time = 20, one_per_turf = 0, on_floor = 1, supplied_material = src.type, required_skills_soft = alist(MECHANICAL_ENGINEERING_SKILL_COMPONENT = SKILL_LEVEL_FAMILIAR)), + new /datum/stack_recipe("[display_name] urn", /obj/item/material/urn, 10, time = 30, one_per_turf = FALSE, on_floor = 1, supplied_material = src.type, required_skills_soft = alist(MECHANICAL_ENGINEERING_SKILL_COMPONENT = SKILL_LEVEL_FAMILIAR)) )) var/list/hardness_craftables = list() if(hardness >= 10) - hardness_craftables += new /datum/stack_recipe("[display_name] ashtray", /obj/item/material/ashtray, 2, one_per_turf = 1, on_floor = 1, supplied_material = "[name]", required_skills_soft = alist(MECHANICAL_ENGINEERING_SKILL_COMPONENT = SKILL_LEVEL_FAMILIAR)) + hardness_craftables += new /datum/stack_recipe("[display_name] ashtray", /obj/item/material/ashtray, 2, one_per_turf = 1, on_floor = 1, supplied_material = src.type, required_skills_soft = alist(MECHANICAL_ENGINEERING_SKILL_COMPONENT = SKILL_LEVEL_FAMILIAR)) if(hardness > 50) - hardness_craftables += new /datum/stack_recipe("[display_name] fork", /obj/item/material/kitchen/utensil/fork/plastic, 1, on_floor = 1, supplied_material = "[name]", required_skills_soft = alist(MECHANICAL_ENGINEERING_SKILL_COMPONENT = SKILL_LEVEL_FAMILIAR)) - hardness_craftables += new /datum/stack_recipe("[display_name] spoon", /obj/item/material/kitchen/utensil/spoon/plastic, 1, on_floor = 1, supplied_material = "[name]", required_skills_soft = alist(MECHANICAL_ENGINEERING_SKILL_COMPONENT = SKILL_LEVEL_FAMILIAR)) - hardness_craftables += new /datum/stack_recipe("[display_name] knife", /obj/item/material/kitchen/utensil/knife/plastic, 1, on_floor = 1, supplied_material = "[name]", required_skills_soft = alist(MECHANICAL_ENGINEERING_SKILL_COMPONENT = SKILL_LEVEL_FAMILIAR)) - hardness_craftables += new /datum/stack_recipe("[display_name] blade", /obj/item/material/butterflyblade, 6, time = 20, one_per_turf = 0, on_floor = 1, supplied_material = "[name]", required_skills_soft = alist(MECHANICAL_ENGINEERING_SKILL_COMPONENT = SKILL_LEVEL_TRAINED)) - hardness_craftables += new /datum/stack_recipe("[display_name] spearhead", /obj/item/material/spearhead, 6, time = 20, one_per_turf = 0, on_floor = 1, supplied_material = "[name]", required_skills_soft = alist(MECHANICAL_ENGINEERING_SKILL_COMPONENT = SKILL_LEVEL_TRAINED)) - hardness_craftables += new /datum/stack_recipe("[display_name] drill head", /obj/item/material/drill_head, 6, time = 20, one_per_turf = 0, on_floor = 1, supplied_material = "[name]", required_skills_soft = alist(MECHANICAL_ENGINEERING_SKILL_COMPONENT = SKILL_LEVEL_TRAINED)) + hardness_craftables += new /datum/stack_recipe("[display_name] fork", /obj/item/material/kitchen/utensil/fork/plastic, 1, on_floor = 1, supplied_material = src.type, required_skills_soft = alist(MECHANICAL_ENGINEERING_SKILL_COMPONENT = SKILL_LEVEL_FAMILIAR)) + hardness_craftables += new /datum/stack_recipe("[display_name] spoon", /obj/item/material/kitchen/utensil/spoon/plastic, 1, on_floor = 1, supplied_material = src.type, required_skills_soft = alist(MECHANICAL_ENGINEERING_SKILL_COMPONENT = SKILL_LEVEL_FAMILIAR)) + hardness_craftables += new /datum/stack_recipe("[display_name] knife", /obj/item/material/kitchen/utensil/knife/plastic, 1, on_floor = 1, supplied_material = src.type, required_skills_soft = alist(MECHANICAL_ENGINEERING_SKILL_COMPONENT = SKILL_LEVEL_FAMILIAR)) + hardness_craftables += new /datum/stack_recipe("[display_name] blade", /obj/item/material/butterflyblade, 6, time = 20, one_per_turf = 0, on_floor = 1, supplied_material = src.type, required_skills_soft = alist(MECHANICAL_ENGINEERING_SKILL_COMPONENT = SKILL_LEVEL_TRAINED)) + hardness_craftables += new /datum/stack_recipe("[display_name] spearhead", /obj/item/material/spearhead, 6, time = 20, one_per_turf = 0, on_floor = 1, supplied_material = src.type, required_skills_soft = alist(MECHANICAL_ENGINEERING_SKILL_COMPONENT = SKILL_LEVEL_TRAINED)) + hardness_craftables += new /datum/stack_recipe("[display_name] drill head", /obj/item/material/drill_head, 6, time = 20, one_per_turf = 0, on_floor = 1, supplied_material = src.type, required_skills_soft = alist(MECHANICAL_ENGINEERING_SKILL_COMPONENT = SKILL_LEVEL_TRAINED)) if(length(hardness_craftables)) recipes += new /datum/stack_recipe_list("generic miscellaneous", hardness_craftables) -/material/steel/generate_recipes() +/singleton/material/steel/generate_recipes() ..() recipes += new /datum/stack_recipe_list("construction recipes", list( @@ -124,18 +125,18 @@ new /datum/stack_recipe("large trap foundation", /obj/item/large_trap_foundation, 4, time = 40, required_skills_soft = alist(MECHANICAL_ENGINEERING_SKILL_COMPONENT = SKILL_LEVEL_FAMILIAR)) )) -/material/plasteel/generate_recipes() +/singleton/material/plasteel/generate_recipes() ..() recipes += new /datum/stack_recipe_list("[display_name] recipes", list( new /datum/stack_recipe("AI core", /obj/structure/AIcore, BUILD_AMT, time = 50, one_per_turf = 1, required_skills_soft = alist(MECHANICAL_ENGINEERING_SKILL_COMPONENT = SKILL_LEVEL_TRAINED)), new /datum/stack_recipe("plateel barricade", /obj/structure/barricade/plasteel, BUILD_AMT, time = 12 SECONDS, one_per_turf = 1, required_skills_soft = alist(MECHANICAL_ENGINEERING_SKILL_COMPONENT = SKILL_LEVEL_TRAINED)), - new /datum/stack_recipe("knife grip", /obj/item/material/butterflyhandle, 4, time = 20, one_per_turf = 0, on_floor = 1, supplied_material = "[name]", required_skills_soft = alist(MECHANICAL_ENGINEERING_SKILL_COMPONENT = SKILL_LEVEL_FAMILIAR)), + new /datum/stack_recipe("knife grip", /obj/item/material/butterflyhandle, 4, time = 20, one_per_turf = 0, on_floor = 1, supplied_material = src.type, required_skills_soft = alist(MECHANICAL_ENGINEERING_SKILL_COMPONENT = SKILL_LEVEL_FAMILIAR)), new /datum/stack_recipe("dark floor tile", /obj/item/stack/tile/floor_dark, 1, 4, 20, required_skills_soft = alist(MECHANICAL_ENGINEERING_SKILL_COMPONENT = SKILL_LEVEL_FAMILIAR)), new /datum/stack_recipe("full dark floor tile", /obj/item/stack/tile/floor_dark/full, 1, 4, 20, required_skills_soft = alist(MECHANICAL_ENGINEERING_SKILL_COMPONENT = SKILL_LEVEL_FAMILIAR)) )) -/material/plastic/generate_recipes() +/singleton/material/plastic/generate_recipes() ..() recipes += new /datum/stack_recipe_list("[display_name] recipes", list( @@ -153,7 +154,7 @@ new /datum/stack_recipe("plastic flaps", /obj/structure/plasticflaps, BUILD_AMT, 1, 1) )) -/material/wood/generate_recipes() +/singleton/material/wood/generate_recipes() ..() recipes += new /datum/stack_recipe_list("[display_name] recipes", list( @@ -177,14 +178,14 @@ new /datum/stack_recipe("easel", /obj/structure/easel, BUILD_AMT, time = 15, one_per_turf = 1, on_floor = 1) )) -/material/stone/generate_recipes() +/singleton/material/stone/generate_recipes() ..() recipes += new /datum/stack_recipe_list("[display_name] recipes", list( new /datum/stack_recipe("planting bed", /obj/structure/machinery/portable_atmospherics/hydroponics/soil, 3, time = 10, one_per_turf = 1, on_floor = 1) )) -/material/cardboard/generate_recipes() +/singleton/material/cardboard/generate_recipes() ..() recipes += new /datum/stack_recipe_list("[display_name] recipes", list( @@ -208,7 +209,7 @@ new /datum/stack_recipe("yellow folder", /obj/item/folder/yellow) )) -/material/cloth/generate_recipes() +/singleton/material/cloth/generate_recipes() ..() recipes += new /datum/stack_recipe_list("[display_name] curtains", list( @@ -228,14 +229,14 @@ new /datum/stack_recipe("canvas 23x23", /obj/item/canvas/twentythree_twentythree, 8) )) -/material/hide/corgi/generate_recipes() +/singleton/material/hide/corgi/generate_recipes() ..() recipes += new /datum/stack_recipe_list("[display_name] costumes", list( new /datum/stack_recipe("corgi costume", /obj/item/clothing/suit/storage/hooded/wintercoat/corgi, 3) )) -/material/hide/monkey/generate_recipes() +/singleton/material/hide/monkey/generate_recipes() ..() recipes += new /datum/stack_recipe_list("[display_name] costumes", list( @@ -243,49 +244,49 @@ new /datum/stack_recipe("monkey suit", /obj/item/clothing/suit/monkeysuit, 2) )) -/material/silver/generate_recipes() +/singleton/material/silver/generate_recipes() ..() recipes += new /datum/stack_recipe_list("[display_name] construction", list( new /datum/stack_recipe("silver floor tile", /obj/item/stack/tile/silver, 1, 4, 20) )) -/material/gold/generate_recipes() +/singleton/material/gold/generate_recipes() ..() recipes += new /datum/stack_recipe_list("[display_name] construction", list( new /datum/stack_recipe("golden floor tile", /obj/item/stack/tile/gold, 1, 4, 20) )) -/material/uranium/generate_recipes() +/singleton/material/uranium/generate_recipes() ..() recipes += new /datum/stack_recipe_list("[display_name] construction", list( new /datum/stack_recipe("uranium floor tile", /obj/item/stack/tile/uranium, 1, 4, 20) )) -/material/phoron/generate_recipes() +/singleton/material/phoron/generate_recipes() ..() recipes += new /datum/stack_recipe_list("[display_name] construction", list( new /datum/stack_recipe("phoron floor tile", /obj/item/stack/tile/phoron, 1, 4, 20) )) -/material/diamond/generate_recipes() +/singleton/material/diamond/generate_recipes() ..() recipes += new /datum/stack_recipe_list("[display_name] construction", list( new /datum/stack_recipe("diamond floor tile", /obj/item/stack/tile/diamond, 1, 4, 20) )) -/material/stone/marble/generate_recipes() +/singleton/material/stone/marble/generate_recipes() ..() recipes += new /datum/stack_recipe_list("[display_name] construction", list( new /datum/stack_recipe("marble floor tile", /obj/item/stack/tile/marble, 1, 4, 20), )) -/material/leather/generate_recipes() +/singleton/material/leather/generate_recipes() ..() recipes += new /datum/stack_recipe_list("[display_name] construction", list( @@ -293,12 +294,12 @@ new /datum/stack_recipe("leather whip", /obj/item/melee/whip, 15, 1, time = 20) )) -/material/wood/log/generate_recipes() +/singleton/material/wood/log/generate_recipes() recipes = list() recipes += new/datum/stack_recipe("bonfire", /obj/structure/bonfire, 3, time = 50, one_per_turf = 1, on_floor = 1) recipes += new/datum/stack_recipe("log bench", /obj/structure/flora/log_bench, 2, time = 20, one_per_turf = 1, on_floor = 1) -/material/wood/branch/generate_recipes() +/singleton/material/wood/branch/generate_recipes() recipes = list() recipes += new/datum/stack_recipe("bonfire", /obj/structure/bonfire, 10, time = 50, one_per_turf = 1, on_floor = 1) recipes += new/datum/stack_recipe("torch handle", /obj/item/torch, 1, time = 15, one_per_turf = 0, on_floor = 0) diff --git a/code/modules/materials/material_sheets.dm b/code/modules/materials/material_sheets.dm index 847730f016f..8dcca387c45 100644 --- a/code/modules/materials/material_sheets.dm +++ b/code/modules/materials/material_sheets.dm @@ -8,8 +8,8 @@ max_amount = 50 recyclable = TRUE // Pretty much all materials should be recyclable - var/default_type = DEFAULT_WALL_MATERIAL - var/material/material + var/default_type = MATERIAL_STEEL + var/singleton/material/material var/perunit var/apply_colour //temp pending icon rewrite var/painted_colour @@ -25,8 +25,8 @@ randpixel_xy() if(!default_type) - default_type = DEFAULT_WALL_MATERIAL - material = SSmaterials.get_material_by_name(default_type) + default_type = MATERIAL_STEEL + material = GET_SINGLETON(default_type) if(!material) return INITIALIZE_HINT_QDEL @@ -81,7 +81,7 @@ /obj/item/stack/material/transfer_to(obj/item/stack/S, var/tamount=null, var/type_verified) var/obj/item/stack/material/M = S - if(!istype(M) || material.name != M.material.name) + if(!istype(M) || material.type != M.material.type) return 0 var/transfer = ..(S,tamount,1) if(src) @@ -285,7 +285,7 @@ /obj/item/stack/material/steel name = DEFAULT_WALL_MATERIAL icon_state = "sheet-metal" - default_type = DEFAULT_WALL_MATERIAL + default_type = MATERIAL_STEEL icon_has_variants = TRUE /obj/item/stack/material/steel/attackby(obj/item/attacking_item, mob/user) @@ -562,7 +562,7 @@ /obj/item/stack/material/bronze name = "bronze" icon_state = "sheet-brass" - default_type = "bronze" + default_type = MATERIAL_BRONZE icon_has_variants = TRUE /obj/item/stack/material/bronze/full/Initialize() diff --git a/code/modules/materials/materials.dm b/code/modules/materials/materials.dm index 313c4b5f775..4159a3f67e1 100644 --- a/code/modules/materials/materials.dm +++ b/code/modules/materials/materials.dm @@ -30,97 +30,127 @@ return /obj/proc/get_material_name() - var/material/material = get_material() + var/singleton/material/material = get_material() if(material) return material.name // Material definition and procs follow. -/material - var/name // Unique name for use in indexing the list. - var/display_name // Prettier name for display. - var/adjective_name // To override the name for subtypes and stuff. +/singleton/material + /// Unique name for use in indexing the list. + var/name + /// Prettier name for display. + var/display_name + /// To override the name for subtypes and stuff. + var/adjective_name var/use_name - var/flags = 0 // Various status modifiers. + /// Various status modifiers. + var/flags = 0 var/sheet_singular_name = "sheet" var/sheet_plural_name = "sheets" // Shards/tables/structures - var/shard_type = SHARD_SHRAPNEL // Path of debris object. - var/shard_icon // Related to above. - var/shard_can_repair = 1 // Can shards be turned into sheets with a welder? - var/list/recipes // Holder for all recipes usable with a sheet of this material. - var/destruction_desc = "breaks apart" // Fancy string for barricades/tables/objects exploding. + /// Path of debris object. + var/shard_type = SHARD_SHRAPNEL + /// Related to above. + var/shard_icon + /// Can shards be turned into sheets with a welder? + var/shard_can_repair = 1 + /// Holder for all recipes usable with a sheet of this material. + var/list/recipes + /// Fancy string for barricades/tables/objects exploding. + var/destruction_desc = "breaks apart" // Icons var/colour_blend = TRUE - var/icon_colour // Colour applied to products of this material. - var/wall_colour // Colour applied to walls specifically. - var/icon_base = "solid" // Wall and table base icon tag. See header. - var/door_icon_base = "metal" // Door base icon tag. See header. - var/reinf_icon = "reinf_over" // Handles type of overlay used for tables and walls. Don't change without checking every use case. + /// Colour applied to products of this material. + var/icon_colour + /// Colour applied to walls specifically. + var/wall_colour + /// Wall and table base icon tag. See header. + var/icon_base = "solid" + /// Door base icon tag. See header. + var/door_icon_base = "metal" + /// Handles type of overlay used for tables and walls. Don't change without checking every use case. + var/reinf_icon = "reinf_over" var/icon/multipart_reinf_icon - var/list/stack_origin_tech = list(TECH_MATERIAL = 1) // Research level for stacks. + /// Research level for stacks. + var/list/stack_origin_tech = list(TECH_MATERIAL = 1) var/icon/wall_icon var/icon/table_icon // Attributes - var/cut_delay = 0 // Delay in ticks when cutting through this wall. - var/radioactivity // Radiation var. Used in wall and object processing to irradiate surroundings. - var/ignition_point // K, point at which the material catches on fire. - var/melting_point = 1800 // K, walls will take damage if they're next to a fire hotter than this - var/integrity = 150 // General-use HP value for products. - var/protectiveness = 10 // How well this material works as armor. Higher numbers are better, diminishing returns applies. - var/opacity = 1 // Is the material transparent? 0.5< makes transparent walls/doors. - var/reflectivity = 0 // How reflective to light is the material? Currently used for laser reflection and defense. - var/explosion_resistance = 5 // Only used by walls currently. - var/conductive = 1 // Objects with this var add CONDUCTS to flags on spawn. - var/conductivity = null // How conductive the material is. Iron acts as the baseline, at 10. - var/list/composite_material // If set, object matter var will be a list containing these values. + /// Delay in ticks when cutting through this wall. + var/cut_delay = 0 + /// Radiation var. Used in wall and object processing to irradiate surroundings. + var/radioactivity + /// K, point at which the material catches on fire. + var/ignition_point + /// K, walls will take damage if they're next to a fire hotter than this + var/melting_point = 1800 + /// General-use HP value for products. + var/integrity = 150 + /// How well this material works as armor. Higher numbers are better, diminishing returns applies. + var/protectiveness = 10 + /// Is the material transparent? 0.5< makes transparent walls/doors. + var/opacity = 1 + /// How reflective to light is the material? Currently used for laser reflection and defense. + var/reflectivity = 0 + /// Only used by walls currently. + var/explosion_resistance = 5 + /// Objects with this var add CONDUCTS to flags on spawn. + var/conductive = 1 + /// How conductive the material is. Iron acts as the baseline, at 10. + var/conductivity = null + /// If set, object matter var will be a list containing these values. + var/list/composite_material - // Placeholder vars for the time being, todo properly integrate windows/light tiles/rods. + /// Placeholder vars for the time being, todo properly integrate windows/light tiles/rods. var/created_window var/rod_product var/wire_product var/list/window_options = list() // Damage values. - var/hardness = 60 // Prob of wall destruction by hulk, used for edge damage in weapons. Also used for bullet protection in armor. - var/weight = 20 // Determines blunt damage/throwforce for weapons, and whether it can be flipped. Check DEFAULT_TABLE_FLIP_WEIGHT if you want your materai to be tableflippable. + /// Prob of wall destruction by hulk, used for edge damage in weapons. Also used for bullet protection in armor. + var/hardness = 60 + /// Determines blunt damage/throwforce for weapons, and whether it can be flipped. Check DEFAULT_TABLE_FLIP_WEIGHT if you want your materai to be tableflippable. + var/weight = 20 /// The price value of the item var/value = 1 - // Noise when someone is faceplanted onto a table made of this material. + /// Noise when someone is faceplanted onto a table made of this material. var/tableslam_noise = 'sound/weapons/tablehit1.ogg' - // Noise made when a simple door made of this material opens or closes. + /// Noise made when a simple door made of this material opens or closes. var/dooropen_noise = 'sound/effects/stonedoor_openclose.ogg' - // Noise made when you hit structure made of this material. + /// Noise made when you hit structure made of this material. var/hitsound = 'sound/weapons/Genhit.ogg' - // Path to resulting stacktype. Todo remove need for this. + /// Path to resulting stacktype. Todo remove need for this. var/stack_type - // Wallrot crumble message. + /// Wallrot crumble message. var/rotting_touch_message = "crumbles under your touch" - //What golem species is created with this material + /// What golem species is created with this material var/golem = null //automatic-ness for giving drop n' pickup sounds on init. var/drop_sound = 'sound/items/drop/metal_sheet.ogg' var/pickup_sound = 'sound/items/pickup/metal_sheet.ogg' - //for use in material weapons. because tiles and stacks sound different. since cardboard baseball bats sound different from wooden ones and et cetera. + /// for use in material weapons. because tiles and stacks sound different. since cardboard baseball bats sound different from wooden ones and et cetera. var/weapon_drop_sound = 'sound/items/drop/metalweapon.ogg' var/weapon_pickup_sound = 'sound/items/pickup/metalweapon.ogg' var/weapon_hitsound = SFX_SWING_HIT - var/shatter_sound = SFX_BREAK_GLASS //sound it makes when it breaks. + /// Sound it makes when it breaks. + var/shatter_sound = SFX_BREAK_GLASS /// Whether this material is fusion fuel or not. var/is_fusion_fuel /// Material light. Used for fuel rods. var/luminescence -/material/proc/build_rod_product(var/mob/user, var/obj/item/stack/used_stack, var/obj/item/stack/target_stack) +/singleton/material/proc/build_rod_product(var/mob/user, var/obj/item/stack/used_stack, var/obj/item/stack/target_stack) if(!rod_product) to_chat(user, SPAN_WARNING("You cannot make anything out of \the [target_stack]")) return @@ -134,7 +164,7 @@ S.add_fingerprint(user) S.add_to_stacks(user) -/material/proc/build_wired_product(var/mob/user, var/obj/item/stack/used_stack, var/obj/item/stack/target_stack) +/singleton/material/proc/build_wired_product(var/mob/user, var/obj/item/stack/used_stack, var/obj/item/stack/target_stack) if(!wire_product) to_chat(user, SPAN_WARNING("You cannot make anything out of \the [target_stack]")) return @@ -150,7 +180,7 @@ user.put_in_hands(product) // Make sure we have a display name and shard icon even if they aren't explicitly set. -/material/New() +/singleton/material/New() ..() if(!display_name) display_name = name @@ -203,21 +233,21 @@ multipart_reinf_icon = new(multipart_reinf_icon) multipart_reinf_icon.Blend(blend_colour, ICON_MULTIPLY) -/material/Destroy(force) +/singleton/material/Destroy(force) stack_trace("Someone tried to delete a /material.") . = ..() return QDEL_HINT_LETMELIVE //Materials cannot be deleted, as you cannot poof the concept out of existence // This is a placeholder for proper integration of windows/windoors into the system. -/material/proc/build_windows(var/mob/living/user, var/obj/item/stack/used_stack) +/singleton/material/proc/build_windows(var/mob/living/user, var/obj/item/stack/used_stack) return 0 // Weapons handle applying a divisor for this value locally. -/material/proc/get_blunt_damage() +/singleton/material/proc/get_blunt_damage() return weight //todo // Return the matter comprising this material. -/material/proc/get_matter() +/singleton/material/proc/get_matter() var/list/temp_matter = list() if(islist(composite_material)) for(var/material_string in composite_material) @@ -227,23 +257,23 @@ return temp_matter // As above. -/material/proc/get_edge_damage() +/singleton/material/proc/get_edge_damage() return hardness //todo // Snowflakey, only checked for alien doors at the moment. -/material/proc/can_open_material_door(var/mob/living/user) +/singleton/material/proc/can_open_material_door(var/mob/living/user) return 1 // Currently used for weapons and objects made of uranium to irradiate things. -/material/proc/products_need_process() +/singleton/material/proc/products_need_process() return (radioactivity>0) //todo // Used by walls when qdel()ing to avoid neighbor merging. -/material/placeholder +/singleton/material/placeholder name = "placeholder" // Places a girder object when a wall is dismantled, also applies reinforced material. -/material/proc/place_dismantled_girder(var/turf/target, var/material/reinf_material) +/singleton/material/proc/place_dismantled_girder(var/turf/target, var/singleton/material/reinf_material) var/obj/structure/girder/G = new(target) if(reinf_material) G.reinf_material = reinf_material @@ -251,12 +281,12 @@ // General wall debris product placement. // Not particularly necessary aside from snowflakey cult girders. -/material/proc/place_dismantled_product(var/turf/target,var/is_devastated) +/singleton/material/proc/place_dismantled_product(var/turf/target,var/is_devastated) for(var/x=1;x<(is_devastated?2:3);x++) place_sheet(target) // Debris product. Used ALL THE TIME. -/material/proc/place_sheet(var/turf/target) +/singleton/material/proc/place_sheet(var/turf/target) if(stack_type) for(var/obj/item/stack/S in target) if(S.type == stack_type && S.amount < S.max_amount) @@ -266,20 +296,20 @@ return new stack_type(target) // As above. -/material/proc/place_shard(var/turf/target) +/singleton/material/proc/place_shard(var/turf/target) if(shard_type) - return new /obj/item/material/shard(target, src.name) + return new /obj/item/material/shard(target, src.type) // Used by walls and weapons to determine if they break or not. -/material/proc/is_brittle() +/singleton/material/proc/is_brittle() return !!(flags & MATERIAL_BRITTLE) -/material/proc/combustion_effect(var/turf/T, var/temperature) +/singleton/material/proc/combustion_effect(var/turf/T, var/temperature) return // Datum definitions follow. -/material/uranium - name = MATERIAL_URANIUM +/singleton/material/uranium + name = "uranium" stack_type = /obj/item/stack/material/uranium radioactivity = RAD_LEVEL_LOW icon_base = "stone" @@ -292,8 +322,8 @@ door_icon_base = "stone" golem = SPECIES_GOLEM_URANIUM -/material/diamond - name = MATERIAL_DIAMOND +/singleton/material/diamond + name = "diamond" stack_type = /obj/item/stack/material/diamond flags = MATERIAL_UNMELTABLE cut_delay = 60 @@ -311,8 +341,8 @@ drop_sound = 'sound/items/drop/glass.ogg' pickup_sound = 'sound/items/pickup/glass.ogg' -/material/gold - name = MATERIAL_GOLD +/singleton/material/gold + name = "gold" stack_type = /obj/item/stack/material/gold icon_colour = "#EDD12F" weight = 30 @@ -324,8 +354,8 @@ sheet_plural_name = "ingots" golem = SPECIES_GOLEM_GOLD -/material/bronze - name = MATERIAL_BRONZE +/singleton/material/bronze + name = "bronze" stack_type = /obj/item/stack/material/bronze weight = 30 hardness = 50 @@ -335,17 +365,17 @@ stack_origin_tech = list(TECH_MATERIAL = 2) golem = SPECIES_GOLEM_BRONZE -/material/osmium - name = MATERIAL_OSMIUM +/singleton/material/osmium + name = "osmium" stack_type = /obj/item/stack/material/osmium - icon_colour = "#9999ff" + icon_colour = "#9999FF" stack_origin_tech = list(TECH_MATERIAL = 5) sheet_singular_name = "ingot" sheet_plural_name = "ingots" value = 30 -/material/silver - name = MATERIAL_SILVER +/singleton/material/silver + name = "silver" stack_type = /obj/item/stack/material/silver icon_colour = "#D1E6E3" weight = 22 @@ -357,8 +387,8 @@ sheet_plural_name = "ingots" golem = SPECIES_GOLEM_SILVER -/material/phoron - name = MATERIAL_PHORON +/singleton/material/phoron + name = "phoron" stack_type = /obj/item/stack/material/phoron ignition_point = PHORON_MINIMUM_BURN_TEMPERATURE icon_base = "stone" @@ -375,8 +405,8 @@ drop_sound = 'sound/items/drop/glass.ogg' pickup_sound = 'sound/items/pickup/glass.ogg' -/material/phoron/supermatter - name = MATERIAL_SUPERMATTER +/singleton/material/phoron/supermatter + name = "supermatter" icon_colour = "#ffff00" radioactivity = RAD_LEVEL_MODERATE conductivity = 100 @@ -389,8 +419,8 @@ stack_origin_tech = list(TECH_BLUESPACE = 2, TECH_MATERIAL = 6, TECH_PHORON = 4) stack_type = null -/material/stone - name = MATERIAL_SANDSTONE +/singleton/material/stone + name = "sandstone" stack_type = /obj/item/stack/material/sandstone icon_base = "stone" reinf_icon = "reinf_stone" @@ -409,8 +439,8 @@ drop_sound = 'sound/items/drop/boots.ogg' pickup_sound = 'sound/items/pickup/boots.ogg' -/material/stone/marble - name = MATERIAL_MARBLE +/singleton/material/stone/marble + name = "marble" icon_colour = "#b4b1a6" weight = 26 hardness = 70 @@ -420,8 +450,8 @@ drop_sound = 'sound/items/drop/boots.ogg' pickup_sound = 'sound/items/pickup/boots.ogg' -/material/stone/brick - name = MATERIAL_BRICK +/singleton/material/stone/brick + name = "brick" reinf_icon = "reinf_stone" icon_colour = COLOR_GRAY30 wall_colour = COLOR_GRAY30 @@ -430,8 +460,8 @@ hardness = 70 golem = SPECIES_GOLEM_MARBLE -/material/concrete - name = MATERIAL_CONCRETE +/singleton/material/concrete + name = "concrete" icon_colour = COLOR_CONCRETE wall_colour = COLOR_CONCRETE wall_icon = 'icons/turf/smooth/composite_solid_color.dmi' @@ -440,8 +470,8 @@ stack_type = null golem = null -/material/steel - name = DEFAULT_WALL_MATERIAL +/singleton/material/steel + name = "steel" stack_type = /obj/item/stack/material/steel integrity = 150 value = 4 @@ -457,8 +487,9 @@ weapon_hitsound = 'sound/weapons/metalhit.ogg' -/material/diona - name = MATERIAL_DIONA +/singleton/material/diona + name = "biomass_diona" + display_name = "alien biomass" icon_colour = null stack_type = null wall_icon = 'icons/turf/smooth/diona_wall.dmi' @@ -474,21 +505,21 @@ golem = SPECIES_GOLEM_WOOD hitsound = 'sound/effects/woodhit.ogg' -/material/diona/place_dismantled_product() +/singleton/material/diona/place_dismantled_product() return -/material/diona/place_dismantled_girder(var/turf/target) +/singleton/material/diona/place_dismantled_girder(var/turf/target) new /obj/structure/diona/vines(target) -/material/steel/holographic - name = "holo" + DEFAULT_WALL_MATERIAL - display_name = DEFAULT_WALL_MATERIAL +/singleton/material/steel/holographic + name = "holosteel" + display_name = "steel" stack_type = null shard_type = SHARD_NONE value = 0 -/material/plasteel - name = MATERIAL_PLASTEEL +/singleton/material/plasteel + name = "plasteel" stack_type = /obj/item/stack/material/plasteel integrity = 400 melting_point = 6000 @@ -507,8 +538,8 @@ hitsound = 'sound/weapons/smash.ogg' weapon_hitsound = 'sound/weapons/metalhit.ogg' -/material/plasteel/titanium - name = MATERIAL_TITANIUM +/singleton/material/plasteel/titanium + name = "titanium" stack_type = /obj/item/stack/material/titanium integrity = 600 conductivity = 2.38 @@ -521,8 +552,8 @@ icon_colour = "#D1E6E3" golem = SPECIES_GOLEM_TITANIUM -/material/glass - name = MATERIAL_GLASS +/singleton/material/glass + name = "glass" stack_type = /obj/item/stack/material/glass table_icon = 'icons/obj/structure/tables/glass_table.dmi' flags = MATERIAL_BRITTLE @@ -546,7 +577,7 @@ drop_sound = 'sound/items/drop/glass.ogg' pickup_sound = 'sound/items/pickup/glass.ogg' -/material/glass/build_windows(var/mob/living/user, var/obj/item/stack/used_stack) +/singleton/material/glass/build_windows(var/mob/living/user, var/obj/item/stack/used_stack) if(!user || !used_stack || !created_window || !window_options.len) return 0 @@ -615,11 +646,11 @@ new build_path(T, build_dir, 1) return 1 -/material/glass/proc/is_reinforced() +/singleton/material/glass/proc/is_reinforced() return (hardness > 35) //todo -/material/glass/wired - name = MATERIAL_GLASS_WIRED +/singleton/material/glass/wired + name = "wired glass" display_name = "wired glass" stack_type = /obj/item/stack/material/glass/wired flags = MATERIAL_BRITTLE @@ -637,8 +668,8 @@ wire_product = null rod_product = null -/material/glass/reinforced - name = MATERIAL_GLASS_REINFORCED +/singleton/material/glass/reinforced + name = "reinforced glass" display_name = "reinforced glass" stack_type = /obj/item/stack/material/glass/reinforced flags = MATERIAL_BRITTLE @@ -657,8 +688,8 @@ wire_product = null rod_product = null -/material/glass/phoron - name = MATERIAL_GLASS_PHORON +/singleton/material/glass/phoron + name = "borosilicate glass" display_name = "borosilicate glass" stack_type = /obj/item/stack/material/glass/phoronglass flags = MATERIAL_BRITTLE @@ -671,8 +702,8 @@ rod_product = /obj/item/stack/material/glass/phoronrglass golem = SPECIES_GOLEM_PHORON -/material/glass/phoron/reinforced - name = MATERIAL_GLASS_REINFORCED_PHORON +/singleton/material/glass/phoron/reinforced + name = "reinforced borosilicate glass" display_name = "reinforced borosilicate glass" stack_type = /obj/item/stack/material/glass/phoronrglass stack_origin_tech = list(TECH_MATERIAL = 5) @@ -683,8 +714,8 @@ value = 40 rod_product = null -/material/plastic - name = MATERIAL_PLASTIC +/singleton/material/plastic + name = "plastic" stack_type = /obj/item/stack/material/plastic flags = MATERIAL_BRITTLE icon_colour = "#CCCCCC" @@ -697,22 +728,14 @@ drop_sound = 'sound/items/drop/plastic_sheet.ogg' pickup_sound = 'sound/items/pickup/plastic_sheet.ogg' -/material/plastic/holographic - name = MATERIAL_PLASTIC_HOLO +/singleton/material/plastic/holographic + name = "holoplastic" display_name = "plastic" stack_type = null shard_type = SHARD_NONE -/material/osmium - name = MATERIAL_OSMIUM - stack_type = /obj/item/stack/material/osmium - icon_colour = "#9999FF" - stack_origin_tech = list(TECH_MATERIAL = 5) - sheet_singular_name = "ingot" - sheet_plural_name = "ingots" - -/material/mhydrogen - name = MATERIAL_HYDROGEN_METALLIC +/singleton/material/mhydrogen + name = "metallic hydrogen" display_name = "metallic hydrogen" stack_type = /obj/item/stack/material/mhydrogen icon_colour = "#E6C5DE" @@ -722,8 +745,8 @@ golem = SPECIES_GOLEM_HYDROGEN is_fusion_fuel = TRUE -/material/platinum - name = MATERIAL_PLATINUM +/singleton/material/platinum + name = "platinum" stack_type = /obj/item/stack/material/platinum icon_colour = "#9999FF" weight = 27 @@ -733,8 +756,8 @@ sheet_singular_name = "ingot" sheet_plural_name = "ingots" -/material/iron - name = MATERIAL_IRON +/singleton/material/iron + name = "iron" stack_type = /obj/item/stack/material/iron icon_colour = "#5C5454" weight = 22 @@ -747,8 +770,8 @@ weapon_hitsound = 'sound/weapons/metalhit.ogg' is_fusion_fuel = TRUE -/material/aluminium - name = MATERIAL_ALUMINIUM +/singleton/material/aluminium + name = "aluminium" stack_type = /obj/item/stack/material/aluminium icon_colour = "#cccdcc" weight = 18 @@ -756,8 +779,8 @@ hitsound = 'sound/weapons/smash.ogg' weapon_hitsound = 'sound/weapons/metalhit.ogg' -/material/lead - name = MATERIAL_LEAD +/singleton/material/lead + name = "lead" stack_type = /obj/item/stack/material/lead icon_colour = "#5f5960" weight = 32 @@ -768,9 +791,9 @@ weapon_hitsound = 'sound/weapons/metalhit.ogg' // Adminspawn only, do not let anyone get this. -/material/elevatorium - name = MATERIAL_ELEVATOR - display_name = "elevator panelling" +/singleton/material/elevatorium + name = "elevatorium" + display_name = "elevator paneling" stack_type = null icon_colour = "#666666" wall_icon = 'icons/turf/smooth/composite_solid_color.dmi' @@ -781,8 +804,8 @@ weight = 500 protectiveness = 80 -/material/wood - name = MATERIAL_WOOD +/singleton/material/wood + name = "wood" stack_type = /obj/item/stack/material/wood // why wouldn't it have a stacktype seriously guys why icon_colour = WOOD_COLOR_GENERIC integrity = 50 @@ -814,43 +837,43 @@ weapon_hitsound = 'sound/weapons/woodenhit.ogg' reinf_icon = "reinf_wood" -/material/wood/birch - name = MATERIAL_BIRCH +/singleton/material/wood/birch + name = "birch wood" stack_type = /obj/item/stack/material/wood/coloured/birch icon_colour = WOOD_COLOR_BIRCH -/material/wood/mahogany - name = MATERIAL_MAHOGANY +/singleton/material/wood/mahogany + name = "mahogany wood" stack_type = /obj/item/stack/material/wood/coloured/mahogany icon_colour = WOOD_COLOR_RICH -/material/wood/maple - name = MATERIAL_MAPLE +/singleton/material/wood/maple + name = "maple wood" stack_type = /obj/item/stack/material/wood/coloured/maple icon_colour = WOOD_COLOR_PALE -/material/wood/bamboo - name = MATERIAL_BAMBOO +/singleton/material/wood/bamboo + name = "bamboo wood" stack_type = /obj/item/stack/material/wood/coloured/bamboo icon_colour = WOOD_COLOR_PALE2 -/material/wood/ebony - name = MATERIAL_EBONY +/singleton/material/wood/ebony + name = "ebony wood" stack_type = /obj/item/stack/material/wood/coloured/ebony icon_colour = WOOD_COLOR_BLACK -/material/wood/walnut - name = MATERIAL_WALNUT +/singleton/material/wood/walnut + name = "walnut wood" stack_type = /obj/item/stack/material/wood/coloured/walnut icon_colour = WOOD_COLOR_CHOCOLATE -/material/wood/yew - name = MATERIAL_YEW +/singleton/material/wood/yew + name = "yew wood" stack_type = /obj/item/stack/material/wood/coloured/yew icon_colour = WOOD_COLOR_YELLOW -/material/wood/log //This is gonna replace wood planks in a way for NBT, leaving it here for now - name = MATERIAL_WOOD_LOG +/singleton/material/wood/log //This is gonna replace wood planks in a way for NBT, leaving it here for now + name = "log" stack_type = /obj/item/stack/material/wood/log icon_colour = "#824B28" integrity = 50 @@ -864,8 +887,8 @@ sheet_singular_name = "pice" sheet_plural_name = "piles" -/material/wood/branch - name = MATERIAL_WOOD_BRANCH +/singleton/material/wood/branch + name = "branch" stack_type = /obj/item/stack/material/wood/branch icon_colour = "#824B28" integrity = 10 @@ -877,8 +900,8 @@ sheet_singular_name = "bundle" sheet_plural_name = "bundle" -/material/rust - name = MATERIAL_RUST +/singleton/material/rust + name = "rust" display_name = "rusty steel" stack_type = null icon_colour = "#B7410E" @@ -889,19 +912,20 @@ hardness = 15 weight = 18 -/material/wood/holographic - name = MATERIAL_WOOD_HOLO +/singleton/material/wood/holographic + name = "holowood" display_name = "wood" stack_type = null shard_type = SHARD_NONE value = 0 -/material/cardboard - name = MATERIAL_CARDBOARD +/singleton/material/cardboard + name = "cardboard" stack_type = /obj/item/stack/material/cardboard flags = MATERIAL_BRITTLE integrity = 10 icon_colour = COLOR_CARDBOARD + integrity = 5 hardness = 1 weight = 1 protectiveness = 0 // 0% @@ -917,8 +941,8 @@ pickup_sound = 'sound/items/pickup/cardboard_sheet.ogg' weapon_hitsound = 'sound/weapons/cardboardhit.ogg' -/material/cult - name = MATERIAL_CULT +/singleton/material/cult + name = "cult" display_name = "daemon stone" icon_base = "cult" wall_icon = 'icons/turf/smooth/cult_wall.dmi' @@ -931,22 +955,22 @@ sheet_singular_name = "brick" sheet_plural_name = "bricks" -/material/cult/place_dismantled_girder(var/turf/target) +/singleton/material/cult/place_dismantled_girder(var/turf/target) new /obj/structure/girder/cult(target) -/material/cult/place_dismantled_product(var/turf/target) +/singleton/material/cult/place_dismantled_product(var/turf/target) new /obj/effect/decal/cleanable/blood(target) -/material/cult/reinf - name = MATERIAL_CULT_REINFORCED +/singleton/material/cult/reinf + name = "cult_reinforced" icon_colour = COLOR_CULT_REINFORCED display_name = "human remains" -/material/cult/reinf/place_dismantled_product(var/turf/target) +/singleton/material/cult/reinf/place_dismantled_product(var/turf/target) new /obj/effect/decal/remains/human(target) -/material/resin - name = MATERIAL_RESIN +/singleton/material/resin + name = "resin" icon_colour = "#E85DD8" dooropen_noise = 'sound/effects/attackblob.ogg' door_icon_base = "resin" @@ -954,12 +978,13 @@ sheet_singular_name = "blob" sheet_plural_name = "blobs" -/material/leather - name = MATERIAL_LEATHER +/singleton/material/leather + name = "leather" icon_colour = COLOR_LEATHER stack_type = /obj/item/stack/material/leather stack_origin_tech = list(TECH_MATERIAL = 2) flags = MATERIAL_PADDING + integrity = 5 hardness = 1 weight = 1 value = 3 @@ -970,21 +995,22 @@ drop_sound = 'sound/items/drop/skin_sheet.ogg' pickup_sound = 'sound/items/pickup/skin_sheet.ogg' -/material/leather/fine - name = MATERIAL_LEATHER_FINE +/singleton/material/leather/fine + name = "fine leather" icon_colour = "#4B3A27" stack_type = /obj/item/stack/material/leather/fine ignition_point = T0C+320 melting_point = T0C+320 -/material/cotton - name = MATERIAL_COTTON +/singleton/material/cotton + name = "cotton" display_name ="cotton" icon_colour = "#FFFFFF" flags = MATERIAL_PADDING ignition_point = T0C+232 melting_point = T0C+300 protectiveness = 1 // 4% + integrity = 5 hardness = 1 weight = 1 golem = SPECIES_GOLEM_CLOTH @@ -992,11 +1018,12 @@ pickup_sound = SFX_CLOTH_PICKUP weapon_hitsound = 'sound/weapons/towelwhip.ogg' -/material/carpet - name = MATERIAL_CARPET +/singleton/material/carpet + name = "carpet" display_name = "comfy" use_name = "red upholstery" stack_type = /obj/item/stack/tile/carpet + integrity = 5 hardness = 1 weight = 1 icon_colour = COLOR_RED @@ -1013,63 +1040,63 @@ pickup_sound = SFX_CLOTH_PICKUP weapon_hitsound = 'sound/weapons/towelwhip.ogg' -/material/carpet/black - name = MATERIAL_CARPET_BLACK +/singleton/material/carpet/black + name = "carpet_black" use_name = "black upholstery" stack_type = /obj/item/stack/tile/carpet/black icon_colour = COLOR_BLACK icon_base = "carpet_black" table_icon = 'icons/obj/structure/tables/fancy_table_black.dmi' -/material/carpet/blue - name = MATERIAL_CARPET_BLUE +/singleton/material/carpet/blue + name = "carpet_blue" use_name = "blue upholstery" stack_type = /obj/item/stack/tile/carpet/lightblue icon_colour = COLOR_BLUE icon_base = "carpet_blue" table_icon = 'icons/obj/structure/tables/fancy_table_blue.dmi' -/material/carpet/cyan - name = MATERIAL_CARPET_CYAN +/singleton/material/carpet/cyan + name = "carpet_cyan" use_name = "cyan upholstery" stack_type = /obj/item/stack/tile/carpet/cyan icon_colour = COLOR_CYAN icon_base = "carpet_cyan" table_icon = 'icons/obj/structure/tables/fancy_table_cyan.dmi' -/material/carpet/green - name = MATERIAL_CARPET_GREEN +/singleton/material/carpet/green + name = "carpet_green" use_name = "green upholstery" stack_type = /obj/item/stack/tile/carpet/green icon_colour = COLOR_GREEN icon_base = "carpet_green" table_icon = 'icons/obj/structure/tables/fancy_table_green.dmi' -/material/carpet/orange - name = MATERIAL_CARPET_ORANGE +/singleton/material/carpet/orange + name = "carpet_orange" use_name = "orange upholstery" stack_type = /obj/item/stack/tile/carpet/orange icon_colour = COLOR_ORANGE icon_base = "carpet_orange" table_icon = 'icons/obj/structure/tables/fancy_table_green.dmi' -/material/carpet/purple - name = MATERIAL_CARPET_PURPLE +/singleton/material/carpet/purple + name = "carpet_purple" use_name = "purple upholstery" stack_type = /obj/item/stack/tile/carpet/purple icon_colour = COLOR_PURPLE icon_base = "carpet_purple" table_icon = 'icons/obj/structure/tables/fancy_table_purple.dmi' -/material/carpet/red - name = MATERIAL_CARPET_RED +/singleton/material/carpet/red + name = "carpet_red" stack_type = /obj/item/stack/tile/carpet/red icon_colour = COLOR_RED icon_base = "carpet_red" table_icon = 'icons/obj/structure/tables/fancy_table_red.dmi' -/material/cloth - name = MATERIAL_CLOTH +/singleton/material/cloth + name = "cloth" stack_type = /obj/item/stack/material/cloth stack_origin_tech = list(TECH_MATERIAL = 2) door_icon_base = "wood" @@ -1077,6 +1104,7 @@ melting_point = T0C+300 protectiveness = 1 // 4% flags = MATERIAL_PADDING + integrity = 5 hardness = 1 weight = 1 golem = SPECIES_GOLEM_CLOTH @@ -1084,8 +1112,8 @@ pickup_sound = SFX_CLOTH_PICKUP weapon_hitsound = 'sound/weapons/towelwhip.ogg' -/material/hide //TODO make different hides somewhat different among them - name = MATERIAL_HIDE +/singleton/material/hide //TODO make different hides somewhat different among them + name = "hide" stack_origin_tech = list(TECH_MATERIAL = 2) stack_type = /obj/item/stack/material/animalhide door_icon_base = "wood" @@ -1093,6 +1121,7 @@ ignition_point = T0C+232 melting_point = T0C+300 flags = MATERIAL_PADDING + integrity = 5 hardness = 1 weight = 1 protectiveness = 3 // 13% @@ -1101,42 +1130,42 @@ pickup_sound = 'sound/items/pickup/skin_sheet.ogg' value = 5 -/material/hide/corgi - name = MATERIAL_HIDE_CORGI +/singleton/material/hide/corgi + name = "corgi hide" stack_type = /obj/item/stack/material/animalhide/corgi icon_colour = "#F9A635" -/material/hide/cat - name = MATERIAL_HIDE_CAT +/singleton/material/hide/cat + name = "cat hide" stack_type = /obj/item/stack/material/animalhide/cat icon_colour = "#444444" -/material/hide/monkey - name = MATERIAL_HIDE_MONKEY +/singleton/material/hide/monkey + name = "monkey hide" stack_type = /obj/item/stack/material/animalhide/monkey icon_colour = "#914800" -/material/hide/lizard - name = MATERIAL_HIDE_LIZARD +/singleton/material/hide/lizard + name = "lizard hide" stack_type = /obj/item/stack/material/animalhide/lizard icon_colour = "#34AF10" -/material/hide/human - name = MATERIAL_HIDE_HUMAN +/singleton/material/hide/human + name = "human hide" stack_type = /obj/item/stack/material/animalhide/human icon_colour = "#833C00" value = 35 -/material/hide/barehide +/singleton/material/hide/barehide name = "bare hide" stack_type = /obj/item/stack/material/animalhide/barehide -/material/hide/wetleather +/singleton/material/hide/wetleather name = "wet leather" stack_type = /obj/item/stack/material/animalhide/wetleather -/material/bone - name = MATERIAL_BONE +/singleton/material/bone + name = "bone" icon_colour = "#e3dac9" icon_base = "stone" reinf_icon = "reinf_stone" @@ -1151,16 +1180,16 @@ protectiveness = 10 // 33% golem = SPECIES_GOLEM_MEAT -/material/bone/necromancer - name = MATERIAL_BONE_CURSED +/singleton/material/bone/necromancer + name = "cursed bone" weight = 20 integrity = 150 hardness = 60 protectiveness = 20 // 50% value = 50 -/material/vaurca - name = MATERIAL_VAURCA +/singleton/material/vaurca + name = "biomass_vaurca" display_name = "alien biomass" stack_type = null icon_colour = "#1C7400" @@ -1175,8 +1204,8 @@ protectiveness = 20 // 50% conductivity = 10 -/material/shuttle - name = MATERIAL_SHUTTLE +/singleton/material/shuttle + name = "shuttle" display_name = "plastitanium alloy" stack_type = null reinf_icon = "no_sprite"//placeholder @@ -1191,8 +1220,8 @@ protectiveness = 80 // 80% cut_delay = 20 SECONDS -/material/shuttle/skrell - name = MATERIAL_SHUTTLE_SKRELL +/singleton/material/shuttle/skrell + name = "skrell" table_icon = 'icons/obj/structure/tables/skrell_table.dmi' display_name = "superadvanced alloy" weight = 23 @@ -1200,8 +1229,8 @@ icon_colour = null icon_base = "skrell" -/material/graphite - name = MATERIAL_GRAPHITE +/singleton/material/graphite + name = "graphite" stack_type = /obj/item/stack/material/graphite icon_colour = "#666666" shard_type = SHARD_STONE_PIECE @@ -1214,8 +1243,8 @@ drop_sound = 'sound/items/drop/boots.ogg' pickup_sound = 'sound/items/pickup/boots.ogg' -/material/tritium - name = MATERIAL_TRITIUM +/singleton/material/tritium + name = "tritium" stack_type = /obj/item/stack/material/tritium icon_colour = "#777777" stack_origin_tech = list(TECH_MATERIAL = 5) @@ -1224,8 +1253,8 @@ is_fusion_fuel = TRUE value = 300 -/material/deuterium - name = MATERIAL_DEUTERIUM +/singleton/material/deuterium + name = "deuterium" stack_type = /obj/item/stack/material/deuterium icon_colour = "#999999" stack_origin_tech = list(TECH_MATERIAL = 3) @@ -1233,8 +1262,8 @@ sheet_plural_name = "ingots" is_fusion_fuel = TRUE -/material/boron - name = MATERIAL_BORON +/singleton/material/boron + name = "boron" stack_type = /obj/item/stack/material/boron icon_colour = "#bbbbbb" stack_origin_tech = list(TECH_MATERIAL = 3) diff --git a/code/modules/mining/machine_processing.dm b/code/modules/mining/machine_processing.dm index b167e0e3f80..718fcdef06e 100644 --- a/code/modules/mining/machine_processing.dm +++ b/code/modules/mining/machine_processing.dm @@ -63,7 +63,7 @@ var/points = 0 var/list/ore/input_mats = list() - var/list/material/output_mats = list() + var/list/singleton/material/output_mats = list() var/list/datum/alloy/alloy_mats = list() var/waste = 0 var/idx = 0 @@ -275,7 +275,7 @@ dat += "" - for(var/material/OM in output_mats) + for(var/singleton/material/OM in output_mats) if(output_mats[OM] > 1) dat += "" else @@ -523,7 +523,7 @@ GLOBAL_LIST_EMPTY_TYPED(alloy_data, /datum/alloy) if(can_make % 2 > 0) can_make-- - var/material/M = SSmaterials.get_material_by_name(O.compresses_to) + var/singleton/material/M = GET_SINGLETON(O.compresses_to) if(!istype(M) || !can_make || ores_stored[metal] < 1) continue @@ -541,7 +541,7 @@ GLOBAL_LIST_EMPTY_TYPED(alloy_data, /datum/alloy) else if(ores_processing[metal] & SMELTER_MODE_SMELTING && O.smelts_to) var/can_make = clamp(ores_stored[metal], 0, ROUND_UP(sheets_per_second*seconds_per_tick) - sheets) - var/material/M = SSmaterials.get_material_by_name(O.smelts_to) + var/singleton/material/M = GET_SINGLETON(O.smelts_to) if(!istype(M) || !can_make || ores_stored[metal] < 1) continue diff --git a/code/modules/mining/mint.dm b/code/modules/mining/mint.dm index 4728fd759a1..edc56564cc0 100644 --- a/code/modules/mining/mint.dm +++ b/code/modules/mining/mint.dm @@ -40,7 +40,7 @@ amt_phoron += 100 * O.get_amount() if("uranium") amt_uranium += 100 * O.get_amount() - if(DEFAULT_WALL_MATERIAL) + if("steel") amt_iron += 100 * O.get_amount() else processed = FALSE diff --git a/code/modules/mob/living/simple_animal/hostile/phoron_worm.dm b/code/modules/mob/living/simple_animal/hostile/phoron_worm.dm index b478bd13909..1fb2485a4fb 100644 --- a/code/modules/mob/living/simple_animal/hostile/phoron_worm.dm +++ b/code/modules/mob/living/simple_animal/hostile/phoron_worm.dm @@ -71,7 +71,7 @@ if(istype(A, /obj/item/stack/material)) var/obj/item/stack/material/P = A - if(P.material.name == MATERIAL_PHORON) + if(P.material.type == MATERIAL_PHORON) visible_message(SPAN_WARNING("\The [src] starts consuming \the [P]..."), SPAN_NOTICE("You start consuming \the [P].")) if(!do_after(src, 1 SECOND, P)) return diff --git a/code/modules/overmap/ship_weaponry/_ship_ammunition.dm b/code/modules/overmap/ship_weaponry/_ship_ammunition.dm index 5c579a0a392..dc63d30f813 100644 --- a/code/modules/overmap/ship_weaponry/_ship_ammunition.dm +++ b/code/modules/overmap/ship_weaponry/_ship_ammunition.dm @@ -273,7 +273,7 @@ P = new /obj/projectile/bullet/pellet/fragment/spall/metalrod(O) else if(istype(thing_pierced, /obj/structure/machinery/door/airlock)) var/obj/structure/machinery/door/airlock/D = thing_pierced - if(D.window_material && D.window_material == SSmaterials.get_material_by_name(MATERIAL_GLASS)) + if(D.window_material && D.window_material == GET_SINGLETON(MATERIAL_GLASS)) P = new /obj/projectile/bullet/pellet/fragment/spall/glass(O) else P = new /obj/projectile/bullet/pellet/fragment/spall(O) diff --git a/code/modules/power/fusion/fuel_assembly/fuel_assembly.dm b/code/modules/power/fusion/fuel_assembly/fuel_assembly.dm index 993dbf57670..85a3ee0bb0c 100644 --- a/code/modules/power/fusion/fuel_assembly/fuel_assembly.dm +++ b/code/modules/power/fusion/fuel_assembly/fuel_assembly.dm @@ -27,7 +27,7 @@ fuel_colour = initial(R.color) initial_amount = 50000 - var/material/material = SSmaterials.get_material_by_name(fuel_type) + var/singleton/material/material = GET_SINGLETON(fuel_type) if(istype(material)) initial_amount = SHEET_MATERIAL_AMOUNT * 5 // Fuel compressor eats 5 sheets. name = "[material.use_name] fuel rod assembly" diff --git a/code/modules/power/fusion/fuel_assembly/fuel_compressor.dm b/code/modules/power/fusion/fuel_assembly/fuel_compressor.dm index c94c7d874ad..dccd415468b 100644 --- a/code/modules/power/fusion/fuel_assembly/fuel_compressor.dm +++ b/code/modules/power/fusion/fuel_assembly/fuel_compressor.dm @@ -41,7 +41,7 @@ return 1 else if(istype(thing, /obj/item/stack/material)) var/obj/item/stack/material/M = thing - var/material/mat = M.get_material() + var/singleton/material/mat = M.get_material() if(!mat.is_fusion_fuel) to_chat(user, SPAN_WARNING("It would be pointless to make a fuel rod out of [mat.use_name].")) return diff --git a/code/modules/power/fusion/kinetic_harvester.dm b/code/modules/power/fusion/kinetic_harvester.dm index 7653e72e6a8..7ae8827f253 100644 --- a/code/modules/power/fusion/kinetic_harvester.dm +++ b/code/modules/power/fusion/kinetic_harvester.dm @@ -8,11 +8,13 @@ icon_state = "off" manufacturer = "hephaestus" var/initial_id_tag - var/list/stored = list() - var/list/harvesting = list() + var/list/stored = list() + var/list/harvesting = list() + var/list/can_harvest = list() 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") AddComponent(/datum/component/local_network_member, initial_id_tag) find_core() queue_icon_update() @@ -67,7 +69,7 @@ data["status"] = (use_power >= POWER_USE_ACTIVE) data["materials"] = list() for(var/mat in stored) - var/material/material = SSmaterials.get_material_by_name(mat) + var/singleton/material/material = GET_SINGLETON(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])) @@ -80,18 +82,17 @@ if(use_power >= POWER_USE_ACTIVE) if(harvest_from && harvest_from.owned_field) for(var/mat in harvest_from.owned_field.reactants) - if(SSmaterials.materials_by_name[mat] && !stored[mat]) + if((mat in can_harvest) && !stored[mat]) stored[mat] = 0 for(var/mat in harvesting) - if(!SSmaterials.materials_by_name[mat]) - harvesting -= mat - else if(mat in harvest_from.owned_field.reactants) - var/harvest = min(harvest_from.owned_field.reactants[mat], 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 - stored[mat] += harvest + 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)) + // 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 + stored[mat] += harvest else harvesting.Cut() @@ -110,7 +111,7 @@ switch(action) if("remove_mat") var/mat = params["remove_mat"] - var/material/material = SSmaterials.get_material_by_name(mat) + var/singleton/material/material = GET_SINGLETON(mat) if(material) var/sheet_cost = (SHEET_MATERIAL_AMOUNT * 1.5) var/sheets = min(FLOOR(stored[mat]/sheet_cost, 1), 50) diff --git a/code/modules/radiation/radiation.dm b/code/modules/radiation/radiation.dm index f913946eeb3..b568e172ed3 100644 --- a/code/modules/radiation/radiation.dm +++ b/code/modules/radiation/radiation.dm @@ -48,7 +48,7 @@ cached_rad_resistance = 0 for(var/obj/O in src.contents) if(!(O.rad_resistance_modifier <= 0) && O.density) - var/material/M = O.get_material() + var/singleton/material/M = O.get_material() if(!M) continue cached_rad_resistance += (M.weight * O.rad_resistance_modifier) / RADIATION_MATERIAL_RESISTANCE_DIVISOR // Looks like storing the contents length is meant to be a basic check if the cache is stale due to items enter/exiting. Better than nothing so I'm leaving it as is. ~Leshana diff --git a/code/modules/random_map/automata/diona.dm b/code/modules/random_map/automata/diona.dm index f292f79632f..4799c6b1fa5 100644 --- a/code/modules/random_map/automata/diona.dm +++ b/code/modules/random_map/automata/diona.dm @@ -4,7 +4,7 @@ /turf/simulated/wall/diona/Initialize(mapload) canSmoothWith = list(src.type) - . = ..(mapload, "biomass") + . = ..(mapload, MATERIAL_DIONA) canSmoothWith = list(src.type) /obj/structure/diona diff --git a/code/modules/reagents/reagent_containers.dm b/code/modules/reagents/reagent_containers.dm index 0246762dd65..6c764a0bd9e 100644 --- a/code/modules/reagents/reagent_containers.dm +++ b/code/modules/reagents/reagent_containers.dm @@ -12,7 +12,7 @@ var/accuracy = 1 var/fragile = 0 // If nonzero, above what force do we shatter? var/shatter_sound = SFX_BREAK_GLASS - var/material/shatter_material = MATERIAL_GLASS //slight typecasting abuse here, gets converted to a material in initializee + var/singleton/material/shatter_material = MATERIAL_GLASS var/can_be_placed_into = list( /obj/structure/machinery/chem_master, /obj/structure/machinery/chem_heater, @@ -55,7 +55,7 @@ if(!possible_transfer_amounts) src.verbs -= /obj/item/reagent_containers/verb/set_APTFT create_reagents(volume) - shatter_material = SSmaterials.get_material_by_name(shatter_material) + shatter_material = GET_SINGLETON(shatter_material) /obj/item/reagent_containers/attack_self(mob/user) return diff --git a/code/modules/research/xenoarchaeology/finds/finds_special.dm b/code/modules/research/xenoarchaeology/finds/finds_special.dm index 38d240d59f3..189a6a7918b 100644 --- a/code/modules/research/xenoarchaeology/finds/finds_special.dm +++ b/code/modules/research/xenoarchaeology/finds/finds_special.dm @@ -65,13 +65,13 @@ ///Amount of force required by the weapon to smash the statue. var/fragile = 15 ///Sets the type of material for use by the place shard proc. - var/material/shatter_material = MATERIAL_STEEL + var/singleton/material/shatter_material = MATERIAL_STEEL /obj/item/vampiric/New() ..() START_PROCESSING(SSprocessing, src) become_hearing_sensitive() - shatter_material = SSmaterials.get_material_by_name(shatter_material) + shatter_material = GET_SINGLETON(shatter_material) /obj/item/vampiric/Destroy() STOP_PROCESSING(SSprocessing, src) diff --git a/code/modules/spell_system/artifacts/items/bone_spear.dm b/code/modules/spell_system/artifacts/items/bone_spear.dm index 09ac0428a07..3a87ee8d2c2 100644 --- a/code/modules/spell_system/artifacts/items/bone_spear.dm +++ b/code/modules/spell_system/artifacts/items/bone_spear.dm @@ -1,3 +1,3 @@ /obj/item/material/twohanded/spear/bone desc = "A spear crafted with bones of some long forgotten creature." - default_material = "cursed bone" + default_material = MATERIAL_BONE_CURSED diff --git a/code/modules/tables/flipping.dm b/code/modules/tables/flipping.dm index 7613bb3d1c4..395304c5d52 100644 --- a/code/modules/tables/flipping.dm +++ b/code/modules/tables/flipping.dm @@ -7,7 +7,7 @@ var/obj/structure/table/T for(var/angle in list(-90,90)) T = locate() in get_step(src.loc,turn(direction,angle)) - if(T && T.flipped == 0 && T.material.name == material.name) + if(T && T.flipped == 0 && T.material.type == material.type) return 0 T = locate() in get_step(src.loc,direction) if (!T || T.flipped == 1 || T.material != material) @@ -52,7 +52,7 @@ L.Add(turn(src.dir,90)) for(var/new_dir in L) var/obj/structure/table/T = locate() in get_step(src.loc,new_dir) - if(T && T.material.name == material.name) + if(T && T.material.type == material.type) if(T.flipped == 1 && T.dir == src.dir && !T.unflipping_check(new_dir)) return 0 return 1 @@ -92,7 +92,7 @@ atom_flags |= ATOM_FLAG_CHECKS_BORDER for(var/D in list(turn(direction, 90), turn(direction, -90))) var/obj/structure/table/T = locate() in get_step(src,D) - if(T && T.flipped == 0 && material && T.material && T.material.name == material.name) + if(T && T.flipped == 0 && material && T.material && T.material.type == material.type) T.flip(direction) take_damage(rand(5, 10)) update_connections(1) @@ -110,7 +110,7 @@ atom_flags &= ~ATOM_FLAG_CHECKS_BORDER for(var/D in list(turn(dir, 90), turn(dir, -90))) var/obj/structure/table/T = locate() in get_step(src.loc,D) - if(T && T.flipped == 1 && T.dir == src.dir && material && T.material&& T.material.name == material.name) + if(T && T.flipped == 1 && T.dir == src.dir && material && T.material&& T.material.type == material.type) T.unflip() update_connections(1) diff --git a/code/modules/tables/presets.dm b/code/modules/tables/presets.dm index 022f2b15fca..916f4eb959f 100644 --- a/code/modules/tables/presets.dm +++ b/code/modules/tables/presets.dm @@ -2,7 +2,7 @@ /obj/structure/table/standard icon_state = "solid_preview" - table_mat = DEFAULT_TABLE_MATERIAL + table_mat = MATERIAL_PLASTIC /obj/structure/table/standard/flipped icon_state = "solid_flip0" @@ -16,7 +16,7 @@ /obj/structure/table/steel icon = 'icons/obj/structure/tables/steel_table.dmi' icon_state = "steel_preview" - table_mat = DEFAULT_WALL_MATERIAL + table_mat = MATERIAL_PLASTIC /obj/structure/table/stone icon_state = "stone_preview" @@ -27,13 +27,13 @@ /obj/structure/table/reinforced icon_state = "reinf_solid_preview" - table_mat = DEFAULT_TABLE_MATERIAL - table_reinf = DEFAULT_TABLE_REINF_MATERIAL + table_mat = MATERIAL_PLASTIC + table_reinf = MATERIAL_PLASTEEL /obj/structure/table/reinforced/steel icon = 'icons/obj/structure/tables/steel_table.dmi' icon_state = "reinf_steel_preview" - table_mat = DEFAULT_WALL_MATERIAL + table_mat = MATERIAL_STEEL /obj/structure/table/reinforced/wood icon_state = "reinf_wood_preview" @@ -44,12 +44,15 @@ icon = 'icons/obj/structure/tables/glass_table.dmi' icon_state = "reinf_glass_preview" table_mat = MATERIAL_GLASS - table_reinf = DEFAULT_TABLE_REINF_MATERIAL + table_reinf = MATERIAL_PLASTEEL /obj/structure/table/wood icon_state = "wood_preview" table_mat = MATERIAL_WOOD +/obj/structure/table/wood/reinf + table_reinf = MATERIAL_WOOD + /obj/structure/table/wood/birch table_mat = MATERIAL_BIRCH @@ -80,6 +83,11 @@ icon_state = "glass_preview" table_mat = MATERIAL_GLASS +/obj/structure/table/glass/reinf + name = "reinforced glass table" + icon_state = "reinf_glass_preview" + table_reinf = MATERIAL_PLASTEEL + /obj/structure/table/skrell icon = 'icons/obj/structure/tables/skrell_table.dmi' icon_state = "skrell_preview" diff --git a/code/modules/tables/rack.dm b/code/modules/tables/rack.dm index 31ced2b5bca..0d4a5ff4024 100644 --- a/code/modules/tables/rack.dm +++ b/code/modules/tables/rack.dm @@ -8,7 +8,7 @@ can_plate = 0 can_reinforce = 0 flipped = -1 - table_mat = DEFAULT_TABLE_MATERIAL + table_mat = MATERIAL_PLASTIC dismantle_mat = /obj/item/stack/material/plastic /obj/structure/table/rack/New() diff --git a/code/modules/tables/tables.dm b/code/modules/tables/tables.dm index dbd3b91d89b..262ceff5fac 100644 --- a/code/modules/tables/tables.dm +++ b/code/modules/tables/tables.dm @@ -23,7 +23,7 @@ var/can_plate = 1 var/manipulating = 0 - var/material/reinforced = null + var/singleton/material/reinforced = null var/obj/item/stack/dismantle_mat = /obj/item/stack/rods // Gambling tables. I'd prefer reinforced with carpet/felt/cloth/whatever, but AFAIK it's either harder or impossible to get /obj/item/stack/material of those. @@ -133,9 +133,9 @@ /obj/structure/table/Initialize() if(table_mat) - material = SSmaterials.get_material_by_name(table_mat) + material = GET_SINGLETON(table_mat) if(table_reinf) - reinforced = SSmaterials.get_material_by_name(table_reinf) + reinforced = GET_SINGLETON(table_reinf) AddComponent(/datum/component/armor, list(MELEE = ARMOR_MELEE_KNIVES, BULLET = ARMOR_BALLISTIC_MINOR)) . = ..() @@ -210,7 +210,7 @@ // Returns the material to set the table to. /obj/structure/table/proc/common_material_add(obj/item/stack/material/S, mob/user, verb) // Verb is actually verb without 'e' or 'ing', which is added. Works for 'plate'/'plating' and 'reinforce'/'reinforcing'. - var/material/M = S.get_material() + var/singleton/material/M = S.get_material() if(!istype(M)) to_chat(user, SPAN_WARNING("You cannot [verb]e \the [src] with \the [S].")) return null @@ -228,7 +228,7 @@ return M // Returns the material to set the table to. -/obj/structure/table/proc/common_material_remove(mob/user, material/M, delay, what, type_holding, sound) +/obj/structure/table/proc/common_material_remove(mob/user, singleton/material/M, delay, what, type_holding, sound) if(!M.stack_type) to_chat(user, SPAN_WARNING("You are unable to remove the [what] from this table!")) return M @@ -286,7 +286,7 @@ S = reinforced.place_shard(loc) if(S) shards += S if(material) - if(material.stack_type && (full_return || prob(20))) + if(material?.stack_type && (full_return || prob(20))) material.place_sheet(loc) else S = material.place_shard(loc) @@ -343,7 +343,7 @@ var/tabledirs = 0 for(var/direction in list(turn(dir,90), turn(dir,-90)) ) var/obj/structure/table/T = locate(/obj/structure/table ,get_step(src,direction)) - if(T && T.flipped == 1 && T.dir == src.dir && material && T.material && T.material.name == material.name) + if(T && T.flipped == 1 && T.dir == src.dir && material && T.material && T.material.type == material.type) type++ tabledirs |= direction @@ -436,7 +436,7 @@ for(var/obj/structure/table/T in orange(src, 1)) var/T_dir = get_dir(src, T) if(T_dir in blocked_dirs) continue - if(material && T.material && material.name == T.material.name && flipped == T.flipped) + if(material && T.material && material.type == T.material.type && flipped == T.flipped) connection_dirs |= T_dir if(propagate) INVOKE_ASYNC(T, PROC_REF(update_connections)) diff --git a/code/modules/turbolift/turbolift_turfs.dm b/code/modules/turbolift/turbolift_turfs.dm index 7f58e8b410d..08ea42d2b46 100644 --- a/code/modules/turbolift/turbolift_turfs.dm +++ b/code/modules/turbolift/turbolift_turfs.dm @@ -1,4 +1,4 @@ /turf/simulated/wall/elevator/Initialize(mapload) canSmoothWith = list(src.type) - . = ..(mapload, "elevatorium") + . = ..(mapload, MATERIAL_ELEVATOR) canSmoothWith = list(src.type) diff --git a/code/modules/weather/weather_fsm_states.dm b/code/modules/weather/weather_fsm_states.dm index 5dbd7fd2bce..b4c8d8ab196 100644 --- a/code/modules/weather/weather_fsm_states.dm +++ b/code/modules/weather/weather_fsm_states.dm @@ -31,10 +31,10 @@ ABSTRACT_TYPE(/singleton/state/weather) // Temporarily removing the material checks, we do not have the same material system as Nebula // if(is_liquid && weather.water_material) - // var/material/mat = SSmaterials.get_material_by_name(weather.water_material) + // var/material/mat = SSmaterials.get_material_name(weather.water_material) // weather.color = mat.icon_colour // else if(is_ice && weather.ice_material) - // var/material/mat = SSmaterials.get_material_by_name(weather.ice_material) + // var/material/mat = SSmaterials.get_material_name(weather.ice_material) // weather.color = mat.icon_colour if(is_liquid) diff --git a/code/unit_tests/recipe_tests.dm b/code/unit_tests/recipe_tests.dm index b832fb28841..2f59acfeb2c 100755 --- a/code/unit_tests/recipe_tests.dm +++ b/code/unit_tests/recipe_tests.dm @@ -41,8 +41,8 @@ /datum/unit_test/stack_recipe_cost/start_test() var/tested_count = 0 var/error_count = 0 - SSmaterials.create_material_lists() // just in case - for(var/material/D in SSmaterials.materials) + var/list/materials = GET_SINGLETON_SUBTYPE_MAP(/singleton/material) + for(var/singleton/material/D in materials) var/list/datum/stack_recipe_list/recipe_lists = D.get_recipes() var/list/temp_matter = D.get_matter() for(var/datum/stack_recipe_list/L in recipe_lists) diff --git a/html/changelogs/Bat-MaterialSingletons.yml b/html/changelogs/Bat-MaterialSingletons.yml new file mode 100644 index 00000000000..37f57bcecff --- /dev/null +++ b/html/changelogs/Bat-MaterialSingletons.yml @@ -0,0 +1,8 @@ +author: Batrachophrenoboocosmomachia +delete-after: True +changes: + - refactor: "Repaths /material to /singleton/material." + - refactor: "Replaces all material string defines to path defines, replacing SSmaterials procs w/ GET_SINGLETON instead." + - refactor: "Removes all material var edited objects from all maps, adding new presets where necessary." + - refactor: "Updates recipes unit test to run all recipes against all material singletons." + - bugfix: "Prevents several material recipes from being generated for non-rigid materials (i.e. cloth railings)." diff --git a/maps/away/away_site/abandoned_industrial/abandoned_industrial_station.dmm b/maps/away/away_site/abandoned_industrial/abandoned_industrial_station.dmm index f48db672605..66193d8b2cf 100644 --- a/maps/away/away_site/abandoned_industrial/abandoned_industrial_station.dmm +++ b/maps/away/away_site/abandoned_industrial/abandoned_industrial_station.dmm @@ -1348,9 +1348,7 @@ /area/abandoned_industrial_station/docks_east) "el" = ( /obj/effect/floor_decal/corner/green/diagonal, -/obj/structure/table/glass{ - table_reinf = "glass" - }, +/obj/structure/table/glass/reinf, /obj/random/medical, /obj/random/medical, /turf/simulated/floor/tiled/white, @@ -9634,9 +9632,7 @@ /turf/simulated/floor/tiled/dark, /area/abandoned_industrial_station/hangar) "DZ" = ( -/obj/structure/table/glass{ - table_reinf = "glass" - }, +/obj/structure/table/glass/reinf, /obj/item/flashlight/lamp/off{ pixel_x = -3; pixel_y = 4 @@ -9767,9 +9763,7 @@ /area/abandoned_industrial_station/docks_east) "EF" = ( /obj/effect/floor_decal/corner/green/diagonal, -/obj/structure/table/glass{ - table_reinf = "glass" - }, +/obj/structure/table/glass/reinf, /obj/item/reagent_containers/syringe/inaprovaline, /turf/simulated/floor/tiled/white, /area/abandoned_industrial_station/medical) @@ -11858,9 +11852,7 @@ /area/abandoned_industrial_station/hallways) "Lh" = ( /obj/effect/floor_decal/corner/green/diagonal, -/obj/structure/table/glass{ - table_reinf = "glass" - }, +/obj/structure/table/glass/reinf, /obj/random/dirt_75, /turf/simulated/floor/tiled/white, /area/abandoned_industrial_station/medical) diff --git a/maps/away/away_site/abandoned_propellant_depot/abandoned_propellant_depot.dmm b/maps/away/away_site/abandoned_propellant_depot/abandoned_propellant_depot.dmm index 9a8d20fb67b..c2bfd1f8f65 100644 --- a/maps/away/away_site/abandoned_propellant_depot/abandoned_propellant_depot.dmm +++ b/maps/away/away_site/abandoned_propellant_depot/abandoned_propellant_depot.dmm @@ -3708,9 +3708,7 @@ /turf/simulated/floor/plating, /area/abandoned_propellant_depot/maint_storage) "lX" = ( -/obj/structure/table/glass{ - table_reinf = "glass" - }, +/obj/structure/table/glass/reinf, /obj/item/flashlight/lamp/off{ pixel_x = -3; pixel_y = 4 @@ -9935,9 +9933,7 @@ /turf/simulated/floor/plating, /area/abandoned_propellant_depot/atmos_propellant) "GW" = ( -/obj/structure/table/glass{ - table_reinf = "glass" - }, +/obj/structure/table/glass/reinf, /obj/random/medical{ pixel_y = 4 }, diff --git a/maps/away/away_site/cult_base/cult_base.dmm b/maps/away/away_site/cult_base/cult_base.dmm index d6c3f1b5c98..2f9290d341f 100644 --- a/maps/away/away_site/cult_base/cult_base.dmm +++ b/maps/away/away_site/cult_base/cult_base.dmm @@ -923,9 +923,7 @@ /turf/simulated/floor/plating, /area/cult_base/hallways_south) "acx" = ( -/obj/structure/table/glass{ - table_reinf = "glass" - }, +/obj/structure/table/glass/reinf, /obj/random/medical, /obj/item/reagent_containers/food/drinks/waterbottle{ pixel_x = 8; @@ -2387,9 +2385,7 @@ /area/cult_base/crew_quarters) "ajg" = ( /obj/effect/floor_decal/corner/grey/diagonal, -/obj/structure/table/glass{ - table_reinf = "glass" - }, +/obj/structure/table/glass/reinf, /obj/random/firstaid{ pixel_x = -3; pixel_y = 6 @@ -4304,9 +4300,7 @@ /area/shuttle/cult_base/cargo) "auH" = ( /obj/effect/floor_decal/corner/green/diagonal, -/obj/structure/table/glass{ - table_reinf = "glass" - }, +/obj/structure/table/glass/reinf, /obj/random/medical{ pixel_y = 7; pixel_x = 4 @@ -4715,9 +4709,7 @@ /turf/simulated/floor/tiled/white, /area/shuttle/cult_base/crew) "awV" = ( -/obj/structure/table/glass{ - table_reinf = "glass" - }, +/obj/structure/table/glass/reinf, /obj/item/clothing/gloves/latex/nitrile{ pixel_y = 4 }, @@ -6470,9 +6462,7 @@ /turf/simulated/mineral/surface, /area/space) "aIC" = ( -/obj/structure/table/glass{ - table_reinf = "glass" - }, +/obj/structure/table/glass/reinf, /obj/random/firstaid{ pixel_x = 8; pixel_y = 8 @@ -8820,9 +8810,7 @@ /area/cult_base/asteroid_inside) "aWq" = ( /obj/effect/floor_decal/corner/green/diagonal, -/obj/structure/table/glass{ - table_reinf = "glass" - }, +/obj/structure/table/glass/reinf, /obj/item/reagent_containers/spray/sterilizine{ pixel_x = -6; pixel_y = 4 diff --git a/maps/away/scenarios/enviro_testing_facility/enviro_testing_facility_submaps_main.dmm b/maps/away/scenarios/enviro_testing_facility/enviro_testing_facility_submaps_main.dmm index 67b667d3ea6..99b84128f0c 100644 --- a/maps/away/scenarios/enviro_testing_facility/enviro_testing_facility_submaps_main.dmm +++ b/maps/away/scenarios/enviro_testing_facility/enviro_testing_facility_submaps_main.dmm @@ -168,9 +168,7 @@ /turf/simulated/floor/tiled/dark, /area/enviro_testing_facility/inside/crew/quarters) "ajR" = ( -/obj/structure/table/glass{ - table_reinf = "glass" - }, +/obj/structure/table/glass, /obj/structure/machinery/light{ dir = 4 }, @@ -2983,9 +2981,7 @@ /turf/simulated/floor/plating, /area/enviro_testing_facility/inside/medical/hallway) "cVb" = ( -/obj/structure/table/glass{ - table_reinf = "glass" - }, +/obj/structure/table/glass/reinf, /obj/item/storage/box/syringes{ pixel_x = -4; pixel_y = 7 @@ -4833,9 +4829,7 @@ /area/enviro_testing_facility/inside/security/lobby) "ePg" = ( /obj/effect/floor_decal/corner_wide/paleblue/diagonal, -/obj/structure/table/glass{ - table_reinf = "glass" - }, +/obj/structure/table/glass/reinf, /obj/random/medical{ pixel_y = 14; pixel_x = 2 @@ -5193,9 +5187,7 @@ /area/enviro_testing_facility/inside/maintenance/engineering_south) "fmW" = ( /obj/effect/floor_decal/corner_wide/lime/diagonal, -/obj/structure/table/glass{ - table_reinf = "glass" - }, +/obj/structure/table/glass/reinf, /obj/item/storage/box/masks{ pixel_x = 4; pixel_y = 9 @@ -5303,9 +5295,7 @@ /area/enviro_testing_facility/inside/research/hallway) "frZ" = ( /obj/effect/floor_decal/corner_wide/lime/diagonal, -/obj/structure/table/glass{ - table_reinf = "glass" - }, +/obj/structure/table/glass/reinf, /obj/random/medical{ pixel_y = 8 }, @@ -7375,9 +7365,7 @@ /area/enviro_testing_facility/inside/maintenance/security) "hpM" = ( /obj/effect/floor_decal/corner_wide/lime/diagonal, -/obj/structure/table/glass{ - table_reinf = "glass" - }, +/obj/structure/table/glass/reinf, /obj/item/storage/box/masks{ pixel_x = 4; pixel_y = 9 @@ -8379,9 +8367,7 @@ }, /area/template_noop) "ita" = ( -/obj/structure/table/glass{ - table_reinf = "glass" - }, +/obj/structure/table/glass/reinf, /obj/random/medical{ pixel_y = 8 }, @@ -8706,9 +8692,7 @@ /turf/simulated/floor/reinforced, /area/enviro_testing_facility/inside/engineering/reactors) "iFu" = ( -/obj/structure/table/glass{ - table_reinf = "glass" - }, +/obj/structure/table/glass, /obj/structure/machinery/light{ dir = 8 }, @@ -9869,9 +9853,7 @@ /turf/simulated/floor/tiled/dark, /area/enviro_testing_facility/inside/crew/quarters) "jSV" = ( -/obj/structure/table/glass{ - table_reinf = "glass" - }, +/obj/structure/table/glass, /obj/structure/machinery/light{ dir = 8 }, @@ -10750,9 +10732,7 @@ }, /area/template_noop) "kIo" = ( -/obj/structure/table/glass{ - table_reinf = "glass" - }, +/obj/structure/table/glass, /obj/structure/machinery/light{ dir = 4 }, @@ -11554,9 +11534,7 @@ /area/enviro_testing_facility/inside/security/lobby) "lBb" = ( /obj/effect/floor_decal/corner_wide/paleblue/diagonal, -/obj/structure/table/glass{ - table_reinf = "glass" - }, +/obj/structure/table/glass/reinf, /obj/structure/cable/yellow{ icon_state = "0-2" }, @@ -13221,9 +13199,7 @@ /turf/simulated/floor/tiled, /area/enviro_testing_facility/inside/crew/quarters) "nre" = ( -/obj/structure/table/glass{ - table_reinf = "glass" - }, +/obj/structure/table/glass/reinf, /obj/effect/floor_decal/corner_wide/paleblue/diagonal, /turf/simulated/floor/tiled/white, /area/enviro_testing_facility/inside/medical/recovery_1) @@ -13554,9 +13530,7 @@ /area/enviro_testing_facility/inside/security/cells_2) "nHS" = ( /obj/effect/floor_decal/corner_wide/lime/diagonal, -/obj/structure/table/glass{ - table_reinf = "glass" - }, +/obj/structure/table/glass/reinf, /obj/structure/bedsheetbin{ pixel_x = 3; pixel_y = 7 @@ -13868,9 +13842,7 @@ /turf/simulated/floor/tiled/dark, /area/enviro_testing_facility/inside/security/lobby) "nVk" = ( -/obj/structure/table/glass{ - table_reinf = "glass" - }, +/obj/structure/table/glass/reinf, /obj/item/paper_bin{ pixel_x = 4; pixel_y = 4 @@ -17372,9 +17344,7 @@ /area/enviro_testing_facility/inside/research/hallway) "rGp" = ( /obj/effect/floor_decal/corner_wide/lime/diagonal, -/obj/structure/table/glass{ - table_reinf = "glass" - }, +/obj/structure/table/glass/reinf, /obj/random/medical{ pixel_y = 2; pixel_x = -7 @@ -17949,9 +17919,7 @@ /turf/simulated/floor/tiled/dark, /area/enviro_testing_facility/inside/engineering/mech_lab) "sjM" = ( -/obj/structure/table/glass{ - table_reinf = "glass" - }, +/obj/structure/table/glass/reinf, /obj/structure/cable/yellow{ icon_state = "0-2" }, @@ -19093,9 +19061,7 @@ /turf/simulated/floor/tiled, /area/enviro_testing_facility/inside/control/offices) "tqb" = ( -/obj/structure/table/glass{ - table_reinf = "glass" - }, +/obj/structure/table/glass/reinf, /obj/random/medical{ pixel_y = 8 }, @@ -19640,9 +19606,7 @@ /area/enviro_testing_facility/inside/security/hallway) "tSe" = ( /obj/effect/floor_decal/corner_wide/lime/diagonal, -/obj/structure/table/glass{ - table_reinf = "glass" - }, +/obj/structure/table/glass/reinf, /obj/item/paper_bin{ pixel_x = 4; pixel_y = 4 @@ -19687,9 +19651,7 @@ /area/enviro_testing_facility/inside/maintenance/medical) "tVj" = ( /obj/effect/floor_decal/corner_wide/lime/diagonal, -/obj/structure/table/glass{ - table_reinf = "glass" - }, +/obj/structure/table/glass/reinf, /obj/item/storage/box/masks{ pixel_x = 4; pixel_y = 9 @@ -19912,9 +19874,7 @@ }, /area/template_noop) "uaw" = ( -/obj/structure/table/glass{ - table_reinf = "glass" - }, +/obj/structure/table/glass/reinf, /obj/random/medical{ pixel_y = 8 }, @@ -20298,9 +20258,7 @@ /area/enviro_testing_facility/inside/research/rnd) "uyu" = ( /obj/effect/floor_decal/corner_wide/lime/diagonal, -/obj/structure/table/glass{ - table_reinf = "glass" - }, +/obj/structure/table/glass/reinf, /obj/item/storage/firstaid/regular{ pixel_x = -2; pixel_y = 9 @@ -20767,9 +20725,7 @@ /turf/simulated/floor/tiled/white, /area/enviro_testing_facility/inside/medical/lobby) "uYU" = ( -/obj/structure/table/glass{ - table_reinf = "glass" - }, +/obj/structure/table/glass, /obj/structure/machinery/light{ dir = 8 }, @@ -20859,9 +20815,7 @@ /turf/simulated/floor/exoplanet/konyang/wilting, /area/template_noop) "vdw" = ( -/obj/structure/table/glass{ - table_reinf = "glass" - }, +/obj/structure/table/glass/reinf, /obj/item/healthanalyzer{ pixel_x = -3 }, diff --git a/maps/away/scenarios/ruined_propellant_depot/ruined_propellant_depot.dmm b/maps/away/scenarios/ruined_propellant_depot/ruined_propellant_depot.dmm index 15c362d19fa..82d3af2e384 100644 --- a/maps/away/scenarios/ruined_propellant_depot/ruined_propellant_depot.dmm +++ b/maps/away/scenarios/ruined_propellant_depot/ruined_propellant_depot.dmm @@ -3802,9 +3802,7 @@ /turf/simulated/floor/plating, /area/ruined_propellant_depot/maint_storage) "lX" = ( -/obj/structure/table/glass{ - table_reinf = "glass" - }, +/obj/structure/table/glass/reinf, /obj/item/flashlight/lamp/off{ pixel_x = -3; pixel_y = 4 @@ -10312,9 +10310,7 @@ /turf/simulated/floor/plating, /area/ruined_propellant_depot/atmos_propellant) "GW" = ( -/obj/structure/table/glass{ - table_reinf = "glass" - }, +/obj/structure/table/glass/reinf, /obj/random/medical{ pixel_y = 4 }, diff --git a/maps/event/generic_dock/generic_dock-1.dmm b/maps/event/generic_dock/generic_dock-1.dmm index 82fdc51f31d..fab1de5e9ae 100644 --- a/maps/event/generic_dock/generic_dock-1.dmm +++ b/maps/event/generic_dock/generic_dock-1.dmm @@ -5345,10 +5345,7 @@ /obj/structure/railing/mapped{ name = "adjusted railing" }, -/obj/structure/table/glass{ - name = "reinforced glass table"; - table_reinf = "glass" - }, +/obj/structure/table/glass/reinf, /turf/unsimulated/floor{ icon_state = "wood" }, @@ -5933,10 +5930,7 @@ /obj/item/flame/lighter/zippo/gold{ pixel_y = 3 }, -/obj/structure/table/glass{ - name = "reinforced glass table"; - table_reinf = "glass" - }, +/obj/structure/table/glass/reinf, /turf/unsimulated/floor{ icon_state = "wood" }, @@ -12814,10 +12808,7 @@ /obj/item/material/ashtray/bronze{ pixel_y = -7 }, -/obj/structure/table/glass{ - name = "reinforced glass table"; - table_reinf = "glass" - }, +/obj/structure/table/glass/reinf, /turf/unsimulated/floor{ icon_state = "wood" }, diff --git a/maps/sccv_horizon/sccv_horizon.dmm b/maps/sccv_horizon/sccv_horizon.dmm index 2bd95b29054..edf82e1a63b 100644 --- a/maps/sccv_horizon/sccv_horizon.dmm +++ b/maps/sccv_horizon/sccv_horizon.dmm @@ -2015,9 +2015,7 @@ pixel_x = -5; pixel_y = 4 }, -/obj/structure/table/wood{ - table_reinf = "wood" - }, +/obj/structure/table/wood/reinf, /obj/effect/floor_decal/corner/grey{ dir = 5 }, @@ -13470,9 +13468,7 @@ pixel_y = -9 }, /obj/effect/decal/cleanable/dirt, -/obj/structure/table/wood{ - table_reinf = "wood" - }, +/obj/structure/table/wood/reinf, /turf/unsimulated/floor/carpet, /area/antag/raider) "bKL" = ( @@ -21298,9 +21294,7 @@ /obj/effect/floor_decal/corner_wide/paleblue{ dir = 9 }, -/obj/structure/table/glass{ - table_reinf = "glass" - }, +/obj/structure/table/glass/reinf, /obj/item/flashlight/lamp, /obj/structure/machinery/atmospherics/unary/vent_scrubber/on{ dir = 4 @@ -22605,9 +22599,7 @@ /obj/item/laser_pointer/red{ pixel_y = 3 }, -/obj/structure/table/wood{ - table_reinf = "wood" - }, +/obj/structure/table/wood/reinf, /obj/effect/floor_decal/spline/fancy/wood{ dir = 8 }, @@ -23411,9 +23403,7 @@ /obj/structure/machinery/atmospherics/unary/vent_pump/on{ dir = 4 }, -/obj/structure/table/glass{ - table_reinf = "glass" - }, +/obj/structure/table/glass/reinf, /obj/item/paper_bin{ pixel_y = 3 }, @@ -29554,10 +29544,7 @@ pixel_x = 1; pixel_y = 4 }, -/obj/structure/table/glass{ - name = "reinforced glass table"; - table_reinf = "glass" - }, +/obj/structure/table/glass/reinf, /turf/unsimulated/floor/monotile, /area/antag/mercenary) "dNH" = ( @@ -34796,9 +34783,7 @@ /obj/structure/machinery/chemical_dispenser/bar_alc/full{ pixel_y = 7 }, -/obj/structure/table/wood{ - table_reinf = "wood" - }, +/obj/structure/table/wood/reinf, /obj/effect/floor_decal/corner/grey{ dir = 5 }, @@ -36950,9 +36935,7 @@ /turf/simulated/floor/plating, /area/horizon/rnd/hallway) "eLj" = ( -/obj/structure/table/glass{ - table_reinf = "glass" - }, +/obj/structure/table/glass/reinf, /obj/item/flashlight/lamp, /obj/effect/floor_decal/corner_wide/paleblue/full{ dir = 1 @@ -42868,9 +42851,7 @@ /obj/effect/floor_decal/corner_wide/paleblue/full{ dir = 8 }, -/obj/structure/table/glass{ - table_reinf = "glass" - }, +/obj/structure/table/glass/reinf, /obj/structure/machinery/photocopier/faxmachine{ department = "Chief Medical Officer's Office" }, @@ -47843,10 +47824,7 @@ /obj/item/flame/lighter/zippo/gold{ pixel_y = 3 }, -/obj/structure/table/glass{ - name = "reinforced glass table"; - table_reinf = "glass" - }, +/obj/structure/table/glass/reinf, /turf/unsimulated/floor/wood, /area/centcom/evac) "gjV" = ( @@ -50709,9 +50687,7 @@ /obj/item/hand_labeler{ pixel_y = 2 }, -/obj/structure/table/wood{ - table_reinf = "wood" - }, +/obj/structure/table/wood/reinf, /obj/effect/floor_decal/spline/fancy/wood{ dir = 8 }, @@ -68613,10 +68589,7 @@ /turf/simulated/floor/tiled/full, /area/horizon/hallway/primary/deck_3/central) "iUu" = ( -/obj/structure/table/glass{ - name = "reinforced glass table"; - table_reinf = "glass" - }, +/obj/structure/table/glass/reinf, /turf/unsimulated/floor/wood, /area/centcom/evac) "iUv" = ( @@ -71762,9 +71735,7 @@ /obj/structure/machinery/chemical_dispenser/bar_soft/full{ pixel_y = 7 }, -/obj/structure/table/wood{ - table_reinf = "wood" - }, +/obj/structure/table/wood/reinf, /obj/effect/floor_decal/corner/grey{ dir = 5 }, @@ -75902,10 +75873,7 @@ /turf/simulated/floor/tiled/dark/full, /area/horizon/maintenance/deck_2/operations) "jRe" = ( -/obj/structure/table/glass{ - name = "reinforced glass table"; - table_reinf = "glass" - }, +/obj/structure/table/glass/reinf, /obj/item/laser_pointer/red, /turf/unsimulated/floor/monotile, /area/antag/mercenary) @@ -85228,9 +85196,7 @@ /turf/simulated/floor/tiled, /area/horizon/engineering/hallway/interior) "kZJ" = ( -/obj/structure/table/glass{ - table_reinf = "glass" - }, +/obj/structure/table/glass/reinf, /obj/effect/floor_decal/corner_wide/paleblue{ dir = 10 }, @@ -102192,9 +102158,7 @@ /turf/simulated/floor/tiled/dark/full, /area/horizon/shuttle/intrepid/port_storage) "nlQ" = ( -/obj/structure/table/glass{ - table_reinf = "glass" - }, +/obj/structure/table/glass/reinf, /obj/item/folder, /obj/effect/floor_decal/corner_wide/green{ dir = 6 @@ -112361,10 +112325,7 @@ pixel_x = 1; pixel_y = 7 }, -/obj/structure/table/glass{ - name = "reinforced glass table"; - table_reinf = "glass" - }, +/obj/structure/table/glass/reinf, /turf/unsimulated/floor/monotile, /area/antag/mercenary) "oDy" = ( @@ -114163,10 +114124,7 @@ pixel_x = -3; pixel_y = 8 }, -/obj/structure/table/glass{ - name = "reinforced glass table"; - table_reinf = "glass" - }, +/obj/structure/table/glass/reinf, /obj/effect/landmark{ name = "Syndicate-Uplink" }, @@ -121904,9 +121862,7 @@ /obj/structure/machinery/light{ dir = 1 }, -/obj/structure/table/wood{ - table_reinf = "wood" - }, +/obj/structure/table/wood/reinf, /obj/effect/floor_decal/spline/fancy/wood{ dir = 9 }, @@ -137566,9 +137522,7 @@ }, /area/horizon/holodeck/source_konyang) "rQb" = ( -/obj/structure/table/glass{ - table_reinf = "glass" - }, +/obj/structure/table/glass/reinf, /obj/effect/floor_decal/corner/paleblue/diagonal, /obj/item/modular_computer/laptop/preset/medical/cmo{ pixel_y = 5 @@ -150274,9 +150228,7 @@ pixel_x = -7; pixel_y = 8 }, -/obj/structure/table/wood{ - table_reinf = "wood" - }, +/obj/structure/table/wood/reinf, /obj/effect/floor_decal/corner/grey{ dir = 5 }, @@ -151569,9 +151521,7 @@ "tCv" = ( /obj/item/deck/cards, /obj/effect/decal/cleanable/dirt, -/obj/structure/table/wood{ - table_reinf = "wood" - }, +/obj/structure/table/wood/reinf, /turf/unsimulated/floor/carpet, /area/antag/raider) "tCy" = ( @@ -158991,9 +158941,7 @@ /turf/simulated/floor/wood, /area/horizon/service/bar) "uBH" = ( -/obj/structure/table/glass{ - table_reinf = "glass" - }, +/obj/structure/table/glass/reinf, /obj/item/paper_bin, /obj/item/pen, /obj/effect/floor_decal/corner_wide/green{ @@ -170628,9 +170576,7 @@ /turf/simulated/floor/tiled/full, /area/horizon/command/bridge/upperdeck) "wdE" = ( -/obj/structure/table/glass{ - table_reinf = "glass" - }, +/obj/structure/table/glass/reinf, /obj/effect/floor_decal/corner/paleblue/diagonal, /turf/simulated/floor/tiled/white, /area/horizon/command/heads/cmo) @@ -184077,10 +184023,7 @@ /obj/structure/railing/mapped{ name = "adjusted railing" }, -/obj/structure/table/glass{ - name = "reinforced glass table"; - table_reinf = "glass" - }, +/obj/structure/table/glass/reinf, /turf/unsimulated/floor/wood, /area/centcom/evac) "xKC" = (
[output_mats[OM]][OM.display_name] [OM.sheet_plural_name]