Merge branch 'master' of https://github.com/Skyrat-SS13/Skyrat-tg into upstream-24-10a

This commit is contained in:
Majkl-J
2024-10-20 04:12:02 -07:00
1411 changed files with 131464 additions and 65514 deletions
@@ -1,7 +1,33 @@
/**
* So far, only used by the fishing minigame. Feel free to rename it to something like veryfastprocess
* if you need one that fires 10 times a second
*/
/// subsystem for the fishing minigame processing.
PROCESSING_SUBSYSTEM_DEF(fishing)
name = "Fishing"
wait = 0.1 SECONDS
flags = SS_BACKGROUND|SS_POST_FIRE_TIMING
wait = 0.05 SECONDS // If you raise it to 0.1 SECONDS, you better also modify [datum/fish_movement/move_fish()]
///Cached fish properties so we don't have to initalize fish every time
var/list/fish_properties
///A cache of fish that can be caught by each type of fishing lure
var/list/lure_catchables
/datum/controller/subsystem/processing/fishing/Initialize()
///init the properties
fish_properties = list()
for(var/fish_type in subtypesof(/obj/item/fish))
var/obj/item/fish/fish = new fish_type(null, FALSE)
fish_properties[fish_type] = list()
fish_properties[fish_type][FISH_PROPERTIES_FAV_BAIT] = fish.favorite_bait.Copy()
fish_properties[fish_type][FISH_PROPERTIES_BAD_BAIT] = fish.disliked_bait.Copy()
fish_properties[fish_type][FISH_PROPERTIES_TRAITS] = fish.fish_traits.Copy()
qdel(fish)
///init the list of things lures can catch
lure_catchables = list()
var/list/fish_types = subtypesof(/obj/item/fish)
for(var/lure_type in typesof(/obj/item/fishing_lure))
var/obj/item/fishing_lure/lure = new lure_type
lure_catchables[lure_type] = list()
for(var/obj/item/fish/fish_type as anything in fish_types)
if(lure.is_catchable_fish(fish_type, fish_properties[fish_type]))
lure_catchables[lure_type] += fish_type
qdel(lure)
return SS_INIT_SUCCESS