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

◆ BloodButcherer_TryButchering()

void Terraria.Player.BloodButcherer_TryButchering ( NPC npc,
Item sItem,
float damage,
float knockBack )
inlineprivate

Definition at line 41992 of file Player.cs.

41993 {
41994 if (_spawnBloodButcherer && Main.myPlayer == whoAmI && (npc == null || npc.CanBeChasedBy(this)))
41995 {
41996 Vector2 v = npc.Center - MountedCenter;
41997 v = v.SafeNormalize(Vector2.Zero);
41998 Vector2 vector = npc.Hitbox.ClosestPointInRect(MountedCenter) + v;
41999 Vector2 spinningpoint = (npc.Center - vector) * 0.8f;
42000 spinningpoint = spinningpoint.RotatedBy(Main.rand.NextFloatDirection() * (float)Math.PI * 0.25f);
42001 int num = Projectile.NewProjectile(GetProjectileSource_Item(sItem), vector.X, vector.Y, spinningpoint.X, spinningpoint.Y, 975, (int)damage, knockBack, whoAmI, 1f, npc.whoAmI);
42002 Main.projectile[num].StatusNPC(npc.whoAmI);
42003 Projectile.KillOldestJavelin(num, 975, npc.whoAmI, _bloodButchererMax5);
42004 _spawnBloodButcherer = false;
42005 }
42006 }
const double PI
Definition Math.cs:16
Vector2 MountedCenter
Definition Player.cs:2853
static Point[] _bloodButchererMax5
Definition Player.cs:2711
bool _spawnBloodButcherer
Definition Player.cs:2453
IEntitySource GetProjectileSource_Item(Item item)
Definition Player.cs:9272

References Terraria.NPC.CanBeChasedBy(), Terraria.Entity.Hitbox, Terraria.Projectile.KillOldestJavelin(), Terraria.Main.myPlayer, Terraria.Projectile.NewProjectile(), System.Math.PI, Terraria.Main.projectile, Terraria.Main.rand, Terraria.Entity.whoAmI, and Microsoft.Xna.Framework.Vector2.Zero.