Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
CommonBossBigProgressBar.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 }
28 _cache.SetLife(nPC.life, nPC.lifeMax);
29 _headIndex = bossHeadTextureIndex;
30 return true;
31 }
32
33 public void Draw(ref BigProgressBarInfo info, SpriteBatch spriteBatch)
34 {
36 Rectangle barIconFrame = value.Frame();
37 BigProgressBarHelper.DrawFancyBar(spriteBatch, _cache.LifeCurrent, _cache.LifeMax, value, barIconFrame);
38 }
39}
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
int GetBossHeadTextureIndex()
Definition NPC.cs:1698
int life
Definition NPC.cs:477