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

◆ DrawProj_PiercingStarlight()

void Terraria.Main.DrawProj_PiercingStarlight ( Projectile proj)
inlineprivate

Definition at line 32988 of file Main.cs.

32989 {
32990 float num = proj.ai[1];
32991 if (num == 0f)
32992 {
32993 num = 1f;
32994 }
32995 int num2 = (int)Math.Ceiling(3f * num);
32996 LoadProjectile(proj.type);
32997 LoadItem(4923);
32998 int num3 = 2;
32999 Vector2 vector = proj.Center - proj.rotation.ToRotationVector2() * num3;
33000 for (int i = 0; i < 1; i++)
33001 {
33002 float num4 = rand.NextFloat();
33003 float num5 = Utils.GetLerpValue(0f, 0.3f, num4, clamped: true) * Utils.GetLerpValue(1f, 0.5f, num4, clamped: true);
33004 Microsoft.Xna.Framework.Color color = proj.GetAlpha(Lighting.GetColor(proj.Center.ToTileCoordinates())) * num5;
33005 Texture2D value = TextureAssets.Item[4923].Value;
33006 Vector2 origin = value.Size() / 2f;
33007 float num6 = rand.NextFloatDirection();
33008 float num7 = 8f + MathHelper.Lerp(0f, 20f, num4) + rand.NextFloat() * 6f;
33009 float num8 = proj.rotation + num6 * ((float)Math.PI * 2f) * 0.04f;
33010 float num9 = num8 + (float)Math.PI / 4f;
33011 Vector2 position = vector + num8.ToRotationVector2() * num7 + rand.NextVector2Circular(8f, 8f) - screenPosition;
33013 if (proj.rotation < -(float)Math.PI / 2f || proj.rotation > (float)Math.PI / 2f)
33014 {
33015 num9 += (float)Math.PI / 2f;
33016 spriteEffects |= SpriteEffects.FlipHorizontally;
33017 }
33018 spriteBatch.Draw(value, position, null, color, num9, origin, 1f, spriteEffects, 0f);
33019 }
33020 for (int j = 0; j < num2; j++)
33021 {
33022 float num10 = rand.NextFloat();
33023 float num11 = Utils.GetLerpValue(0f, 0.3f, num10, clamped: true) * Utils.GetLerpValue(1f, 0.5f, num10, clamped: true);
33024 float amount = Utils.GetLerpValue(0f, 0.3f, num10, clamped: true) * Utils.GetLerpValue(1f, 0.5f, num10, clamped: true);
33025 float num12 = MathHelper.Lerp(0.6f, 1f, amount);
33026 Microsoft.Xna.Framework.Color fairyQueenWeaponsColor = proj.GetFairyQueenWeaponsColor(0.25f, 0f, (rand.NextFloat() * 0.33f + GlobalTimeWrappedHourly) % 1f);
33029 color2 *= num11 * 0.5f;
33030 Vector2 origin2 = value2.Size() / 2f;
33031 Microsoft.Xna.Framework.Color color3 = Microsoft.Xna.Framework.Color.White * num11;
33032 color3.A /= 2;
33034 float num13 = 1f;
33035 float num14 = (num - 1f) / 2f;
33036 float num15 = rand.NextFloat() * 2f * num;
33037 num15 += num14;
33038 float num16 = rand.NextFloatDirection();
33039 Vector2 vector2 = new Vector2(2.8f + num15 * (1f + num14), 1f) * num13 * num12;
33040 float value3 = 50f * num;
33041 Vector2 vector3 = proj.rotation.ToRotationVector2() * ((j >= 1) ? 56 : 0);
33042 float num17 = 0.03f - (float)j * 0.012f;
33043 num17 /= num;
33044 float num18 = 30f + MathHelper.Lerp(0f, value3, num10) + num15 * 16f;
33045 float num19 = proj.rotation + num16 * ((float)Math.PI * 2f) * num17;
33046 float rotation = num19;
33047 Vector2 position2 = vector + num19.ToRotationVector2() * num18 + rand.NextVector2Circular(20f, 20f) + vector3 - screenPosition;
33048 color2 *= num13;
33049 color4 *= num13;
33050 SpriteEffects effects = SpriteEffects.None;
33051 spriteBatch.Draw(value2, position2, null, color2, rotation, origin2, vector2, effects, 0f);
33052 spriteBatch.Draw(value2, position2, null, color4, rotation, origin2, vector2 * 0.6f, effects, 0f);
33053 }
33054 }
static float Lerp(float value1, float value2, float amount)
Definition MathHelper.cs:53
static double Ceiling(double a)
const double PI
Definition Math.cs:16
static Asset< Texture2D >[] Projectile
static Asset< Texture2D >[] Item
void LoadProjectile(int i)
Definition Main.cs:56041
static SpriteBatch spriteBatch
Definition Main.cs:974
void LoadItem(int i)
Definition Main.cs:56023
static Vector2 screenPosition
Definition Main.cs:1715
static UnifiedRandom rand
Definition Main.cs:1387
static float GlobalTimeWrappedHourly
Definition Main.cs:405

References System.Math.Ceiling(), Terraria.Lighting.GetColor(), Terraria.Utils.GetLerpValue(), Terraria.Main.GlobalTimeWrappedHourly, System.Text.RegularExpressions.i, Terraria.GameContent.TextureAssets.Item, Microsoft.Xna.Framework.MathHelper.Lerp(), Terraria.Main.LoadItem(), Terraria.Main.LoadProjectile(), System.Math.PI, Terraria.GameContent.TextureAssets.Projectile, Terraria.Main.rand, Terraria.Main.screenPosition, Terraria.Main.spriteBatch, System.value, and Microsoft.Xna.Framework.Graphics.Vector2.

Referenced by Terraria.Main.DrawProjDirect().