From 76b933fd4b148b1848e14e5656378c74c8d12283 Mon Sep 17 00:00:00 2001 From: Ghom <42542238+Ghommie@users.noreply.github.com> Date: Tue, 16 Sep 2025 01:41:01 +0200 Subject: [PATCH] Underwater basketweaving recipes are hidden unless you've the skillchip (#92979) ## About The Pull Request The recipes are locked behind a particular skillchip anyway. We might as well just use the framework for learnable recipes instead of relying on a particular trait with no other use to it. This also prevents these recipes from showing in the menu even if the requirements aren't met. ## Why It's Good For The Game See above. ## Changelog :cl: refactor: Underwater basketweaving refactored so it doesn't show in the crafting menu unless you've the skillchip active. /:cl: --- code/__DEFINES/traits/declarations.dm | 1 - code/_globalvars/traits/_traits.dm | 1 - code/_globalvars/traits/admin_tooling.dm | 1 - code/datums/components/crafting/containers.dm | 5 +-- .../skill_learning/generic_skillchips/misc.dm | 10 ----- .../underwater_basketweaving.dm | 43 +++++++++++++++++++ tgstation.dme | 1 + 7 files changed, 46 insertions(+), 16 deletions(-) create mode 100644 code/modules/library/skill_learning/generic_skillchips/underwater_basketweaving.dm diff --git a/code/__DEFINES/traits/declarations.dm b/code/__DEFINES/traits/declarations.dm index 1b4dd11c213..7f07625dd6d 100644 --- a/code/__DEFINES/traits/declarations.dm +++ b/code/__DEFINES/traits/declarations.dm @@ -729,7 +729,6 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai #define TRAIT_MAGICALLY_PHASED "magically_phased" //SKILLS -#define TRAIT_UNDERWATER_BASKETWEAVING_KNOWLEDGE "underwater_basketweaving" #define TRAIT_WINE_TASTER "wine_taster" #define TRAIT_BONSAI "bonsai" #define TRAIT_LIGHTBULB_REMOVER "lightbulb_remover" diff --git a/code/_globalvars/traits/_traits.dm b/code/_globalvars/traits/_traits.dm index 76caa49c4c4..1a79d669acd 100644 --- a/code/_globalvars/traits/_traits.dm +++ b/code/_globalvars/traits/_traits.dm @@ -587,7 +587,6 @@ GLOBAL_LIST_INIT(traits_by_type, list( "TRAIT_UNBREAKABLE" = TRAIT_UNBREAKABLE, "TRAIT_UNCONVERTABLE" = TRAIT_UNCONVERTABLE, "TRAIT_UNDENSE" = TRAIT_UNDENSE, - "TRAIT_UNDERWATER_BASKETWEAVING_KNOWLEDGE" = TRAIT_UNDERWATER_BASKETWEAVING_KNOWLEDGE, "TRAIT_UNHUSKABLE" = TRAIT_UNHUSKABLE, "TRAIT_UNINTELLIGIBLE_SPEECH" = TRAIT_UNINTELLIGIBLE_SPEECH, "TRAIT_UNKNOWN_APPEARANCE" = TRAIT_UNKNOWN_APPEARANCE, diff --git a/code/_globalvars/traits/admin_tooling.dm b/code/_globalvars/traits/admin_tooling.dm index 233b25ee2cd..2e681d9c410 100644 --- a/code/_globalvars/traits/admin_tooling.dm +++ b/code/_globalvars/traits/admin_tooling.dm @@ -313,7 +313,6 @@ GLOBAL_LIST_INIT(admin_visible_traits, list( "TRAIT_UI_BLOCKED" = TRAIT_UI_BLOCKED, "TRAIT_UNCONVERTABLE" = TRAIT_UNCONVERTABLE, "TRAIT_UNDENSE" = TRAIT_UNDENSE, - "TRAIT_UNDERWATER_BASKETWEAVING_KNOWLEDGE" = TRAIT_UNDERWATER_BASKETWEAVING_KNOWLEDGE, "TRAIT_UNHUSKABLE" = TRAIT_UNHUSKABLE, "TRAIT_UNINTELLIGIBLE_SPEECH" = TRAIT_UNINTELLIGIBLE_SPEECH, "TRAIT_UNKNOWN_APPEARANCE" = TRAIT_UNKNOWN_APPEARANCE, diff --git a/code/datums/components/crafting/containers.dm b/code/datums/components/crafting/containers.dm index fb241c4d0d9..45e4d0e94fe 100644 --- a/code/datums/components/crafting/containers.dm +++ b/code/datums/components/crafting/containers.dm @@ -28,15 +28,14 @@ ) result = /obj/item/storage/basket category = CAT_CONTAINERS + crafting_flags = parent_type::crafting_flags | CRAFT_MUST_BE_LEARNED steps = list( - "master the art of underwater basketweaving", + "master the art of underwater basketweaving", "be underwater" ) /datum/crafting_recipe/underwater_basket/check_requirements(mob/user, list/collected_requirements) . = ..() - if(!HAS_TRAIT(user,TRAIT_UNDERWATER_BASKETWEAVING_KNOWLEDGE)) - return FALSE var/turf/T = get_turf(user) if(istype(T, /turf/open/water)) return TRUE diff --git a/code/modules/library/skill_learning/generic_skillchips/misc.dm b/code/modules/library/skill_learning/generic_skillchips/misc.dm index 92c024c4732..083f67cb4a0 100644 --- a/code/modules/library/skill_learning/generic_skillchips/misc.dm +++ b/code/modules/library/skill_learning/generic_skillchips/misc.dm @@ -1,15 +1,5 @@ //Contains generic skillchips that are fairly short and simple -/obj/item/skillchip/basketweaving - name = "Basketsoft 3000 skillchip" - desc = "Underwater edition." - auto_traits = list(TRAIT_UNDERWATER_BASKETWEAVING_KNOWLEDGE) - skill_name = "Underwater Basketweaving" - skill_description = "Master intricate art of using twine to create perfect baskets while submerged." - skill_icon = "shopping-basket" - activate_message = span_notice("You're one with the twine and the sea.") - deactivate_message = span_notice("Higher mysteries of underwater basketweaving leave your mind.") - /obj/item/skillchip/wine_taster name = "WINE skillchip" desc = "Wine.Is.Not.Equal version 5." diff --git a/code/modules/library/skill_learning/generic_skillchips/underwater_basketweaving.dm b/code/modules/library/skill_learning/generic_skillchips/underwater_basketweaving.dm new file mode 100644 index 00000000000..eb83bffdad0 --- /dev/null +++ b/code/modules/library/skill_learning/generic_skillchips/underwater_basketweaving.dm @@ -0,0 +1,43 @@ + +/obj/item/skillchip/basketweaving + name = "Basketsoft 3000 skillchip" + desc = "Underwater edition." + skill_name = "Underwater Basketweaving" + skill_description = "Master intricate art of using twine to create perfect baskets while submerged." + skill_icon = "shopping-basket" + activate_message = span_notice("You're one with the twine and the sea.") + deactivate_message = span_notice("Higher mysteries of underwater basketweaving leave your mind.") + +/obj/item/skillchip/basketweaving/has_mob_incompatibility(mob/living/carbon/target) + . = ..() + if(.) + return + + if(!target.mind) + return "Target incapable of learning recipe." + +/obj/item/skillchip/basketweaving/on_activate(mob/living/carbon/user, silent=FALSE) + . = ..() + if(!user.mind) + return + learn_recipes(user) + //Prevent the skill from being transferred via mindswap. What an edge case + RegisterSignal(user.mind, COMSIG_MIND_TRANSFERRED, PROC_REF(forget_recipes)) + RegisterSignal(user, COMSIG_MOB_MIND_TRANSFERRED_INTO, PROC_REF(learn_recipes)) + +/obj/item/skillchip/basketweaving/proc/learn_recipes(mob/source) + SIGNAL_HANDLER + for(var/recipe_type in typesof(/datum/crafting_recipe/underwater_basket)) + source.mind.teach_crafting_recipe(recipe_type) + +/obj/item/skillchip/basketweaving/proc/forget_recipes(datum/mind/source, mob/previous_body) + SIGNAL_HANDLER + for(var/recipe_type in typesof(/datum/crafting_recipe/underwater_basket)) + source.forget_crafting_recipe(recipe_type) + +/obj/item/skillchip/basketweaving/on_deactivate(mob/living/carbon/user, silent=FALSE) + if(user.mind) + forget_recipes(user.mind) + UnregisterSignal(user.mind, COMSIG_MIND_TRANSFERRED) + UnregisterSignal(user, COMSIG_MOB_MIND_TRANSFERRED_INTO) + return ..() diff --git a/tgstation.dme b/tgstation.dme index 9e4d8718937..10335a32699 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -4683,6 +4683,7 @@ #include "code\modules\library\skill_learning\generic_skillchips\musical.dm" #include "code\modules\library\skill_learning\generic_skillchips\point.dm" #include "code\modules\library\skill_learning\generic_skillchips\self_surgery.dm" +#include "code\modules\library\skill_learning\generic_skillchips\underwater_basketweaving.dm" #include "code\modules\library\skill_learning\job_skillchips\_job.dm" #include "code\modules\library\skill_learning\job_skillchips\chef.dm" #include "code\modules\library\skill_learning\job_skillchips\clown.dm"