Terraria 1.4.0.5 Source Code
This commit is contained in:
commit
05205f009e
1059 changed files with 563450 additions and 0 deletions
48
GameContent/Shaders/MoonLordScreenShaderData.cs
Normal file
48
GameContent/Shaders/MoonLordScreenShaderData.cs
Normal file
|
@ -0,0 +1,48 @@
|
|||
// Decompiled with JetBrains decompiler
|
||||
// Type: Terraria.GameContent.Shaders.MoonLordScreenShaderData
|
||||
// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null
|
||||
// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83
|
||||
// Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe
|
||||
|
||||
using Terraria.Graphics.Shaders;
|
||||
|
||||
namespace Terraria.GameContent.Shaders
|
||||
{
|
||||
public class MoonLordScreenShaderData : ScreenShaderData
|
||||
{
|
||||
private int _moonLordIndex = -1;
|
||||
private bool _aimAtPlayer;
|
||||
|
||||
public MoonLordScreenShaderData(string passName, bool aimAtPlayer)
|
||||
: base(passName)
|
||||
{
|
||||
this._aimAtPlayer = aimAtPlayer;
|
||||
}
|
||||
|
||||
private void UpdateMoonLordIndex()
|
||||
{
|
||||
if (this._aimAtPlayer || this._moonLordIndex >= 0 && Main.npc[this._moonLordIndex].active && Main.npc[this._moonLordIndex].type == 398)
|
||||
return;
|
||||
int num = -1;
|
||||
for (int index = 0; index < Main.npc.Length; ++index)
|
||||
{
|
||||
if (Main.npc[index].active && Main.npc[index].type == 398)
|
||||
{
|
||||
num = index;
|
||||
break;
|
||||
}
|
||||
}
|
||||
this._moonLordIndex = num;
|
||||
}
|
||||
|
||||
public override void Apply()
|
||||
{
|
||||
this.UpdateMoonLordIndex();
|
||||
if (this._aimAtPlayer)
|
||||
this.UseTargetPosition(Main.LocalPlayer.Center);
|
||||
else if (this._moonLordIndex != -1)
|
||||
this.UseTargetPosition(Main.npc[this._moonLordIndex].Center);
|
||||
base.Apply();
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue