Skip to content

Commit

Permalink
[MIRROR] Fishes love kronkaine + Examining fishing spots. (#2222)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
Co-authored-by: Ghom <[email protected]>
Co-authored-by: san7890 <[email protected]>
  • Loading branch information
4 people authored Mar 2, 2024
1 parent bd4d309 commit 714ad35
Show file tree
Hide file tree
Showing 8 changed files with 75 additions and 8 deletions.
2 changes: 2 additions & 0 deletions code/__DEFINES/traits/declarations.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions code/_globalvars/traits/_traits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
42 changes: 42 additions & 0 deletions code/datums/components/fishing_spot.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
9 changes: 7 additions & 2 deletions code/datums/skills/fishing.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,26 @@
*/
/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)

/datum/skill/fishing/level_lost(datum/mind/mind, new_level, old_level, silent)
. = ..()
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)
3 changes: 1 addition & 2 deletions code/game/objects/items/food/bait.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions code/modules/fishing/fishing_minigame.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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"

/**
Expand Down Expand Up @@ -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!!!")
Expand Down
4 changes: 2 additions & 2 deletions code/modules/library/skill_learning/skillchip.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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.")
Expand Down
18 changes: 18 additions & 0 deletions code/modules/reagents/chemistry/reagents/drug_reagents.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 714ad35

Please sign in to comment.