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

◆ DropTombstoneTownNPC()

void Terraria.NPC.DropTombstoneTownNPC ( NetworkText deathText)
inline

Definition at line 83929 of file NPC.cs.

83930 {
83931 if (Main.netMode != 1)
83932 {
83933 float num = 0.1f;
83934 if (Main.rand.Next(2) == 0)
83935 {
83936 num = -0.1f;
83937 }
83938 float num2;
83939 for (num2 = (float)Main.rand.Next(-35, 36) * 0.1f; num2 < 2f && num2 > -2f; num2 += (float)Main.rand.Next(-30, 31) * 0.1f)
83940 {
83941 }
83942 int num3 = Main.rand.Next(6);
83943 if (type != 17 && type != 441)
83944 {
83945 num3 = ((num3 != 0) ? (num3 + 200) : 43);
83946 }
83947 else
83948 {
83949 num3 = Main.rand.Next(5);
83950 num3 += 527;
83951 }
83952 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);
83953 Main.projectile[num4].miscText = deathText.ToString();
83954 }
83955 }
int width
The width of this Entity's hitbox, in pixels.
Definition Entity.cs:46
int height
The height of this Entity's hitbox, in pixels.
Definition Entity.cs:51
int type
The NPC ID of this NPC. The NPC ID is a unique number assigned to each NPC loaded into the game....
Definition NPC.cs:990
IEntitySource GetSpawnSource_ForProjectile()
Definition NPC.cs:107558

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: