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

◆ DrawProj_TrueNightsEdge()

void Terraria.Main.DrawProj_TrueNightsEdge ( Projectile proj)
inlineprivate

Definition at line 25955 of file Main.cs.

25956 {
25959 Vector2 origin = rectangle.Size() / 2f;
25960 float num = proj.scale * 1.1f;
25961 SpriteEffects effects = ((!(proj.ai[0] >= 0f)) ? SpriteEffects.FlipVertically : SpriteEffects.None);
25962 float num2 = 0.975f;
25963 float fromValue = Lighting.GetColor(proj.Center.ToTileCoordinates()).ToVector3().Length() / (float)Math.Sqrt(3.0);
25964 fromValue = Utils.Remap(fromValue, 0.2f, 1f, 0f, 1f);
25965 float num3 = MathHelper.Min(0.15f + fromValue * 0.85f, Utils.Remap(proj.localAI[0], 30f, 96f, 1f, 0f));
25966 _ = proj.Size / 2f;
25967 float num4 = 2f;
25968 for (float num5 = num4; num5 >= 0f; num5 -= 1f)
25969 {
25970 if (!(proj.oldPos[(int)num5] == Vector2.Zero))
25971 {
25972 Vector2 vector = proj.Center - proj.velocity * 0.5f * num5;
25973 float num6 = proj.oldRot[(int)num5] + proj.ai[0] * ((float)Math.PI * 2f) * 0.1f * (0f - num5);
25974 Vector2 position = vector - screenPosition;
25975 float num7 = 1f - num5 / num4;
25976 float num8 = proj.Opacity * num7 * num7 * 0.85f;
25977 float amount = proj.Opacity * proj.Opacity;
25979 spriteBatch.Draw(val.Value, position, rectangle, color * num3 * num8, num6 + proj.ai[0] * ((float)Math.PI / 4f) * -1f, origin, num * num2, effects, 0f);
25981 Microsoft.Xna.Framework.Color color3 = Microsoft.Xna.Framework.Color.White * num8 * 0.5f;
25982 color3.A = (byte)((float)(int)color3.A * (1f - num3));
25984 color4.G = (byte)((float)(int)color4.G * num3);
25985 color4.R = (byte)((float)(int)color4.R * (0.25f + num3 * 0.75f));
25986 float num9 = 3f;
25987 for (float num10 = (float)Math.PI * -2f + (float)Math.PI * 2f / num9; num10 < 0f; num10 += (float)Math.PI * 2f / num9)
25988 {
25989 float num11 = Utils.Remap(num10, (float)Math.PI * -2f, 0f, 0f, 0.5f);
25990 spriteBatch.Draw(val.Value, position, rectangle, color4 * 0.15f * num11, num6 + proj.ai[0] * 0.01f + num10, origin, num, effects, 0f);
25991 spriteBatch.Draw(val.Value, position, rectangle, Microsoft.Xna.Framework.Color.Lerp(new Microsoft.Xna.Framework.Color(80, 30, 160), new Microsoft.Xna.Framework.Color(200, 255, 0), amount) * fromValue * num8 * num11, num6 + num10, origin, num * 0.8f, effects, 0f);
25992 spriteBatch.Draw(val.Value, position, rectangle, color2 * fromValue * num8 * MathHelper.Lerp(0.05f, 0.4f, fromValue) * num11, num6 + num10, origin, num * num2, effects, 0f);
25993 spriteBatch.Draw(val.Value, position, val.Frame(1, 4, 0, 3), Microsoft.Xna.Framework.Color.White * MathHelper.Lerp(0.05f, 0.5f, fromValue) * num8 * num11, num6 + num10, origin, num, effects, 0f);
25994 }
25995 spriteBatch.Draw(val.Value, position, rectangle, color4 * 0.15f, num6 + proj.ai[0] * 0.01f, origin, num, effects, 0f);
25996 spriteBatch.Draw(val.Value, position, rectangle, Microsoft.Xna.Framework.Color.Lerp(new Microsoft.Xna.Framework.Color(80, 30, 160), new Microsoft.Xna.Framework.Color(200, 255, 0), amount) * num3 * num8, num6, origin, num * 0.8f, effects, 0f);
25997 spriteBatch.Draw(val.Value, position, rectangle, color2 * fromValue * num8 * MathHelper.Lerp(0.05f, 0.4f, num3), num6, origin, num * num2, effects, 0f);
25998 spriteBatch.Draw(val.Value, position, val.Frame(1, 4, 0, 3), Microsoft.Xna.Framework.Color.White * MathHelper.Lerp(0.05f, 0.5f, num3) * num8, num6, origin, num, effects, 0f);
25999 }
26000 }
26001 float num12 = 1f - proj.localAI[0] * 1f / 80f;
26002 if (num12 < 0.5f)
26003 {
26004 num12 = 0.5f;
26005 }
26006 Vector2 drawpos = proj.Center - screenPosition + (proj.rotation + 0.47123894f * proj.ai[0]).ToRotationVector2() * ((float)val.Width() * 0.5f - 4f) * num * num12;
26007 float num13 = MathHelper.Min(num3, MathHelper.Lerp(1f, fromValue, Utils.Remap(proj.localAI[0], 0f, 80f, 0f, 1f)));
26008 DrawPrettyStarSparkle(proj.Opacity, SpriteEffects.None, drawpos, new Microsoft.Xna.Framework.Color(255, 255, 255, 0) * proj.Opacity * 0.5f * num13, new Microsoft.Xna.Framework.Color(150, 255, 100) * num13, proj.Opacity, 0f, 1f, 1f, 2f, (float)Math.PI / 4f, new Vector2(2f, 2f), Vector2.One);
26009 }
static float Lerp(float value1, float value2, float amount)
Definition MathHelper.cs:53
static float Min(float value1, float value2)
Definition MathHelper.cs:36
static double Sqrt(double d)
const double PI
Definition Math.cs:16
static Asset< Texture2D >[] Projectile
static void DrawPrettyStarSparkle(float opacity, SpriteEffects dir, Vector2 drawpos, Microsoft.Xna.Framework.Color drawColor, Microsoft.Xna.Framework.Color shineColor, float flareCounter, float fadeInStart, float fadeInEnd, float fadeOutStart, float fadeOutEnd, float rotation, Vector2 scale, Vector2 fatness)
Definition Main.cs:32485
static SpriteBatch spriteBatch
Definition Main.cs:974
static Vector2 screenPosition
Definition Main.cs:1715
static Color Lerp(Color value1, Color value2, float amount)
Definition Color.cs:491

References Terraria.Main.DrawPrettyStarSparkle(), Terraria.Lighting.GetColor(), Microsoft.Xna.Framework.Color.Lerp(), Microsoft.Xna.Framework.MathHelper.Lerp(), Microsoft.Xna.Framework.MathHelper.Min(), Microsoft.Xna.Framework.Vector2.One, System.Math.PI, Terraria.GameContent.TextureAssets.Projectile, Terraria.Utils.Remap(), Terraria.Main.screenPosition, Terraria.Main.spriteBatch, System.Math.Sqrt(), and Microsoft.Xna.Framework.Vector2.Zero.

Referenced by Terraria.Main.DrawProjDirect().