Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
LunarPillarBigProgessBar.cs
Go to the documentation of this file.
3
5
7{
9
10 private int _headIndex;
11
13 {
14 if (info.npcIndexToAimAt < 0 || info.npcIndexToAimAt > 200)
15 {
16 return false;
17 }
18 NPC nPC = Main.npc[info.npcIndexToAimAt];
19 if (!nPC.active)
20 {
21 return false;
22 }
23 int bossHeadTextureIndex = nPC.GetBossHeadTextureIndex();
24 if (bossHeadTextureIndex == -1)
25 {
26 return false;
27 }
29 {
30 return false;
31 }
32 if (nPC.ai[2] == 1f)
33 {
34 return false;
35 }
36 Utils.Clamp((float)nPC.life / (float)nPC.lifeMax, 0f, 1f);
38 _ = 600f * Main.GameModeInfo.EnemyMaxLifeMultiplier * GetMaxShieldValue() / (float)nPC.lifeMax;
39 _cache.SetLife(nPC.life, nPC.lifeMax);
41 _headIndex = bossHeadTextureIndex;
42 return true;
43 }
44
45 public void Draw(ref BigProgressBarInfo info, SpriteBatch spriteBatch)
46 {
48 Rectangle barIconFrame = value.Frame();
50 }
51
52 internal abstract float GetCurrentShieldValue();
53
54 internal abstract float GetMaxShieldValue();
55
56 internal abstract bool IsPlayerInCombatArea();
57}
static float Clamp(float value, float min, float max)
Definition MathHelper.cs:46
static Asset< Texture2D >[] NpcHeadBoss
static void DrawFancyBar(SpriteBatch spriteBatch, float lifeAmount, float lifeMax, Texture2D barIconTexture, Rectangle barIconFrame)
void Draw(ref BigProgressBarInfo info, SpriteBatch spriteBatch)
static NPC[] npc
Definition Main.cs:1685
int lifeMax
Definition NPC.cs:479
float[] ai
Definition NPC.cs:447
int GetBossHeadTextureIndex()
Definition NPC.cs:1698
int life
Definition NPC.cs:477