From 186f4bd4c277dc24ba2849ee86f2e54677718285 Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Wed, 11 Nov 2020 03:51:23 +0100 Subject: [PATCH] [MIRROR] Fixes a few bugs with greyscale stacks. (#1670) * Fixes a few bugs with greyscale stacks. (#54858) Fixes greyscale floor tiles merging regardless of their materials. Fixes greyscale floor tiles voiding materials when splitting the stack. Fixes greyscale floor tile stacks being created with no mats_per_unit and only enough custom materials for a single unit. Fixes greyscale tile flooring being created with the wrong amount of materials. Fixes greyscale tile flooring not producing floor tiles/producing floor tiles with 0 units. * Fixes a few bugs with greyscale stacks. Co-authored-by: TemporalOroboros --- .../components/storage/concrete/stack.dm | 3 +- code/game/machinery/constructable_frame.dm | 10 +- code/game/objects/items/stacks/bscrystal.dm | 6 +- code/game/objects/items/stacks/rods.dm | 6 +- .../game/objects/items/stacks/sheets/glass.dm | 16 +-- .../objects/items/stacks/sheets/hot_ice.dm | 2 +- .../objects/items/stacks/sheets/mineral.dm | 30 ++--- .../items/stacks/sheets/sheet_types.dm | 28 ++-- code/game/objects/items/stacks/stack.dm | 122 +++++++++++------- .../items/stacks/tiles/tile_mineral.dm | 18 +-- .../objects/items/stacks/tiles/tile_types.dm | 6 +- code/game/turfs/open/floor.dm | 14 +- code/game/turfs/open/floor/plating.dm | 2 +- code/modules/mining/ores_coins.dm | 18 +-- code/modules/mob/inventory.dm | 4 +- code/modules/plumbing/ducts.dm | 2 +- code/modules/power/cable.dm | 4 +- code/modules/power/pipecleaners.dm | 4 +- .../research/xenobiology/xenobiology.dm | 4 +- 19 files changed, 169 insertions(+), 130 deletions(-) diff --git a/code/datums/components/storage/concrete/stack.dm b/code/datums/components/storage/concrete/stack.dm index 1f0c44c6502..210f22ea5a3 100644 --- a/code/datums/components/storage/concrete/stack.dm +++ b/code/datums/components/storage/concrete/stack.dm @@ -39,7 +39,8 @@ _S.add(can_insert) S.use(can_insert, TRUE) return TRUE - return ..(S.change_stack(null, can_insert), override) + I = S.split_stack(null, can_insert) + return ..() /datum/component/storage/concrete/stack/remove_from_storage(obj/item/I, atom/new_location) var/atom/real_location = real_location() diff --git a/code/game/machinery/constructable_frame.dm b/code/game/machinery/constructable_frame.dm index 7d0e787e6ce..3dab1884d5b 100644 --- a/code/game/machinery/constructable_frame.dm +++ b/code/game/machinery/constructable_frame.dm @@ -245,10 +245,12 @@ for(var/obj/item/part in added_components) if(istype(part,/obj/item/stack)) - var/obj/item/stack/S = part - var/obj/item/stack/NS = locate(S.merge_type) in components //find a stack to merge with - if(NS) - S.merge(NS) + var/obj/item/stack/incoming_stack = part + for(var/obj/item/stack/merge_stack in components) + if(incoming_stack.can_merge(merge_stack)) + incoming_stack.merge(merge_stack) + if(QDELETED(incoming_stack)) + break if(!QDELETED(part)) //If we're a stack and we merged we might not exist anymore components += part part.forceMove(src) diff --git a/code/game/objects/items/stacks/bscrystal.dm b/code/game/objects/items/stacks/bscrystal.dm index 04e8e2d7c32..59a535810ae 100644 --- a/code/game/objects/items/stacks/bscrystal.dm +++ b/code/game/objects/items/stacks/bscrystal.dm @@ -7,7 +7,7 @@ singular_name = "bluespace crystal" dye_color = DYE_COSMIC w_class = WEIGHT_CLASS_TINY - custom_materials = list(/datum/material/bluespace=MINERAL_MATERIAL_AMOUNT) + mats_per_unit = list(/datum/material/bluespace=MINERAL_MATERIAL_AMOUNT) points = 50 var/blink_range = 8 // The teleport range when crushed/thrown at someone. refined_type = /obj/item/stack/sheet/bluespace_crystal @@ -51,7 +51,7 @@ /obj/item/stack/ore/bluespace_crystal/artificial name = "artificial bluespace crystal" desc = "An artificially made bluespace crystal, it looks delicate." - custom_materials = list(/datum/material/bluespace=MINERAL_MATERIAL_AMOUNT*0.5) + mats_per_unit = list(/datum/material/bluespace=MINERAL_MATERIAL_AMOUNT*0.5) blink_range = 4 // Not as good as the organic stuff! points = 0 //nice try refined_type = null @@ -65,7 +65,7 @@ inhand_icon_state = "sheet-polycrystal" singular_name = "bluespace polycrystal" desc = "A stable polycrystal, made of fused-together bluespace crystals. You could probably break one off." - custom_materials = list(/datum/material/bluespace=MINERAL_MATERIAL_AMOUNT) + mats_per_unit = list(/datum/material/bluespace=MINERAL_MATERIAL_AMOUNT) attack_verb_continuous = list("bluespace polybashes", "bluespace polybatters", "bluespace polybludgeons", "bluespace polythrashes", "bluespace polysmashes") attack_verb_simple = list("bluespace polybash", "bluespace polybatter", "bluespace polybludgeon", "bluespace polythrash", "bluespace polysmash") novariants = TRUE diff --git a/code/game/objects/items/stacks/rods.dm b/code/game/objects/items/stacks/rods.dm index ed060e0be29..a9bf16dcca8 100644 --- a/code/game/objects/items/stacks/rods.dm +++ b/code/game/objects/items/stacks/rods.dm @@ -19,7 +19,7 @@ GLOBAL_LIST_INIT(rod_recipes, list ( \ throwforce = 10 throw_speed = 3 throw_range = 7 - custom_materials = list(/datum/material/iron=1000) + mats_per_unit = list(/datum/material/iron=1000) max_amount = 50 attack_verb_continuous = list("hits", "bludgeons", "whacks") attack_verb_simple = list("hit", "bludgeon", "whack") @@ -68,7 +68,7 @@ GLOBAL_LIST_INIT(rod_recipes, list ( \ return ..() /obj/item/stack/rods/cyborg - custom_materials = null + mats_per_unit = null is_cyborg = 1 cost = 250 @@ -94,7 +94,7 @@ GLOBAL_LIST_INIT(rod_recipes, list ( \ color = "#5286b9ff" flags_1 = CONDUCT_1 w_class = WEIGHT_CLASS_NORMAL - custom_materials = list(/datum/material/iron=1000, /datum/material/plasma=500, /datum/material/titanium=2000) + mats_per_unit = list(/datum/material/iron=1000, /datum/material/plasma=500, /datum/material/titanium=2000) max_amount = 30 resistance_flags = FIRE_PROOF | LAVA_PROOF diff --git a/code/game/objects/items/stacks/sheets/glass.dm b/code/game/objects/items/stacks/sheets/glass.dm index 7549cd23ff6..eac538cbce1 100644 --- a/code/game/objects/items/stacks/sheets/glass.dm +++ b/code/game/objects/items/stacks/sheets/glass.dm @@ -20,7 +20,7 @@ GLOBAL_LIST_INIT(glass_recipes, list ( \ singular_name = "glass sheet" icon_state = "sheet-glass" inhand_icon_state = "sheet-glass" - custom_materials = list(/datum/material/glass=MINERAL_MATERIAL_AMOUNT) + mats_per_unit = list(/datum/material/glass=MINERAL_MATERIAL_AMOUNT) armor = list(MELEE = 0, BULLET = 0, LASER = 0, ENERGY = 0, BOMB = 0, BIO = 0, RAD = 0, FIRE = 50, ACID = 100) resistance_flags = ACID_PROOF merge_type = /obj/item/stack/sheet/glass @@ -35,7 +35,7 @@ GLOBAL_LIST_INIT(glass_recipes, list ( \ return BRUTELOSS /obj/item/stack/sheet/glass/cyborg - custom_materials = null + mats_per_unit = null is_cyborg = 1 cost = 500 @@ -86,7 +86,7 @@ GLOBAL_LIST_INIT(pglass_recipes, list ( \ singular_name = "plasma glass sheet" icon_state = "sheet-pglass" inhand_icon_state = "sheet-pglass" - custom_materials = list(/datum/material/alloy/plasmaglass=MINERAL_MATERIAL_AMOUNT) + mats_per_unit = list(/datum/material/alloy/plasmaglass=MINERAL_MATERIAL_AMOUNT) material_type = /datum/material/alloy/plasmaglass armor = list(MELEE = 0, BULLET = 0, LASER = 0, ENERGY = 0, BOMB = 0, BIO = 0, RAD = 0, FIRE = 75, ACID = 100) resistance_flags = ACID_PROOF @@ -138,7 +138,7 @@ GLOBAL_LIST_INIT(reinforced_glass_recipes, list ( \ singular_name = "reinforced glass sheet" icon_state = "sheet-rglass" inhand_icon_state = "sheet-rglass" - custom_materials = list(/datum/material/iron=MINERAL_MATERIAL_AMOUNT * 0.5, /datum/material/glass=MINERAL_MATERIAL_AMOUNT) + mats_per_unit = list(/datum/material/iron=MINERAL_MATERIAL_AMOUNT * 0.5, /datum/material/glass=MINERAL_MATERIAL_AMOUNT) armor = list(MELEE = 0, BULLET = 0, LASER = 0, ENERGY = 0, BOMB = 0, BIO = 0, RAD = 0, FIRE = 70, ACID = 100) resistance_flags = ACID_PROOF merge_type = /obj/item/stack/sheet/rglass @@ -151,7 +151,7 @@ GLOBAL_LIST_INIT(reinforced_glass_recipes, list ( \ ..() /obj/item/stack/sheet/rglass/cyborg - custom_materials = null + mats_per_unit = null var/datum/robot_energy_storage/glasource var/metcost = 250 var/glacost = 500 @@ -185,7 +185,7 @@ GLOBAL_LIST_INIT(prglass_recipes, list ( \ singular_name = "reinforced plasma glass sheet" icon_state = "sheet-prglass" inhand_icon_state = "sheet-prglass" - custom_materials = list(/datum/material/alloy/plasmaglass=MINERAL_MATERIAL_AMOUNT, /datum/material/iron = MINERAL_MATERIAL_AMOUNT * 0.5) + mats_per_unit = list(/datum/material/alloy/plasmaglass=MINERAL_MATERIAL_AMOUNT, /datum/material/iron = MINERAL_MATERIAL_AMOUNT * 0.5) armor = list(MELEE = 20, BULLET = 0, LASER = 0, ENERGY = 0, BOMB = 0, BIO = 0, RAD = 0, FIRE = 80, ACID = 100) resistance_flags = ACID_PROOF material_flags = MATERIAL_NO_EFFECTS @@ -209,7 +209,7 @@ GLOBAL_LIST_INIT(titaniumglass_recipes, list( singular_name = "titanium glass sheet" icon_state = "sheet-titaniumglass" inhand_icon_state = "sheet-titaniumglass" - custom_materials = list(/datum/material/alloy/titaniumglass=MINERAL_MATERIAL_AMOUNT) + mats_per_unit = list(/datum/material/alloy/titaniumglass=MINERAL_MATERIAL_AMOUNT) material_type = /datum/material/alloy/titaniumglass armor = list(MELEE = 0, BULLET = 0, LASER = 0, ENERGY = 0, BOMB = 0, BIO = 0, RAD = 0, FIRE = 80, ACID = 100) resistance_flags = ACID_PROOF @@ -230,7 +230,7 @@ GLOBAL_LIST_INIT(plastitaniumglass_recipes, list( singular_name = "plastitanium glass sheet" icon_state = "sheet-plastitaniumglass" inhand_icon_state = "sheet-plastitaniumglass" - custom_materials = list(/datum/material/alloy/plastitaniumglass=MINERAL_MATERIAL_AMOUNT) + mats_per_unit = list(/datum/material/alloy/plastitaniumglass=MINERAL_MATERIAL_AMOUNT) material_type = /datum/material/alloy/plastitaniumglass armor = list(MELEE = 0, BULLET = 0, LASER = 0, ENERGY = 0, BOMB = 0, BIO = 0, RAD = 0, FIRE = 80, ACID = 100) material_flags = MATERIAL_NO_EFFECTS diff --git a/code/game/objects/items/stacks/sheets/hot_ice.dm b/code/game/objects/items/stacks/sheets/hot_ice.dm index 08ce2c4a417..3a7105c9d46 100644 --- a/code/game/objects/items/stacks/sheets/hot_ice.dm +++ b/code/game/objects/items/stacks/sheets/hot_ice.dm @@ -4,7 +4,7 @@ inhand_icon_state = "hot-ice" singular_name = "hot ice piece" icon = 'icons/obj/stack_objects.dmi' - custom_materials = list(/datum/material/hot_ice=MINERAL_MATERIAL_AMOUNT) + mats_per_unit = list(/datum/material/hot_ice=MINERAL_MATERIAL_AMOUNT) grind_results = list(/datum/reagent/toxin/hot_ice = 25) material_type = /datum/material/hot_ice diff --git a/code/game/objects/items/stacks/sheets/mineral.dm b/code/game/objects/items/stacks/sheets/mineral.dm index ac94410cea3..577a2695b4e 100644 --- a/code/game/objects/items/stacks/sheets/mineral.dm +++ b/code/game/objects/items/stacks/sheets/mineral.dm @@ -37,7 +37,7 @@ GLOBAL_LIST_INIT(sandstone_recipes, list ( \ inhand_icon_state = "sheet-sandstone" throw_speed = 3 throw_range = 5 - custom_materials = list(/datum/material/sandstone=MINERAL_MATERIAL_AMOUNT) + mats_per_unit = list(/datum/material/sandstone=MINERAL_MATERIAL_AMOUNT) sheettype = "sandstone" merge_type = /obj/item/stack/sheet/mineral/sandstone walltype = /turf/closed/wall/mineral/sandstone @@ -98,7 +98,7 @@ GLOBAL_LIST_INIT(sandbag_recipes, list ( \ inhand_icon_state = "sheet-diamond" singular_name = "diamond" sheettype = "diamond" - custom_materials = list(/datum/material/diamond=MINERAL_MATERIAL_AMOUNT) + mats_per_unit = list(/datum/material/diamond=MINERAL_MATERIAL_AMOUNT) novariants = TRUE grind_results = list(/datum/reagent/carbon = 20) point_value = 25 @@ -124,7 +124,7 @@ GLOBAL_LIST_INIT(diamond_recipes, list ( \ inhand_icon_state = "sheet-uranium" singular_name = "uranium sheet" sheettype = "uranium" - custom_materials = list(/datum/material/uranium=MINERAL_MATERIAL_AMOUNT) + mats_per_unit = list(/datum/material/uranium=MINERAL_MATERIAL_AMOUNT) novariants = TRUE grind_results = list(/datum/reagent/uranium = 20) point_value = 20 @@ -152,7 +152,7 @@ GLOBAL_LIST_INIT(uranium_recipes, list ( \ sheettype = "plasma" resistance_flags = FLAMMABLE max_integrity = 100 - custom_materials = list(/datum/material/plasma=MINERAL_MATERIAL_AMOUNT) + mats_per_unit = list(/datum/material/plasma=MINERAL_MATERIAL_AMOUNT) grind_results = list(/datum/reagent/toxin/plasma = 20) point_value = 20 merge_type = /obj/item/stack/sheet/mineral/plasma @@ -194,7 +194,7 @@ GLOBAL_LIST_INIT(plasma_recipes, list ( \ inhand_icon_state = "sheet-gold" singular_name = "gold bar" sheettype = "gold" - custom_materials = list(/datum/material/gold=MINERAL_MATERIAL_AMOUNT) + mats_per_unit = list(/datum/material/gold=MINERAL_MATERIAL_AMOUNT) grind_results = list(/datum/reagent/gold = 20) point_value = 20 merge_type = /obj/item/stack/sheet/mineral/gold @@ -221,7 +221,7 @@ GLOBAL_LIST_INIT(gold_recipes, list ( \ inhand_icon_state = "sheet-silver" singular_name = "silver bar" sheettype = "silver" - custom_materials = list(/datum/material/silver=MINERAL_MATERIAL_AMOUNT) + mats_per_unit = list(/datum/material/silver=MINERAL_MATERIAL_AMOUNT) grind_results = list(/datum/reagent/silver = 20) point_value = 20 merge_type = /obj/item/stack/sheet/mineral/silver @@ -247,7 +247,7 @@ GLOBAL_LIST_INIT(silver_recipes, list ( \ inhand_icon_state = "sheet-bananium" singular_name = "bananium sheet" sheettype = "bananium" - custom_materials = list(/datum/material/bananium=MINERAL_MATERIAL_AMOUNT) + mats_per_unit = list(/datum/material/bananium=MINERAL_MATERIAL_AMOUNT) novariants = TRUE grind_results = list(/datum/reagent/consumable/banana = 20) point_value = 50 @@ -277,7 +277,7 @@ GLOBAL_LIST_INIT(bananium_recipes, list ( \ throw_speed = 1 throw_range = 3 sheettype = "titanium" - custom_materials = list(/datum/material/titanium=MINERAL_MATERIAL_AMOUNT) + mats_per_unit = list(/datum/material/titanium=MINERAL_MATERIAL_AMOUNT) point_value = 20 merge_type = /obj/item/stack/sheet/mineral/titanium material_type = /datum/material/titanium @@ -309,7 +309,7 @@ GLOBAL_LIST_INIT(titanium_recipes, list ( \ throw_speed = 1 throw_range = 3 sheettype = "plastitanium" - custom_materials = list(/datum/material/alloy/plastitanium=MINERAL_MATERIAL_AMOUNT) + mats_per_unit = list(/datum/material/alloy/plastitanium=MINERAL_MATERIAL_AMOUNT) point_value = 45 material_type = /datum/material/alloy/plastitanium merge_type = /obj/item/stack/sheet/mineral/plastitanium @@ -333,7 +333,7 @@ GLOBAL_LIST_INIT(plastitanium_recipes, list ( \ name = "snow" icon_state = "sheet-snow" inhand_icon_state = "sheet-snow" - custom_materials = list(/datum/material/snow = MINERAL_MATERIAL_AMOUNT) + mats_per_unit = list(/datum/material/snow = MINERAL_MATERIAL_AMOUNT) singular_name = "snow block" force = 1 throwforce = 2 @@ -369,7 +369,7 @@ GLOBAL_LIST_INIT(adamantine_recipes, list( icon_state = "sheet-adamantine" inhand_icon_state = "sheet-adamantine" singular_name = "adamantine sheet" - custom_materials = list(/datum/material/adamantine=MINERAL_MATERIAL_AMOUNT) + mats_per_unit = list(/datum/material/adamantine=MINERAL_MATERIAL_AMOUNT) merge_type = /obj/item/stack/sheet/mineral/adamantine /obj/item/stack/sheet/mineral/adamantine/get_main_recipes() @@ -386,7 +386,7 @@ GLOBAL_LIST_INIT(adamantine_recipes, list( singular_name = "runite bar" icon_state = "sheet-runite" inhand_icon_state = "sheet-runite" - custom_materials = list(/datum/material/runite=MINERAL_MATERIAL_AMOUNT) + mats_per_unit = list(/datum/material/runite=MINERAL_MATERIAL_AMOUNT) merge_type = /obj/item/stack/sheet/mineral/runite material_type = /datum/material/runite @@ -400,7 +400,7 @@ GLOBAL_LIST_INIT(adamantine_recipes, list( inhand_icon_state = "sheet-mythril" singular_name = "mythril sheet" novariants = TRUE - custom_materials = list(/datum/material/mythril=MINERAL_MATERIAL_AMOUNT) + mats_per_unit = list(/datum/material/mythril=MINERAL_MATERIAL_AMOUNT) merge_type = /obj/item/stack/sheet/mineral/mythril /* @@ -413,7 +413,7 @@ GLOBAL_LIST_INIT(adamantine_recipes, list( inhand_icon_state = "sheet-abductor" singular_name = "alien alloy sheet" sheettype = "abductor" - custom_materials = list(/datum/material/alloy/alien=MINERAL_MATERIAL_AMOUNT) + mats_per_unit = list(/datum/material/alloy/alien=MINERAL_MATERIAL_AMOUNT) merge_type = /obj/item/stack/sheet/mineral/abductor material_type = /datum/material/alloy/alien walltype = /turf/closed/wall/mineral/abductor @@ -481,7 +481,7 @@ GLOBAL_LIST_INIT(metalhydrogen_recipes, list( w_class = WEIGHT_CLASS_NORMAL resistance_flags = FIRE_PROOF | LAVA_PROOF | ACID_PROOF | INDESTRUCTIBLE point_value = 100 - custom_materials = list(/datum/material/metalhydrogen = MINERAL_MATERIAL_AMOUNT) + mats_per_unit = list(/datum/material/metalhydrogen = MINERAL_MATERIAL_AMOUNT) merge_type = /obj/item/stack/sheet/mineral/metal_hydrogen /obj/item/stack/sheet/mineral/metal_hydrogen/get_main_recipes() diff --git a/code/game/objects/items/stacks/sheets/sheet_types.dm b/code/game/objects/items/stacks/sheets/sheet_types.dm index 33b7b9108fa..58f961bc775 100644 --- a/code/game/objects/items/stacks/sheets/sheet_types.dm +++ b/code/game/objects/items/stacks/sheets/sheet_types.dm @@ -128,7 +128,7 @@ GLOBAL_LIST_INIT(metal_recipes, list ( \ singular_name = "metal sheet" icon_state = "sheet-metal" inhand_icon_state = "sheet-metal" - custom_materials = list(/datum/material/iron=MINERAL_MATERIAL_AMOUNT) + mats_per_unit = list(/datum/material/iron=MINERAL_MATERIAL_AMOUNT) throwforce = 10 flags_1 = CONDUCT_1 resistance_flags = FIRE_PROOF @@ -156,7 +156,7 @@ GLOBAL_LIST_INIT(metal_recipes, list ( \ amount = 5 /obj/item/stack/sheet/metal/cyborg - custom_materials = null + mats_per_unit = null is_cyborg = 1 cost = 500 @@ -187,7 +187,7 @@ GLOBAL_LIST_INIT(plasteel_recipes, list ( \ desc = "This sheet is an alloy of iron and plasma." icon_state = "sheet-plasteel" inhand_icon_state = "sheet-plasteel" - custom_materials = list(/datum/material/alloy/plasteel=MINERAL_MATERIAL_AMOUNT) + mats_per_unit = list(/datum/material/alloy/plasteel=MINERAL_MATERIAL_AMOUNT) material_type = /datum/material/alloy/plasteel throwforce = 10 flags_1 = CONDUCT_1 @@ -260,7 +260,7 @@ GLOBAL_LIST_INIT(wood_recipes, list ( \ icon_state = "sheet-wood" inhand_icon_state = "sheet-wood" icon = 'icons/obj/stack_objects.dmi' - custom_materials = list(/datum/material/wood=MINERAL_MATERIAL_AMOUNT) + mats_per_unit = list(/datum/material/wood=MINERAL_MATERIAL_AMOUNT) sheettype = "wood" armor = list(MELEE = 0, BULLET = 0, LASER = 0, ENERGY = 0, BOMB = 0, BIO = 0, RAD = 0, FIRE = 50, ACID = 0) resistance_flags = FLAMMABLE @@ -293,7 +293,7 @@ GLOBAL_LIST_INIT(bamboo_recipes, list ( \ icon_state = "sheet-bamboo" inhand_icon_state = "sheet-bamboo" icon = 'icons/obj/stack_objects.dmi' - custom_materials = list(/datum/material/bamboo = MINERAL_MATERIAL_AMOUNT) + mats_per_unit = list(/datum/material/bamboo = MINERAL_MATERIAL_AMOUNT) throwforce = 15 armor = list(MELEE = 0, BULLET = 0, LASER = 0, ENERGY = 0, BOMB = 0, BIO = 0, RAD = 0, FIRE = 50, ACID = 0) resistance_flags = FLAMMABLE @@ -477,7 +477,7 @@ GLOBAL_LIST_INIT(cardboard_recipes, list ( \ singular_name = "cardboard sheet" icon_state = "sheet-card" inhand_icon_state = "sheet-card" - custom_materials = list(/datum/material/cardboard = MINERAL_MATERIAL_AMOUNT) + mats_per_unit = list(/datum/material/cardboard = MINERAL_MATERIAL_AMOUNT) resistance_flags = FLAMMABLE force = 0 throwforce = 0 @@ -531,7 +531,7 @@ GLOBAL_LIST_INIT(runed_metal_recipes, list ( \ icon_state = "sheet-runed" inhand_icon_state = "sheet-runed" icon = 'icons/obj/stack_objects.dmi' - custom_materials = list(/datum/material/runedmetal = MINERAL_MATERIAL_AMOUNT) + mats_per_unit = list(/datum/material/runedmetal = MINERAL_MATERIAL_AMOUNT) sheettype = "runed" merge_type = /obj/item/stack/sheet/runed_metal novariants = TRUE @@ -587,7 +587,7 @@ GLOBAL_LIST_INIT(bronze_recipes, list ( \ icon_state = "sheet-brass" inhand_icon_state = "sheet-brass" icon = 'icons/obj/stack_objects.dmi' - custom_materials = list(/datum/material/bronze = MINERAL_MATERIAL_AMOUNT) + mats_per_unit = list(/datum/material/bronze = MINERAL_MATERIAL_AMOUNT) lefthand_file = 'icons/mob/inhands/misc/sheets_lefthand.dmi' righthand_file = 'icons/mob/inhands/misc/sheets_righthand.dmi' resistance_flags = FIRE_PROOF | ACID_PROOF @@ -643,7 +643,7 @@ GLOBAL_LIST_INIT(bronze_recipes, list ( \ icon = 'icons/obj/mining.dmi' icon_state = "bone" inhand_icon_state = "sheet-bone" - custom_materials = list(/datum/material/bone = MINERAL_MATERIAL_AMOUNT) + mats_per_unit = list(/datum/material/bone = MINERAL_MATERIAL_AMOUNT) singular_name = "bone" desc = "Someone's been drinking their milk." force = 7 @@ -672,7 +672,7 @@ GLOBAL_LIST_INIT(plastic_recipes, list( singular_name = "plastic sheet" icon_state = "sheet-plastic" inhand_icon_state = "sheet-plastic" - custom_materials = list(/datum/material/plastic=MINERAL_MATERIAL_AMOUNT) + mats_per_unit = list(/datum/material/plastic=MINERAL_MATERIAL_AMOUNT) throwforce = 7 material_type = /datum/material/plastic merge_type = /obj/item/stack/sheet/plastic @@ -697,7 +697,7 @@ new /datum/stack_recipe("paper frame door", /obj/structure/mineral_door/paperfra singular_name = "paper frame" icon_state = "sheet-paper" inhand_icon_state = "sheet-paper" - custom_materials = list(/datum/material/paper = MINERAL_MATERIAL_AMOUNT) + mats_per_unit = list(/datum/material/paper = MINERAL_MATERIAL_AMOUNT) merge_type = /obj/item/stack/sheet/paperframes resistance_flags = FLAMMABLE grind_results = list(/datum/reagent/cellulose = 20) @@ -719,7 +719,7 @@ new /datum/stack_recipe("paper frame door", /obj/structure/mineral_door/paperfra singular_name = "meat sheet" icon_state = "sheet-meat" material_flags = MATERIAL_COLOR - custom_materials = list(/datum/material/meat = MINERAL_MATERIAL_AMOUNT) + mats_per_unit = list(/datum/material/meat = MINERAL_MATERIAL_AMOUNT) merge_type = /obj/item/stack/sheet/meat material_type = /datum/material/meat material_modifier = 1 //None of that wussy stuff @@ -736,7 +736,7 @@ new /datum/stack_recipe("paper frame door", /obj/structure/mineral_door/paperfra desc = "It's a delicious pepperoni sheetzza!" singular_name = "pepperoni sheetzza" icon_state = "sheet-pizza" - custom_materials = list(/datum/material/pizza = MINERAL_MATERIAL_AMOUNT) + mats_per_unit = list(/datum/material/pizza = MINERAL_MATERIAL_AMOUNT) merge_type = /obj/item/stack/sheet/pizza material_type = /datum/material/pizza material_modifier = 1 @@ -753,7 +753,7 @@ new /datum/stack_recipe("paper frame door", /obj/structure/mineral_door/paperfra desc = "You're too old to be playing with sandcastles. Now you build... sandstations." singular_name = "sand block" icon_state = "sheet-sandstone" - custom_materials = list(/datum/material/sand = MINERAL_MATERIAL_AMOUNT) + mats_per_unit = list(/datum/material/sand = MINERAL_MATERIAL_AMOUNT) merge_type = /obj/item/stack/sheet/sandblock material_type = /datum/material/sand material_modifier = 1 diff --git a/code/game/objects/items/stacks/stack.dm b/code/game/objects/items/stacks/stack.dm index 7faf696b43d..2fa7fc761a1 100644 --- a/code/game/objects/items/stacks/stack.dm +++ b/code/game/objects/items/stacks/stack.dm @@ -40,16 +40,6 @@ /// Amount of matter for RCD var/matter_amount = 0 -/obj/item/stack/on_grind() - for(var/i in 1 to grind_results.len) //This should only call if it's ground, so no need to check if grind_results exists - grind_results[grind_results[i]] *= get_amount() //Gets the key at position i, then the reagent amount of that key, then multiplies it by stack size - -/obj/item/stack/grind_requirements() - if(is_cyborg) - to_chat(usr, "[src] is electronically synthesized in your chassis and can't be ground up!") - return - return TRUE - /obj/item/stack/Initialize(mapload, new_amount, merge = TRUE) if(new_amount != null) amount = new_amount @@ -58,16 +48,16 @@ new type(loc, max_amount, FALSE) if(!merge_type) merge_type = type - if(custom_materials?.len) - mats_per_unit = list() - var/in_process_mat_list = custom_materials.Copy() - for(var/i in custom_materials) - mats_per_unit[SSmaterials.GetMaterialRef(i)] = in_process_mat_list[i] - custom_materials[i] *= amount + + if(LAZYLEN(mats_per_unit)) + set_mats_per_unit(mats_per_unit, 1) + else if(LAZYLEN(custom_materials)) + set_mats_per_unit(custom_materials, amount ? 1/amount : 1) + . = ..() if(merge) for(var/obj/item/stack/S in loc) - if(S.merge_type == merge_type) + if(can_merge(S)) INVOKE_ASYNC(src, .proc/merge, S) var/list/temp_recipes = get_main_recipes() recipes = temp_recipes.Copy() @@ -84,6 +74,31 @@ update_weight() update_icon() +/** Sets the amount of materials per unit for this stack. + * + * Arguments: + * - [mats][/list]: The value to set the mats per unit to. + * - multiplier: The amount to multiply the mats per unit by. Defaults to 1. + */ +/obj/item/stack/proc/set_mats_per_unit(list/mats, multiplier=1) + mats_per_unit = SSmaterials.FindOrCreateMaterialCombo(mats, multiplier) + update_custom_materials() + +/** Updates the custom materials list of this stack. + */ +/obj/item/stack/proc/update_custom_materials() + set_custom_materials(mats_per_unit, amount) + +/obj/item/stack/on_grind() + for(var/i in 1 to length(grind_results)) //This should only call if it's ground, so no need to check if grind_results exists + grind_results[grind_results[i]] *= get_amount() //Gets the key at position i, then the reagent amount of that key, then multiplies it by stack size + +/obj/item/stack/grind_requirements() + if(is_cyborg) + to_chat(usr, "[src] is electronically synthesized in your chassis and can't be ground up!") + return + return TRUE + /obj/item/stack/proc/get_main_recipes() SHOULD_CALL_PARENT(TRUE) return list()//empty list @@ -242,11 +257,12 @@ O.setDir(usr.dir) use(R.req_amount * multiplier) - if(R.applies_mats && custom_materials?.len) - var/list/used_materials = list() - for(var/i in custom_materials) - used_materials[SSmaterials.GetMaterialRef(i)] = R.req_amount / R.res_amount * (MINERAL_MATERIAL_AMOUNT / custom_materials.len) - O.set_custom_materials(used_materials) + if(R.applies_mats && LAZYLEN(mats_per_unit)) + if(isstack(O)) + var/obj/item/stack/crafted_stack = O + crafted_stack.set_mats_per_unit(mats_per_unit, R.req_amount / R.res_amount) + else + O.set_custom_materials(mats_per_unit, R.req_amount / R.res_amount) if(istype(O, /obj/structure/windoor_assembly)) var/obj/structure/windoor_assembly/W = O @@ -337,10 +353,7 @@ if(check && zero_amount()) return TRUE if(length(mats_per_unit)) - var/temp_materials = custom_materials.Copy() - for(var/i in mats_per_unit) - temp_materials[i] = mats_per_unit[i] * src.amount - set_custom_materials(temp_materials) + update_custom_materials() update_icon() update_weight() return TRUE @@ -367,19 +380,33 @@ return TRUE return FALSE -/obj/item/stack/proc/add(amount) +/** Adds some number of units to this stack. + * + * Arguments: + * - _amount: The number of units to add to this stack. + */ +/obj/item/stack/proc/add(_amount) if (is_cyborg) - source.add_charge(amount * cost) + source.add_charge(_amount * cost) else - src.amount += amount + amount += _amount if(length(mats_per_unit)) - var/temp_materials = custom_materials.Copy() - for(var/i in mats_per_unit) - temp_materials[i] = mats_per_unit[i] * src.amount - set_custom_materials(temp_materials) + update_custom_materials() update_icon() update_weight() +/** Checks whether this stack can merge itself into another stack. + * + * Arguments: + * - [check][/obj/item/stack]: The stack to check for mergeability. + */ +/obj/item/stack/proc/can_merge(obj/item/stack/check) + if(!istype(check, merge_type)) + return FALSE + if(mats_per_unit != check.mats_per_unit) + return FALSE + return TRUE + /obj/item/stack/proc/merge(obj/item/stack/S) //Merge src into S, as much as possible if(QDELETED(S) || QDELETED(src) || S == src) //amusingly this can cause a stack to consume itself, let's not allow that. return @@ -395,14 +422,14 @@ S.add(transfer) return transfer -/obj/item/stack/Crossed(atom/movable/AM) - if(istype(AM, merge_type) && !AM.throwing) - merge(AM) +/obj/item/stack/Crossed(atom/movable/crossing) + if(!crossing.throwing && can_merge(crossing)) + merge(crossing) . = ..() -/obj/item/stack/hitby(atom/movable/AM, skipcatch, hitpush, blocked, datum/thrownthing/throwingdatum) - if(istype(AM, merge_type)) - merge(AM) +/obj/item/stack/hitby(atom/movable/hitting, skipcatch, hitpush, blocked, datum/thrownthing/throwingdatum) + if(can_merge(hitting)) + merge(hitting) . = ..() //ATTACK HAND IGNORING PARENT RETURN VALUE @@ -410,7 +437,7 @@ if(user.get_inactive_held_item() == src) if(zero_amount()) return - return change_stack(user,1) + return split_stack(user, 1) else . = ..() @@ -433,14 +460,21 @@ if(stackmaterial == null || stackmaterial <= 0 || !user.canUseTopic(src, BE_CLOSE, ismonkey(user))) return else - change_stack(user, stackmaterial) + split_stack(user, stackmaterial) to_chat(user, "You take [stackmaterial] sheets out of the stack.") -/obj/item/stack/proc/change_stack(mob/user, amount) +/** Splits the stack into two stacks. + * + * Arguments: + * - [user][/mob]: The mob splitting the stack. + * - amount: The number of units to split from this stack. + */ +/obj/item/stack/proc/split_stack(mob/user, amount) if(!use(amount, TRUE, FALSE)) - return FALSE + return null var/obj/item/stack/F = new type(user? user : drop_location(), amount, FALSE) . = F + F.set_mats_per_unit(mats_per_unit, 1) // Required for greyscale sheets and tiles. F.copy_evidences(src) if(user) if(!user.put_in_hands(F, merge_stacks = FALSE)) @@ -450,7 +484,7 @@ zero_amount() /obj/item/stack/attackby(obj/item/W, mob/user, params) - if(istype(W, merge_type)) + if(can_merge(W)) var/obj/item/stack/S = W if(merge(S)) to_chat(user, "Your [S.name] stack now contains [S.get_amount()] [S.singular_name]\s.") diff --git a/code/game/objects/items/stacks/tiles/tile_mineral.dm b/code/game/objects/items/stacks/tiles/tile_mineral.dm index 995587fa112..626da228121 100644 --- a/code/game/objects/items/stacks/tiles/tile_mineral.dm +++ b/code/game/objects/items/stacks/tiles/tile_mineral.dm @@ -6,7 +6,7 @@ inhand_icon_state = "tile-plasma" turf_type = /turf/open/floor/mineral/plasma mineralType = "plasma" - custom_materials = list(/datum/material/plasma=500) + mats_per_unit = list(/datum/material/plasma=500) /obj/item/stack/tile/mineral/uranium name = "uranium tile" @@ -16,7 +16,7 @@ inhand_icon_state = "tile-uranium" turf_type = /turf/open/floor/mineral/uranium mineralType = "uranium" - custom_materials = list(/datum/material/uranium=500) + mats_per_unit = list(/datum/material/uranium=500) /obj/item/stack/tile/mineral/gold name = "gold tile" @@ -26,7 +26,7 @@ inhand_icon_state = "tile-gold" turf_type = /turf/open/floor/mineral/gold mineralType = "gold" - custom_materials = list(/datum/material/gold=500) + mats_per_unit = list(/datum/material/gold=500) /obj/item/stack/tile/mineral/silver name = "silver tile" @@ -36,7 +36,7 @@ inhand_icon_state = "tile-silver" turf_type = /turf/open/floor/mineral/silver mineralType = "silver" - custom_materials = list(/datum/material/silver=500) + mats_per_unit = list(/datum/material/silver=500) /obj/item/stack/tile/mineral/diamond name = "diamond tile" @@ -46,7 +46,7 @@ inhand_icon_state = "tile-diamond" turf_type = /turf/open/floor/mineral/diamond mineralType = "diamond" - custom_materials = list(/datum/material/diamond=500) + mats_per_unit = list(/datum/material/diamond=500) /obj/item/stack/tile/mineral/bananium name = "bananium tile" @@ -56,7 +56,7 @@ inhand_icon_state = "tile-bananium" turf_type = /turf/open/floor/mineral/bananium mineralType = "bananium" - custom_materials = list(/datum/material/bananium=500) + mats_per_unit = list(/datum/material/bananium=500) /obj/item/stack/tile/mineral/abductor name = "alien floor tile" @@ -65,7 +65,7 @@ icon = 'icons/obj/abductor.dmi' icon_state = "tile_abductor" inhand_icon_state = "tile-abductor" - custom_materials = list(/datum/material/alloy/alien=MINERAL_MATERIAL_AMOUNT*0.25) + mats_per_unit = list(/datum/material/alloy/alien=MINERAL_MATERIAL_AMOUNT*0.25) turf_type = /turf/open/floor/mineral/abductor mineralType = "abductor" @@ -77,7 +77,7 @@ inhand_icon_state = "tile-shuttle" turf_type = /turf/open/floor/mineral/titanium mineralType = "titanium" - custom_materials = list(/datum/material/titanium=500) + mats_per_unit = list(/datum/material/titanium=500) tile_reskin_types = list( /obj/item/stack/tile/mineral/titanium, /obj/item/stack/tile/mineral/titanium/yellow, @@ -162,7 +162,7 @@ inhand_icon_state = "tile-darkshuttle" turf_type = /turf/open/floor/mineral/plastitanium mineralType = "plastitanium" - custom_materials = list(/datum/material/alloy/plastitanium=MINERAL_MATERIAL_AMOUNT*0.25) + mats_per_unit = list(/datum/material/alloy/plastitanium=MINERAL_MATERIAL_AMOUNT*0.25) material_flags = MATERIAL_NO_EFFECTS /obj/item/stack/tile/mineral/snow diff --git a/code/game/objects/items/stacks/tiles/tile_types.dm b/code/game/objects/items/stacks/tiles/tile_types.dm index 926960c6814..c5187007faf 100644 --- a/code/game/objects/items/stacks/tiles/tile_types.dm +++ b/code/game/objects/items/stacks/tiles/tile_types.dm @@ -365,7 +365,7 @@ icon_state = "tile" inhand_icon_state = "tile" force = 6 - custom_materials = list(/datum/material/iron=500) + mats_per_unit = list(/datum/material/iron=500) throwforce = 10 flags_1 = CONDUCT_1 turf_type = /turf/open/floor/plasteel @@ -375,7 +375,7 @@ matter_amount = 1 /obj/item/stack/tile/plasteel/cyborg - custom_materials = null // All other Borg versions of items have no Metal or Glass - RR + mats_per_unit = null // All other Borg versions of items have no Metal or Glass - RR is_cyborg = 1 cost = 125 @@ -384,7 +384,7 @@ singular_name = "plastic floor tile" desc = "A tile of cheap, flimsy plastic flooring." icon_state = "tile_plastic" - custom_materials = list(/datum/material/plastic=500) + mats_per_unit = list(/datum/material/plastic=500) turf_type = /turf/open/floor/plastic /obj/item/stack/tile/material diff --git a/code/game/turfs/open/floor.dm b/code/game/turfs/open/floor.dm index 4e9a1218d13..53384000193 100644 --- a/code/game/turfs/open/floor.dm +++ b/code/game/turfs/open/floor.dm @@ -194,8 +194,8 @@ /turf/open/floor/proc/spawn_tile() if(!has_tile()) - return - new floor_tile(src) + return null + return new floor_tile(src) /turf/open/floor/singularity_pull(S, current_size) ..() @@ -324,11 +324,13 @@ name = "floor" icon_state = "materialfloor" material_flags = MATERIAL_ADD_PREFIX | MATERIAL_COLOR | MATERIAL_AFFECT_STATISTICS + floor_tile = /obj/item/stack/tile/material /turf/open/floor/material/has_tile() - return custom_materials.len + return LAZYLEN(custom_materials) /turf/open/floor/material/spawn_tile() - for(var/i in custom_materials) - var/datum/material/M = i - new M.sheet_type(src, FLOOR(custom_materials[M] / MINERAL_MATERIAL_AMOUNT, 1)) + . = ..() + if(.) + var/obj/item/stack/tile = . + tile.set_mats_per_unit(custom_materials, 1) diff --git a/code/game/turfs/open/floor/plating.dm b/code/game/turfs/open/floor/plating.dm index 9072207c242..9ca7adc7abc 100644 --- a/code/game/turfs/open/floor/plating.dm +++ b/code/game/turfs/open/floor/plating.dm @@ -80,7 +80,7 @@ return if(istype(W, /obj/item/stack/tile/material)) var/turf/newturf = PlaceOnTop(/turf/open/floor/material, flags = CHANGETURF_INHERIT_AIR) - newturf.set_custom_materials(W.custom_materials) + newturf.set_custom_materials(W.mats_per_unit) else if(W.turf_type) var/turf/open/floor/T = PlaceOnTop(W.turf_type, flags = CHANGETURF_INHERIT_AIR) if(istype(W, /obj/item/stack/tile/light)) //TODO: get rid of this ugly check somehow diff --git a/code/modules/mining/ores_coins.dm b/code/modules/mining/ores_coins.dm index 5b9ed970a44..557aeda6b78 100644 --- a/code/modules/mining/ores_coins.dm +++ b/code/modules/mining/ores_coins.dm @@ -73,7 +73,7 @@ singular_name = "uranium ore chunk" points = 30 material_flags = MATERIAL_NO_EFFECTS - custom_materials = list(/datum/material/uranium=MINERAL_MATERIAL_AMOUNT) + mats_per_unit = list(/datum/material/uranium=MINERAL_MATERIAL_AMOUNT) refined_type = /obj/item/stack/sheet/mineral/uranium mine_experience = 6 scan_state = "rock_Uranium" @@ -85,7 +85,7 @@ inhand_icon_state = "Iron ore" singular_name = "iron ore chunk" points = 1 - custom_materials = list(/datum/material/iron=MINERAL_MATERIAL_AMOUNT) + mats_per_unit = list(/datum/material/iron=MINERAL_MATERIAL_AMOUNT) refined_type = /obj/item/stack/sheet/metal mine_experience = 1 scan_state = "rock_Iron" @@ -97,7 +97,7 @@ inhand_icon_state = "Glass ore" singular_name = "sand pile" points = 1 - custom_materials = list(/datum/material/glass=MINERAL_MATERIAL_AMOUNT) + mats_per_unit = list(/datum/material/glass=MINERAL_MATERIAL_AMOUNT) refined_type = /obj/item/stack/sheet/glass w_class = WEIGHT_CLASS_TINY mine_experience = 0 //its sand @@ -142,7 +142,7 @@ GLOBAL_LIST_INIT(sand_recipes, list(\ inhand_icon_state = "Plasma ore" singular_name = "plasma ore chunk" points = 15 - custom_materials = list(/datum/material/plasma=MINERAL_MATERIAL_AMOUNT) + mats_per_unit = list(/datum/material/plasma=MINERAL_MATERIAL_AMOUNT) refined_type = /obj/item/stack/sheet/mineral/plasma mine_experience = 5 scan_state = "rock_Plasma" @@ -160,7 +160,7 @@ GLOBAL_LIST_INIT(sand_recipes, list(\ singular_name = "silver ore chunk" points = 16 mine_experience = 3 - custom_materials = list(/datum/material/silver=MINERAL_MATERIAL_AMOUNT) + mats_per_unit = list(/datum/material/silver=MINERAL_MATERIAL_AMOUNT) refined_type = /obj/item/stack/sheet/mineral/silver scan_state = "rock_Silver" spreadChance = 5 @@ -172,7 +172,7 @@ GLOBAL_LIST_INIT(sand_recipes, list(\ singular_name = "gold ore chunk" points = 18 mine_experience = 5 - custom_materials = list(/datum/material/gold=MINERAL_MATERIAL_AMOUNT) + mats_per_unit = list(/datum/material/gold=MINERAL_MATERIAL_AMOUNT) refined_type = /obj/item/stack/sheet/mineral/gold scan_state = "rock_Gold" spreadChance = 5 @@ -183,7 +183,7 @@ GLOBAL_LIST_INIT(sand_recipes, list(\ inhand_icon_state = "Diamond ore" singular_name = "diamond ore chunk" points = 50 - custom_materials = list(/datum/material/diamond=MINERAL_MATERIAL_AMOUNT) + mats_per_unit = list(/datum/material/diamond=MINERAL_MATERIAL_AMOUNT) refined_type = /obj/item/stack/sheet/mineral/diamond mine_experience = 10 scan_state = "rock_Diamond" @@ -194,7 +194,7 @@ GLOBAL_LIST_INIT(sand_recipes, list(\ inhand_icon_state = "Bananium ore" singular_name = "bananium ore chunk" points = 60 - custom_materials = list(/datum/material/bananium=MINERAL_MATERIAL_AMOUNT) + mats_per_unit = list(/datum/material/bananium=MINERAL_MATERIAL_AMOUNT) refined_type = /obj/item/stack/sheet/mineral/bananium mine_experience = 15 scan_state = "rock_Bananium" @@ -205,7 +205,7 @@ GLOBAL_LIST_INIT(sand_recipes, list(\ inhand_icon_state = "Titanium ore" singular_name = "titanium ore chunk" points = 50 - custom_materials = list(/datum/material/titanium=MINERAL_MATERIAL_AMOUNT) + mats_per_unit = list(/datum/material/titanium=MINERAL_MATERIAL_AMOUNT) refined_type = /obj/item/stack/sheet/mineral/titanium mine_experience = 3 scan_state = "rock_Titanium" diff --git a/code/modules/mob/inventory.dm b/code/modules/mob/inventory.dm index 0d1b86a65ad..0c894a9fa32 100644 --- a/code/modules/mob/inventory.dm +++ b/code/modules/mob/inventory.dm @@ -219,13 +219,13 @@ return FALSE if (merge_stacks) - if (istype(active_stack) && istype(I_stack, active_stack.merge_type)) + if (istype(active_stack) && active_stack.can_merge(I_stack)) if (I_stack.merge(active_stack)) to_chat(usr, "Your [active_stack.name] stack now contains [active_stack.get_amount()] [active_stack.singular_name]\s.") return TRUE else var/obj/item/stack/inactive_stack = get_inactive_held_item() - if (istype(inactive_stack) && istype(I_stack, inactive_stack.merge_type)) + if (istype(inactive_stack) && inactive_stack.can_merge(I_stack)) if (I_stack.merge(inactive_stack)) to_chat(usr, "Your [inactive_stack.name] stack now contains [inactive_stack.get_amount()] [inactive_stack.singular_name]\s.") return TRUE diff --git a/code/modules/plumbing/ducts.dm b/code/modules/plumbing/ducts.dm index d36d501a716..b4dbc523c94 100644 --- a/code/modules/plumbing/ducts.dm +++ b/code/modules/plumbing/ducts.dm @@ -390,7 +390,7 @@ All the important duct code: singular_name = "duct" icon = 'icons/obj/plumbing/fluid_ducts.dmi' icon_state = "ducts" - custom_materials = list(/datum/material/iron=500) + mats_per_unit = list(/datum/material/iron=500) w_class = WEIGHT_CLASS_TINY novariants = FALSE max_amount = 50 diff --git a/code/modules/power/cable.dm b/code/modules/power/cable.dm index f826ecfca33..6454792a44f 100644 --- a/code/modules/power/cable.dm +++ b/code/modules/power/cable.dm @@ -399,7 +399,7 @@ GLOBAL_LIST_INIT(wire_node_generating_types, typecacheof(list(/obj/structure/gri w_class = WEIGHT_CLASS_SMALL throw_speed = 3 throw_range = 5 - custom_materials = list(/datum/material/iron=10, /datum/material/glass=5) + mats_per_unit = list(/datum/material/iron=10, /datum/material/glass=5) flags_1 = CONDUCT_1 slot_flags = ITEM_SLOT_BELT attack_verb_continuous = list("whips", "lashes", "disciplines", "flogs") @@ -599,7 +599,7 @@ GLOBAL_LIST_INIT(wire_node_generating_types, typecacheof(list(/obj/structure/gri /obj/item/stack/cable_coil/cyborg is_cyborg = 1 - custom_materials = list() + mats_per_unit = null cost = 1 #undef CABLE_RESTRAINTS_COST diff --git a/code/modules/power/pipecleaners.dm b/code/modules/power/pipecleaners.dm index 37386750439..3dfd4b1c7ce 100644 --- a/code/modules/power/pipecleaners.dm +++ b/code/modules/power/pipecleaners.dm @@ -194,7 +194,7 @@ By design, d1 is the smallest direction and d2 is the highest w_class = WEIGHT_CLASS_SMALL throw_speed = 3 throw_range = 5 - custom_materials = list(/datum/material/iron=10, /datum/material/glass=5) + mats_per_unit = list(/datum/material/iron=10, /datum/material/glass=5) flags_1 = CONDUCT_1 slot_flags = ITEM_SLOT_BELT attack_verb_continuous = list("whips", "lashes", "disciplines", "flogs") @@ -208,7 +208,7 @@ By design, d1 is the smallest direction and d2 is the highest /obj/item/stack/pipe_cleaner_coil/cyborg is_cyborg = 1 - custom_materials = null + mats_per_unit = null cost = 1 /obj/item/stack/pipe_cleaner_coil/cyborg/attack_self(mob/user) diff --git a/code/modules/research/xenobiology/xenobiology.dm b/code/modules/research/xenobiology/xenobiology.dm index a7b6f8f8c50..9ef6e374f20 100644 --- a/code/modules/research/xenobiology/xenobiology.dm +++ b/code/modules/research/xenobiology/xenobiology.dm @@ -1037,7 +1037,7 @@ inhand_icon_state = "tile-bluespace" w_class = WEIGHT_CLASS_NORMAL force = 6 - custom_materials = list(/datum/material/iron=500) + mats_per_unit = list(/datum/material/iron=500) throwforce = 10 throw_speed = 3 throw_range = 7 @@ -1054,7 +1054,7 @@ inhand_icon_state = "tile-sepia" w_class = WEIGHT_CLASS_NORMAL force = 6 - custom_materials = list(/datum/material/iron=500) + mats_per_unit = list(/datum/material/iron=500) throwforce = 10 throw_speed = 0.1 throw_range = 28