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

◆ HorsemansBlade_SpawnPumpkin()

void Terraria.Player.HorsemansBlade_SpawnPumpkin ( int npcIndex,
int dmg,
float kb )
inline

Definition at line 41246 of file Player.cs.

41247 {
41248 //IL_0007: Unknown result type (might be due to invalid IL or missing references)
41249 //IL_00a1: Unknown result type (might be due to invalid IL or missing references)
41250 //IL_00a7: Unknown result type (might be due to invalid IL or missing references)
41251 //IL_00b6: Unknown result type (might be due to invalid IL or missing references)
41252 Vector2 center = Main.npc[npcIndex].Center;
41253 int logicCheckScreenHeight = Main.LogicCheckScreenHeight;
41254 int logicCheckScreenWidth = Main.LogicCheckScreenWidth;
41255 int num = Main.rand.Next(100, 300);
41256 int num2 = Main.rand.Next(100, 300);
41257 num = ((Main.rand.Next(2) != 0) ? (num + (logicCheckScreenWidth / 2 - num)) : (num - (logicCheckScreenWidth / 2 + num)));
41258 num2 = ((Main.rand.Next(2) != 0) ? (num2 + (logicCheckScreenHeight / 2 - num2)) : (num2 - (logicCheckScreenHeight / 2 + num2)));
41259 num += (int)position.X;
41260 num2 += (int)position.Y;
41261 Vector2 vector = default(Vector2);
41262 ((Vector2)(ref vector))._002Ector((float)num, (float)num2);
41263 float num3 = center.X - vector.X;
41264 float num4 = center.Y - vector.Y;
41265 float num5 = (float)Math.Sqrt(num3 * num3 + num4 * num4);
41266 num5 = 8f / num5;
41267 num3 *= num5;
41268 num4 *= num5;
41269 Projectile.NewProjectile(GetProjectileSource_Item(HeldItem), num, num2, num3, num4, 321, dmg, kb, whoAmI, npcIndex);
41270 }
int whoAmI
The index of this Entity within its specific array. These arrays track the entities in the world....
Definition Entity.cs:16
Vector2 position
The position of this Entity in world coordinates.
Definition Entity.cs:28
IEntitySource GetProjectileSource_Item(Item item)
Definition Player.cs:7831

References Terraria.Player.GetProjectileSource_Item(), Terraria.Player.HeldItem, Terraria.Main.LogicCheckScreenHeight, Terraria.Main.LogicCheckScreenWidth, Terraria.Projectile.NewProjectile(), Terraria.Main.npc, Terraria.Entity.position, Terraria.Main.rand, and Terraria.Entity.whoAmI.

+ Here is the call graph for this function: