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

◆ SpawnThingsFromPot()

static void Terraria.WorldGen.SpawnThingsFromPot ( int i,
int j,
int x2,
int y2,
int style )
inlinestaticprivate

Definition at line 51342 of file WorldGen.cs.

51343 {
51344 //IL_02d4: Unknown result type (might be due to invalid IL or missing references)
51345 //IL_0e7c: Unknown result type (might be due to invalid IL or missing references)
51346 bool flag = (double)j < Main.rockLayer;
51347 bool flag2 = j < Main.UnderworldLayer;
51348 if (Main.remixWorld)
51349 {
51350 flag = (double)j > Main.rockLayer && j < Main.UnderworldLayer;
51351 flag2 = (double)j > Main.worldSurface && (double)j < Main.rockLayer;
51352 }
51353 float num = 1f;
51354 bool flag3 = style >= 34 && style <= 36;
51355 switch (style)
51356 {
51357 case 4:
51358 case 5:
51359 case 6:
51360 num = 1.25f;
51361 break;
51362 case 7:
51363 case 8:
51364 case 9:
51365 num = 1.75f;
51366 break;
51367 default:
51368 if (style >= 10 && style <= 12)
51369 {
51370 num = 1.9f;
51371 }
51372 else if (style >= 13 && style <= 15)
51373 {
51374 num = 2.1f;
51375 }
51376 else if (style >= 16 && style <= 18)
51377 {
51378 num = 1.6f;
51379 }
51380 else if (style >= 19 && style <= 21)
51381 {
51382 num = 3.5f;
51383 }
51384 else if (style >= 22 && style <= 24)
51385 {
51386 num = 1.6f;
51387 }
51388 else if (style >= 25 && style <= 27)
51389 {
51390 num = 10f;
51391 }
51392 else if (style >= 28 && style <= 30)
51393 {
51394 if (Main.hardMode)
51395 {
51396 num = 4f;
51397 }
51398 }
51399 else if (style >= 31 && style <= 33)
51400 {
51401 num = 2f;
51402 }
51403 else if (style >= 34 && style <= 36)
51404 {
51405 num = 1.25f;
51406 }
51407 break;
51408 case 0:
51409 case 1:
51410 case 2:
51411 case 3:
51412 break;
51413 }
51414 num = (num * 2f + 1f) / 3f;
51415 int range = (int)(500f / ((num + 1f) / 2f));
51416 if (gen)
51417 {
51418 return;
51419 }
51420 if (Player.GetClosestRollLuck(i, j, range) == 0f)
51421 {
51422 if (Main.netMode != 1)
51423 {
51424 Projectile.NewProjectile(GetProjectileSource_TileBreak(i, j), i * 16 + 16, j * 16 + 16, 0f, -12f, 518, 0, 0f, Main.myPlayer);
51425 }
51426 return;
51427 }
51428 if (genRand.Next(35) == 0 && Main.wallDungeon[Main.tile[i, j].wall] && (double)j > Main.worldSurface)
51429 {
51430 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 327);
51431 return;
51432 }
51433 if (Main.getGoodWorld && genRand.Next(6) == 0)
51434 {
51435 Projectile.NewProjectile(GetProjectileSource_TileBreak(i, j), i * 16 + 16, j * 16 + 8, (float)Main.rand.Next(-100, 101) * 0.002f, 0f, 28, 0, 0f, Main.myPlayer, 16f, 16f);
51436 return;
51437 }
51438 if (Main.remixWorld && Main.netMode != 1 && genRand.Next(5) == 0)
51439 {
51440 Player player = Main.player[Player.FindClosest(new Vector2((float)(i * 16), (float)(j * 16)), 16, 16)];
51441 if (Main.rand.Next(2) == 0)
51442 {
51443 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 75);
51444 }
51445 else if (player.ZoneJungle)
51446 {
51447 int num12 = -1;
51448 num12 = NPC.NewNPC(NPC.GetSpawnSourceForNaturalSpawn(), x2 * 16 + 16, y2 * 16 + 32, -10);
51449 if (num12 > -1)
51450 {
51451 Main.npc[num12].ai[1] = 75f;
51452 Main.npc[num12].netUpdate = true;
51453 }
51454 }
51455 else if ((double)j > Main.rockLayer && j < Main.maxTilesY - 350)
51456 {
51457 int num13 = -1;
51458 num13 = ((Main.rand.Next(9) == 0) ? NPC.NewNPC(NPC.GetSpawnSourceForNaturalSpawn(), x2 * 16 + 16, y2 * 16 + 32, -7) : ((Main.rand.Next(7) == 0) ? NPC.NewNPC(NPC.GetSpawnSourceForNaturalSpawn(), x2 * 16 + 16, y2 * 16 + 32, -8) : ((Main.rand.Next(6) == 0) ? NPC.NewNPC(NPC.GetSpawnSourceForNaturalSpawn(), x2 * 16 + 16, y2 * 16 + 32, -9) : ((Main.rand.Next(3) != 0) ? NPC.NewNPC(NPC.GetSpawnSourceForNaturalSpawn(), x2 * 16 + 16, y2 * 16 + 32, 1) : NPC.NewNPC(NPC.GetSpawnSourceForNaturalSpawn(), x2 * 16 + 16, y2 * 16 + 32, -3)))));
51459 if (num13 > -1)
51460 {
51461 Main.npc[num13].ai[1] = 75f;
51462 Main.npc[num13].netUpdate = true;
51463 }
51464 }
51465 else if ((double)j > Main.worldSurface && (double)j <= Main.rockLayer)
51466 {
51467 int num14 = -1;
51468 num14 = NPC.NewNPC(NPC.GetSpawnSourceForNaturalSpawn(), x2 * 16 + 16, y2 * 16 + 32, -6);
51469 if (num14 > -1)
51470 {
51471 Main.npc[num14].ai[1] = 75f;
51472 Main.npc[num14].netUpdate = true;
51473 }
51474 }
51475 else
51476 {
51477 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 75);
51478 }
51479 return;
51480 }
51481 if (Main.remixWorld && (double)i > (double)Main.maxTilesX * 0.37 && (double)i < (double)Main.maxTilesX * 0.63 && j > Main.maxTilesY - 220)
51482 {
51483 int stack = Main.rand.Next(20, 41);
51484 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 965, stack);
51485 return;
51486 }
51487 if (genRand.Next(45) == 0 || (Main.rand.Next(45) == 0 && Main.expertMode))
51488 {
51489 if ((double)j < Main.worldSurface)
51490 {
51491 int num16 = genRand.Next(10);
51492 if (num16 == 0)
51493 {
51494 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 292);
51495 }
51496 if (num16 == 1)
51497 {
51498 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 298);
51499 }
51500 if (num16 == 2)
51501 {
51502 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 299);
51503 }
51504 if (num16 == 3)
51505 {
51506 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 290);
51507 }
51508 if (num16 == 4)
51509 {
51510 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 2322);
51511 }
51512 if (num16 == 5)
51513 {
51514 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 2324);
51515 }
51516 if (num16 == 6)
51517 {
51518 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 2325);
51519 }
51520 if (num16 >= 7)
51521 {
51522 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 2350, genRand.Next(1, 3));
51523 }
51524 }
51525 else if (flag)
51526 {
51527 int num17 = genRand.Next(11);
51528 if (num17 == 0)
51529 {
51530 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 289);
51531 }
51532 if (num17 == 1)
51533 {
51534 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 298);
51535 }
51536 if (num17 == 2)
51537 {
51538 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 299);
51539 }
51540 if (num17 == 3)
51541 {
51542 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 290);
51543 }
51544 if (num17 == 4)
51545 {
51546 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 303);
51547 }
51548 if (num17 == 5)
51549 {
51550 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 291);
51551 }
51552 if (num17 == 6)
51553 {
51554 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 304);
51555 }
51556 if (num17 == 7)
51557 {
51558 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 2322);
51559 }
51560 if (num17 == 8)
51561 {
51562 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 2329);
51563 }
51564 if (num17 >= 7)
51565 {
51566 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 2350, genRand.Next(1, 3));
51567 }
51568 }
51569 else if (flag2)
51570 {
51571 int num18 = genRand.Next(15);
51572 if (num18 == 0)
51573 {
51574 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 296);
51575 }
51576 if (num18 == 1)
51577 {
51578 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 295);
51579 }
51580 if (num18 == 2)
51581 {
51582 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 299);
51583 }
51584 if (num18 == 3)
51585 {
51586 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 302);
51587 }
51588 if (num18 == 4)
51589 {
51590 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 303);
51591 }
51592 if (num18 == 5)
51593 {
51594 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 305);
51595 }
51596 if (num18 == 6)
51597 {
51598 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 301);
51599 }
51600 if (num18 == 7)
51601 {
51602 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 302);
51603 }
51604 if (num18 == 8)
51605 {
51606 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 297);
51607 }
51608 if (num18 == 9)
51609 {
51610 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 304);
51611 }
51612 if (num18 == 10)
51613 {
51614 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 2322);
51615 }
51616 if (num18 == 11)
51617 {
51618 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 2323);
51619 }
51620 if (num18 == 12)
51621 {
51622 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 2327);
51623 }
51624 if (num18 == 13)
51625 {
51626 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 2329);
51627 }
51628 if (num18 >= 7)
51629 {
51630 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 2350, genRand.Next(1, 3));
51631 }
51632 }
51633 else
51634 {
51635 int num19 = genRand.Next(14);
51636 if (num19 == 0)
51637 {
51638 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 296);
51639 }
51640 if (num19 == 1)
51641 {
51642 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 295);
51643 }
51644 if (num19 == 2)
51645 {
51646 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 293);
51647 }
51648 if (num19 == 3)
51649 {
51650 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 288);
51651 }
51652 if (num19 == 4)
51653 {
51654 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 294);
51655 }
51656 if (num19 == 5)
51657 {
51658 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 297);
51659 }
51660 if (num19 == 6)
51661 {
51662 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 304);
51663 }
51664 if (num19 == 7)
51665 {
51666 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 305);
51667 }
51668 if (num19 == 8)
51669 {
51670 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 301);
51671 }
51672 if (num19 == 9)
51673 {
51674 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 302);
51675 }
51676 if (num19 == 10)
51677 {
51678 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 288);
51679 }
51680 if (num19 == 11)
51681 {
51682 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 300);
51683 }
51684 if (num19 == 12)
51685 {
51686 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 2323);
51687 }
51688 if (num19 == 13)
51689 {
51690 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 2326);
51691 }
51692 if (genRand.Next(5) == 0)
51693 {
51694 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 4870);
51695 }
51696 }
51697 return;
51698 }
51699 if (Main.netMode == 2 && Main.rand.Next(30) == 0)
51700 {
51701 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 2997);
51702 return;
51703 }
51704 int num15 = Main.rand.Next(7);
51705 if (Main.expertMode)
51706 {
51707 num15--;
51708 }
51709 Player player2 = Main.player[Player.FindClosest(new Vector2((float)(i * 16), (float)(j * 16)), 16, 16)];
51710 int num2 = 0;
51711 int num3 = 20;
51712 for (int k = 0; k < 50; k++)
51713 {
51714 Item item = player2.inventory[k];
51715 if (!item.IsAir && item.createTile == 4)
51716 {
51717 num2 += item.stack;
51718 if (num2 >= num3)
51719 {
51720 break;
51721 }
51722 }
51723 }
51724 bool flag4 = num2 < num3;
51725 if (num15 == 0 && player2.statLife < player2.statLifeMax2)
51726 {
51727 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 58);
51728 if (Main.rand.Next(2) == 0)
51729 {
51730 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 58);
51731 }
51732 if (Main.expertMode)
51733 {
51734 if (Main.rand.Next(2) == 0)
51735 {
51736 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 58);
51737 }
51738 if (Main.rand.Next(2) == 0)
51739 {
51740 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 58);
51741 }
51742 }
51743 return;
51744 }
51745 if (num15 == 1 || (num15 == 0 && flag4))
51746 {
51747 int num4 = Main.rand.Next(2, 7);
51748 if (Main.expertMode)
51749 {
51750 num4 += Main.rand.Next(1, 7);
51751 }
51752 int type = 8;
51753 int type2 = 282;
51754 if (player2.ZoneHallow)
51755 {
51756 num4 += Main.rand.Next(2, 7);
51757 type = 4387;
51758 }
51759 else if ((style >= 22 && style <= 24) || player2.ZoneCrimson)
51760 {
51761 num4 += Main.rand.Next(2, 7);
51762 type = 4386;
51763 }
51764 else if ((style >= 16 && style <= 18) || player2.ZoneCorrupt)
51765 {
51766 num4 += Main.rand.Next(2, 7);
51767 type = 4385;
51768 }
51769 else if (style >= 7 && style <= 9)
51770 {
51771 num4 += Main.rand.Next(2, 7);
51772 num4 = (int)((float)num4 * 1.5f);
51773 type = 4388;
51774 }
51775 else if (style >= 4 && style <= 6)
51776 {
51777 type = 974;
51778 type2 = 286;
51779 }
51780 else if (style >= 34 && style <= 36)
51781 {
51782 num4 += Main.rand.Next(2, 7);
51783 type = 4383;
51784 }
51785 else if (player2.ZoneGlowshroom)
51786 {
51787 num4 += Main.rand.Next(2, 7);
51788 type = 5293;
51789 }
51790 if (Main.tile[i, j].liquid > 0)
51791 {
51792 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, type2, num4);
51793 }
51794 else
51795 {
51796 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, type, num4);
51797 }
51798 return;
51799 }
51800 switch (num15)
51801 {
51802 case 2:
51803 {
51804 int stack2 = Main.rand.Next(10, 21);
51805 int type4 = 40;
51806 if (flag && genRand.Next(2) == 0)
51807 {
51808 type4 = ((!Main.hardMode) ? 42 : 168);
51809 }
51810 if (j > Main.UnderworldLayer)
51811 {
51812 type4 = 265;
51813 }
51814 else if (Main.hardMode)
51815 {
51816 type4 = ((Main.rand.Next(2) != 0) ? 47 : ((SavedOreTiers.Silver != 168) ? 278 : 4915));
51817 }
51818 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, type4, stack2);
51819 return;
51820 }
51821 case 3:
51822 {
51823 int type5 = 28;
51824 if (j > Main.UnderworldLayer || Main.hardMode)
51825 {
51826 type5 = 188;
51827 }
51828 int num6 = 1;
51829 if (Main.expertMode && Main.rand.Next(3) != 0)
51830 {
51831 num6++;
51832 }
51833 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, type5, num6);
51834 return;
51835 }
51836 case 4:
51837 if (flag3 || flag2)
51838 {
51839 int type3 = 166;
51840 if (flag3)
51841 {
51842 type3 = 4423;
51843 }
51844 int num5 = Main.rand.Next(4) + 1;
51845 if (Main.expertMode)
51846 {
51847 num5 += Main.rand.Next(4);
51848 }
51849 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, type3, num5);
51850 return;
51851 }
51852 break;
51853 }
51854 if ((num15 == 4 || num15 == 5) && j < Main.UnderworldLayer && !Main.hardMode)
51855 {
51856 int stack3 = Main.rand.Next(20, 41);
51857 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 965, stack3);
51858 return;
51859 }
51860 float num7 = 200 + genRand.Next(-100, 101);
51861 if ((double)j < Main.worldSurface)
51862 {
51863 num7 *= 0.5f;
51864 }
51865 else if (flag)
51866 {
51867 num7 *= 0.75f;
51868 }
51869 else if (j > Main.maxTilesY - 250)
51870 {
51871 num7 *= 1.25f;
51872 }
51873 num7 *= 1f + (float)Main.rand.Next(-20, 21) * 0.01f;
51874 if (Main.rand.Next(4) == 0)
51875 {
51876 num7 *= 1f + (float)Main.rand.Next(5, 11) * 0.01f;
51877 }
51878 if (Main.rand.Next(8) == 0)
51879 {
51880 num7 *= 1f + (float)Main.rand.Next(10, 21) * 0.01f;
51881 }
51882 if (Main.rand.Next(12) == 0)
51883 {
51884 num7 *= 1f + (float)Main.rand.Next(20, 41) * 0.01f;
51885 }
51886 if (Main.rand.Next(16) == 0)
51887 {
51888 num7 *= 1f + (float)Main.rand.Next(40, 81) * 0.01f;
51889 }
51890 if (Main.rand.Next(20) == 0)
51891 {
51892 num7 *= 1f + (float)Main.rand.Next(50, 101) * 0.01f;
51893 }
51894 if (Main.expertMode)
51895 {
51896 num7 *= 2.5f;
51897 }
51898 if (Main.expertMode && Main.rand.Next(2) == 0)
51899 {
51900 num7 *= 1.25f;
51901 }
51902 if (Main.expertMode && Main.rand.Next(3) == 0)
51903 {
51904 num7 *= 1.5f;
51905 }
51906 if (Main.expertMode && Main.rand.Next(4) == 0)
51907 {
51908 num7 *= 1.75f;
51909 }
51910 num7 *= num;
51911 if (NPC.downedBoss1)
51912 {
51913 num7 *= 1.1f;
51914 }
51915 if (NPC.downedBoss2)
51916 {
51917 num7 *= 1.1f;
51918 }
51919 if (NPC.downedBoss3)
51920 {
51921 num7 *= 1.1f;
51922 }
51923 if (NPC.downedMechBoss1)
51924 {
51925 num7 *= 1.1f;
51926 }
51927 if (NPC.downedMechBoss2)
51928 {
51929 num7 *= 1.1f;
51930 }
51931 if (NPC.downedMechBoss3)
51932 {
51933 num7 *= 1.1f;
51934 }
51935 if (NPC.downedPlantBoss)
51936 {
51937 num7 *= 1.1f;
51938 }
51939 if (NPC.downedQueenBee)
51940 {
51941 num7 *= 1.1f;
51942 }
51943 if (NPC.downedGolemBoss)
51944 {
51945 num7 *= 1.1f;
51946 }
51947 if (NPC.downedPirates)
51948 {
51949 num7 *= 1.1f;
51950 }
51951 if (NPC.downedGoblins)
51952 {
51953 num7 *= 1.1f;
51954 }
51955 if (NPC.downedFrost)
51956 {
51957 num7 *= 1.1f;
51958 }
51959 while ((int)num7 > 0)
51960 {
51961 if (num7 > 1000000f)
51962 {
51963 int num8 = (int)(num7 / 1000000f);
51964 if (num8 > 50 && Main.rand.Next(2) == 0)
51965 {
51966 num8 /= Main.rand.Next(3) + 1;
51967 }
51968 if (Main.rand.Next(2) == 0)
51969 {
51970 num8 /= Main.rand.Next(3) + 1;
51971 }
51972 num7 -= (float)(1000000 * num8);
51973 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 74, num8);
51974 continue;
51975 }
51976 if (num7 > 10000f)
51977 {
51978 int num9 = (int)(num7 / 10000f);
51979 if (num9 > 50 && Main.rand.Next(2) == 0)
51980 {
51981 num9 /= Main.rand.Next(3) + 1;
51982 }
51983 if (Main.rand.Next(2) == 0)
51984 {
51985 num9 /= Main.rand.Next(3) + 1;
51986 }
51987 num7 -= (float)(10000 * num9);
51988 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 73, num9);
51989 continue;
51990 }
51991 if (num7 > 100f)
51992 {
51993 int num10 = (int)(num7 / 100f);
51994 if (num10 > 50 && Main.rand.Next(2) == 0)
51995 {
51996 num10 /= Main.rand.Next(3) + 1;
51997 }
51998 if (Main.rand.Next(2) == 0)
51999 {
52000 num10 /= Main.rand.Next(3) + 1;
52001 }
52002 num7 -= (float)(100 * num10);
52003 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 72, num10);
52004 continue;
52005 }
52006 int num11 = (int)num7;
52007 if (num11 > 50 && Main.rand.Next(2) == 0)
52008 {
52009 num11 /= Main.rand.Next(3) + 1;
52010 }
52011 if (Main.rand.Next(2) == 0)
52012 {
52013 num11 /= Main.rand.Next(4) + 1;
52014 }
52015 if (num11 < 1)
52016 {
52017 num11 = 1;
52018 }
52019 num7 -= (float)num11;
52020 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 71, num11);
52021 }
52022 }
static volatile bool gen
Definition WorldGen.cs:1210
static UnifiedRandom genRand
Definition WorldGen.cs:1455
static EntitySource_TileBreak GetProjectileSource_TileBreak(int x, int y)
Definition WorldGen.cs:1552
static IEntitySource GetItemSource_FromTileBreak(int x, int y)

References Terraria.Item.createTile, Terraria.NPC.downedBoss1, Terraria.NPC.downedBoss2, Terraria.NPC.downedBoss3, Terraria.NPC.downedFrost, Terraria.NPC.downedGoblins, Terraria.NPC.downedGolemBoss, Terraria.NPC.downedMechBoss1, Terraria.NPC.downedMechBoss2, Terraria.NPC.downedMechBoss3, Terraria.NPC.downedPirates, Terraria.NPC.downedPlantBoss, Terraria.NPC.downedQueenBee, Terraria.Main.expertMode, Terraria.Player.FindClosest(), Terraria.Player.GetClosestRollLuck(), Terraria.Main.getGoodWorld, Terraria.NPC.GetSpawnSourceForNaturalSpawn(), Terraria.Main.hardMode, Terraria.Item.IsAir, Terraria.Main.maxTilesX, Terraria.Main.maxTilesY, Terraria.Main.myPlayer, Terraria.Main.netMode, Terraria.Item.NewItem(), Terraria.NPC.NewNPC(), Terraria.Projectile.NewProjectile(), Terraria.Main.npc, Terraria.Main.player, Terraria.Main.rand, Terraria.Main.remixWorld, Terraria.Main.rockLayer, Terraria.Item.stack, Terraria.Main.tile, Terraria.Main.UnderworldLayer, Terraria.Main.wallDungeon, Terraria.Main.worldSurface, and Terraria.Player.ZoneJungle.

+ Here is the call graph for this function: