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

◆ DrawProjWithStarryTrail()

void Terraria.Main.DrawProjWithStarryTrail ( Projectile proj,
Microsoft::Xna::Framework::Color projectileColor,
SpriteEffects dir )
inlineprivate

Definition at line 34287 of file Main.cs.

34288 {
34289 Microsoft.Xna.Framework.Color color = new Microsoft.Xna.Framework.Color(255, 255, 255, projectileColor.A - proj.alpha);
34290 Vector2 vector = proj.velocity;
34291 Microsoft.Xna.Framework.Color color2 = Microsoft.Xna.Framework.Color.Blue * 0.1f;
34292 Vector2 spinningpoint = new Vector2(0f, -4f);
34293 float num = 0f;
34294 float t = vector.Length();
34295 float num2 = Utils.GetLerpValue(3f, 5f, t, clamped: true);
34296 bool flag = true;
34297 if (proj.type == 856 || proj.type == 857)
34298 {
34299 vector = proj.position - proj.oldPos[1];
34300 float num3 = vector.Length();
34301 if (num3 == 0f)
34302 {
34304 }
34305 else
34306 {
34307 vector *= 5f / num3;
34308 }
34309 Vector2 origin = new Vector2(proj.ai[0], proj.ai[1]);
34310 Vector2 center = player[proj.owner].Center;
34311 float lerpValue = Utils.GetLerpValue(0f, 120f, origin.Distance(center), clamped: true);
34312 float num4 = 90f;
34313 if (proj.type == 857)
34314 {
34315 num4 = 60f;
34316 flag = false;
34317 }
34318 float lerpValue2 = Utils.GetLerpValue(num4, num4 * (5f / 6f), proj.localAI[0], clamped: true);
34319 float lerpValue3 = Utils.GetLerpValue(0f, 120f, proj.Center.Distance(center), clamped: true);
34321 lerpValue2 *= Utils.GetLerpValue(0f, 15f, proj.localAI[0], clamped: true);
34322 color2 = Microsoft.Xna.Framework.Color.HotPink * 0.15f * (lerpValue2 * lerpValue);
34323 if (proj.type == 857)
34324 {
34325 color2 = proj.GetFirstFractalColor() * 0.15f * (lerpValue2 * lerpValue);
34326 }
34327 spinningpoint = new Vector2(0f, -2f);
34328 float lerpValue4 = Utils.GetLerpValue(num4, num4 * (2f / 3f), proj.localAI[0], clamped: true);
34329 lerpValue4 *= Utils.GetLerpValue(0f, 20f, proj.localAI[0], clamped: true);
34330 num = -0.3f * (1f - lerpValue4);
34331 num += -1f * Utils.GetLerpValue(15f, 0f, proj.localAI[0], clamped: true);
34332 num *= lerpValue;
34334 }
34335 Vector2 vector2 = proj.Center + vector;
34337 _ = new Microsoft.Xna.Framework.Rectangle(0, 0, value.Width, value.Height).Size() / 2f;
34338 Texture2D value2 = TextureAssets.Extra[91].Value;
34340 Vector2 origin2 = new Vector2((float)value3.Width / 2f, 10f);
34341 _ = Microsoft.Xna.Framework.Color.Cyan * 0.5f * num2;
34342 Vector2 vector3 = new Vector2(0f, proj.gfxOffY);
34343 float num5 = (float)timeForVisualEffects / 60f;
34344 Vector2 vector4 = vector2 + vector * 0.5f;
34345 Microsoft.Xna.Framework.Color color3 = Microsoft.Xna.Framework.Color.White * 0.5f * num2;
34346 color3.A = 0;
34348 color4.A = 0;
34350 color5.A = 0;
34352 color6.A = 0;
34353 float num6 = vector.ToRotation();
34354 EntitySpriteDraw(value2, vector4 - screenPosition + vector3 + spinningpoint.RotatedBy((float)Math.PI * 2f * num5), value3, color4, num6 + (float)Math.PI / 2f, origin2, 1.5f + num, SpriteEffects.None);
34355 EntitySpriteDraw(value2, vector4 - screenPosition + vector3 + spinningpoint.RotatedBy((float)Math.PI * 2f * num5 + (float)Math.PI * 2f / 3f), value3, color5, num6 + (float)Math.PI / 2f, origin2, 1.1f + num, SpriteEffects.None);
34356 EntitySpriteDraw(value2, vector4 - screenPosition + vector3 + spinningpoint.RotatedBy((float)Math.PI * 2f * num5 + 4.1887903f), value3, color6, num6 + (float)Math.PI / 2f, origin2, 1.3f + num, SpriteEffects.None);
34357 Vector2 vector5 = vector2 - vector * 0.5f;
34358 for (float num7 = 0f; num7 < 1f; num7 += 0.5f)
34359 {
34360 float num8 = num5 % 0.5f / 0.5f;
34361 num8 = (num8 + num7) % 1f;
34362 float num9 = num8 * 2f;
34363 if (num9 > 1f)
34364 {
34365 num9 = 2f - num9;
34366 }
34367 EntitySpriteDraw(value2, vector5 - screenPosition + vector3, value3, color3 * num9, num6 + (float)Math.PI / 2f, origin2, 0.3f + num8 * 0.5f, SpriteEffects.None);
34368 }
34369 if (flag)
34370 {
34371 float rotation = proj.rotation + proj.localAI[1];
34372 _ = (float)timeForVisualEffects / 240f;
34377 if (globalTimeWrappedHourly >= 1f)
34378 {
34380 }
34382 Vector2 position = proj.Center - screenPosition;
34383 instance.LoadItem(75);
34384 Texture2D value4 = TextureAssets.Item[75].Value;
34386 EntitySpriteDraw(origin: rectangle.Size() / 2f, texture: value4, position: position, sourceRectangle: rectangle, color: color, rotation: rotation, scale: proj.scale, effects: SpriteEffects.None);
34387 }
34388 }
const double PI
Definition Math.cs:16
static Asset< Texture2D >[] Projectile
static Asset< Texture2D >[] Item
static Asset< Texture2D >[] Extra
static double timeForVisualEffects
Definition Main.cs:1286
static Main instance
Definition Main.cs:283
static Vector2 screenPosition
Definition Main.cs:1715
static Player[] player
Definition Main.cs:1803
static float GlobalTimeWrappedHourly
Definition Main.cs:405
static void EntitySpriteDraw(Texture2D texture, Vector2 position, Microsoft.Xna.Framework.Rectangle? sourceRectangle, Microsoft.Xna.Framework.Color color, float rotation, Vector2 origin, float scale, SpriteEffects effects, float worthless=0f)
Definition Main.cs:34658
static float Distance(Vector2 value1, Vector2 value2)
Definition Vector2.cs:91

References Microsoft.Xna.Framework.Vector2.Distance(), Terraria.Main.EntitySpriteDraw(), Terraria.GameContent.TextureAssets.Extra, Terraria.Utils.GetLerpValue(), Terraria.Main.GlobalTimeWrappedHourly, Terraria.Main.instance, Terraria.GameContent.TextureAssets.Item, System.Math.PI, Terraria.Main.player, Terraria.GameContent.TextureAssets.Projectile, Terraria.Main.screenPosition, Terraria.Main.timeForVisualEffects, Microsoft.Xna.Framework.Vector2.UnitY, System.value, and Microsoft.Xna.Framework.Graphics.Vector2.

Referenced by Terraria.Main.DrawProjDirect().