From 714ad35ef0192c1eec3279e49146ed8999409c04 Mon Sep 17 00:00:00 2001 From: Iajret Creature <122297233+Steals-The-PRs@users.noreply.github.com> Date: Sat, 2 Mar 2024 22:18:34 +0300 Subject: [PATCH] [MIRROR] Fishes love kronkaine + Examining fishing spots. (#2222) * Fishes love kronkaine + Examining fishing spots. (#81519) ## About The Pull Request Food items with kronkaine in it now count as great baits (this is the case of the "all-natural" bait from that overpriced cargo pack I'm converting into a less expensive goodie in another PR) Sufficiently high fishing skill (and the relative skillchip) allows you to list fishes in a fishing spot by examining it twice. ## Why It's Good For The Game Little fishing things off the top of my head before I move on bigger stuff. ## Changelog :cl: add: Fishes love kronkaine. qol: Examining a fishing spot twice with sufficiently high fishing skill (or the skillchip) will get you a list of fishes that can be caught. /:cl: --------- * Fishes love kronkaine + Examining fishing spots. --------- Co-authored-by: NovaBot <154629622+NovaBot13@users.noreply.github.com> Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com> Co-authored-by: san7890 --- code/__DEFINES/traits/declarations.dm | 2 + code/_globalvars/traits/_traits.dm | 1 + code/datums/components/fishing_spot.dm | 42 +++++++++++++++++++ code/datums/skills/fishing.dm | 9 +++- code/game/objects/items/food/bait.dm | 3 +- code/modules/fishing/fishing_minigame.dm | 4 +- .../library/skill_learning/skillchip.dm | 4 +- .../chemistry/reagents/drug_reagents.dm | 18 ++++++++ 8 files changed, 75 insertions(+), 8 deletions(-) diff --git a/code/__DEFINES/traits/declarations.dm b/code/__DEFINES/traits/declarations.dm index 04866902472..f6e0d75e557 100644 --- a/code/__DEFINES/traits/declarations.dm +++ b/code/__DEFINES/traits/declarations.dm @@ -221,6 +221,8 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai #define TRAIT_NO_THROW_HITPUSH "no_throw_hitpush" ///Added to mob or mind, changes the icons of the fish shown in the minigame UI depending on the possible reward. #define TRAIT_REVEAL_FISH "reveal_fish" +///This trait gets you a list of fishes that can be caught when examining a fishing spot. +#define TRAIT_EXAMINE_FISHING_SPOT "examine_fishing_spot" /// Added to a mob, allows that mob to experience flavour-based moodlets when examining food #define TRAIT_REMOTE_TASTING "remote_tasting" diff --git a/code/_globalvars/traits/_traits.dm b/code/_globalvars/traits/_traits.dm index f61dea2a5bb..39c59ecd882 100644 --- a/code/_globalvars/traits/_traits.dm +++ b/code/_globalvars/traits/_traits.dm @@ -195,6 +195,7 @@ GLOBAL_LIST_INIT(traits_by_type, list( "TRAIT_EMOTEMUTE" = TRAIT_EMOTEMUTE, "TRAIT_EMPATH" = TRAIT_EMPATH, "TRAIT_ENTRAILS_READER" = TRAIT_ENTRAILS_READER, + "TRAIT_EXAMINE_FISHING_SPOT" = TRAIT_EXAMINE_FISHING_SPOT, "TRAIT_EXPANDED_FOV" = TRAIT_EXPANDED_FOV, "TRAIT_EXTROVERT" = TRAIT_EXTROVERT, "TRAIT_FAKEDEATH" = TRAIT_FAKEDEATH, diff --git a/code/datums/components/fishing_spot.dm b/code/datums/components/fishing_spot.dm index c8a00ce74cd..7ee368e543e 100644 --- a/code/datums/components/fishing_spot.dm +++ b/code/datums/components/fishing_spot.dm @@ -15,6 +15,11 @@ fish_source.on_fishing_spot_init() RegisterSignal(parent, COMSIG_ATOM_ATTACKBY, PROC_REF(handle_attackby)) RegisterSignal(parent, COMSIG_FISHING_ROD_CAST, PROC_REF(handle_cast)) + RegisterSignal(parent, COMSIG_ATOM_EXAMINE, PROC_REF(on_examined)) + +/datum/component/fishing_spot/Destroy() + fish_source = null + return ..() /datum/component/fishing_spot/proc/handle_cast(datum/source, obj/item/fishing_rod/rod, mob/user) SIGNAL_HANDLER @@ -28,6 +33,43 @@ return COMPONENT_NO_AFTERATTACK return NONE +///If the fish source has fishes that are shown in the +/datum/component/fishing_spot/proc/on_examined(datum/source, mob/user, list/examine_text) + SIGNAL_HANDLER + if(!HAS_MIND_TRAIT(user, TRAIT_EXAMINE_FISHING_SPOT)) + return + + var/has_known_fishes = FALSE + for(var/reward in fish_source.fish_counts) + if(!ispath(reward, /obj/item/fish)) + continue + var/obj/item/fish/prototype = reward + if(initial(prototype.show_in_catalog)) + has_known_fishes = TRUE + break + if(!has_known_fishes) + return + + examine_text += span_tinynoticeital("This is a fishing spot. You can look again to list its fishes...") + +/datum/component/fishing_spot/proc/on_examined_more(datum/source, mob/user, list/examine_text) + SIGNAL_HANDLER + if(!HAS_MIND_TRAIT(user, TRAIT_EXAMINE_FISHING_SPOT)) + return + + var/list/known_fishes = list() + for(var/reward in fish_source.fish_counts) + if(!ispath(reward, /obj/item/fish)) + continue + var/obj/item/fish/prototype = reward + if(initial(prototype.show_in_catalog)) + known_fishes += initial(prototype.name) + + if(!length(known_fishes)) + return + + examine_text += span_info("You can catch the following fish here: [english_list(known_fishes)].") + /datum/component/fishing_spot/proc/try_start_fishing(obj/item/possibly_rod, mob/user) SIGNAL_HANDLER var/obj/item/fishing_rod/rod = possibly_rod diff --git a/code/datums/skills/fishing.dm b/code/datums/skills/fishing.dm index ddf90e1a0a3..cfd14a4ce3b 100644 --- a/code/datums/skills/fishing.dm +++ b/code/datums/skills/fishing.dm @@ -4,17 +4,20 @@ */ /datum/skill/fishing name = "Fishing" - title = "Fisher" + title = "Angler" desc = "How empty and alone you are on this barren Earth." modifiers = list(SKILL_VALUE_MODIFIER = list(1, 1, 0, -1, -2, -4, -6)) skill_item_path = /obj/item/clothing/head/soft/fishing_hat /datum/skill/fishing/New() . = ..() - levelUpMessages[SKILL_LEVEL_MASTER] = span_nicegreen("After lots of practice, I've begun to truly understand the surprising depth behind [name]. As a master [title], I can take an easier guess of what I'm trying to catch now.") + levelUpMessages[SKILL_LEVEL_JOURNEYMAN] = span_nicegreen("I feel like I've become quite proficient at [name]! I can tell what fishes I can catch at any given fishing spot.") + levelUpMessages[SKILL_LEVEL_MASTER] = span_nicegreen("I've begun to truly understand the surprising depth behind [name]. As a master [title], I can guess what I'm going to catch now!") /datum/skill/fishing/level_gained(datum/mind/mind, new_level, old_level, silent) . = ..() + if(new_level >= SKILL_LEVEL_JOURNEYMAN && old_level < SKILL_LEVEL_JOURNEYMAN) + ADD_TRAIT(mind, TRAIT_EXAMINE_FISHING_SPOT, SKILL_TRAIT) if(new_level >= SKILL_LEVEL_MASTER && old_level < SKILL_LEVEL_MASTER) ADD_TRAIT(mind, TRAIT_REVEAL_FISH, SKILL_TRAIT) @@ -22,3 +25,5 @@ . = ..() if(old_level >= SKILL_LEVEL_MASTER && new_level < SKILL_LEVEL_MASTER) REMOVE_TRAIT(mind, TRAIT_REVEAL_FISH, SKILL_TRAIT) + if(old_level >= SKILL_LEVEL_JOURNEYMAN && new_level < SKILL_LEVEL_JOURNEYMAN) + REMOVE_TRAIT(mind, TRAIT_EXAMINE_FISHING_SPOT, SKILL_TRAIT) diff --git a/code/game/objects/items/food/bait.dm b/code/game/objects/items/food/bait.dm index aa9a0e7bd9e..047a8a7cd58 100644 --- a/code/game/objects/items/food/bait.dm +++ b/code/game/objects/items/food/bait.dm @@ -36,9 +36,8 @@ lefthand_file = 'icons/mob/inhands/items_lefthand.dmi' righthand_file = 'icons/mob/inhands/items_righthand.dmi' inhand_icon_state = "pen" - food_reagents = list(/datum/reagent/drug/kronkaine = 1) + food_reagents = list(/datum/reagent/drug/kronkaine = 2) //The kronkaine is the thing that makes this a great bait. tastes = list("hypocrisy" = 1) - bait_quality = TRAIT_GREAT_QUALITY_BAIT /obj/item/food/bait/doughball name = "doughball" diff --git a/code/modules/fishing/fishing_minigame.dm b/code/modules/fishing/fishing_minigame.dm index e2108848b0b..14c1d88390c 100644 --- a/code/modules/fishing/fishing_minigame.dm +++ b/code/modules/fishing/fishing_minigame.dm @@ -191,7 +191,7 @@ if(difficulty > FISHING_EASY_DIFFICULTY) completion -= round(MAX_FISH_COMPLETION_MALUS * (difficulty/100), 1) - if(HAS_TRAIT(user, TRAIT_REVEAL_FISH) || (user.mind && HAS_TRAIT(user.mind, TRAIT_REVEAL_FISH))) + if(HAS_MIND_TRAIT(user, TRAIT_REVEAL_FISH)) fish_icon = GLOB.specific_fish_icons[reward_path] || "fish" /** @@ -332,7 +332,7 @@ phase = BITING_PHASE // Trashing animation playsound(lure, 'sound/effects/fish_splash.ogg', 100) - if(HAS_TRAIT(user, TRAIT_REVEAL_FISH) || (user.mind && HAS_TRAIT(user.mind, TRAIT_REVEAL_FISH))) + if(HAS_MIND_TRAIT(user, TRAIT_REVEAL_FISH)) switch(fish_icon) if(FISH_ICON_DEF) send_alert("fish!!!") diff --git a/code/modules/library/skill_learning/skillchip.dm b/code/modules/library/skill_learning/skillchip.dm index 2ef7a20e680..a6afa3398bc 100644 --- a/code/modules/library/skill_learning/skillchip.dm +++ b/code/modules/library/skill_learning/skillchip.dm @@ -491,9 +491,9 @@ /obj/item/skillchip/master_angler name = "Mast-Angl-Er skillchip" - auto_traits = list(TRAIT_REVEAL_FISH) + auto_traits = list(TRAIT_REVEAL_FISH, TRAIT_EXAMINE_FISHING_SPOT) skill_name = "Fisherman's Discernment" - skill_description = "While fishing, it'll make a smidge easier to guess whatever you're trying to catch." + skill_description = "Lists fishes when examining a fishing spot, and gives a hint of whatever thing's biting the hook." skill_icon = "fish" activate_message = span_notice("You feel the knowledge and passion of several sunbaked, seasoned fishermen burn within you.") deactivate_message = span_notice("You no longer feel like casting a fishing rod by the sunny riverside.") diff --git a/code/modules/reagents/chemistry/reagents/drug_reagents.dm b/code/modules/reagents/chemistry/reagents/drug_reagents.dm index d8841be7f66..43a3d340831 100644 --- a/code/modules/reagents/chemistry/reagents/drug_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/drug_reagents.dm @@ -785,6 +785,24 @@ chemical_flags = REAGENT_CAN_BE_SYNTHESIZED addiction_types = list(/datum/addiction/stimulants = 20) +/datum/reagent/drug/kronkaine/on_new(data) + . = ..() + // Kronkaine also makes for a great fishing bait (found in "natural" baits) + if(!istype(holder?.my_atom, /obj/item/food)) + return + ADD_TRAIT(holder.my_atom, TRAIT_GREAT_QUALITY_BAIT, type) + RegisterSignal(holder, COMSIG_REAGENTS_CLEAR_REAGENTS, PROC_REF(on_reagents_clear)) + RegisterSignal(holder, COMSIG_REAGENTS_DEL_REAGENT, PROC_REF(on_reagent_delete)) + +/datum/reagent/drug/kronkaine/proc/on_reagents_clear(datum/reagents/reagents) + SIGNAL_HANDLER + REMOVE_TRAIT(holder.my_atom, TRAIT_GREAT_QUALITY_BAIT, type) + +/datum/reagent/drug/kronkaine/proc/on_reagent_delete(datum/reagents/reagents, datum/reagent/deleted_reagent) + SIGNAL_HANDLER + if(deleted_reagent == src) + REMOVE_TRAIT(holder.my_atom, TRAIT_GREAT_QUALITY_BAIT, type) + /datum/reagent/drug/kronkaine/on_mob_metabolize(mob/living/kronkaine_fiend) . = ..() kronkaine_fiend.add_actionspeed_modifier(/datum/actionspeed_modifier/kronkaine)