lava lillies and other fixes
-astral biome now avoids living trees and the hallowed when placing -many brimstone crag gen fixes and polishing
No files matched your search
@@ -9,6 +9,7 @@ namespace CalamityMod.BiomeManagers
|
||||
{
|
||||
public override ModWaterStyle WaterStyle => ModContent.Find<ModWaterStyle>("CalamityMod/AstralWater");
|
||||
public override ModSurfaceBackgroundStyle SurfaceBackgroundStyle => ModContent.Find<ModSurfaceBackgroundStyle>("CalamityMod/AstralSurfaceBGStyle");
|
||||
public override ModUndergroundBackgroundStyle UndergroundBackgroundStyle => ModContent.Find<ModUndergroundBackgroundStyle>("CalamityMod/AstralUndergroundBGStyle");
|
||||
public override SceneEffectPriority Priority => SceneEffectPriority.BiomeHigh;
|
||||
public override string BestiaryIcon => "CalamityMod/BiomeManagers/AbovegroundAstralBiomeIcon";
|
||||
public override string BackgroundPath => "CalamityMod/Backgrounds/MapBackgrounds/AstralBG";
|
||||
@@ -30,6 +31,5 @@ namespace CalamityMod.BiomeManagers
|
||||
{
|
||||
player.ManageSpecialBiomeVisuals("CalamityMod:Astral", isActive);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -62,6 +62,8 @@ namespace CalamityMod.Projectiles.Enemy
|
||||
Projectile.Kill();
|
||||
}
|
||||
|
||||
Projectile.velocity *= 0.98f;
|
||||
|
||||
if (Math.Abs(Projectile.velocity.X) > 0f)
|
||||
{
|
||||
Projectile.spriteDirection = -Projectile.direction;
|
||||
|
||||
@@ -95,7 +95,7 @@ namespace CalamityMod.Projectiles.Pets
|
||||
Vector2 center2 = Projectile.Center;
|
||||
Vector2 vector48 = player.Center - center2;
|
||||
float playerDistance = vector48.Length();
|
||||
if (Projectile.velocity.Y == 0 && (HoleBelow() || (playerDistance > 150f && Projectile.position.X == Projectile.oldPosition.X)))
|
||||
if (Projectile.velocity.Y == 0 && ((HoleBelow() && playerDistance > 150f) || (playerDistance > 150f && Projectile.position.X == Projectile.oldPosition.X)))
|
||||
{
|
||||
Projectile.velocity.Y = -8f;
|
||||
}
|
||||
@@ -159,12 +159,12 @@ namespace CalamityMod.Projectiles.Pets
|
||||
Projectile.frameCounter = 0;
|
||||
}
|
||||
//falling frame
|
||||
if (Projectile.velocity.Y > 0.3f && Projectile.position.Y != Projectile.oldPosition.Y)
|
||||
else if (Projectile.velocity.Y > 0.3f && Projectile.position.Y != Projectile.oldPosition.Y)
|
||||
{
|
||||
Projectile.frame = 4;
|
||||
Projectile.frameCounter = 0;
|
||||
}
|
||||
else
|
||||
else if (Projectile.velocity.X != 0)
|
||||
{
|
||||
//moving animation
|
||||
Projectile.frameCounter++;
|
||||
|
||||
@@ -35,9 +35,9 @@ namespace CalamityMod.Tiles.Abyss.AbyssAmbient
|
||||
|
||||
public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b)
|
||||
{
|
||||
r = 49f / 255f;
|
||||
g = 159f / 255f;
|
||||
b = 242f / 255f;
|
||||
r = 49f / 500f;
|
||||
g = 159f / 500f;
|
||||
b = 242f / 500f;
|
||||
}
|
||||
|
||||
public override void NumDust(int i, int j, bool fail, ref int num)
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using Terraria.ObjectData;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.Enums;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
|
||||
namespace CalamityMod.Tiles.Crags.Lily
|
||||
{
|
||||
public class LavaLily1 : ModTile
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.tileFrameImportant[Type] = true;
|
||||
Main.tileSolid[Type] = false;
|
||||
TileObjectData.newTile.Width = 5;
|
||||
TileObjectData.newTile.Height = 3;
|
||||
TileObjectData.newTile.Origin = new Point16(3, 2);
|
||||
TileObjectData.newTile.CoordinateHeights = new int[] { 16, 16, 16 };
|
||||
TileObjectData.newTile.StyleWrapLimit = 36;
|
||||
TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.SolidWithTop | AnchorType.SolidSide, TileObjectData.newTile.Width, 0);
|
||||
TileObjectData.newTile.CoordinateWidth = 16;
|
||||
TileObjectData.newTile.CoordinatePadding = 2;
|
||||
TileObjectData.newTile.DrawYOffset = 3;
|
||||
TileObjectData.addTile(Type);
|
||||
AddMapEntry(new Color(153, 100, 176));
|
||||
DustType = -1; //idk what dust to put here
|
||||
}
|
||||
|
||||
internal static void DrawLilyTop(int i, int j, Texture2D tex, Rectangle? source, Vector2? offset = null, Vector2? origin = null, bool Glow = false)
|
||||
{
|
||||
Tile tile = Main.tile[i, j];
|
||||
Vector2 drawPos = new Vector2(i, j).ToWorldCoordinates() - Main.screenPosition + (offset ?? new Vector2(0, -2));
|
||||
Color color = Lighting.GetColor(i, j);
|
||||
|
||||
Main.spriteBatch.Draw(tex, drawPos, source, Glow ? Color.White : color, 0, origin ?? source.Value.Size() / 3f, 1f, SpriteEffects.None, 0f);
|
||||
}
|
||||
|
||||
public static Vector2 TileOffset => Lighting.LegacyEngine.Mode > 1 ? Vector2.Zero : Vector2.One * 12;
|
||||
|
||||
public override void PostDraw(int i, int j, SpriteBatch spriteBatch)
|
||||
{
|
||||
//draw the glowmask on the lily base
|
||||
Tile tile = Framing.GetTileSafely(i, j);
|
||||
Texture2D tex = ModContent.Request<Texture2D>("CalamityMod/Tiles/Crags/Lily/LavaLily1Glow").Value;
|
||||
Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange, Main.offScreenRange);
|
||||
|
||||
spriteBatch.Draw(tex, new Vector2(i * 16, j * 16 + 2) - Main.screenPosition + zero, new Rectangle(tile.TileFrameX, tile.TileFrameY, 16, 16), Color.White);
|
||||
|
||||
Texture2D lilyTex = ModContent.Request<Texture2D>("CalamityMod/Tiles/Crags/Lily/LavaLily1Top").Value;
|
||||
Texture2D glowTex = ModContent.Request<Texture2D>("CalamityMod/Tiles/Crags/Lily/LavaLily1TopGlow").Value;
|
||||
|
||||
//draw in the middle of the tile so it doesnt draw more than once
|
||||
if (Framing.GetTileSafely(i, j).TileFrameX == 36 && Framing.GetTileSafely(i, j).TileFrameY == 18)
|
||||
{
|
||||
DrawLilyTop(i, j, lilyTex, new Rectangle(0, 0, 178, 184), TileOffset.ToWorldCoordinates(), new Vector2(98, 191), false);
|
||||
DrawLilyTop(i, j, glowTex, new Rectangle(0, 0, 178, 184), TileOffset.ToWorldCoordinates(), new Vector2(98, 191), true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 987 B |
|
After Width: | Height: | Size: 5.1 KiB |
|
After Width: | Height: | Size: 2.4 KiB |
@@ -0,0 +1,63 @@
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using Terraria.ObjectData;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.Enums;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
|
||||
namespace CalamityMod.Tiles.Crags.Lily
|
||||
{
|
||||
public class LavaLily2 : ModTile
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.tileFrameImportant[Type] = true;
|
||||
Main.tileSolid[Type] = false;
|
||||
TileObjectData.newTile.Width = 5;
|
||||
TileObjectData.newTile.Height = 3;
|
||||
TileObjectData.newTile.Origin = new Point16(3, 2);
|
||||
TileObjectData.newTile.CoordinateHeights = new int[] { 16, 16, 16 };
|
||||
TileObjectData.newTile.StyleWrapLimit = 36;
|
||||
TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.SolidWithTop | AnchorType.SolidSide, TileObjectData.newTile.Width, 0);
|
||||
TileObjectData.newTile.CoordinateWidth = 16;
|
||||
TileObjectData.newTile.CoordinatePadding = 2;
|
||||
TileObjectData.newTile.DrawYOffset = 3;
|
||||
TileObjectData.addTile(Type);
|
||||
AddMapEntry(new Color(153, 100, 176));
|
||||
DustType = -1; //idk what dust to put here
|
||||
}
|
||||
|
||||
internal static void DrawLilyTop(int i, int j, Texture2D tex, Rectangle? source, Vector2? offset = null, Vector2? origin = null, bool Glow = false)
|
||||
{
|
||||
Tile tile = Main.tile[i, j];
|
||||
Vector2 drawPos = new Vector2(i, j).ToWorldCoordinates() - Main.screenPosition + (offset ?? new Vector2(0, -2));
|
||||
Color color = Lighting.GetColor(i, j);
|
||||
|
||||
Main.spriteBatch.Draw(tex, drawPos, source, Glow ? Color.White : color, 0, origin ?? source.Value.Size() / 3f, 1f, SpriteEffects.None, 0f);
|
||||
}
|
||||
|
||||
public static Vector2 TileOffset => Lighting.LegacyEngine.Mode > 1 ? Vector2.Zero : Vector2.One * 12;
|
||||
|
||||
public override void PostDraw(int i, int j, SpriteBatch spriteBatch)
|
||||
{
|
||||
//draw the glowmask on the lily base
|
||||
Tile tile = Framing.GetTileSafely(i, j);
|
||||
Texture2D tex = ModContent.Request<Texture2D>("CalamityMod/Tiles/Crags/Lily/LavaLily2Glow").Value;
|
||||
Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange, Main.offScreenRange);
|
||||
|
||||
spriteBatch.Draw(tex, new Vector2(i * 16, j * 16 + 2) - Main.screenPosition + zero, new Rectangle(tile.TileFrameX, tile.TileFrameY, 16, 16), Color.White);
|
||||
|
||||
Texture2D lilyTex = ModContent.Request<Texture2D>("CalamityMod/Tiles/Crags/Lily/LavaLily2Top").Value;
|
||||
Texture2D glowTex = ModContent.Request<Texture2D>("CalamityMod/Tiles/Crags/Lily/LavaLily2TopGlow").Value;
|
||||
|
||||
//draw in the middle of the tile so it doesnt draw more than once
|
||||
if (Framing.GetTileSafely(i, j).TileFrameX == 36 && Framing.GetTileSafely(i, j).TileFrameY == 18)
|
||||
{
|
||||
DrawLilyTop(i, j, lilyTex, new Rectangle(0, 0, 192, 206), TileOffset.ToWorldCoordinates(), new Vector2(90, 209), false);
|
||||
DrawLilyTop(i, j, glowTex, new Rectangle(0, 0, 192, 206), TileOffset.ToWorldCoordinates(), new Vector2(90, 209), true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 1023 B |
|
After Width: | Height: | Size: 970 B |
|
After Width: | Height: | Size: 3.8 KiB |
|
After Width: | Height: | Size: 3.7 KiB |
@@ -0,0 +1,63 @@
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using Terraria.ObjectData;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.Enums;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
|
||||
namespace CalamityMod.Tiles.Crags.Lily
|
||||
{
|
||||
public class LavaLily3 : ModTile
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.tileFrameImportant[Type] = true;
|
||||
Main.tileSolid[Type] = false;
|
||||
TileObjectData.newTile.Width = 5;
|
||||
TileObjectData.newTile.Height = 3;
|
||||
TileObjectData.newTile.Origin = new Point16(3, 2);
|
||||
TileObjectData.newTile.CoordinateHeights = new int[] { 16, 16, 16 };
|
||||
TileObjectData.newTile.StyleWrapLimit = 36;
|
||||
TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.SolidWithTop | AnchorType.SolidSide, TileObjectData.newTile.Width, 0);
|
||||
TileObjectData.newTile.CoordinateWidth = 16;
|
||||
TileObjectData.newTile.CoordinatePadding = 2;
|
||||
TileObjectData.newTile.DrawYOffset = 3;
|
||||
TileObjectData.addTile(Type);
|
||||
AddMapEntry(new Color(153, 100, 176));
|
||||
DustType = -1; //idk what dust to put here
|
||||
}
|
||||
|
||||
internal static void DrawLilyTop(int i, int j, Texture2D tex, Rectangle? source, Vector2? offset = null, Vector2? origin = null, bool Glow = false)
|
||||
{
|
||||
Tile tile = Main.tile[i, j];
|
||||
Vector2 drawPos = new Vector2(i, j).ToWorldCoordinates() - Main.screenPosition + (offset ?? new Vector2(0, -2));
|
||||
Color color = Lighting.GetColor(i, j);
|
||||
|
||||
Main.spriteBatch.Draw(tex, drawPos, source, Glow ? Color.White : color, 0, origin ?? source.Value.Size() / 3f, 1f, SpriteEffects.None, 0f);
|
||||
}
|
||||
|
||||
public static Vector2 TileOffset => Lighting.LegacyEngine.Mode > 1 ? Vector2.Zero : Vector2.One * 12;
|
||||
|
||||
public override void PostDraw(int i, int j, SpriteBatch spriteBatch)
|
||||
{
|
||||
//draw the glowmask on the lily base
|
||||
Tile tile = Framing.GetTileSafely(i, j);
|
||||
Texture2D tex = ModContent.Request<Texture2D>("CalamityMod/Tiles/Crags/Lily/LavaLily3Glow").Value;
|
||||
Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange, Main.offScreenRange);
|
||||
|
||||
spriteBatch.Draw(tex, new Vector2(i * 16, j * 16 + 2) - Main.screenPosition + zero, new Rectangle(tile.TileFrameX, tile.TileFrameY, 16, 16), Color.White);
|
||||
|
||||
Texture2D lilyTex = ModContent.Request<Texture2D>("CalamityMod/Tiles/Crags/Lily/LavaLily3Top").Value;
|
||||
Texture2D glowTex = ModContent.Request<Texture2D>("CalamityMod/Tiles/Crags/Lily/LavaLily3TopGlow").Value;
|
||||
|
||||
//draw in the middle of the tile so it doesnt draw more than once
|
||||
if (Framing.GetTileSafely(i, j).TileFrameX == 36 && Framing.GetTileSafely(i, j).TileFrameY == 18)
|
||||
{
|
||||
DrawLilyTop(i, j, lilyTex, new Rectangle(0, 0, 178, 198), TileOffset.ToWorldCoordinates(), new Vector2(98, 199), false);
|
||||
DrawLilyTop(i, j, glowTex, new Rectangle(0, 0, 178, 198), TileOffset.ToWorldCoordinates(), new Vector2(98, 199), true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 990 B |
|
After Width: | Height: | Size: 911 B |
|
After Width: | Height: | Size: 3.5 KiB |
|
After Width: | Height: | Size: 3.4 KiB |
@@ -57,12 +57,12 @@ namespace CalamityMod.World
|
||||
while (y < Main.worldSurface)
|
||||
{
|
||||
if (Main.tile[x, y].HasTile &&
|
||||
(Main.tile[x, y].TileType == ModContent.TileType<AstralSand>() || Main.tile[x, y].TileType == ModContent.TileType<AstralSandstone>() ||
|
||||
Main.tile[x, y].TileType == ModContent.TileType<HardenedAstralSand>() || Main.tile[x, y].TileType == ModContent.TileType<AstralIce>() ||
|
||||
Main.tile[x, y].TileType == ModContent.TileType<AstralDirt>() || Main.tile[x, y].TileType == ModContent.TileType<AstralStone>() ||
|
||||
Main.tile[x, y].TileType == ModContent.TileType<AstralGrass>() || Main.tile[x, y].TileType == ModContent.TileType<NovaeSlag>() ||
|
||||
Main.tile[x, y].TileType == ModContent.TileType<CelestialRemains>() || Main.tile[x, y].TileType == ModContent.TileType<AstralSnow>() ||
|
||||
Main.tile[x, y].TileType == ModContent.TileType<AstralClay>() || Main.tile[x, y].TileType == ModContent.TileType<AstralStone>()))
|
||||
(Main.tile[x, y].TileType == ModContent.TileType<AstralSand>() || Main.tile[x, y].TileType == ModContent.TileType<AstralSandstone>() ||
|
||||
Main.tile[x, y].TileType == ModContent.TileType<HardenedAstralSand>() || Main.tile[x, y].TileType == ModContent.TileType<AstralIce>() ||
|
||||
Main.tile[x, y].TileType == ModContent.TileType<AstralDirt>() || Main.tile[x, y].TileType == ModContent.TileType<AstralStone>() ||
|
||||
Main.tile[x, y].TileType == ModContent.TileType<AstralGrass>() || Main.tile[x, y].TileType == ModContent.TileType<NovaeSlag>() ||
|
||||
Main.tile[x, y].TileType == ModContent.TileType<CelestialRemains>() || Main.tile[x, y].TileType == ModContent.TileType<AstralSnow>() ||
|
||||
Main.tile[x, y].TileType == ModContent.TileType<AstralClay>() || Main.tile[x, y].TileType == ModContent.TileType<AstralStone>()))
|
||||
{
|
||||
astralTileCount++;
|
||||
if (astralTileCount > astralTilesAllowed)
|
||||
@@ -127,7 +127,7 @@ namespace CalamityMod.World
|
||||
{
|
||||
float worldEdgeMargin = (float)Main.maxTilesX * 0.08f;
|
||||
int xLimit = Main.maxTilesX / 2;
|
||||
int x = Abyss.AtLeftSideOfWorld ? rand.Next(650, xLimit - 200) : rand.Next(xLimit + 200, Main.maxTilesX - 650);
|
||||
int x = Abyss.AtLeftSideOfWorld ? rand.Next(Main.dungeonX + 200, xLimit - 350) : rand.Next(xLimit + 350, Main.dungeonX - 200);
|
||||
|
||||
//world surface = 920 large 740 medium 560 small
|
||||
int y = (int)(Main.worldSurface * 0.5); //Large = 522, Medium = 444, Small = 336
|
||||
@@ -146,18 +146,27 @@ namespace CalamityMod.World
|
||||
{
|
||||
suitableTiles++;
|
||||
|
||||
// Avoid floating islands: Clouds and Sunplate both harshly punish attempted meteor spawns
|
||||
//Avoid floating islands: Clouds and Sunplate both harshly punish attempted meteor spawns
|
||||
if (Main.tile[l, m].TileType == TileID.Cloud || Main.tile[l, m].TileType == TileID.Sunplate)
|
||||
{
|
||||
suitableTiles -= 100;
|
||||
}
|
||||
// Avoid Sulphurous Sea beach: Cannot be converted by astral
|
||||
//Avoid the hallowed so it doesnt get demolished by the astral biome
|
||||
else if (Main.tile[l, m].TileType == TileID.HallowedGrass || Main.tile[l, m].TileType == TileID.Pearlstone)
|
||||
{
|
||||
suitableTiles -= 100;
|
||||
}
|
||||
//Avoid living trees, doesnt land on them too often but its better to prevent it
|
||||
else if (Main.tile[l, m].TileType == TileID.LivingWood || Main.tile[l, m].TileType == TileID.LeafBlock)
|
||||
{
|
||||
suitableTiles -= 100;
|
||||
}
|
||||
//Avoid Sulphurous Sea beach: Cannot be converted by astral
|
||||
else if (Main.tile[l, m].TileType == ModContent.TileType<SulphurousSand>() || Main.tile[l, m].TileType == ModContent.TileType<SulphurousSandstone>())
|
||||
{
|
||||
suitableTiles -= 100;
|
||||
}
|
||||
|
||||
// Prevent the Astral biome from overriding or interfering with an AA biome
|
||||
//Prevent the Astral biome from overriding or interfering with an AA biome
|
||||
else if (ancientsAwakened is not null && aaTilesToAvoid.Contains(Main.tile[l, m].TileType))
|
||||
{
|
||||
suitableTiles -= 100;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using CalamityMod.Tiles.Crags;
|
||||
using CalamityMod.Tiles.Crags.Spike;
|
||||
using CalamityMod.Tiles.Crags.Tree;
|
||||
using CalamityMod.Tiles.Crags.Lily;
|
||||
using CalamityMod.Tiles.Ores;
|
||||
using CalamityMod.Walls;
|
||||
using CalamityMod.Schematics;
|
||||
@@ -28,8 +29,6 @@ namespace CalamityMod.World
|
||||
static int lavaLakeBigPlaceDelay = 0;
|
||||
static int numLavaLakes = 0;
|
||||
|
||||
static int TreeDelay = 0;
|
||||
|
||||
//all the main crags terrain generation
|
||||
private static void GenCrags()
|
||||
{
|
||||
@@ -98,7 +97,7 @@ namespace CalamityMod.World
|
||||
//scorched remains patches
|
||||
for (int x = biomeStart + 30; x <= biomeEdge - 30; x++)
|
||||
{
|
||||
if (WorldGen.genRand.Next(150) == 0)
|
||||
if (WorldGen.genRand.Next(145) == 0)
|
||||
{
|
||||
ScorchedGrassPatches(new Point(x, Main.maxTilesY - 135));
|
||||
}
|
||||
@@ -221,23 +220,6 @@ namespace CalamityMod.World
|
||||
}
|
||||
}
|
||||
|
||||
//spread grass on all scorched remains
|
||||
for (int x = biomeStart; x <= biomeEdge; x++)
|
||||
{
|
||||
for (int y = Main.maxTilesY - 200; y <= Main.maxTilesY - 5; y++)
|
||||
{
|
||||
Tile tile = Main.tile[x, y];
|
||||
Tile tileUp = Main.tile[x, y - 1];
|
||||
|
||||
if (tile.TileType == ModContent.TileType<ScorchedRemains>() && !tileUp.HasTile && tileUp.LiquidAmount == 0)
|
||||
{
|
||||
tile.TileType = (ushort)ModContent.TileType<ScorchedRemainsGrass>();
|
||||
}
|
||||
|
||||
Tile.SmoothSlope(x, y, true);
|
||||
}
|
||||
}
|
||||
|
||||
//place clumps of charred ore
|
||||
for (int x = biomeStart; x <= biomeEdge; x++)
|
||||
{
|
||||
@@ -270,11 +252,31 @@ namespace CalamityMod.World
|
||||
for (int y = Main.maxTilesY - 200; y <= Main.maxTilesY - 5; y++)
|
||||
{
|
||||
Tile tile = Main.tile[x, y];
|
||||
Tile tileAbove = Main.tile[x, y - 1];
|
||||
|
||||
if (tile.LiquidAmount > 0)
|
||||
{
|
||||
tile.LiquidType = LiquidID.Lava;
|
||||
tile.LiquidAmount = 255;
|
||||
}
|
||||
|
||||
//get rid of lava above scorched remains as much as possible
|
||||
if (tile.TileType == ModContent.TileType<ScorchedRemains>() && !tileAbove.HasTile)
|
||||
{
|
||||
for (int i = x - 1; i <= x + 1; i++)
|
||||
{
|
||||
for (int j = y - 5; j <= y; j++)
|
||||
{
|
||||
Tile lavaTile = Main.tile[i, j];
|
||||
Tile lavaTileDown = Main.tile[i, j + 1];
|
||||
|
||||
if (lavaTile.WallType == 0 && lavaTileDown.WallType == 0)
|
||||
{
|
||||
lavaTile.LiquidAmount = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -286,6 +288,24 @@ namespace CalamityMod.World
|
||||
Main.tile[x, y].LiquidAmount = 0;
|
||||
}
|
||||
}
|
||||
|
||||
//settle all liquids
|
||||
CalamityUtils.SettleWater();
|
||||
|
||||
//spread grass on all scorched remains with no lava above them
|
||||
for (int x = biomeStart; x <= biomeEdge; x++)
|
||||
{
|
||||
for (int y = Main.maxTilesY - 200; y <= Main.maxTilesY - 110; y++)
|
||||
{
|
||||
Tile tile = Main.tile[x, y];
|
||||
Tile tileUp = Main.tile[x, y - 1];
|
||||
|
||||
if (tile.TileType == ModContent.TileType<ScorchedRemains>() && !tileUp.HasTile && tileUp.LiquidAmount == 0)
|
||||
{
|
||||
tile.TileType = (ushort)ModContent.TileType<ScorchedRemainsGrass>();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//place ambient objects and other stuff
|
||||
@@ -300,7 +320,8 @@ namespace CalamityMod.World
|
||||
for (int y = Main.maxTilesY - 200; y <= Main.maxTilesY - 5; y++)
|
||||
{
|
||||
Tile tile = Main.tile[x, y];
|
||||
Tile tileUp = Main.tile[x, y - 1];
|
||||
|
||||
Tile.SmoothSlope(x, y, true);
|
||||
|
||||
//stalactites and stalagmites
|
||||
if (tile.TileType == ModContent.TileType<BrimstoneSlag>())
|
||||
@@ -340,23 +361,67 @@ namespace CalamityMod.World
|
||||
|
||||
WorldGen.PlaceObject(x, y - 1, WorldGen.genRand.Next(Stalagmites));
|
||||
}
|
||||
}
|
||||
|
||||
if (TreeDelay > 0)
|
||||
//place lillies on scorched remains grass
|
||||
if (tile.TileType == ModContent.TileType<ScorchedRemainsGrass>())
|
||||
{
|
||||
//place them decently often since they are pretty big tiles, also dont place them in lava
|
||||
if (WorldGen.genRand.Next(4) == 0)
|
||||
{
|
||||
TreeDelay--;
|
||||
ushort[] Lillies = new ushort[] { (ushort)ModContent.TileType<LavaLily1>(),
|
||||
(ushort)ModContent.TileType<LavaLily2>(), (ushort)ModContent.TileType<LavaLily3>() };
|
||||
|
||||
WorldGen.PlaceObject(x, y - 1, WorldGen.genRand.Next(Lillies));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//separate y loop so trees dont grow too deep
|
||||
for (int y = Main.maxTilesY - 150; y <= Main.maxTilesY - 122; y++)
|
||||
{
|
||||
Tile tile = Main.tile[x, y];
|
||||
|
||||
Tile.SmoothSlope(x, y, true);
|
||||
|
||||
//stalactites and stalagmites
|
||||
if (tile.TileType == ModContent.TileType<BrimstoneSlag>())
|
||||
{
|
||||
//grow spine tree
|
||||
if (WorldGen.genRand.Next(3) == 0 && TreeDelay == 0 && !tile.LeftSlope && !tile.RightSlope && !tile.IsHalfBlock)
|
||||
if (WorldGen.genRand.Next(12) == 0 && !tile.LeftSlope && !tile.RightSlope && !tile.IsHalfBlock)
|
||||
{
|
||||
SpineTree.Spawn(x, y - 1, 22, 28, false, -1, false);
|
||||
TreeDelay = 20;
|
||||
PlaceTree(x, y - 1, ModContent.TileType<SpineTree>());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static bool PlaceTree(int x, int y, int tileType)
|
||||
{
|
||||
int minDistance = 5;
|
||||
int treeNearby = 0;
|
||||
|
||||
for (int i = x - minDistance; i < x + minDistance; i++)
|
||||
{
|
||||
for (int j = y - minDistance; j < y + minDistance; j++)
|
||||
{
|
||||
if (Main.tile[i, j].HasTile && Main.tile[i, j].TileType == tileType)
|
||||
{
|
||||
treeNearby++;
|
||||
if (treeNearby > 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SpineTree.Spawn(x, y, 22, 28, false, -1, false);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public static void FillBrimstoneChests(Chest chest, int Type, bool firstItem)
|
||||
{
|
||||
/*
|
||||
|
||||