mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-22 04:22:39 +01:00
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 <Batrochophreno@gmail.com> Co-authored-by: kano-dot <bhutanlikanoxy@gmail.com>
This commit is contained in:
co-authored by
kano-dot
parent
2e61d8fd15
commit
eebb8b971c
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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()
|
||||
..()
|
||||
|
||||
@@ -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."))
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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()
|
||||
|
||||
+253
-224
File diff suppressed because it is too large
Load Diff
@@ -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 += "<table>"
|
||||
|
||||
for(var/material/OM in output_mats)
|
||||
for(var/singleton/material/OM in output_mats)
|
||||
if(output_mats[OM] > 1)
|
||||
dat += "<tr><td><b><small>[output_mats[OM]]</b></small></td><td><small>[OM.display_name] [OM.sheet_plural_name]</small></td></tr>"
|
||||
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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/turf/simulated/wall/elevator/Initialize(mapload)
|
||||
canSmoothWith = list(src.type)
|
||||
. = ..(mapload, "elevatorium")
|
||||
. = ..(mapload, MATERIAL_ELEVATOR)
|
||||
canSmoothWith = list(src.type)
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user