Fish no longer dies when flopping on safe water. (#90024)

## About The Pull Request
I've been feeling for some time that fishes dying if placed on fishable
water (or lava/plasma for a couple ones) to be kinda lakluster and
counterintuitive. YakumoChen opening an issue about it proved I wasn't
the only one thinking that, and I'm not feeling like starting with
adding fishing stuff just yet. Not without improving the existing
content first.

The source_types file was also getting big and a bit bad to navigate
through, so I've decided to split it into half a dozen distinct files:
fishing portals, rifts, turfs, structures, mining/ruins and surgery.

## Why It's Good For The Game
This fixes #89872.
The files should also be bit more organized now.

## Changelog
🆑
fix: Fish will no longer drown if left half-submerged in a fishable turf
on which it can normally be found. Instead it will disperse after a
while or if starving. Note that this only happens if the fish is native
to such turfs (eg. lavaloop on beach water will still die).
/🆑
This commit is contained in:
Ghom
2025-03-31 16:39:49 +01:00
committed by GitHub
parent 87dfee5d81
commit c9d4d83412
14 changed files with 1208 additions and 1121 deletions
@@ -13,6 +13,8 @@ PROCESSING_SUBSYSTEM_DEF(fishing)
var/list/fish_properties
///A cache of fish that can be caught by each type of fishing lure
var/list/lure_catchables
///A list of fish types with list of turfs where they can happily hop around without dying as assoc value
var/list/fish_safe_turfs_by_type = list()
/datum/controller/subsystem/processing/fishing/Initialize()
..()
@@ -102,4 +104,19 @@ PROCESSING_SUBSYSTEM_DEF(fishing)
QDEL_LIST(spawned_fish)
//Populate the list of safe turfs for several fishes
for(var/source_path in GLOB.preset_fish_sources)
var/datum/fish_source/source = GLOB.preset_fish_sources[source_path]
if(!length(source.associated_safe_turfs))
continue
for(var/fish_path in source.fish_table)
if(!istype(fish_path, /obj/item/fish))
continue
LAZYOR(fish_safe_turfs_by_type[fish_path], source.associated_safe_turfs)
//If a subtype doesn't have set safe turfs, it'll inherit them from the parent type.
for(var/fish_type as anything in fish_safe_turfs_by_type)
for(var/fish_subtype in subtypesof(fish_type))
if(!length(fish_safe_turfs_by_type[fish_subtype]))
fish_safe_turfs_by_type[fish_subtype] = fish_safe_turfs_by_type[fish_type]
return SS_INIT_SUCCESS