Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
DeerclopsBigProgressBar.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 _cache.SetLife(nPC.life, nPC.lifeMax);
33 _headIndex = bossHeadTextureIndex;
34 return true;
35 }
36
37 public void Draw(ref BigProgressBarInfo info, SpriteBatch spriteBatch)
38 {
40 Rectangle barIconFrame = value.Frame();
41 BigProgressBarHelper.DrawFancyBar(spriteBatch, _cache.LifeCurrent, _cache.LifeMax, value, barIconFrame);
42 }
43}
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
static bool IsDeerclopsHostile()
Definition NPC.cs:37117
int GetBossHeadTextureIndex()
Definition NPC.cs:1698
int life
Definition NPC.cs:477