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

◆ DrawProj_NightsEdge()

void Terraria.Main.DrawProj_NightsEdge ( Projectile proj)
inlineprivate

Definition at line 25807 of file Main.cs.

25808 {
25809 Vector2 vector = proj.Center - screenPosition;
25812 Vector2 origin = rectangle.Size() / 2f;
25813 float num = proj.scale * 1.1f;
25814 SpriteEffects effects = ((!(proj.ai[0] >= 0f)) ? SpriteEffects.FlipVertically : SpriteEffects.None);
25815 float num2 = proj.localAI[0] / proj.ai[1];
25816 float num3 = Utils.Remap(num2, 0f, 0.6f, 0f, 1f) * Utils.Remap(num2, 0.6f, 1f, 1f, 0f);
25817 float num4 = 0.975f;
25818 float fromValue = Lighting.GetColor(proj.Center.ToTileCoordinates()).ToVector3().Length() / (float)Math.Sqrt(3.0);
25819 fromValue = Utils.Remap(fromValue, 0.2f, 1f, 0f, 1f);
25821 spriteBatch.Draw(val.Value, vector, rectangle, color * fromValue * num3, proj.rotation + proj.ai[0] * ((float)Math.PI / 4f) * -1f * (1f - num2), origin, num * num4, effects, 0f);
25823 Microsoft.Xna.Framework.Color color3 = Microsoft.Xna.Framework.Color.White * num3 * 0.5f;
25824 color3.A = (byte)((float)(int)color3.A * (1f - fromValue));
25826 color4.G = (byte)((float)(int)color4.G * fromValue);
25827 color4.R = (byte)((float)(int)color4.R * (0.25f + fromValue * 0.75f));
25828 spriteBatch.Draw(val.Value, vector, rectangle, color4 * 0.15f, proj.rotation + proj.ai[0] * 0.01f, origin, num, effects, 0f);
25829 spriteBatch.Draw(val.Value, vector, rectangle, new Microsoft.Xna.Framework.Color(80, 30, 160) * fromValue * num3 * 0.3f, proj.rotation, origin, num * 0.8f, effects, 0f);
25830 spriteBatch.Draw(val.Value, vector, rectangle, color2 * fromValue * num3 * 0.7f, proj.rotation, origin, num * num4, effects, 0f);
25831 spriteBatch.Draw(val.Value, vector, val.Frame(1, 4, 0, 3), Microsoft.Xna.Framework.Color.White * 0.3f * num3 * (1f - fromValue * 0.7f), proj.rotation + proj.ai[0] * 0.01f, origin, num, effects, 0f);
25832 Vector2 drawpos = vector + (proj.rotation + Utils.Remap(num2, 0f, 1f, 0f, (float)Math.PI / 2f) * proj.ai[0]).ToRotationVector2() * ((float)val.Width() * 0.5f - 4f) * num;
25833 DrawPrettyStarSparkle(proj.Opacity, SpriteEffects.None, drawpos, new Microsoft.Xna.Framework.Color(255, 255, 255, 0) * num3 * 0.5f, color2, num2, 0f, 0.5f, 0.5f, 1f, (float)Math.PI / 4f, new Vector2(2f, 2f), Vector2.One);
25834 }
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

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

Referenced by Terraria.Main.DrawProjDirect().