diff --git a/code/game/mecha/equipment/tools/other_tools.dm b/code/game/mecha/equipment/tools/other_tools.dm index 0fa690f621a..2776c1ed465 100644 --- a/code/game/mecha/equipment/tools/other_tools.dm +++ b/code/game/mecha/equipment/tools/other_tools.dm @@ -399,7 +399,7 @@ /obj/item/mecha_parts/mecha_equipment/generator/get_equip_info() var/output = ..() if(output) - return "[output] \[[fuel]: [round(fuel.amount*fuel.mats_per_stack,0.1)] cm3\] - [equip_ready?"A":"Dea"]ctivate" + return "[output] \[[fuel]: [round(fuel.amount*MINERAL_MATERIAL_AMOUNT,0.1)] cm3\] - [equip_ready?"A":"Dea"]ctivate" /obj/item/mecha_parts/mecha_equipment/generator/action(target) if(chassis) @@ -409,9 +409,9 @@ /obj/item/mecha_parts/mecha_equipment/generator/proc/load_fuel(var/obj/item/stack/sheet/P) if(P.type == fuel.type && P.amount > 0) - var/to_load = max(max_fuel - fuel.amount*fuel.mats_per_stack,0) + var/to_load = max(max_fuel - fuel.amount*MINERAL_MATERIAL_AMOUNT,0) if(to_load) - var/units = min(max(round(to_load / P.mats_per_stack),1),P.amount) + var/units = min(max(round(to_load / MINERAL_MATERIAL_AMOUNT),1),P.amount) fuel.amount += units P.use(units) occupant_message("[units] unit\s of [fuel] successfully loaded.") @@ -447,7 +447,7 @@ if(cur_charge < chassis.cell.maxcharge) use_fuel = fuel_per_cycle_active chassis.give_power(power_per_cycle) - fuel.amount -= min(use_fuel/fuel.mats_per_stack,fuel.amount) + fuel.amount -= min(use_fuel/MINERAL_MATERIAL_AMOUNT,fuel.amount) update_equip_info() return 1 diff --git a/code/game/objects/items/stacks/rods.dm b/code/game/objects/items/stacks/rods.dm index 83ca21a1fc1..412f3cae5d8 100644 --- a/code/game/objects/items/stacks/rods.dm +++ b/code/game/objects/items/stacks/rods.dm @@ -18,7 +18,6 @@ GLOBAL_LIST_INIT(rod_recipes, list ( \ throw_speed = 3 throw_range = 7 custom_materials = list(/datum/material/iron=1000) - mats_per_stack = 1000 max_amount = 50 attack_verb = list("hit", "bludgeoned", "whacked") hitsound = 'sound/weapons/gun/general/grenade_launch.ogg' @@ -35,7 +34,7 @@ GLOBAL_LIST_INIT(rod_recipes, list ( \ /obj/item/stack/rods/get_main_recipes() . = ..() . += GLOB.rod_recipes - + /obj/item/stack/rods/update_icon() var/amount = get_amount() if((amount <= 5) && (amount > 0)) diff --git a/code/game/objects/items/stacks/sheets/glass.dm b/code/game/objects/items/stacks/sheets/glass.dm index 77bbcb3328e..3e1f2d53f1b 100644 --- a/code/game/objects/items/stacks/sheets/glass.dm +++ b/code/game/objects/items/stacks/sheets/glass.dm @@ -182,7 +182,7 @@ GLOBAL_LIST_INIT(prglass_recipes, list ( \ singular_name = "reinforced plasma glass sheet" icon_state = "sheet-prglass" item_state = "sheet-prglass" - custom_materials = list(/datum/material/plasma=MINERAL_MATERIAL_AMOUNT * 0.5, /datum/material/glass=MINERAL_MATERIAL_AMOUNT, /datum/material/iron = MINERAL_MATERIAL_AMOUNT * 0.5,) + custom_materials = list(/datum/material/plasma=MINERAL_MATERIAL_AMOUNT * 0.5, /datum/material/glass=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 diff --git a/code/game/objects/items/stacks/sheets/mineral.dm b/code/game/objects/items/stacks/sheets/mineral.dm index 14eb01d8f6d..b0aa251b032 100644 --- a/code/game/objects/items/stacks/sheets/mineral.dm +++ b/code/game/objects/items/stacks/sheets/mineral.dm @@ -247,7 +247,7 @@ GLOBAL_LIST_INIT(silver_recipes, list ( \ . = ..() . += GLOB.silver_recipes -/* +/* * Clown */ /obj/item/stack/sheet/mineral/bananium @@ -272,8 +272,8 @@ GLOBAL_LIST_INIT(bananium_recipes, list ( \ . = ..() . += GLOB.bananium_recipes -/* - * Titanium +/* + * Titanium */ /obj/item/stack/sheet/mineral/titanium name = "titanium" @@ -333,7 +333,7 @@ GLOBAL_LIST_INIT(plastitanium_recipes, list ( \ /* * Snow */ - + /obj/item/stack/sheet/mineral/snow name = "snow" icon_state = "sheet-snow" diff --git a/code/game/objects/items/stacks/sheets/sheet_types.dm b/code/game/objects/items/stacks/sheets/sheet_types.dm index da93366554d..6e014a5681e 100644 --- a/code/game/objects/items/stacks/sheets/sheet_types.dm +++ b/code/game/objects/items/stacks/sheets/sheet_types.dm @@ -156,7 +156,7 @@ GLOBAL_LIST_INIT(plasteel_recipes, list ( \ desc = "This sheet is an alloy of iron and plasma." icon_state = "sheet-plasteel" item_state = "sheet-metal" - custom_materials = list(/datum/material/iron=2000, /datum/material/plasma=2000) + custom_materials = list(/datum/material/iron=MINERAL_MATERIAL_AMOUNT, /datum/material/plasma=MINERAL_MATERIAL_AMOUNT) throwforce = 10 flags_1 = CONDUCT_1 armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 100, "acid" = 80) diff --git a/code/game/objects/items/stacks/sheets/sheets.dm b/code/game/objects/items/stacks/sheets/sheets.dm index ce901a75f93..466a9db7c5c 100644 --- a/code/game/objects/items/stacks/sheets/sheets.dm +++ b/code/game/objects/items/stacks/sheets/sheets.dm @@ -10,7 +10,6 @@ throw_range = 3 attack_verb = list("bashed", "battered", "bludgeoned", "thrashed", "smashed") novariants = FALSE - mats_per_stack = MINERAL_MATERIAL_AMOUNT var/sheettype = null //this is used for girders in the creation of walls/false walls var/point_value = 0 //turn-in value for the gulag stacker - loosely relative to its rarity. diff --git a/code/game/objects/items/stacks/stack.dm b/code/game/objects/items/stacks/stack.dm index 47ed13491e6..d5fb53209e6 100644 --- a/code/game/objects/items/stacks/stack.dm +++ b/code/game/objects/items/stacks/stack.dm @@ -24,7 +24,7 @@ var/merge_type = null // This path and its children should merge with this stack, defaults to src.type var/full_w_class = WEIGHT_CLASS_NORMAL //The weight class the stack should have at amount > 2/3rds max_amount var/novariants = TRUE //Determines whether the item should update it's sprites based on amount. - var/mats_per_stack = 0 + var/list/mats_per_unit //list that tells you how much is in a single unit. ///Datum material type that this stack is made of var/material_type //NOTE: When adding grind_results, the amounts should be for an INDIVIDUAL ITEM - these amounts will be multiplied by the stack size in on_grind() @@ -49,8 +49,11 @@ if(!merge_type) merge_type = type if(custom_materials && custom_materials.len) + mats_per_unit = list() + var/in_process_mat_list = custom_materials.Copy() for(var/i in custom_materials) - custom_materials[getmaterialref(i)] = mats_per_stack * amount + mats_per_unit[getmaterialref(i)] = in_process_mat_list[i] + custom_materials[i] *= amount . = ..() if(merge) for(var/obj/item/stack/S in loc) @@ -315,8 +318,8 @@ amount -= used if(check) zero_amount() - for(var/i in custom_materials) - custom_materials[i] = amount * mats_per_stack + for(var/i in mats_per_unit) + custom_materials[i] = amount * mats_per_unit[i] update_icon() update_weight() return TRUE @@ -348,9 +351,9 @@ source.add_charge(amount * cost) else src.amount += amount - if(custom_materials && custom_materials.len) - for(var/i in custom_materials) - custom_materials[getmaterialref(i)] = MINERAL_MATERIAL_AMOUNT * src.amount + if(mats_per_unit && mats_per_unit.len) + for(var/i in mats_per_unit) + custom_materials[i] = mats_per_unit[i] * src.amount set_custom_materials() //Refresh update_icon() update_weight() diff --git a/code/game/objects/items/stacks/tiles/tile_types.dm b/code/game/objects/items/stacks/tiles/tile_types.dm index 12cb7b90370..02f33ad99b6 100644 --- a/code/game/objects/items/stacks/tiles/tile_types.dm +++ b/code/game/objects/items/stacks/tiles/tile_types.dm @@ -11,7 +11,6 @@ throw_speed = 3 throw_range = 7 max_amount = 60 - mats_per_stack = 500 var/turf_type = null var/mineralType = null novariants = TRUE diff --git a/code/modules/mining/ores_coins.dm b/code/modules/mining/ores_coins.dm index f1dcd971382..7fbea8d0465 100644 --- a/code/modules/mining/ores_coins.dm +++ b/code/modules/mining/ores_coins.dm @@ -18,7 +18,6 @@ var/refined_type = null //What this ore defaults to being refined into var/mine_experience = 5 //How much experience do you get for mining this ore? novariants = TRUE // Ore stacks handle their icon updates themselves to keep the illusion that there's more going - mats_per_stack = MINERAL_MATERIAL_AMOUNT var/list/stack_overlays /obj/item/stack/ore/update_icon() diff --git a/code/modules/plumbing/ducts.dm b/code/modules/plumbing/ducts.dm index 52878362018..1bad3a86d72 100644 --- a/code/modules/plumbing/ducts.dm +++ b/code/modules/plumbing/ducts.dm @@ -363,7 +363,6 @@ All the important duct code: icon = 'icons/obj/plumbing/fluid_ducts.dmi' icon_state = "ducts" custom_materials = list(/datum/material/iron=500) - mats_per_stack = 500 w_class = WEIGHT_CLASS_TINY novariants = FALSE max_amount = 50