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

◆ AI_87_BigMimic_ShootItem()

void Terraria.NPC.AI_87_BigMimic_ShootItem ( int itemID)
inlineprivate

Definition at line 45389 of file NPC.cs.

45390 {
45391 //IL_008a: Unknown result type (might be due to invalid IL or missing references)
45392 //IL_0099: Unknown result type (might be due to invalid IL or missing references)
45393 //IL_009e: Unknown result type (might be due to invalid IL or missing references)
45394 //IL_00a3: Unknown result type (might be due to invalid IL or missing references)
45395 //IL_00a9: Unknown result type (might be due to invalid IL or missing references)
45396 //IL_00b6: Unknown result type (might be due to invalid IL or missing references)
45397 int num = Item.NewItem(GetItemSource_Loot(), (int)position.X, (int)position.Y, width, height, itemID, 1, noBroadcast: false, -1, noGrabDelay: true);
45398 float num5 = Main.rand.Next(10, 26);
45399 Vector2 vector = default(Vector2);
45400 ((Vector2)(ref vector))._002Ector(position.X + (float)width * 0.5f, position.Y + (float)height * 0.5f);
45401 Vector2 val = Main.player[target].Center - new Vector2(0f, 120f);
45402 float num2 = val.X - vector.X;
45403 float num3 = val.Y - vector.Y;
45404 num2 += (float)Main.rand.Next(-50, 51) * 0.1f;
45405 num3 += (float)Main.rand.Next(-50, 51) * 0.1f;
45406 float num4 = (float)Math.Sqrt(num2 * num2 + num3 * num3);
45407 num4 = num5 / num4;
45408 num2 *= num4;
45409 num3 *= num4;
45410 num2 += (float)Main.rand.Next(-50, 51) * 0.1f;
45411 num3 += (float)Main.rand.Next(-50, 51) * 0.1f;
45412 Main.item[num].velocity.X = num2;
45413 Main.item[num].velocity.Y = num3;
45414 Main.item[num].noGrabDelay = 100;
45415 if (Main.netMode != 0)
45416 {
45417 NetMessage.SendData(21, -1, -1, null, num);
45418 }
45419 }
Vector2 position
The position of this Entity in world coordinates.
Definition Entity.cs:28
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
IEntitySource GetItemSource_Loot()
Definition NPC.cs:107573
int target
Definition NPC.cs:1019

References Terraria.NPC.GetItemSource_Loot(), Terraria.Entity.height, Terraria.Main.item, Terraria.Main.netMode, Terraria.Item.NewItem(), Terraria.Main.player, Terraria.Entity.position, Terraria.Main.rand, Terraria.NetMessage.SendData(), Terraria.NPC.target, and Terraria.Entity.width.

Referenced by Terraria.NPC.AI_87_BigMimic_FireStuffCannonBurst().

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