Many changes
-Sunken sea generation polishing and fixing -Abyss generation loops now just use X and Y instead of abyssIndex and abyssIndex2 -Sunken draedon lab now generates in the sunken sea -Added abyss coral -Fixed and polished the sulphur reefs generation a bit -Added sea anemonies to the burrows because i forgot to add them earlier
No files matched your search
@@ -8,7 +8,7 @@ using CalamityMod.Items.Materials;
|
||||
namespace CalamityMod.Items.Armor.Vanity
|
||||
{
|
||||
[AutoloadEquip(EquipType.Head)]
|
||||
public class SnailHead : ModItem, ILocalizedModType
|
||||
public class AbyssHood : ModItem, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Armor.Vanity";
|
||||
|
||||
@@ -32,10 +32,11 @@ namespace CalamityMod.Items.Armor.Vanity
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe().
|
||||
AddIngredient<AbyssGravel>(10).
|
||||
AddIngredient<Lumenyl>(18).
|
||||
AddTile(TileID.Loom).
|
||||
Register();
|
||||
AddIngredient<AbyssGravel>(10).
|
||||
AddIngredient<Lumenyl>(18).
|
||||
AddIngredient(ItemID.Silk, 20).
|
||||
AddTile(TileID.Loom).
|
||||
Register();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 522 B |
|
After Width: | Height: | Size: 4.5 KiB |
@@ -8,7 +8,7 @@ using CalamityMod.Items.Materials;
|
||||
namespace CalamityMod.Items.Armor.Vanity
|
||||
{
|
||||
[AutoloadEquip(EquipType.Body)]
|
||||
public class SnailRobe : ModItem, ILocalizedModType
|
||||
public class AbyssRobe : ModItem, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Armor.Vanity";
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace CalamityMod.Items.Armor.Vanity
|
||||
{
|
||||
if (Main.netMode != NetmodeID.Server)
|
||||
{
|
||||
EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Armor/Vanity/SnailRobe_Legs", EquipType.Legs, this);
|
||||
EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Armor/Vanity/AbyssRobe_Legs", EquipType.Legs, this);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,11 +38,11 @@ namespace CalamityMod.Items.Armor.Vanity
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe().
|
||||
AddIngredient<AbyssGravel>(22).
|
||||
AddIngredient<Lumenyl>(25).
|
||||
AddIngredient(ItemID.Silk, 25).
|
||||
AddTile(TileID.Loom).
|
||||
Register();
|
||||
AddIngredient<AbyssGravel>(22).
|
||||
AddIngredient<Lumenyl>(25).
|
||||
AddIngredient(ItemID.Silk, 25).
|
||||
AddTile(TileID.Loom).
|
||||
Register();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 693 B |
|
After Width: | Height: | Size: 5.5 KiB |
|
After Width: | Height: | Size: 4.2 KiB |
|
Before Width: | Height: | Size: 474 B |
|
Before Width: | Height: | Size: 3.8 KiB |
|
Before Width: | Height: | Size: 711 B |
|
Before Width: | Height: | Size: 5.5 KiB |
|
Before Width: | Height: | Size: 4.2 KiB |
@@ -243,12 +243,12 @@ YharonMask: {
|
||||
Tooltip: ""
|
||||
}
|
||||
|
||||
SnailHead: {
|
||||
DisplayName: Wearable Head Snail
|
||||
Tooltip: ""
|
||||
AbyssHood: {
|
||||
DisplayName: Abyss Cultist Hood
|
||||
Tooltip: Turns your face into tentacles
|
||||
}
|
||||
|
||||
SnailRobe: {
|
||||
DisplayName: Fancy Abyss Robe
|
||||
Tooltip: ""
|
||||
AbyssRobe: {
|
||||
DisplayName: Abyss Cultist Robe
|
||||
Tooltip: It feels cold, but very cozy
|
||||
}
|
||||
@@ -127,11 +127,12 @@ namespace CalamityMod.Systems
|
||||
int sunkenSeaX = (GenVars.UndergroundDesertLocation.Left + GenVars.UndergroundDesertLocation.Right) / 2;
|
||||
int sunkenSeaY = Main.maxTilesY / 2;
|
||||
|
||||
SunkenSea.PlaceRadiantReefs(sunkenSeaX - 130, sunkenSeaY + 75, true);
|
||||
SunkenSea.PlaceRadiantReefs(sunkenSeaX + 130, sunkenSeaY + 75, false);
|
||||
//place each piece of the sunken sea based on the above positons
|
||||
SunkenSea.PlaceRadiantReefs(sunkenSeaX - 100, sunkenSeaY + 75, true);
|
||||
SunkenSea.PlaceRadiantReefs(sunkenSeaX + 100, sunkenSeaY + 75, false);
|
||||
SunkenSea.PlacePolypForest(sunkenSeaX, sunkenSeaY + 75);
|
||||
SunkenSea.PlaceBasaltGully(sunkenSeaX, sunkenSeaY + (Main.maxTilesY / 4));
|
||||
SunkenSea.PlaceGleamingBurrows(sunkenSeaX, sunkenSeaY + (Main.maxTilesY / 4));
|
||||
SunkenSea.PlaceGleamingBurrows(sunkenSeaX, sunkenSeaY + (Main.maxTilesY / 4) - 50);
|
||||
SunkenSea.PlaceSunkenSeaAmbience();
|
||||
SunkenSea.BasaltGullyLavaCleanup(sunkenSeaX, sunkenSeaY + (Main.maxTilesY / 4));
|
||||
}));
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
using Terraria.ID;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
|
||||
namespace CalamityMod.Tiles.Abyss
|
||||
{
|
||||
public class AbyssCoral : ModTile
|
||||
{
|
||||
public byte[,] tileAdjacency;
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.tileSolid[Type] = true;
|
||||
Main.tileBlockLight[Type] = true;
|
||||
|
||||
CalamityUtils.MergeWithGeneral(Type);
|
||||
Main.tileLighted[Type] = true;
|
||||
|
||||
TileID.Sets.HasSlopeFrames[Type] = true;
|
||||
|
||||
TileID.Sets.ChecksForMerge[Type] = true;
|
||||
HitSound = SoundID.Dig;
|
||||
DustType = 119;
|
||||
AddMapEntry(new Color(139, 206, 56));
|
||||
Main.tileShine2[Type] = true;
|
||||
|
||||
TileID.Sets.CanBeDugByShovel[Type] = true;
|
||||
|
||||
TileFraming.SetUpUniversalMerge(Type, ModContent.TileType<AbyssGravel>(), out tileAdjacency);
|
||||
}
|
||||
|
||||
public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b)
|
||||
{
|
||||
if (!Main.tile[i - 1, j].HasTile || !Main.tile[i + 1, j].HasTile || !Main.tile[i, j - 1].HasTile || !Main.tile[i, j + 1].HasTile)
|
||||
{
|
||||
float brightness = 0.9f;
|
||||
Color Color1 = new Color(52, 84, 107);
|
||||
Color Color2 = new Color(29, 38, 56);
|
||||
Color value = Color.Lerp(Color1, Color2, (MathF.Sin(-j / 80f + Main.GameUpdateCount * 0.017f + i / 40f) + 1f) / 2f);
|
||||
Color value1 = Color.Lerp(Color1, Color2, (MathF.Sin((j - 100) / 50f + Main.GameUpdateCount * 0.004f + -i / 30f) + 1f) / 2f);
|
||||
r = (value.R + value1.R) / 300f;
|
||||
g = (value.G + value1.G) / 300f;
|
||||
b = (value.B + value1.B) / 300f;
|
||||
r *= brightness;
|
||||
g *= brightness;
|
||||
b *= brightness;
|
||||
}
|
||||
}
|
||||
|
||||
public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak)
|
||||
{
|
||||
TileFraming.GetAdjacencyData(i, j, ModContent.TileType<AbyssGravel>(), out tileAdjacency[i, j]);
|
||||
return TileFraming.BetterGemsparkFraming(i, j, resetFrame);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -50,10 +50,10 @@ namespace CalamityMod.Tiles.SunkenSea
|
||||
if (!Main.tile[i - 1, j].HasTile || !Main.tile[i + 1, j].HasTile || !Main.tile[i, j - 1].HasTile || !Main.tile[i, j + 1].HasTile)
|
||||
{
|
||||
float brightness = 0.9f;
|
||||
Color Cyan1 = new Color(130, 213, 247);
|
||||
Color Cyan2 = new Color(26, 68, 85);
|
||||
Color value = Color.Lerp(Cyan1, Cyan2, (MathF.Sin(-j / 80f + Main.GameUpdateCount * 0.017f + i / 40f) + 1f) / 2f);
|
||||
Color value1 = Color.Lerp(Cyan1, Cyan2, (MathF.Sin((j - 100) / 50f + Main.GameUpdateCount * 0.004f + -i / 30f) + 1f) / 2f);
|
||||
Color Color1 = new Color(130, 213, 247);
|
||||
Color Color2 = new Color(26, 68, 85);
|
||||
Color value = Color.Lerp(Color1, Color2, (MathF.Sin(-j / 80f + Main.GameUpdateCount * 0.017f + i / 40f) + 1f) / 2f);
|
||||
Color value1 = Color.Lerp(Color1, Color2, (MathF.Sin((j - 100) / 50f + Main.GameUpdateCount * 0.004f + -i / 30f) + 1f) / 2f);
|
||||
r = (value.R + value1.R) / 400f;
|
||||
g = (value.G + value1.G) / 400f;
|
||||
b = (value.B + value1.B) / 400f;
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using CalamityMod.Items.Placeables;
|
||||
using CalamityMod.Tiles.SunkenSea.Ambient;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
@@ -62,5 +64,44 @@ namespace CalamityMod.Tiles.SunkenSea
|
||||
TileFraming.GetAdjacencyData(i, j, TileID.Sand, out fifthTileAdjacency[i, j]);
|
||||
return TileFraming.BrimstoneFraming(i, j, resetFrame);
|
||||
}
|
||||
|
||||
public override void RandomUpdate(int i, int j)
|
||||
{
|
||||
Tile tile = Main.tile[i, j];
|
||||
Tile up = Main.tile[i, j - 1];
|
||||
Tile up2 = Main.tile[i, j - 2];
|
||||
|
||||
if (!up.HasTile && !up2.HasTile && up.LiquidAmount > 0 && up2.LiquidAmount > 0 && !tile.LeftSlope && !tile.RightSlope && !tile.IsHalfBlock)
|
||||
{
|
||||
//brain corals
|
||||
if (WorldGen.genRand.NextBool(18))
|
||||
{
|
||||
ushort[] BrainCorals = new ushort[] { (ushort)ModContent.TileType<BrainCoral>(), (ushort)ModContent.TileType<SmallBrainCoral>() };
|
||||
|
||||
ushort newObject = Main.rand.Next(BrainCorals);
|
||||
|
||||
WorldGen.PlaceObject(i, j - 1, newObject, true);
|
||||
NetMessage.SendObjectPlacement(-1, i, j - 1, newObject, 0, 0, -1, -1);
|
||||
}
|
||||
|
||||
//tube corals
|
||||
if (WorldGen.genRand.NextBool(8))
|
||||
{
|
||||
ushort[] TubeCorals = new ushort[] { (ushort)ModContent.TileType<TubeCoral>(), (ushort)ModContent.TileType<SmallTubeCoral>() };
|
||||
|
||||
ushort newObject = Main.rand.Next(TubeCorals);
|
||||
|
||||
WorldGen.PlaceObject(i, j - 1, newObject, true);
|
||||
NetMessage.SendObjectPlacement(-1, i, j - 1, newObject, 0, 0, -1, -1);
|
||||
}
|
||||
|
||||
//anemonie
|
||||
if (WorldGen.genRand.NextBool(10))
|
||||
{
|
||||
WorldGen.PlaceObject(i, j - 1, (ushort)ModContent.TileType<SeaAnemone>(), true);
|
||||
NetMessage.SendObjectPlacement(-1, i, j - 1, (ushort)ModContent.TileType<SeaAnemone>(), 0, 0, -1, -1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -42,10 +42,10 @@ namespace CalamityMod.Tiles.SunkenSea
|
||||
if (!Main.tile[i - 1, j].HasTile || !Main.tile[i + 1, j].HasTile || !Main.tile[i, j - 1].HasTile || !Main.tile[i, j + 1].HasTile)
|
||||
{
|
||||
float brightness = 0.9f;
|
||||
Color Lime1 = new Color(176, 242, 96);
|
||||
Color Lime2 = new Color(82, 113, 29);
|
||||
Color value = Color.Lerp(Lime1, Lime2, (MathF.Sin(-j / 80f + Main.GameUpdateCount * 0.017f + i / 40f) + 1f) / 2f);
|
||||
Color value1 = Color.Lerp(Lime1, Lime2, (MathF.Sin((j - 100) / 50f + Main.GameUpdateCount * 0.004f + -i / 30f) + 1f) / 2f);
|
||||
Color Color1 = new Color(176, 242, 96);
|
||||
Color Color2 = new Color(82, 113, 29);
|
||||
Color value = Color.Lerp(Color1, Color2, (MathF.Sin(-j / 80f + Main.GameUpdateCount * 0.017f + i / 40f) + 1f) / 2f);
|
||||
Color value1 = Color.Lerp(Color1, Color2, (MathF.Sin((j - 100) / 50f + Main.GameUpdateCount * 0.004f + -i / 30f) + 1f) / 2f);
|
||||
r = (value.R + value1.R) / 300f;
|
||||
g = (value.G + value1.G) / 300f;
|
||||
b = (value.B + value1.B) / 300f;
|
||||
|
||||
@@ -42,10 +42,10 @@ namespace CalamityMod.Tiles.SunkenSea
|
||||
if (!Main.tile[i - 1, j].HasTile || !Main.tile[i + 1, j].HasTile || !Main.tile[i, j - 1].HasTile || !Main.tile[i, j + 1].HasTile)
|
||||
{
|
||||
float brightness = 0.9f;
|
||||
Color Magenta1 = new Color(242, 96, 161);
|
||||
Color Magenta2 = new Color(156, 51, 83);
|
||||
Color value = Color.Lerp(Magenta1, Magenta2, (MathF.Sin(-j / 80f + Main.GameUpdateCount * 0.017f + i / 40f) + 1f) / 2f);
|
||||
Color value1 = Color.Lerp(Magenta1, Magenta2, (MathF.Sin((j - 100) / 50f + Main.GameUpdateCount * 0.004f + -i / 30f) + 1f) / 2f);
|
||||
Color Color1 = new Color(242, 96, 161);
|
||||
Color Color2 = new Color(156, 51, 83);
|
||||
Color value = Color.Lerp(Color1, Color2, (MathF.Sin(-j / 80f + Main.GameUpdateCount * 0.017f + i / 40f) + 1f) / 2f);
|
||||
Color value1 = Color.Lerp(Color1, Color2, (MathF.Sin((j - 100) / 50f + Main.GameUpdateCount * 0.004f + -i / 30f) + 1f) / 2f);
|
||||
r = (value.R + value1.R) / 300f;
|
||||
g = (value.G + value1.G) / 300f;
|
||||
b = (value.B + value1.B) / 300f;
|
||||
|
||||
@@ -42,10 +42,10 @@ namespace CalamityMod.Tiles.SunkenSea
|
||||
if (!Main.tile[i - 1, j].HasTile || !Main.tile[i + 1, j].HasTile || !Main.tile[i, j - 1].HasTile || !Main.tile[i, j + 1].HasTile)
|
||||
{
|
||||
float brightness = 0.9f;
|
||||
Color Orange1 = new Color(255, 177, 120);
|
||||
Color Orange2 = new Color(117, 23, 44);
|
||||
Color value = Color.Lerp(Orange1, Orange2, (MathF.Sin(-j / 80f + Main.GameUpdateCount * 0.017f + i / 40f) + 1f) / 2f);
|
||||
Color value1 = Color.Lerp(Orange1, Orange2, (MathF.Sin((j - 100) / 50f + Main.GameUpdateCount * 0.004f + -i / 30f) + 1f) / 2f);
|
||||
Color Color1 = new Color(255, 177, 120);
|
||||
Color Color2 = new Color(117, 23, 44);
|
||||
Color value = Color.Lerp(Color1, Color2, (MathF.Sin(-j / 80f + Main.GameUpdateCount * 0.017f + i / 40f) + 1f) / 2f);
|
||||
Color value1 = Color.Lerp(Color1, Color2, (MathF.Sin((j - 100) / 50f + Main.GameUpdateCount * 0.004f + -i / 30f) + 1f) / 2f);
|
||||
r = (value.R + value1.R) / 300f;
|
||||
g = (value.G + value1.G) / 300f;
|
||||
b = (value.B + value1.B) / 300f;
|
||||
|
||||
@@ -42,10 +42,10 @@ namespace CalamityMod.Tiles.SunkenSea
|
||||
if (!Main.tile[i - 1, j].HasTile || !Main.tile[i + 1, j].HasTile || !Main.tile[i, j - 1].HasTile || !Main.tile[i, j + 1].HasTile)
|
||||
{
|
||||
float brightness = 0.9f;
|
||||
Color Yellow1 = new Color(218, 203, 67);
|
||||
Color Yellow2 = new Color(121, 76, 1);
|
||||
Color value = Color.Lerp(Yellow1, Yellow2, (MathF.Sin(-j / 80f + Main.GameUpdateCount * 0.017f + i / 40f) + 1f) / 2f);
|
||||
Color value1 = Color.Lerp(Yellow1, Yellow2, (MathF.Sin((j - 100) / 50f + Main.GameUpdateCount * 0.004f + -i / 30f) + 1f) / 2f);
|
||||
Color Color1 = new Color(218, 203, 67);
|
||||
Color Color2 = new Color(121, 76, 1);
|
||||
Color value = Color.Lerp(Color1, Color2, (MathF.Sin(-j / 80f + Main.GameUpdateCount * 0.017f + i / 40f) + 1f) / 2f);
|
||||
Color value1 = Color.Lerp(Color1, Color2, (MathF.Sin((j - 100) / 50f + Main.GameUpdateCount * 0.004f + -i / 30f) + 1f) / 2f);
|
||||
r = (value.R + value1.R) / 300f;
|
||||
g = (value.G + value1.G) / 300f;
|
||||
b = (value.B + value1.B) / 300f;
|
||||
|
||||
@@ -51,11 +51,11 @@ namespace CalamityMod.World
|
||||
int abyssMinX = AtLeftSideOfWorld ? 0 : abyssChasmX - 160;
|
||||
int abyssMaxX = AtLeftSideOfWorld ? abyssChasmX + 160 : x;
|
||||
|
||||
for (int abyssIndex = abyssMinX; abyssIndex < abyssMaxX; abyssIndex++)
|
||||
for (int X = abyssMinX; X < abyssMaxX; X++)
|
||||
{
|
||||
for (int abyssIndex2 = 0; abyssIndex2 < abyssChasmY + 50; abyssIndex2++)
|
||||
for (int Y = 0; Y < abyssChasmY + 50; Y++)
|
||||
{
|
||||
Tile tile = Framing.GetTileSafely(abyssIndex, abyssIndex2);
|
||||
Tile tile = Framing.GetTileSafely(X, Y);
|
||||
|
||||
if (tile.LiquidType == LiquidID.Lava && tile.LiquidAmount > 0)
|
||||
{
|
||||
@@ -70,43 +70,43 @@ namespace CalamityMod.World
|
||||
//i have at least left comments so people reading will know what does what
|
||||
if (Main.remixWorld)
|
||||
{
|
||||
if (abyssIndex2 <= rockLayer)
|
||||
if (Y <= rockLayer)
|
||||
{
|
||||
//replaces blocks wand walls that can be converted
|
||||
if (canConvert)
|
||||
{
|
||||
//layer 4
|
||||
if (abyssIndex2 <= rockLayer - (int)((y - 200) * 0.6f))
|
||||
if (Y <= rockLayer - (int)((y - 200) * 0.6f))
|
||||
{
|
||||
tile.TileType = (ushort)ModContent.TileType<Voidstone>();
|
||||
tile.WallType = (ushort)ModContent.WallType<VoidstoneWallUnsafe>();
|
||||
}
|
||||
//layer 3-4 dithering transition
|
||||
else if (abyssIndex2 <= rockLayer - (int)((y - 200) * 0.59f) && WorldGen.genRand.NextBool(2))
|
||||
else if (Y <= rockLayer - (int)((y - 200) * 0.59f) && WorldGen.genRand.NextBool(2))
|
||||
{
|
||||
tile.TileType = (ushort)ModContent.TileType<Voidstone>();
|
||||
tile.WallType = (ushort)ModContent.WallType<VoidstoneWallUnsafe>();
|
||||
}
|
||||
//layer 3
|
||||
else if (abyssIndex2 <= rockLayer - (int)((y - 200) * 0.4f))
|
||||
else if (Y <= rockLayer - (int)((y - 200) * 0.4f))
|
||||
{
|
||||
tile.TileType = (ushort)ModContent.TileType<PyreMantle>();
|
||||
tile.WallType = (ushort)ModContent.WallType<PyreMantleWall>();
|
||||
}
|
||||
//layer 2-3 dithering transition
|
||||
else if (abyssIndex2 <= rockLayer - (int)((y - 200) * 0.39f) && WorldGen.genRand.NextBool(2))
|
||||
else if (Y <= rockLayer - (int)((y - 200) * 0.39f) && WorldGen.genRand.NextBool(2))
|
||||
{
|
||||
tile.TileType = (ushort)ModContent.TileType<PyreMantle>();
|
||||
tile.WallType = (ushort)ModContent.WallType<PyreMantleWall>();
|
||||
}
|
||||
//layer 2
|
||||
else if (abyssIndex2 <= rockLayer - (int)((y - 200) * 0.2f))
|
||||
else if (Y <= rockLayer - (int)((y - 200) * 0.2f))
|
||||
{
|
||||
tile.TileType = (ushort)ModContent.TileType<AbyssGravel>();
|
||||
tile.WallType = (ushort)ModContent.WallType<AbyssGravelWall>();
|
||||
}
|
||||
//layer 1-2 dithering transition
|
||||
else if (abyssIndex2 <= rockLayer - (int)((y - 200) * 0.19f))
|
||||
else if (Y <= rockLayer - (int)((y - 200) * 0.19f))
|
||||
{
|
||||
if (WorldGen.genRand.NextBool(2))
|
||||
{
|
||||
@@ -132,37 +132,37 @@ namespace CalamityMod.World
|
||||
tile.Get<TileWallWireStateData>().HasTile = true;
|
||||
|
||||
//layer 4
|
||||
if (abyssIndex2 <= rockLayer - (int)((y - 200) * 0.6f))
|
||||
if (Y <= rockLayer - (int)((y - 200) * 0.6f))
|
||||
{
|
||||
tile.TileType = (ushort)ModContent.TileType<Voidstone>();
|
||||
tile.WallType = (ushort)ModContent.WallType<VoidstoneWallUnsafe>();
|
||||
}
|
||||
//layer 3-4 dithering transition
|
||||
else if (abyssIndex2 <= rockLayer - (int)((y - 200) * 0.59f) && WorldGen.genRand.NextBool(2))
|
||||
else if (Y <= rockLayer - (int)((y - 200) * 0.59f) && WorldGen.genRand.NextBool(2))
|
||||
{
|
||||
tile.TileType = (ushort)ModContent.TileType<Voidstone>();
|
||||
tile.WallType = (ushort)ModContent.WallType<VoidstoneWallUnsafe>();
|
||||
}
|
||||
//layer 3
|
||||
else if (abyssIndex2 <= rockLayer - (int)((y - 200) * 0.4f))
|
||||
else if (Y <= rockLayer - (int)((y - 200) * 0.4f))
|
||||
{
|
||||
tile.TileType = (ushort)ModContent.TileType<PyreMantle>();
|
||||
tile.WallType = (ushort)ModContent.WallType<PyreMantleWall>();
|
||||
}
|
||||
//layer 2-3 dithering transition
|
||||
else if (abyssIndex2 <= rockLayer - (int)((y - 200) * 0.39f) && WorldGen.genRand.NextBool(2))
|
||||
else if (Y <= rockLayer - (int)((y - 200) * 0.39f) && WorldGen.genRand.NextBool(2))
|
||||
{
|
||||
tile.TileType = (ushort)ModContent.TileType<PyreMantle>();
|
||||
tile.WallType = (ushort)ModContent.WallType<PyreMantleWall>();
|
||||
}
|
||||
//layer 2
|
||||
else if (abyssIndex2 <= rockLayer - (int)((y - 200) * 0.2f))
|
||||
else if (Y <= rockLayer - (int)((y - 200) * 0.2f))
|
||||
{
|
||||
tile.TileType = (ushort)ModContent.TileType<AbyssGravel>();
|
||||
tile.WallType = (ushort)ModContent.WallType<AbyssGravelWall>();
|
||||
}
|
||||
//layer 1-2 dithering transition
|
||||
else if (abyssIndex2 <= rockLayer - (int)((y - 200) * 0.19f))
|
||||
else if (Y <= rockLayer - (int)((y - 200) * 0.19f))
|
||||
{
|
||||
if (WorldGen.genRand.NextBool(2))
|
||||
{
|
||||
@@ -186,37 +186,37 @@ namespace CalamityMod.World
|
||||
}
|
||||
else
|
||||
{
|
||||
if (abyssIndex2 > (rockLayer - Main.maxTilesY / 15) + 35)
|
||||
if (Y > (rockLayer - Main.maxTilesY / 15) + 35)
|
||||
{
|
||||
//replaces blocks wand walls that can be converted
|
||||
//replaces blocks and walls that can be converted
|
||||
if (canConvert)
|
||||
{
|
||||
//layer 4
|
||||
if (abyssIndex2 > (rockLayer + y * 0.270))
|
||||
if (Y > (rockLayer + y * 0.270))
|
||||
{
|
||||
tile.TileType = (ushort)ModContent.TileType<Voidstone>();
|
||||
tile.WallType = (ushort)ModContent.WallType<VoidstoneWallUnsafe>();
|
||||
}
|
||||
//layer 3-4 dithering transition
|
||||
else if (abyssIndex2 > (rockLayer + y * 0.268) && WorldGen.genRand.NextBool(2))
|
||||
else if (Y > (rockLayer + y * 0.268) && WorldGen.genRand.NextBool(2))
|
||||
{
|
||||
tile.TileType = (ushort)ModContent.TileType<Voidstone>();
|
||||
tile.WallType = (ushort)ModContent.WallType<VoidstoneWallUnsafe>();
|
||||
}
|
||||
//layer 3
|
||||
else if (abyssIndex2 > (rockLayer + y * 0.145))
|
||||
else if (Y > (rockLayer + y * 0.145))
|
||||
{
|
||||
tile.TileType = (ushort)ModContent.TileType<PyreMantle>();
|
||||
tile.WallType = (ushort)ModContent.WallType<PyreMantleWall>();
|
||||
}
|
||||
//layer 2-3 dithering transition
|
||||
else if (abyssIndex2 > (rockLayer + y * 0.143) && WorldGen.genRand.NextBool(2))
|
||||
else if (Y > (rockLayer + y * 0.143) && WorldGen.genRand.NextBool(2))
|
||||
{
|
||||
tile.TileType = (ushort)ModContent.TileType<PyreMantle>();
|
||||
tile.WallType = (ushort)ModContent.WallType<PyreMantleWall>();
|
||||
}
|
||||
//layer 1-2 dithering transition
|
||||
else if (abyssIndex2 >= rockLayer - 10 && abyssIndex2 <= rockLayer)
|
||||
else if (Y >= rockLayer - 10 && Y <= rockLayer)
|
||||
{
|
||||
if (WorldGen.genRand.NextBool(2))
|
||||
{
|
||||
@@ -230,7 +230,7 @@ namespace CalamityMod.World
|
||||
}
|
||||
}
|
||||
//layer 1
|
||||
else if (abyssIndex2 <= rockLayer - 10)
|
||||
else if (Y <= rockLayer - 10)
|
||||
{
|
||||
tile.TileType = (ushort)ModContent.TileType<SulphurousShale>();
|
||||
tile.WallType = (ushort)ModContent.WallType<SulphurousShaleWall>();
|
||||
@@ -248,31 +248,31 @@ namespace CalamityMod.World
|
||||
tile.Get<TileWallWireStateData>().HasTile = true;
|
||||
|
||||
//layer 4
|
||||
if (abyssIndex2 > (rockLayer + y * 0.270))
|
||||
if (Y > (rockLayer + y * 0.270))
|
||||
{
|
||||
tile.TileType = (ushort)ModContent.TileType<Voidstone>();
|
||||
tile.WallType = (ushort)ModContent.WallType<VoidstoneWallUnsafe>();
|
||||
}
|
||||
//layer 3-4 dithering transition
|
||||
else if (abyssIndex2 > (rockLayer + y * 0.268) && WorldGen.genRand.NextBool(2))
|
||||
else if (Y > (rockLayer + y * 0.268) && WorldGen.genRand.NextBool(2))
|
||||
{
|
||||
tile.TileType = (ushort)ModContent.TileType<Voidstone>();
|
||||
tile.WallType = (ushort)ModContent.WallType<VoidstoneWallUnsafe>();
|
||||
}
|
||||
//layer 3
|
||||
else if (abyssIndex2 > (rockLayer + y * 0.145))
|
||||
else if (Y > (rockLayer + y * 0.145))
|
||||
{
|
||||
tile.TileType = (ushort)ModContent.TileType<PyreMantle>();
|
||||
tile.WallType = (ushort)ModContent.WallType<PyreMantleWall>();
|
||||
}
|
||||
//layer 2-3 dithering transition
|
||||
else if (abyssIndex2 > (rockLayer + y * 0.143) && WorldGen.genRand.NextBool(2))
|
||||
else if (Y > (rockLayer + y * 0.143) && WorldGen.genRand.NextBool(2))
|
||||
{
|
||||
tile.TileType = (ushort)ModContent.TileType<PyreMantle>();
|
||||
tile.WallType = (ushort)ModContent.WallType<PyreMantleWall>();
|
||||
}
|
||||
//layer 1-2 dithering transition
|
||||
else if (abyssIndex2 >= rockLayer - 10 && abyssIndex2 <= rockLayer)
|
||||
else if (Y >= rockLayer - 10 && Y <= rockLayer)
|
||||
{
|
||||
if (WorldGen.genRand.NextBool(2))
|
||||
{
|
||||
@@ -286,7 +286,7 @@ namespace CalamityMod.World
|
||||
}
|
||||
}
|
||||
//layer 1
|
||||
else if (abyssIndex2 <= rockLayer - 10)
|
||||
else if (Y <= rockLayer - 10)
|
||||
{
|
||||
tile.TileType = (ushort)ModContent.TileType<SulphurousShale>();
|
||||
tile.WallType = (ushort)ModContent.WallType<SulphurousShaleWall>();
|
||||
@@ -523,27 +523,27 @@ namespace CalamityMod.World
|
||||
}
|
||||
|
||||
//clean up
|
||||
for (int abyssIndex = abyssMinX + 5; abyssIndex < abyssMaxX - 5; abyssIndex++)
|
||||
for (int X = abyssMinX + 5; X < abyssMaxX - 5; X++)
|
||||
{
|
||||
for (int abyssIndex2 = 5; abyssIndex2 < abyssChasmY; abyssIndex2++)
|
||||
for (int Y = 5; Y < abyssChasmY; Y++)
|
||||
{
|
||||
Tile tile = Main.tile[abyssIndex, abyssIndex2];
|
||||
Tile tileUp = Main.tile[abyssIndex, abyssIndex2 - 1];
|
||||
Tile tileDown = Main.tile[abyssIndex, abyssIndex2 + 1];
|
||||
Tile tileLeft = Main.tile[abyssIndex - 1, abyssIndex2];
|
||||
Tile tileRight = Main.tile[abyssIndex + 1, abyssIndex2];
|
||||
Tile tile = Main.tile[X, Y];
|
||||
Tile tileUp = Main.tile[X, Y - 1];
|
||||
Tile tileDown = Main.tile[X, Y + 1];
|
||||
Tile tileLeft = Main.tile[X - 1, Y];
|
||||
Tile tileRight = Main.tile[X + 1, Y];
|
||||
|
||||
if (tile.TileType == ModContent.TileType<AbyssGravel>() || tile.TileType == ModContent.TileType<PyreMantle>() ||
|
||||
tile.TileType == ModContent.TileType<Voidstone>() || tile.TileType == ModContent.TileType<PlantyMush>() ||
|
||||
tile.TileType == ModContent.TileType<ScoriaOre>() || tile.TileType == ModContent.TileType<SulphurousShale>())
|
||||
{
|
||||
//slope tiles
|
||||
Tile.SmoothSlope(abyssIndex, abyssIndex2, true);
|
||||
Tile.SmoothSlope(X, Y, true);
|
||||
|
||||
//kill any individual floating tiles
|
||||
if (!tileUp.HasTile && !tileDown.HasTile && !tileLeft.HasTile && !tileRight.HasTile)
|
||||
{
|
||||
WorldGen.KillTile(abyssIndex, abyssIndex2);
|
||||
WorldGen.KillTile(X, Y);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -557,24 +557,24 @@ namespace CalamityMod.World
|
||||
//kill obsidian
|
||||
if (tile.TileType == TileID.Obsidian)
|
||||
{
|
||||
WorldGen.KillTile(abyssIndex, abyssIndex2);
|
||||
WorldGen.KillTile(X, Y);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//ambient tiles and pots
|
||||
for (int abyssIndex = abyssMinX + 5; abyssIndex < abyssMaxX - 5; abyssIndex++)
|
||||
for (int X = abyssMinX + 5; X < abyssMaxX - 5; X++)
|
||||
{
|
||||
for (int abyssIndex2 = 0; abyssIndex2 < (Main.remixWorld ? rockLayer : Main.maxTilesY - 200); abyssIndex2++)
|
||||
for (int Y = 0; Y < (Main.remixWorld ? rockLayer : Main.maxTilesY - 200); Y++)
|
||||
{
|
||||
Tile tileToGrowVineOn = Main.tile[abyssIndex, abyssIndex2];
|
||||
Tile tileToGrowVineOn = Main.tile[X, Y];
|
||||
|
||||
if (!Main.tile[abyssIndex, abyssIndex2].HasTile)
|
||||
if (!Main.tile[X, Y].HasTile)
|
||||
{
|
||||
Tile tile = Main.tile[abyssIndex, abyssIndex2 + 1];
|
||||
Tile tile = Main.tile[X, Y + 1];
|
||||
|
||||
//above the 4th layer
|
||||
if (abyssIndex2 < (Main.remixWorld ? rockLayer : Main.maxTilesY - 200) && WorldGen.SolidTile(abyssIndex, abyssIndex2 + 1))
|
||||
if (Y < (Main.remixWorld ? rockLayer : Main.maxTilesY - 200) && WorldGen.SolidTile(X, Y + 1))
|
||||
{
|
||||
//sulphur shale stuff
|
||||
if (tile.TileType == ModContent.TileType<SulphurousShale>())
|
||||
@@ -582,7 +582,7 @@ namespace CalamityMod.World
|
||||
//tube coral
|
||||
if (WorldGen.genRand.NextBool(85))
|
||||
{
|
||||
WorldGen.PlaceObject(abyssIndex, abyssIndex2, (ushort)ModContent.TileType<SulphurTubeCoral>());
|
||||
WorldGen.PlaceObject(X, Y, (ushort)ModContent.TileType<SulphurTubeCoral>());
|
||||
}
|
||||
|
||||
//shale rock piles
|
||||
@@ -591,7 +591,7 @@ namespace CalamityMod.World
|
||||
ushort[] ShalePiles = new ushort[] { (ushort)ModContent.TileType<ShalePile1>(),
|
||||
(ushort)ModContent.TileType<ShalePile2>(), (ushort)ModContent.TileType<ShalePile3>() };
|
||||
|
||||
WorldGen.PlaceObject(abyssIndex, abyssIndex2, WorldGen.genRand.Next(ShalePiles));
|
||||
WorldGen.PlaceObject(X, Y, WorldGen.genRand.Next(ShalePiles));
|
||||
}
|
||||
|
||||
//pire corals
|
||||
@@ -600,7 +600,7 @@ namespace CalamityMod.World
|
||||
ushort[] PireCorals = new ushort[] { (ushort)ModContent.TileType<SulphurPireCoral1>(),
|
||||
(ushort)ModContent.TileType<SulphurPireCoral2>(), (ushort)ModContent.TileType<SulphurPireCoral3>() };
|
||||
|
||||
WorldGen.PlaceObject(abyssIndex, abyssIndex2, WorldGen.genRand.Next(PireCorals));
|
||||
WorldGen.PlaceObject(X, Y, WorldGen.genRand.Next(PireCorals));
|
||||
}
|
||||
|
||||
//sulphur fossils
|
||||
@@ -609,7 +609,7 @@ namespace CalamityMod.World
|
||||
ushort[] SulphuricFossils = new ushort[] { (ushort)ModContent.TileType<SulphuricFossil1>(),
|
||||
(ushort)ModContent.TileType<SulphuricFossil2>(), (ushort)ModContent.TileType<SulphuricFossil3>() };
|
||||
|
||||
WorldGen.PlaceObject(abyssIndex, abyssIndex2, WorldGen.genRand.Next(SulphuricFossils));
|
||||
WorldGen.PlaceObject(X, Y, WorldGen.genRand.Next(SulphuricFossils));
|
||||
}
|
||||
|
||||
//ribs
|
||||
@@ -619,7 +619,7 @@ namespace CalamityMod.World
|
||||
(ushort)ModContent.TileType<SulphurousRib2>(), (ushort)ModContent.TileType<SulphurousRib3>(),
|
||||
(ushort)ModContent.TileType<SulphurousRib4>(), (ushort)ModContent.TileType<SulphurousRib5>() };
|
||||
|
||||
WorldGen.PlaceObject(abyssIndex, abyssIndex2, WorldGen.genRand.Next(Ribs));
|
||||
WorldGen.PlaceObject(X, Y, WorldGen.genRand.Next(Ribs));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -631,17 +631,33 @@ namespace CalamityMod.World
|
||||
ushort[] PlantPiles = new ushort[] { (ushort)ModContent.TileType<PlantyMushPile1>(),
|
||||
(ushort)ModContent.TileType<PlantyMushPile2>(), (ushort)ModContent.TileType<PlantyMushPile3>() };
|
||||
|
||||
WorldGen.PlaceObject(abyssIndex, abyssIndex2, WorldGen.genRand.Next(PlantPiles));
|
||||
WorldGen.PlaceObject(X, Y, WorldGen.genRand.Next(PlantPiles));
|
||||
}
|
||||
}
|
||||
|
||||
//abyss gravel stuff
|
||||
if (tile.TileType == ModContent.TileType<AbyssGravel>())
|
||||
{
|
||||
//place coral blobs
|
||||
if (WorldGen.genRand.NextBool(125) && !Main.tile[X, Y - 1].HasTile)
|
||||
{
|
||||
ShapeData circle = new ShapeData();
|
||||
GenAction blotchMod = new Modifiers.Blotches(2, 0.4);
|
||||
WorldUtils.Gen(new Point(X, Y), new Shapes.Circle(WorldGen.genRand.Next(3, 4)), Actions.Chain(new GenAction[]
|
||||
{
|
||||
blotchMod.Output(circle)
|
||||
}));
|
||||
|
||||
WorldUtils.Gen(new Point(X, Y), new ModShapes.All(circle), Actions.Chain(new GenAction[]
|
||||
{
|
||||
new Actions.PlaceTile((ushort)ModContent.TileType<AbyssCoral>())
|
||||
}));
|
||||
}
|
||||
|
||||
//rare pearls
|
||||
if (WorldGen.genRand.NextBool(50))
|
||||
{
|
||||
WorldGen.PlaceObject(abyssIndex, abyssIndex2, (ushort)ModContent.TileType<MassiveRarePearl>());
|
||||
WorldGen.PlaceObject(X, Y, (ushort)ModContent.TileType<MassiveRarePearl>());
|
||||
}
|
||||
|
||||
//giant kelp on abyss gravel
|
||||
@@ -650,7 +666,7 @@ namespace CalamityMod.World
|
||||
ushort[] Kelps = new ushort[] { (ushort)ModContent.TileType<AbyssGiantKelp1>(), (ushort)ModContent.TileType<AbyssGiantKelp2>(),
|
||||
(ushort)ModContent.TileType<AbyssGiantKelp3>(), (ushort)ModContent.TileType<AbyssGiantKelp4>() };
|
||||
|
||||
WorldGen.PlaceObject(abyssIndex, abyssIndex2, WorldGen.genRand.Next(Kelps));
|
||||
WorldGen.PlaceObject(X, Y, WorldGen.genRand.Next(Kelps));
|
||||
}
|
||||
|
||||
//plany mush piles
|
||||
@@ -659,7 +675,7 @@ namespace CalamityMod.World
|
||||
ushort[] PlantPiles = new ushort[] { (ushort)ModContent.TileType<PlantyMushPile1>(),
|
||||
(ushort)ModContent.TileType<PlantyMushPile2>(), (ushort)ModContent.TileType<PlantyMushPile3>() };
|
||||
|
||||
WorldGen.PlaceObject(abyssIndex, abyssIndex2, WorldGen.genRand.Next(PlantPiles));
|
||||
WorldGen.PlaceObject(X, Y, WorldGen.genRand.Next(PlantPiles));
|
||||
}
|
||||
|
||||
//gravel rock piles
|
||||
@@ -668,7 +684,7 @@ namespace CalamityMod.World
|
||||
ushort[] GravelPiles = new ushort[] { (ushort)ModContent.TileType<GravelPile1>(),
|
||||
(ushort)ModContent.TileType<GravelPile2>(), (ushort)ModContent.TileType<GravelPile3>() };
|
||||
|
||||
WorldGen.PlaceObject(abyssIndex, abyssIndex2, WorldGen.genRand.Next(GravelPiles));
|
||||
WorldGen.PlaceObject(X, Y, WorldGen.genRand.Next(GravelPiles));
|
||||
}
|
||||
|
||||
//abyss gravel vents
|
||||
@@ -677,7 +693,7 @@ namespace CalamityMod.World
|
||||
ushort[] Vents = new ushort[] { (ushort)ModContent.TileType<AbyssVent1>(),
|
||||
(ushort)ModContent.TileType<AbyssVent2>(), (ushort)ModContent.TileType<AbyssVent3>() };
|
||||
|
||||
WorldGen.PlaceObject(abyssIndex, abyssIndex2, WorldGen.genRand.Next(Vents));
|
||||
WorldGen.PlaceObject(X, Y, WorldGen.genRand.Next(Vents));
|
||||
}
|
||||
|
||||
//pirate crates
|
||||
@@ -686,7 +702,7 @@ namespace CalamityMod.World
|
||||
ushort[] PirateCrate = new ushort[] { (ushort)ModContent.TileType<PirateCrate1>(),
|
||||
(ushort)ModContent.TileType<PirateCrate2>(), (ushort)ModContent.TileType<PirateCrate3>(), (ushort)ModContent.TileType<PirateCrate4>(), (ushort)ModContent.TileType<PirateCrate5>(), (ushort)ModContent.TileType<PirateCrate6>() };
|
||||
|
||||
WorldGen.PlaceObject(abyssIndex, abyssIndex2, WorldGen.genRand.Next(PirateCrate));
|
||||
WorldGen.PlaceObject(X, Y, WorldGen.genRand.Next(PirateCrate));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -700,7 +716,7 @@ namespace CalamityMod.World
|
||||
(ushort)ModContent.TileType<SpiderCoral2>(), (ushort)ModContent.TileType<SpiderCoral3>(),
|
||||
(ushort)ModContent.TileType<SpiderCoral4>(), (ushort)ModContent.TileType<SpiderCoral5>() };
|
||||
|
||||
WorldGen.PlaceObject(abyssIndex, abyssIndex2, WorldGen.genRand.Next(SpiderCorals));
|
||||
WorldGen.PlaceObject(X, Y, WorldGen.genRand.Next(SpiderCorals));
|
||||
}
|
||||
|
||||
//thermal vent
|
||||
@@ -709,7 +725,7 @@ namespace CalamityMod.World
|
||||
ushort[] Vents = new ushort[] { (ushort)ModContent.TileType<ThermalVent1>(),
|
||||
(ushort)ModContent.TileType<ThermalVent2>(), (ushort)ModContent.TileType<ThermalVent3>() };
|
||||
|
||||
WorldGen.PlaceObject(abyssIndex, abyssIndex2, WorldGen.genRand.Next(Vents));
|
||||
WorldGen.PlaceObject(X, Y, WorldGen.genRand.Next(Vents));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -722,57 +738,57 @@ namespace CalamityMod.World
|
||||
ushort[] BulbTrees = new ushort[] { (ushort)ModContent.TileType<BulbTree1>(),
|
||||
(ushort)ModContent.TileType<BulbTree2>(), (ushort)ModContent.TileType<BulbTree3>() };
|
||||
|
||||
WorldGen.PlaceObject(abyssIndex, abyssIndex2, WorldGen.genRand.Next(BulbTrees));
|
||||
WorldGen.PlaceObject(X, Y, WorldGen.genRand.Next(BulbTrees));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//pots
|
||||
if ((tile.TileType == ModContent.TileType<AbyssGravel>() || tile.TileType == ModContent.TileType<PyreMantle>() ||
|
||||
tile.TileType == ModContent.TileType<Voidstone>()) && abyssIndex2 > (Main.remixWorld ? rockLayer - (int)((y - 200) * 0.8f) : rockLayer))
|
||||
tile.TileType == ModContent.TileType<Voidstone>()) && Y > (Main.remixWorld ? rockLayer - (int)((y - 200) * 0.8f) : rockLayer))
|
||||
{
|
||||
if (WorldGen.genRand.NextBool(5))
|
||||
{
|
||||
WorldGen.PlacePot(abyssIndex, abyssIndex2, (ushort)ModContent.TileType<AbyssalPots>());
|
||||
CalamityUtils.SafeSquareTileFrame(abyssIndex, abyssIndex2, true);
|
||||
WorldGen.PlacePot(X, Y, (ushort)ModContent.TileType<AbyssalPots>());
|
||||
CalamityUtils.SafeSquareTileFrame(X, Y, true);
|
||||
}
|
||||
}
|
||||
|
||||
//sulphur pots
|
||||
else if (tile.TileType == ModContent.TileType<SulphurousShale>() && abyssIndex2 < (Main.remixWorld ? Main.maxTilesY - 200 : (int)Main.worldSurface))
|
||||
else if (tile.TileType == ModContent.TileType<SulphurousShale>() && Y < (Main.remixWorld ? Main.maxTilesY - 200 : (int)Main.worldSurface))
|
||||
{
|
||||
if (WorldGen.genRand.NextBool(3))
|
||||
{
|
||||
WorldGen.PlacePot(abyssIndex, abyssIndex2, (ushort)ModContent.TileType<SulphurousPots>());
|
||||
CalamityUtils.SafeSquareTileFrame(abyssIndex, abyssIndex2, true);
|
||||
WorldGen.PlacePot(X, Y, (ushort)ModContent.TileType<SulphurousPots>());
|
||||
CalamityUtils.SafeSquareTileFrame(X, Y, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//esentially what this does is grow one vine on the bottom of a tile, then use the util to keep placing the vine until it decides to stop
|
||||
if (tileToGrowVineOn.TileType == ModContent.TileType<PlantyMush>() && Main.tile[abyssIndex, abyssIndex2].Slope == 0 && !Main.tile[abyssIndex, abyssIndex2 + 1].HasTile)
|
||||
if (tileToGrowVineOn.TileType == ModContent.TileType<PlantyMush>() && Main.tile[X, Y].Slope == 0 && !Main.tile[X, Y + 1].HasTile)
|
||||
{
|
||||
if (WorldGen.genRand.Next(2) == 0)
|
||||
{
|
||||
WorldGen.PlaceTile(abyssIndex, abyssIndex2 + 1, (ushort)ModContent.TileType<ViperVines>());
|
||||
WorldGen.PlaceTile(X, Y + 1, (ushort)ModContent.TileType<ViperVines>());
|
||||
}
|
||||
}
|
||||
if (tileToGrowVineOn.TileType == ModContent.TileType<ViperVines>())
|
||||
{
|
||||
CalamityUtils.GrowVines(abyssIndex, abyssIndex2, WorldGen.genRand.Next(1, 4), (ushort)ModContent.TileType<ViperVines>());
|
||||
CalamityUtils.GrowVines(X, Y, WorldGen.genRand.Next(1, 4), (ushort)ModContent.TileType<ViperVines>());
|
||||
}
|
||||
|
||||
//same as above but for sulphur vines
|
||||
if (tileToGrowVineOn.TileType == ModContent.TileType<SulphurousShale>() && Main.tile[abyssIndex, abyssIndex2].Slope == 0 && !Main.tile[abyssIndex, abyssIndex2 + 1].HasTile)
|
||||
if (tileToGrowVineOn.TileType == ModContent.TileType<SulphurousShale>() && Main.tile[X, Y].Slope == 0 && !Main.tile[X, Y + 1].HasTile)
|
||||
{
|
||||
if (WorldGen.genRand.Next(5) == 0)
|
||||
{
|
||||
WorldGen.PlaceTile(abyssIndex, abyssIndex2 + 1, (ushort)ModContent.TileType<SulphurousVines>());
|
||||
WorldGen.PlaceTile(X, Y + 1, (ushort)ModContent.TileType<SulphurousVines>());
|
||||
}
|
||||
}
|
||||
if (tileToGrowVineOn.TileType == ModContent.TileType<SulphurousVines>())
|
||||
{
|
||||
CalamityUtils.GrowVines(abyssIndex, abyssIndex2, WorldGen.genRand.Next(1, 4), (ushort)ModContent.TileType<SulphurousVines>());
|
||||
CalamityUtils.GrowVines(X, Y, WorldGen.genRand.Next(1, 4), (ushort)ModContent.TileType<SulphurousVines>());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -326,61 +326,35 @@ namespace CalamityMod.World
|
||||
|
||||
public static void PlaceSunkenSeaLab(out Point placementPoint, List<Point> workshopPoints, StructureMap structures)
|
||||
{
|
||||
int tries = 0;
|
||||
string mapKey = SunkenSeaLabKey;
|
||||
PilePlacementMaps.TryGetValue(mapKey, out PilePlacementFunction pilePlacementFunction);
|
||||
SchematicMetaTile[,] schematic = TileMaps[mapKey];
|
||||
int labWidth = schematic.GetLength(0);
|
||||
int labHeight = schematic.GetLength(1);
|
||||
|
||||
do
|
||||
{
|
||||
// Pick a location based on the Underground Desert, because the Sunken Sea is based on the Underground Desert
|
||||
Rectangle ugDesert = GenVars.UndergroundDesertLocation;
|
||||
int placementPositionX = -1;
|
||||
int sunkenSeaX = (GenVars.UndergroundDesertLocation.Left + GenVars.UndergroundDesertLocation.Right) / 2;
|
||||
int sunkenSeaY = Main.maxTilesY / 2;
|
||||
|
||||
// Desperation generation: if 75% of attempts failed, start generating literally anywhere in the Sunken Sea
|
||||
if (tries >= 1500)
|
||||
placementPositionX = WorldGen.genRand.Next(ugDesert.Left, ugDesert.Right - labWidth);
|
||||
// 50% chance to be on either the left or the right.
|
||||
// If it's on the right then shove it left because all schematics are placed based on their top left corner.
|
||||
else if (WorldGen.genRand.NextBool())
|
||||
placementPositionX = WorldGen.genRand.Next(ugDesert.Left - 20, ugDesert.Left + 10);
|
||||
else
|
||||
placementPositionX = WorldGen.genRand.Next(ugDesert.Right - 10, ugDesert.Right + 20) - labWidth;
|
||||
int placementPositionX = sunkenSeaX < Main.maxTilesX / 2 ? sunkenSeaX - 120 : sunkenSeaX + 120;
|
||||
int placementPositionY = (sunkenSeaY + (Main.maxTilesY / 4) - 25) - labHeight;
|
||||
|
||||
int sunkenSeaY = 0;
|
||||
placementPoint = new Point(placementPositionX, placementPositionY);
|
||||
Vector2 schematicSize = new Vector2(schematic.GetLength(0), schematic.GetLength(1));
|
||||
|
||||
//copied the desert position code from the sunken sea's generation so the lab always generates within the sunken sea properly
|
||||
for (int y = Main.maxTilesY - 200; y >= Main.worldSurface; y--)
|
||||
{
|
||||
if (Main.tile[placementPositionX, y].WallType == ModContent.WallType<NavystoneWall>() ||
|
||||
Main.tile[placementPositionX, y].WallType == ModContent.WallType<EutrophicSandWall>())
|
||||
{
|
||||
sunkenSeaY = y - 80; //offset so it generates nicely
|
||||
break;
|
||||
}
|
||||
}
|
||||
/*
|
||||
I do not think that this check needs to exist for now, no other structures exist in the sunken sea at the moment
|
||||
Once other sunken sea structures are added, i will likely re-enable this and modify the generation so that it avoids protected areas again
|
||||
This is just so i can have it generating in time for the patreon beta
|
||||
*/
|
||||
|
||||
int placementPositionY = sunkenSeaY - labHeight;
|
||||
|
||||
placementPoint = new Point(placementPositionX, placementPositionY);
|
||||
Vector2 schematicSize = new Vector2(schematic.GetLength(0), schematic.GetLength(1));
|
||||
|
||||
if (structures.CanPlace(new Rectangle(placementPoint.X, placementPoint.Y, (int)schematicSize.X, (int)schematicSize.Y)))
|
||||
{
|
||||
bool hasPlacedLogAndSchematic = false;
|
||||
PlaceSchematic(mapKey, new Point(placementPoint.X, placementPoint.Y), SchematicAnchor.TopLeft, ref hasPlacedLogAndSchematic, new Action<Chest, int, bool>(FillSunkenSeaLaboratoryChest));
|
||||
CalamityUtils.AddProtectedStructure(new Rectangle(placementPoint.X, placementPoint.Y, (int)schematicSize.X, (int)schematicSize.Y), 20);
|
||||
//Reverted changes to center point placement; the change caused it to not center like it should, offsetting the range at which the bio lab theme plays
|
||||
CalamityWorld.SunkenSeaLabCenter = placementPoint.ToWorldCoordinates() + new Vector2(TileMaps[mapKey].GetLength(0), TileMaps[mapKey].GetLength(1)) * 8f;
|
||||
break;
|
||||
}
|
||||
//try again if the structure is colliding with a structure from another mod
|
||||
else
|
||||
tries++;
|
||||
}
|
||||
while (tries <= 2000);
|
||||
//if (structures.CanPlace(new Rectangle(placementPoint.X, placementPoint.Y, (int)schematicSize.X, (int)schematicSize.Y)))
|
||||
//{
|
||||
bool hasPlacedLogAndSchematic = false;
|
||||
PlaceSchematic(mapKey, new Point(placementPoint.X, placementPoint.Y), SchematicAnchor.TopLeft, ref hasPlacedLogAndSchematic, new Action<Chest, int, bool>(FillSunkenSeaLaboratoryChest));
|
||||
CalamityUtils.AddProtectedStructure(new Rectangle(placementPoint.X, placementPoint.Y, (int)schematicSize.X, (int)schematicSize.Y), 20);
|
||||
//Reverted changes to center point placement; the change caused it to not center like it should, offsetting the range at which the bio lab theme plays
|
||||
CalamityWorld.SunkenSeaLabCenter = placementPoint.ToWorldCoordinates() + new Vector2(TileMaps[mapKey].GetLength(0), TileMaps[mapKey].GetLength(1)) * 8f;
|
||||
//}
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -681,7 +681,7 @@ namespace CalamityMod.World
|
||||
int cavePerlinSeed = WorldGen.genRand.Next();
|
||||
int cavePerlinSeedWalls = WorldGen.genRand.Next();
|
||||
|
||||
Point origin = new Point(x + (x < Main.maxTilesX / 2 ? -10 : 10), YStart + depth + 80);
|
||||
Point origin = new Point(x + (x < Main.maxTilesX / 2 ? -35 : 35), YStart + depth + 80);
|
||||
Vector2 center = origin.ToVector2() * 16f + new Vector2(8f);
|
||||
|
||||
float angle = MathHelper.Pi * 0.15f;
|
||||
@@ -705,31 +705,93 @@ namespace CalamityMod.World
|
||||
{
|
||||
if (CheckReefsCircle(new Point(X, Y), topFoci, bottomFoci, constant, center, out float dist))
|
||||
{
|
||||
//clear absolutely everything before generating the caverns
|
||||
Main.tile[X, Y].ClearEverything();
|
||||
float percent = dist / constant;
|
||||
float blurPercent = 0.98f;
|
||||
|
||||
//generate perlin noise caves
|
||||
float horizontalOffsetNoise = CalamityUtils.PerlinNoise2D(X / 20f, Y / 20f, 5, unchecked(cavePerlinSeed + 1)) * 0.01f;
|
||||
float cavePerlinValue = CalamityUtils.PerlinNoise2D(X / 1000f, Y / 350f, 5, cavePerlinSeed) + 0.5f + horizontalOffsetNoise;
|
||||
float cavePerlinValue2 = CalamityUtils.PerlinNoise2D(X / 1000f, Y / 350f, 5, unchecked(cavePerlinSeed - 1)) + 0.5f;
|
||||
float caveNoiseMap = (cavePerlinValue + cavePerlinValue2) * 0.5f;
|
||||
float caveCreationThreshold = horizontalOffsetNoise * 3.5f + 0.235f;
|
||||
|
||||
//kill or place tiles depending on the noise map
|
||||
if (caveNoiseMap * caveNoiseMap > caveCreationThreshold)
|
||||
if (percent > blurPercent)
|
||||
{
|
||||
WorldGen.KillTile(X, Y);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
WorldGen.PlaceTile(X, Y, (ushort)ModContent.TileType<SulphurousSand>());
|
||||
//clear absolutely everything before generating the caverns
|
||||
Main.tile[X, Y].ClearEverything();
|
||||
|
||||
//generate perlin noise caves
|
||||
float horizontalOffsetNoise = CalamityUtils.PerlinNoise2D(X / 20f, Y / 20f, 5, unchecked(cavePerlinSeed + 1)) * 0.01f;
|
||||
float cavePerlinValue = CalamityUtils.PerlinNoise2D(X / 1000f, Y / 350f, 5, cavePerlinSeed) + 0.5f + horizontalOffsetNoise;
|
||||
float cavePerlinValue2 = CalamityUtils.PerlinNoise2D(X / 1000f, Y / 350f, 5, unchecked(cavePerlinSeed - 1)) + 0.5f;
|
||||
float caveNoiseMap = (cavePerlinValue + cavePerlinValue2) * 0.5f;
|
||||
float caveCreationThreshold = horizontalOffsetNoise * 3.5f + 0.235f;
|
||||
|
||||
//kill or place tiles depending on the noise map
|
||||
if (caveNoiseMap * caveNoiseMap > caveCreationThreshold)
|
||||
{
|
||||
WorldGen.KillTile(X, Y);
|
||||
}
|
||||
else
|
||||
{
|
||||
WorldGen.PlaceTile(X, Y, (ushort)ModContent.TileType<HardenedSulphurousSandstone>());
|
||||
}
|
||||
|
||||
Main.tile[X, Y].WallType = (ushort)ModContent.WallType<HardenedSulphurousSandstoneWall>();
|
||||
WorldGen.PlaceWall(X, Y, ModContent.WallType<HardenedSulphurousSandstoneWall>());
|
||||
|
||||
Main.tile[X, Y].Get<LiquidData>().LiquidType = LiquidID.Water;
|
||||
Main.tile[X, Y].LiquidAmount = byte.MaxValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//place sand
|
||||
for (int X = origin.X - size - 3; X <= origin.X + size + 3; X++)
|
||||
{
|
||||
for (int Y = (int)(origin.Y - verticalRadius * 0.4f) - 3; Y <= origin.Y + verticalRadius + 3; Y++)
|
||||
{
|
||||
if (CheckReefsCircle(new Point(X, Y), topFoci, bottomFoci, constant, center, out float dist))
|
||||
{
|
||||
bool canPlaceSand = false;
|
||||
|
||||
//place sand clumps on top of exposed navystone
|
||||
if (Main.tile[X, Y].TileType == ModContent.TileType<HardenedSulphurousSandstone>() && !Main.tile[X, Y - 1].HasTile)
|
||||
{
|
||||
canPlaceSand = true;
|
||||
}
|
||||
|
||||
Main.tile[X, Y].WallType = (ushort)ModContent.WallType<SulphurousSandstoneWall>();
|
||||
WorldGen.PlaceWall(X, Y, ModContent.WallType<SulphurousSandstoneWall>());
|
||||
if (canPlaceSand)
|
||||
{
|
||||
SunkenSea.PlaceSand(X, Y, 3, ModContent.TileType<Tiles.SunkenSea.VolcanicSand>());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Main.tile[X, Y].Get<LiquidData>().LiquidType = LiquidID.Water;
|
||||
Main.tile[X, Y].LiquidAmount = byte.MaxValue;
|
||||
//cleanup
|
||||
for (int X = origin.X - size - 3; X <= origin.X + size + 3; X++)
|
||||
{
|
||||
for (int Y = (int)(origin.Y - verticalRadius * 0.4f) - 3; Y <= origin.Y + verticalRadius + 3; Y++)
|
||||
{
|
||||
if (CheckReefsCircle(new Point(X, Y), topFoci, bottomFoci, constant, center, out float dist))
|
||||
{
|
||||
//clean tiles that are sticking out (aka tiles only attached to one tile on one side)
|
||||
bool OnlyRight = !Main.tile[X, Y - 1].HasTile && !Main.tile[X, Y + 1].HasTile && !Main.tile[X - 1, Y].HasTile;
|
||||
bool OnlyLeft = !Main.tile[X, Y - 1].HasTile && !Main.tile[X, Y + 1].HasTile && !Main.tile[X + 1, Y].HasTile;
|
||||
bool OnlyDown = !Main.tile[X, Y - 1].HasTile && !Main.tile[X - 1, Y].HasTile && !Main.tile[X + 1, Y].HasTile;
|
||||
bool OnlyUp = !Main.tile[X, Y + 1].HasTile && !Main.tile[X - 1, Y].HasTile && !Main.tile[X + 1, Y].HasTile;
|
||||
|
||||
if (OnlyRight || OnlyLeft || OnlyDown || OnlyUp)
|
||||
{
|
||||
WorldGen.KillTile(X, Y);
|
||||
}
|
||||
|
||||
//kill random single floating tiles
|
||||
if (!Main.tile[X, Y - 1].HasTile && !Main.tile[X, Y + 1].HasTile && !Main.tile[X - 1, Y].HasTile && !Main.tile[X + 1, Y].HasTile)
|
||||
{
|
||||
WorldGen.KillTile(X, Y);
|
||||
}
|
||||
|
||||
Tile.SmoothSlope(X, Y);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -189,20 +189,6 @@ namespace CalamityMod.World
|
||||
}
|
||||
}
|
||||
|
||||
for (int X = origin.X - biomeSize - 3; X <= origin.X + biomeSize + 3; X++)
|
||||
{
|
||||
for (int Y = (int)(origin.Y - verticalRadius * 0.4f) - 3; Y <= origin.Y + verticalRadius + 3; Y++)
|
||||
{
|
||||
if (CheckInBiomeArea(new Point(X, Y), topFoci, bottomFoci, constant, center, out float dist, Y < origin.Y))
|
||||
{
|
||||
if (!Main.tile[X, Y].HasTile && Main.tile[X, Y - 1].HasTile && Main.tile[X, Y + 1].HasTile && Main.tile[X - 1, Y].HasTile && Main.tile[X + 1, Y].HasTile)
|
||||
{
|
||||
WorldGen.PlaceTile(X, Y, (ushort)ModContent.TileType<Shellstone>());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//place extra tiles
|
||||
for (int X = origin.X - biomeSize - 3; X <= origin.X + biomeSize + 3; X++)
|
||||
{
|
||||
@@ -276,7 +262,7 @@ namespace CalamityMod.World
|
||||
float angle = MathHelper.Pi * 0.15f;
|
||||
float otherAngle = MathHelper.PiOver2 - angle;
|
||||
|
||||
int biomeSize = 140 + (Main.maxTilesX / 180);
|
||||
int biomeSize = 120 + (Main.maxTilesX / 180);
|
||||
float actualSize = biomeSize * 16f;
|
||||
float constant = actualSize * 2f / (float)Math.Sin(angle);
|
||||
|
||||
@@ -469,13 +455,34 @@ namespace CalamityMod.World
|
||||
Vector2 topFoci = center - fociOffset;
|
||||
Vector2 bottomFoci = center + fociOffset;
|
||||
|
||||
for (int X = origin.X - biomeSize - 3; X <= origin.X + biomeSize + 3; X++)
|
||||
//place another barrier so the gleaming burrows doesnt just burst into the gully
|
||||
for (int X = origin.X - biomeSize - 3; X <= origin.X + biomeSize + 3; X += 10)
|
||||
{
|
||||
for (int Y = (int)(origin.Y - verticalRadius * 0.4f) - 3; Y <= origin.Y + verticalRadius + 3; Y++)
|
||||
for (int Y = (int)(origin.Y - verticalRadius * 0.4f) - 3; Y <= origin.Y + verticalRadius + 3; Y += 2)
|
||||
{
|
||||
if (CheckInBiomeArea(new Point(X, Y), topFoci, bottomFoci, constant, center, out float dist, true))
|
||||
{
|
||||
float percent = dist / constant;
|
||||
float blurPercent = 0.98f;
|
||||
|
||||
if (percent > blurPercent)
|
||||
{
|
||||
if (Y > origin.Y + 20)
|
||||
{
|
||||
ShapeData circle = new ShapeData();
|
||||
GenAction blotchMod = new Modifiers.Blotches(2, 0.4);
|
||||
|
||||
WorldUtils.Gen(new Point(X, Y + 10), new Shapes.Circle(20), Actions.Chain(new GenAction[]
|
||||
{
|
||||
blotchMod.Output(circle)
|
||||
}));
|
||||
WorldUtils.Gen(new Point(X, Y + 10), new ModShapes.All(circle), Actions.Chain(new GenAction[]
|
||||
{
|
||||
new Actions.Clear(),
|
||||
new Actions.PlaceTile((ushort)ModContent.TileType<Basalt>())
|
||||
}));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -652,84 +659,55 @@ namespace CalamityMod.World
|
||||
//basalt biome underneath the sunken sea
|
||||
public static void PlaceBasaltGully(int startPosX, int startPosY)
|
||||
{
|
||||
Point origin = new Point(startPosX, startPosY);
|
||||
Vector2 center = origin.ToVector2() * 16f + new Vector2(8f);
|
||||
|
||||
float angle = MathHelper.Pi * 0.15f;
|
||||
float otherAngle = MathHelper.PiOver2 - angle;
|
||||
|
||||
int biomeSize = 230 + (Main.maxTilesX / 180);
|
||||
float actualSize = biomeSize * 16f;
|
||||
float constant = actualSize * 2f / (float)Math.Sin(angle);
|
||||
|
||||
float fociSpacing = actualSize * (float)Math.Sin(otherAngle) / (float)Math.Sin(angle);
|
||||
int verticalRadius = (int)(constant / 16f);
|
||||
|
||||
Vector2 fociOffset = Vector2.UnitY * fociSpacing;
|
||||
Vector2 topFoci = center - fociOffset;
|
||||
Vector2 bottomFoci = center + fociOffset;
|
||||
|
||||
//first, place a basalt barrier around where the gleaming burrows will be
|
||||
for (int X = origin.X - biomeSize - 3; X <= origin.X + biomeSize + 3; X++)
|
||||
//place area of basalt all the way down to hell
|
||||
for (int X = startPosX - biomeSize; X <= startPosX + biomeSize; X += 20)
|
||||
{
|
||||
for (int Y = (int)(origin.Y - verticalRadius * 0.4f) - 3; Y <= origin.Y + verticalRadius + 3; Y++)
|
||||
for (int Y = startPosY + 20; Y <= Main.maxTilesY - 250; Y += 20)
|
||||
{
|
||||
if (CheckInBiomeArea(new Point(X, Y), topFoci, bottomFoci, constant, center, out float dist, true))
|
||||
if (Main.tile[X, Y].TileType != ModContent.TileType<Basalt>())
|
||||
{
|
||||
float percent = dist / constant;
|
||||
float blurPercent = 0.98f;
|
||||
|
||||
if (percent > blurPercent)
|
||||
ShapeData circle = new ShapeData();
|
||||
GenAction blotchMod = new Modifiers.Blotches(2, 0.4);
|
||||
|
||||
WorldUtils.Gen(new Point(X, Y), new Shapes.Circle(60), Actions.Chain(new GenAction[]
|
||||
{
|
||||
if (Y > origin.Y + 75 && Main.tile[X, Y].TileType != ModContent.TileType<Basalt>())
|
||||
blotchMod.Output(circle)
|
||||
}));
|
||||
WorldUtils.Gen(new Point(X, Y), new ModShapes.All(circle), Actions.Chain(new GenAction[]
|
||||
{
|
||||
new Actions.Clear(),
|
||||
new Actions.PlaceTile((ushort)ModContent.TileType<Basalt>())
|
||||
}));
|
||||
|
||||
//place a giant area of basalt below the sunken sea
|
||||
for (int j = Y; j <= Main.maxTilesY - 250; j += 15)
|
||||
{
|
||||
int radius = WorldGen.genRand.Next(30, 45);
|
||||
int RandomX = Main.rand.Next(-25, 25);
|
||||
|
||||
WorldUtils.Gen(new Point(X + RandomX, j), new Shapes.Circle(radius), Actions.Chain(new GenAction[]
|
||||
{
|
||||
ShapeData circle = new ShapeData();
|
||||
GenAction blotchMod = new Modifiers.Blotches(2, 0.4);
|
||||
|
||||
WorldUtils.Gen(new Point(X, Y), new Shapes.Circle(60), Actions.Chain(new GenAction[]
|
||||
{
|
||||
blotchMod.Output(circle)
|
||||
}));
|
||||
WorldUtils.Gen(new Point(X, Y), new ModShapes.All(circle), Actions.Chain(new GenAction[]
|
||||
{
|
||||
new Actions.Clear(),
|
||||
new Actions.PlaceTile((ushort)ModContent.TileType<Basalt>())
|
||||
}));
|
||||
blotchMod.Output(circle)
|
||||
}));
|
||||
|
||||
//place a giant area of basalt below the sunken sea
|
||||
for (int j = Y; j <= Main.maxTilesY - 250; j += 15)
|
||||
{
|
||||
int radius = WorldGen.genRand.Next(30, 45);
|
||||
int RandomX = Main.rand.Next(-25, 25);
|
||||
|
||||
WorldUtils.Gen(new Point(X + RandomX, j), new Shapes.Circle(radius), Actions.Chain(new GenAction[]
|
||||
{
|
||||
blotchMod.Output(circle)
|
||||
}));
|
||||
|
||||
List<ushort> WallIDs = new()
|
||||
{
|
||||
WallID.LavaUnsafe1, WallID.LavaUnsafe2, WallID.LavaUnsafe3, WallID.LavaUnsafe4,
|
||||
};
|
||||
|
||||
//place blocks
|
||||
WorldUtils.Gen(new Point(X + RandomX, j), new ModShapes.All(circle), Actions.Chain(new GenAction[]
|
||||
{
|
||||
new Actions.Clear(),
|
||||
new Actions.PlaceTile((ushort)ModContent.TileType<Basalt>()),
|
||||
new Actions.PlaceWall(WorldGen.genRand.Next(WallIDs))
|
||||
}));
|
||||
}
|
||||
}
|
||||
//place blocks
|
||||
WorldUtils.Gen(new Point(X + RandomX, j), new ModShapes.All(circle), Actions.Chain(new GenAction[]
|
||||
{
|
||||
new Actions.Clear(),
|
||||
new Actions.PlaceTile((ushort)ModContent.TileType<Basalt>()),
|
||||
new Actions.PlaceWall(WallID.LavaUnsafe1)
|
||||
}));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//place caverns and lava
|
||||
for (int X = origin.X - biomeSize - (Main.maxTilesX / 25); X <= origin.X + biomeSize + (Main.maxTilesX / 25); X++)
|
||||
for (int X = startPosX - biomeSize - (Main.maxTilesX / 25); X <= startPosX + biomeSize + (Main.maxTilesX / 25); X++)
|
||||
{
|
||||
for (int Y = origin.Y + 50; Y <= Main.maxTilesY - 210; Y++)
|
||||
for (int Y = startPosY; Y <= Main.maxTilesY - 210; Y++)
|
||||
{
|
||||
if (Main.tile[X, Y].TileType == ModContent.TileType<Basalt>())
|
||||
{
|
||||
@@ -751,9 +729,9 @@ namespace CalamityMod.World
|
||||
}
|
||||
|
||||
//place sand blocks
|
||||
for (int X = origin.X - biomeSize - (Main.maxTilesX / 25); X <= origin.X + biomeSize + (Main.maxTilesX / 25); X++)
|
||||
for (int X = startPosX - biomeSize - (Main.maxTilesX / 25); X <= startPosX + biomeSize + (Main.maxTilesX / 25); X++)
|
||||
{
|
||||
for (int Y = origin.Y + 50; Y <= Main.maxTilesY - 200; Y++)
|
||||
for (int Y = startPosY; Y <= Main.maxTilesY - 210; Y++)
|
||||
{
|
||||
bool canPlaceSand = false;
|
||||
|
||||
@@ -771,9 +749,9 @@ namespace CalamityMod.World
|
||||
}
|
||||
|
||||
//cleanup
|
||||
for (int X = origin.X - biomeSize - (Main.maxTilesX / 25); X <= origin.X + biomeSize + (Main.maxTilesX / 25); X++)
|
||||
for (int X = startPosX - biomeSize - (Main.maxTilesX / 25); X <= startPosX + biomeSize + (Main.maxTilesX / 25); X++)
|
||||
{
|
||||
for (int Y = origin.Y + 50; Y <= Main.maxTilesY - 210; Y++)
|
||||
for (int Y = startPosY; Y <= Main.maxTilesY - 210; Y++)
|
||||
{
|
||||
//clean tiles that are sticking out (aka tiles only attached to one tile on one side)
|
||||
bool OnlyRight = !Main.tile[X, Y - 1].HasTile && !Main.tile[X, Y + 1].HasTile && !Main.tile[X - 1, Y].HasTile;
|
||||
@@ -804,20 +782,13 @@ namespace CalamityMod.World
|
||||
|
||||
public static void BasaltGullyLavaCleanup(int startPosX, int startPosY)
|
||||
{
|
||||
Point origin = new Point(startPosX, startPosY);
|
||||
|
||||
int biomeSize = 230 + (Main.maxTilesX / 180);
|
||||
|
||||
for (int X = origin.X - biomeSize - (Main.maxTilesX / 25); X <= origin.X + biomeSize + (Main.maxTilesX / 25); X++)
|
||||
for (int X = startPosX - biomeSize - (Main.maxTilesX / 25); X <= startPosX + biomeSize + (Main.maxTilesX / 25); X++)
|
||||
{
|
||||
for (int Y = origin.Y + 50; Y <= Main.maxTilesY - 210; Y++)
|
||||
for (int Y = startPosY + 50; Y <= Main.maxTilesY - 200; Y++)
|
||||
{
|
||||
List<ushort> WallIDs = new()
|
||||
{
|
||||
WallID.LavaUnsafe1, WallID.LavaUnsafe2, WallID.LavaUnsafe3, WallID.LavaUnsafe4,
|
||||
};
|
||||
|
||||
if (WallIDs.Contains(Main.tile[X, Y].WallType))
|
||||
if (Main.tile[X, Y].WallType == WallID.LavaUnsafe1)
|
||||
{
|
||||
//get rid of water
|
||||
if (Main.tile[X, Y].LiquidType == LiquidID.Water)
|
||||
@@ -890,6 +861,12 @@ namespace CalamityMod.World
|
||||
WorldGen.PlaceObject(X, Y - 1, (ushort)ModContent.TileType<SmallTubeCoral>());
|
||||
}
|
||||
|
||||
//anemonies
|
||||
if (WorldGen.genRand.NextBool(10))
|
||||
{
|
||||
WorldGen.PlaceObject(X, Y - 1, (ushort)ModContent.TileType<SeaAnemone>());
|
||||
}
|
||||
|
||||
//giant navystone piles
|
||||
if (WorldGen.genRand.NextBool(10))
|
||||
{
|
||||
@@ -1186,7 +1163,7 @@ namespace CalamityMod.World
|
||||
if (collapse)
|
||||
{
|
||||
float distY = center.Y - point.Y;
|
||||
point.Y -= distY * 3f;
|
||||
point.Y -= distY * 4f;
|
||||
}
|
||||
|
||||
float distance1 = Vector2.Distance(point, focus1);
|
||||
|
||||