diff --git a/code/datums/components/crafting/guncrafting.dm b/code/datums/components/crafting/guncrafting.dm index 610df6178b5..1bd0b0b2419 100644 --- a/code/datums/components/crafting/guncrafting.dm +++ b/code/datums/components/crafting/guncrafting.dm @@ -18,8 +18,8 @@ /obj/item/weaponcrafting/receiver/create_slapcraft_component() var/static/list/slapcraft_recipe_list = list(/datum/crafting_recipe/pipegun) - AddComponent( - /datum/component/slapcrafting,\ + AddElement( + /datum/element/slapcrafting,\ slapcraft_recipes = slapcraft_recipe_list,\ ) @@ -34,8 +34,8 @@ /obj/item/weaponcrafting/stock/create_slapcraft_component() var/static/list/slapcraft_recipe_list = list(/datum/crafting_recipe/smoothbore_disabler, /datum/crafting_recipe/laser_musket) - AddComponent( - /datum/component/slapcrafting,\ + AddElement( + /datum/element/slapcrafting,\ slapcraft_recipes = slapcraft_recipe_list,\ ) @@ -48,8 +48,8 @@ /obj/item/weaponcrafting/giant_wrench/create_slapcraft_component() // slappycraft var/static/list/slapcraft_recipe_list = list(/datum/crafting_recipe/giant_wrench) - AddComponent( - /datum/component/slapcrafting,\ + AddElement( + /datum/element/slapcrafting,\ slapcraft_recipes = slapcraft_recipe_list,\ ) diff --git a/code/datums/components/crafting/slapcrafting.dm b/code/datums/elements/slapcrafting.dm similarity index 77% rename from code/datums/components/crafting/slapcrafting.dm rename to code/datums/elements/slapcrafting.dm index a15a8a80b17..42776bf31f7 100644 --- a/code/datums/components/crafting/slapcrafting.dm +++ b/code/datums/elements/slapcrafting.dm @@ -1,10 +1,11 @@ /// Slapcrafting component! -/datum/component/slapcrafting - dupe_mode = COMPONENT_DUPE_UNIQUE_PASSARGS +/datum/element/slapcrafting + element_flags = ELEMENT_BESPOKE + argument_hash_start_idx = 2 var/list/slapcraft_recipes = list() /** - * Slapcraft component + * Slapcraft element * * Slap it onto a item to be able to slapcraft with it * @@ -14,35 +15,28 @@ * It will check the area near the user for the rest of the ingredients and tools. * * **/ -/datum/component/slapcrafting/Initialize( - slapcraft_recipes = null, - ) +/datum/element/slapcrafting/Attach(datum/target, slapcraft_recipes = null) + ..() + if(!isitem(target)) + return ELEMENT_INCOMPATIBLE - if(!isitem(parent)) - return COMPONENT_INCOMPATIBLE + var/obj/item/target_item = target - var/obj/item/parent_item = parent + if((target_item.item_flags & ABSTRACT) || (target_item.item_flags & DROPDEL)) + return //Don't do anything, it just shouldn't be used in crafting. - if((parent_item.item_flags & ABSTRACT) || (parent_item.item_flags & DROPDEL)) - return COMPONENT_NOTRANSFER + RegisterSignal(target, COMSIG_ATOM_ATTACKBY, PROC_REF(attempt_slapcraft)) + RegisterSignal(target, COMSIG_ATOM_EXAMINE, PROC_REF(get_examine_info)) + RegisterSignal(target, COMSIG_ATOM_EXAMINE_MORE, PROC_REF(get_examine_more_info)) + RegisterSignal(target, COMSIG_TOPIC, PROC_REF(topic_handler)) - RegisterSignal(parent, COMSIG_ATOM_ATTACKBY, PROC_REF(attempt_slapcraft)) - RegisterSignal(parent, COMSIG_ATOM_EXAMINE, PROC_REF(get_examine_info)) - RegisterSignal(parent, COMSIG_ATOM_EXAMINE_MORE, PROC_REF(get_examine_more_info)) - RegisterSignal(parent, COMSIG_TOPIC, PROC_REF(topic_handler)) + src.slapcraft_recipes = slapcraft_recipes - src.slapcraft_recipes += slapcraft_recipes +/datum/element/slapcrafting/Detach(datum/source, ...) + . = ..() + UnregisterSignal(source, list(COMSIG_ATOM_ATTACKBY, COMSIG_ATOM_EXAMINE, COMSIG_ATOM_EXAMINE_MORE)) -/datum/component/slapcrafting/InheritComponent(datum/component/slapcrafting/new_comp, original, slapcraft_recipes) - if(!original) - return - src.slapcraft_recipes += slapcraft_recipes - -/datum/component/slapcrafting/Destroy(force) - UnregisterSignal(parent, list(COMSIG_ATOM_ATTACKBY, COMSIG_ATOM_EXAMINE, COMSIG_ATOM_EXAMINE_MORE)) - return ..() - -/datum/component/slapcrafting/proc/attempt_slapcraft(obj/item/parent_item, obj/item/slapper, mob/user) +/datum/element/slapcrafting/proc/attempt_slapcraft(obj/item/parent_item, obj/item/slapper, mob/user) if(isnull(slapcraft_recipes)) CRASH("NULL SLAPCRAFT RECIPES?") @@ -71,9 +65,9 @@ return // We might use radials so we need to split the proc chain - INVOKE_ASYNC(src, PROC_REF(slapcraft_async), valid_recipes, user, craft_sheet) + INVOKE_ASYNC(src, PROC_REF(slapcraft_async), parent_item, valid_recipes, user, craft_sheet) -/datum/component/slapcrafting/proc/slapcraft_async(list/valid_recipes, mob/user, datum/component/personal_crafting/craft_sheet) +/datum/element/slapcrafting/proc/slapcraft_async(obj/parent_item, list/valid_recipes, mob/user, datum/component/personal_crafting/craft_sheet) var/list/recipe_choices = list() @@ -90,7 +84,7 @@ if(!recipe_choices) CRASH("No recipe choices despite validating in earlier proc") - string_chosen_recipe = show_radial_menu(user, parent, recipe_choices, require_near = TRUE) + string_chosen_recipe = show_radial_menu(user, parent_item, recipe_choices, require_near = TRUE) if(isnull(string_chosen_recipe)) return // they closed the thing @@ -118,7 +112,7 @@ to_chat(user, span_warning("crafting failed" + error_string)) /// Alerts any examiners to the recipe, if they wish to know more. -/datum/component/slapcrafting/proc/get_examine_info(atom/source, mob/user, list/examine_list) +/datum/element/slapcrafting/proc/get_examine_info(atom/source, mob/user, list/examine_list) SIGNAL_HANDLER var/list/string_results = list() @@ -132,17 +126,17 @@ already_used_names += initial(result.name) string_results += list("\a [initial(result.name)]") - examine_list += span_notice("You think [parent] could be used to make [english_list(string_results)]! Examine again to look at the details...") + examine_list += span_notice("You think [source] could be used to make [english_list(string_results)]! Examine again to look at the details...") /// Alerts any examiners to the details of the recipe. -/datum/component/slapcrafting/proc/get_examine_more_info(atom/source, mob/user, list/examine_list) +/datum/element/slapcrafting/proc/get_examine_more_info(atom/source, mob/user, list/examine_list) SIGNAL_HANDLER for(var/datum/crafting_recipe/recipe as anything in slapcraft_recipes) var/atom/result = initial(recipe.result) examine_list += "See Recipe For [initial(result.name)]" -/datum/component/slapcrafting/proc/topic_handler(atom/source, user, href_list) +/datum/element/slapcrafting/proc/topic_handler(atom/source, user, href_list) SIGNAL_HANDLER if(!href_list["check_recipe"]) @@ -176,7 +170,7 @@ var/amount = initial(cur_recipe.reqs[ingredient]) // If we're about to describe the ingredient that the component is based on, lower the described amount by 1 or remove it outright. - if(parent.type == valid_type) + if(source.type == valid_type) if(amount > 1) amount-- else diff --git a/code/game/machinery/pipe/construction.dm b/code/game/machinery/pipe/construction.dm index 9e926d9a841..929383b178c 100644 --- a/code/game/machinery/pipe/construction.dm +++ b/code/game/machinery/pipe/construction.dm @@ -120,8 +120,8 @@ Buildable meters return ..() var/static/list/slapcraft_recipe_list = list(/datum/crafting_recipe/ghettojetpack, /datum/crafting_recipe/pipegun, /datum/crafting_recipe/smoothbore_disabler, /datum/crafting_recipe/improvised_pneumatic_cannon) - AddComponent( - /datum/component/slapcrafting,\ + AddElement( + /datum/element/slapcrafting,\ slapcraft_recipes = slapcraft_recipe_list,\ ) diff --git a/code/game/objects/items/crayons.dm b/code/game/objects/items/crayons.dm index f50909eee12..9bc86d0c7f9 100644 --- a/code/game/objects/items/crayons.dm +++ b/code/game/objects/items/crayons.dm @@ -763,8 +763,8 @@ . = ..() var/static/list/slapcraft_recipe_list = list(/datum/crafting_recipe/improvised_coolant) - AddComponent( - /datum/component/slapcrafting,\ + AddElement( + /datum/element/slapcrafting,\ slapcraft_recipes = slapcraft_recipe_list,\ ) register_context() diff --git a/code/game/objects/items/devices/flashlight.dm b/code/game/objects/items/devices/flashlight.dm index 05c8ec9a263..e684c1b4959 100644 --- a/code/game/objects/items/devices/flashlight.dm +++ b/code/game/objects/items/devices/flashlight.dm @@ -46,8 +46,8 @@ var/static/list/slapcraft_recipe_list = list(/datum/crafting_recipe/flashlight_eyes) - AddComponent( - /datum/component/slapcrafting,\ + AddElement( + /datum/element/slapcrafting,\ slapcraft_recipes = slapcraft_recipe_list,\ ) diff --git a/code/game/objects/items/devices/radio/radio.dm b/code/game/objects/items/devices/radio/radio.dm index ced454c3d32..912e1d66b09 100644 --- a/code/game/objects/items/devices/radio/radio.dm +++ b/code/game/objects/items/devices/radio/radio.dm @@ -116,9 +116,7 @@ // No subtypes if(type != /obj/item/radio) return - AddComponent(/datum/component/slapcrafting,\ - slapcraft_recipes = list(/datum/crafting_recipe/improv_explosive)\ - ) + AddElement(/datum/element/slapcrafting, string_list(list(/datum/crafting_recipe/improv_explosive))) RegisterSignal(src, COMSIG_HIT_BY_SABOTEUR, PROC_REF(on_saboteur)) diff --git a/code/game/objects/items/devices/scanners/gas_analyzer.dm b/code/game/objects/items/devices/scanners/gas_analyzer.dm index b1110e389a1..f5fe29f9ed5 100644 --- a/code/game/objects/items/devices/scanners/gas_analyzer.dm +++ b/code/game/objects/items/devices/scanners/gas_analyzer.dm @@ -37,8 +37,8 @@ return var/static/list/slapcraft_recipe_list = list(/datum/crafting_recipe/material_sniffer) - AddComponent( - /datum/component/slapcrafting,\ + AddElement( + /datum/element/slapcrafting,\ slapcraft_recipes = slapcraft_recipe_list,\ ) diff --git a/code/game/objects/items/extinguisher.dm b/code/game/objects/items/extinguisher.dm index 1e879d4422c..764e2fc6173 100644 --- a/code/game/objects/items/extinguisher.dm +++ b/code/game/objects/items/extinguisher.dm @@ -52,8 +52,8 @@ . = ..() var/static/list/slapcraft_recipe_list = list(/datum/crafting_recipe/ghettojetpack) - AddComponent( - /datum/component/slapcrafting,\ + AddElement( + /datum/element/slapcrafting,\ slapcraft_recipes = slapcraft_recipe_list,\ ) diff --git a/code/game/objects/items/flamethrower.dm b/code/game/objects/items/flamethrower.dm index e2d587cd359..ad03fe9ab4f 100644 --- a/code/game/objects/items/flamethrower.dm +++ b/code/game/objects/items/flamethrower.dm @@ -40,8 +40,8 @@ AddElement(/datum/element/update_icon_updates_onmob) var/static/list/slapcraft_recipe_list = list(/datum/crafting_recipe/flamethrower) - AddComponent( - /datum/component/slapcrafting,\ + AddElement( + /datum/element/slapcrafting,\ slapcraft_recipes = slapcraft_recipe_list,\ ) diff --git a/code/game/objects/items/handcuffs.dm b/code/game/objects/items/handcuffs.dm index 5b740532999..c5a68260aba 100644 --- a/code/game/objects/items/handcuffs.dm +++ b/code/game/objects/items/handcuffs.dm @@ -214,8 +214,8 @@ var/static/list/slapcraft_recipe_list = list(/datum/crafting_recipe/bola, /datum/crafting_recipe/gonbola) - AddComponent( - /datum/component/slapcrafting,\ + AddElement( + /datum/element/slapcrafting,\ slapcraft_recipes = slapcraft_recipe_list,\ ) diff --git a/code/game/objects/items/pillow.dm b/code/game/objects/items/pillow.dm index f1c96e2baa0..f699dd34b3b 100644 --- a/code/game/objects/items/pillow.dm +++ b/code/game/objects/items/pillow.dm @@ -37,8 +37,8 @@ /datum/crafting_recipe/pillow_suit, /datum/crafting_recipe/pillow_hood,\ ) - AddComponent( - /datum/component/slapcrafting,\ + AddElement( + /datum/element/slapcrafting,\ slapcraft_recipes = slapcraft_recipe_list,\ ) diff --git a/code/game/objects/items/shields.dm b/code/game/objects/items/shields.dm index 2cc41b5d9f2..1553f0e9c8f 100644 --- a/code/game/objects/items/shields.dm +++ b/code/game/objects/items/shields.dm @@ -145,8 +145,8 @@ . = ..() var/static/list/slapcraft_recipe_list = list(/datum/crafting_recipe/strobeshield) - AddComponent( - /datum/component/slapcrafting,\ + AddElement( + /datum/element/slapcrafting,\ slapcraft_recipes = slapcraft_recipe_list,\ ) diff --git a/code/game/objects/items/spear.dm b/code/game/objects/items/spear.dm index 66e96bcab4b..272c3c2d134 100644 --- a/code/game/objects/items/spear.dm +++ b/code/game/objects/items/spear.dm @@ -61,8 +61,8 @@ /obj/item/spear/proc/add_headpike_component() var/static/list/slapcraft_recipe_list = list(/datum/crafting_recipe/headpike) - AddComponent( - /datum/component/slapcrafting,\ + AddElement( + /datum/element/slapcrafting,\ slapcraft_recipes = slapcraft_recipe_list,\ ) @@ -231,8 +231,8 @@ /obj/item/spear/military/add_headpike_component() var/static/list/slapcraft_recipe_list = list(/datum/crafting_recipe/headpikemilitary) - AddComponent( - /datum/component/slapcrafting,\ + AddElement( + /datum/element/slapcrafting,\ slapcraft_recipes = slapcraft_recipe_list,\ ) @@ -255,8 +255,8 @@ /obj/item/spear/bonespear/add_headpike_component() var/static/list/slapcraft_recipe_list = list(/datum/crafting_recipe/headpikebone) - AddComponent( - /datum/component/slapcrafting,\ + AddElement( + /datum/element/slapcrafting,\ slapcraft_recipes = slapcraft_recipe_list,\ ) @@ -279,7 +279,7 @@ /obj/item/spear/bamboospear/add_headpike_component() var/static/list/slapcraft_recipe_list = list(/datum/crafting_recipe/headpikebamboo) - AddComponent( - /datum/component/slapcrafting,\ + AddElement( + /datum/element/slapcrafting,\ slapcraft_recipes = slapcraft_recipe_list,\ ) diff --git a/code/game/objects/items/stacks/rods.dm b/code/game/objects/items/stacks/rods.dm index 82f19d09d96..5d41f41afcb 100644 --- a/code/game/objects/items/stacks/rods.dm +++ b/code/game/objects/items/stacks/rods.dm @@ -58,8 +58,8 @@ GLOBAL_LIST_INIT(rod_recipes, list ( \ var/static/list/slapcraft_recipe_list = list(/datum/crafting_recipe/spear, /datum/crafting_recipe/stunprod, /datum/crafting_recipe/teleprod) // snatcher prod isn't here as a spoopy secret - AddComponent( - /datum/component/slapcrafting,\ + AddElement( + /datum/element/slapcrafting,\ slapcraft_recipes = slapcraft_recipe_list,\ ) diff --git a/code/game/objects/items/stacks/sheets/leather.dm b/code/game/objects/items/stacks/sheets/leather.dm index 2d1636e9e16..fbd69dbd20d 100644 --- a/code/game/objects/items/stacks/sheets/leather.dm +++ b/code/game/objects/items/stacks/sheets/leather.dm @@ -251,8 +251,8 @@ GLOBAL_LIST_INIT(leather_recipes, list ( \ /datum/crafting_recipe/goliathcloak, /datum/crafting_recipe/skilt, /datum/crafting_recipe/drakecloak,\ ) - AddComponent( - /datum/component/slapcrafting,\ + AddElement( + /datum/element/slapcrafting,\ slapcraft_recipes = slapcraft_recipe_list,\ ) @@ -311,8 +311,8 @@ GLOBAL_LIST_INIT(sinew_recipes, list ( \ var/static/list/slapcraft_recipe_list = list(/datum/crafting_recipe/drakecloak) - AddComponent( - /datum/component/slapcrafting,\ + AddElement( + /datum/element/slapcrafting,\ slapcraft_recipes = slapcraft_recipe_list,\ ) diff --git a/code/game/objects/items/stacks/sheets/sheet_types.dm b/code/game/objects/items/stacks/sheets/sheet_types.dm index d32df256240..0ec790fe743 100644 --- a/code/game/objects/items/stacks/sheets/sheet_types.dm +++ b/code/game/objects/items/stacks/sheets/sheet_types.dm @@ -549,8 +549,8 @@ GLOBAL_LIST_INIT(durathread_recipes, list ( \ . = ..() var/static/list/slapcraft_recipe_list = list(/datum/crafting_recipe/durathread_helmet, /datum/crafting_recipe/durathread_vest) - AddComponent( - /datum/component/slapcrafting,\ + AddElement( + /datum/element/slapcrafting,\ slapcraft_recipes = slapcraft_recipe_list,\ ) @@ -683,8 +683,8 @@ GLOBAL_LIST_INIT(cardboard_recipes, list ( \ . = ..() var/static/list/slapcraft_recipe_list = list(/datum/crafting_recipe/cardboard_id) - AddComponent( - /datum/component/slapcrafting,\ + AddElement( + /datum/element/slapcrafting,\ slapcraft_recipes = slapcraft_recipe_list,\ ) @@ -824,8 +824,8 @@ GLOBAL_LIST_INIT(bronze_recipes, list ( \ /datum/crafting_recipe/skullhelm, ) - AddComponent( - /datum/component/slapcrafting,\ + AddElement( + /datum/element/slapcrafting,\ slapcraft_recipes = slapcraft_recipe_list,\ ) GLOBAL_LIST_INIT(plastic_recipes, list( diff --git a/code/game/objects/items/storage/backpack.dm b/code/game/objects/items/storage/backpack.dm index c01203e3d50..d2d4297fdc6 100644 --- a/code/game/objects/items/storage/backpack.dm +++ b/code/game/objects/items/storage/backpack.dm @@ -47,9 +47,8 @@ /obj/item/bag_of_holding_inert/Initialize(mapload) . = ..() - AddComponent(/datum/component/slapcrafting,\ - slapcraft_recipes = list(/datum/crafting_recipe/boh)\ - ) + var/static/list/recipes = list(/datum/crafting_recipe/boh) + AddElement(/datum/element/slapcrafting, recipes) /obj/item/storage/backpack/holding name = "bag of holding" diff --git a/code/modules/clothing/glasses/_glasses.dm b/code/modules/clothing/glasses/_glasses.dm index 9453df3616f..a1c9a8ea44b 100644 --- a/code/modules/clothing/glasses/_glasses.dm +++ b/code/modules/clothing/glasses/_glasses.dm @@ -326,8 +326,8 @@ /obj/item/clothing/glasses/sunglasses/proc/add_glasses_slapcraft_component() var/static/list/slapcraft_recipe_list = list(/datum/crafting_recipe/hudsunsec, /datum/crafting_recipe/hudsunmed, /datum/crafting_recipe/hudsundiag, /datum/crafting_recipe/scienceglasses) - AddComponent( - /datum/component/slapcrafting,\ + AddElement( + /datum/element/slapcrafting,\ slapcraft_recipes = slapcraft_recipe_list,\ ) @@ -346,8 +346,8 @@ /obj/item/clothing/glasses/sunglasses/chemical/add_glasses_slapcraft_component() var/static/list/slapcraft_recipe_list = list(/datum/crafting_recipe/scienceglassesremoval) - AddComponent( - /datum/component/slapcrafting,\ + AddElement( + /datum/element/slapcrafting,\ slapcraft_recipes = slapcraft_recipe_list,\ ) diff --git a/code/modules/clothing/glasses/hud.dm b/code/modules/clothing/glasses/hud.dm index 46900c1caa9..e201ade95ec 100644 --- a/code/modules/clothing/glasses/hud.dm +++ b/code/modules/clothing/glasses/hud.dm @@ -4,7 +4,7 @@ flags_1 = null //doesn't protect eyes because it's a monocle, duh var/hud_type = null - // NOTE: Just because you have a HUD display doesn't mean you should be able to interact with stuff on examine, that's where the associated trait (TRAIT_MEDICAL_HUD, TRAIT_SECURITY_HUD, etc) is necessary. + // NOTE: Just because you have a HUD display doesn't mean you should be able to interact with stuff on examine, that's where the associated trait (TRAIT_MEDICAL_HUD, TRAIT_SECURITY_HUD, etc) is necessary. /obj/item/clothing/glasses/hud/equipped(mob/living/carbon/human/user, slot) ..() @@ -94,8 +94,8 @@ . = ..() var/static/list/slapcraft_recipe_list = list(/datum/crafting_recipe/hudsunmedremoval) - AddComponent( - /datum/component/slapcrafting,\ + AddElement( + /datum/element/slapcrafting,\ slapcraft_recipes = slapcraft_recipe_list,\ ) @@ -131,8 +131,8 @@ . = ..() var/static/list/slapcraft_recipe_list = list(/datum/crafting_recipe/hudsundiagremoval) - AddComponent( - /datum/component/slapcrafting,\ + AddElement( + /datum/element/slapcrafting,\ slapcraft_recipes = slapcraft_recipe_list,\ ) @@ -175,8 +175,8 @@ . = ..() var/static/list/slapcraft_recipe_list = list(/datum/crafting_recipe/hudsunsecremoval) - AddComponent( - /datum/component/slapcrafting,\ + AddElement( + /datum/element/slapcrafting,\ slapcraft_recipes = slapcraft_recipe_list,\ ) diff --git a/code/modules/clothing/gloves/boxing.dm b/code/modules/clothing/gloves/boxing.dm index 03b1cbb5bf7..021d895f69c 100644 --- a/code/modules/clothing/gloves/boxing.dm +++ b/code/modules/clothing/gloves/boxing.dm @@ -13,8 +13,8 @@ . = ..() var/static/list/slapcraft_recipe_list = list(/datum/crafting_recipe/extendohand_l, /datum/crafting_recipe/extendohand_r) - AddComponent( - /datum/component/slapcrafting,\ + AddElement( + /datum/element/slapcrafting,\ slapcraft_recipes = slapcraft_recipe_list,\ ) diff --git a/code/modules/clothing/gloves/color.dm b/code/modules/clothing/gloves/color.dm index ddb0e07dd99..bb0e1280995 100644 --- a/code/modules/clothing/gloves/color.dm +++ b/code/modules/clothing/gloves/color.dm @@ -15,8 +15,8 @@ . = ..() var/static/list/slapcraft_recipe_list = list(/datum/crafting_recipe/radiogloves) - AddComponent( - /datum/component/slapcrafting,\ + AddElement( + /datum/element/slapcrafting,\ slapcraft_recipes = slapcraft_recipe_list,\ ) @@ -37,8 +37,8 @@ . = ..() var/static/list/slapcraft_recipe_list = list(/datum/crafting_recipe/gripperoffbrand) - AddComponent( - /datum/component/slapcrafting,\ + AddElement( + /datum/element/slapcrafting,\ slapcraft_recipes = slapcraft_recipe_list,\ ) diff --git a/code/modules/clothing/head/jobs.dm b/code/modules/clothing/head/jobs.dm index 5ea7d62313b..a5041de7fa0 100644 --- a/code/modules/clothing/head/jobs.dm +++ b/code/modules/clothing/head/jobs.dm @@ -412,8 +412,8 @@ /datum/crafting_recipe/sturdy_shako,\ ) - AddComponent( - /datum/component/slapcrafting,\ + AddElement( + /datum/element/slapcrafting,\ slapcraft_recipes = slapcraft_recipe_list,\ ) diff --git a/code/modules/fishing/aquarium/aquarium_kit.dm b/code/modules/fishing/aquarium/aquarium_kit.dm index 30c93003231..9b1bf20e0e3 100644 --- a/code/modules/fishing/aquarium/aquarium_kit.dm +++ b/code/modules/fishing/aquarium/aquarium_kit.dm @@ -100,7 +100,8 @@ /obj/item/aquarium_kit/Initialize(mapload) . = ..() - AddComponent(/datum/component/slapcrafting, /datum/crafting_recipe/aquarium) + var/static/list/recipes = list(/datum/crafting_recipe/aquarium) + AddElement(/datum/element/slapcrafting, recipes) /obj/item/aquarium_prop name = "generic aquarium prop" diff --git a/code/modules/projectiles/ammunition/ballistic/shotgun.dm b/code/modules/projectiles/ammunition/ballistic/shotgun.dm index b545500420b..aeb3b34ed4a 100644 --- a/code/modules/projectiles/ammunition/ballistic/shotgun.dm +++ b/code/modules/projectiles/ammunition/ballistic/shotgun.dm @@ -140,8 +140,8 @@ var/static/list/slapcraft_recipe_list = list(/datum/crafting_recipe/meteorslug, /datum/crafting_recipe/pulseslug, /datum/crafting_recipe/dragonsbreath, /datum/crafting_recipe/ionslug) - AddComponent( - /datum/component/slapcrafting,\ + AddElement( + /datum/element/slapcrafting,\ slapcraft_recipes = slapcraft_recipe_list,\ ) diff --git a/code/modules/projectiles/guns/energy/energy_gun.dm b/code/modules/projectiles/guns/energy/energy_gun.dm index 3ce3338bf87..e826e1392bf 100644 --- a/code/modules/projectiles/guns/energy/energy_gun.dm +++ b/code/modules/projectiles/guns/energy/energy_gun.dm @@ -16,8 +16,8 @@ return var/static/list/slapcraft_recipe_list = list(/datum/crafting_recipe/advancedegun, /datum/crafting_recipe/tempgun, /datum/crafting_recipe/beam_rifle) - AddComponent( - /datum/component/slapcrafting,\ + AddElement( + /datum/element/slapcrafting,\ slapcraft_recipes = slapcraft_recipe_list,\ ) diff --git a/code/modules/projectiles/guns/energy/kinetic_accelerator.dm b/code/modules/projectiles/guns/energy/kinetic_accelerator.dm index 1cfa73ddc64..ab023d38b55 100644 --- a/code/modules/projectiles/guns/energy/kinetic_accelerator.dm +++ b/code/modules/projectiles/guns/energy/kinetic_accelerator.dm @@ -27,8 +27,8 @@ return var/static/list/slapcraft_recipe_list = list(/datum/crafting_recipe/ebow) - AddComponent( - /datum/component/slapcrafting,\ + AddElement( + /datum/element/slapcrafting,\ slapcraft_recipes = slapcraft_recipe_list,\ ) diff --git a/code/modules/projectiles/guns/energy/laser.dm b/code/modules/projectiles/guns/energy/laser.dm index 95baca98db8..90dc0c57172 100644 --- a/code/modules/projectiles/guns/energy/laser.dm +++ b/code/modules/projectiles/guns/energy/laser.dm @@ -16,8 +16,8 @@ return var/static/list/slapcraft_recipe_list = list(/datum/crafting_recipe/xraylaser, /datum/crafting_recipe/hellgun, /datum/crafting_recipe/ioncarbine) - AddComponent( - /datum/component/slapcrafting,\ + AddElement( + /datum/element/slapcrafting,\ slapcraft_recipes = slapcraft_recipe_list,\ ) diff --git a/code/modules/reagents/reagent_containers/cups/glassbottle.dm b/code/modules/reagents/reagent_containers/cups/glassbottle.dm index a293aac7aa1..b246cc01e07 100644 --- a/code/modules/reagents/reagent_containers/cups/glassbottle.dm +++ b/code/modules/reagents/reagent_containers/cups/glassbottle.dm @@ -42,9 +42,8 @@ /obj/item/reagent_containers/cup/glass/bottle/Initialize(mapload, vol) . = ..() - AddComponent(/datum/component/slapcrafting,\ - slapcraft_recipes = list(/datum/crafting_recipe/molotov)\ - ) + var/static/list/recipes = list(/datum/crafting_recipe/molotov) + AddElement(/datum/element/slapcrafting, recipes) /obj/item/reagent_containers/cup/glass/bottle/small name = "small glass bottle" diff --git a/code/modules/reagents/reagent_containers/cups/soda.dm b/code/modules/reagents/reagent_containers/cups/soda.dm index 5bf0eb782c5..2e85b2273f4 100644 --- a/code/modules/reagents/reagent_containers/cups/soda.dm +++ b/code/modules/reagents/reagent_containers/cups/soda.dm @@ -23,9 +23,7 @@ /obj/item/reagent_containers/cup/soda_cans/Initialize(mapload, vol) . = ..() - AddComponent(/datum/component/slapcrafting,\ - slapcraft_recipes = list(/datum/crafting_recipe/improv_explosive)\ - ) + AddElement(/datum/element/slapcrafting, string_list(list(/datum/crafting_recipe/improv_explosive))) /obj/item/reagent_containers/cup/soda_cans/random/Initialize(mapload) ..() diff --git a/code/modules/surgery/tools.dm b/code/modules/surgery/tools.dm index eba496e0b8c..2bd8f485887 100644 --- a/code/modules/surgery/tools.dm +++ b/code/modules/surgery/tools.dm @@ -286,8 +286,8 @@ //saws are very accurate and fast at butchering var/static/list/slapcraft_recipe_list = list(/datum/crafting_recipe/chainsaw) - AddComponent( - /datum/component/slapcrafting,\ + AddElement( + /datum/element/slapcrafting,\ slapcraft_recipes = slapcraft_recipe_list,\ ) diff --git a/tgstation.dme b/tgstation.dme index 951bc45f356..d75703cda0e 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -1272,7 +1272,6 @@ #include "code\datums\components\crafting\misc.dm" #include "code\datums\components\crafting\ranged_weapon.dm" #include "code\datums\components\crafting\robot.dm" -#include "code\datums\components\crafting\slapcrafting.dm" #include "code\datums\components\crafting\structures.dm" #include "code\datums\components\crafting\tailoring.dm" #include "code\datums\components\crafting\tiles.dm" @@ -1504,6 +1503,7 @@ #include "code\datums\elements\simple_flying.dm" #include "code\datums\elements\skill_reward.dm" #include "code\datums\elements\skittish.dm" +#include "code\datums\elements\slapcrafting.dm" #include "code\datums\elements\soft_landing.dm" #include "code\datums\elements\spooky.dm" #include "code\datums\elements\squish.dm"