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

◆ DrawProj_FairyQueenLance()

void Terraria.Main.DrawProj_FairyQueenLance ( Projectile proj)
inlineprivate

Definition at line 33056 of file Main.cs.

33057 {
33058 Vector2 vector = proj.Center - screenPosition;
33059 int num = 40;
33060 int num2 = 180 * num;
33061 num2 /= 2;
33062 Microsoft.Xna.Framework.Color color = proj.AI_171_GetColor();
33064 color.A = 0;
33065 color2.A /= 2;
33066 Texture2D value = TextureAssets.Extra[178].Value;
33067 Vector2 origin = value.Frame().Size() * new Vector2(0f, 0.5f);
33068 Vector2 scale = new Vector2(num2 / value.Width, 2f);
33069 Vector2 scale2 = new Vector2((float)(num2 / value.Width) * 0.5f, 2f);
33070 Microsoft.Xna.Framework.Color color3 = color * Utils.GetLerpValue(60f, 55f, proj.localAI[0], clamped: true) * Utils.GetLerpValue(0f, 10f, proj.localAI[0], clamped: true);
33071 spriteBatch.Draw(value, vector, null, color3, proj.rotation, origin, scale2, SpriteEffects.None, 0f);
33072 spriteBatch.Draw(value, vector, null, color3 * 0.3f, proj.rotation, origin, scale, SpriteEffects.None, 0f);
33074 Vector2 origin2 = value2.Frame().Size() / 2f;
33075 Microsoft.Xna.Framework.Color color4 = Microsoft.Xna.Framework.Color.White * Utils.GetLerpValue(0f, 20f, proj.localAI[0], clamped: true);
33076 color4.A /= 2;
33077 float num3 = MathHelper.Lerp(0.7f, 1f, Utils.GetLerpValue(55f, 60f, proj.localAI[0], clamped: true));
33078 float lerpValue = Utils.GetLerpValue(10f, 60f, proj.localAI[0]);
33079 if (lerpValue > 0f)
33080 {
33081 float lerpValue2 = Utils.GetLerpValue(0f, 1f, proj.velocity.Length(), clamped: true);
33082 for (float num4 = 1f; num4 > 0f; num4 -= 1f / 6f)
33083 {
33084 Vector2 vector2 = proj.rotation.ToRotationVector2() * -120f * num4 * lerpValue2;
33085 spriteBatch.Draw(value2, vector + vector2, null, color * lerpValue * (1f - num4), proj.rotation, origin2, num3, SpriteEffects.None, 0f);
33086 spriteBatch.Draw(value2, vector + vector2, null, new Microsoft.Xna.Framework.Color(255, 255, 255, 0) * 0.15f * lerpValue * (1f - num4), proj.rotation, origin2, num3 * 0.85f, SpriteEffects.None, 0f);
33087 }
33088 for (float num5 = 0f; num5 < 1f; num5 += 0.25f)
33089 {
33090 Vector2 vector3 = (num5 * ((float)Math.PI * 2f) + proj.rotation).ToRotationVector2() * 2f * num3;
33091 spriteBatch.Draw(value2, vector + vector3, null, color2 * lerpValue, proj.rotation, origin2, num3, SpriteEffects.None, 0f);
33092 }
33093 spriteBatch.Draw(value2, vector, null, color2 * lerpValue, proj.rotation, origin2, num3 * 1.1f, SpriteEffects.None, 0f);
33094 }
33095 spriteBatch.Draw(value2, vector, null, color4, proj.rotation, origin2, num3, SpriteEffects.None, 0f);
33096 }
static float Lerp(float value1, float value2, float amount)
Definition MathHelper.cs:53
const double PI
Definition Math.cs:16
static Asset< Texture2D >[] Projectile
static Asset< Texture2D >[] Extra
static SpriteBatch spriteBatch
Definition Main.cs:974
static Vector2 screenPosition
Definition Main.cs:1715

References Terraria.GameContent.TextureAssets.Extra, Terraria.Utils.GetLerpValue(), Microsoft.Xna.Framework.MathHelper.Lerp(), System.Math.PI, Terraria.GameContent.TextureAssets.Projectile, Terraria.Main.screenPosition, Terraria.Main.spriteBatch, System.value, and Microsoft.Xna.Framework.Graphics.Vector2.

Referenced by Terraria.Main.DrawProjDirect().