TModLoader v1.4.4.9
TModLoader source code documentation
Loading...
Searching...
No Matches

◆ DrawInterface_Resources_Breath()

static void Terraria.Main.DrawInterface_Resources_Breath ( )
inlinestaticprivate

Definition at line 56048 of file Main.cs.

56049 {
56050 //IL_009e: Unknown result type (might be due to invalid IL or missing references)
56051 //IL_00b8: Unknown result type (might be due to invalid IL or missing references)
56052 //IL_00bd: Unknown result type (might be due to invalid IL or missing references)
56053 //IL_00c2: Unknown result type (might be due to invalid IL or missing references)
56054 //IL_00f5: Unknown result type (might be due to invalid IL or missing references)
56055 //IL_00f6: Unknown result type (might be due to invalid IL or missing references)
56056 //IL_00fb: Unknown result type (might be due to invalid IL or missing references)
56057 //IL_0105: Unknown result type (might be due to invalid IL or missing references)
56058 //IL_010a: Unknown result type (might be due to invalid IL or missing references)
56059 //IL_010f: Unknown result type (might be due to invalid IL or missing references)
56060 //IL_0133: Unknown result type (might be due to invalid IL or missing references)
56061 //IL_0139: Unknown result type (might be due to invalid IL or missing references)
56062 //IL_013e: Unknown result type (might be due to invalid IL or missing references)
56063 //IL_02a0: Unknown result type (might be due to invalid IL or missing references)
56064 //IL_02dc: Unknown result type (might be due to invalid IL or missing references)
56065 //IL_02e1: Unknown result type (might be due to invalid IL or missing references)
56066 //IL_02fc: Unknown result type (might be due to invalid IL or missing references)
56067 //IL_030e: Unknown result type (might be due to invalid IL or missing references)
56068 //IL_031a: Unknown result type (might be due to invalid IL or missing references)
56069 //IL_0320: Unknown result type (might be due to invalid IL or missing references)
56070 //IL_0472: Unknown result type (might be due to invalid IL or missing references)
56071 //IL_04ae: Unknown result type (might be due to invalid IL or missing references)
56072 //IL_04b3: Unknown result type (might be due to invalid IL or missing references)
56073 //IL_04ce: Unknown result type (might be due to invalid IL or missing references)
56074 //IL_04e0: Unknown result type (might be due to invalid IL or missing references)
56075 //IL_04ec: Unknown result type (might be due to invalid IL or missing references)
56076 //IL_04f2: Unknown result type (might be due to invalid IL or missing references)
56077 bool flag = false;
56078 if (player[myPlayer].dead)
56079 {
56080 return;
56081 }
56082 if (player[myPlayer].lavaTime < player[myPlayer].lavaMax && player[myPlayer].lavaWet)
56083 {
56084 flag = true;
56085 }
56086 else if (player[myPlayer].lavaTime < player[myPlayer].lavaMax && player[myPlayer].breath == player[myPlayer].breathMax)
56087 {
56088 flag = true;
56089 }
56090 Vector2 vector = player[myPlayer].Top + new Vector2(0f, player[myPlayer].gfxOffY);
56091 if (playerInventory && screenHeight < 1000)
56092 {
56093 vector.Y += player[myPlayer].height - 20;
56094 }
56095 vector = Vector2.Transform(vector - screenPosition, GameViewMatrix.ZoomMatrix);
56096 if (!playerInventory || screenHeight >= 1000)
56097 {
56098 vector.Y -= 100f;
56099 }
56100 vector /= UIScale;
56101 if (ingameOptionsWindow || InGameUI.IsVisible)
56102 {
56103 ((Vector2)(ref vector))._002Ector((float)(screenWidth / 2), (float)(screenHeight / 2 + 236));
56104 if (InGameUI.IsVisible)
56105 {
56106 vector.Y = screenHeight - 64;
56107 }
56108 }
56109 if (player[myPlayer].breath < player[myPlayer].breathMax && !player[myPlayer].ghost && !flag)
56110 {
56111 _ = player[myPlayer].breathMax / 20;
56112 int num = 20;
56113 for (int i = 1; i < player[myPlayer].breathMax / num + 1; i++)
56114 {
56115 int num5 = 255;
56116 float num6 = 1f;
56117 if (player[myPlayer].breath >= i * num)
56118 {
56119 num5 = 255;
56120 }
56121 else
56122 {
56123 float num7 = (float)(player[myPlayer].breath - (i - 1) * num) / (float)num;
56124 num5 = (int)(30f + 225f * num7);
56125 if (num5 < 30)
56126 {
56127 num5 = 30;
56128 }
56129 num6 = num7 / 4f + 0.75f;
56130 if ((double)num6 < 0.75)
56131 {
56132 num6 = 0.75f;
56133 }
56134 }
56135 int num8 = 0;
56136 int num9 = 0;
56137 if (i > 10)
56138 {
56139 num8 -= 260;
56140 num9 += 26;
56141 }
56142 spriteBatch.Draw(TextureAssets.Bubble.Value, vector + new Vector2((float)(26 * (i - 1) + num8) - 125f, 32f + ((float)TextureAssets.Bubble.Height() - (float)TextureAssets.Bubble.Height() * num6) / 2f + (float)num9), (Rectangle?)new Rectangle(0, 0, TextureAssets.Bubble.Width(), TextureAssets.Bubble.Height()), new Color(num5, num5, num5, num5), 0f, default(Vector2), num6, (SpriteEffects)0, 0f);
56143 }
56144 }
56145 if (!(player[myPlayer].lavaTime < player[myPlayer].lavaMax && !player[myPlayer].ghost && flag))
56146 {
56147 return;
56148 }
56149 int num10 = player[myPlayer].lavaMax / 10;
56150 _ = player[myPlayer].breathMax / num10;
56151 for (int j = 1; j < player[myPlayer].lavaMax / num10 + 1; j++)
56152 {
56153 int num11 = 255;
56154 float num12 = 1f;
56155 if (player[myPlayer].lavaTime >= j * num10)
56156 {
56157 num11 = 255;
56158 }
56159 else
56160 {
56161 float num2 = (float)(player[myPlayer].lavaTime - (j - 1) * num10) / (float)num10;
56162 num11 = (int)(30f + 225f * num2);
56163 if (num11 < 30)
56164 {
56165 num11 = 30;
56166 }
56167 num12 = num2 / 4f + 0.75f;
56168 if ((double)num12 < 0.75)
56169 {
56170 num12 = 0.75f;
56171 }
56172 }
56173 int num3 = 0;
56174 int num4 = 0;
56175 if (j > 10)
56176 {
56177 num3 -= 260;
56178 num4 += 26;
56179 }
56180 spriteBatch.Draw(TextureAssets.Flame.Value, vector + new Vector2((float)(26 * (j - 1) + num3) - 125f, 32f + ((float)TextureAssets.Flame.Height() - (float)TextureAssets.Flame.Height() * num12) / 2f + (float)num4), (Rectangle?)new Rectangle(0, 0, TextureAssets.Bubble.Width(), TextureAssets.Bubble.Height()), new Color(num11, num11, num11, num11), 0f, default(Vector2), num12, (SpriteEffects)0, 0f);
56181 }
56182 }
static Asset< Texture2D > Bubble
static Asset< Texture2D > Flame
static bool ingameOptionsWindow
Definition Main.cs:732
static UserInterface InGameUI
Definition Main.cs:411
static SpriteBatch spriteBatch
Definition Main.cs:1043
static int myPlayer
The index in F:Terraria.Main.player of this client's Player. If this is 255, this client is the ser...
Definition Main.cs:1958
static float UIScale
Definition Main.cs:2782
static int screenHeight
Definition Main.cs:1870
static Vector2 screenPosition
The position of the top left corner of the screen in world coordinates. Modify in M:Terraria....
Definition Main.cs:1864
static SpriteViewMatrix GameViewMatrix
Definition Main.cs:255
static bool playerInventory
Definition Main.cs:1912
static int screenWidth
Definition Main.cs:1868
static Player[] player
Definition Main.cs:1960

References Terraria.GameContent.TextureAssets.Bubble, Terraria.Graphics.Light.Color, Terraria.GameContent.TextureAssets.Flame, Terraria.Main.GameViewMatrix, Terraria.Main.ingameOptionsWindow, Terraria.Main.InGameUI, Terraria.Main.myPlayer, Terraria.Main.player, Terraria.Main.playerInventory, Terraria.Main.screenHeight, Terraria.Main.screenPosition, Terraria.Main.screenWidth, Terraria.Main.spriteBatch, and Terraria.Main.UIScale.

Referenced by Terraria.Main.GUIBarsDrawInner().

+ Here is the caller graph for this function: