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

◆ SporeSac()

void Terraria.Player.SporeSac ( Item sourceItem)
inline

Definition at line 41568 of file Player.cs.

41569 {
41570 //IL_00c7: Unknown result type (might be due to invalid IL or missing references)
41571 //IL_00cc: Unknown result type (might be due to invalid IL or missing references)
41572 //IL_0108: Unknown result type (might be due to invalid IL or missing references)
41573 //IL_0118: Unknown result type (might be due to invalid IL or missing references)
41574 //IL_0149: Unknown result type (might be due to invalid IL or missing references)
41575 //IL_015e: Unknown result type (might be due to invalid IL or missing references)
41576 //IL_0165: Unknown result type (might be due to invalid IL or missing references)
41577 //IL_01a1: Unknown result type (might be due to invalid IL or missing references)
41578 //IL_01ae: Unknown result type (might be due to invalid IL or missing references)
41579 //IL_0171: Unknown result type (might be due to invalid IL or missing references)
41580 //IL_018c: Unknown result type (might be due to invalid IL or missing references)
41581 //IL_0193: Unknown result type (might be due to invalid IL or missing references)
41582 //IL_0224: Unknown result type (might be due to invalid IL or missing references)
41583 //IL_0335: Unknown result type (might be due to invalid IL or missing references)
41584 //IL_033c: Unknown result type (might be due to invalid IL or missing references)
41585 //IL_02e5: Unknown result type (might be due to invalid IL or missing references)
41586 //IL_02ef: Unknown result type (might be due to invalid IL or missing references)
41587 //IL_02f4: Unknown result type (might be due to invalid IL or missing references)
41588 //IL_02f9: Unknown result type (might be due to invalid IL or missing references)
41589 int damage = 70;
41590 float knockBack = 1.5f;
41591 if (Main.rand.Next(15) != 0)
41592 {
41593 return;
41594 }
41595 int num = 0;
41596 for (int i = 0; i < 1000; i++)
41597 {
41598 if (Main.projectile[i].active && Main.projectile[i].owner == whoAmI && (Main.projectile[i].type == 567 || Main.projectile[i].type == 568))
41599 {
41600 num++;
41601 }
41602 }
41603 if (Main.rand.Next(15) < num || num >= 10)
41604 {
41605 return;
41606 }
41607 int num2 = 50;
41608 int num3 = 24;
41609 int num4 = 90;
41610 for (int j = 0; j < num2; j++)
41611 {
41612 int num5 = Main.rand.Next(200 - j * 2, 400 + j * 2);
41613 Vector2 center = base.Center;
41614 center.X += Main.rand.Next(-num5, num5 + 1);
41615 center.Y += Main.rand.Next(-num5, num5 + 1);
41616 if (Collision.SolidCollision(center, num3, num3) || Collision.WetCollision(center, num3, num3))
41617 {
41618 continue;
41619 }
41620 center.X += num3 / 2;
41621 center.Y += num3 / 2;
41622 if (!Collision.CanHit(new Vector2(base.Center.X, position.Y), 1, 1, center, 1, 1) && !Collision.CanHit(new Vector2(base.Center.X, position.Y - 50f), 1, 1, center, 1, 1))
41623 {
41624 continue;
41625 }
41626 int num6 = (int)center.X / 16;
41627 int num7 = (int)center.Y / 16;
41628 bool flag = false;
41629 if (Main.rand.Next(3) == 0 && Main.tile[num6, num7] != null && Main.tile[num6, num7].wall > 0)
41630 {
41631 flag = true;
41632 }
41633 else
41634 {
41635 center.X -= num4 / 2;
41636 center.Y -= num4 / 2;
41637 if (Collision.SolidCollision(center, num4, num4))
41638 {
41639 center.X += num4 / 2;
41640 center.Y += num4 / 2;
41641 flag = true;
41642 }
41643 else if (Main.tile[num6, num7] != null && Main.tile[num6, num7].active() && Main.tile[num6, num7].type == 19)
41644 {
41645 flag = true;
41646 }
41647 }
41648 if (!flag)
41649 {
41650 continue;
41651 }
41652 for (int k = 0; k < 1000; k++)
41653 {
41654 if (Main.projectile[k].active && Main.projectile[k].owner == whoAmI && Main.projectile[k].aiStyle == 105)
41655 {
41656 Vector2 val = center - Main.projectile[k].Center;
41657 if (((Vector2)(ref val)).Length() < 48f)
41658 {
41659 flag = false;
41660 break;
41661 }
41662 }
41663 }
41664 if (flag && Main.myPlayer == whoAmI)
41665 {
41666 Projectile.NewProjectile(GetProjectileSource_Accessory(sourceItem), center.X, center.Y, 0f, 0f, 567 + Main.rand.Next(2), damage, knockBack, whoAmI);
41667 break;
41668 }
41669 }
41670 }
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_Accessory(Item item)
Definition Player.cs:7866

References Terraria.Collision.CanHit(), Terraria.Player.GetProjectileSource_Accessory(), Terraria.Main.myPlayer, Terraria.Projectile.NewProjectile(), Terraria.Entity.position, Terraria.Main.projectile, Terraria.Main.rand, Terraria.Collision.SolidCollision(), Terraria.Main.tile, Terraria.Collision.WetCollision(), and Terraria.Entity.whoAmI.

Referenced by Terraria.Player.ApplyEquipFunctional().

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