Files
CalamityModPublic/World/AerialiteOreGen.cs
T
Mortis3 fe722627bb last major abyss generation changes
Abyss Changes:
-sulphur depths islands now start at the top of the abyss hole
-abyss layer 2 islands are smaller, and more dense. chests no longer spawn in houses and there are more of them in layer 2
-layer 3 has a new block, also no longer has chests
-chaotic puffer, devilfish, and giant squid now only spawn in layer 3
-toxicatfish now spawns in the sulphur depths
-raised sulflounder spawn rate a bit
-reaper sharks and eidolon wyrms now have much lower spawnrates in layer 3
-toxic minnows cannot spawn in layer 3
-sulphur depths water now uses a toned down version of the sulphur sea waters light color
-added better bestiary names for each abyss layer
-sulphur poisoning UI now shows up in the sulphur depths

Other Changes:
-a few crags generation polishings
-added flipped versions of each giant crag lily for variety
-fixed sulphur and viper vines not dying if no tiles were above them
-probably a few other small things ive forgotten about
2023-02-10 20:35:50 -05:00

76 lines
3.1 KiB
C#

using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using Terraria.DataStructures;
using Terraria.GameContent.Generation;
using Terraria.WorldBuilding;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System;
using System.Linq;
using System.Collections.Generic;
using CalamityMod.DataStructures;
namespace CalamityMod.World
{
public class AerialiteOreGen
{
public static void Generate(bool Convert)
{
if (Main.netMode != NetmodeID.MultiplayerClient)
{
for (int x = 5; x < Main.maxTilesX - 5; x++)
{
for (int y = 5; y < Main.worldSurface; y++)
{
if (!Convert)
{
Tile tile = Main.tile[x, y];
if (WorldGen.genRand.Next(365) == 0 && tile.TileType == TileID.Cloud && tile.HasTile)
{
ShapeData circle = new ShapeData();
ShapeData biggerCircle = new ShapeData();
GenAction blotchMod = new Modifiers.Blotches(2, 0.4);
int radius = (int)(WorldGen.genRand.Next(3, 5) * WorldGen.genRand.NextFloat(0.74f, 0.82f));
//big cloud circle
WorldUtils.Gen(new Point(x, y), new Shapes.Circle(radius + 1), Actions.Chain(new GenAction[]
{
blotchMod.Output(biggerCircle)
}));
WorldUtils.Gen(new Point(x, y), new ModShapes.All(biggerCircle), Actions.Chain(new GenAction[]
{
new Actions.ClearTile(),
new Actions.PlaceTile((ushort)TileID.Cloud)
}));
//circle of ore
WorldUtils.Gen(new Point(x, y), new Shapes.Circle(radius), Actions.Chain(new GenAction[]
{
blotchMod.Output(circle)
}));
WorldUtils.Gen(new Point(x, y), new ModShapes.All(circle), Actions.Chain(new GenAction[]
{
new Actions.ClearTile(),
new Actions.PlaceTile((ushort)ModContent.TileType<Tiles.Ores.AerialiteOreDisenchanted>())
}));
}
}
if (Convert)
{
if (Main.tile[x, y].TileType == ModContent.TileType<Tiles.Ores.AerialiteOreDisenchanted>())
{
Main.tile[x, y].TileType = (ushort)ModContent.TileType<Tiles.Ores.AerialiteOre>();
}
}
}
}
}
}
}
}