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

◆ AI_161_RapierStabs()

void Terraria.Projectile.AI_161_RapierStabs ( )
inlineprivate

Definition at line 39450 of file Projectile.cs.

39451 {
39452 Player player = Main.player[owner];
39453 rotation = velocity.ToRotation() + (float)Math.PI / 2f;
39454 ai[0] += 1f;
39455 float opacity = Utils.GetLerpValue(0f, 7f, ai[0], clamped: true) * Utils.GetLerpValue(16f, 12f, ai[0], clamped: true);
39456 Opacity = opacity;
39457 base.Center = player.RotatedRelativePoint(player.MountedCenter, reverseRotation: false, addGfxOffY: false) + velocity * (ai[0] - 1f);
39458 spriteDirection = ((!(Vector2.Dot(velocity, Vector2.UnitX) < 0f)) ? 1 : (-1));
39459 if (ai[0] >= 16f)
39460 {
39461 Kill();
39462 }
39463 else
39464 {
39465 player.heldProj = whoAmI;
39466 }
39467 }
const double PI
Definition Math.cs:16
Vector2 velocity
Definition Entity.cs:16
static float Dot(Vector2 value1, Vector2 value2)
Definition Vector2.cs:121

References Microsoft.Xna.Framework.Vector2.Dot(), Terraria.Utils.GetLerpValue(), Terraria.Player.MountedCenter, System.Math.PI, Terraria.Main.player, Terraria.Player.RotatedRelativePoint(), and Microsoft.Xna.Framework.Vector2.UnitX.