FriendlyBeesList.
This commit is contained in:
1 parent
cb3e5e07e2
commit
a2fc330e47
3 files changed
+40
-14
No files matched your search
@@ -281,7 +281,7 @@ namespace CalamityMod.CalPlayer
|
||||
|
||||
if (!proj.npcProj && !proj.trap && proj.friendly)
|
||||
{
|
||||
if ((plaguebringerCarapace || uberBees) && CalamityLists.friendlyBeeList.Contains(proj.type))
|
||||
if ((plaguebringerCarapace || uberBees) && FriendlyBeesList.IsFriendlyBee(proj))
|
||||
target.AddBuff(BuffType<Plague>(), 300);
|
||||
|
||||
// All projectiles fired from Soma Prime are marked using CalamityGlobalProjectile
|
||||
|
||||
@@ -77,7 +77,6 @@ namespace CalamityMod
|
||||
{
|
||||
public sealed class CalamityLists : ModSystem
|
||||
{
|
||||
public static List<int> friendlyBeeList;
|
||||
public static List<int> debuffList;
|
||||
public static List<int> fireDebuffList;
|
||||
public static List<int> sicknessDebuffList;
|
||||
@@ -155,17 +154,6 @@ namespace CalamityMod
|
||||
|
||||
public override void OnModLoad()
|
||||
{
|
||||
friendlyBeeList = new List<int>()
|
||||
{
|
||||
ProjectileID.GiantBee,
|
||||
ProjectileID.Bee,
|
||||
ProjectileID.Wasp,
|
||||
ProjectileType<PlaguenadeBee>(),
|
||||
ProjectileType<PlaguePrincess>(),
|
||||
ProjectileType<BabyPlaguebringer>(),
|
||||
ProjectileType<PlagueBeeSmall>()
|
||||
};
|
||||
|
||||
debuffList = new List<int>()
|
||||
{
|
||||
BuffID.Poisoned,
|
||||
@@ -1671,7 +1659,6 @@ namespace CalamityMod
|
||||
|
||||
public override void Unload()
|
||||
{
|
||||
friendlyBeeList = null;
|
||||
debuffList = null;
|
||||
fireDebuffList = null;
|
||||
sicknessDebuffList = null;
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
using System.Collections.Generic;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using CalamityMod.Projectiles.Summon;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using static Terraria.ModLoader.ModContent;
|
||||
|
||||
namespace CalamityMod.Systems.Collections
|
||||
{
|
||||
/// <summary>
|
||||
/// A <see cref="ModSystem"/> that contains a <see cref="IList{T}"/> that has all the Projectile IDs of all friendly bees.
|
||||
/// </summary>
|
||||
public sealed class FriendlyBeesList : ModSystem
|
||||
{
|
||||
public static IList<int> List { get; private set; }
|
||||
|
||||
public override void OnModLoad()
|
||||
{
|
||||
List =
|
||||
[
|
||||
ProjectileID.GiantBee,
|
||||
ProjectileID.Bee,
|
||||
ProjectileID.Wasp,
|
||||
ProjectileType<PlaguenadeBee>(),
|
||||
ProjectileType<PlaguePrincess>(),
|
||||
ProjectileType<BabyPlaguebringer>(),
|
||||
ProjectileType<PlagueBeeSmall>()
|
||||
];
|
||||
}
|
||||
|
||||
public override void Unload() => List = null;
|
||||
|
||||
/// <summary>
|
||||
/// A shorthand method to check if a projectile is a friendly bee.
|
||||
/// </summary>
|
||||
public static bool IsFriendlyBee(Projectile proj) => List.Contains(proj.type);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user