Files
CalamityModPublic/NPCs/PlaguebringerGoliath/PbGScreenShaderData.cs
T
Andrew Marheine f41b6e50ad 1 - Cal Clone phase 1 is dead.
2 - Fixed Spaz and Cal Clone rotations.
2021-08-19 00:03:09 -05:00

45 lines
1.1 KiB
C#

using Terraria;
using Terraria.Graphics.Shaders;
using Terraria.ModLoader;
namespace CalamityMod.NPCs.PlaguebringerGoliath
{
public class PbGScreenShaderData : ScreenShaderData
{
private int PbGIndex;
public PbGScreenShaderData(string passName)
: base(passName)
{
}
private void UpdatePbGIndex()
{
int PbGType = ModContent.NPCType<PlaguebringerGoliath>();
if (PbGIndex >= 0 && Main.npc[PbGIndex].active && Main.npc[PbGIndex].type == PbGType)
{
return;
}
PbGIndex = -1;
for (int i = 0; i < Main.npc.Length; i++)
{
if (Main.npc[i].active && Main.npc[i].type == PbGType)
{
PbGIndex = i;
break;
}
}
}
public override void Apply()
{
UpdatePbGIndex();
if (PbGIndex != -1)
{
UseTargetPosition(Main.npc[PbGIndex].Center);
}
base.Apply();
}
}
}