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

◆ FindArenaHitbox()

static void Terraria.GameContent.Events.DD2Event.FindArenaHitbox ( )
inlinestatic

Definition at line 737 of file DD2Event.cs.

738 {
740 {
742 return;
743 }
745 Vector2 vector = new Vector2(float.MaxValue, float.MaxValue);
746 Vector2 vector2 = new Vector2(0f, 0f);
747 for (int i = 0; i < 200; i++)
748 {
749 NPC nPC = Main.npc[i];
750 if (nPC.active && (nPC.type == 549 || nPC.type == 548))
751 {
752 Vector2 topLeft = nPC.TopLeft;
753 if (vector.X > topLeft.X)
754 {
755 vector.X = topLeft.X;
756 }
757 if (vector.Y > topLeft.Y)
758 {
759 vector.Y = topLeft.Y;
760 }
761 topLeft = nPC.BottomRight;
762 if (vector2.X < topLeft.X)
763 {
764 vector2.X = topLeft.X;
765 }
766 if (vector2.Y < topLeft.Y)
767 {
768 vector2.Y = topLeft.Y;
769 }
770 }
771 }
772 Vector2 vector3 = new Vector2(16f, 16f) * 50f;
773 vector -= vector3;
774 vector2 += vector3;
776 ArenaHitbox.X = (int)vector.X;
777 ArenaHitbox.Y = (int)vector.Y;
778 ArenaHitbox.Width = (int)vector4.X;
779 ArenaHitbox.Height = (int)vector4.Y;
780 }

References Terraria.GameContent.Events.DD2Event._arenaHitboxingCooldown, and Terraria.Main.npc.

Referenced by Terraria.NPC.AI(), and Terraria.Player.Update().