It's now possible to take trophy fish from previous rounds off the mount (based on RNG). (#89439)

## About The Pull Request
Instead of immediately dusting, there's now a chance, depending on size
and weight (lower is better) as well as the fishing skill of who tries
to remove it (higher is better). At no skill (or if the fish is removed
indirectly), the odds of it not dusting can be as low as about 3~4% (BIG
FISH) and as high as 50% (tiny feesh), while each level in the skill
provides an additional 4% to the roll, up to a bonus 28% (legendary
level).

As always, regardless of RNG, the fish won't be removed from the
persistence system if removed from the trophy mount, and only if
replaced.

This PR also allows trophy fish to retain traits between rounds, but
keep in mind the fish starts dead and may have to be revived first. Also
trying to sell it will yield a pitiful 1/20 of its theorical export
value, much like for fish from fish cases.

## Why It's Good For The Game
The persistent trophy fish mount at the bar seems to fare fairly well
without outstanding issues so far, so maybe I should let people get
their hands on rare and valuable fish from previous rounds, and give
players some more practical reasons to place a fish on the mount for
future rounds. As long as people don't start beelining the trophy mount
by the bar on regular basis.

## Changelog


🆑
balance: It's now possible to take trophy fish from previous shifts off
their mounts without turning them into dust based on a probability
revolving around the size and weight of the fish against your fishing
skill.
/🆑
This commit is contained in:
Ghom
2025-03-07 15:37:13 +01:00
committed by GitHub
parent 3874e9cd6e
commit f6ccd9fa5d
8 changed files with 70 additions and 39 deletions
@@ -5,6 +5,7 @@
#define PERSISTENCE_FISH_MATERIAL "fish_material"
#define PERSISTENCE_FISH_CATCHER "fish_catcher"
#define PERSISTENCE_FISH_CATCH_DATE "fish_catch_date"
#define PERSISTENCE_FISH_TRAITS "fish_traits"
///Instantiate a fish, then set its size, weight, eventually materials and finally add it to the mount.
/datum/controller/subsystem/persistence/proc/load_trophy_fish(obj/structure/fish_mount/mount)
@@ -23,7 +24,15 @@
if(!fish_path) //the fish was removed, uh uh.
return
var/obj/item/fish/fish = new fish_path(mount, /* apply_qualities = */ FALSE)
fish.fish_traits.Cut()
var/list/traits_text = data[PERSISTENCE_FISH_TRAITS]
if(!isnull(traits_text))
var/list/traits = list()
for(var/text_path in traits_text)
var/path = text2path(text_path)
if(path)
traits |= path
fish.fish_traits = traits
fish.apply_traits()
fish.update_size_and_weight(data[PERSISTENCE_FISH_SIZE], data[PERSISTENCE_FISH_WEIGHT])
var/material_path = text2path(data[PERSISTENCE_FISH_MATERIAL])
if(material_path)
@@ -34,8 +43,8 @@
fish.persistence_load(data)
fish.name = data[PERSISTENCE_FISH_NAME]
fish.set_status(FISH_DEAD, silent = TRUE)
fish.catch_date = data[PERSISTENCE_FISH_CATCH_DATE]
mount.add_fish(fish, from_persistence = TRUE, catcher = data[PERSISTENCE_FISH_CATCHER])
mount.catch_date = data[PERSISTENCE_FISH_CATCH_DATE]
/datum/controller/subsystem/persistence/proc/save_trophy_fish(obj/structure/fish_mount/mount)
var/obj/item/fish/fish = mount.mounted_fish
@@ -56,8 +65,12 @@
data[PERSISTENCE_FISH_WEIGHT] = fish.weight / fish.material_weight_mult
var/datum/material/material = fish.get_master_material()
data[PERSISTENCE_FISH_MATERIAL] = "[material?.type]"
data[PERSISTENCE_FISH_CATCHER] = mount.catcher_name
data[PERSISTENCE_FISH_CATCH_DATE] = mount.catch_date
data[PERSISTENCE_FISH_CATCHER] = fish.catcher_name
data[PERSISTENCE_FISH_CATCH_DATE] = fish.catch_date
var/list/traits = list()
for(var/trait_path in fish.fish_traits)
traits += "[trait_path]"
data[PERSISTENCE_FISH_TRAITS] = traits
fish.persistence_save(data)
trophy_fishes_database.set_key(mount.persistence_id, data)
@@ -69,3 +82,4 @@
#undef PERSISTENCE_FISH_MATERIAL
#undef PERSISTENCE_FISH_CATCHER
#undef PERSISTENCE_FISH_CATCH_DATE
#undef PERSISTENCE_FISH_TRAITS