mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-24 13:38:41 +01:00
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 🆑 refactor: Underwater basketweaving refactored so it doesn't show in the crafting menu unless you've the skillchip active. /🆑
This commit is contained in:
@@ -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."
|
||||
|
||||
@@ -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 ..()
|
||||
Reference in New Issue
Block a user