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

◆ WormPet()

static void Terraria.DelegateMethods.CharacterPreview.WormPet ( Projectile proj,
bool walking )
inlinestatic

Definition at line 63 of file DelegateMethods.cs.

64 {
65 float num = -0.3985988f;
66 Vector2 vector = (Vector2.UnitY * 2f).RotatedBy(num);
67 Vector2 position = proj.position;
68 int num2 = proj.oldPos.Length;
69 if (proj.type == 893)
70 {
71 num2 = proj.oldPos.Length - 30;
72 }
73 for (int i = 0; i < proj.oldPos.Length; i++)
74 {
75 position -= vector;
76 if (i < num2)
77 {
78 proj.oldPos[i] = position;
79 }
80 else if (i > 0)
81 {
82 proj.oldPos[i] = proj.oldPos[i - 1];
83 }
84 vector = vector.RotatedBy(-0.05235987901687622);
85 }
86 proj.rotation = vector.ToRotation() + (float)Math.PI / 10f + (float)Math.PI;
87 if (proj.type == 887)
88 {
89 proj.rotation += (float)Math.PI / 8f;
90 }
91 if (proj.type == 893)
92 {
93 proj.rotation += (float)Math.PI / 2f;
94 }
95 }
const double PI
Definition Math.cs:16

References Microsoft.Xna.Framework.Vector2.Length(), Terraria.Projectile.oldPos, System.Math.PI, Terraria.Entity.position, and Terraria.Projectile.type.