From 14792e20b87dbcb7abc79e4f4d200d1ff8e438cb Mon Sep 17 00:00:00 2001 From: Flowaria Date: Wed, 16 Oct 2024 23:13:41 +0900 Subject: [PATCH] HighTestFishingPoleList. --- CalPlayer/CalamityPlayerMiscEffects.cs | 2 +- CalamityLists.cs | 12 -------- Items/Fishing/FishingRods/EarlyBloomRod.cs | 5 ++++ .../Fishing/FishingRods/TheDevourerofCods.cs | 5 ++++ .../Collections/HighTestFishingPoleList.cs | 28 +++++++++++++++++++ 5 files changed, 39 insertions(+), 13 deletions(-) create mode 100644 Systems/Collections/HighTestFishingPoleList.cs diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index ad83d7c6ed..499db82c0e 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -3081,7 +3081,7 @@ namespace CalamityMod.CalPlayer } } - if (CalamityLists.highTestFishList.Contains(Player.ActiveItem().type)) + if (HighTestFishingPoleList.IsHighTestFishingPole(Player.ActiveItem())) Player.accFishingLine = true; if (planarSpeedBoost != 0) diff --git a/CalamityLists.cs b/CalamityLists.cs index d599816cf4..329cf64be8 100644 --- a/CalamityLists.cs +++ b/CalamityLists.cs @@ -77,8 +77,6 @@ namespace CalamityMod { public sealed class CalamityLists : ModSystem { - public static List scopedWeaponList; - public static List highTestFishList; public static List forceItemList; public static List livingFireBlockList; public static List amalgamBuffList; @@ -143,14 +141,6 @@ namespace CalamityMod public override void OnModLoad() { - // TODO -- override HoldItem => Player.accFishingLine = true; on these items, just like the scope fix... - highTestFishList = new List() - { - ItemID.GoldenFishingRod, - ItemType(), - ItemType() - }; - forceItemList = new List() { ItemType(), @@ -1389,8 +1379,6 @@ namespace CalamityMod public override void Unload() { - scopedWeaponList = null; - highTestFishList = null; forceItemList = null; livingFireBlockList = null; amalgamBuffList = null; diff --git a/Items/Fishing/FishingRods/EarlyBloomRod.cs b/Items/Fishing/FishingRods/EarlyBloomRod.cs index 2c536a12f5..fa92d6cf33 100644 --- a/Items/Fishing/FishingRods/EarlyBloomRod.cs +++ b/Items/Fishing/FishingRods/EarlyBloomRod.cs @@ -27,6 +27,11 @@ namespace CalamityMod.Items.Fishing.FishingRods Item.rare = ModContent.RarityType(); } + public override void HoldItem(Player player) + { + player.accFishingLine = true; + } + public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { for (int i = 0; i < 6; i++) diff --git a/Items/Fishing/FishingRods/TheDevourerofCods.cs b/Items/Fishing/FishingRods/TheDevourerofCods.cs index 62d2e6cc12..c05b8bb2ec 100644 --- a/Items/Fishing/FishingRods/TheDevourerofCods.cs +++ b/Items/Fishing/FishingRods/TheDevourerofCods.cs @@ -33,6 +33,11 @@ namespace CalamityMod.Items.Fishing.FishingRods Item.rare = ModContent.RarityType(); } + public override void HoldItem(Player player) + { + player.accFishingLine = true; + } + public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { for (int i = 0; i < 10; i++) diff --git a/Systems/Collections/HighTestFishingPoleList.cs b/Systems/Collections/HighTestFishingPoleList.cs new file mode 100644 index 0000000000..743f869edd --- /dev/null +++ b/Systems/Collections/HighTestFishingPoleList.cs @@ -0,0 +1,28 @@ +using System.Collections.Generic; +using CalamityMod.Items.Fishing.FishingRods; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using static Terraria.ModLoader.ModContent; + +namespace CalamityMod.Systems.Collections +{ + public sealed class HighTestFishingPoleList : ModSystem + { + public static IList List { get; private set; } + + public override void OnModLoad() + { + List = + [ + ItemID.GoldenFishingRod, + ItemType(), + ItemType() + ]; + } + + public override void Unload() => List = null; + + public static bool IsHighTestFishingPole(Item item) => List.Contains(item.type); + } +}