Terraria v1.4.4.9
Terraria source code documentation
All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Events Macros

◆ DropTombstoneTownNPC()

void Terraria.NPC.DropTombstoneTownNPC ( NetworkText deathText)
inline

Definition at line 70568 of file NPC.cs.

70569 {
70570 if (Main.netMode != 1)
70571 {
70572 float num = 0.1f;
70573 if (Main.rand.Next(2) == 0)
70574 {
70575 num = -0.1f;
70576 }
70577 float num2;
70578 for (num2 = (float)Main.rand.Next(-35, 36) * 0.1f; num2 < 2f && num2 > -2f; num2 += (float)Main.rand.Next(-30, 31) * 0.1f)
70579 {
70580 }
70581 int num3 = Main.rand.Next(6);
70582 if (type != 17 && type != 441)
70583 {
70584 num3 = ((num3 != 0) ? (num3 + 200) : 43);
70585 }
70586 else
70587 {
70588 num3 = Main.rand.Next(5);
70589 num3 += 527;
70590 }
70591 int num4 = Projectile.NewProjectile(GetSpawnSource_ForProjectile(), position.X + (float)(width / 2), position.Y + (float)(height / 2), (float)Main.rand.Next(10, 30) * num + num2, (float)Main.rand.Next(-40, -20) * 0.1f, num3, 0, 0f, Main.myPlayer);
70592 Main.projectile[num4].miscText = deathText.ToString();
70593 }
70594 }
int type
Definition NPC.cs:445
IEntitySource GetSpawnSource_ForProjectile()
Definition NPC.cs:87526

References Terraria.NPC.GetSpawnSource_ForProjectile(), Terraria.Entity.height, Terraria.Main.myPlayer, Terraria.Main.netMode, Terraria.Projectile.NewProjectile(), Terraria.Main.projectile, Terraria.Main.rand, Terraria.NPC.type, and Terraria.Entity.width.

Referenced by Terraria.NPC.checkDead().