Advertisement
Guest User

Untitled

a guest
Mar 28th, 2020
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.51 KB | None | 0 0
  1. public override void NPCLoot()
  2. {
  3. if (!Main.expertMode)
  4. {
  5. Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MineralChunk"), Main.rand.Next(3, 5));
  6. }
  7.  
  8.  
  9. /* {
  10. int loots2 = Main.rand.Next(10);
  11. switch (loots2)
  12. {
  13. case 1: Item.NewItem(npc.getRect(), mod.ItemType("GiantSandSifterTrophy"), 1); break;
  14. case 2: break;
  15. }
  16. }*/
  17. OurStuffAddonWorld.downedLifeEnforcer = true;
  18. if (Main.expertMode)
  19. {
  20. npc.DropBossBags();
  21. }
  22. if (OurStuffAddonWorld.heartStone = false)
  23. {
  24. OurStuffAddonWorld.heartStone = true;
  25. Main.NewText("Life bursts through the world", 250, 200, 200);
  26.  
  27. // Ores are quite simple, we simply use a for loop and the WorldGen.TileRunner to place splotches of the specified Tile in the world.
  28. // "6E-05" is "scientific notation". It simply means 0.00006 but in some ways is easier to read.
  29. for (int k = 0; k < (int)((double)(Main.maxTilesX * Main.maxTilesY) * 6E-05); k++)
  30. {
  31. // The inside of this for loop corresponds to one single splotch of our Ore.
  32. // First, we randomly choose any coordinate in the world by choosing a random x and y value.
  33. int x = WorldGen.genRand.Next(5, Main.maxTilesX - 500);
  34. int y = WorldGen.genRand.Next((int)WorldGen.rockLayer, Main.maxTilesY); // WorldGen.worldSurfaceLow is actually the highest surface tile. In practice you might want to use WorldGen.rockLayer or other WorldGen values.
  35.  
  36. // Then, we call WorldGen.TileRunner with random "strength" and random "steps", as well as the Tile we wish to place. Feel free to experiment with strength and step to see the shape they generate.
  37. Tile tile = Framing.GetTileSafely(x, y);
  38. if (tile.active() && tile.type == TileID.Stone)
  39. {
  40. WorldGen.TileRunner(x, y, 10, WorldGen.genRand.Next(3, 5), mod.TileType("HeartStone"), false, 0f, 0f, true, true);
  41. int Y = WorldGen.genRand.Next((int)WorldGen.rockLayer - 500, Main.maxTilesY - (int)WorldGen.rockLayer - 600);
  42. }
  43. }
  44. }
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement