From 80c4e66b2bc4ded8192c1797a47a3674bc831e02 Mon Sep 17 00:00:00 2001 From: Flowaria Date: Thu, 31 Oct 2024 20:37:34 +0900 Subject: [PATCH] VeneratedLocketBanList. --- CalPlayer/CalamityPlayer.cs | 15 +++----- CalamityLists.cs | 21 ------------ ModSupport/ModCalls.cs | 4 +-- Systems/Collections/VeneratedLocketBanList.cs | 34 +++++++++++++++++++ 4 files changed, 41 insertions(+), 33 deletions(-) create mode 100644 Systems/Collections/VeneratedLocketBanList.cs diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index fed35514bf..3d5ecfc8e3 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -12,7 +12,6 @@ using CalamityMod.CalPlayer.Dashes; using CalamityMod.Cooldowns; using CalamityMod.DataStructures; using CalamityMod.Dusts; -using CalamityMod.Enums; using CalamityMod.Events; using CalamityMod.FluidSimulation; using CalamityMod.Items; @@ -53,20 +52,16 @@ using CalamityMod.Projectiles.Summon; using CalamityMod.Projectiles.Typeless; using CalamityMod.Systems; using CalamityMod.Systems.Collections; -using CalamityMod.Waters; using CalamityMod.World; using Microsoft.Xna.Framework; using Terraria; using Terraria.Audio; using Terraria.DataStructures; -using Terraria.GameContent; -using Terraria.GameContent.Liquid; using Terraria.GameInput; using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.ModLoader; using Terraria.ModLoader.IO; -using Terraria.Utilities.Terraria.Utilities; using static Terraria.ModLoader.ModContent; namespace CalamityMod.CalPlayer @@ -1158,18 +1153,18 @@ namespace CalamityMod.CalPlayer public bool ZoneRadiantReefs => Player.InModBiome(); public bool ZoneGleamingBurrows => Player.InModBiome(); public bool ZoneBasaltGully => Player.InModBiome(); - + public bool ZoneSulphur => Player.InModBiome(); public bool ZoneAbyss => ZoneAbyssLayer1 || ZoneAbyssLayer2 || ZoneAbyssLayer3 || ZoneAbyssLayer4; public bool ZoneAbyssLayer1 => Player.InModBiome(); public bool ZoneAbyssLayer2 => Player.InModBiome(); public bool ZoneAbyssLayer3 => Player.InModBiome(); public bool ZoneAbyssLayer4 => Player.InModBiome(); - + public bool ZoneFloralParadise => Player.InModBiome(); - + public bool ZoneCalamity => Player.InModBiome(); - + public bool ZoneAstral => Player.InModBiome() && !ZoneAbyss; public bool InAnyCalamityBiome => ZoneAbyss || ZoneCalamity || ZoneFloralParadise || ZoneSulphur || ZoneSunkenSea || ZoneAstral; @@ -4168,7 +4163,7 @@ namespace CalamityMod.CalPlayer var LocketSource = Player.GetSource_Accessory(FindAccessory(ModContent.ItemType())); if (item.CountsAsClass()) { - if (!CalamityLists.VeneratedLocketBanlist.Contains(item.type)) + if (!VeneratedLocketBanList.Includes(item.type)) { float veneratedCloneSpeed = item.shootSpeed; Vector2 realPlayerPos = Player.RotatedRelativePoint(Player.MountedCenter, true); diff --git a/CalamityLists.cs b/CalamityLists.cs index 2218258613..24dea356cf 100644 --- a/CalamityLists.cs +++ b/CalamityLists.cs @@ -3,7 +3,6 @@ using System.Collections.Generic; using CalamityMod.BiomeManagers; using CalamityMod.Enums; using CalamityMod.Items.DraedonMisc; -using CalamityMod.Items.Weapons.Rogue; using CalamityMod.NPCs.AquaticScourge; using CalamityMod.NPCs.AstrumAureus; using CalamityMod.NPCs.AstrumDeus; @@ -52,8 +51,6 @@ namespace CalamityMod public static List DisabledSummonerNerfItems; public static List DisabledSummonerNerfMinions; - public static List VeneratedLocketBanlist; //To ban projectiles from locket, mainly spikeballs altho Toasty asked me to add mod calls for adding stuff like Dreamtastic - /// /// Each Sunken Sea subbiome has a correspoding spawn condition boolean value and a biome type. /// @@ -61,10 +58,6 @@ namespace CalamityMod public override void OnModLoad() { - // Lists of enemies that resist piercing to some extent (mostly worms). - // Could prove useful for other things as well. - - // Collections BossRushHPChanges = new SortedDictionary { @@ -260,18 +253,6 @@ namespace CalamityMod DisabledSummonerNerfItems = new(); DisabledSummonerNerfMinions = new(); - VeneratedLocketBanlist = new List() - { - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType() - }; - SunkenSeaBiomeCorrespondentValues = new() { { SunkenSeaBiomeFlags.UndergroundDesert, (spawnInfo => spawnInfo.Player.ZoneDesert, -1 /* None needed. */) }, @@ -298,8 +279,6 @@ namespace CalamityMod DisabledSummonerNerfItems = null; DisabledSummonerNerfMinions = null; - VeneratedLocketBanlist = null; - SunkenSeaBiomeCorrespondentValues = null; } } diff --git a/ModSupport/ModCalls.cs b/ModSupport/ModCalls.cs index 934efc430c..8d056b58c5 100644 --- a/ModSupport/ModCalls.cs +++ b/ModSupport/ModCalls.cs @@ -949,9 +949,9 @@ namespace CalamityMod #region Venerated Locket Bans public static bool AddToVeneratedLocketBanlist(int type) { - if (!CalamityLists.VeneratedLocketBanlist.Contains(type)) + if (!VeneratedLocketBanList.Includes(type)) { - CalamityLists.VeneratedLocketBanlist.Add(type); + VeneratedLocketBanList.List.Add(type); return true; } return false; diff --git a/Systems/Collections/VeneratedLocketBanList.cs b/Systems/Collections/VeneratedLocketBanList.cs new file mode 100644 index 0000000000..bc241f08ac --- /dev/null +++ b/Systems/Collections/VeneratedLocketBanList.cs @@ -0,0 +1,34 @@ +using System.Collections.Generic; +using CalamityMod.Items.Weapons.Rogue; +using Terraria.ModLoader; +using static Terraria.ModLoader.ModContent; + +namespace CalamityMod.Systems.Collections +{ + /// + /// To ban projectiles from locket, mainly spikeballs altho Toasty asked me to add mod calls for adding stuff like Dreamtastic + /// + public sealed class VeneratedLocketBanList : ModSystem + { + public static IList List { get; private set; } + + public override void OnModLoad() + { + List = + [ + ItemType(), + ItemType(), + ItemType(), + ItemType(), + ItemType(), + ItemType(), + ItemType(), + ItemType() + ]; + } + + public override void Unload() => List = null; + + public static bool Includes(int itemType) => List.Contains(itemType); + } +}