diff --git a/code/datums/components/crafting/atmospheric.dm b/code/datums/components/crafting/atmospheric.dm index 6674ee1059a..7b11df7bbb4 100644 --- a/code/datums/components/crafting/atmospheric.dm +++ b/code/datums/components/crafting/atmospheric.dm @@ -38,7 +38,21 @@ ) blacklist = list(/obj/item/analyzer/ranged) -/datum/crafting_recipe/layer_adapter +///abstract path for pipe crafting recipes that set the pipe_type of their results and have other checks as well +/datum/crafting_recipe/spec_pipe + var/pipe_type + +/datum/crafting_recipe/spec_pipe/check_requirements(mob/user, list/collected_requirements) + return atmos_pipe_check(user, collected_requirements) + +/datum/crafting_recipe/spec_pipe/on_craft_completion(mob/user, atom/result) + var/obj/item/pipe/crafted_pipe = result + crafted_pipe.pipe_type = pipe_type + crafted_pipe.pipe_color = COLOR_VERY_LIGHT_GRAY + crafted_pipe.setDir(user.dir) + crafted_pipe.update() + +/datum/crafting_recipe/spec_pipe/layer_adapter name = "Layer manifold fitting" tool_behaviors = list(TOOL_WRENCH, TOOL_WELDER) result = /obj/item/pipe/binary/layer_adapter @@ -48,18 +62,9 @@ ) time = 1 SECONDS category = CAT_ATMOSPHERIC + pipe_type = /obj/machinery/atmospherics/pipe/layer_manifold -/datum/crafting_recipe/layer_adapter/check_requirements(mob/user, list/collected_requirements) - return atmos_pipe_check(user, collected_requirements) - -/datum/crafting_recipe/layer_adapter/on_craft_completion(mob/user, atom/result) - var/obj/item/pipe/crafted_pipe = result - crafted_pipe.pipe_type = /obj/machinery/atmospherics/pipe/layer_manifold - crafted_pipe.pipe_color = COLOR_VERY_LIGHT_GRAY - crafted_pipe.setDir(user.dir) - crafted_pipe.update() - -/datum/crafting_recipe/color_adapter +/datum/crafting_recipe/spec_pipe/color_adapter name = "Color adapter fitting" tool_behaviors = list(TOOL_WRENCH, TOOL_WELDER) result = /obj/item/pipe/binary/color_adapter @@ -69,18 +74,9 @@ ) time = 1 SECONDS category = CAT_ATMOSPHERIC + pipe_type = /obj/machinery/atmospherics/pipe/color_adapter -/datum/crafting_recipe/color_adapter/check_requirements(mob/user, list/collected_requirements) - return atmos_pipe_check(user, collected_requirements) - -/datum/crafting_recipe/color_adapter/on_craft_completion(mob/user, atom/result) - var/obj/item/pipe/crafted_pipe = result - crafted_pipe.pipe_type = /obj/machinery/atmospherics/pipe/color_adapter - crafted_pipe.pipe_color = COLOR_VERY_LIGHT_GRAY - crafted_pipe.setDir(user.dir) - crafted_pipe.update() - -/datum/crafting_recipe/he_pipe +/datum/crafting_recipe/spec_pipe/he_pipe name = "H/E pipe fitting" tool_behaviors = list(TOOL_WRENCH, TOOL_WELDER) result = /obj/item/pipe/quaternary/he_pipe @@ -90,18 +86,9 @@ ) time = 1 SECONDS category = CAT_ATMOSPHERIC + pipe_type = /obj/machinery/atmospherics/pipe/heat_exchanging/manifold4w -/datum/crafting_recipe/he_pipe/check_requirements(mob/user, list/collected_requirements) - return atmos_pipe_check(user, collected_requirements) - -/datum/crafting_recipe/he_pipe/on_craft_completion(mob/user, atom/result) - var/obj/item/pipe/crafted_pipe = result - crafted_pipe.pipe_type = /obj/machinery/atmospherics/pipe/heat_exchanging/manifold4w - crafted_pipe.pipe_color = COLOR_VERY_LIGHT_GRAY - crafted_pipe.setDir(user.dir) - crafted_pipe.update() - -/datum/crafting_recipe/he_junction +/datum/crafting_recipe/spec_pipe/he_junction name = "H/E junction fitting" tool_behaviors = list(TOOL_WRENCH, TOOL_WELDER) result = /obj/item/pipe/directional/he_junction @@ -111,18 +98,9 @@ ) time = 1 SECONDS category = CAT_ATMOSPHERIC + pipe_type = /obj/machinery/atmospherics/pipe/heat_exchanging/junction -/datum/crafting_recipe/he_junction/check_requirements(mob/user, list/collected_requirements) - return atmos_pipe_check(user, collected_requirements) - -/datum/crafting_recipe/he_junction/on_craft_completion(mob/user, atom/result) - var/obj/item/pipe/crafted_pipe = result - crafted_pipe.pipe_type = /obj/machinery/atmospherics/pipe/heat_exchanging/junction - crafted_pipe.pipe_color = COLOR_VERY_LIGHT_GRAY - crafted_pipe.setDir(user.dir) - crafted_pipe.update() - -/datum/crafting_recipe/pressure_pump +/datum/crafting_recipe/spec_pipe/pressure_pump name = "Pressure pump fitting" tool_behaviors = list(TOOL_WRENCH, TOOL_WELDER) result = /obj/item/pipe/binary/pressure_pump @@ -133,18 +111,9 @@ ) time = 2 SECONDS category = CAT_ATMOSPHERIC + pipe_type = /obj/machinery/atmospherics/components/binary/pump -/datum/crafting_recipe/pressure_pump/check_requirements(mob/user, list/collected_requirements) - return atmos_pipe_check(user, collected_requirements) - -/datum/crafting_recipe/pressure_pump/on_craft_completion(mob/user, atom/result) - var/obj/item/pipe/crafted_pipe = result - crafted_pipe.pipe_type = /obj/machinery/atmospherics/components/binary/pump - crafted_pipe.pipe_color = COLOR_VERY_LIGHT_GRAY - crafted_pipe.setDir(user.dir) - crafted_pipe.update() - -/datum/crafting_recipe/manual_valve +/datum/crafting_recipe/spec_pipe/manual_valve name = "Manual valve fitting" tool_behaviors = list(TOOL_WRENCH, TOOL_WELDER) result = /obj/item/pipe/binary/manual_valve @@ -154,18 +123,9 @@ ) time = 2 SECONDS category = CAT_ATMOSPHERIC + pipe_type = /obj/machinery/atmospherics/components/binary/valve -/datum/crafting_recipe/manual_valve/check_requirements(mob/user, list/collected_requirements) - return atmos_pipe_check(user, collected_requirements) - -/datum/crafting_recipe/manual_valve/on_craft_completion(mob/user, atom/result) - var/obj/item/pipe/crafted_pipe = result - crafted_pipe.pipe_type = /obj/machinery/atmospherics/components/binary/valve - crafted_pipe.pipe_color = COLOR_VERY_LIGHT_GRAY - crafted_pipe.setDir(user.dir) - crafted_pipe.update() - -/datum/crafting_recipe/vent +/datum/crafting_recipe/spec_pipe/vent name = "Vent pump fitting" tool_behaviors = list(TOOL_WRENCH, TOOL_WELDER) result = /obj/item/pipe/directional/vent @@ -176,18 +136,9 @@ ) time = 2 SECONDS category = CAT_ATMOSPHERIC + pipe_type = /obj/machinery/atmospherics/components/unary/vent_pump -/datum/crafting_recipe/vent/check_requirements(mob/user, list/collected_requirements) - return atmos_pipe_check(user, collected_requirements) - -/datum/crafting_recipe/vent/on_craft_completion(mob/user, atom/result) - var/obj/item/pipe/crafted_pipe = result - crafted_pipe.pipe_type = /obj/machinery/atmospherics/components/unary/vent_pump - crafted_pipe.pipe_color = COLOR_VERY_LIGHT_GRAY - crafted_pipe.setDir(user.dir) - crafted_pipe.update() - -/datum/crafting_recipe/scrubber +/datum/crafting_recipe/spec_pipe/scrubber name = "Scrubber fitting" tool_behaviors = list(TOOL_WRENCH, TOOL_WELDER) result = /obj/item/pipe/directional/scrubber @@ -198,18 +149,9 @@ ) time = 2 SECONDS category = CAT_ATMOSPHERIC + pipe_type = /obj/machinery/atmospherics/components/unary/vent_scrubber -/datum/crafting_recipe/scrubber/check_requirements(mob/user, list/collected_requirements) - return atmos_pipe_check(user, collected_requirements) - -/datum/crafting_recipe/scrubber/on_craft_completion(mob/user, atom/result) - var/obj/item/pipe/crafted_pipe = result - crafted_pipe.pipe_type = /obj/machinery/atmospherics/components/unary/vent_scrubber - crafted_pipe.pipe_color = COLOR_VERY_LIGHT_GRAY - crafted_pipe.setDir(user.dir) - crafted_pipe.update() - -/datum/crafting_recipe/filter +/datum/crafting_recipe/spec_pipe/filter name = "Filter fitting" tool_behaviors = list(TOOL_WRENCH, TOOL_WELDER) result = /obj/item/pipe/trinary/flippable/filter @@ -220,18 +162,9 @@ ) time = 2 SECONDS category = CAT_ATMOSPHERIC + pipe_type = /obj/machinery/atmospherics/components/trinary/filter -/datum/crafting_recipe/filter/check_requirements(mob/user, list/collected_requirements) - return atmos_pipe_check(user, collected_requirements) - -/datum/crafting_recipe/filter/on_craft_completion(mob/user, atom/result) - var/obj/item/pipe/crafted_pipe = result - crafted_pipe.pipe_type = /obj/machinery/atmospherics/components/trinary/filter - crafted_pipe.pipe_color = COLOR_VERY_LIGHT_GRAY - crafted_pipe.setDir(user.dir) - crafted_pipe.update() - -/datum/crafting_recipe/mixer +/datum/crafting_recipe/spec_pipe/mixer name = "Mixer fitting" tool_behaviors = list(TOOL_WRENCH, TOOL_WELDER) result = /obj/item/pipe/trinary/flippable/mixer @@ -242,18 +175,9 @@ ) time = 2 SECONDS category = CAT_ATMOSPHERIC + pipe_type = /obj/machinery/atmospherics/components/trinary/mixer -/datum/crafting_recipe/mixer/check_requirements(mob/user, list/collected_requirements) - return atmos_pipe_check(user, collected_requirements) - -/datum/crafting_recipe/mixer/on_craft_completion(mob/user, atom/result) - var/obj/item/pipe/crafted_pipe = result - crafted_pipe.pipe_type = /obj/machinery/atmospherics/components/trinary/mixer - crafted_pipe.pipe_color = COLOR_VERY_LIGHT_GRAY - crafted_pipe.setDir(user.dir) - crafted_pipe.update() - -/datum/crafting_recipe/connector +/datum/crafting_recipe/spec_pipe/connector name = "Portable connector fitting" tool_behaviors = list(TOOL_WRENCH, TOOL_WELDER) result = /obj/item/pipe/directional/connector @@ -263,18 +187,9 @@ ) time = 2 SECONDS category = CAT_ATMOSPHERIC + pipe_type = /obj/machinery/atmospherics/components/unary/portables_connector -/datum/crafting_recipe/connector/check_requirements(mob/user, list/collected_requirements) - return atmos_pipe_check(user, collected_requirements) - -/datum/crafting_recipe/connector/on_craft_completion(mob/user, atom/result) - var/obj/item/pipe/crafted_pipe = result - crafted_pipe.pipe_type = /obj/machinery/atmospherics/components/unary/portables_connector - crafted_pipe.pipe_color = COLOR_VERY_LIGHT_GRAY - crafted_pipe.setDir(user.dir) - crafted_pipe.update() - -/datum/crafting_recipe/passive_vent +/datum/crafting_recipe/spec_pipe/passive_vent name = "Passive vent fitting" tool_behaviors = list(TOOL_WRENCH, TOOL_WELDER) result = /obj/item/pipe/directional/passive_vent @@ -284,18 +199,9 @@ ) time = 2 SECONDS category = CAT_ATMOSPHERIC + pipe_type = /obj/machinery/atmospherics/components/unary/passive_vent -/datum/crafting_recipe/passive_vent/check_requirements(mob/user, list/collected_requirements) - return atmos_pipe_check(user, collected_requirements) - -/datum/crafting_recipe/passive_vent/on_craft_completion(mob/user, atom/result) - var/obj/item/pipe/crafted_pipe = result - crafted_pipe.pipe_type = /obj/machinery/atmospherics/components/unary/passive_vent - crafted_pipe.pipe_color = COLOR_VERY_LIGHT_GRAY - crafted_pipe.setDir(user.dir) - crafted_pipe.update() - -/datum/crafting_recipe/injector +/datum/crafting_recipe/spec_pipe/injector name = "Outlet injector fitting" tool_behaviors = list(TOOL_WRENCH, TOOL_WELDER) result = /obj/item/pipe/directional/injector @@ -306,18 +212,9 @@ ) time = 2 SECONDS category = CAT_ATMOSPHERIC + pipe_type = /obj/machinery/atmospherics/components/unary/outlet_injector -/datum/crafting_recipe/injector/check_requirements(mob/user, list/collected_requirements) - return atmos_pipe_check(user, collected_requirements) - -/datum/crafting_recipe/injector/on_craft_completion(mob/user, atom/result) - var/obj/item/pipe/crafted_pipe = result - crafted_pipe.pipe_type = /obj/machinery/atmospherics/components/unary/outlet_injector - crafted_pipe.pipe_color = COLOR_VERY_LIGHT_GRAY - crafted_pipe.setDir(user.dir) - crafted_pipe.update() - -/datum/crafting_recipe/he_exchanger +/datum/crafting_recipe/spec_pipe/he_exchanger name = "Heat exchanger fitting" tool_behaviors = list(TOOL_WRENCH, TOOL_WELDER) result = /obj/item/pipe/directional/he_exchanger @@ -327,16 +224,7 @@ ) time = 2 SECONDS category = CAT_ATMOSPHERIC - -/datum/crafting_recipe/he_exchanger/check_requirements(mob/user, list/collected_requirements) - return atmos_pipe_check(user, collected_requirements) - -/datum/crafting_recipe/he_exchanger/on_craft_completion(mob/user, atom/result) - var/obj/item/pipe/crafted_pipe = result - crafted_pipe.pipe_type = /obj/machinery/atmospherics/components/unary/heat_exchanger - crafted_pipe.pipe_color = COLOR_VERY_LIGHT_GRAY - crafted_pipe.setDir(user.dir) - crafted_pipe.update() + pipe_type = /obj/machinery/atmospherics/components/unary/heat_exchanger /datum/crafting_recipe/steam_vent name = "Steam Vent" @@ -360,7 +248,7 @@ ) category = CAT_STRUCTURE -/datum/crafting_recipe/airlock_pump +/datum/crafting_recipe/spec_pipe/airlock_pump name = "External Airlock Pump" tool_behaviors = list(TOOL_WRENCH, TOOL_WELDER) result = /obj/item/pipe/directional/airlock_pump @@ -372,13 +260,4 @@ ) time = 2 SECONDS category = CAT_ATMOSPHERIC - -/datum/crafting_recipe/airlock_pump/check_requirements(mob/user, list/collected_requirements) - return atmos_pipe_check(user, collected_requirements) - -/datum/crafting_recipe/airlock_pump/on_craft_completion(mob/user, atom/result) - var/obj/item/pipe/crafted_pipe = result - crafted_pipe.pipe_type = /obj/machinery/atmospherics/components/unary/airlock_pump - crafted_pipe.pipe_color = COLOR_VERY_LIGHT_GRAY - crafted_pipe.setDir(user.dir) - crafted_pipe.update() + pipe_type = /obj/machinery/atmospherics/components/unary/airlock_pump