From 2bdec078d7d9ba35bc7ababb58adc9ff14ba468b Mon Sep 17 00:00:00 2001 From: SandPoot <43283559+SandPoot@users.noreply.github.com> Date: Tue, 21 Feb 2023 16:42:57 -0300 Subject: [PATCH] Merge pull request #311 from Sandstorm-Station/duct-piping Several duct pipe fixes/qol --- .../items/stacks/sheets/sheet_types.dm | 2 +- code/game/objects/items/stacks/stack.dm | 41 ----------- .../game/objects/items/stacks/stack_recipe.dm | 69 +++++++++++++++++++ code/modules/plumbing/ducts.dm | 2 +- .../modules/research/machinery/_production.dm | 2 +- tgstation.dme | 1 + 6 files changed, 73 insertions(+), 44 deletions(-) create mode 100644 code/game/objects/items/stacks/stack_recipe.dm diff --git a/code/game/objects/items/stacks/sheets/sheet_types.dm b/code/game/objects/items/stacks/sheets/sheet_types.dm index 5dbdddb540..572ce58c74 100644 --- a/code/game/objects/items/stacks/sheets/sheet_types.dm +++ b/code/game/objects/items/stacks/sheets/sheet_types.dm @@ -798,7 +798,7 @@ GLOBAL_LIST_INIT(plastic_recipes, list( new /datum/stack_recipe("water bottle", /obj/item/reagent_containers/glass/beaker/waterbottle/empty), \ new /datum/stack_recipe("large water bottle", /obj/item/reagent_containers/glass/beaker/waterbottle/large/empty,3), \ new /datum/stack_recipe("shower curtain", /obj/structure/curtain, 10, time = 10, one_per_turf = 1, on_floor = 1), \ - new /datum/stack_recipe("duct", /obj/item/stack/ducts,1), \ + new /datum/stack_recipe("duct", /obj/item/stack/ducts, 1, 5, 50), \ new /datum/stack_recipe("laser pointer case", /obj/item/glasswork/glass_base/laserpointer_shell, 30), \ new /datum/stack_recipe("wet floor sign", /obj/item/clothing/suit/caution, 2))) diff --git a/code/game/objects/items/stacks/stack.dm b/code/game/objects/items/stacks/stack.dm index 266d8b7b86..b2cd0f481b 100644 --- a/code/game/objects/items/stacks/stack.dm +++ b/code/game/objects/items/stacks/stack.dm @@ -514,44 +514,3 @@ /obj/item/stack/microwave_act(obj/machinery/microwave/M) if(istype(M) && M.dirty < 100) M.dirty += amount - -/* - * Recipe datum - */ -/datum/stack_recipe - var/title = "ERROR" - var/result_type - var/req_amount = 1 - var/res_amount = 1 - var/max_res_amount = 1 - var/time = 0 - var/one_per_turf = FALSE - var/on_floor = FALSE - var/placement_checks = FALSE - var/applies_mats = FALSE - var/trait_booster = null - var/trait_modifier = 1 - -/datum/stack_recipe/New(title, result_type, req_amount = 1, res_amount = 1, max_res_amount = 1,time = 0, one_per_turf = FALSE, on_floor = FALSE, window_checks = FALSE, placement_checks = FALSE, applies_mats = FALSE, trait_booster = null, trait_modifier = 1) - src.title = title - src.result_type = result_type - src.req_amount = req_amount - src.res_amount = res_amount - src.max_res_amount = max_res_amount - src.time = time - src.one_per_turf = one_per_turf - src.on_floor = on_floor - src.placement_checks = placement_checks - src.applies_mats = applies_mats - src.trait_booster = trait_booster - src.trait_modifier = trait_modifier -/* - * Recipe list datum - */ -/datum/stack_recipe_list - var/title = "ERROR" - var/list/recipes - -/datum/stack_recipe_list/New(title, recipes) - src.title = title - src.recipes = recipes diff --git a/code/game/objects/items/stacks/stack_recipe.dm b/code/game/objects/items/stacks/stack_recipe.dm new file mode 100644 index 0000000000..b8cbfe3b61 --- /dev/null +++ b/code/game/objects/items/stacks/stack_recipe.dm @@ -0,0 +1,69 @@ + +/* + * Recipe datum + */ +/datum/stack_recipe + /// The title of the recipe + var/title = "ERROR" + /// What atom the recipe makes, typepath + var/atom/result_type + /// Amount of stack required to make + var/req_amount = 1 + /// Amount of resulting atoms made + var/res_amount = 1 + /// Max amount of resulting atoms made + var/max_res_amount = 1 + /// How long it takes to make + var/time = 0 + /// If only one of the resulting atom is allowed per turf + var/one_per_turf = FALSE + /// If the atom requires a floor below + var/on_floor = FALSE + /// Bitflag of additional placement checks required to place. (STACK_CHECK_CARDINALS|STACK_CHECK_ADJACENT) + var/placement_checks = NONE + /// If TRUE, the created atom will gain custom mat datums + var/applies_mats = FALSE + /// What trait, if any, boosts the construction speed of this item + var/trait_booster + /// How much the trait above, if supplied, boosts the construct speed of this item + var/trait_modifier = 1 + +/datum/stack_recipe/New( + title, + result_type, + req_amount = 1, + res_amount = 1, + max_res_amount = 1, + time = 0, + one_per_turf = FALSE, + on_floor = FALSE, + window_checks = FALSE, + placement_checks = NONE, + applies_mats = FALSE, + trait_booster, + trait_modifier = 1, +) + + src.title = title + src.result_type = result_type + src.req_amount = req_amount + src.res_amount = res_amount + src.max_res_amount = max_res_amount + src.time = time + src.one_per_turf = one_per_turf + src.on_floor = on_floor + src.placement_checks = placement_checks + src.applies_mats = applies_mats + src.trait_booster = trait_booster + src.trait_modifier = trait_modifier + +/* + * Recipe list datum + */ +/datum/stack_recipe_list + var/title = "ERROR" + var/list/recipes + +/datum/stack_recipe_list/New(title, recipes) + src.title = title + src.recipes = recipes diff --git a/code/modules/plumbing/ducts.dm b/code/modules/plumbing/ducts.dm index 8a27f2669c..59816544ab 100644 --- a/code/modules/plumbing/ducts.dm +++ b/code/modules/plumbing/ducts.dm @@ -388,7 +388,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) + custom_materials = list(/datum/material/plastic = 400) w_class = WEIGHT_CLASS_TINY novariants = FALSE max_amount = 50 diff --git a/code/modules/research/machinery/_production.dm b/code/modules/research/machinery/_production.dm index 7862f24715..30d0c70566 100644 --- a/code/modules/research/machinery/_production.dm +++ b/code/modules/research/machinery/_production.dm @@ -120,7 +120,7 @@ return round(A / max(1, all_materials[mat] * ef)) /obj/machinery/rnd/production/proc/efficient_with(path) - return !ispath(path, /obj/item/stack/sheet) && !ispath(path, /obj/item/stack/ore/bluespace_crystal) + return !ispath(path, /obj/item/stack/sheet) && !ispath(path, /obj/item/stack/ore/bluespace_crystal) && !ispath(path, /obj/item/stack/ducts) /obj/machinery/rnd/production/proc/user_try_print_id(id, amount) if((!istype(linked_console) && requires_console) || !id) diff --git a/tgstation.dme b/tgstation.dme index 5949ee79a7..0c11dca769 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -1283,6 +1283,7 @@ #include "code\game\objects\items\stacks\medical.dm" #include "code\game\objects\items\stacks\rods.dm" #include "code\game\objects\items\stacks\stack.dm" +#include "code\game\objects\items\stacks\stack_recipe.dm" #include "code\game\objects\items\stacks\tape.dm" #include "code\game\objects\items\stacks\telecrystal.dm" #include "code\game\objects\items\stacks\tickets.dm"