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

◆ Difficulty_3_SpawnMonsterFromGate()

static void Terraria.GameContent.Events.DD2Event.Difficulty_3_SpawnMonsterFromGate ( Vector2 gateBottom)
inlinestaticprivate

Definition at line 1597 of file DD2Event.cs.

1598 {
1599 //IL_0000: Unknown result type (might be due to invalid IL or missing references)
1600 //IL_0008: Unknown result type (might be due to invalid IL or missing references)
1601 int x = (int)gateBottom.X;
1602 int y = (int)gateBottom.Y;
1603 int num = 60;
1604 int num2 = 7;
1605 if (NPC.waveNumber > 1)
1606 {
1607 num2 = 9;
1608 }
1609 if (NPC.waveNumber > 3)
1610 {
1611 num2 = 12;
1612 }
1613 if (NPC.waveNumber > 5)
1614 {
1615 num2 = 15;
1616 }
1617 int num3 = 7;
1618 if (NPC.waveNumber > 4)
1619 {
1620 num3 = 10;
1621 }
1622 int num4 = 2;
1623 if (NPC.waveNumber > 5)
1624 {
1625 num4 = 3;
1626 }
1627 int num5 = 12;
1628 if (NPC.waveNumber > 3)
1629 {
1630 num5 = 18;
1631 }
1632 int num6 = 4;
1633 if (NPC.waveNumber > 5)
1634 {
1635 num6 = 6;
1636 }
1637 int num7 = 4;
1638 for (int i = 1; i < Main.CurrentFrameFlags.ActivePlayersCount; i++)
1639 {
1640 num = (int)((double)num * 1.3);
1641 num2 = (int)((double)num2 * 1.3);
1642 num5 = (int)((double)num * 1.3);
1643 num6 = (int)((double)num * 1.35);
1644 num7 = (int)((double)num7 * 1.3);
1645 }
1646 int num8 = 200;
1647 int num9 = 200;
1648 switch (NPC.waveNumber)
1649 {
1650 case 1:
1651 if (Main.rand.Next(18) == 0 && NPC.CountNPCS(563) < num2)
1652 {
1653 num8 = NPC.NewNPC(GetSpawnSource_OldOnesArmy(), x, y, 563);
1654 }
1655 else if (NPC.CountNPCS(554) < num)
1656 {
1657 if (Main.rand.Next(7) == 0)
1658 {
1659 num8 = NPC.NewNPC(GetSpawnSource_OldOnesArmy(), x, y, 557);
1660 }
1661 num9 = NPC.NewNPC(GetSpawnSource_OldOnesArmy(), x, y, 554);
1662 }
1663 break;
1664 case 2:
1665 if (Main.rand.Next(3) == 0 && NPC.CountNPCS(578) < num7)
1666 {
1667 num8 = NPC.NewNPC(GetSpawnSource_OldOnesArmy(), x, y, 578);
1668 }
1669 else if (Main.rand.Next(7) == 0 && NPC.CountNPCS(563) < num2)
1670 {
1671 num8 = NPC.NewNPC(GetSpawnSource_OldOnesArmy(), x, y, 563);
1672 }
1673 else if (Main.rand.Next(3) == 0 && NPC.CountNPCS(573) < num5)
1674 {
1675 num8 = NPC.NewNPC(GetSpawnSource_OldOnesArmy(), x, y, 573);
1676 }
1677 else if (NPC.CountNPCS(554) < num)
1678 {
1679 if (Main.rand.Next(4) == 0)
1680 {
1681 num8 = NPC.NewNPC(GetSpawnSource_OldOnesArmy(), x, y, 557);
1682 }
1683 num9 = NPC.NewNPC(GetSpawnSource_OldOnesArmy(), x, y, 554);
1684 }
1685 break;
1686 case 3:
1687 if (Main.rand.Next(13) == 0 && NPC.CountNPCS(571) < num6)
1688 {
1689 num8 = NPC.NewNPC(GetSpawnSource_OldOnesArmy(), x, y, 571);
1690 }
1691 else if (Main.rand.Next(7) == 0 && NPC.CountNPCS(573) < num5)
1692 {
1693 num8 = NPC.NewNPC(GetSpawnSource_OldOnesArmy(), x, y, 573);
1694 }
1695 else if (Main.rand.Next(10) == 0 && NPC.CountNPCS(560) < num3)
1696 {
1697 num8 = NPC.NewNPC(GetSpawnSource_OldOnesArmy(), x, y, 560);
1698 }
1699 else if (Main.rand.Next(8) == 0 && NPC.CountNPCS(563) < num2)
1700 {
1701 num8 = NPC.NewNPC(GetSpawnSource_OldOnesArmy(), x, y, 563);
1702 }
1703 else if (NPC.CountNPCS(554) + NPC.CountNPCS(557) < num)
1704 {
1705 num8 = NPC.NewNPC(GetSpawnSource_OldOnesArmy(), x, y, 554);
1706 }
1707 break;
1708 case 4:
1709 if (Main.rand.Next(24) == 0 && !NPC.AnyNPCs(565))
1710 {
1711 num8 = NPC.NewNPC(GetSpawnSource_OldOnesArmy(), x, y, 565);
1712 }
1713 else if (Main.rand.Next(12) == 0 && NPC.CountNPCS(571) < num6)
1714 {
1715 num8 = NPC.NewNPC(GetSpawnSource_OldOnesArmy(), x, y, 571);
1716 }
1717 else if (Main.rand.Next(15) == 0 && NPC.CountNPCS(560) < num3)
1718 {
1719 num8 = NPC.NewNPC(GetSpawnSource_OldOnesArmy(), x, y, 560);
1720 }
1721 else if (Main.rand.Next(7) == 0 && NPC.CountNPCS(563) < num2)
1722 {
1723 num8 = NPC.NewNPC(GetSpawnSource_OldOnesArmy(), x, y, 563);
1724 }
1725 else if (Main.rand.Next(5) == 0 && NPC.CountNPCS(573) + NPC.CountNPCS(575) < num5)
1726 {
1727 num8 = ((Main.rand.Next(3) == 0) ? NPC.NewNPC(GetSpawnSource_OldOnesArmy(), x, y, 575) : NPC.NewNPC(GetSpawnSource_OldOnesArmy(), x, y, 573));
1728 }
1729 else if (NPC.CountNPCS(554) < num)
1730 {
1731 num8 = NPC.NewNPC(GetSpawnSource_OldOnesArmy(), x, y, 554);
1732 }
1733 break;
1734 case 5:
1735 if (Main.rand.Next(20) == 0 && !NPC.AnyNPCs(577))
1736 {
1737 num8 = NPC.NewNPC(GetSpawnSource_OldOnesArmy(), x, y, 577);
1738 }
1739 else if (Main.rand.Next(17) == 0 && NPC.CountNPCS(569) < num4)
1740 {
1741 num8 = NPC.NewNPC(GetSpawnSource_OldOnesArmy(), x, y, 569);
1742 }
1743 else if (Main.rand.Next(8) == 0 && NPC.CountNPCS(571) < num6)
1744 {
1745 num8 = NPC.NewNPC(GetSpawnSource_OldOnesArmy(), x, y, 571);
1746 }
1747 else if (Main.rand.Next(7) == 0 && NPC.CountNPCS(573) + NPC.CountNPCS(575) < num5)
1748 {
1749 num8 = ((Main.rand.Next(4) == 0) ? NPC.NewNPC(GetSpawnSource_OldOnesArmy(), x, y, 575) : NPC.NewNPC(GetSpawnSource_OldOnesArmy(), x, y, 573));
1750 }
1751 else if (NPC.CountNPCS(554) + NPC.CountNPCS(557) < num)
1752 {
1753 if (Main.rand.Next(3) == 0)
1754 {
1755 num8 = NPC.NewNPC(GetSpawnSource_OldOnesArmy(), x, y, 557);
1756 }
1757 num9 = NPC.NewNPC(GetSpawnSource_OldOnesArmy(), x, y, 554);
1758 }
1759 break;
1760 case 6:
1761 if (Main.rand.Next(20) == 0 && !NPC.AnyNPCs(577))
1762 {
1763 num8 = NPC.NewNPC(GetSpawnSource_OldOnesArmy(), x, y, 577);
1764 }
1765 else if (Main.rand.Next(20) == 0 && !NPC.AnyNPCs(565))
1766 {
1767 num8 = NPC.NewNPC(GetSpawnSource_OldOnesArmy(), x, y, 565);
1768 }
1769 else if (Main.rand.Next(12) == 0 && NPC.CountNPCS(571) < num6)
1770 {
1771 num8 = NPC.NewNPC(GetSpawnSource_OldOnesArmy(), x, y, 571);
1772 }
1773 else if (Main.rand.Next(25) == 0 && NPC.CountNPCS(569) < num4)
1774 {
1775 num8 = NPC.NewNPC(GetSpawnSource_OldOnesArmy(), x, y, 569);
1776 }
1777 if (Main.rand.Next(7) == 0 && NPC.CountNPCS(578) < num7)
1778 {
1779 num8 = NPC.NewNPC(GetSpawnSource_OldOnesArmy(), x, y, 578);
1780 }
1781 else if (Main.rand.Next(7) == 0 && NPC.CountNPCS(573) + NPC.CountNPCS(575) < num5)
1782 {
1783 num8 = ((Main.rand.Next(3) == 0) ? NPC.NewNPC(GetSpawnSource_OldOnesArmy(), x, y, 575) : NPC.NewNPC(GetSpawnSource_OldOnesArmy(), x, y, 573));
1784 }
1785 else if (Main.rand.Next(5) == 0 && NPC.CountNPCS(563) < num2)
1786 {
1787 num8 = NPC.NewNPC(GetSpawnSource_OldOnesArmy(), x, y, 563);
1788 }
1789 else if (NPC.CountNPCS(554) + NPC.CountNPCS(557) < num)
1790 {
1791 if (Main.rand.Next(3) == 0)
1792 {
1793 num8 = NPC.NewNPC(GetSpawnSource_OldOnesArmy(), x, y, 557);
1794 }
1795 num9 = NPC.NewNPC(GetSpawnSource_OldOnesArmy(), x, y, 554);
1796 }
1797 break;
1798 case 7:
1799 if (Main.rand.Next(20) == 0 && NPC.CountNPCS(571) < num6)
1800 {
1801 num8 = NPC.NewNPC(GetSpawnSource_OldOnesArmy(), x, y, 571);
1802 }
1803 else if (Main.rand.Next(17) == 0 && NPC.CountNPCS(569) < num4)
1804 {
1805 num8 = NPC.NewNPC(GetSpawnSource_OldOnesArmy(), x, y, 569);
1806 }
1807 else if (Main.rand.Next(10) == 0 && NPC.CountNPCS(563) < num2)
1808 {
1809 num8 = NPC.NewNPC(GetSpawnSource_OldOnesArmy(), x, y, 563);
1810 }
1811 else if (NPC.CountNPCS(554) + NPC.CountNPCS(557) < num)
1812 {
1813 if (Main.rand.Next(5) == 0)
1814 {
1815 num8 = NPC.NewNPC(GetSpawnSource_OldOnesArmy(), x, y, 557);
1816 }
1817 num9 = NPC.NewNPC(GetSpawnSource_OldOnesArmy(), x, y, 554);
1818 }
1819 break;
1820 default:
1821 num8 = NPC.NewNPC(GetSpawnSource_OldOnesArmy(), x, y, 554);
1822 break;
1823 }
1824 if (Main.netMode == 2 && num8 < 200)
1825 {
1826 NetMessage.SendData(23, -1, -1, null, num8);
1827 }
1828 if (Main.netMode == 2 && num9 < 200)
1829 {
1830 NetMessage.SendData(23, -1, -1, null, num9);
1831 }
1832 }
static IEntitySource GetSpawnSource_OldOnesArmy()
Definition DD2Event.cs:1875

References Terraria.Main.CurrentFrameFlags.ActivePlayersCount, Terraria.NPC.AnyNPCs(), Terraria.NPC.CountNPCS(), Terraria.GameContent.Events.DD2Event.GetSpawnSource_OldOnesArmy(), Terraria.Main.netMode, Terraria.NPC.NewNPC(), Terraria.Main.rand, Terraria.NetMessage.SendData(), and Terraria.NPC.waveNumber.

Referenced by Terraria.GameContent.Events.DD2Event.SpawnMonsterFromGate().

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