Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
MoonLordScreenShaderData.cs
Go to the documentation of this file.
2
4
6{
7 private int _moonLordIndex = -1;
8
9 private bool _aimAtPlayer;
10
11 public MoonLordScreenShaderData(string passName, bool aimAtPlayer)
12 : base(passName)
13 {
14 _aimAtPlayer = aimAtPlayer;
15 }
16
17 private void UpdateMoonLordIndex()
18 {
19 if (_aimAtPlayer || (_moonLordIndex >= 0 && Main.npc[_moonLordIndex].active && Main.npc[_moonLordIndex].type == 398))
20 {
21 return;
22 }
23 int moonLordIndex = -1;
24 for (int i = 0; i < Main.npc.Length; i++)
25 {
26 if (Main.npc[i].active && Main.npc[i].type == 398)
27 {
28 moonLordIndex = i;
29 break;
30 }
31 }
32 _moonLordIndex = moonLordIndex;
33 }
34
35 public override void Apply()
36 {
38 if (_aimAtPlayer)
39 {
41 }
42 else if (_moonLordIndex != -1)
43 {
45 }
46 base.Apply();
47 }
48}
ScreenShaderData UseTargetPosition(Vector2 position)
static NPC[] npc
Definition Main.cs:1685
static Player LocalPlayer
Definition Main.cs:2829