Unit test material checks are now performed on all crafting recipes by default. All stack recipes now transfer mats to the results (#92620)

## About The Pull Request
Extends the part of the crafting unit test that ensures consistency
between the total mats of the components of a recipe (or rather, the
result of said recipe) and a generic instance of the same type as its
result, previously only implemented on food recipes.

## Why It's Good For The Game
This ensures a degree of consistency with the material composition of
various objects in the game. I couldn't do it in the original PR as that
one was too big already and it took months to get it merged, and have
the relative bugs fixed.

Currently a WIP as I slowly deal with the unit test reports.

## Changelog

🆑
refactor: Follow-up to the crafting/material refactor from months ago.
All objects crafted with stacks now inherit their mat composition (not
necessarily the effects and color) by default, while previously only a
few things like chair, sinks and toilets did. Report any object looking
or behaving weirdly as a result.
fix: The material composition of ammo boxes is no longer a 1/10 of what
it's supposed to be. It was a shitty hack to make it harder to recycle
empty ammo boxes. Instead, they lose materials as they're emptied now.
/🆑
This commit is contained in:
Ghom
2025-12-02 18:29:01 -05:00
committed by GitHub
parent 085007eae1
commit 0b0c5ea91e
272 changed files with 850 additions and 280 deletions
+7 -7
View File
@@ -26,16 +26,16 @@
#define CRAFT_ON_SOLID_GROUND (1<<4)
/// If the craft checks that there are objects with density in the same turf when being built
#define CRAFT_CHECK_DENSITY (1<<5)
/// If the created atom will gain custom mat datums
#define CRAFT_APPLIES_MATS (1<<6)
/// Crafting passes reagents of components to the finished product
#define CRAFT_TRANSFERS_REAGENTS (1<<7)
#define CRAFT_TRANSFERS_REAGENTS (1<<6)
/// Crafting clears all reagents present in the finished product
#define CRAFT_CLEARS_REAGENTS (1<<8)
/// For the crafting unit test, ensures that the custom materials of an item are the same when crafted and spawned.
#define CRAFT_ENFORCE_MATERIALS_PARITY (1<<9)
#define CRAFT_CLEARS_REAGENTS (1<<7)
/// For the crafting unit test, we don't check if the custom materials of an item are the same when crafted and spawned should its recipe have this flag.
#define CRAFT_SKIP_MATERIALS_PARITY (1<<8)
/// Exclusive to the personal_crafting component, skips the time spent crafting the recipe.
#define CRAFT_IGNORE_DO_AFTER (1<<10)
#define CRAFT_IGNORE_DO_AFTER (1<<9)
/// This craft won't change the materials of the resulting item to match that of the combined components
#define CRAFT_NO_MATERIALS (1<<10)
//food/drink crafting defines
//When adding new defines, please make sure to also add them to the encompassing list
+8 -9
View File
@@ -21,16 +21,16 @@ SUBSYSTEM_DEF(materials)
var/list/list/material_combos
///List of stackcrafting recipes for materials using base recipes
var/list/base_stack_recipes = list(
new /datum/stack_recipe("Chair", /obj/structure/chair/greyscale, crafting_flags = CRAFT_CHECK_DENSITY | CRAFT_ONE_PER_TURF | CRAFT_ON_SOLID_GROUND | CRAFT_APPLIES_MATS, category = CAT_FURNITURE),
new /datum/stack_recipe("Toilet", /obj/structure/toilet/greyscale, crafting_flags = CRAFT_CHECK_DENSITY | CRAFT_ONE_PER_TURF | CRAFT_ON_SOLID_GROUND | CRAFT_APPLIES_MATS, category = CAT_FURNITURE),
new /datum/stack_recipe("Sink Frame", /obj/structure/sinkframe, crafting_flags = CRAFT_CHECK_DENSITY | CRAFT_ONE_PER_TURF | CRAFT_ON_SOLID_GROUND | CRAFT_APPLIES_MATS, category = CAT_FURNITURE),
new /datum/stack_recipe("Material floor tile", /obj/item/stack/tile/material, 1, 4, 20, crafting_flags = CRAFT_APPLIES_MATS, category = CAT_TILES),
new /datum/stack_recipe("Material airlock assembly", /obj/structure/door_assembly/door_assembly_material, 4, time = 5 SECONDS, crafting_flags = CRAFT_CHECK_DENSITY | CRAFT_ONE_PER_TURF | CRAFT_ON_SOLID_GROUND | CRAFT_APPLIES_MATS, category = CAT_DOORS),
new /datum/stack_recipe("Material platform", /obj/structure/platform/material, 2, time = 3 SECONDS, crafting_flags = CRAFT_CHECK_DENSITY | CRAFT_ONE_PER_TURF | CRAFT_ON_SOLID_GROUND | CRAFT_APPLIES_MATS, trait_booster = TRAIT_QUICK_BUILD, trait_modifier = 0.75, category = CAT_STRUCTURE), \
new /datum/stack_recipe("Chair", /obj/structure/chair/greyscale, crafting_flags = CRAFT_CHECK_DENSITY | CRAFT_ONE_PER_TURF | CRAFT_ON_SOLID_GROUND | CRAFT_SKIP_MATERIALS_PARITY, category = CAT_FURNITURE),
new /datum/stack_recipe("Toilet", /obj/structure/toilet/greyscale, crafting_flags = CRAFT_CHECK_DENSITY | CRAFT_ONE_PER_TURF | CRAFT_ON_SOLID_GROUND | CRAFT_SKIP_MATERIALS_PARITY, category = CAT_FURNITURE),
new /datum/stack_recipe("Sink Frame", /obj/structure/sinkframe, crafting_flags = CRAFT_CHECK_DENSITY | CRAFT_ONE_PER_TURF | CRAFT_ON_SOLID_GROUND | CRAFT_SKIP_MATERIALS_PARITY, category = CAT_FURNITURE),
new /datum/stack_recipe("Material floor tile", /obj/item/stack/tile/material, 1, 4, 20, crafting_flags = CRAFT_SKIP_MATERIALS_PARITY, category = CAT_TILES),
new /datum/stack_recipe("Material airlock assembly", /obj/structure/door_assembly/door_assembly_material, 4, time = 5 SECONDS, crafting_flags = CRAFT_CHECK_DENSITY | CRAFT_ONE_PER_TURF | CRAFT_ON_SOLID_GROUND | CRAFT_SKIP_MATERIALS_PARITY, category = CAT_DOORS),
new /datum/stack_recipe("Material platform", /obj/structure/platform/material, 2, time = 3 SECONDS, crafting_flags = CRAFT_CHECK_DENSITY | CRAFT_ONE_PER_TURF | CRAFT_ON_SOLID_GROUND | CRAFT_SKIP_MATERIALS_PARITY, trait_booster = TRAIT_QUICK_BUILD, trait_modifier = 0.75, category = CAT_STRUCTURE), \
)
///List of stackcrafting recipes for materials using rigid recipes
var/list/rigid_stack_recipes = list(
new /datum/stack_recipe("Carving block", /obj/structure/carving_block, 5, time = 3 SECONDS, crafting_flags = CRAFT_CHECK_DENSITY | CRAFT_ONE_PER_TURF | CRAFT_ON_SOLID_GROUND | CRAFT_APPLIES_MATS, category = CAT_STRUCTURE),
new /datum/stack_recipe("Carving block", /obj/structure/carving_block, 5, time = 3 SECONDS, crafting_flags = CRAFT_CHECK_DENSITY | CRAFT_ONE_PER_TURF | CRAFT_ON_SOLID_GROUND | CRAFT_SKIP_MATERIALS_PARITY, category = CAT_STRUCTURE),
)
///A list of dimensional themes used by the dimensional anomaly and other things, most of which require materials to function.
@@ -157,8 +157,7 @@ SUBSYSTEM_DEF(materials)
if(!material_combos)
InitializeMaterials()
var/list/combo_params = list()
for(var/x in materials_declaration)
var/datum/material/mat = x
for(var/datum/material/mat as anything in materials_declaration)
combo_params += "[istype(mat) ? mat.id : mat]=[OPTIMAL_COST(materials_declaration[mat] * multiplier)]"
sortTim(combo_params, GLOBAL_PROC_REF(cmp_text_asc)) // We have to sort now in case the declaration was not in order
var/combo_index = combo_params.Join("-")
+1 -1
View File
@@ -37,7 +37,7 @@
var/atom/result = new bake_result
if(!item_target.compare_materials(result))
var/warning = "custom_materials of [result.type] when baked compared to just spawned don't match"
var/what_it_should_be = item_target.get_materials_english_list()
var/what_it_should_be = item_target.transcribe_materials_list()
stack_trace("[warning]. custom_materials should be [what_it_should_be].")
qdel(result)
+4 -2
View File
@@ -26,6 +26,8 @@
var/list/parts = list()
///items, structures and machineries of types that are in this list won't transfer their materials to the result
var/list/requirements_mats_blacklist
///if set, the materials in this list and their values will be subtracted from the result.
var/list/removed_mats
///like tool_behaviors but for reagents
var/list/chem_catalysts = list()
///where it shows up in the crafting UI
@@ -102,9 +104,9 @@
src.reqs[material] = stack_recipe.req_amount
src.category = stack_recipe.category || CAT_MISC
src.placement_checks = stack_recipe.placement_checks
src.crafting_flags = stack_recipe.crafting_flags
if(!(stack_recipe.crafting_flags & CRAFT_APPLIES_MATS))
requirements_mats_blacklist = list(material) //the item is not intended to have mats :shrug:
src.removed_mats = stack_recipe.removed_mats
/**
* Run custom pre-craft checks for this recipe, don't add feedback messages in this because it will spam the client
@@ -42,6 +42,7 @@
)
time = 5 SECONDS
category = CAT_CHEMISTRY
crafting_flags = parent_type::crafting_flags | CRAFT_SKIP_MATERIALS_PARITY //there are two ways to make a chem bombcore. We go with the first one for mats check
/datum/crafting_recipe/alcohol_burner
name = "Burner (Ethanol)"
@@ -27,8 +27,9 @@
/obj/item/stack/sheet/mineral/bamboo = 20
)
result = /obj/item/storage/basket
crafting_flags = CRAFT_SKIP_MATERIALS_PARITY
category = CAT_CONTAINERS
crafting_flags = parent_type::crafting_flags | CRAFT_MUST_BE_LEARNED
crafting_flags = parent_type::crafting_flags | CRAFT_MUST_BE_LEARNED | CRAFT_SKIP_MATERIALS_PARITY
steps = list(
"master the art of underwater basketweaving",
"be underwater"
+18 -3
View File
@@ -244,15 +244,30 @@
//used to gather the material composition of the utilized requirements to transfer to the result
var/list/total_materials = list()
var/list/stuff_to_use = get_used_reqs(recipe, crafter, total_materials)
for(var/mat in recipe.removed_mats)
var/to_remove = recipe.removed_mats[mat]
var/datum/material/ref_mat = locate(mat) in total_materials
if(!ref_mat)
continue
if(total_materials[ref_mat] < to_remove)
total_materials -= ref_mat
else
total_materials[ref_mat] -= to_remove
var/atom/result
var/turf/craft_turf = get_turf(crafter.loc)
var/set_materials = TRUE
var/set_materials = !(recipe.crafting_flags & CRAFT_NO_MATERIALS)
if(ispath(recipe.result, /turf))
result = craft_turf.place_on_top(recipe.result)
else if(ispath(recipe.result, /obj/item/stack))
var/res_amount = recipe.result_amount || 1
//we don't merge the stack right away but try to put it in the hand of the crafter
result = new recipe.result(craft_turf, recipe.result_amount || 1, /*merge =*/FALSE)
set_materials = FALSE //stacks are bit too complex for it for now, but you're free to change that.
if(set_materials)
result = new recipe.result(craft_turf, res_amount, /*merge =*/ FALSE, /*mat_override =*/ total_materials, /*mat_amt =*/ 1 / res_amount)
set_materials = FALSE //We've already set the materials on init. Don't do it again
else
result = new recipe.result(craft_turf, res_amount, FALSE)
else
result = new recipe.result(craft_turf)
if(result.atom_storage && recipe.delete_contents)
@@ -60,6 +60,7 @@
)
time = 10 SECONDS
category = CAT_EQUIPMENT
removed_mats = list(/datum/material/iron = SHEET_MATERIAL_AMOUNT * 2)
/datum/crafting_recipe/motorized_wheelchair
name = "Motorized Wheelchair"
+33 -1
View File
@@ -16,6 +16,7 @@
desc = "A prototype modular receiver and trigger assembly for a firearm."
icon = 'icons/obj/weapons/improvised.dmi'
icon_state = "receiver"
custom_materials = list(/datum/material/iron = SHEET_MATERIAL_AMOUNT * 5.5, /datum/material/cardboard = SHEET_MATERIAL_AMOUNT)
/obj/item/weaponcrafting/receiver/create_slapcraft_component()
var/static/list/slapcraft_recipe_list = list(/datum/crafting_recipe/pipegun)
@@ -28,7 +29,7 @@
/obj/item/weaponcrafting/stock
name = "rifle stock"
desc = "A classic rifle stock that doubles as a grip, roughly carved out of wood."
custom_materials = list(/datum/material/wood = SHEET_MATERIAL_AMOUNT * 6)
custom_materials = list(/datum/material/wood = SHEET_MATERIAL_AMOUNT * 8)
resistance_flags = FLAMMABLE
icon = 'icons/obj/weapons/improvised.dmi'
icon_state = "riflestock"
@@ -68,31 +69,61 @@
/obj/item/weaponcrafting/gunkit/nuclear
name = "advanced energy gun parts kit (lethal/nonlethal)"
desc = "A suitcase containing the necessary gun parts to transform a standard energy gun into an advanced energy gun."
custom_materials = list(
/datum/material/iron = SHEET_MATERIAL_AMOUNT * 5,
/datum/material/glass = SHEET_MATERIAL_AMOUNT,
/datum/material/uranium = SHEET_MATERIAL_AMOUNT * 1.5,
/datum/material/titanium = HALF_SHEET_MATERIAL_AMOUNT,
)
/obj/item/weaponcrafting/gunkit/tesla
name = "tesla cannon parts kit (lethal)"
desc = "A suitcase containing the necessary gun parts to construct a tesla cannon around a stabilized flux anomaly. Handle with care."
icon_state = "weaponskit_tesla"
custom_materials = list(/datum/material/iron = SHEET_MATERIAL_AMOUNT * 5, /datum/material/glass = SHEET_MATERIAL_AMOUNT * 5, /datum/material/silver = SHEET_MATERIAL_AMOUNT * 5)
/obj/item/weaponcrafting/gunkit/xray
name = "x-ray laser gun parts kit (lethal)"
desc = "A suitcase containing the necessary gun parts to turn a laser gun into a x-ray laser gun. Do not point most parts directly towards face."
custom_materials = list(
/datum/material/gold = SHEET_MATERIAL_AMOUNT * 2.5,
/datum/material/uranium = SHEET_MATERIAL_AMOUNT * 2,
/datum/material/iron = SHEET_MATERIAL_AMOUNT * 2.5,
/datum/material/titanium = SHEET_MATERIAL_AMOUNT,
/datum/material/bluespace = SHEET_MATERIAL_AMOUNT,
)
/obj/item/weaponcrafting/gunkit/ion
name = "ion carbine parts kit (nonlethal/highly destructive/very lethal (silicons))"
desc = "A suitcase containing the necessary gun parts to transform a standard laser gun into a ion carbine. Perfect against lockers you don't have access to."
custom_materials = list(/datum/material/silver = SHEET_MATERIAL_AMOUNT * 3, /datum/material/iron = SHEET_MATERIAL_AMOUNT * 4, /datum/material/uranium = SHEET_MATERIAL_AMOUNT)
/obj/item/weaponcrafting/gunkit/temperature
name = "temperature gun parts kit (less lethal/very lethal (lizardpeople))"
desc = "A suitcase containing the necessary gun parts to transform a standard energy gun into a temperature gun. Fantastic at birthday parties and killing indigenous populations of lizardpeople."
custom_materials = list(/datum/material/iron = SHEET_MATERIAL_AMOUNT * 2.5, /datum/material/glass = SMALL_MATERIAL_AMOUNT * 5, /datum/material/silver = SHEET_MATERIAL_AMOUNT * 1.5)
/obj/item/weaponcrafting/gunkit/beam_rifle
name = "\improper Event Horizon anti-existential beam rifle part kit (DOOMSDAY DEVICE, DO NOT CONSTRUCT)"
desc = "What fevered minds wrought this terrible construction kit? To create a frame to harness the strange energies that flow through the Spinward Sector towards such horrible acts of violence?"
custom_materials = list(
/datum/material/iron = SHEET_MATERIAL_AMOUNT * 5,
/datum/material/glass =SHEET_MATERIAL_AMOUNT * 2.5,
/datum/material/diamond = SHEET_MATERIAL_AMOUNT * 2.5,
/datum/material/uranium = SHEET_MATERIAL_AMOUNT * 4,
/datum/material/silver = SHEET_MATERIAL_AMOUNT * 2.25,
/datum/material/gold = SHEET_MATERIAL_AMOUNT * 2.5,
)
/obj/item/weaponcrafting/gunkit/ebow
name = "energy crossbow part kit (less lethal)"
desc = "Highly illegal weapons refurbishment kit that allows you to turn the standard proto-kinetic accelerator into a near-duplicate energy crossbow. Almost like the real thing!"
custom_materials = list(
/datum/material/iron = SHEET_MATERIAL_AMOUNT * 2.5,
/datum/material/glass = HALF_SHEET_MATERIAL_AMOUNT * 1.5,
/datum/material/uranium = HALF_SHEET_MATERIAL_AMOUNT * 1.5,
/datum/material/silver = HALF_SHEET_MATERIAL_AMOUNT * 1.5,
)
/obj/item/weaponcrafting/gunkit/hellgun
name = "hellfire laser gun degradation kit (warcrime lethal)"
@@ -101,6 +132,7 @@
/obj/item/weaponcrafting/gunkit/photon
name = "photon cannon parts kit (nonlethal)"
desc = "A suitcase containing the necessary gun parts to construct a photon cannon around a stabilized flux anomaly. Harness the power of the sun, in the palms of your hands."
custom_materials = list(/datum/material/iron = SHEET_MATERIAL_AMOUNT * 3, /datum/material/glass = SHEET_MATERIAL_AMOUNT * 7, /datum/material/gold = SHEET_MATERIAL_AMOUNT * 5)
/obj/item/weaponcrafting/gunkit/sks
name = "\improper Sakhno SKS semi-automatic rifle parts kit (lethal)"
@@ -62,6 +62,7 @@
/obj/item/melee/baton/security = 1,
)
tool_behaviors = list(TOOL_WELDER)
crafting_flags = parent_type::crafting_flags | CRAFT_SKIP_MATERIALS_PARITY
time = 10 SECONDS
category = CAT_WEAPON_MELEE
@@ -73,6 +74,7 @@
/obj/item/melee/baton/telescopic/contractor_baton = 1,
)
tool_behaviors = list(TOOL_WELDER)
crafting_flags = parent_type::crafting_flags | CRAFT_SKIP_MATERIALS_PARITY
time = 10 SECONDS
category = CAT_WEAPON_MELEE
@@ -8,6 +8,7 @@
result = /obj/item/stack/sheet/paperframes
result_amount = 5
category = CAT_STRUCTURE
requirements_mats_blacklist = list(/obj/item/stack/sheet/mineral/wood)
/datum/crafting_recipe/rib
name = "Colossal Rib"
@@ -118,6 +119,12 @@
)
tool_behaviors = list(TOOL_SCREWDRIVER, TOOL_WELDER, TOOL_DRILL)
time = 30 SECONDS
removed_mats = list(
/datum/material/alloy/plasteel = SHEET_MATERIAL_AMOUNT * 2,
/datum/material/iron = SHEET_MATERIAL_AMOUNT * 1.55,
/datum/material/titanium = SHEET_MATERIAL_AMOUNT,
/datum/material/glass = SHEET_MATERIAL_AMOUNT,
)
category = CAT_STRUCTURE
/datum/crafting_recipe/vault
@@ -132,6 +139,14 @@
)
tool_behaviors = list(TOOL_SCREWDRIVER, TOOL_WELDER, TOOL_DRILL)
time = 90 SECONDS
removed_mats = list(
/datum/material/metalhydrogen = SHEET_MATERIAL_AMOUNT * 5,
/datum/material/alloy/plastitanium = SHEET_MATERIAL_AMOUNT * 2,
/datum/material/alloy/plasteel = SHEET_MATERIAL_AMOUNT * 2,
/datum/material/iron = SHEET_MATERIAL_AMOUNT * 1.5,
/datum/material/titanium = SHEET_MATERIAL_AMOUNT,
/datum/material/glass = SHEET_MATERIAL_AMOUNT,
)
category = CAT_STRUCTURE
crafting_flags = CRAFT_CHECK_DENSITY | CRAFT_ON_SOLID_GROUND
@@ -147,4 +162,10 @@
tool_behaviors = list(TOOL_SCREWDRIVER, TOOL_WELDER, TOOL_DRILL)
time = 90 SECONDS
category = CAT_STRUCTURE
removed_mats = list(
/datum/material/metalhydrogen = SHEET_MATERIAL_AMOUNT * 5,
/datum/material/alloy/plastitanium = SHEET_MATERIAL_AMOUNT * 2,
/datum/material/iron = SHEET_MATERIAL_AMOUNT,
/datum/material/glass = SHEET_MATERIAL_AMOUNT,
)
crafting_flags = CRAFT_CHECK_DENSITY | CRAFT_ON_SOLID_GROUND
@@ -150,6 +150,7 @@
tool_behaviors = list(TOOL_SCREWDRIVER, TOOL_WIRECUTTER)
reqs = list(/obj/item/clothing/glasses/hud/security/sunglasses = 1)
category = CAT_EQUIPMENT
crafting_flags = parent_type::crafting_flags | CRAFT_SKIP_MATERIALS_PARITY
/datum/crafting_recipe/hudsunmed
name = "Medical HUDsunglasses"
@@ -168,6 +169,7 @@
tool_behaviors = list(TOOL_SCREWDRIVER, TOOL_WIRECUTTER)
reqs = list(/obj/item/clothing/glasses/hud/health/sunglasses = 1)
category = CAT_EQUIPMENT
crafting_flags = parent_type::crafting_flags | CRAFT_SKIP_MATERIALS_PARITY
/datum/crafting_recipe/hudsundiag
name = "Diagnostic HUDsunglasses"
@@ -186,6 +188,7 @@
tool_behaviors = list(TOOL_SCREWDRIVER, TOOL_WIRECUTTER)
reqs = list(/obj/item/clothing/glasses/hud/diagnostic/sunglasses = 1)
category = CAT_EQUIPMENT
crafting_flags = parent_type::crafting_flags | CRAFT_SKIP_MATERIALS_PARITY
/datum/crafting_recipe/scienceglasses
name = "Science Glasses"
@@ -204,6 +207,7 @@
tool_behaviors = list(TOOL_SCREWDRIVER, TOOL_WIRECUTTER)
reqs = list(/obj/item/clothing/glasses/sunglasses/chemical = 1)
category = CAT_EQUIPMENT
crafting_flags = parent_type::crafting_flags | CRAFT_SKIP_MATERIALS_PARITY
/datum/crafting_recipe/ghostsheet
name = "Ghost Sheet"
@@ -539,6 +543,7 @@
/obj/item/stack/sheet/mineral/metal_hydrogen = 1,
/obj/item/stack/sheet/mineral/zaukerite = 1,
)
crafting_flags = parent_type::crafting_flags | CRAFT_SKIP_MATERIALS_PARITY // stupid recipe, don't give every atmos gas mask these mats.
category = CAT_CLOTHING
+1
View File
@@ -16,6 +16,7 @@
blacklist = list(/obj/item/grown/log/steel)
result = /obj/structure/bonfire
category = CAT_TOOLS
crafting_flags = parent_type::crafting_flags | CRAFT_SKIP_MATERIALS_PARITY
/datum/crafting_recipe/boneshovel
name = "Serrated Bone Shovel"
@@ -101,6 +101,7 @@
tool_behaviors = list(TOOL_SCREWDRIVER)
time = 1.2 SECONDS
category = CAT_WEAPON_AMMO
crafting_flags = CRAFT_SKIP_MATERIALS_PARITY
/datum/crafting_recipe/trashball
name = "Trashball"
+1 -1
View File
@@ -41,7 +41,7 @@
var/atom/result = new cook_result
if(!item_parent.compare_materials(result))
var/warning = "custom_materials of [result.type] when grilled compared to just spawned don't match"
var/what_it_should_be = item_parent.get_materials_english_list()
var/what_it_should_be = item_parent.transcribe_materials_list()
stack_trace("[warning]. custom_materials should be [what_it_should_be].")
qdel(result)
+2
View File
@@ -377,6 +377,7 @@
icon = 'icons/obj/devices/remote.dmi'
icon_state = "trapdoor_remote"
COOLDOWN_DECLARE(trapdoor_cooldown)
custom_materials = list(/datum/material/iron = SMALL_MATERIAL_AMOUNT * 1.5, /datum/material/glass = SMALL_MATERIAL_AMOUNT * 0.5)
var/trapdoor_cooldown_time = 2 SECONDS
var/obj/item/assembly/trapdoor/internals
@@ -474,6 +475,7 @@
desc = "A kit containing all the parts needed to build a trapdoor. Can only be used on open space."
icon = 'icons/obj/weapons/improvised.dmi'
icon_state = "kitsuitcase"
custom_materials = list(/datum/material/iron = SHEET_MATERIAL_AMOUNT * 6.5, /datum/material/glass = SMALL_MATERIAL_AMOUNT * 2.2)
var/in_use = FALSE
/obj/item/trapdoor_kit/Initialize(mapload)
+1 -1
View File
@@ -21,7 +21,7 @@
var/atom/result = new dry_result
if(!atom_target.compare_materials(result))
var/warning = "custom_materials of [result.type] when dried compared to just spawned don't match"
var/what_it_should_be = atom_target.get_materials_english_list()
var/what_it_should_be = atom_target.transcribe_materials_list()
stack_trace("[warning]. custom_materials should be [what_it_should_be].")
qdel(result)
+1 -1
View File
@@ -31,7 +31,7 @@
var/atom/result = new result_typepath
if(!target.compare_materials(result))
var/warning = "custom_materials of [result.type] when microwaved compared to just spawned don't match"
var/what_it_should_be = target.get_materials_english_list()
var/what_it_should_be = target.transcribe_materials_list()
stack_trace("[warning]. custom_materials should be [what_it_should_be].")
qdel(result)
+1 -1
View File
@@ -45,7 +45,7 @@
var/atom/movable/result = new result_atom_type
if(!prototype.compare_materials(result))
var/warning = "custom_materials of [result.type] when processed compared to just spawned don't match"
var/what_it_should_be = prototype.get_materials_english_list()
var/what_it_should_be = prototype.transcribe_materials_list()
//compose a text string containing the syntax and paths to use for editing the custom_materials var
if(result.custom_materials)
what_it_should_be += " (you can round values a bit)"
+37 -13
View File
@@ -29,16 +29,28 @@
/atom/proc/initialize_materials(list/materials, multiplier = 1)
SHOULD_NOT_OVERRIDE(TRUE)
if(multiplier != 1)
materials = materials.Copy() //avoid editing the list that was originally used as argument if it's ever going to be used again.
materials = materials.Copy() //avoid editing the original list since it may be cached somewhere (likely in the materials subsystem).
for(var/current_material in materials)
materials[current_material] *= multiplier
//Let's be sure that there are absolutely no materials in the list that aren't positive.
var/list/nonpos_mats
for(var/mat in materials)
if(materials[mat] <= 0)
LAZYADD(nonpos_mats, "[mat] = [materials[mat]]")
materials -= mat
if(length(nonpos_mats))
stack_trace("materials with non-positive values found in [type]: [english_list(nonpos_mats, and_text = ", ")]")
if(!length(materials))
return
sortTim(materials, GLOBAL_PROC_REF(cmp_numeric_dsc), associative = TRUE)
apply_material_effects(materials)
///proc responsible for applying material effects when setting materials.
/atom/proc/apply_material_effects(list/materials)
SHOULD_CALL_PARENT(TRUE)
if(material_flags & MATERIAL_EFFECTS)
var/list/material_effects = get_material_effects_list(materials)
finalize_material_effects(material_effects)
@@ -375,10 +387,7 @@
* Gets the most common material in the object.
*/
/atom/proc/get_master_material()
var/list/cached_materials = custom_materials
if(!length(cached_materials))
return null
return GET_MATERIAL_REF(cached_materials[1]) //materials are sorted by amount, the first is always the main one
return length(custom_materials) ? GET_MATERIAL_REF(custom_materials[1]) : null //materials are sorted by amount, the first is always the main one
/**
* Gets the total amount of materials in this atom.
@@ -387,6 +396,16 @@
return isnull(custom_materials) ? 0 : counterlist_sum(custom_materials)
///A simple proc that iterates through each material that the object is made of and spawns some stacks based on their amount and associated sheet/ore type.
/atom/proc/drop_costum_materials(multiplier = 1)
for(var/datum/material/material as anything in custom_materials)
var/stack_type = material.sheet_type || material.ore_type
if(!stack_type)
continue
var/amount_to_spawn = FLOOR(custom_materials[material] / SHEET_MATERIAL_AMOUNT * multiplier, 1)
if(amount_to_spawn > 0)
new stack_type(loc, amount_to_spawn)
/**
* A bit of leeway when comparing the amount of material of two items.
* This was made to test the material composition of items spawned via crafting/processable component and an items of the same type spawned
@@ -401,6 +420,8 @@
/// Compares the materials of two items to see if they're roughly the same. Primarily used in crafting and processing unit tests.
/atom/proc/compare_materials(atom/target)
if(custom_materials == target.custom_materials) // SSmaterials caches the combinations so we don't have to run more complex checks
return TRUE
if(length(custom_materials) != length(target.custom_materials))
return FALSE
for(var/mat in custom_materials)
@@ -415,17 +436,20 @@
#undef COMPARISION_ACCEPTABLE_MATERIAL_DEVIATION
/**
* Returns a string with the materials and their respective amounts in it (eg. [list(/datum/material/meat = 100, /datum/material/plastic = 10)] )
* also used in several unit tests.
* Returns a string with the materials and their respective amounts written in a way that reflects how it's displayed in the code
* (eg. [list(/datum/material/meat = 100, /datum/material/plastic = 10)]). Also used in several unit tests.
* Not to be confused with get_material_english_list()
*/
/atom/proc/get_materials_english_list()
if(!custom_materials)
return "null"
/atom/proc/transcribe_materials_list(list/mats_list)
if(!mats_list)
if(!custom_materials)
return "null"
mats_list = custom_materials
var/text = "\[list("
var/index = 1
var/mats_len = length(custom_materials)
for(var/datum/material/mat as anything in custom_materials)
text += "[mat.type] = [custom_materials[mat]]"
var/mats_len = length(mats_list)
for(var/datum/material/mat as anything in mats_list)
text += "[mat.type] = [mats_list[mat]]"
if(index < mats_len)
text += ", "
index++
+1
View File
@@ -9,6 +9,7 @@
density = TRUE
anchored = FALSE
max_integrity = 500
custom_materials = list(/datum/material/alloy/plasteel = SHEET_MATERIAL_AMOUNT * 4)
var/state = CORE_STATE_EMPTY
var/datum/ai_laws/laws
var/obj/item/circuitboard/aicore/circuit
+1 -4
View File
@@ -7,10 +7,7 @@
desc = "The basic construction for Nanotrasen-Always-Watching-You cameras."
icon = 'icons/obj/machines/camera.dmi'
icon_state = "cameracase"
custom_materials = list(
/datum/material/iron = SMALL_MATERIAL_AMOUNT * 4,
/datum/material/glass = SMALL_MATERIAL_AMOUNT * 2.5,
)
custom_materials = list(/datum/material/iron = SHEET_MATERIAL_AMOUNT)
result_path = /obj/machinery/camera/autoname/deconstructed
wall_external = TRUE
@@ -167,7 +167,7 @@
desc = "A device designed to detect gases and their concentration in an area."
icon = 'icons/obj/wallmounts.dmi'
icon_state = "gsensor0"
custom_materials = list(/datum/material/iron = SMALL_MATERIAL_AMOUNT, /datum/material/glass = SMALL_MATERIAL_AMOUNT)
custom_materials = list(/datum/material/iron = SHEET_MATERIAL_AMOUNT + SMALL_MATERIAL_AMOUNT * 0.3, /datum/material/glass = SMALL_MATERIAL_AMOUNT * 0.2)
/obj/item/air_sensor/Initialize(mapload, inlet, outlet)
. = ..()
@@ -302,6 +302,7 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/computer/security/telescreen/ordnance
/obj/item/wallframe/telescreen/engine
name = "engine telescreen frame"
result_path = /obj/machinery/computer/security/telescreen/engine
custom_materials = list(/datum/material/iron = SHEET_MATERIAL_AMOUNT * 7)
MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/computer/security/telescreen/engine, 32)
@@ -314,6 +315,7 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/computer/security/telescreen/engine,
/obj/item/wallframe/telescreen/turbine
name = "turbine telescreen frame"
result_path = /obj/machinery/computer/security/telescreen/turbine
custom_materials = list(/datum/material/iron = SHEET_MATERIAL_AMOUNT * 7)
MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/computer/security/telescreen/turbine, 32)
@@ -350,6 +352,7 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/computer/security/telescreen/prison,
/obj/item/wallframe/telescreen/auxbase
name = "auxiliary base telescreen frame"
result_path = /obj/machinery/computer/security/telescreen/auxbase
custom_materials = list(/datum/material/iron = SHEET_MATERIAL_AMOUNT * 7)
MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/computer/security/telescreen/auxbase, 32)
@@ -6,6 +6,7 @@
base_icon_state = "box_"
density = TRUE
max_integrity = 250
custom_materials = list(/datum/material/iron = SHEET_MATERIAL_AMOUNT * 5)
/// What board do we accept
var/board_type = /obj/item/circuitboard
/// Reference to the circuit inside the frame
@@ -231,6 +231,7 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/defibrillator_mount, 28)
icon_state = "mobile"
anchored = FALSE
density = TRUE
custom_materials = list(/datum/material/iron = SHEET_MATERIAL_AMOUNT * 5.15, /datum/material/silver = SHEET_MATERIAL_AMOUNT, /datum/material/glass = SMALL_MATERIAL_AMOUNT * 1.5)
/obj/machinery/defibrillator_mount/mobile/Initialize(mapload)
. = ..()
+1
View File
@@ -70,6 +70,7 @@
icon_state = "woodenbarricade"
resistance_flags = FLAMMABLE
bar_material = WOOD
custom_materials = list(/datum/material/wood = SHEET_MATERIAL_AMOUNT * 5)
/// When destroyed or deconstructed, how many planks of wood does our barricade drop? Also determines how many it takes to repair the barricade and by how much.
var/drop_amount = 3
+1
View File
@@ -2444,6 +2444,7 @@
aiControlDisabled = AI_WIRE_DISABLED
req_access = list(ACCESS_BLOODCULT)
damage_deflection = 10
custom_materials = list(/datum/material/runedmetal = SHEET_MATERIAL_AMOUNT)
var/openingoverlaytype = /obj/effect/temp_visual/cult/door
var/friendly = FALSE
var/stealthy = FALSE
+2
View File
@@ -815,6 +815,7 @@
base_icon_state = "frame"
anchored = FALSE
density = TRUE
custom_materials = list(/datum/material/iron = SHEET_MATERIAL_AMOUNT * 3)
var/constructionStep = CONSTRUCTION_NO_CIRCUIT
var/reinforced = 0
/// Is this a border_only firelock? Used in several checks during construction
@@ -971,6 +972,7 @@
flags_1 = ON_BORDER_1
obj_flags = CAN_BE_HIT | IGNORE_DENSITY
directional = TRUE
custom_materials = list(/datum/material/iron = SHEET_MATERIAL_AMOUNT * 2)
/obj/structure/firelock_frame/border_only/Initialize(mapload)
. = ..()
+1
View File
@@ -14,6 +14,7 @@
resistance_flags = FIRE_PROOF
damage_deflection = 70
can_open_with_hands = FALSE
custom_materials = list(/datum/material/alloy/plasteel = SHEET_MATERIAL_AMOUNT * 15, /datum/material/iron = SMALL_MATERIAL_AMOUNT * 2, /datum/material/glass = SMALL_MATERIAL_AMOUNT * 2)
/// The recipe for this door
var/datum/crafting_recipe/recipe_type = /datum/crafting_recipe/blast_doors
/// The current deconstruction step
+2
View File
@@ -9,6 +9,7 @@
armor_type = /datum/armor/poddoor_shutters
max_integrity = 100
recipe_type = /datum/crafting_recipe/shutters
custom_materials = list(/datum/material/alloy/plasteel = SHEET_MATERIAL_AMOUNT * 5, /datum/material/iron = SMALL_MATERIAL_AMOUNT, /datum/material/glass = SMALL_MATERIAL_AMOUNT)
animation_sound = 'sound/machines/shutter.ogg'
show_nav_computer_icon = FALSE
@@ -37,6 +38,7 @@
/obj/machinery/door/poddoor/shutters/preopen/deconstructed
deconstruction = BLASTDOOR_NEEDS_WIRES
custom_materials = list(/datum/material/alloy/plasteel = SHEET_MATERIAL_AMOUNT * 5)
/obj/machinery/door/poddoor/shutters/indestructible
name = "hardened shutters"
+1
View File
@@ -10,6 +10,7 @@
armor_type = /datum/armor/machinery_igniter
resistance_flags = FIRE_PROOF
processing_flags = NONE
custom_materials = list(/datum/material/iron = SHEET_MATERIAL_AMOUNT * 5 + HALF_SHEET_MATERIAL_AMOUNT, /datum/material/glass = SMALL_MATERIAL_AMOUNT / 2)
var/id = null
var/on = FALSE
+1
View File
@@ -24,6 +24,7 @@
mouse_drag_pointer = MOUSE_ACTIVE_POINTER
use_power = NO_POWER_USE
interaction_flags_mouse_drop = NEED_HANDS
custom_materials = list(/datum/material/iron = SHEET_MATERIAL_AMOUNT * 1.1, /datum/material/plastic = SHEET_MATERIAL_AMOUNT, /datum/material/glass = SMALL_MATERIAL_AMOUNT * 0.2)
/// Information and effects about where the IV drip is attached to
var/datum/iv_drip_attachment/attachment
+37
View File
@@ -19,6 +19,7 @@ Buildable meters
icon_state_preview = "manifold4w"
inhand_icon_state = "buildpipe"
w_class = WEIGHT_CLASS_NORMAL
custom_materials = list(/datum/material/iron = SHEET_MATERIAL_AMOUNT)
///Piping layer that we are going to be on
var/piping_layer = PIPING_LAYER_DEFAULT
///Type of pipe-object made, selected from the RPD
@@ -42,65 +43,100 @@ Buildable meters
/obj/item/pipe/directional
RPD_type = PIPE_UNARY
/obj/item/pipe/directional/he_junction
icon_state_preview = "junction"
pipe_type = /obj/machinery/atmospherics/pipe/heat_exchanging/junction
custom_materials = list(/datum/material/iron = SHEET_MATERIAL_AMOUNT * 2)
/obj/item/pipe/directional/vent
name = "air vent fitting"
icon_state_preview = "uvent"
pipe_type = /obj/machinery/atmospherics/components/unary/vent_pump
custom_materials = list(/datum/material/iron = SHEET_MATERIAL_AMOUNT * 6 + SMALL_MATERIAL_AMOUNT / 2, /datum/material/glass = SMALL_MATERIAL_AMOUNT / 2)
/obj/item/pipe/directional/scrubber
name = "air scrubber fitting"
icon_state_preview = "scrubber"
pipe_type = /obj/machinery/atmospherics/components/unary/vent_scrubber
custom_materials = list(/datum/material/iron = SHEET_MATERIAL_AMOUNT * 6 + SMALL_MATERIAL_AMOUNT / 2, /datum/material/glass = SMALL_MATERIAL_AMOUNT / 2)
/obj/item/pipe/directional/connector
icon_state_preview = "connector"
pipe_type = /obj/machinery/atmospherics/components/unary/portables_connector
custom_materials = list(/datum/material/iron = SHEET_MATERIAL_AMOUNT * 2)
/obj/item/pipe/directional/passive_vent
icon_state_preview = "pvent"
pipe_type = /obj/machinery/atmospherics/components/unary/passive_vent
custom_materials = list(/datum/material/iron = SHEET_MATERIAL_AMOUNT * 2)
/obj/item/pipe/directional/injector
icon_state_preview = "injector"
pipe_type = /obj/machinery/atmospherics/components/unary/outlet_injector
custom_materials = list(/datum/material/iron = SHEET_MATERIAL_AMOUNT * 2, /datum/material/glass = SMALL_MATERIAL_AMOUNT / 2)
/obj/item/pipe/directional/he_exchanger
icon_state_preview = "heunary"
pipe_type = /obj/machinery/atmospherics/components/unary/heat_exchanger
custom_materials = list(/datum/material/iron = SHEET_MATERIAL_AMOUNT, /datum/material/alloy/plasteel = SHEET_MATERIAL_AMOUNT)
/obj/item/pipe/directional/airlock_pump
icon_state_preview = "airlock_pump"
pipe_type = /obj/machinery/atmospherics/components/unary/airlock_pump
custom_materials = list(/datum/material/iron = SHEET_MATERIAL_AMOUNT * 6, /datum/material/glass = SMALL_MATERIAL_AMOUNT * 0.7)
/obj/item/pipe/binary
RPD_type = PIPE_STRAIGHT
/obj/item/pipe/binary/layer_adapter
icon_state_preview = "manifoldlayer"
pipe_type = /obj/machinery/atmospherics/pipe/layer_manifold
custom_materials = list(/datum/material/iron = SHEET_MATERIAL_AMOUNT * 2)
/obj/item/pipe/binary/color_adapter
icon_state_preview = "adapter_center"
pipe_type = /obj/machinery/atmospherics/pipe/color_adapter
custom_materials = list(/datum/material/iron = SHEET_MATERIAL_AMOUNT * 2)
/obj/item/pipe/binary/pressure_pump
icon_state_preview = "pump"
pipe_type = /obj/machinery/atmospherics/components/binary/pump
custom_materials = list(/datum/material/iron = SHEET_MATERIAL_AMOUNT * 6, /datum/material/glass = SMALL_MATERIAL_AMOUNT / 2)
/obj/item/pipe/binary/manual_valve
icon_state_preview = "mvalve"
pipe_type = /obj/machinery/atmospherics/components/binary/valve
custom_materials = list(/datum/material/iron = SHEET_MATERIAL_AMOUNT * 2)
/obj/item/pipe/binary/bendable
RPD_type = PIPE_BENDABLE
/obj/item/pipe/trinary
RPD_type = PIPE_TRINARY
/obj/item/pipe/trinary/flippable
RPD_type = PIPE_TRIN_M
var/flipped = FALSE
/obj/item/pipe/trinary/flippable/filter
name = "gas filter fitting"
icon_state_preview = "filter"
pipe_type = /obj/machinery/atmospherics/components/trinary/filter
custom_materials = list(/datum/material/iron = SHEET_MATERIAL_AMOUNT * 6, /datum/material/glass = SMALL_MATERIAL_AMOUNT / 2)
/obj/item/pipe/trinary/flippable/mixer
icon_state_preview = "mixer"
pipe_type = /obj/machinery/atmospherics/components/trinary/mixer
custom_materials = list(/datum/material/iron = SHEET_MATERIAL_AMOUNT * 6, /datum/material/glass = SMALL_MATERIAL_AMOUNT / 2)
/obj/item/pipe/quaternary
RPD_type = PIPE_ONEDIR
/obj/item/pipe/quaternary/pipe
icon_state_preview = "manifold4w"
pipe_type = /obj/machinery/atmospherics/pipe/smart
/obj/item/pipe/quaternary/pipe/crafted
/obj/item/pipe/quaternary/pipe/crafted/Initialize(mapload, _pipe_type, _dir, obj/machinery/atmospherics/make_from, device_color, device_init_dir = SOUTH)
@@ -114,6 +150,7 @@ Buildable meters
/obj/item/pipe/quaternary/he_pipe
icon_state_preview = "he_manifold4w"
pipe_type = /obj/machinery/atmospherics/pipe/heat_exchanging/manifold4w
custom_materials = list(/datum/material/iron = SHEET_MATERIAL_AMOUNT * 2)
/obj/item/pipe/Initialize(mapload, _pipe_type, _dir, obj/machinery/atmospherics/make_from, device_color, device_init_dir = SOUTH)
if(make_from)
@@ -17,6 +17,7 @@
density = TRUE
obj_flags = UNIQUE_RENAME | RENAME_NO_DESC
use_power = NO_POWER_USE
custom_materials = list(/datum/material/iron = SHEET_MATERIAL_AMOUNT * 5)
var/build_step = PTURRET_UNSECURED //the current step in the building process
var/finish_name = "turret" //the name applied to the product turret
var/obj/item/gun/installed_gun = null
@@ -210,4 +210,4 @@
icon = 'icons/obj/machines/turret_control.dmi'
icon_state = "control_frame"
result_path = /obj/machinery/turretid
custom_materials = list(/datum/material/iron= SHEET_MATERIAL_AMOUNT)
custom_materials = list(/datum/material/iron = SHEET_MATERIAL_AMOUNT * 6)
+1
View File
@@ -547,6 +547,7 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/requests_console/auto_name, 30)
icon_state = "req_comp_off"
result_path = /obj/machinery/requests_console/auto_name
pixel_shift = 30
custom_materials = list(/datum/material/iron = SHEET_MATERIAL_AMOUNT * 7)
/datum/aas_config_entry/rc_emergency
name = "RC Alert: Emergency Request"
+1
View File
@@ -324,6 +324,7 @@
cell = null
interaction_flags_click = FORBID_TELEKINESIS_REACH
settable_temperature_range = 50
custom_materials = list(/datum/material/glass = SHEET_MATERIAL_AMOUNT * 3, /datum/material/iron = SHEET_MATERIAL_AMOUNT * 2)
///The beaker within the heater
var/obj/item/reagent_containers/beaker = null
/// How quickly it delivers heat to the reagents. In watts per joule of the thermal energy difference of the reagent from the temperature difference of the current and target temperatures.
+2
View File
@@ -15,6 +15,7 @@
subsystem_type = /datum/controller/subsystem/processing/fastprocess
interaction_flags_machine = INTERACT_MACHINE_WIRES_IF_OPEN | INTERACT_MACHINE_OFFLINE
use_power = NO_POWER_USE
custom_materials = list(/datum/material/alloy/plasteel = SHEET_MATERIAL_AMOUNT * 10)
/// What is the lowest amount of time we can set the timer to?
var/minimum_timer = SYNDIEBOMB_MIN_TIMER_SECONDS
@@ -356,6 +357,7 @@
w_class = WEIGHT_CLASS_NORMAL
flags_1 = PREVENT_CONTENTS_EXPLOSION_1 // We detonate upon being exploded.
resistance_flags = FLAMMABLE //Burnable (but the casing isn't)
custom_materials = list(/datum/material/iron = SHEET_MATERIAL_AMOUNT * 2.05)
var/adminlog = null
var/range_heavy = 3
var/range_medium = 9
@@ -8,6 +8,7 @@
resistance_flags = FLAMMABLE
obj_flags = CAN_BE_HIT
item_flags = NO_PIXEL_RANDOM_DROP
custom_materials = list(/datum/material/cardboard = SHEET_MATERIAL_AMOUNT * 5)
/// If the cutout is pushed over and has to be righted
var/pushed_over = FALSE
/// If the cutout actually appears as what it portray and not a discolored version
+1
View File
@@ -2058,6 +2058,7 @@
worn_icon_state = "nothing"
resistance_flags = FLAMMABLE
slot_flags = ITEM_SLOT_ID
custom_materials = list(/datum/material/cardboard = SHEET_MATERIAL_AMOUNT)
///The "name" of the "owner" of this "ID"
var/scribbled_name
///The assignment written on this card.
+1
View File
@@ -24,6 +24,7 @@
actions_types = list(/datum/action/item_action/startchainsaw)
tool_behaviour = TOOL_SAW
toolspeed = 1.5 //Turn it on first you dork
custom_materials = list(/datum/material/iron = SHEET_MATERIAL_AMOUNT * 5, /datum/material/alloy/plasteel = SHEET_MATERIAL_AMOUNT * 5, /datum/material/glass = SHEET_MATERIAL_AMOUNT * 3)
var/force_on = 24
/// The looping sound for our chainsaw when running
var/datum/looping_sound/chainsaw/chainsaw_loop
+4 -2
View File
@@ -163,7 +163,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM
name = "firebrand"
desc = "An unlit firebrand. It makes you wonder why it's not just called a stick."
smoketime = 40 SECONDS
custom_materials = list(/datum/material/wood = SHEET_MATERIAL_AMOUNT)
custom_materials = list(/datum/material/wood = SHEET_MATERIAL_AMOUNT * 2)
grind_results = list(/datum/reagent/carbon = 2)
/obj/item/match/firebrand/Initialize(mapload)
@@ -175,6 +175,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM
desc = "A budget lighter done by using a battery and some aluminium. Hold tightly to ignite."
icon_state = "battery_unlit"
base_icon_state = "battery"
custom_materials = list(/datum/material/iron = SMALL_MATERIAL_AMOUNT * 7, /datum/material/glass = SMALL_MATERIAL_AMOUNT * 0.5)
/obj/item/match/battery/attack_self(mob/living/user, modifiers)
. = ..()
@@ -932,6 +933,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM
list_reagents = null
w_class = WEIGHT_CLASS_SMALL
choke_forever = TRUE
custom_materials = list(/datum/material/wood = SHEET_MATERIAL_AMOUNT * 2)
///name of the stuff packed inside this pipe
var/packeditem
@@ -1009,7 +1011,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM
inhand_icon_on = null
inhand_icon_off = null
lung_harm = 2
custom_materials = list(/datum/material/glass = SHEET_MATERIAL_AMOUNT)
custom_materials = list(/datum/material/glass = SHEET_MATERIAL_AMOUNT * 3)
///////////
//ROLLING//
+1
View File
@@ -229,6 +229,7 @@
inhand_icon_state = "gold_horn"
worn_icon_state = "horn_gold"
COOLDOWN_DECLARE(golden_horn_cooldown)
custom_materials = list(/datum/material/bananium = SHEET_MATERIAL_AMOUNT * 5)
/obj/item/bikehorn/golden/attack()
flip_mobs()
@@ -35,12 +35,14 @@
desc = "A stylish upgrade (?) to the intelliCard."
icon_state = "aitater"
base_icon_state = "aitater"
custom_materials = list(/datum/material/iron = SMALL_MATERIAL_AMOUNT * 0.5, /datum/material/glass = SMALL_MATERIAL_AMOUNT * 0.5)
/obj/item/aicard/aispook
name = "intelliLantern"
desc = "A spoOoOoky upgrade to the intelliCard."
icon_state = "aispook"
base_icon_state = "aispook"
custom_materials = list(/datum/material/iron = SMALL_MATERIAL_AMOUNT * 0.5, /datum/material/glass = SMALL_MATERIAL_AMOUNT * 0.5)
/obj/item/aicard/suicide_act(mob/living/user)
user.visible_message(span_suicide("[user] is trying to upload [user.p_them()]self into [src]! That's not going to work out well!"))
@@ -9,6 +9,7 @@
icon_state = "pressureplate"
layer = ABOVE_OPEN_TURF_LAYER
plane = FLOOR_PLANE
custom_materials = list(/datum/material/iron = SHEET_MATERIAL_AMOUNT * 1.75, /datum/material/glass = SMALL_MATERIAL_AMOUNT * 0.7)
var/trigger_mob = TRUE
var/trigger_item = FALSE
var/specific_item = null
@@ -197,7 +197,7 @@
icon_state = "intercom"
result_path = /obj/item/radio/intercom/unscrewed
pixel_shift = 26
custom_materials = list(/datum/material/iron = SMALL_MATERIAL_AMOUNT * 0.75, /datum/material/glass = SMALL_MATERIAL_AMOUNT * 0.25)
custom_materials = list(/datum/material/iron = SHEET_MATERIAL_AMOUNT * 2)
MAPPING_DIRECTIONAL_HELPERS(/obj/item/radio/intercom, 27)
@@ -404,6 +404,7 @@ effective or pretty fucking useless.
desc = "A jury-rigged device that disrupts nearby radio communication. Its crude construction provides a significantly smaller area of effect compared to its Syndicate counterpart."
range = 5
disruptor_range = 3
custom_materials = list(/datum/material/iron = SMALL_MATERIAL_AMOUNT * 0.5, /datum/material/glass = SMALL_MATERIAL_AMOUNT * 0.5)
/obj/item/jammer/makeshift/Initialize(mapload)
. = ..()
+1 -1
View File
@@ -162,7 +162,7 @@
throwforce = 1
w_class = WEIGHT_CLASS_SMALL
force = 3
custom_materials = list(/datum/material/iron = SMALL_MATERIAL_AMOUNT * 0.5, /datum/material/glass = SMALL_MATERIAL_AMOUNT * 0.4)
custom_materials = null
max_water = 30
sprite_name = "coolant"
dog_fashion = null
+1
View File
@@ -83,6 +83,7 @@ GLOBAL_DATUM(bridge_axe, /obj/item/fireaxe)
icon_angle = 180
force_unwielded = 5
force_wielded = 23
custom_materials = list(/datum/material/bone = SHEET_MATERIAL_AMOUNT * 6)
/*
* Metal Hydrogen Axe
+1 -1
View File
@@ -12,7 +12,7 @@
throw_speed = 1
throw_range = 5
w_class = WEIGHT_CLASS_NORMAL
custom_materials = list(/datum/material/iron= HALF_SHEET_MATERIAL_AMOUNT * 0.5)
custom_materials = list(/datum/material/iron = SHEET_MATERIAL_AMOUNT * 1.05, /datum/material/glass = SMALL_MATERIAL_AMOUNT * 0.8)
resistance_flags = FIRE_PROOF
trigger_guard = TRIGGER_GUARD_NORMAL
light_system = OVERLAY_LIGHT
+1
View File
@@ -103,6 +103,7 @@
icon_state = "flatcart"
density = TRUE
opacity = FALSE
custom_materials = list(/datum/material/iron = SHEET_MATERIAL_AMOUNT * 8, /datum/material/alloy/plasteel = SHEET_MATERIAL_AMOUNT)
/obj/structure/flatpack_cart/Initialize(mapload)
. = ..()
+1
View File
@@ -87,6 +87,7 @@
tastes = list("cheese" = 4, "royalty" = 1)
rat_heal = 70
crafting_complexity = FOOD_COMPLEXITY_3
custom_materials = list(/datum/material/gold = SHEET_MATERIAL_AMOUNT * 5)
//Curd cheese, a general term which I will now proceed to stretch as thin as the toppings on a supermarket sandwich:
//I'll use it as a substitute for ricotta, cottage cheese and quark, as well as any other non-aged, soft grainy cheese
@@ -270,6 +270,7 @@
tastes = list("bread" = 1, "meat" = 1, "tomato sauce" = 1, "death" = 1)
foodtypes = MEAT|VEGETABLES|GRAIN
eat_time = 4 SECONDS // Makes it harder to force-feed this to people as a weapon, as funny as that is.
custom_materials = list(/datum/material/meat = MEATSLAB_MATERIAL_AMOUNT * 2)
var/static/list/correct_clothing = list(/obj/item/clothing/under/rank/civilian/cookjorts, /obj/item/clothing/under/shorts/jeanshorts)
/obj/item/food/sandwich/death/Initialize(mapload)
@@ -6,6 +6,7 @@
inhand_icon_state = "flashbang"
w_class = WEIGHT_CLASS_SMALL
force = 2
custom_materials = list(/datum/material/iron = SHEET_MATERIAL_AMOUNT)
/// Which stage of construction this grenade is currently at.
var/stage = GRENADE_EMPTY
/// The set of reagent containers that have been added to this grenade casing.
@@ -16,6 +16,7 @@
shrapnel_type = /obj/projectile/bullet/shrapnel/ied
det_time = 225 SECONDS //this is handled by assemblies now
display_timer = FALSE
custom_materials = list(/datum/material/iron = SHEET_MATERIAL_AMOUNT * 1.65, /datum/material/glass = SMALL_MATERIAL_AMOUNT * 2)
/// Explosive power
var/power = 5
/// Our assembly that when activated causes us to explode
@@ -14,6 +14,7 @@
w_class = WEIGHT_CLASS_BULKY
drop_sound = 'sound/items/handling/ammobox_drop.ogg'
pickup_sound = 'sound/items/handling/ammobox_pickup.ogg'
custom_materials = list(/datum/material/iron = SHEET_MATERIAL_AMOUNT * 6)
/// How many times we can use this maintenance kit to maintain a gun
var/uses = 3
/// THe maximum uses, used for our examine text.
+4 -1
View File
@@ -208,7 +208,7 @@
var/cable_color = CABLE_COLOR_RED
lefthand_file = 'icons/mob/inhands/equipment/tools_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/tools_righthand.dmi'
custom_materials = list(/datum/material/iron= SMALL_MATERIAL_AMOUNT * 1.5, /datum/material/glass= SMALL_MATERIAL_AMOUNT * 0.75)
custom_materials = list(/datum/material/iron= SMALL_MATERIAL_AMOUNT * 1.5, /datum/material/glass = SMALL_MATERIAL_AMOUNT * 1.5)
breakouttime = 30 SECONDS
cuffsound = 'sound/items/weapons/cablecuff.ogg'
pickup_sound = null
@@ -572,6 +572,7 @@
righthand_file = 'icons/mob/inhands/weapons/thrown_righthand.dmi'
breakouttime = 3.5 SECONDS//easy to apply, easy to break out of
gender = NEUTER
custom_materials = list(/datum/material/iron = SHEET_MATERIAL_AMOUNT * 6.1, /datum/material/glass = SMALL_MATERIAL_AMOUNT * 1.5)
///Amount of time to knock the target down for once it's hit in deciseconds.
var/knockdown = 0
///Reference of the mob we will attempt to snare
@@ -624,6 +625,7 @@
inhand_icon_state = "bola_r"
breakouttime = 7 SECONDS
knockdown = 3.5 SECONDS
custom_materials = list(/datum/material/alloy/plasteel = SHEET_MATERIAL_AMOUNT * 6.1, /datum/material/glass = SMALL_MATERIAL_AMOUNT * 0.7)
/**
* A security variant of the bola.
@@ -639,6 +641,7 @@
w_class = WEIGHT_CLASS_SMALL
breakouttime = 6 SECONDS
custom_price = PAYCHECK_COMMAND * 0.35
custom_materials = null
/obj/item/restraints/legcuffs/bola/energy/Initialize(mapload)
. = ..()
+1
View File
@@ -336,6 +336,7 @@
icon_state = "bananium_inspector"
w_class = WEIGHT_CLASS_SMALL
max_mode = BANANIUM_CLOWN_INSPECTOR_PRINT_SOUND_MODE_LAST
custom_materials = list(/datum/material/bananium = SHEET_MATERIAL_AMOUNT * 5)
///How many more times can we print?
var/paper_charges = 32
///Max value of paper_charges
+1 -1
View File
@@ -167,7 +167,7 @@
throwforce = 5
throw_speed = 3
throw_range = 7
custom_materials = list(/datum/material/wood = SHEET_MATERIAL_AMOUNT * 1.5)
custom_materials = list(/datum/material/wood = SHEET_MATERIAL_AMOUNT * 2)
resistance_flags = FLAMMABLE
w_class = WEIGHT_CLASS_NORMAL
attack_verb_continuous = list("bashes", "batters", "bludgeons", "thrashes", "whacks")
+5 -5
View File
@@ -217,7 +217,7 @@
obj_flags = parent_type::obj_flags & ~CONDUCTS_ELECTRICITY
force = 15
throwforce = 15
custom_materials = null
custom_materials = list(/datum/material/bone = SHEET_MATERIAL_AMOUNT * 2)
/datum/embedding/combat_knife/weak
embed_chance = 35
@@ -245,7 +245,7 @@
attack_verb_continuous = list("shanks", "shivs")
attack_verb_simple = list("shank", "shiv")
armor_type = /datum/armor/none
custom_materials = list(/datum/material/glass = SMALL_MATERIAL_AMOUNT * 4)
custom_materials = list(/datum/material/glass = SHEET_MATERIAL_AMOUNT)
/obj/item/knife/shiv/make_stabby()
AddComponent(/datum/component/alternative_sharpness, SHARP_POINTY, alt_continuous, alt_simple, -3)
@@ -258,7 +258,7 @@
force = 9
throwforce = 13
armor_type = /datum/armor/shiv_plasma
custom_materials = list(/datum/material/glass=SMALL_MATERIAL_AMOUNT *4, /datum/material/plasma=SMALL_MATERIAL_AMOUNT * 2)
custom_materials = list(/datum/material/alloy/plasmaglass = SHEET_MATERIAL_AMOUNT)
/datum/armor/shiv_plasma
melee = 25
@@ -278,7 +278,7 @@
throw_range = 7
wound_bonus = 10
armor_type = /datum/armor/shiv_titanium
custom_materials = list(/datum/material/glass=SMALL_MATERIAL_AMOUNT * 4, /datum/material/titanium=SMALL_MATERIAL_AMOUNT * 2)
custom_materials = list(/datum/material/alloy/titaniumglass = SHEET_MATERIAL_AMOUNT)
/datum/armor/shiv_titanium
melee = 25
@@ -301,7 +301,7 @@
wound_bonus = 10
exposed_wound_bonus = 20
armor_type = /datum/armor/shiv_plastitanium
custom_materials = list(/datum/material/glass= SMALL_MATERIAL_AMOUNT * 4, /datum/material/alloy/plastitanium= SMALL_MATERIAL_AMOUNT * 2)
custom_materials = list(/datum/material/alloy/plastitaniumglass = SHEET_MATERIAL_AMOUNT)
/datum/armor/shiv_plastitanium
melee = 50
+1
View File
@@ -15,6 +15,7 @@
w_class = WEIGHT_CLASS_TINY
throw_speed = 1
throw_range = 7
custom_materials = list(/datum/material/iron = SMALL_MATERIAL_AMOUNT * 0.2, /datum/material/glass = SMALL_MATERIAL_AMOUNT * 0.2)
var/state = DEFLATED
var/datum/gas_mixture/air_contents = null
+2
View File
@@ -836,6 +836,7 @@
slot_flags = ITEM_SLOT_BACK
convertible = FALSE
active_changes_inhand = FALSE
custom_materials = list(/datum/material/iron = SHEET_MATERIAL_AMOUNT * 1.15, /datum/material/glass = SMALL_MATERIAL_AMOUNT * 2)
var/obj/item/assembly/igniter/sparkler
///Determines whether or not we can improve the cattleprod into a new type. Prevents turning the cattleprod subtypes into different subtypes, or wasting materials on making it....another version of itself.
var/can_upgrade = TRUE
@@ -925,6 +926,7 @@
inhand_icon_state = "teleprod"
slot_flags = null
can_upgrade = FALSE
custom_materials = list(/datum/material/iron = SHEET_MATERIAL_AMOUNT * 1.15, /datum/material/bluespace = SHEET_MATERIAL_AMOUNT, /datum/material/glass = SMALL_MATERIAL_AMOUNT * 2)
/obj/item/melee/baton/security/cattleprod/teleprod/clumsy_check(mob/living/carbon/human/user)
. = ..()
@@ -75,6 +75,7 @@
icon_state = "tailwhip"
inhand_icon_state = "tailwhip"
item_flags = NONE
custom_materials = list(/datum/material/iron = SMALL_MATERIAL_AMOUNT * 0.1, /datum/material/glass = SMALL_MATERIAL_AMOUNT * 0.1)
/obj/item/melee/chainofcommand/tailwhip/kitty
name = "cat o' nine tails"
+1
View File
@@ -243,6 +243,7 @@
armour_penetration = 1000
force_string = "INFINITE"
item_flags = NEEDS_PERMIT|NO_BLOOD_ON_ITEM
custom_materials = list(/datum/material/adamantine = SHEET_MATERIAL_AMOUNT * 20, /datum/material/iron = SHEET_MATERIAL_AMOUNT)
var/obj/machinery/power/supermatter_crystal/shard
var/balanced = 1
+1
View File
@@ -220,6 +220,7 @@ GLOBAL_LIST_EMPTY(sniffable_sheets)
desc = "A handheld tracking device that locates sheets of glass and iron."
icon_state = "pinpointer_sniffer"
worn_icon_state = "pinpointer_black"
custom_materials = list(/datum/material/iron = SMALL_MATERIAL_AMOUNT * 0.8, /datum/material/glass = SMALL_MATERIAL_AMOUNT * 0.7)
/obj/item/pinpointer/material_sniffer/scan_for_target()
if(target || !GLOB.sniffable_sheets.len)
@@ -20,6 +20,7 @@
lefthand_file = 'icons/mob/inhands/weapons/guns_lefthand.dmi'
righthand_file = 'icons/mob/inhands/weapons/guns_righthand.dmi'
armor_type = /datum/armor/item_pneumatic_cannon
custom_materials = list(/datum/material/iron = SHEET_MATERIAL_AMOUNT * 6)
var/maxWeightClass = 20 //The max weight of items that can fit into the cannon
var/loadedWeightClass = 0 //The weight of items currently in the cannon
var/obj/item/tank/internals/tank = null //The gas tank that is drawn from to fire things
+1
View File
@@ -324,6 +324,7 @@
max_amount = 30
name = "makeshift rapid pipe cleaner layer"
ghetto = TRUE
custom_materials = list(/datum/material/iron = SHEET_MATERIAL_AMOUNT * 15)
/obj/item/rcl/ghetto/update_icon_state()
if(!loaded)
+1
View File
@@ -9,6 +9,7 @@
attack_verb_simple = list("forcefully inspire", "violently encourage", "relentlessly galvanize")
lefthand_file = 'icons/mob/inhands/equipment/banners_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/banners_righthand.dmi'
custom_materials = list(/datum/material/iron = SHEET_MATERIAL_AMOUNT)
var/inspiration_available = TRUE //If this banner can be used to inspire crew
var/morale_time = 0
var/morale_cooldown = 600 //How many deciseconds between uses
+5 -3
View File
@@ -117,7 +117,7 @@
desc = "A medieval wooden buckler."
icon_state = "buckler"
inhand_icon_state = "buckler"
custom_materials = list(/datum/material/wood = SHEET_MATERIAL_AMOUNT * 10)
custom_materials = list(/datum/material/wood = SHEET_MATERIAL_AMOUNT * 20)
resistance_flags = FLAMMABLE
block_chance = 30
max_integrity = 55
@@ -131,6 +131,7 @@
block_chance = 40
max_integrity = 40
w_class = WEIGHT_CLASS_NORMAL
custom_materials = null
/obj/item/shield/kite
name = "kite shield"
@@ -167,7 +168,7 @@
desc = "A shield adept at blocking blunt objects from connecting with the torso of the shield wielder, less so bullets and laser beams."
icon_state = "riot"
inhand_icon_state = "riot"
custom_materials = list(/datum/material/glass= SHEET_MATERIAL_AMOUNT * 3.75, /datum/material/iron= HALF_SHEET_MATERIAL_AMOUNT)
custom_materials = list(/datum/material/glass= SHEET_MATERIAL_AMOUNT * 4.05, /datum/material/iron = SHEET_MATERIAL_AMOUNT * 2.8)
transparent = TRUE
max_integrity = 75
shield_break_sound = 'sound/effects/glass/glassbr3.ogg'
@@ -203,6 +204,7 @@
icon_state = "flashshield"
inhand_icon_state = "flashshield"
var/obj/item/assembly/flash/handheld/embedded_flash = /obj/item/assembly/flash/handheld
custom_materials = list(/datum/material/iron = SHEET_MATERIAL_AMOUNT * 5.1, /datum/material/glass= SHEET_MATERIAL_AMOUNT * 4.35)
/obj/item/shield/riot/flash/Initialize(mapload)
. = ..()
@@ -479,7 +481,7 @@
desc = "A crude shield made out of several sheets of iron taped together, not very durable."
icon_state = "improvised"
inhand_icon_state = "improvised"
custom_materials = list(/datum/material/iron = HALF_SHEET_MATERIAL_AMOUNT * 2)
custom_materials = list(/datum/material/iron = SHEET_MATERIAL_AMOUNT * 10)
max_integrity = 35
shield_break_leftover = /obj/item/stack/rods/two
armor_type = /datum/armor/item_shield/improvised
+1 -1
View File
@@ -10,7 +10,7 @@
attack_verb_continuous = list("bashes", "smacks")
attack_verb_simple = list("bash", "smack")
resistance_flags = FLAMMABLE
custom_materials = list(/datum/material/cardboard = SHEET_MATERIAL_AMOUNT * 2, /datum/material/iron = HALF_SHEET_MATERIAL_AMOUNT)
var/label = ""
COOLDOWN_DECLARE(picket_sign_cooldown)
+1
View File
@@ -10,6 +10,7 @@
w_class = WEIGHT_CLASS_NORMAL
attack_verb_continuous = list("smacks", "whacks", "slams", "smashes")
attack_verb_simple = list("smack", "whack", "slam", "smash")
custom_materials = list(/datum/material/iron = SHEET_MATERIAL_AMOUNT * 10)
///The vehicle counterpart for the board
var/board_item_type = /obj/vehicle/ridden/scooter/skateboard
+3 -6
View File
@@ -16,7 +16,7 @@
demolition_mod = 0.75 // Note: This is significant, as this needs to be low enough that any possible force adjustments from better spears does not go over airlock deflection. See AIRLOCK_DAMAGE_DEFLECTION_N.
embed_type = /datum/embedding/spear
armour_penetration = 5
custom_materials = list(/datum/material/iron = HALF_SHEET_MATERIAL_AMOUNT, /datum/material/glass= HALF_SHEET_MATERIAL_AMOUNT * 2)
custom_materials = list(/datum/material/iron = SHEET_MATERIAL_AMOUNT * 0.65, /datum/material/glass= SHEET_MATERIAL_AMOUNT * 1.15)
hitsound = 'sound/items/weapons/bladeslice.ogg'
attack_verb_continuous = list("attacks", "pokes", "jabs", "tears", "lacerates", "gores")
attack_verb_simple = list("attack", "poke", "jab", "tear", "lacerate", "gore")
@@ -96,7 +96,6 @@
if(/obj/item/shard/plasma)
force = 11
throwforce = 21
custom_materials = list(/datum/material/iron= HALF_SHEET_MATERIAL_AMOUNT, /datum/material/alloy/plasmaglass= HALF_SHEET_MATERIAL_AMOUNT * 2)
icon_prefix = "spearplasma"
modify_max_integrity(220)
wound_bonus = -10
@@ -115,7 +114,6 @@
throwforce = 22
throw_range = 8
throw_speed = 5
custom_materials = list(/datum/material/iron= HALF_SHEET_MATERIAL_AMOUNT, /datum/material/alloy/titaniumglass= HALF_SHEET_MATERIAL_AMOUNT * 2)
modify_max_integrity(230)
wound_bonus = -5
force_unwielded = 12
@@ -135,7 +133,6 @@
throwforce = 23
throw_range = 9
throw_speed = 5
custom_materials = list(/datum/material/iron= HALF_SHEET_MATERIAL_AMOUNT, /datum/material/alloy/plastitaniumglass= HALF_SHEET_MATERIAL_AMOUNT * 2)
modify_max_integrity(240)
wound_bonus = 0
exposed_wound_bonus = 20
@@ -307,7 +304,7 @@
icon_prefix = "bone_spear"
throwforce = 22
armour_penetration = 20 //Enhanced armor piercing
custom_materials = list(/datum/material/bone = HALF_SHEET_MATERIAL_AMOUNT * 7)
custom_materials = list(/datum/material/bone = SHEET_MATERIAL_AMOUNT * 4)
force_unwielded = 12
force_wielded = 20
spear_leftovers = /obj/item/stack/sheet/bone
@@ -331,7 +328,7 @@
desc = "A haphazardly-constructed bamboo stick with a sharpened tip, ready to poke holes into unsuspecting people."
throwforce = 23 //Better to throw
custom_materials = list(/datum/material/bamboo = SHEET_MATERIAL_AMOUNT * 20)
custom_materials = list(/datum/material/bamboo = SHEET_MATERIAL_AMOUNT * 25)
spear_leftovers = /obj/item/stack/sheet/mineral/bamboo
/obj/item/spear/bamboospear/add_headpike_component()
+2 -2
View File
@@ -11,7 +11,7 @@ GLOBAL_LIST_INIT(rod_recipes, list ( \
new/datum/stack_recipe("ladder", /obj/structure/ladder/crafted, 15, time = 15 SECONDS, crafting_flags = CRAFT_ONE_PER_TURF | CRAFT_ON_SOLID_GROUND, category = CAT_STRUCTURE), \
new/datum/stack_recipe("catwalk floor tile", /obj/item/stack/tile/catwalk_tile, 1, 4, 20, category = CAT_TILES), \
new/datum/stack_recipe("stairs frame", /obj/structure/stairs_frame, 10, time = 5 SECONDS, crafting_flags = CRAFT_CHECK_DENSITY | CRAFT_ONE_PER_TURF | CRAFT_ON_SOLID_GROUND, category = CAT_STRUCTURE), \
new/datum/stack_recipe("probing cane", /obj/item/cane/white, 3, time = 1 SECONDS, crafting_flags = CRAFT_CHECK_DENSITY, category = CAT_TOOLS), \
new/datum/stack_recipe("probing cane", /obj/item/cane/white, 3, time = 1 SECONDS, crafting_flags = CRAFT_CHECK_DENSITY | CRAFT_SKIP_MATERIALS_PARITY, category = CAT_TOOLS), \
new/datum/stack_recipe("sharpened iron rod", /obj/item/ammo_casing/rebar, 1, time = 0.2 SECONDS, crafting_flags = CRAFT_CHECK_DENSITY, category = CAT_WEAPON_AMMO), \
))
@@ -28,7 +28,7 @@ GLOBAL_LIST_INIT(rod_recipes, list ( \
throw_speed = 3
throw_range = 7
demolition_mod = 1.25
mats_per_unit = list(/datum/material/iron=HALF_SHEET_MATERIAL_AMOUNT)
mats_per_unit = list(/datum/material/iron = HALF_SHEET_MATERIAL_AMOUNT)
max_amount = 50
attack_verb_continuous = list("hits", "bludgeons", "whacks")
attack_verb_simple = list("hit", "bludgeon", "whack")
@@ -146,7 +146,7 @@ GLOBAL_LIST_INIT(reinforced_glass_recipes, list ( \
null, \
new/datum/stack_recipe("directional reinforced window", /obj/structure/window/reinforced/unanchored, time = 0.5 SECONDS, crafting_flags = CRAFT_CHECK_DENSITY | CRAFT_ON_SOLID_GROUND | CRAFT_CHECK_DIRECTION, category = CAT_WINDOWS), \
new/datum/stack_recipe("fulltile reinforced window", /obj/structure/window/reinforced/fulltile/unanchored, 2, time = 2 SECONDS, crafting_flags = CRAFT_CHECK_DENSITY | CRAFT_ON_SOLID_GROUND | CRAFT_IS_FULLTILE, category = CAT_WINDOWS), \
new/datum/stack_recipe("glass shard", /obj/item/shard, time = 10, crafting_flags = CRAFT_CHECK_DENSITY | CRAFT_ON_SOLID_GROUND, category = CAT_MISC), \
new/datum/stack_recipe("glass shard", /obj/item/shard, time = 10, crafting_flags = CRAFT_CHECK_DENSITY | CRAFT_ON_SOLID_GROUND | CRAFT_SKIP_MATERIALS_PARITY, category = CAT_MISC), \
new/datum/stack_recipe("reinforced glass tile", /obj/item/stack/tile/rglass, 1, 4, 20, category = CAT_TILES) \
))
@@ -185,7 +185,7 @@ GLOBAL_LIST_INIT(reinforced_glass_recipes, list ( \
GLOBAL_LIST_INIT(prglass_recipes, list ( \
new/datum/stack_recipe("directional reinforced window", /obj/structure/window/reinforced/plasma/unanchored, time = 0.5 SECONDS, crafting_flags = CRAFT_CHECK_DENSITY | CRAFT_ON_SOLID_GROUND | CRAFT_CHECK_DIRECTION, category = CAT_WINDOWS), \
new/datum/stack_recipe("fulltile reinforced window", /obj/structure/window/reinforced/plasma/fulltile/unanchored, 2, time = 2 SECONDS, crafting_flags = CRAFT_CHECK_DENSITY | CRAFT_ON_SOLID_GROUND | CRAFT_IS_FULLTILE, category = CAT_WINDOWS), \
new/datum/stack_recipe("plasma glass shard", /obj/item/shard/plasma, time = 40, crafting_flags = CRAFT_CHECK_DENSITY | CRAFT_ON_SOLID_GROUND, category = CAT_MISC), \
new/datum/stack_recipe("plasma glass shard", /obj/item/shard/plasma, time = 40, crafting_flags = CRAFT_CHECK_DENSITY | CRAFT_ON_SOLID_GROUND | CRAFT_SKIP_MATERIALS_PARITY, category = CAT_MISC), \
new/datum/stack_recipe("reinforced plasma glass tile", /obj/item/stack/tile/rglass/plasma, 1, 4, 20, category = CAT_TILES) \
))
@@ -377,6 +377,7 @@ GLOBAL_LIST_INIT(plastitaniumglass_recipes, list(
to_chat(user, span_notice("You begin to wrap the [cloth] around the [src]..."))
if(do_after(user, craft_time, target = src))
var/obj/item/knife/shiv/shiv = new shiv_type
shiv.set_custom_materials(custom_materials)
cloth.use(1)
to_chat(user, span_notice("You wrap the [cloth] around the [src], forming a makeshift weapon."))
remove_item_from_storage(src, user)
@@ -12,6 +12,7 @@
obj_flags = CONDUCTS_ELECTRICITY
max_amount = 60
grind_results = list(/datum/reagent/silicon = 20, /datum/reagent/copper = 5)
mats_per_unit = list(/datum/material/iron = SHEET_MATERIAL_AMOUNT * 1.05, /datum/material/glass = SHEET_MATERIAL_AMOUNT * 1.05)
merge_type = /obj/item/stack/light_w
/obj/item/stack/light_w/examine(mob/user)
@@ -24,9 +24,9 @@ Mineral Sheets
*/
GLOBAL_LIST_INIT(sandstone_recipes, list ( \
new/datum/stack_recipe("sandstone door", /obj/structure/mineral_door/sandstone, 10, time = 5 SECONDS, crafting_flags = CRAFT_CHECK_DENSITY | CRAFT_ONE_PER_TURF | CRAFT_ON_SOLID_GROUND | CRAFT_APPLIES_MATS, category = CAT_DOORS), \
new/datum/stack_recipe("sandstone door", /obj/structure/mineral_door/sandstone, 10, time = 5 SECONDS, crafting_flags = CRAFT_CHECK_DENSITY | CRAFT_ONE_PER_TURF | CRAFT_ON_SOLID_GROUND, category = CAT_DOORS), \
new/datum/stack_recipe("sandstone platform", /obj/structure/platform/sandstone, 2, time = 3 SECONDS, crafting_flags = CRAFT_CHECK_DENSITY | CRAFT_ONE_PER_TURF | CRAFT_ON_SOLID_GROUND, trait_booster = TRAIT_QUICK_BUILD, trait_modifier = 0.75, category = CAT_STRUCTURE), \
new/datum/stack_recipe("Breakdown into sand", /obj/item/stack/ore/glass, 1, crafting_flags = CRAFT_CHECK_DENSITY | CRAFT_ON_SOLID_GROUND, category = CAT_MISC), \
new/datum/stack_recipe("Breakdown into sand", /obj/item/stack/ore/glass, 1, crafting_flags = CRAFT_CHECK_DENSITY | CRAFT_ON_SOLID_GROUND | CRAFT_NO_MATERIALS, category = CAT_MISC), \
))
/obj/item/stack/sheet/mineral/sandstone
@@ -108,7 +108,7 @@ GLOBAL_LIST_INIT(sandbag_recipes, list ( \
walltype = /turf/closed/wall/mineral/diamond
GLOBAL_LIST_INIT(diamond_recipes, list ( \
new/datum/stack_recipe("diamond door", /obj/structure/mineral_door/transparent/diamond, 10, time = 5 SECONDS, crafting_flags = CRAFT_CHECK_DENSITY | CRAFT_ONE_PER_TURF | CRAFT_ON_SOLID_GROUND | CRAFT_APPLIES_MATS, category = CAT_DOORS), \
new/datum/stack_recipe("diamond door", /obj/structure/mineral_door/transparent/diamond, 10, time = 5 SECONDS, crafting_flags = CRAFT_CHECK_DENSITY | CRAFT_ONE_PER_TURF | CRAFT_ON_SOLID_GROUND, category = CAT_DOORS), \
new/datum/stack_recipe("diamond tile", /obj/item/stack/tile/mineral/diamond, 1, 4, 20, crafting_flags = NONE, category = CAT_TILES), \
))
@@ -139,7 +139,7 @@ GLOBAL_LIST_INIT(diamond_recipes, list ( \
walltype = /turf/closed/wall/mineral/uranium
GLOBAL_LIST_INIT(uranium_recipes, list ( \
new/datum/stack_recipe("uranium door", /obj/structure/mineral_door/uranium, 10, time = 5 SECONDS, crafting_flags = CRAFT_CHECK_DENSITY | CRAFT_ONE_PER_TURF | CRAFT_ON_SOLID_GROUND | CRAFT_APPLIES_MATS, category = CAT_DOORS), \
new/datum/stack_recipe("uranium door", /obj/structure/mineral_door/uranium, 10, time = 5 SECONDS, crafting_flags = CRAFT_CHECK_DENSITY | CRAFT_ONE_PER_TURF | CRAFT_ON_SOLID_GROUND, category = CAT_DOORS), \
new/datum/stack_recipe("depleted uranium platform", /obj/structure/platform/uranium, 2, time = 3 SECONDS, crafting_flags = CRAFT_CHECK_DENSITY | CRAFT_ONE_PER_TURF | CRAFT_ON_SOLID_GROUND, trait_booster = TRAIT_QUICK_BUILD, trait_modifier = 0.75, category = CAT_STRUCTURE), \
new/datum/stack_recipe("uranium tile", /obj/item/stack/tile/mineral/uranium, 1, 4, 20, crafting_flags = NONE, category = CAT_TILES), \
))
@@ -180,7 +180,7 @@ GLOBAL_LIST_INIT(uranium_recipes, list ( \
return TOXLOSS//dont you kids know that stuff is toxic?
GLOBAL_LIST_INIT(plasma_recipes, list ( \
new/datum/stack_recipe("plasma door", /obj/structure/mineral_door/transparent/plasma, 10, time = 5 SECONDS, crafting_flags = CRAFT_CHECK_DENSITY | CRAFT_ONE_PER_TURF | CRAFT_ON_SOLID_GROUND | CRAFT_APPLIES_MATS, category = CAT_DOORS), \
new/datum/stack_recipe("plasma door", /obj/structure/mineral_door/transparent/plasma, 10, time = 5 SECONDS, crafting_flags = CRAFT_CHECK_DENSITY | CRAFT_ONE_PER_TURF | CRAFT_ON_SOLID_GROUND, category = CAT_DOORS), \
new/datum/stack_recipe("plasma tile", /obj/item/stack/tile/mineral/plasma, 1, 4, 20, crafting_flags = NONE, category = CAT_TILES), \
))
@@ -214,7 +214,7 @@ GLOBAL_LIST_INIT(plasma_recipes, list ( \
walltype = /turf/closed/wall/mineral/gold
GLOBAL_LIST_INIT(gold_recipes, list ( \
new/datum/stack_recipe("golden door", /obj/structure/mineral_door/gold, 10, time = 5 SECONDS, crafting_flags = CRAFT_CHECK_DENSITY | CRAFT_ONE_PER_TURF | CRAFT_ON_SOLID_GROUND | CRAFT_APPLIES_MATS, category = CAT_DOORS), \
new/datum/stack_recipe("golden door", /obj/structure/mineral_door/gold, 10, time = 5 SECONDS, crafting_flags = CRAFT_CHECK_DENSITY | CRAFT_ONE_PER_TURF | CRAFT_ON_SOLID_GROUND, category = CAT_DOORS), \
new/datum/stack_recipe("golden platform", /obj/structure/platform/gold, 2, time = 3 SECONDS, crafting_flags = CRAFT_CHECK_DENSITY | CRAFT_ONE_PER_TURF | CRAFT_ON_SOLID_GROUND, trait_booster = TRAIT_QUICK_BUILD, trait_modifier = 0.75, category = CAT_STRUCTURE), \
new/datum/stack_recipe("gold tile", /obj/item/stack/tile/mineral/gold, 1, 4, 20, crafting_flags = NONE, category = CAT_TILES), \
new/datum/stack_recipe("blank plaque", /obj/item/plaque, 1, crafting_flags = NONE, category = CAT_FURNITURE), \
@@ -246,7 +246,7 @@ GLOBAL_LIST_INIT(gold_recipes, list ( \
walltype = /turf/closed/wall/mineral/silver
GLOBAL_LIST_INIT(silver_recipes, list ( \
new/datum/stack_recipe("silver door", /obj/structure/mineral_door/silver, 10, time = 5 SECONDS, crafting_flags = CRAFT_CHECK_DENSITY | CRAFT_ONE_PER_TURF | CRAFT_ON_SOLID_GROUND | CRAFT_APPLIES_MATS, category = CAT_DOORS), \
new/datum/stack_recipe("silver door", /obj/structure/mineral_door/silver, 10, time = 5 SECONDS, crafting_flags = CRAFT_CHECK_DENSITY | CRAFT_ONE_PER_TURF | CRAFT_ON_SOLID_GROUND, category = CAT_DOORS), \
new/datum/stack_recipe("silver platform", /obj/structure/platform/silver, 2, time = 3 SECONDS, crafting_flags = CRAFT_CHECK_DENSITY | CRAFT_ONE_PER_TURF | CRAFT_ON_SOLID_GROUND, trait_booster = TRAIT_QUICK_BUILD, trait_modifier = 0.75, category = CAT_STRUCTURE), \
new/datum/stack_recipe("silver tile", /obj/item/stack/tile/mineral/silver, 1, 4, 20, crafting_flags = NONE, category = CAT_TILES), \
))
@@ -145,7 +145,7 @@ GLOBAL_LIST_INIT(metal_recipes, list ( \
new/datum/stack_recipe("tram controller frame", /obj/item/wallframe/tram, 20, crafting_flags = NONE, category = CAT_STRUCTURE), \
new/datum/stack_recipe("tram display frame", /obj/item/wallframe/indicator_display, 7, crafting_flags = NONE, category = CAT_STRUCTURE), \
null, \
new/datum/stack_recipe("iron door", /obj/structure/mineral_door/iron, 20, time = 5 SECONDS, crafting_flags = CRAFT_CHECK_DENSITY | CRAFT_ONE_PER_TURF | CRAFT_ON_SOLID_GROUND | CRAFT_APPLIES_MATS, category = CAT_DOORS), \
new/datum/stack_recipe("iron door", /obj/structure/mineral_door/iron, 20, time = 5 SECONDS, crafting_flags = CRAFT_CHECK_DENSITY | CRAFT_ONE_PER_TURF | CRAFT_ON_SOLID_GROUND, category = CAT_DOORS), \
new/datum/stack_recipe("filing cabinet", /obj/structure/filingcabinet, 2, time = 10 SECONDS, crafting_flags = CRAFT_CHECK_DENSITY | CRAFT_ONE_PER_TURF | CRAFT_ON_SOLID_GROUND, category = CAT_FURNITURE), \
new/datum/stack_recipe("desk bell", /obj/structure/desk_bell, 2, time = 3 SECONDS, crafting_flags = NONE, category = CAT_FURNITURE), \
new/datum/stack_recipe("floodlight frame", /obj/structure/floodlight_frame, 5, crafting_flags = CRAFT_CHECK_DENSITY | CRAFT_ONE_PER_TURF | CRAFT_ON_SOLID_GROUND, category = CAT_STRUCTURE), \
@@ -373,7 +373,7 @@ GLOBAL_LIST_INIT(wood_recipes, list ( \
new/datum/stack_recipe("rake", /obj/item/cultivator/rake, 5, time = 1 SECONDS, crafting_flags = NONE, category = CAT_TOOLS),\
new/datum/stack_recipe("ore box", /obj/structure/ore_box, 4, time = 5 SECONDS, crafting_flags = CRAFT_CHECK_DENSITY | CRAFT_ONE_PER_TURF | CRAFT_ON_SOLID_GROUND, category = CAT_CONTAINERS),\
new/datum/stack_recipe("wooden crate", /obj/structure/closet/crate/wooden, 6, time = 5 SECONDS, crafting_flags = CRAFT_CHECK_DENSITY | CRAFT_ONE_PER_TURF | CRAFT_ON_SOLID_GROUND, category = CAT_FURNITURE),\
new/datum/stack_recipe("baseball bat", /obj/item/melee/baseball_bat, 5, time = 1.5 SECONDS, crafting_flags = NONE, category = CAT_WEAPON_MELEE),\
new/datum/stack_recipe("baseball bat", /obj/item/melee/baseball_bat, 5, time = 1.5 SECONDS, crafting_flags = NONE, category = CAT_WEAPON_MELEE, removed_mats = list(/datum/material/wood = SHEET_MATERIAL_AMOUNT * 1.5)),\
new/datum/stack_recipe("wooden crutch", /obj/item/cane/crutch/wood, 5, time = 1.5 SECONDS, crafting_flags = NONE, category = CAT_WEAPON_MELEE),\
new/datum/stack_recipe("loom", /obj/structure/loom, 10, time = 1.5 SECONDS, crafting_flags = CRAFT_CHECK_DENSITY | CRAFT_ONE_PER_TURF | CRAFT_ON_SOLID_GROUND, category = CAT_TOOLS), \
new/datum/stack_recipe("mortar", /obj/item/reagent_containers/cup/mortar, 3, crafting_flags = NONE, category = CAT_CHEMISTRY), \
@@ -451,7 +451,7 @@ GLOBAL_LIST_INIT(bamboo_recipes, list ( \
new/datum/stack_recipe("bamboo spear", /obj/item/spear/bamboospear, 25, time = 9 SECONDS, crafting_flags = NONE, category = CAT_WEAPON_MELEE), \
new/datum/stack_recipe("blow gun", /obj/item/gun/syringe/blowgun, 10, time = 7 SECONDS, crafting_flags = NONE, category = CAT_WEAPON_RANGED), \
new/datum/stack_recipe("crude syringe", /obj/item/reagent_containers/syringe/crude, 5, time = 1 SECONDS, crafting_flags = NONE, category = CAT_CHEMISTRY), \
new/datum/stack_recipe("rice hat", /obj/item/clothing/head/costume/rice_hat, 10, time = 7 SECONDS, crafting_flags = NONE, category = CAT_CLOTHING), \
new/datum/stack_recipe("rice hat", /obj/item/clothing/head/costume/rice_hat, 10, time = 7 SECONDS, crafting_flags = CRAFT_SKIP_MATERIALS_PARITY, category = CAT_CLOTHING), \
null, \
new/datum/stack_recipe("bamboo stool", /obj/structure/chair/stool/bamboo, 2, time = 1 SECONDS, crafting_flags = CRAFT_CHECK_DENSITY | CRAFT_ONE_PER_TURF | CRAFT_ON_SOLID_GROUND, category = CAT_FURNITURE), \
new/datum/stack_recipe("bamboo mat piece", /obj/item/stack/tile/bamboo, 1, 4, 20, crafting_flags = NONE, category = CAT_TILES), \
@@ -802,11 +802,6 @@ GLOBAL_LIST_INIT(bronze_recipes, list ( \
. = ..()
. += GLOB.bronze_recipes
/obj/item/stack/sheet/paperframes/Initialize(mapload, new_amount, merge = TRUE, list/mat_override=null, mat_amt=1)
. = ..()
pixel_x = 0
pixel_y = 0
/obj/item/stack/sheet/bronze/thirty
amount = 30
@@ -881,7 +876,7 @@ GLOBAL_LIST_INIT(plastic_recipes, list(
new /datum/stack_recipe("plastic flaps", /obj/structure/plasticflaps, 5, crafting_flags = CRAFT_CHECK_DENSITY | CRAFT_ONE_PER_TURF | CRAFT_ON_SOLID_GROUND, time = 4 SECONDS, category = CAT_FURNITURE), \
new /datum/stack_recipe("water bottle", /obj/item/reagent_containers/cup/glass/waterbottle/empty, crafting_flags = NONE, category = CAT_CONTAINERS), \
new /datum/stack_recipe("large water bottle", /obj/item/reagent_containers/cup/glass/waterbottle/large/empty, 3, crafting_flags = NONE, category = CAT_CONTAINERS), \
new /datum/stack_recipe("colo cups", /obj/item/reagent_containers/cup/glass/colocup, 1, crafting_flags = NONE, category = CAT_CONTAINERS), \
new /datum/stack_recipe("colo cups", /obj/item/reagent_containers/cup/glass/colocup, 1, crafting_flags = NONE, category = CAT_CONTAINERS, removed_mats = list(/datum/material/plastic = HALF_SHEET_MATERIAL_AMOUNT)), \
new /datum/stack_recipe("mannequin", /obj/structure/mannequin/plastic, 25, time = 5 SECONDS, crafting_flags = CRAFT_ONE_PER_TURF, category = CAT_ENTERTAINMENT), \
new /datum/stack_recipe("wet floor sign", /obj/item/clothing/suit/caution, 2, crafting_flags = NONE, category = CAT_EQUIPMENT), \
new /datum/stack_recipe("warning cone", /obj/item/clothing/head/cone, 2, crafting_flags = NONE, category = CAT_EQUIPMENT), \
+28 -20
View File
@@ -94,12 +94,11 @@
if(merge)
. = INITIALIZE_HINT_LATELOAD
var/materials_mult = amount
if(LAZYLEN(mat_override))
materials_mult *= mat_amt
mats_per_unit = mat_override
if(LAZYLEN(mats_per_unit))
initialize_materials(mats_per_unit, materials_mult)
mats_per_unit = SSmaterials.FindOrCreateMaterialCombo(mats_per_unit, mat_amt)
initialize_materials(mats_per_unit, amount)
recipes = get_main_recipes().Copy()
if(material_type)
@@ -120,6 +119,10 @@
/obj/item/stack/LateInitialize()
merge_with_loc()
/obj/item/stack/Destroy()
mats_per_unit = null
return ..()
/obj/item/stack/Moved(atom/old_loc, movement_dir, forced, list/old_locs, momentum_change)
. = ..()
if((!throwing || throwing.target_turf == loc) && old_loc != loc && (flags_1 & INITIALIZED_1))
@@ -160,11 +163,6 @@
other_stack = find_other_stack(already_found, TRUE)
return TRUE
/obj/item/stack/apply_material_effects(list/materials)
. = ..()
if(amount)
mats_per_unit = SSmaterials.FindOrCreateMaterialCombo(materials, 1/amount)
/obj/item/stack/blend_requirements()
if(is_cyborg)
to_chat(usr, span_warning("[src] is too integrated into your chassis and can't be ground up!"))
@@ -417,7 +415,7 @@
#undef FULL_LIST
/// Makes the item with the given recipe.
/obj/item/stack/proc/make_item(mob/builder, datum/stack_recipe/recipe, multiplier)
/obj/item/stack/proc/make_item(mob/builder, datum/stack_recipe/recipe, multiplier = 1)
if(get_amount() < 1 && !is_cyborg) //sanity check as this shouldn't happen
qdel(src)
return
@@ -456,8 +454,6 @@
return
created = covered_turf.place_on_top(recipe.result_type, flags = CHANGETURF_INHERIT_AIR)
builder.balloon_alert(builder, "placed [ispath(recipe.result_type, /turf/open) ? "floor" : "wall"]")
if((recipe.crafting_flags & CRAFT_APPLIES_MATS) && LAZYLEN(mats_per_unit))
created.set_custom_materials(mats_per_unit, recipe.req_amount / recipe.res_amount)
else
created = new recipe.result_type(builder.drop_location())
@@ -468,17 +464,30 @@
if(ismovable(created))
created.setDir(builder.dir)
created.on_craft_completion(list(used_stack), null, builder)
qdel(used_stack) //you've outlived your purpose
builder.investigate_log("crafted [recipe.title]", INVESTIGATE_CRAFTING)
// Apply mat datums
if((recipe.crafting_flags & CRAFT_APPLIES_MATS) && LAZYLEN(mats_per_unit))
if(LAZYLEN(mats_per_unit) && !(recipe.crafting_flags & CRAFT_NO_MATERIALS))
var/list/result_mats = mats_per_unit.Copy()
for(var/mat in recipe.removed_mats)
var/to_remove = recipe.removed_mats[mat]
var/datum/material/ref_mat = locate(mat) in result_mats
if(!ref_mat)
continue
if(result_mats[ref_mat] < to_remove)
result_mats -= ref_mat
else
result_mats[ref_mat] -= to_remove
if(isstack(created))
var/obj/item/stack/crafted_stack = created
crafted_stack.set_custom_materials(mats_per_unit, (recipe.req_amount / recipe.res_amount) * crafted_stack.amount)
crafted_stack.mats_per_unit = SSmaterials.FindOrCreateMaterialCombo(result_mats)
update_custom_materials()
else
created.set_custom_materials(mats_per_unit, recipe.req_amount / recipe.res_amount)
created.set_custom_materials(result_mats, recipe.req_amount * multiplier)
qdel(used_stack) //you've outlived your purpose
// We could be qdeleted - like if it's a stack and has already been merged
if(QDELETED(created))
@@ -573,11 +582,10 @@
if (amount < used)
return FALSE
amount -= used
if(check && is_zero_amount(delete_if_zero = TRUE))
return TRUE
update_custom_materials()
update_appearance()
update_weight()
if(!is_zero_amount(delete_if_zero = check))
update_custom_materials()
update_appearance()
update_weight()
return TRUE
/obj/item/stack/tool_use_check(mob/living/user, amount, heat_required)
@@ -25,6 +25,8 @@
var/trait_modifier = 1
/// Category for general crafting menu
var/category
/// The amount of material to remove from the recipe's result
var/list/removed_mats
///crafting_flags var to hold bool values
var/crafting_flags = CRAFT_CHECK_DENSITY
@@ -41,6 +43,7 @@
trait_booster,
trait_modifier = 1,
category,
list/removed_mats,
)
src.title = title
@@ -55,6 +58,8 @@
src.trait_modifier = trait_modifier
src.category = src.category || category || CAT_MISC
src.removed_mats = removed_mats
// We create base64 image only if item have color. Otherwise use icon_ref for TGUI
var/obj/item/result = result_type
var/paint = result::color
@@ -8,6 +8,7 @@
attack_verb_simple = list("bash", "batter", "bludgeon", "thrash", "smash")
turf_type = /turf/open/floor/light
merge_type = /obj/item/stack/tile/light
mats_per_unit = list(/datum/material/iron = SHEET_MATERIAL_AMOUNT * 1.05, /datum/material/glass = SHEET_MATERIAL_AMOUNT * 1.05)
var/state = 0
/obj/item/stack/tile/light/attackby(obj/item/O, mob/user, list/modifiers, list/attack_modifiers)
@@ -230,3 +230,4 @@
turf_type = /turf/open/floor/fake_snow
mineralType = "snow"
merge_type = /obj/item/stack/tile/mineral/snow
mats_per_unit = list(/datum/material/snow = HALF_SHEET_MATERIAL_AMOUNT / 2)
@@ -137,6 +137,7 @@
/obj/item/stack/tile/wood/tile,
/obj/item/stack/tile/wood/parquet,
)
mats_per_unit = list(/datum/material/wood = HALF_SHEET_MATERIAL_AMOUNT / 2)
/obj/item/stack/tile/wood/parquet
name = "parquet wood floor tile"
@@ -175,6 +176,7 @@
/obj/item/stack/tile/bamboo/tatami/purple,
/obj/item/stack/tile/bamboo/tatami/black,
)
mats_per_unit = list(/datum/material/bamboo = HALF_SHEET_MATERIAL_AMOUNT / 2)
/obj/item/stack/tile/bamboo/tatami
name = "Tatami with green rim"
@@ -207,6 +209,7 @@
inhand_icon_state = "tile-basalt"
turf_type = /turf/open/floor/fakebasalt
merge_type = /obj/item/stack/tile/basalt
mats_per_unit = list(/datum/material/sand = SHEET_MATERIAL_AMOUNT * 2)
//Carpets
/obj/item/stack/tile/carpet
@@ -1079,6 +1082,7 @@
/obj/item/stack/tile/circuit/green,
/obj/item/stack/tile/circuit/red,
)
mats_per_unit = list(/datum/material/iron = SHEET_MATERIAL_AMOUNT * 1.05, /datum/material/glass = SHEET_MATERIAL_AMOUNT * 1.05)
/obj/item/stack/tile/circuit/green
name = "green circuit tile"
@@ -1142,7 +1146,7 @@
singular_name = "plastic floor tile"
desc = "A tile of cheap, flimsy plastic flooring."
icon_state = "tile_plastic"
mats_per_unit = list(/datum/material/plastic=SMALL_MATERIAL_AMOUNT*5)
mats_per_unit = list(/datum/material/plastic = HALF_SHEET_MATERIAL_AMOUNT / 2)
turf_type = /turf/open/floor/plastic
merge_type = /obj/item/stack/tile/plastic
@@ -1191,13 +1195,13 @@
desc = "A clangy tile made of high-quality bronze. Clockwork construction techniques allow the clanging to be minimized."
icon_state = "tile_brass"
turf_type = /turf/open/floor/bronze
mats_per_unit = list(/datum/material/bronze=SMALL_MATERIAL_AMOUNT*5)
mats_per_unit = list(/datum/material/bronze = HALF_SHEET_MATERIAL_AMOUNT / 2)
merge_type = /obj/item/stack/tile/bronze
tile_reskin_types = list(
/obj/item/stack/tile/bronze,
/obj/item/stack/tile/bronze/flat,
/obj/item/stack/tile/bronze/filled,
)
)
/obj/item/stack/tile/bronze/flat
name = "flat bronze tile"
@@ -1257,7 +1261,7 @@
desc = "Flooring that shows its contents underneath. Engineers love it!"
icon_state = "maint_catwalk"
inhand_icon_state = "tile-catwalk"
mats_per_unit = list(/datum/material/iron=SMALL_MATERIAL_AMOUNT)
mats_per_unit = list(/datum/material/iron = SMALL_MATERIAL_AMOUNT * 1.2)
turf_type = /turf/open/floor/catwalk_floor
merge_type = /obj/item/stack/tile/catwalk_tile //Just to be cleaner, these all stack with each other
tile_reskin_types = list(
@@ -1324,7 +1328,7 @@
inhand_icon_state = "tile-rglass"
turf_type = /turf/open/floor/glass/reinforced
merge_type = /obj/item/stack/tile/rglass
mats_per_unit = list(/datum/material/iron=SHEET_MATERIAL_AMOUNT * 0.125, /datum/material/glass=SHEET_MATERIAL_AMOUNT * 0.25) // 4 tiles per sheet
mats_per_unit = list(/datum/material/iron = SHEET_MATERIAL_AMOUNT * 0.125, /datum/material/glass=SHEET_MATERIAL_AMOUNT * 0.25) // 4 tiles per sheet
/obj/item/stack/tile/rglass/sixty
amount = 60
+2
View File
@@ -513,6 +513,7 @@
slot_flags = ITEM_SLOT_BACK|ITEM_SLOT_SUITSTORE|ITEM_SLOT_NECK
resistance_flags = FLAMMABLE
storage_type = /datum/storage/bag/rebar_quiver
custom_materials = list(/datum/material/iron = SMALL_MATERIAL_AMOUNT * 6.5, /datum/material/glass = SMALL_MATERIAL_AMOUNT * 1.5)
/obj/item/storage/bag/rebar_quiver/syndicate
icon_state = "syndie_quiver_0"
@@ -582,6 +583,7 @@
/obj/item/storage/bag/quiver/lesser
storage_type = /datum/storage/bag/quiver/less
custom_materials = list(/datum/material/wood = SHEET_MATERIAL_AMOUNT)
/obj/item/storage/bag/quiver/full/PopulateContents()
. = ..()
@@ -19,6 +19,8 @@
/obj/item/storage/box/Initialize(mapload)
. = ..()
if(foldable_result == /obj/item/stack/sheet/cardboard)
set_custom_materials(list(/datum/material/cardboard = SHEET_MATERIAL_AMOUNT))
update_appearance()
/obj/item/storage/box/suicide_act(mob/living/carbon/user)
@@ -58,6 +58,7 @@
illustration = null
resistance_flags = FLAMMABLE
foldable_result = null
custom_materials = list(/datum/material/paper = SHEET_MATERIAL_AMOUNT * 1.25)
/// A list of all available papersack reskins
var/list/papersack_designs = list()
///What design from papersack_designs we are currently using.
+1 -1
View File
@@ -609,7 +609,7 @@
spawn_count = 10
contents_tag = "pickle"
foldable_result = /obj/item/reagent_containers/cup/beaker/large
custom_materials = list(/datum/material/glass = SHEET_MATERIAL_AMOUNT)
custom_materials = list(/datum/material/glass = SHEET_MATERIAL_AMOUNT * 1.25)
open_status = FANCY_CONTAINER_ALWAYS_OPEN
has_open_closed_states = FALSE
storage_type = /datum/storage/pickles_jar
@@ -498,6 +498,7 @@
righthand_file = 'icons/mob/inhands/equipment/medical_righthand.dmi'
w_class = WEIGHT_CLASS_SMALL
storage_type = /datum/storage/test_tube_rack
custom_materials = list(/datum/material/wood = SHEET_MATERIAL_AMOUNT)
/obj/item/storage/test_tube_rack/update_icon_state()
icon_state = "[base_icon_state][contents.len > 0 ? contents.len : null]"
+1
View File
@@ -13,6 +13,7 @@
slowdown = 1
item_flags = SLOWS_WHILE_IN_HAND
pass_flags = NONE
custom_materials = list(/datum/material/silver = SHEET_MATERIAL_AMOUNT, /datum/material/iron = SHEET_MATERIAL_AMOUNT)
/// If true we're currently portable
var/is_portable = TRUE
+1
View File
@@ -189,6 +189,7 @@
full_speed = FALSE
drift_force = 1 NEWTONS
stabilizer_force = 0.5 NEWTONS
custom_materials = list(/datum/material/iron = SHEET_MATERIAL_AMOUNT * 4.4, /datum/material/glass = SMALL_MATERIAL_AMOUNT * 3)
/obj/item/tank/jetpack/improvised/allow_thrust(num)
if(!ismob(loc))
+6
View File
@@ -300,6 +300,12 @@
ACCESS_RD,
ACCESS_SYNDICATE,
)
custom_materials = list(
/datum/material/iron = SHEET_MATERIAL_AMOUNT * 4.75,
/datum/material/silver = SHEET_MATERIAL_AMOUNT * 2.50,
/datum/material/titanium = SHEET_MATERIAL_AMOUNT * 1.75,
/datum/material/glass = SHEET_MATERIAL_AMOUNT * 1.25,
)
radio_alert = TRUE
/obj/item/crowbar/power/paramedic/sound_the_alarms(mob/user, obj/machinery/door/airlock/target)
+2
View File
@@ -586,6 +586,7 @@
w_class = WEIGHT_CLASS_SMALL
attack_verb_continuous = list("attacks", "strikes", "hits")
attack_verb_simple = list("attack", "strike", "hit")
custom_materials = list(/datum/material/plastic = SHEET_MATERIAL_AMOUNT * 4, /datum/material/glass = SMALL_MATERIAL_AMOUNT * 1.1, /datum/material/iron = SMALL_MATERIAL_AMOUNT * 0.1)
/// Whether our sword has been multitooled to rainbow
var/hacked = FALSE
/// The color of our fake energy sword
@@ -1081,6 +1082,7 @@
icon_state = "snowball"
throwforce = 20 //the same damage as a disabler shot
damtype = STAMINA //maybe someday we can add stuffing rocks (or perhaps ore?) into snowballs to make them deal brute damage
custom_materials = list(/datum/material/snow = SHEET_MATERIAL_AMOUNT)
/obj/item/toy/snowball/ranged_interact_with_atom(atom/interacting_with, mob/living/user, list/modifiers)
user.throw_item(interacting_with)
+1
View File
@@ -66,6 +66,7 @@
throw_speed = 1
armour_penetration = 15
hitsound = 'sound/items/car_engine_start.ogg'
custom_materials = list(/datum/material/iron = SHEET_MATERIAL_AMOUNT * 14, /datum/material/cardboard = SHEET_MATERIAL_AMOUNT, /datum/material/glass = SMALL_MATERIAL_AMOUNT * 0.8)
/// The number of charges the house edge has accrued through 2-handed hits, to charge a more powerful charge attack.
var/fire_charges = 0
///Sound played when wielded.
+3 -1
View File
@@ -628,6 +628,7 @@ for further reading, please see: https://github.com/tgstation/tgstation/pull/301
icon_angle = -135
lefthand_file = 'icons/mob/inhands/weapons/staves_lefthand.dmi'
righthand_file = 'icons/mob/inhands/weapons/staves_righthand.dmi'
custom_materials = list(/datum/material/bamboo = SHEET_MATERIAL_AMOUNT * 4)
/obj/item/bambostaff/Initialize(mapload)
. = ..()
@@ -745,7 +746,7 @@ for further reading, please see: https://github.com/tgstation/tgstation/pull/301
desc = "A handmade crutch. Also makes a decent bludgeon if you need it."
icon_state = "crutch_wood"
inhand_icon_state = "crutch_wood"
custom_materials = list(/datum/material/wood = SMALL_MATERIAL_AMOUNT * 0.5)
custom_materials = list(/datum/material/wood = SHEET_MATERIAL_AMOUNT * 5)
/obj/item/cane/white
name = "white cane"
@@ -873,6 +874,7 @@ for further reading, please see: https://github.com/tgstation/tgstation/pull/301
throw_range = 1
attack_verb_continuous = list("clubs", "bludgeons")
attack_verb_simple = list("club", "bludgeon")
custom_materials = list(/datum/material/iron = SHEET_MATERIAL_AMOUNT)
/obj/item/melee/baseball_bat
name = "baseball bat"
+1
View File
@@ -22,6 +22,7 @@
force = 10
throwforce = 6
w_class = WEIGHT_CLASS_BULKY
custom_materials = list(/datum/material/iron = SHEET_MATERIAL_AMOUNT * 22, /datum/material/plastic = SHEET_MATERIAL_AMOUNT * 5, /datum/material/glass = SMALL_MATERIAL_AMOUNT * 0.5)
///What item is being charged currently?
var/obj/item/charging = null
///Did we put power into "charging" last process()?
@@ -19,6 +19,7 @@
resistance_flags = FLAMMABLE
max_integrity = 100
integrity_failure = 0.35
custom_materials = list(/datum/material/iron = SHEET_MATERIAL_AMOUNT * 2)
/// What material this bed is made of
var/build_stack_type = /obj/item/stack/sheet/iron
/// How many mats to drop when deconstructed
@@ -314,6 +315,7 @@
build_stack_type = /obj/item/stack/sheet/mineral/wood
build_stack_amount = 10
elevation = 0
custom_materials = list(/datum/material/wood = SHEET_MATERIAL_AMOUNT * 10)
var/owned = FALSE
/obj/structure/bed/dogbed/ian
@@ -381,6 +383,7 @@
icon_state = "bed_double"
build_stack_amount = 4
max_buckled_mobs = 2
custom_materials = list(/datum/material/iron = SHEET_MATERIAL_AMOUNT * 4)
/// The mob who buckled to this bed second, to avoid other mobs getting pixel-shifted before he unbuckles.
var/mob/living/goldilocks
@@ -188,6 +188,7 @@
buildstackamount = 3
item_chair = /obj/item/chair/wood
fishing_modifier = -6
custom_materials = list(/datum/material/wood = SHEET_MATERIAL_AMOUNT * 3)
/obj/structure/chair/wood/narsie_act()
return
@@ -207,6 +208,7 @@
item_chair = null
fishing_modifier = -7
has_armrest = TRUE
custom_materials = list(/datum/material/iron = SHEET_MATERIAL_AMOUNT * 2)
/obj/structure/chair/comfy/brown
color = rgb(70, 47, 28)
@@ -232,7 +234,7 @@
unbuckle_sound = SFX_SEATBELT_UNBUCKLE
resistance_flags = FIRE_PROOF
max_integrity = 120
custom_materials = list(/datum/material/titanium = SHEET_MATERIAL_AMOUNT)
custom_materials = list(/datum/material/titanium = SHEET_MATERIAL_AMOUNT * 2)
/obj/structure/chair/comfy/shuttle/electrify_self(obj/item/assembly/shock_kit/input_shock_kit, mob/user, list/overlays_from_child_procs)
if(!overlays_from_child_procs)
@@ -286,6 +288,7 @@
icon_state = "carp_chair"
buildstacktype = /obj/item/stack/sheet/animalhide/carp
fishing_modifier = -12
custom_materials = null
/obj/structure/chair/office
name = "office chair"
@@ -294,6 +297,7 @@
item_chair = null
fishing_modifier = -6
icon_state = "officechair_dark"
custom_materials = list(/datum/material/iron = SHEET_MATERIAL_AMOUNT * 5)
/obj/structure/chair/office/Initialize(mapload)
. = ..()
@@ -375,6 +379,7 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/structure/chair/stool/bar, 0)
buildstacktype = /obj/item/stack/sheet/mineral/bamboo
buildstackamount = 2
item_chair = /obj/item/chair/stool/bamboo
custom_materials = list(/datum/material/bamboo = SHEET_MATERIAL_AMOUNT * 2)
/obj/item/chair
name = "chair"
@@ -393,7 +398,7 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/structure/chair/stool/bar, 0)
max_integrity = 100
hitsound = 'sound/items/trayhit/trayhit1.ogg'
hit_reaction_chance = 50
custom_materials = list(/datum/material/iron =SHEET_MATERIAL_AMOUNT)
custom_materials = list(/datum/material/iron = SHEET_MATERIAL_AMOUNT)
item_flags = SKIP_FANTASY_ON_SPAWN
// Duration of daze inflicted when the chair is smashed against someone from behind.
@@ -524,6 +529,7 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/structure/chair/stool/bar, 0)
origin_type = /obj/structure/chair/stool/bamboo
max_integrity = 40 //Submissive and breakable unlike the chad iron stool
daze_amount = 0 //Not hard enough to cause them to become dazed
custom_materials = list(/datum/material/bamboo = SHEET_MATERIAL_AMOUNT * 2)
/obj/item/chair/stool/narsie_act()
return //sturdy enough to ignore a god
@@ -538,6 +544,7 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/structure/chair/stool/bar, 0)
origin_type = /obj/structure/chair/wood
custom_materials = null
daze_amount = 0
custom_materials = list(/datum/material/wood = SHEET_MATERIAL_AMOUNT * 3)
/obj/item/chair/wood/narsie_act()
return
@@ -563,6 +570,7 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/structure/chair/stool/bar, 0)
item_chair = null
fishing_modifier = -13 //the pinnacle of Ratvarian technology.
has_armrest = TRUE
custom_materials = list(/datum/material/bronze = SHEET_MATERIAL_AMOUNT)
/// Total rotations made
var/turns = 0
@@ -606,6 +614,7 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/structure/chair/stool/bar, 0)
obj_flags = parent_type::obj_flags | NO_DEBRIS_AFTER_DECONSTRUCTION
alpha = 0
fishing_modifier = -21 //it only lives for 25 seconds, so we make them worth it.
custom_materials = null
/obj/structure/chair/mime/wrench_act_secondary(mob/living/user, obj/item/weapon)
return NONE
@@ -622,7 +631,7 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/structure/chair/stool/bar, 0)
desc = "No matter how much you squirm, it'll still be uncomfortable."
resistance_flags = FLAMMABLE
max_integrity = 70
custom_materials = list(/datum/material/plastic =SHEET_MATERIAL_AMOUNT)
custom_materials = list(/datum/material/plastic = SHEET_MATERIAL_AMOUNT * 2)
buildstacktype = /obj/item/stack/sheet/plastic
buildstackamount = 2
item_chair = /obj/item/chair/plastic
@@ -656,7 +665,7 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/structure/chair/stool/bar, 0)
w_class = WEIGHT_CLASS_NORMAL
force = 7
throw_range = 5 //Lighter Weight --> Flies Farther.
custom_materials = list(/datum/material/plastic =SHEET_MATERIAL_AMOUNT)
custom_materials = list(/datum/material/plastic = SHEET_MATERIAL_AMOUNT * 2)
max_integrity = 70
daze_amount = 0
origin_type = /obj/structure/chair/plastic
@@ -8,6 +8,7 @@
buildstacktype = /obj/item/stack/sheet/mineral/wood
buildstackamount = 3
item_chair = null
custom_materials = list(/datum/material/wood = SHEET_MATERIAL_AMOUNT * 3)
///This proc adds the rotate component, overwrite this if you for some reason want to change some specific args.
/obj/structure/chair/pew/MakeRotate()
@@ -111,6 +111,7 @@ COLORED_SOFA(/obj/structure/chair/sofa, maroon, SOFA_MAROON)
buildstacktype = /obj/item/stack/sheet/mineral/bamboo
buildstackamount = 3
has_armrest = FALSE
custom_materials = list(/datum/material/bamboo = SHEET_MATERIAL_AMOUNT * 3)
/obj/structure/chair/sofa/bamboo/left
icon_state = "bamboo_sofaend_left"
@@ -581,6 +581,7 @@ LINEN BINS
resistance_flags = FLAMMABLE
max_integrity = 70
anchored_tabletop_offset = 6
custom_materials = list(/datum/material/iron = SHEET_MATERIAL_AMOUNT)
/// The number of bedsheets in the bin
var/amount = 10
/// A list of actual sheets within the bin

Some files were not shown because too many files have changed in this diff Show More