diff --git a/code/datums/components/explodable.dm b/code/datums/components/explodable.dm index 66bc308bbce..f30c2aa4f41 100644 --- a/code/datums/components/explodable.dm +++ b/code/datums/components/explodable.dm @@ -56,7 +56,7 @@ detonate() /datum/component/explodable/proc/on_equip(datum/source, mob/equipper, slot) - RegisterSignal(equipper, COMSIG_MOB_APPLY_DAMGE, .proc/explodable_attack_zone) + RegisterSignal(equipper, COMSIG_MOB_APPLY_DAMGE, .proc/explodable_attack_zone, TRUE) /datum/component/explodable/proc/on_drop(datum/source, mob/user) UnregisterSignal(user, COMSIG_MOB_APPLY_DAMGE) diff --git a/code/game/atoms.dm b/code/game/atoms.dm index 5422504e680..e31f347590d 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -1178,4 +1178,5 @@ if(!(material_flags & MATERIAL_NO_EFFECTS)) custom_material.on_applied(src, materials[custom_material] * multiplier * material_modifier, material_flags) - custom_materials[custom_material] += materials[custom_material] * multiplier + custom_materials[custom_material] += materials[x] * multiplier + diff --git a/code/game/mecha/equipment/tools/other_tools.dm b/code/game/mecha/equipment/tools/other_tools.dm index 12d62d54a78..9ad1e442a05 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.perunit,0.1)] cm3\] - [equip_ready?"A":"Dea"]ctivate" + return "[output] \[[fuel]: [round(fuel.amount*fuel.mats_per_stack,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.perunit,0) + var/to_load = max(max_fuel - fuel.amount*fuel.mats_per_stack,0) if(to_load) - var/units = min(max(round(to_load / P.perunit),1),P.amount) + var/units = min(max(round(to_load / P.mats_per_stack),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.perunit,fuel.amount) + fuel.amount -= min(use_fuel/fuel.mats_per_stack,fuel.amount) update_equip_info() return 1 diff --git a/code/game/objects/items/stacks/sheets/mineral.dm b/code/game/objects/items/stacks/sheets/mineral.dm index c7626bb077f..14eb01d8f6d 100644 --- a/code/game/objects/items/stacks/sheets/mineral.dm +++ b/code/game/objects/items/stacks/sheets/mineral.dm @@ -319,6 +319,7 @@ GLOBAL_LIST_INIT(titanium_recipes, list ( \ custom_materials = list(/datum/material/titanium=MINERAL_MATERIAL_AMOUNT, /datum/material/plasma=MINERAL_MATERIAL_AMOUNT) point_value = 45 merge_type = /obj/item/stack/sheet/mineral/plastitanium + material_flags = MATERIAL_NO_EFFECTS GLOBAL_LIST_INIT(plastitanium_recipes, list ( \ new/datum/stack_recipe("plastitanium tile", /obj/item/stack/tile/mineral/plastitanium, 1, 4, 20), \ diff --git a/code/game/objects/items/stacks/sheets/sheet_types.dm b/code/game/objects/items/stacks/sheets/sheet_types.dm index 4c1ddf5c442..f7e709ef6dd 100644 --- a/code/game/objects/items/stacks/sheets/sheet_types.dm +++ b/code/game/objects/items/stacks/sheets/sheet_types.dm @@ -169,6 +169,7 @@ GLOBAL_LIST_INIT(plasteel_recipes, list ( \ grind_results = list(/datum/reagent/iron = 20, /datum/reagent/toxin/plasma = 20) point_value = 23 tableVariant = /obj/structure/table/reinforced + material_flags = MATERIAL_NO_EFFECTS /obj/item/stack/sheet/plasteel/get_main_recipes() . = ..() diff --git a/code/game/objects/items/stacks/sheets/sheets.dm b/code/game/objects/items/stacks/sheets/sheets.dm index 6e7c29c210d..ce901a75f93 100644 --- a/code/game/objects/items/stacks/sheets/sheets.dm +++ b/code/game/objects/items/stacks/sheets/sheets.dm @@ -10,7 +10,7 @@ throw_range = 3 attack_verb = list("bashed", "battered", "bludgeoned", "thrashed", "smashed") novariants = FALSE - var/perunit = MINERAL_MATERIAL_AMOUNT + 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 bbad31be950..285647aaec7 100644 --- a/code/game/objects/items/stacks/stack.dm +++ b/code/game/objects/items/stacks/stack.dm @@ -24,6 +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 ///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,7 +50,7 @@ merge_type = type if(custom_materials && custom_materials.len) for(var/i in custom_materials) - custom_materials[getmaterialref(i)] = MINERAL_MATERIAL_AMOUNT * amount + custom_materials[getmaterialref(i)] = mats_per_stack * amount . = ..() if(merge) for(var/obj/item/stack/S in loc) @@ -228,7 +229,7 @@ if(R.applies_mats && custom_materials && custom_materials.len) var/list/used_materials = list() for(var/i in custom_materials) - used_materials[getmaterialref(i)] = R.req_amount * (MINERAL_MATERIAL_AMOUNT / custom_materials.len) + used_materials[getmaterialref(i)] = R.req_amount / R.res_amount * (MINERAL_MATERIAL_AMOUNT / custom_materials.len) O.set_custom_materials(used_materials) //START: oh fuck i'm so sorry diff --git a/code/game/objects/items/stacks/tiles/tile_mineral.dm b/code/game/objects/items/stacks/tiles/tile_mineral.dm index 9af095385b3..4cb4fbf865a 100644 --- a/code/game/objects/items/stacks/tiles/tile_mineral.dm +++ b/code/game/objects/items/stacks/tiles/tile_mineral.dm @@ -87,6 +87,7 @@ turf_type = /turf/open/floor/mineral/plastitanium mineralType = "plastitanium" custom_materials = list(/datum/material/titanium=250, /datum/material/plasma=250) + material_flags = MATERIAL_NO_EFFECTS /obj/item/stack/tile/mineral/snow name = "snow tile" diff --git a/code/game/objects/items/stacks/tiles/tile_types.dm b/code/game/objects/items/stacks/tiles/tile_types.dm index d9ebe6d3d7b..25e6547a269 100644 --- a/code/game/objects/items/stacks/tiles/tile_types.dm +++ b/code/game/objects/items/stacks/tiles/tile_types.dm @@ -11,6 +11,7 @@ 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/game/objects/structures/beds_chairs/chair.dm b/code/game/objects/structures/beds_chairs/chair.dm index 9a53035e0a4..d992629e953 100644 --- a/code/game/objects/structures/beds_chairs/chair.dm +++ b/code/game/objects/structures/beds_chairs/chair.dm @@ -54,8 +54,13 @@ /obj/structure/chair/deconstruct() // If we have materials, and don't have the NOCONSTRUCT flag - if(buildstacktype && (!(flags_1 & NODECONSTRUCT_1))) - new buildstacktype(loc,buildstackamount) + if(!(flags_1 & NODECONSTRUCT_1)) + if(buildstacktype) + new buildstacktype(loc,buildstackamount) + else + for(var/i in custom_materials) + var/datum/material/M = i + new M.sheet_type(loc, FLOOR(custom_materials[M] / MINERAL_MATERIAL_AMOUNT, 1)) ..() /obj/structure/chair/attack_paw(mob/user) @@ -126,7 +131,7 @@ /obj/structure/chair/greyscale material_flags = MATERIAL_ADD_PREFIX | MATERIAL_COLOR item_chair = /obj/item/chair/greyscale - + buildstacktype = null //Custom mats handle this /obj/structure/chair/wood icon_state = "wooden_chair" diff --git a/code/game/objects/structures/table_frames.dm b/code/game/objects/structures/table_frames.dm index 6a20246b54c..158a3931657 100644 --- a/code/game/objects/structures/table_frames.dm +++ b/code/game/objects/structures/table_frames.dm @@ -45,14 +45,14 @@ return to_chat(user, "You start adding [material] to [src]...") if(do_after(user, 20, target = src) && material.use(1)) - var/list/material_list + var/list/material_list = list() if(material.material_type) - material_list = list(material.material_type = MINERAL_MATERIAL_AMOUNT) + material_list[material.material_type] = MINERAL_MATERIAL_AMOUNT make_new_table(/obj/structure/table/greyscale, material_list) else return ..() -/obj/structure/table_frame/proc/make_new_table(table_type, list/custom_materials) //makes sure the new table made retains what we had as a frame +/obj/structure/table_frame/proc/make_new_table(table_type, custom_materials) //makes sure the new table made retains what we had as a frame var/obj/structure/table/T = new table_type(loc) T.frame = type T.framestack = framestack diff --git a/code/game/objects/structures/tables_racks.dm b/code/game/objects/structures/tables_racks.dm index 5927efc50eb..00bf210157e 100644 --- a/code/game/objects/structures/tables_racks.dm +++ b/code/game/objects/structures/tables_racks.dm @@ -194,7 +194,12 @@ /obj/structure/table/deconstruct(disassembled = TRUE, wrench_disassembly = 0) if(!(flags_1 & NODECONSTRUCT_1)) var/turf/T = get_turf(src) - new buildstack(T, buildstackamount) + if(buildstack) + new buildstack(T, buildstackamount) + else + for(var/i in custom_materials) + var/datum/material/M = i + new M.sheet_type(T, FLOOR(custom_materials[M] / MINERAL_MATERIAL_AMOUNT, 1)) if(!wrench_disassembly) new frame(T) else @@ -204,6 +209,7 @@ /obj/structure/table/greyscale material_flags = MATERIAL_ADD_PREFIX | MATERIAL_COLOR + buildstack = null //No buildstack, so generate from mat datums /*