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

◆ Difficulty_2_SpawnMonsterFromGate()

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

Definition at line 1290 of file DD2Event.cs.

1291 {
1292 //IL_0000: Unknown result type (might be due to invalid IL or missing references)
1293 //IL_0008: Unknown result type (might be due to invalid IL or missing references)
1294 int x = (int)gateBottom.X;
1295 int y = (int)gateBottom.Y;
1296 int num = 50;
1297 int num2 = 5;
1298 if (NPC.waveNumber > 1)
1299 {
1300 num2 = 8;
1301 }
1302 if (NPC.waveNumber > 3)
1303 {
1304 num2 = 10;
1305 }
1306 if (NPC.waveNumber > 5)
1307 {
1308 num2 = 12;
1309 }
1310 int num3 = 5;
1311 if (NPC.waveNumber > 4)
1312 {
1313 num3 = 7;
1314 }
1315 int num4 = 2;
1316 int num5 = 8;
1317 if (NPC.waveNumber > 3)
1318 {
1319 num5 = 12;
1320 }
1321 int num6 = 3;
1322 if (NPC.waveNumber > 5)
1323 {
1324 num6 = 5;
1325 }
1326 for (int i = 1; i < Main.CurrentFrameFlags.ActivePlayersCount; i++)
1327 {
1328 num = (int)((double)num * 1.3);
1329 num2 = (int)((double)num2 * 1.3);
1330 num5 = (int)((double)num * 1.3);
1331 num6 = (int)((double)num * 1.35);
1332 }
1333 int num7 = 200;
1334 int num8 = 200;
1335 switch (NPC.waveNumber)
1336 {
1337 case 1:
1338 if (Main.rand.Next(20) == 0 && NPC.CountNPCS(562) < num2)
1339 {
1340 num7 = NPC.NewNPC(GetSpawnSource_OldOnesArmy(), x, y, 562);
1341 }
1342 else if (NPC.CountNPCS(553) < num)
1343 {
1344 num7 = NPC.NewNPC(GetSpawnSource_OldOnesArmy(), x, y, 553);
1345 }
1346 break;
1347 case 2:
1348 if (Main.rand.Next(3) == 0 && NPC.CountNPCS(572) < num5)
1349 {
1350 num7 = NPC.NewNPC(GetSpawnSource_OldOnesArmy(), x, y, 572);
1351 }
1352 else if (Main.rand.Next(8) == 0 && NPC.CountNPCS(562) < num2)
1353 {
1354 num7 = NPC.NewNPC(GetSpawnSource_OldOnesArmy(), x, y, 562);
1355 }
1356 else if (NPC.CountNPCS(553) < num)
1357 {
1358 num7 = NPC.NewNPC(GetSpawnSource_OldOnesArmy(), x, y, 553);
1359 }
1360 break;
1361 case 3:
1362 if (Main.rand.Next(7) == 0 && NPC.CountNPCS(572) < num5)
1363 {
1364 num7 = NPC.NewNPC(GetSpawnSource_OldOnesArmy(), x, y, 572);
1365 }
1366 else if (Main.rand.Next(10) == 0 && NPC.CountNPCS(559) < num3)
1367 {
1368 num7 = NPC.NewNPC(GetSpawnSource_OldOnesArmy(), x, y, 559);
1369 }
1370 else if (Main.rand.Next(8) == 0 && NPC.CountNPCS(562) < num2)
1371 {
1372 num7 = NPC.NewNPC(GetSpawnSource_OldOnesArmy(), x, y, 562);
1373 }
1374 else if (NPC.CountNPCS(553) + NPC.CountNPCS(556) < num)
1375 {
1376 if (Main.rand.Next(4) == 0)
1377 {
1378 num7 = NPC.NewNPC(GetSpawnSource_OldOnesArmy(), x, y, 556);
1379 }
1380 num8 = NPC.NewNPC(GetSpawnSource_OldOnesArmy(), x, y, 553);
1381 }
1382 break;
1383 case 4:
1384 if (Main.rand.Next(10) == 0 && NPC.CountNPCS(570) < num6)
1385 {
1386 num7 = NPC.NewNPC(GetSpawnSource_OldOnesArmy(), x, y, 570);
1387 }
1388 else if (Main.rand.Next(12) == 0 && NPC.CountNPCS(559) < num3)
1389 {
1390 num7 = NPC.NewNPC(GetSpawnSource_OldOnesArmy(), x, y, 559);
1391 }
1392 else if (Main.rand.Next(6) == 0 && NPC.CountNPCS(562) < num2)
1393 {
1394 num7 = NPC.NewNPC(GetSpawnSource_OldOnesArmy(), x, y, 562);
1395 }
1396 else if (Main.rand.Next(3) == 0 && NPC.CountNPCS(572) < num5)
1397 {
1398 num7 = NPC.NewNPC(GetSpawnSource_OldOnesArmy(), x, y, 572);
1399 }
1400 else if (NPC.CountNPCS(553) < num)
1401 {
1402 num7 = NPC.NewNPC(GetSpawnSource_OldOnesArmy(), x, y, 553);
1403 }
1404 break;
1405 case 5:
1406 if (Main.rand.Next(7) == 0 && NPC.CountNPCS(570) < num6)
1407 {
1408 num7 = NPC.NewNPC(GetSpawnSource_OldOnesArmy(), x, y, 570);
1409 }
1410 else if (Main.rand.Next(10) == 0 && NPC.CountNPCS(559) < num3)
1411 {
1412 num7 = NPC.NewNPC(GetSpawnSource_OldOnesArmy(), x, y, 559);
1413 }
1414 else if (Main.rand.Next(4) == 0 && NPC.CountNPCS(572) + NPC.CountNPCS(574) < num5)
1415 {
1416 num7 = ((Main.rand.Next(2) != 0) ? NPC.NewNPC(GetSpawnSource_OldOnesArmy(), x, y, 574) : NPC.NewNPC(GetSpawnSource_OldOnesArmy(), x, y, 572));
1417 }
1418 else if (NPC.CountNPCS(553) + NPC.CountNPCS(556) < num)
1419 {
1420 if (Main.rand.Next(3) == 0)
1421 {
1422 num7 = NPC.NewNPC(GetSpawnSource_OldOnesArmy(), x, y, 556);
1423 }
1424 num8 = NPC.NewNPC(GetSpawnSource_OldOnesArmy(), x, y, 553);
1425 }
1426 break;
1427 case 6:
1428 if (Main.rand.Next(7) == 0 && NPC.CountNPCS(570) < num6)
1429 {
1430 num7 = NPC.NewNPC(GetSpawnSource_OldOnesArmy(), x, y, 570);
1431 }
1432 else if (Main.rand.Next(17) == 0 && NPC.CountNPCS(568) < num4)
1433 {
1434 num7 = NPC.NewNPC(GetSpawnSource_OldOnesArmy(), x, y, 568);
1435 }
1436 else if (Main.rand.Next(5) == 0 && NPC.CountNPCS(572) + NPC.CountNPCS(574) < num5)
1437 {
1438 num7 = ((Main.rand.Next(2) == 0) ? NPC.NewNPC(GetSpawnSource_OldOnesArmy(), x, y, 574) : NPC.NewNPC(GetSpawnSource_OldOnesArmy(), x, y, 572));
1439 }
1440 else if (Main.rand.Next(9) == 0 && NPC.CountNPCS(559) < num3)
1441 {
1442 num7 = NPC.NewNPC(GetSpawnSource_OldOnesArmy(), x, y, 559);
1443 }
1444 else if (Main.rand.Next(3) == 0 && NPC.CountNPCS(562) < num2)
1445 {
1446 num7 = NPC.NewNPC(GetSpawnSource_OldOnesArmy(), x, y, 562);
1447 }
1448 else if (NPC.CountNPCS(553) + NPC.CountNPCS(556) < num)
1449 {
1450 if (Main.rand.Next(3) != 0)
1451 {
1452 num7 = NPC.NewNPC(GetSpawnSource_OldOnesArmy(), x, y, 556);
1453 }
1454 num8 = NPC.NewNPC(GetSpawnSource_OldOnesArmy(), x, y, 553);
1455 }
1456 break;
1457 case 7:
1458 {
1460 if ((float)currentKillCount > (float)requiredKillCount * 0.1f && !NPC.AnyNPCs(576))
1461 {
1462 num7 = NPC.NewNPC(GetSpawnSource_OldOnesArmy(), x, y, 576);
1463 }
1464 else if (Main.rand.Next(7) == 0 && NPC.CountNPCS(570) < num6)
1465 {
1466 num7 = NPC.NewNPC(GetSpawnSource_OldOnesArmy(), x, y, 570);
1467 }
1468 else if (Main.rand.Next(17) == 0 && NPC.CountNPCS(568) < num4)
1469 {
1470 num7 = NPC.NewNPC(GetSpawnSource_OldOnesArmy(), x, y, 568);
1471 }
1472 else if (Main.rand.Next(7) == 0 && NPC.CountNPCS(572) + NPC.CountNPCS(574) < num5)
1473 {
1474 num7 = ((Main.rand.Next(3) == 0) ? NPC.NewNPC(GetSpawnSource_OldOnesArmy(), x, y, 574) : NPC.NewNPC(GetSpawnSource_OldOnesArmy(), x, y, 572));
1475 }
1476 else if (Main.rand.Next(11) == 0 && NPC.CountNPCS(559) < num3)
1477 {
1478 num7 = NPC.NewNPC(GetSpawnSource_OldOnesArmy(), x, y, 559);
1479 }
1480 else if (NPC.CountNPCS(553) + NPC.CountNPCS(556) < num)
1481 {
1482 if (Main.rand.Next(2) == 0)
1483 {
1484 num7 = NPC.NewNPC(GetSpawnSource_OldOnesArmy(), x, y, 556);
1485 }
1486 num8 = NPC.NewNPC(GetSpawnSource_OldOnesArmy(), x, y, 553);
1487 }
1488 break;
1489 }
1490 default:
1491 num7 = NPC.NewNPC(GetSpawnSource_OldOnesArmy(), x, y, 553);
1492 break;
1493 }
1494 if (Main.netMode == 2 && num7 < 200)
1495 {
1496 NetMessage.SendData(23, -1, -1, null, num7);
1497 }
1498 if (Main.netMode == 2 && num8 < 200)
1499 {
1500 NetMessage.SendData(23, -1, -1, null, num8);
1501 }
1502 }
static void GetInvasionStatus(out int currentWave, out int requiredKillCount, out int currentKillCount, bool currentlyInCheckProgress=false)
Definition DD2Event.cs:488
static IEntitySource GetSpawnSource_OldOnesArmy()
Definition DD2Event.cs:1875

References Terraria.Main.CurrentFrameFlags.ActivePlayersCount, Terraria.NPC.AnyNPCs(), Terraria.NPC.CountNPCS(), Terraria.GameContent.Events.DD2Event.GetInvasionStatus(), 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: