Terraria v1.4.4.9
Terraria 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 48156 of file WorldGen.cs.

48157 {
48158 bool flag = (double)j < Main.rockLayer;
48159 bool flag2 = j < Main.UnderworldLayer;
48160 if (Main.remixWorld)
48161 {
48162 flag = (double)j > Main.rockLayer && j < Main.UnderworldLayer;
48163 flag2 = (double)j > Main.worldSurface && (double)j < Main.rockLayer;
48164 }
48165 float num = 1f;
48166 bool flag3 = style >= 34 && style <= 36;
48167 switch (style)
48168 {
48169 case 4:
48170 case 5:
48171 case 6:
48172 num = 1.25f;
48173 break;
48174 default:
48175 if (style >= 7 && style <= 9)
48176 {
48177 num = 1.75f;
48178 }
48179 else if (style >= 10 && style <= 12)
48180 {
48181 num = 1.9f;
48182 }
48183 else if (style >= 13 && style <= 15)
48184 {
48185 num = 2.1f;
48186 }
48187 else if (style >= 16 && style <= 18)
48188 {
48189 num = 1.6f;
48190 }
48191 else if (style >= 19 && style <= 21)
48192 {
48193 num = 3.5f;
48194 }
48195 else if (style >= 22 && style <= 24)
48196 {
48197 num = 1.6f;
48198 }
48199 else if (style >= 25 && style <= 27)
48200 {
48201 num = 10f;
48202 }
48203 else if (style >= 28 && style <= 30)
48204 {
48205 if (Main.hardMode)
48206 {
48207 num = 4f;
48208 }
48209 }
48210 else if (style >= 31 && style <= 33)
48211 {
48212 num = 2f;
48213 }
48214 else if (style >= 34 && style <= 36)
48215 {
48216 num = 1.25f;
48217 }
48218 break;
48219 case 0:
48220 case 1:
48221 case 2:
48222 case 3:
48223 break;
48224 }
48225 num = (num * 2f + 1f) / 3f;
48226 int range = (int)(500f / ((num + 1f) / 2f));
48227 if (gen)
48228 {
48229 return;
48230 }
48231 if (Player.GetClosestRollLuck(i, j, range) == 0f)
48232 {
48233 if (Main.netMode != 1)
48234 {
48235 Projectile.NewProjectile(GetProjectileSource_TileBreak(i, j), i * 16 + 16, j * 16 + 16, 0f, -12f, 518, 0, 0f, Main.myPlayer);
48236 }
48237 return;
48238 }
48239 if (genRand.Next(35) == 0 && Main.wallDungeon[Main.tile[i, j].wall] && (double)j > Main.worldSurface)
48240 {
48241 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 327);
48242 return;
48243 }
48244 if (Main.getGoodWorld && genRand.Next(6) == 0)
48245 {
48246 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);
48247 return;
48248 }
48249 if (Main.remixWorld && Main.netMode != 1 && genRand.Next(5) == 0)
48250 {
48251 Player player = Main.player[Player.FindClosest(new Vector2(i * 16, j * 16), 16, 16)];
48252 if (Main.rand.Next(2) == 0)
48253 {
48254 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 75);
48255 }
48256 else if (player.ZoneJungle)
48257 {
48258 int num2 = -1;
48259 num2 = NPC.NewNPC(NPC.GetSpawnSourceForNaturalSpawn(), x2 * 16 + 16, y2 * 16 + 32, -10);
48260 if (num2 > -1)
48261 {
48262 Main.npc[num2].ai[1] = 75f;
48263 Main.npc[num2].netUpdate = true;
48264 }
48265 }
48266 else if ((double)j > Main.rockLayer && j < Main.maxTilesY - 350)
48267 {
48268 int num3 = -1;
48269 num3 = ((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)))));
48270 if (num3 > -1)
48271 {
48272 Main.npc[num3].ai[1] = 75f;
48273 Main.npc[num3].netUpdate = true;
48274 }
48275 }
48276 else if ((double)j > Main.worldSurface && (double)j <= Main.rockLayer)
48277 {
48278 int num4 = -1;
48279 num4 = NPC.NewNPC(NPC.GetSpawnSourceForNaturalSpawn(), x2 * 16 + 16, y2 * 16 + 32, -6);
48280 if (num4 > -1)
48281 {
48282 Main.npc[num4].ai[1] = 75f;
48283 Main.npc[num4].netUpdate = true;
48284 }
48285 }
48286 else
48287 {
48288 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 75);
48289 }
48290 return;
48291 }
48292 if (Main.remixWorld && (double)i > (double)Main.maxTilesX * 0.37 && (double)i < (double)Main.maxTilesX * 0.63 && j > Main.maxTilesY - 220)
48293 {
48294 int stack = Main.rand.Next(20, 41);
48295 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 965, stack);
48296 return;
48297 }
48298 if (genRand.Next(45) == 0 || (Main.rand.Next(45) == 0 && Main.expertMode))
48299 {
48300 if ((double)j < Main.worldSurface)
48301 {
48302 int num5 = genRand.Next(10);
48303 if (num5 == 0)
48304 {
48305 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 292);
48306 }
48307 if (num5 == 1)
48308 {
48309 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 298);
48310 }
48311 if (num5 == 2)
48312 {
48313 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 299);
48314 }
48315 if (num5 == 3)
48316 {
48317 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 290);
48318 }
48319 if (num5 == 4)
48320 {
48321 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 2322);
48322 }
48323 if (num5 == 5)
48324 {
48325 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 2324);
48326 }
48327 if (num5 == 6)
48328 {
48329 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 2325);
48330 }
48331 if (num5 >= 7)
48332 {
48333 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 2350, genRand.Next(1, 3));
48334 }
48335 }
48336 else if (flag)
48337 {
48338 int num6 = genRand.Next(11);
48339 if (num6 == 0)
48340 {
48341 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 289);
48342 }
48343 if (num6 == 1)
48344 {
48345 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 298);
48346 }
48347 if (num6 == 2)
48348 {
48349 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 299);
48350 }
48351 if (num6 == 3)
48352 {
48353 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 290);
48354 }
48355 if (num6 == 4)
48356 {
48357 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 303);
48358 }
48359 if (num6 == 5)
48360 {
48361 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 291);
48362 }
48363 if (num6 == 6)
48364 {
48365 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 304);
48366 }
48367 if (num6 == 7)
48368 {
48369 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 2322);
48370 }
48371 if (num6 == 8)
48372 {
48373 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 2329);
48374 }
48375 if (num6 >= 7)
48376 {
48377 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 2350, genRand.Next(1, 3));
48378 }
48379 }
48380 else if (flag2)
48381 {
48382 int num7 = genRand.Next(15);
48383 if (num7 == 0)
48384 {
48385 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 296);
48386 }
48387 if (num7 == 1)
48388 {
48389 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 295);
48390 }
48391 if (num7 == 2)
48392 {
48393 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 299);
48394 }
48395 if (num7 == 3)
48396 {
48397 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 302);
48398 }
48399 if (num7 == 4)
48400 {
48401 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 303);
48402 }
48403 if (num7 == 5)
48404 {
48405 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 305);
48406 }
48407 if (num7 == 6)
48408 {
48409 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 301);
48410 }
48411 if (num7 == 7)
48412 {
48413 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 302);
48414 }
48415 if (num7 == 8)
48416 {
48417 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 297);
48418 }
48419 if (num7 == 9)
48420 {
48421 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 304);
48422 }
48423 if (num7 == 10)
48424 {
48425 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 2322);
48426 }
48427 if (num7 == 11)
48428 {
48429 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 2323);
48430 }
48431 if (num7 == 12)
48432 {
48433 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 2327);
48434 }
48435 if (num7 == 13)
48436 {
48437 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 2329);
48438 }
48439 if (num7 >= 7)
48440 {
48441 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 2350, genRand.Next(1, 3));
48442 }
48443 }
48444 else
48445 {
48446 int num8 = genRand.Next(14);
48447 if (num8 == 0)
48448 {
48449 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 296);
48450 }
48451 if (num8 == 1)
48452 {
48453 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 295);
48454 }
48455 if (num8 == 2)
48456 {
48457 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 293);
48458 }
48459 if (num8 == 3)
48460 {
48461 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 288);
48462 }
48463 if (num8 == 4)
48464 {
48465 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 294);
48466 }
48467 if (num8 == 5)
48468 {
48469 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 297);
48470 }
48471 if (num8 == 6)
48472 {
48473 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 304);
48474 }
48475 if (num8 == 7)
48476 {
48477 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 305);
48478 }
48479 if (num8 == 8)
48480 {
48481 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 301);
48482 }
48483 if (num8 == 9)
48484 {
48485 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 302);
48486 }
48487 if (num8 == 10)
48488 {
48489 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 288);
48490 }
48491 if (num8 == 11)
48492 {
48493 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 300);
48494 }
48495 if (num8 == 12)
48496 {
48497 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 2323);
48498 }
48499 if (num8 == 13)
48500 {
48501 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 2326);
48502 }
48503 if (genRand.Next(5) == 0)
48504 {
48505 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 4870);
48506 }
48507 }
48508 return;
48509 }
48510 if (Main.netMode == 2 && Main.rand.Next(30) == 0)
48511 {
48512 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 2997);
48513 return;
48514 }
48515 int num9 = Main.rand.Next(7);
48516 if (Main.expertMode)
48517 {
48518 num9--;
48519 }
48520 Player player2 = Main.player[Player.FindClosest(new Vector2(i * 16, j * 16), 16, 16)];
48521 int num10 = 0;
48522 int num11 = 20;
48523 for (int k = 0; k < 50; k++)
48524 {
48525 Item item = player2.inventory[k];
48526 if (!item.IsAir && item.createTile == 4)
48527 {
48528 num10 += item.stack;
48529 if (num10 >= num11)
48530 {
48531 break;
48532 }
48533 }
48534 }
48535 bool flag4 = num10 < num11;
48536 if (num9 == 0 && player2.statLife < player2.statLifeMax2)
48537 {
48538 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 58);
48539 if (Main.rand.Next(2) == 0)
48540 {
48541 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 58);
48542 }
48543 if (Main.expertMode)
48544 {
48545 if (Main.rand.Next(2) == 0)
48546 {
48547 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 58);
48548 }
48549 if (Main.rand.Next(2) == 0)
48550 {
48551 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 58);
48552 }
48553 }
48554 return;
48555 }
48556 if (num9 == 1 || (num9 == 0 && flag4))
48557 {
48558 int num12 = Main.rand.Next(2, 7);
48559 if (Main.expertMode)
48560 {
48561 num12 += Main.rand.Next(1, 7);
48562 }
48563 int type = 8;
48564 int type2 = 282;
48565 if (player2.ZoneHallow)
48566 {
48567 num12 += Main.rand.Next(2, 7);
48568 type = 4387;
48569 }
48570 else if ((style >= 22 && style <= 24) || player2.ZoneCrimson)
48571 {
48572 num12 += Main.rand.Next(2, 7);
48573 type = 4386;
48574 }
48575 else if ((style >= 16 && style <= 18) || player2.ZoneCorrupt)
48576 {
48577 num12 += Main.rand.Next(2, 7);
48578 type = 4385;
48579 }
48580 else if (style >= 7 && style <= 9)
48581 {
48582 num12 += Main.rand.Next(2, 7);
48583 num12 = (int)((float)num12 * 1.5f);
48584 type = 4388;
48585 }
48586 else if (style >= 4 && style <= 6)
48587 {
48588 type = 974;
48589 type2 = 286;
48590 }
48591 else if (style >= 34 && style <= 36)
48592 {
48593 num12 += Main.rand.Next(2, 7);
48594 type = 4383;
48595 }
48596 else if (player2.ZoneGlowshroom)
48597 {
48598 num12 += Main.rand.Next(2, 7);
48599 type = 5293;
48600 }
48601 if (Main.tile[i, j].liquid > 0)
48602 {
48603 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, type2, num12);
48604 }
48605 else
48606 {
48607 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, type, num12);
48608 }
48609 return;
48610 }
48611 switch (num9)
48612 {
48613 case 2:
48614 {
48615 int stack2 = Main.rand.Next(10, 21);
48616 int type4 = 40;
48617 if (flag && genRand.Next(2) == 0)
48618 {
48619 type4 = ((!Main.hardMode) ? 42 : 168);
48620 }
48621 if (j > Main.UnderworldLayer)
48622 {
48623 type4 = 265;
48624 }
48625 else if (Main.hardMode)
48626 {
48627 type4 = ((Main.rand.Next(2) != 0) ? 47 : ((SavedOreTiers.Silver != 168) ? 278 : 4915));
48628 }
48629 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, type4, stack2);
48630 return;
48631 }
48632 case 3:
48633 {
48634 int type5 = 28;
48635 if (j > Main.UnderworldLayer || Main.hardMode)
48636 {
48637 type5 = 188;
48638 }
48639 int num14 = 1;
48640 if (Main.expertMode && Main.rand.Next(3) != 0)
48641 {
48642 num14++;
48643 }
48644 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, type5, num14);
48645 return;
48646 }
48647 case 4:
48648 if (flag3 || flag2)
48649 {
48650 int type3 = 166;
48651 if (flag3)
48652 {
48653 type3 = 4423;
48654 }
48655 int num13 = Main.rand.Next(4) + 1;
48656 if (Main.expertMode)
48657 {
48658 num13 += Main.rand.Next(4);
48659 }
48660 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, type3, num13);
48661 return;
48662 }
48663 break;
48664 }
48665 if ((num9 == 4 || num9 == 5) && j < Main.UnderworldLayer && !Main.hardMode)
48666 {
48667 int stack3 = Main.rand.Next(20, 41);
48668 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 965, stack3);
48669 return;
48670 }
48671 float num15 = 200 + genRand.Next(-100, 101);
48672 if ((double)j < Main.worldSurface)
48673 {
48674 num15 *= 0.5f;
48675 }
48676 else if (flag)
48677 {
48678 num15 *= 0.75f;
48679 }
48680 else if (j > Main.maxTilesY - 250)
48681 {
48682 num15 *= 1.25f;
48683 }
48684 num15 *= 1f + (float)Main.rand.Next(-20, 21) * 0.01f;
48685 if (Main.rand.Next(4) == 0)
48686 {
48687 num15 *= 1f + (float)Main.rand.Next(5, 11) * 0.01f;
48688 }
48689 if (Main.rand.Next(8) == 0)
48690 {
48691 num15 *= 1f + (float)Main.rand.Next(10, 21) * 0.01f;
48692 }
48693 if (Main.rand.Next(12) == 0)
48694 {
48695 num15 *= 1f + (float)Main.rand.Next(20, 41) * 0.01f;
48696 }
48697 if (Main.rand.Next(16) == 0)
48698 {
48699 num15 *= 1f + (float)Main.rand.Next(40, 81) * 0.01f;
48700 }
48701 if (Main.rand.Next(20) == 0)
48702 {
48703 num15 *= 1f + (float)Main.rand.Next(50, 101) * 0.01f;
48704 }
48705 if (Main.expertMode)
48706 {
48707 num15 *= 2.5f;
48708 }
48709 if (Main.expertMode && Main.rand.Next(2) == 0)
48710 {
48711 num15 *= 1.25f;
48712 }
48713 if (Main.expertMode && Main.rand.Next(3) == 0)
48714 {
48715 num15 *= 1.5f;
48716 }
48717 if (Main.expertMode && Main.rand.Next(4) == 0)
48718 {
48719 num15 *= 1.75f;
48720 }
48721 num15 *= num;
48722 if (NPC.downedBoss1)
48723 {
48724 num15 *= 1.1f;
48725 }
48726 if (NPC.downedBoss2)
48727 {
48728 num15 *= 1.1f;
48729 }
48730 if (NPC.downedBoss3)
48731 {
48732 num15 *= 1.1f;
48733 }
48734 if (NPC.downedMechBoss1)
48735 {
48736 num15 *= 1.1f;
48737 }
48738 if (NPC.downedMechBoss2)
48739 {
48740 num15 *= 1.1f;
48741 }
48742 if (NPC.downedMechBoss3)
48743 {
48744 num15 *= 1.1f;
48745 }
48746 if (NPC.downedPlantBoss)
48747 {
48748 num15 *= 1.1f;
48749 }
48750 if (NPC.downedQueenBee)
48751 {
48752 num15 *= 1.1f;
48753 }
48754 if (NPC.downedGolemBoss)
48755 {
48756 num15 *= 1.1f;
48757 }
48758 if (NPC.downedPirates)
48759 {
48760 num15 *= 1.1f;
48761 }
48762 if (NPC.downedGoblins)
48763 {
48764 num15 *= 1.1f;
48765 }
48766 if (NPC.downedFrost)
48767 {
48768 num15 *= 1.1f;
48769 }
48770 while ((int)num15 > 0)
48771 {
48772 if (num15 > 1000000f)
48773 {
48774 int num16 = (int)(num15 / 1000000f);
48775 if (num16 > 50 && Main.rand.Next(2) == 0)
48776 {
48777 num16 /= Main.rand.Next(3) + 1;
48778 }
48779 if (Main.rand.Next(2) == 0)
48780 {
48781 num16 /= Main.rand.Next(3) + 1;
48782 }
48783 num15 -= (float)(1000000 * num16);
48784 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 74, num16);
48785 continue;
48786 }
48787 if (num15 > 10000f)
48788 {
48789 int num17 = (int)(num15 / 10000f);
48790 if (num17 > 50 && Main.rand.Next(2) == 0)
48791 {
48792 num17 /= Main.rand.Next(3) + 1;
48793 }
48794 if (Main.rand.Next(2) == 0)
48795 {
48796 num17 /= Main.rand.Next(3) + 1;
48797 }
48798 num15 -= (float)(10000 * num17);
48799 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 73, num17);
48800 continue;
48801 }
48802 if (num15 > 100f)
48803 {
48804 int num18 = (int)(num15 / 100f);
48805 if (num18 > 50 && Main.rand.Next(2) == 0)
48806 {
48807 num18 /= Main.rand.Next(3) + 1;
48808 }
48809 if (Main.rand.Next(2) == 0)
48810 {
48811 num18 /= Main.rand.Next(3) + 1;
48812 }
48813 num15 -= (float)(100 * num18);
48814 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 72, num18);
48815 continue;
48816 }
48817 int num19 = (int)num15;
48818 if (num19 > 50 && Main.rand.Next(2) == 0)
48819 {
48820 num19 /= Main.rand.Next(3) + 1;
48821 }
48822 if (Main.rand.Next(2) == 0)
48823 {
48824 num19 /= Main.rand.Next(4) + 1;
48825 }
48826 if (num19 < 1)
48827 {
48828 num19 = 1;
48829 }
48830 num15 -= (float)num19;
48831 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 16, 16, 71, num19);
48832 }
48833 }
static volatile bool gen
Definition WorldGen.cs:972
static UnifiedRandom genRand
Definition WorldGen.cs:1215
static EntitySource_TileBreak GetProjectileSource_TileBreak(int x, int y)
Definition WorldGen.cs:1308
static IEntitySource GetItemSource_FromTileBreak(int x, int y)

References 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, System.item, 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.Main.tile, System.type, Terraria.Main.UnderworldLayer, Terraria.Main.wallDungeon, Terraria.Main.worldSurface, and Terraria.Player.ZoneJungle.