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

◆ AI_182_FinalFractal()

void Terraria.Projectile.AI_182_FinalFractal ( )
inlineprivate

Definition at line 44658 of file Projectile.cs.

44659 {
44660 //IL_004e: Unknown result type (might be due to invalid IL or missing references)
44661 //IL_0053: Unknown result type (might be due to invalid IL or missing references)
44662 //IL_00e7: Unknown result type (might be due to invalid IL or missing references)
44663 //IL_002f: Unknown result type (might be due to invalid IL or missing references)
44664 //IL_015a: Unknown result type (might be due to invalid IL or missing references)
44665 //IL_015c: Unknown result type (might be due to invalid IL or missing references)
44666 //IL_0161: Unknown result type (might be due to invalid IL or missing references)
44667 //IL_0170: Unknown result type (might be due to invalid IL or missing references)
44668 //IL_017a: Unknown result type (might be due to invalid IL or missing references)
44669 //IL_0180: Unknown result type (might be due to invalid IL or missing references)
44670 //IL_0182: Unknown result type (might be due to invalid IL or missing references)
44671 //IL_019c: Unknown result type (might be due to invalid IL or missing references)
44672 //IL_01a1: Unknown result type (might be due to invalid IL or missing references)
44673 //IL_01a6: Unknown result type (might be due to invalid IL or missing references)
44674 //IL_01a8: Unknown result type (might be due to invalid IL or missing references)
44675 //IL_01af: Unknown result type (might be due to invalid IL or missing references)
44676 //IL_01b5: Unknown result type (might be due to invalid IL or missing references)
44677 //IL_01b7: Unknown result type (might be due to invalid IL or missing references)
44678 //IL_01bc: Unknown result type (might be due to invalid IL or missing references)
44679 //IL_01c1: Unknown result type (might be due to invalid IL or missing references)
44680 //IL_0215: Unknown result type (might be due to invalid IL or missing references)
44681 //IL_021a: Unknown result type (might be due to invalid IL or missing references)
44682 //IL_021f: Unknown result type (might be due to invalid IL or missing references)
44683 //IL_0237: Unknown result type (might be due to invalid IL or missing references)
44684 //IL_0239: Unknown result type (might be due to invalid IL or missing references)
44685 //IL_023b: Unknown result type (might be due to invalid IL or missing references)
44686 //IL_02eb: Unknown result type (might be due to invalid IL or missing references)
44687 //IL_02f0: Unknown result type (might be due to invalid IL or missing references)
44688 //IL_02f3: Unknown result type (might be due to invalid IL or missing references)
44689 //IL_02f8: Unknown result type (might be due to invalid IL or missing references)
44690 //IL_0350: Unknown result type (might be due to invalid IL or missing references)
44691 //IL_0352: Unknown result type (might be due to invalid IL or missing references)
44692 //IL_035b: Unknown result type (might be due to invalid IL or missing references)
44693 //IL_0379: Unknown result type (might be due to invalid IL or missing references)
44694 //IL_037e: Unknown result type (might be due to invalid IL or missing references)
44695 //IL_039e: Unknown result type (might be due to invalid IL or missing references)
44696 //IL_03bb: Unknown result type (might be due to invalid IL or missing references)
44697 //IL_03c0: Unknown result type (might be due to invalid IL or missing references)
44698 //IL_03c2: Unknown result type (might be due to invalid IL or missing references)
44699 //IL_03c7: Unknown result type (might be due to invalid IL or missing references)
44700 //IL_03ce: Unknown result type (might be due to invalid IL or missing references)
44701 //IL_03d3: Unknown result type (might be due to invalid IL or missing references)
44702 //IL_03d6: Unknown result type (might be due to invalid IL or missing references)
44703 //IL_03db: Unknown result type (might be due to invalid IL or missing references)
44704 //IL_03e2: Unknown result type (might be due to invalid IL or missing references)
44705 //IL_03ed: Unknown result type (might be due to invalid IL or missing references)
44706 //IL_03f7: Unknown result type (might be due to invalid IL or missing references)
44707 //IL_03f8: Unknown result type (might be due to invalid IL or missing references)
44708 //IL_0400: Unknown result type (might be due to invalid IL or missing references)
44709 //IL_040a: Unknown result type (might be due to invalid IL or missing references)
44710 if (type == 933 && localAI[1] == 0f)
44711 {
44712 localAI[1] = 1f;
44714 }
44715 Player player = Main.player[owner];
44716 Vector2 mountedCenter = player.MountedCenter;
44717 float lerpValue = Utils.GetLerpValue(900f, 0f, ((Vector2)(ref velocity)).Length() * 2f, clamped: true);
44718 float num = MathHelper.Lerp(0.7f, 2f, lerpValue);
44719 localAI[0] += num;
44720 if (localAI[0] >= 120f)
44721 {
44722 Kill();
44723 return;
44724 }
44725 float lerpValue2 = Utils.GetLerpValue(0f, 1f, localAI[0] / 60f, clamped: true);
44726 float num11 = localAI[0] / 60f;
44727 float num4 = ai[0];
44728 float num5 = velocity.ToRotation();
44729 float num6 = (float)Math.PI;
44730 float num7 = ((velocity.X > 0f) ? 1 : (-1));
44731 float num8 = num6 + num7 * lerpValue2 * ((float)Math.PI * 2f);
44732 float num9 = ((Vector2)(ref velocity)).Length() + Utils.GetLerpValue(0.5f, 1f, lerpValue2, clamped: true) * 40f;
44733 float num10 = 60f;
44734 if (num9 < num10)
44735 {
44736 num9 = num10;
44737 }
44738 Vector2 val = mountedCenter + velocity;
44739 Vector2 spinningpoint = Utils.RotatedBy(new Vector2(1f, 0f), num8) * new Vector2(num9, num4 * MathHelper.Lerp(2f, 1f, lerpValue));
44740 Vector2 vector2 = val + spinningpoint.RotatedBy(num5);
44741 Vector2 vector3 = (1f - Utils.GetLerpValue(0f, 0.5f, lerpValue2, clamped: true)) * new Vector2((float)((velocity.X > 0f) ? 1 : (-1)) * (0f - num9) * 0.1f, (0f - ai[0]) * 0.3f);
44742 float num2 = num8 + num5;
44743 rotation = num2 + (float)Math.PI / 2f;
44744 base.Center = vector2 + vector3;
44745 spriteDirection = (direction = ((velocity.X > 0f) ? 1 : (-1)));
44746 if (num4 < 0f)
44747 {
44748 rotation = num6 + num7 * lerpValue2 * ((float)Math.PI * -2f) + num5;
44749 rotation += (float)Math.PI / 2f;
44750 spriteDirection = (direction = ((!(velocity.X > 0f)) ? 1 : (-1)));
44751 }
44752 if (num11 < 1f)
44753 {
44755 Vector2 vector4 = (rotation - (float)Math.PI / 2f).ToRotationVector2();
44756 Vector2 center = base.Center;
44757 int num3 = 1 + (int)(((Vector2)(ref velocity)).Length() / 100f);
44758 num3 = (int)((float)num3 * Utils.GetLerpValue(0f, 0.5f, lerpValue2, clamped: true) * Utils.GetLerpValue(1f, 0.5f, lerpValue2, clamped: true));
44759 if (num3 < 1)
44760 {
44761 num3 = 1;
44762 }
44763 for (int i = 0; i < num3; i++)
44764 {
44765 finalFractalProfile.dustMethod(center + vector4 * finalFractalProfile.trailWidth * MathHelper.Lerp(0.5f, 1f, Main.rand.NextFloat()), rotation - (float)Math.PI / 2f + (float)Math.PI / 2f * (float)spriteDirection, player.velocity);
44766 }
44767 Vector3 vector5 = ((Color)(ref finalFractalProfile.trailColor)).ToVector3();
44768 Vector3 vector6 = Vector3.Lerp(Vector3.One, vector5, 0.7f);
44769 Lighting.AddLight(base.Center, vector5 * 0.5f * Opacity);
44770 Lighting.AddLight(mountedCenter, vector6 * Opacity * 0.15f);
44771 }
44772 Opacity = Utils.GetLerpValue(0f, 5f, localAI[0], clamped: true) * Utils.GetLerpValue(120f, 115f, localAI[0], clamped: true);
44773 }
static SlotId PlaySound(in SoundStyle? style, Vector2? position=null, SoundUpdateCallback? updateCallback=null)
Attempts to play a sound style with the provided sound style (if it's not null), and returns a valid ...
Vector2 velocity
The velocity of this Entity in world coordinates per tick.
Definition Entity.cs:33
static readonly SoundStyle Item169
Definition SoundID.cs:1015
int owner
The index of the player who owns this projectile. In Multiplayer, Clients "own" projectiles that they...
float[] ai
An array with 3 slots used for any sort of data storage, which is occasionally synced to the server....
float[] localAI
Acts like F:Terraria.Projectile.ai, but does not sync to the server. Many vanilla T:Terraria....
int type
The Projectile ID of this projectile. The Projectile ID is a unique number assigned to each Projectil...
float rotation
Rotation of the projectile. Radians not Degrees. Use T:Microsoft.Xna.Framework.MathHelper if you want...
static FinalFractalProfile GetFinalFractalProfile(int usedSwordId)

References Terraria.Lighting.AddLight(), Terraria.Graphics.FinalFractalHelper.GetFinalFractalProfile(), Terraria.Utils.GetLerpValue(), Terraria.ID.SoundID.Item169, Terraria.Player.MountedCenter, Terraria.Main.player, Terraria.Audio.SoundEngine.PlaySound(), Terraria.Main.rand, Terraria.Utils.RotatedBy(), and Terraria.Entity.velocity.

+ Here is the call graph for this function: