GolemIDList.

This commit is contained in:
Flowaria authored and Cameron Ewell committed 2024-11-13 16:18:35 -05:00
1 parent ef56d94bee
commit 7434f1d5dc
2 files changed
+29 -11

No files matched your search

-11
View File
@@ -45,7 +45,6 @@ namespace CalamityMod
public sealed class CalamityLists : ModSystem
{
public static List<int> DeathModeSplittingWormIDs;
public static List<int> GolemIDs;
public static List<int> BoundNPCIDs;
public static List<int> GrenadeResistIDs;
@@ -90,15 +89,6 @@ namespace CalamityMod
NPCID.SeekerTail
};
GolemIDs = new List<int>
{
NPCID.Golem,
NPCID.GolemHead,
NPCID.GolemHeadFree,
NPCID.GolemFistLeft,
NPCID.GolemFistRight
};
GrenadeResistIDs = new List<int>
{
ProjectileID.Grenade,
@@ -644,7 +634,6 @@ namespace CalamityMod
public override void Unload()
{
DeathModeSplittingWormIDs = null;
GolemIDs = null;
BoundNPCIDs = null;
GrenadeResistIDs = null;
ZeroContactDamageNPCList = null;
+29
View File
@@ -0,0 +1,29 @@
using System.Collections.Generic;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Systems.Collections
{
public sealed class GolemIDList : ModSystem
{
public static IList<int> List { get; private set; }
public override void OnModLoad()
{
List =
[
NPCID.Golem,
NPCID.GolemHead,
NPCID.GolemHeadFree,
NPCID.GolemFistLeft,
NPCID.GolemFistRight
];
}
public override void Unload() => List = null;
public static bool Includes(NPC npc) => List.Contains(npc.type);
public static bool Includes(int npcType) => List.Contains(npcType);
}
}