diff --git a/BiomeManagers/AbovegroundAstralBiome.cs b/BiomeManagers/AbovegroundAstralBiome.cs index d3ce06a025..f4f7d708ee 100644 --- a/BiomeManagers/AbovegroundAstralBiome.cs +++ b/BiomeManagers/AbovegroundAstralBiome.cs @@ -9,6 +9,7 @@ namespace CalamityMod.BiomeManagers { public override ModWaterStyle WaterStyle => ModContent.Find("CalamityMod/AstralWater"); public override ModSurfaceBackgroundStyle SurfaceBackgroundStyle => ModContent.Find("CalamityMod/AstralSurfaceBGStyle"); + public override ModUndergroundBackgroundStyle UndergroundBackgroundStyle => ModContent.Find("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); } - } } diff --git a/BiomeManagers/AbyssIcon.png b/BiomeManagers/AbyssIcon.png deleted file mode 100644 index 0fab848b86..0000000000 Binary files a/BiomeManagers/AbyssIcon.png and /dev/null differ diff --git a/BiomeManagers/AbyssLayer1Biome.cs b/BiomeManagers/AbyssLayer1Biome.cs index 80842c3696..9a459ae69b 100644 --- a/BiomeManagers/AbyssLayer1Biome.cs +++ b/BiomeManagers/AbyssLayer1Biome.cs @@ -16,18 +16,18 @@ namespace CalamityMod.BiomeManagers int y = Main.maxTilesY; int genLimit = x / 2; int abyssChasmY = y - 250; - int abyssChasmX = Abyss.AtLeftSideOfWorld ? genLimit - (genLimit - 135) : genLimit + (genLimit - 135); + int abyssChasmX = Abyss.AtLeftSideOfWorld ? genLimit - (genLimit - 135) + 35 : genLimit + (genLimit - 135) - 35; bool abyssPosX = false; - bool abyssPosY = point.Y <= abyssChasmY; + bool abyssPosY = point.Y >= (Main.rockLayer - Main.maxTilesY / 13); if (Abyss.AtLeftSideOfWorld) { - if (point.X < abyssChasmX + 80) + if (point.X < abyssChasmX + 125) abyssPosX = true; } else { - if (point.X > abyssChasmX - 80) + if (point.X > abyssChasmX - 125) abyssPosX = true; } @@ -36,16 +36,13 @@ namespace CalamityMod.BiomeManagers if (WeakReferenceSupport.InAnySubworld()) return false; - return point.Y > SulphurousSea.YStart + SulphurousSea.BlockDepth - 78 && - !player.lavaWet && - !player.honeyWet && - abyssPosY && - abyssPosX; + return !player.lavaWet && !player.honeyWet && abyssPosY && abyssPosX; } - public override ModWaterStyle WaterStyle => ModContent.Find("CalamityMod/AbyssWater"); + //temporarily use sulphur for now + public override ModWaterStyle WaterStyle => ModContent.Find("CalamityMod/SulphuricDepthsWater"); public override SceneEffectPriority Priority => SceneEffectPriority.BiomeHigh; - public override string BestiaryIcon => "CalamityMod/BiomeManagers/AbyssIcon"; + public override string BestiaryIcon => "CalamityMod/BiomeManagers/AbyssLayer1Icon"; public override string BackgroundPath => "CalamityMod/Backgrounds/MapBackgrounds/AbyssBGLayer1"; public override string MapBackground => "CalamityMod/Backgrounds/MapBackgrounds/AbyssBGLayer1"; @@ -61,13 +58,14 @@ namespace CalamityMod.BiomeManagers public override void SetStaticDefaults() { - DisplayName.SetDefault("Abyss: First Layer"); + DisplayName.SetDefault("Sulphuric Depths"); } public override bool IsBiomeActive(Player player) { return MeetsBaseAbyssRequirement(player, out int playerYTileCoords) && - playerYTileCoords <= (Main.rockLayer + Main.maxTilesY * 0.03); + playerYTileCoords >= Main.rockLayer - Main.maxTilesY / 15 && + playerYTileCoords <= Main.rockLayer - 22; } } } diff --git a/BiomeManagers/AbyssLayer1Icon.png b/BiomeManagers/AbyssLayer1Icon.png new file mode 100644 index 0000000000..5d7fc7648e Binary files /dev/null and b/BiomeManagers/AbyssLayer1Icon.png differ diff --git a/BiomeManagers/AbyssLayer2Biome.cs b/BiomeManagers/AbyssLayer2Biome.cs index 2b9ca90238..1388f43a10 100644 --- a/BiomeManagers/AbyssLayer2Biome.cs +++ b/BiomeManagers/AbyssLayer2Biome.cs @@ -17,22 +17,22 @@ namespace CalamityMod.BiomeManagers } } - public override ModWaterStyle WaterStyle => ModContent.Find("CalamityMod/AbyssWater"); + public override ModWaterStyle WaterStyle => ModContent.Find("CalamityMod/UpperAbyssWater"); public override SceneEffectPriority Priority => SceneEffectPriority.BiomeHigh; - public override string BestiaryIcon => "CalamityMod/BiomeManagers/AbyssIcon"; + public override string BestiaryIcon => "CalamityMod/BiomeManagers/AbyssLayer2Icon"; public override string BackgroundPath => "CalamityMod/Backgrounds/MapBackgrounds/AbyssBGLayer23"; public override string MapBackground => "CalamityMod/Backgrounds/MapBackgrounds/AbyssBGLayer23"; public override void SetStaticDefaults() { - DisplayName.SetDefault("Abyss: Second Layer"); + DisplayName.SetDefault("Upper Abyss"); } public override bool IsBiomeActive(Player player) { return AbyssLayer1Biome.MeetsBaseAbyssRequirement(player, out int playerYTileCoords) && - playerYTileCoords > (Main.rockLayer + Main.maxTilesY * 0.03) && - playerYTileCoords <= (Main.rockLayer + Main.maxTilesY * 0.14); + playerYTileCoords > Main.rockLayer - 22 && + playerYTileCoords <= Main.rockLayer + Main.maxTilesY * 0.145; } } } diff --git a/BiomeManagers/AbyssLayer2Icon.png b/BiomeManagers/AbyssLayer2Icon.png new file mode 100644 index 0000000000..dda3a08249 Binary files /dev/null and b/BiomeManagers/AbyssLayer2Icon.png differ diff --git a/BiomeManagers/AbyssLayer3Biome.cs b/BiomeManagers/AbyssLayer3Biome.cs index cbd29d5c81..57acbda920 100644 --- a/BiomeManagers/AbyssLayer3Biome.cs +++ b/BiomeManagers/AbyssLayer3Biome.cs @@ -17,22 +17,22 @@ namespace CalamityMod.BiomeManagers } } - public override ModWaterStyle WaterStyle => ModContent.Find("CalamityMod/AbyssWater"); + public override ModWaterStyle WaterStyle => ModContent.Find("CalamityMod/MiddleAbyssWater"); public override SceneEffectPriority Priority => SceneEffectPriority.BiomeHigh; - public override string BestiaryIcon => "CalamityMod/BiomeManagers/AbyssIcon"; + public override string BestiaryIcon => "CalamityMod/BiomeManagers/AbyssLayer3Icon"; public override string BackgroundPath => "CalamityMod/Backgrounds/MapBackgrounds/AbyssBGLayer23"; public override string MapBackground => "CalamityMod/Backgrounds/MapBackgrounds/AbyssBGLayer23"; public override void SetStaticDefaults() { - DisplayName.SetDefault("Abyss: Third Layer"); + DisplayName.SetDefault("Lower Abyss"); } public override bool IsBiomeActive(Player player) { return AbyssLayer1Biome.MeetsBaseAbyssRequirement(player, out int playerYTileCoords) && - playerYTileCoords > (Main.rockLayer + Main.maxTilesY * 0.14) && - playerYTileCoords <= (Main.rockLayer + Main.maxTilesY * 0.26); + playerYTileCoords > Main.rockLayer + Main.maxTilesY * 0.145 && + playerYTileCoords <= Main.rockLayer + Main.maxTilesY * 0.262; } } } diff --git a/BiomeManagers/AbyssLayer3Icon.png b/BiomeManagers/AbyssLayer3Icon.png new file mode 100644 index 0000000000..9469ac6600 Binary files /dev/null and b/BiomeManagers/AbyssLayer3Icon.png differ diff --git a/BiomeManagers/AbyssLayer4Biome.cs b/BiomeManagers/AbyssLayer4Biome.cs index 9368527844..8f6b830864 100644 --- a/BiomeManagers/AbyssLayer4Biome.cs +++ b/BiomeManagers/AbyssLayer4Biome.cs @@ -17,21 +17,21 @@ namespace CalamityMod.BiomeManagers } } - public override ModWaterStyle WaterStyle => ModContent.Find("CalamityMod/AbyssWater"); + public override ModWaterStyle WaterStyle => ModContent.Find("CalamityMod/VoidWater"); public override SceneEffectPriority Priority => SceneEffectPriority.BiomeHigh; - public override string BestiaryIcon => "CalamityMod/BiomeManagers/AbyssIcon"; + public override string BestiaryIcon => "CalamityMod/BiomeManagers/AbyssLayer4Icon"; public override string BackgroundPath => "CalamityMod/Backgrounds/MapBackgrounds/AbyssBGLayer4"; public override string MapBackground => "CalamityMod/Backgrounds/MapBackgrounds/AbyssBGLayer4"; public override void SetStaticDefaults() { - DisplayName.SetDefault("Abyss: Fourth Layer"); + DisplayName.SetDefault("The Void"); } public override bool IsBiomeActive(Player player) { return AbyssLayer1Biome.MeetsBaseAbyssRequirement(player, out int playerYTileCoords) && - playerYTileCoords > Main.rockLayer + Main.maxTilesY * 0.26; + playerYTileCoords > Main.rockLayer + Main.maxTilesY * 0.262; } } } diff --git a/BiomeManagers/AbyssLayer4Icon.png b/BiomeManagers/AbyssLayer4Icon.png new file mode 100644 index 0000000000..9edb4373c6 Binary files /dev/null and b/BiomeManagers/AbyssLayer4Icon.png differ diff --git a/BiomeManagers/SulphurousSeaIcon.png b/BiomeManagers/SulphurousSeaIcon.png index 1c2d2afb05..c2bbafa753 100644 Binary files a/BiomeManagers/SulphurousSeaIcon.png and b/BiomeManagers/SulphurousSeaIcon.png differ diff --git a/ILEditing/MechanicILChanges.cs b/ILEditing/MechanicILChanges.cs index 38dd4dd9cc..0afda36f12 100644 --- a/ILEditing/MechanicILChanges.cs +++ b/ILEditing/MechanicILChanges.cs @@ -834,14 +834,16 @@ namespace CalamityMod.ILEditing initialColor.TopRightColor = SelectLavaColor(initialTexture, initialColor.TopRightColor, liquidType == 1); initialColor.BottomLeftColor = SelectLavaColor(initialTexture, initialColor.BottomLeftColor, liquidType == 1); initialColor.BottomRightColor = SelectLavaColor(initialTexture, initialColor.BottomRightColor, liquidType == 1); - if (liquidType == ModContent.Find("CalamityMod/SulphuricWater").Slot) - SelectSulphuricWaterColor(x, y, ref initialColor); - if (liquidType == ModContent.Find("CalamityMod/SunkenSeaWater").Slot) - SelectSulphuricWaterColor(x, y, ref initialColor); - - if (liquidType == ModContent.Find("CalamityMod/AbyssWater").Slot) + if (liquidType == ModContent.Find("CalamityMod/SunkenSeaWater").Slot || + liquidType == ModContent.Find("CalamityMod/SulphuricWater").Slot || + liquidType == ModContent.Find("CalamityMod/SulphuricDepthsWater").Slot || + liquidType == ModContent.Find("CalamityMod/UpperAbyssWater").Slot || + liquidType == ModContent.Find("CalamityMod/MiddleAbyssWater").Slot || + liquidType == ModContent.Find("CalamityMod/VoidWater").Slot) + { SelectSulphuricWaterColor(x, y, ref initialColor); + } // Apply any extra color conditions. initialColor = ExtraColorChangeConditions?.Invoke(initialColor, liquidType, new(x, y)) ?? initialColor; @@ -967,8 +969,7 @@ namespace CalamityMod.ILEditing orig(self, x, y, out outputColor); Tile tile = CalamityUtils.ParanoidTileRetrieval(x, y); - if (tile.LiquidAmount <= 0 || tile.HasTile || Main.waterStyle != ModContent.Find("CalamityMod/SulphuricWater").Slot && - Main.waterStyle != ModContent.Find("CalamityMod/SunkenSeaWater").Slot) + if (tile.LiquidAmount <= 0 || tile.HasTile || Main.waterStyle != ModContent.Find("CalamityMod/SulphuricWater").Slot) return; Tile above = CalamityUtils.ParanoidTileRetrieval(x, y - 1); diff --git a/Items/Placeables/GloomTorch.png b/Items/Placeables/GloomTorch.png new file mode 100644 index 0000000000..d82c0d6d0c Binary files /dev/null and b/Items/Placeables/GloomTorch.png differ diff --git a/Items/Placeables/SulphurousShale.cs b/Items/Placeables/SulphurousShale.cs new file mode 100644 index 0000000000..d108dd5845 --- /dev/null +++ b/Items/Placeables/SulphurousShale.cs @@ -0,0 +1,35 @@ +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables +{ + public class SulphurousShale : ModItem + { + public override void SetStaticDefaults() + { + SacrificeTotal = 100; + DisplayName.SetDefault("Sulphurous Shale"); + } + + public override void SetDefaults() + { + Item.createTile = ModContent.TileType(); + Item.useStyle = ItemUseStyleID.Swing; + Item.useTurn = true; + Item.useAnimation = 15; + Item.useTime = 10; + Item.autoReuse = true; + Item.consumable = true; + Item.width = 16; + Item.height = 16; + Item.maxStack = 999; + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(4). + AddTile(TileID.WorkBenches). + Register(); + } + } +} diff --git a/Items/Placeables/SulphurousShale.png b/Items/Placeables/SulphurousShale.png new file mode 100644 index 0000000000..8d4e10c1c4 Binary files /dev/null and b/Items/Placeables/SulphurousShale.png differ diff --git a/Items/Placeables/Walls/SulphurousShaleWall.cs b/Items/Placeables/Walls/SulphurousShaleWall.cs new file mode 100644 index 0000000000..4354c63366 --- /dev/null +++ b/Items/Placeables/Walls/SulphurousShaleWall.cs @@ -0,0 +1,34 @@ +using Terraria.ID; +using Terraria.ModLoader; +using WallTiles = CalamityMod.Walls; +namespace CalamityMod.Items.Placeables.Walls +{ + public class SulphurousShaleWall : ModItem + { + public override void SetStaticDefaults() + { + SacrificeTotal = 400; + DisplayName.SetDefault("Sulphurous Shale Wall"); + } + + public override void SetDefaults() + { + Item.createWall = ModContent.WallType(); + Item.useStyle = ItemUseStyleID.Swing; + Item.useTurn = true; + Item.useAnimation = 15; + Item.useTime = 10; + Item.autoReuse = true; + Item.consumable = true; + Item.width = 16; + Item.height = 16; + Item.maxStack = 999; + } + + public override void AddRecipes() + { + CreateRecipe(4).AddTile( + TileID.WorkBenches).AddIngredient(ModContent.ItemType()).Register(); + } + } +} diff --git a/Items/Placeables/Walls/SulphurousShaleWall.png b/Items/Placeables/Walls/SulphurousShaleWall.png new file mode 100644 index 0000000000..22df2ddf22 Binary files /dev/null and b/Items/Placeables/Walls/SulphurousShaleWall.png differ diff --git a/Projectiles/Enemy/ToxicMinnowCloud.cs b/Projectiles/Enemy/ToxicMinnowCloud.cs index 59ef83c5bd..955f5cb2e2 100644 --- a/Projectiles/Enemy/ToxicMinnowCloud.cs +++ b/Projectiles/Enemy/ToxicMinnowCloud.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Projectiles.Enemy public override void SetStaticDefaults() { DisplayName.SetDefault("Toxic Cloud"); - Main.projFrames[Projectile.type] = 4; + Main.projFrames[Projectile.type] = 10; } public override void SetDefaults() @@ -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; diff --git a/Projectiles/Pets/EidolonSnail.cs b/Projectiles/Pets/EidolonSnail.cs index 4ce873dd45..9421f95604 100644 --- a/Projectiles/Pets/EidolonSnail.cs +++ b/Projectiles/Pets/EidolonSnail.cs @@ -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++; diff --git a/Tiles/Abyss/AbyssAmbient/BulbTree.cs b/Tiles/Abyss/AbyssAmbient/BulbTree.cs index 8a48dfb034..1a9a42f1e8 100644 --- a/Tiles/Abyss/AbyssAmbient/BulbTree.cs +++ b/Tiles/Abyss/AbyssAmbient/BulbTree.cs @@ -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) diff --git a/Tiles/Abyss/AbyssGravel.cs b/Tiles/Abyss/AbyssGravel.cs index fbe7d4d4b9..66c4c42473 100644 --- a/Tiles/Abyss/AbyssGravel.cs +++ b/Tiles/Abyss/AbyssGravel.cs @@ -47,7 +47,7 @@ namespace CalamityMod.Tiles.Abyss Tile up2 = Main.tile[i, j - 2]; //place kelp - if (WorldGen.genRand.Next(8) == 0 && !up.HasTile && !up2.HasTile && up.LiquidAmount > 0 && !tile.LeftSlope && !tile.RightSlope && !tile.IsHalfBlock) + if (WorldGen.genRand.Next(8) == 0 && !up.HasTile && !up2.HasTile && up.LiquidAmount > 0 && up2.LiquidAmount > 0 && !tile.LeftSlope && !tile.RightSlope && !tile.IsHalfBlock) { up.TileType = (ushort)ModContent.TileType(); up.HasTile = true; diff --git a/Tiles/Abyss/PlantyMush.cs b/Tiles/Abyss/PlantyMush.cs index 459056b6aa..d55f5dac5b 100644 --- a/Tiles/Abyss/PlantyMush.cs +++ b/Tiles/Abyss/PlantyMush.cs @@ -55,7 +55,7 @@ namespace CalamityMod.Tiles.Abyss Tile up2 = Main.tile[i, j - 2]; //place kelp - if (WorldGen.genRand.Next(5) == 0 && !up.HasTile && !up2.HasTile && up.LiquidAmount > 0 && !tile.LeftSlope && !tile.RightSlope && !tile.IsHalfBlock) + if (WorldGen.genRand.Next(5) == 0 && !up.HasTile && !up2.HasTile && up.LiquidAmount > 0 && up2.LiquidAmount > 0 && !tile.LeftSlope && !tile.RightSlope && !tile.IsHalfBlock) { up.TileType = (ushort)ModContent.TileType(); up.HasTile = true; diff --git a/Tiles/Abyss/SulphurousShale.cs b/Tiles/Abyss/SulphurousShale.cs new file mode 100644 index 0000000000..f95ff7bd6d --- /dev/null +++ b/Tiles/Abyss/SulphurousShale.cs @@ -0,0 +1,201 @@ +//using CalamityMod.Tiles.Abyss.AbyssAmbient; +using CalamityMod.World; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; +using System; +using Terraria; +using Terraria.Audio; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.Abyss +{ + public class SulphurousShale : ModTile + { + int animationFrameWidth = 288; + + public static readonly SoundStyle MineSound = new("CalamityMod/Sounds/Custom/AbyssGravelMine", 3); + public override void SetStaticDefaults() + { + Main.tileSolid[Type] = true; + Main.tileBlockLight[Type] = true; + Main.tileMergeDirt[Type] = true; + + CalamityUtils.MergeWithGeneral(Type); + CalamityUtils.MergeWithAbyss(Type); + + ItemDrop = ModContent.ItemType(); + AddMapEntry(new Color(77, 60, 93)); + MineResist = 5f; + MinPick = 65; + HitSound = MineSound; + DustType = 33; + } + + public override bool CanExplode(int i, int j) + { + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void RandomUpdate(int i, int j) + { + int num8 = WorldGen.genRand.Next((int)Main.rockLayer, (int)(Main.rockLayer + (double)Main.maxTilesY * 0.143)); + int nearbyVineCount = 0; + for (int x = i - 15; x <= i + 15; x++) + { + for (int y = j - 15; y <= j + 15; y++) + { + if (WorldGen.InWorld(x, y)) + { + if (CalamityUtils.ParanoidTileRetrieval(x, y).HasTile && + CalamityUtils.ParanoidTileRetrieval(x, y).TileType == (ushort)ModContent.TileType()) + { + nearbyVineCount++; + } + } + } + } + if (Main.tile[i, j + 1] != null && nearbyVineCount < 5 && j >= SulphurousSea.VineGrowTopLimit) + { + if (!Main.tile[i, j + 1].HasTile && Main.tile[i, j + 1].TileType != (ushort)ModContent.TileType()) + { + if (Main.tile[i, j + 1].LiquidAmount == 255 && + Main.tile[i, j + 1].LiquidType != LiquidID.Lava) + { + bool flag13 = false; + for (int num52 = num8; num52 > num8 - 10; num52--) + { + if (Main.tile[i, num52].BottomSlope) + { + flag13 = false; + break; + } + if (Main.tile[i, num52].HasTile && !Main.tile[i, num52].BottomSlope) + { + flag13 = true; + break; + } + } + if (flag13) + { + int num53 = i; + int num54 = j + 1; + Main.tile[num53, num54].TileType = (ushort)ModContent.TileType(); + Main.tile[num53, num54].Get().HasTile = true; + WorldGen.SquareTileFrame(num53, num54, true); + if (Main.netMode == NetmodeID.Server) + { + NetMessage.SendTileSquare(-1, num53, num54, 3, TileChangeType.None); + } + } + Main.tile[i, j].Get().Slope = SlopeType.Solid; + Main.tile[i, j].Get().IsHalfBlock = false; + } + } + } + } + + public override void AnimateIndividualTile(int type, int i, int j, ref int frameXOffset, ref int frameYOffset) + { + int uniqueAnimationFrameX = 0; + int xPos = i % 4; + int yPos = j % 4; + switch (xPos) + { + case 0: + switch (yPos) + { + case 0: + uniqueAnimationFrameX = 0; + break; + case 1: + uniqueAnimationFrameX = 2; + break; + case 2: + uniqueAnimationFrameX = 1; + break; + case 3: + uniqueAnimationFrameX = 2; + break; + default: + uniqueAnimationFrameX = 2; + break; + } + break; + case 1: + switch (yPos) + { + case 0: + uniqueAnimationFrameX = 2; + break; + case 1: + uniqueAnimationFrameX = 0; + break; + case 2: + uniqueAnimationFrameX = 2; + break; + case 3: + uniqueAnimationFrameX = 2; + break; + default: + uniqueAnimationFrameX = 2; + break; + } + break; + case 2: + switch (yPos) + { + case 0: + uniqueAnimationFrameX = 2; + break; + case 1: + uniqueAnimationFrameX = 0; + break; + case 2: + uniqueAnimationFrameX = 1; + break; + case 3: + uniqueAnimationFrameX = 2; + break; + default: + uniqueAnimationFrameX = 2; + break; + } + break; + case 3: + switch (yPos) + { + case 0: + uniqueAnimationFrameX = 1; + break; + case 1: + uniqueAnimationFrameX = 2; + break; + case 2: + uniqueAnimationFrameX = 0; + break; + case 3: + uniqueAnimationFrameX = 2; + break; + default: + uniqueAnimationFrameX = 2; + break; + } + break; + } + frameXOffset = uniqueAnimationFrameX * animationFrameWidth; + } + + public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) + { + TileFraming.CustomMergeFrame(i, j, Type, ModContent.TileType(), false, false, false, false, resetFrame); + return false; + } + } +} diff --git a/Tiles/Abyss/SulphurousShale.png b/Tiles/Abyss/SulphurousShale.png new file mode 100644 index 0000000000..e23324e5b9 Binary files /dev/null and b/Tiles/Abyss/SulphurousShale.png differ diff --git a/Tiles/Abyss/Voidstone.cs b/Tiles/Abyss/Voidstone.cs index e2e1f9fea0..6640ef6b14 100644 --- a/Tiles/Abyss/Voidstone.cs +++ b/Tiles/Abyss/Voidstone.cs @@ -54,7 +54,7 @@ namespace CalamityMod.Tiles.Abyss Tile up2 = Main.tile[i, j - 2]; //place kelp - if (WorldGen.genRand.Next(25) == 0 && !up.HasTile && !up2.HasTile && up.LiquidAmount > 0 && !tile.LeftSlope && !tile.RightSlope && !tile.IsHalfBlock) + if (WorldGen.genRand.Next(25) == 0 && !up.HasTile && !up2.HasTile && up.LiquidAmount > 0 && up2.LiquidAmount > 0 && !tile.LeftSlope && !tile.RightSlope && !tile.IsHalfBlock) { up.TileType = (ushort)ModContent.TileType(); up.HasTile = true; diff --git a/Tiles/Crags/GloomTorch.png b/Tiles/Crags/GloomTorch.png new file mode 100644 index 0000000000..6ff4c4ab25 Binary files /dev/null and b/Tiles/Crags/GloomTorch.png differ diff --git a/Tiles/Crags/GloomTorchGlowmask.png b/Tiles/Crags/GloomTorchGlowmask.png new file mode 100644 index 0000000000..5f01acab9c Binary files /dev/null and b/Tiles/Crags/GloomTorchGlowmask.png differ diff --git a/Tiles/Crags/Lily/LavaLily1.cs b/Tiles/Crags/Lily/LavaLily1.cs new file mode 100644 index 0000000000..849b8aa9a4 --- /dev/null +++ b/Tiles/Crags/Lily/LavaLily1.cs @@ -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("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("CalamityMod/Tiles/Crags/Lily/LavaLily1Top").Value; + Texture2D glowTex = ModContent.Request("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); + } + } + } +} \ No newline at end of file diff --git a/Tiles/Crags/Lily/LavaLily1.png b/Tiles/Crags/Lily/LavaLily1.png new file mode 100644 index 0000000000..577ffc6c9e Binary files /dev/null and b/Tiles/Crags/Lily/LavaLily1.png differ diff --git a/Tiles/Crags/Lily/LavaLily1Glow.png b/Tiles/Crags/Lily/LavaLily1Glow.png new file mode 100644 index 0000000000..aa8417951c Binary files /dev/null and b/Tiles/Crags/Lily/LavaLily1Glow.png differ diff --git a/Tiles/Crags/Lily/LavaLily1Top.png b/Tiles/Crags/Lily/LavaLily1Top.png new file mode 100644 index 0000000000..6073a6b920 Binary files /dev/null and b/Tiles/Crags/Lily/LavaLily1Top.png differ diff --git a/Tiles/Crags/Lily/LavaLily1TopGlow.png b/Tiles/Crags/Lily/LavaLily1TopGlow.png new file mode 100644 index 0000000000..12aa31f3ec Binary files /dev/null and b/Tiles/Crags/Lily/LavaLily1TopGlow.png differ diff --git a/Tiles/Crags/Lily/LavaLily2.cs b/Tiles/Crags/Lily/LavaLily2.cs new file mode 100644 index 0000000000..957816f3de --- /dev/null +++ b/Tiles/Crags/Lily/LavaLily2.cs @@ -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("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("CalamityMod/Tiles/Crags/Lily/LavaLily2Top").Value; + Texture2D glowTex = ModContent.Request("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); + } + } + } +} \ No newline at end of file diff --git a/Tiles/Crags/Lily/LavaLily2.png b/Tiles/Crags/Lily/LavaLily2.png new file mode 100644 index 0000000000..cd908b4f64 Binary files /dev/null and b/Tiles/Crags/Lily/LavaLily2.png differ diff --git a/Tiles/Crags/Lily/LavaLily2Glow.png b/Tiles/Crags/Lily/LavaLily2Glow.png new file mode 100644 index 0000000000..50fbfbbc5a Binary files /dev/null and b/Tiles/Crags/Lily/LavaLily2Glow.png differ diff --git a/Tiles/Crags/Lily/LavaLily2Top.png b/Tiles/Crags/Lily/LavaLily2Top.png new file mode 100644 index 0000000000..7ce6a66769 Binary files /dev/null and b/Tiles/Crags/Lily/LavaLily2Top.png differ diff --git a/Tiles/Crags/Lily/LavaLily2TopGlow.png b/Tiles/Crags/Lily/LavaLily2TopGlow.png new file mode 100644 index 0000000000..ff3ca4083c Binary files /dev/null and b/Tiles/Crags/Lily/LavaLily2TopGlow.png differ diff --git a/Tiles/Crags/Lily/LavaLily3.cs b/Tiles/Crags/Lily/LavaLily3.cs new file mode 100644 index 0000000000..64e7f004af --- /dev/null +++ b/Tiles/Crags/Lily/LavaLily3.cs @@ -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("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("CalamityMod/Tiles/Crags/Lily/LavaLily3Top").Value; + Texture2D glowTex = ModContent.Request("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); + } + } + } +} \ No newline at end of file diff --git a/Tiles/Crags/Lily/LavaLily3.png b/Tiles/Crags/Lily/LavaLily3.png new file mode 100644 index 0000000000..2287eca150 Binary files /dev/null and b/Tiles/Crags/Lily/LavaLily3.png differ diff --git a/Tiles/Crags/Lily/LavaLily3Glow.png b/Tiles/Crags/Lily/LavaLily3Glow.png new file mode 100644 index 0000000000..964907ab5b Binary files /dev/null and b/Tiles/Crags/Lily/LavaLily3Glow.png differ diff --git a/Tiles/Crags/Lily/LavaLily3Top.png b/Tiles/Crags/Lily/LavaLily3Top.png new file mode 100644 index 0000000000..11a199fa94 Binary files /dev/null and b/Tiles/Crags/Lily/LavaLily3Top.png differ diff --git a/Tiles/Crags/Lily/LavaLily3TopGlow.png b/Tiles/Crags/Lily/LavaLily3TopGlow.png new file mode 100644 index 0000000000..d0c8fa7e3e Binary files /dev/null and b/Tiles/Crags/Lily/LavaLily3TopGlow.png differ diff --git a/Utilities/TileUtils.cs b/Utilities/TileUtils.cs index 2902ed69aa..ac22f63503 100644 --- a/Utilities/TileUtils.cs +++ b/Utilities/TileUtils.cs @@ -335,6 +335,7 @@ namespace CalamityMod TileType(), TileType(), TileType(), + TileType(), TileType(), TileType(), }); @@ -448,6 +449,7 @@ namespace CalamityMod // Sulphurous Sea TileType(), TileType(), + TileType(), // Abyss TileType(), TileType(), diff --git a/Walls/SulphurousShaleWall.cs b/Walls/SulphurousShaleWall.cs new file mode 100644 index 0000000000..a7a9c9e46d --- /dev/null +++ b/Walls/SulphurousShaleWall.cs @@ -0,0 +1,18 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Walls +{ + public class SulphurousShaleWall : ModWall + { + public override void SetStaticDefaults() + { + DustType = 32; + AddMapEntry(new Color(59, 40, 63)); + } + + public override void NumDust(int i, int j, bool fail, ref int num) => num = fail ? 1 : 3; + } +} diff --git a/Walls/SulphurousShaleWall.png b/Walls/SulphurousShaleWall.png new file mode 100644 index 0000000000..31dfbfc2b5 Binary files /dev/null and b/Walls/SulphurousShaleWall.png differ diff --git a/Walls/SulphurousShaleWallSafe.cs b/Walls/SulphurousShaleWallSafe.cs new file mode 100644 index 0000000000..9a28123226 --- /dev/null +++ b/Walls/SulphurousShaleWallSafe.cs @@ -0,0 +1,19 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Walls +{ + public class SulphurousShaleWallSafe : ModWall + { + public override void SetStaticDefaults() + { + Main.wallHouse[Type] = true; + DustType = 32; + ItemDrop = ModContent.ItemType(); + AddMapEntry(new Color(59, 40, 63)); + } + + public override void NumDust(int i, int j, bool fail, ref int num) => num = fail ? 1 : 3; + } +} diff --git a/Walls/SulphurousShaleWallSafe.png b/Walls/SulphurousShaleWallSafe.png new file mode 100644 index 0000000000..31dfbfc2b5 Binary files /dev/null and b/Walls/SulphurousShaleWallSafe.png differ diff --git a/Waters/AstralWater.png b/Waters/AstralWater.png index 10d8bab903..ac63f5853c 100644 Binary files a/Waters/AstralWater.png and b/Waters/AstralWater.png differ diff --git a/Waters/AstralWater_Block.png b/Waters/AstralWater_Block.png index 4d7ec4aa9a..f6030be8bf 100644 Binary files a/Waters/AstralWater_Block.png and b/Waters/AstralWater_Block.png differ diff --git a/Waters/AstralWaterflow.png b/Waters/AstralWaterflow.png index 4cc35417cb..9f03c85683 100644 Binary files a/Waters/AstralWaterflow.png and b/Waters/AstralWaterflow.png differ diff --git a/Waters/MiddleAbyssWater.cs b/Waters/MiddleAbyssWater.cs new file mode 100644 index 0000000000..1c7f8250f8 --- /dev/null +++ b/Waters/MiddleAbyssWater.cs @@ -0,0 +1,28 @@ +using Microsoft.Xna.Framework; +using Terraria.ModLoader; + +namespace CalamityMod.Waters +{ + public class MiddleAbyssWater : ModWaterStyle + { + public override int ChooseWaterfallStyle() + { + return ModContent.Find("CalamityMod/MiddleAbyssWaterflow").Slot; + } + + public override int GetSplashDust() + { + return 33; + } + + public override int GetDropletGore() + { + return 713; + } + + public override Color BiomeHairColor() + { + return Color.Blue; + } + } +} diff --git a/Waters/MiddleAbyssWater.png b/Waters/MiddleAbyssWater.png new file mode 100644 index 0000000000..2f87227da3 Binary files /dev/null and b/Waters/MiddleAbyssWater.png differ diff --git a/Waters/MiddleAbyssWater_Block.png b/Waters/MiddleAbyssWater_Block.png new file mode 100644 index 0000000000..911499c8db Binary files /dev/null and b/Waters/MiddleAbyssWater_Block.png differ diff --git a/Waters/MiddleAbyssWaterflow.cs b/Waters/MiddleAbyssWaterflow.cs new file mode 100644 index 0000000000..6d7deb015d --- /dev/null +++ b/Waters/MiddleAbyssWaterflow.cs @@ -0,0 +1,8 @@ +using Terraria.ModLoader; +namespace CalamityMod.Waters +{ + public class MiddleAbyssWaterflow : ModWaterfallStyle + { + + } +} diff --git a/Waters/MiddleAbyssWaterflow.png b/Waters/MiddleAbyssWaterflow.png new file mode 100644 index 0000000000..bb2d5b743b Binary files /dev/null and b/Waters/MiddleAbyssWaterflow.png differ diff --git a/Waters/SulphuricDepthsWater.cs b/Waters/SulphuricDepthsWater.cs new file mode 100644 index 0000000000..63ab09da0a --- /dev/null +++ b/Waters/SulphuricDepthsWater.cs @@ -0,0 +1,28 @@ +using Microsoft.Xna.Framework; +using Terraria.ModLoader; + +namespace CalamityMod.Waters +{ + public class SulphuricDepthsWater : ModWaterStyle + { + public override int ChooseWaterfallStyle() + { + return ModContent.Find("CalamityMod/SulphuricDepthsWaterflow").Slot; + } + + public override int GetSplashDust() + { + return 33; + } + + public override int GetDropletGore() + { + return 713; + } + + public override Color BiomeHairColor() + { + return Color.Teal; + } + } +} diff --git a/Waters/SulphuricDepthsWater.png b/Waters/SulphuricDepthsWater.png new file mode 100644 index 0000000000..a7a870a527 Binary files /dev/null and b/Waters/SulphuricDepthsWater.png differ diff --git a/Waters/SulphuricDepthsWater_Block.png b/Waters/SulphuricDepthsWater_Block.png new file mode 100644 index 0000000000..93beaf1669 Binary files /dev/null and b/Waters/SulphuricDepthsWater_Block.png differ diff --git a/Waters/SulphuricDepthsWaterflow.cs b/Waters/SulphuricDepthsWaterflow.cs new file mode 100644 index 0000000000..0b0e76017e --- /dev/null +++ b/Waters/SulphuricDepthsWaterflow.cs @@ -0,0 +1,8 @@ +using Terraria.ModLoader; +namespace CalamityMod.Waters +{ + public class SulphuricDepthsWaterflow : ModWaterfallStyle + { + + } +} diff --git a/Waters/SulphuricDepthsWaterflow.png b/Waters/SulphuricDepthsWaterflow.png new file mode 100644 index 0000000000..2bffb3c294 Binary files /dev/null and b/Waters/SulphuricDepthsWaterflow.png differ diff --git a/Waters/UpperAbyssWater.cs b/Waters/UpperAbyssWater.cs new file mode 100644 index 0000000000..965861fdf7 --- /dev/null +++ b/Waters/UpperAbyssWater.cs @@ -0,0 +1,28 @@ +using Microsoft.Xna.Framework; +using Terraria.ModLoader; + +namespace CalamityMod.Waters +{ + public class UpperAbyssWater : ModWaterStyle + { + public override int ChooseWaterfallStyle() + { + return ModContent.Find("CalamityMod/UpperAbyssWaterflow").Slot; + } + + public override int GetSplashDust() + { + return 33; + } + + public override int GetDropletGore() + { + return 713; + } + + public override Color BiomeHairColor() + { + return Color.Blue; + } + } +} diff --git a/Waters/UpperAbyssWater.png b/Waters/UpperAbyssWater.png new file mode 100644 index 0000000000..bb2acdbdf3 Binary files /dev/null and b/Waters/UpperAbyssWater.png differ diff --git a/Waters/UpperAbyssWater_Block.png b/Waters/UpperAbyssWater_Block.png new file mode 100644 index 0000000000..af1637a72d Binary files /dev/null and b/Waters/UpperAbyssWater_Block.png differ diff --git a/Waters/UpperAbyssWaterflow.cs b/Waters/UpperAbyssWaterflow.cs new file mode 100644 index 0000000000..855d4f319d --- /dev/null +++ b/Waters/UpperAbyssWaterflow.cs @@ -0,0 +1,8 @@ +using Terraria.ModLoader; +namespace CalamityMod.Waters +{ + public class UpperAbyssWaterflow : ModWaterfallStyle + { + + } +} diff --git a/Waters/UpperAbyssWaterflow.png b/Waters/UpperAbyssWaterflow.png new file mode 100644 index 0000000000..8c9ae27357 Binary files /dev/null and b/Waters/UpperAbyssWaterflow.png differ diff --git a/Waters/AbyssWater.cs b/Waters/VoidWater.cs similarity index 88% rename from Waters/AbyssWater.cs rename to Waters/VoidWater.cs index a6d848a409..bff3e0bf78 100644 --- a/Waters/AbyssWater.cs +++ b/Waters/VoidWater.cs @@ -3,11 +3,11 @@ using Terraria.ModLoader; namespace CalamityMod.Waters { - public class AbyssWater : ModWaterStyle + public class VoidWater : ModWaterStyle { public override int ChooseWaterfallStyle() { - return ModContent.Find("CalamityMod/AbyssWaterflow").Slot; + return ModContent.Find("CalamityMod/VoidWaterflow").Slot; } public override int GetSplashDust() diff --git a/Waters/AbyssWater.png b/Waters/VoidWater.png similarity index 100% rename from Waters/AbyssWater.png rename to Waters/VoidWater.png diff --git a/Waters/AbyssWater_Block.png b/Waters/VoidWater_Block.png similarity index 100% rename from Waters/AbyssWater_Block.png rename to Waters/VoidWater_Block.png diff --git a/Waters/AbyssWaterflow.cs b/Waters/VoidWaterflow.cs similarity index 58% rename from Waters/AbyssWaterflow.cs rename to Waters/VoidWaterflow.cs index 9284d28dd3..3224a16282 100644 --- a/Waters/AbyssWaterflow.cs +++ b/Waters/VoidWaterflow.cs @@ -1,7 +1,7 @@ using Terraria.ModLoader; namespace CalamityMod.Waters { - public class AbyssWaterflow : ModWaterfallStyle + public class VoidWaterflow : ModWaterfallStyle { } diff --git a/Waters/AbyssWaterflow.png b/Waters/VoidWaterflow.png similarity index 100% rename from Waters/AbyssWaterflow.png rename to Waters/VoidWaterflow.png diff --git a/World/Abyss.cs b/World/Abyss.cs index 2cb9fb8120..f092d9b303 100644 --- a/World/Abyss.cs +++ b/World/Abyss.cs @@ -40,7 +40,7 @@ namespace CalamityMod.World int abyssChasmY = y - 250; //Underworld = y - 200 AbyssChasmBottom = abyssChasmY - 100; //850 small 1450 medium 2050 large - int abyssChasmX = AtLeftSideOfWorld ? genLimit - (genLimit - 135) : genLimit + (genLimit - 135); //2100 - 1965 = 135 : 2100 + 1965 = 4065 + int abyssChasmX = AtLeftSideOfWorld ? genLimit - (genLimit - 135) + 35 : genLimit + (genLimit - 135) - 35; //2100 - 1965 = 135 : 2100 + 1965 = 4065 bool plantyMushSide = true; @@ -49,240 +49,177 @@ namespace CalamityMod.World plantyMushSide = false; } - if (AtLeftSideOfWorld) + int abyssMinX = AtLeftSideOfWorld ? 0 : abyssChasmX - 130; + int abyssMaxX = AtLeftSideOfWorld ? abyssChasmX + 130 : x; + + for (int abyssIndex = abyssMinX; abyssIndex < abyssMaxX; abyssIndex++) { - for (int abyssIndex = 0; abyssIndex < abyssChasmX + 80; abyssIndex++) //235 + for (int abyssIndex2 = 0; abyssIndex2 < abyssChasmY + 50; abyssIndex2++) { - for (int abyssIndex2 = 0; abyssIndex2 < abyssChasmY; abyssIndex2++) + Tile tile = Framing.GetTileSafely(abyssIndex, abyssIndex2); + + if (tile.LiquidType == LiquidID.Lava && tile.LiquidAmount > 0) { - Tile tile = Framing.GetTileSafely(abyssIndex, abyssIndex2); - - if (tile.LiquidType == LiquidID.Lava && tile.LiquidAmount > 0) - { - tile.LiquidType = LiquidID.Water; - tile.LiquidAmount = 255; - } - - bool canConvert = tile.HasTile && tile.TileType < TileID.Count && tile.TileType != TileID.DyePlants && tile.TileType != TileID.Trees && - tile.TileType != TileID.PalmTree && tile.TileType != TileID.Sand && tile.TileType != TileID.Containers && tile.TileType != TileID.Coral && - tile.TileType != TileID.BeachPiles && tile.TileType != ModContent.TileType() && tile.TileType != ModContent.TileType(); - - if (abyssIndex2 > rockLayer - WorldGen.genRand.Next(30)) - { - //dithering on the edge of the abyss - if (abyssIndex > abyssChasmX + 75) - { - if (WorldGen.genRand.NextBool(2)) - { - WorldGen.KillTile(abyssIndex, abyssIndex2); - - if (abyssIndex2 > (rockLayer + y * 0.262)) - { - WorldGen.PlaceTile(abyssIndex, abyssIndex2, (ushort)ModContent.TileType()); - } - else if (abyssIndex2 > (rockLayer + y * 0.140) && WorldGen.genRand.NextBool(3)) - { - WorldGen.PlaceTile(abyssIndex, abyssIndex2, (ushort)ModContent.TileType()); - } - else if (abyssIndex2 > (rockLayer + y * 0.145)) - { - if (WorldGen.genRand.NextBool(3)) - { - WorldGen.PlaceTile(abyssIndex, abyssIndex2, (ushort)ModContent.TileType()); - } - else - { - WorldGen.PlaceTile(abyssIndex, abyssIndex2, (ushort)ModContent.TileType()); - } - } - else - { - WorldGen.PlaceTile(abyssIndex, abyssIndex2, (ushort)ModContent.TileType()); - } - } - } - else - { - if (canConvert) - { - if (abyssIndex2 > (rockLayer + y * 0.262)) - { - tile.TileType = (ushort)ModContent.TileType(); - tile.WallType = (ushort)ModContent.WallType(); - } - else if (abyssIndex2 > (rockLayer + y * 0.142) && WorldGen.genRand.NextBool(3)) - { - tile.TileType = (ushort)ModContent.TileType(); - tile.WallType = (ushort)ModContent.WallType(); - } - else if (abyssIndex2 > (rockLayer + y * 0.145)) - { - if (WorldGen.genRand.NextBool(3)) - { - tile.TileType = (ushort)ModContent.TileType(); - } - else - { - tile.TileType = (ushort)ModContent.TileType(); - } - tile.WallType = (ushort)ModContent.WallType(); - } - else - { - tile.TileType = (ushort)ModContent.TileType(); - tile.WallType = (ushort)ModContent.WallType(); - } - } - else if (!tile.HasTile) - { - tile.Get().HasTile = true; - if (abyssIndex2 > (rockLayer + y * 0.262)) - { - tile.TileType = (ushort)ModContent.TileType(); - tile.WallType = (ushort)ModContent.WallType(); - } - else if (abyssIndex2 > (rockLayer + y * 0.142) && WorldGen.genRand.NextBool(3)) - { - tile.TileType = (ushort)ModContent.TileType(); - tile.WallType = (ushort)ModContent.WallType(); - } - else if (abyssIndex2 > (rockLayer + y * 0.145)) - { - if (WorldGen.genRand.NextBool(3)) - { - tile.TileType = (ushort)ModContent.TileType(); - } - else - { - tile.TileType = (ushort)ModContent.TileType(); - } - tile.WallType = (ushort)ModContent.WallType(); - } - else - { - tile.TileType = (ushort)ModContent.TileType(); - tile.WallType = (ushort)ModContent.WallType(); - } - } - } - } + tile.LiquidType = LiquidID.Water; + tile.LiquidAmount = 255; } - } - } - else - { - for (int abyssIndex = abyssChasmX - 80; abyssIndex < x; abyssIndex++) //3965 - { - for (int abyssIndex2 = 0; abyssIndex2 < abyssChasmY; abyssIndex2++) + + bool canConvert = tile.HasTile && tile.TileType < TileID.Count && tile.TileType != TileID.DyePlants && tile.TileType != TileID.Trees && + tile.TileType != TileID.PalmTree && tile.TileType != TileID.Sand && tile.TileType != TileID.Containers && tile.TileType != TileID.Coral && + tile.TileType != TileID.BeachPiles && tile.TileType != ModContent.TileType(); + + if (abyssIndex2 > (rockLayer - Main.maxTilesY / 15) - WorldGen.genRand.Next(30)) { - Tile tile = Framing.GetTileSafely(abyssIndex, abyssIndex2); - - if (tile.LiquidType == LiquidID.Lava && tile.LiquidAmount > 0) + //dithering on the edge of the abyss + if ((AtLeftSideOfWorld && abyssIndex > abyssChasmX + 125) || (!AtLeftSideOfWorld && abyssIndex < abyssChasmX - 125)) { - tile.LiquidType = LiquidID.Water; - tile.LiquidAmount = 255; - } - - bool canConvert = tile.HasTile && tile.TileType < TileID.Count && tile.TileType != TileID.DyePlants && tile.TileType != TileID.Trees && - tile.TileType != TileID.PalmTree && tile.TileType != TileID.Sand && tile.TileType != TileID.Containers && tile.TileType != TileID.Coral && - tile.TileType != TileID.BeachPiles && tile.TileType != ModContent.TileType() && tile.TileType != ModContent.TileType(); - - if (abyssIndex2 > rockLayer - WorldGen.genRand.Next(30)) - { - //dithering on the edge of the abyss - if (abyssIndex < abyssChasmX - 75) + if (WorldGen.genRand.NextBool(2)) { - if (WorldGen.genRand.NextBool(2)) - { - WorldGen.KillTile(abyssIndex, abyssIndex2); + WorldGen.KillTile(abyssIndex, abyssIndex2); - if (abyssIndex2 > (rockLayer + y * 0.262)) + if (abyssIndex2 > (rockLayer + y * 0.262)) + { + WorldGen.PlaceTile(abyssIndex, abyssIndex2, (ushort)ModContent.TileType()); + } + else if (abyssIndex2 > (rockLayer + y * 0.140) && WorldGen.genRand.NextBool(3)) + { + WorldGen.PlaceTile(abyssIndex, abyssIndex2, (ushort)ModContent.TileType()); + } + else if (abyssIndex2 > (rockLayer + y * 0.145)) + { + if (WorldGen.genRand.NextBool(3)) { WorldGen.PlaceTile(abyssIndex, abyssIndex2, (ushort)ModContent.TileType()); } - else if (abyssIndex2 > (rockLayer + y * 0.140) && WorldGen.genRand.NextBool(3)) - { - WorldGen.PlaceTile(abyssIndex, abyssIndex2, (ushort)ModContent.TileType()); - } - else if (abyssIndex2 > (rockLayer + y * 0.145)) - { - if (WorldGen.genRand.NextBool(3)) - { - WorldGen.PlaceTile(abyssIndex, abyssIndex2, (ushort)ModContent.TileType()); - } - else - { - WorldGen.PlaceTile(abyssIndex, abyssIndex2, (ushort)ModContent.TileType()); - } - } else { WorldGen.PlaceTile(abyssIndex, abyssIndex2, (ushort)ModContent.TileType()); } } - } - else - { - if (canConvert) + else if (abyssIndex2 >= rockLayer - 20 && abyssIndex2 <= rockLayer - 10) { - if (abyssIndex2 > (rockLayer + y * 0.262)) + if (WorldGen.genRand.NextBool(2)) { - tile.TileType = (ushort)ModContent.TileType(); - tile.WallType = (ushort)ModContent.WallType(); - } - else if (abyssIndex2 > (rockLayer + y * 0.140) && WorldGen.genRand.NextBool(3)) - { - tile.TileType = (ushort)ModContent.TileType(); - tile.WallType = (ushort)ModContent.WallType(); - } - else if (abyssIndex2 > (rockLayer + y * 0.145)) - { - if (WorldGen.genRand.NextBool(3)) - { - tile.TileType = (ushort)ModContent.TileType(); - } - else - { - tile.TileType = (ushort)ModContent.TileType(); - } - tile.WallType = (ushort)ModContent.WallType(); + WorldGen.PlaceTile(abyssIndex, abyssIndex2, (ushort)ModContent.TileType()); } else { - tile.TileType = (ushort)ModContent.TileType(); - tile.WallType = (ushort)ModContent.WallType(); + WorldGen.PlaceTile(abyssIndex, abyssIndex2, (ushort)ModContent.TileType()); } } - else if (!tile.HasTile) + else if (abyssIndex2 <= rockLayer - 20) { - tile.Get().HasTile = true; - if (abyssIndex2 > (rockLayer + y * 0.262)) + WorldGen.PlaceTile(abyssIndex, abyssIndex2, (ushort)ModContent.TileType()); + } + else + { + WorldGen.PlaceTile(abyssIndex, abyssIndex2, (ushort)ModContent.TileType()); + } + } + } + else + { + if (canConvert) + { + if (abyssIndex2 > (rockLayer + y * 0.262)) + { + tile.TileType = (ushort)ModContent.TileType(); + tile.WallType = (ushort)ModContent.WallType(); + } + else if (abyssIndex2 > (rockLayer + y * 0.142) && WorldGen.genRand.NextBool(3)) + { + tile.TileType = (ushort)ModContent.TileType(); + tile.WallType = (ushort)ModContent.WallType(); + } + else if (abyssIndex2 > (rockLayer + y * 0.145)) + { + if (WorldGen.genRand.NextBool(3)) { tile.TileType = (ushort)ModContent.TileType(); - tile.WallType = (ushort)ModContent.WallType(); - } - else if (abyssIndex2 > (rockLayer + y * 0.140) && WorldGen.genRand.NextBool(3)) - { - tile.TileType = (ushort)ModContent.TileType(); - tile.WallType = (ushort)ModContent.WallType(); - } - else if (abyssIndex2 > (rockLayer + y * 0.145)) - { - if (WorldGen.genRand.NextBool(3)) - { - tile.TileType = (ushort)ModContent.TileType(); - } - else - { - tile.TileType = (ushort)ModContent.TileType(); - } - tile.WallType = (ushort)ModContent.WallType(); } else { tile.TileType = (ushort)ModContent.TileType(); + } + + tile.WallType = (ushort)ModContent.WallType(); + } + else if (abyssIndex2 >= rockLayer - 20 && abyssIndex2 <= rockLayer) + { + if (WorldGen.genRand.NextBool(2)) + { + WorldGen.PlaceTile(abyssIndex, abyssIndex2, ModContent.TileType()); + tile.TileType = (ushort)ModContent.TileType(); tile.WallType = (ushort)ModContent.WallType(); } + else + { + WorldGen.PlaceTile(abyssIndex, abyssIndex2, ModContent.TileType()); + tile.TileType = (ushort)ModContent.TileType(); + tile.WallType = (ushort)ModContent.WallType(); + } + } + else if (abyssIndex2 <= rockLayer - 20) + { + tile.TileType = (ushort)ModContent.TileType(); + tile.WallType = (ushort)ModContent.WallType(); + } + else + { + tile.TileType = (ushort)ModContent.TileType(); + tile.WallType = (ushort)ModContent.WallType(); + } + } + else if (!tile.HasTile) + { + tile.Get().HasTile = true; + if (abyssIndex2 > (rockLayer + y * 0.262)) + { + tile.TileType = (ushort)ModContent.TileType(); + tile.WallType = (ushort)ModContent.WallType(); + } + else if (abyssIndex2 > (rockLayer + y * 0.142) && WorldGen.genRand.NextBool(3)) + { + tile.TileType = (ushort)ModContent.TileType(); + tile.WallType = (ushort)ModContent.WallType(); + } + else if (abyssIndex2 > (rockLayer + y * 0.145)) + { + if (WorldGen.genRand.NextBool(3)) + { + tile.TileType = (ushort)ModContent.TileType(); + } + else + { + tile.TileType = (ushort)ModContent.TileType(); + } + + tile.WallType = (ushort)ModContent.WallType(); + } + else if (abyssIndex2 >= rockLayer - 20 && abyssIndex2 <= rockLayer) + { + if (WorldGen.genRand.NextBool(2)) + { + WorldGen.PlaceTile(abyssIndex, abyssIndex2, ModContent.TileType()); + tile.TileType = (ushort)ModContent.TileType(); + tile.WallType = (ushort)ModContent.WallType(); + } + else + { + WorldGen.PlaceTile(abyssIndex, abyssIndex2, ModContent.TileType()); + tile.TileType = (ushort)ModContent.TileType(); + tile.WallType = (ushort)ModContent.WallType(); + } + } + else if (abyssIndex2 <= rockLayer - 20) + { + tile.TileType = (ushort)ModContent.TileType(); + tile.WallType = (ushort)ModContent.WallType(); + } + else + { + tile.TileType = (ushort)ModContent.TileType(); + tile.WallType = (ushort)ModContent.WallType(); } } } @@ -290,7 +227,10 @@ namespace CalamityMod.World } } - MiscWorldgenRoutines.ChasmGenerator(abyssChasmX, (int)WorldGen.worldSurfaceLow, AbyssChasmBottom, true); + //just place three craters next to each other to make it wider + MiscWorldgenRoutines.ChasmGenerator(abyssChasmX + 25, (int)WorldGen.worldSurfaceLow, AbyssChasmBottom, true); + MiscWorldgenRoutines.ChasmGenerator(abyssChasmX, (int)WorldGen.worldSurfaceLow + 65, AbyssChasmBottom, true); + MiscWorldgenRoutines.ChasmGenerator(abyssChasmX - 25, (int)WorldGen.worldSurfaceLow, AbyssChasmBottom, true); int maxAbyssIslands = 11; //Small World @@ -308,8 +248,8 @@ namespace CalamityMod.World bool placedFossil = false; //place islands to hide the fossil (funny) - AbyssIsland(abyssChasmX + 32, AbyssChasmBottom + 25, 55, 75, 35, 45, false, true, true); - AbyssIsland(abyssChasmX - 32, AbyssChasmBottom + 25, 55, 75, 35, 45, false, true, true); + AbyssIsland(abyssChasmX + 55, AbyssChasmBottom + 25, 55, 75, 55, 75, false, true, true, false); + AbyssIsland(abyssChasmX - 55, AbyssChasmBottom + 25, 55, 75, 55, 75, false, true, true, false); while (!placedFossil) { @@ -350,12 +290,42 @@ namespace CalamityMod.World } //place a single abyss island under the terminus shrine - AbyssIsland(abyssChasmX, AbyssChasmBottom + 5, 65, 75, 40, 45, false, false, true); + AbyssIsland(abyssChasmX, AbyssChasmBottom + 5, 65, 75, 40, 45, false, false, true, false); //place terminus shrine UndergroundShrines.SpecialHut((ushort)ModContent.TileType(), (ushort)ModContent.TileType(), (ushort)ModContent.WallType(), UndergroundShrines.UndergroundShrineType.Abyss, abyssChasmX, AbyssChasmBottom); + //place islands in the sulphuric depths layer + for (int sulphurIslandY = (rockLayer - Main.maxTilesY / 15) - 5; sulphurIslandY <= rockLayer - 15; sulphurIslandY++) + { + if (WorldGen.genRand.NextBool(2)) + { + int randomIsland = WorldGen.genRand.Next(4); + switch (randomIsland) + { + case 0: + AbyssIsland(abyssChasmX - WorldGen.genRand.Next(55, 78), sulphurIslandY, 55, 75, 35, 45, false, false, false, true); + break; + case 1: + AbyssIsland(abyssChasmX + WorldGen.genRand.Next(55, 78), sulphurIslandY, 55, 75, 35, 45, false, false, false, true); + break; + case 2: + AbyssIsland(abyssChasmX + WorldGen.genRand.Next(55, 78), sulphurIslandY, 55, 75, 35, 45, false, false, false, true); + AbyssIsland(abyssChasmX - WorldGen.genRand.Next(10, 20), sulphurIslandY, 55, 75, 35, 45, false, false, false, true); + break; + case 3: + AbyssIsland(abyssChasmX - WorldGen.genRand.Next(55, 78), sulphurIslandY, 55, 75, 35, 45, false, false, false, true); + AbyssIsland(abyssChasmX + WorldGen.genRand.Next(10, 20), sulphurIslandY, 55, 75, 35, 45, false, false, false, true); + break; + } + + //increase y value so islands cant be spammed on top of each other + sulphurIslandY += 12; + } + } + + //normal abyss islands int islandLocationOffset = 30; int islandLocationY = rockLayer; @@ -365,35 +335,36 @@ namespace CalamityMod.World int randomIsland = WorldGen.genRand.Next(5); //0 1 2 3 4 bool hasVoidstone = islandLocationY > (rockLayer + y * 0.143); AbyssIslandPositions[TotalPlacedIslandsSoFar].Y = islandLocationY; + int randomPositon = WorldGen.genRand.Next(38, 65); switch (randomIsland) { case 0: - AbyssIsland(islandLocationX, islandLocationY, 60, 66, 30, 36, true, false, hasVoidstone); - AbyssIsland(islandLocationX + 40, islandLocationY + 15, 60, 66, 30, 36, false, plantyMushSide, hasVoidstone); - AbyssIsland(islandLocationX - 40, islandLocationY + 15, 60, 66, 30, 36, false, !plantyMushSide, hasVoidstone); + AbyssIsland(islandLocationX, islandLocationY, 60, 66, 30, 36, true, false, hasVoidstone, false); + AbyssIsland(islandLocationX + randomPositon, islandLocationY + 15, 60, 66, 30, 36, false, plantyMushSide, hasVoidstone, false); + AbyssIsland(islandLocationX - randomPositon, islandLocationY + 15, 60, 66, 30, 36, false, !plantyMushSide, hasVoidstone, false); break; case 1: - AbyssIsland(islandLocationX + 30, islandLocationY, 60, 66, 30, 36, true, false, hasVoidstone); - AbyssIsland(islandLocationX, islandLocationY + 15, 60, 66, 30, 36, false, plantyMushSide, hasVoidstone); - AbyssIsland(islandLocationX - 40, islandLocationY + 10, 60, 66, 30, 36, false, !plantyMushSide, hasVoidstone); + AbyssIsland(islandLocationX + randomPositon, islandLocationY, 60, 66, 30, 36, true, false, hasVoidstone, false); + AbyssIsland(islandLocationX, islandLocationY + 15, 60, 66, 30, 36, false, plantyMushSide, hasVoidstone, false); + AbyssIsland(islandLocationX - randomPositon, islandLocationY + 10, 60, 66, 30, 36, false, !plantyMushSide, hasVoidstone, false); islandLocationX += 30; break; case 2: - AbyssIsland(islandLocationX - 30, islandLocationY, 60, 66, 30, 36, true, false, hasVoidstone); - AbyssIsland(islandLocationX + 30, islandLocationY + 10, 60, 66, 30, 36, false, plantyMushSide, hasVoidstone); - AbyssIsland(islandLocationX, islandLocationY + 15, 60, 66, 30, 36, false, !plantyMushSide, hasVoidstone); + AbyssIsland(islandLocationX - randomPositon, islandLocationY, 60, 66, 30, 36, true, false, hasVoidstone, false); + AbyssIsland(islandLocationX + randomPositon, islandLocationY + 10, 60, 66, 30, 36, false, plantyMushSide, hasVoidstone, false); + AbyssIsland(islandLocationX, islandLocationY + 15, 60, 66, 30, 36, false, !plantyMushSide, hasVoidstone, false); islandLocationX -= 30; break; case 3: - AbyssIsland(islandLocationX + 25, islandLocationY, 60, 66, 30, 36, true, false, hasVoidstone); - AbyssIsland(islandLocationX - 5, islandLocationY + 5, 60, 66, 30, 36, false, plantyMushSide, hasVoidstone); - AbyssIsland(islandLocationX - 35, islandLocationY + 15, 60, 66, 30, 36, false, !plantyMushSide, hasVoidstone); + AbyssIsland(islandLocationX + randomPositon, islandLocationY, 60, 66, 30, 36, true, false, hasVoidstone, false); + AbyssIsland(islandLocationX - 5, islandLocationY + 5, 60, 66, 30, 36, false, plantyMushSide, hasVoidstone, false); + AbyssIsland(islandLocationX - randomPositon, islandLocationY + 15, 60, 66, 30, 36, false, !plantyMushSide, hasVoidstone, false); islandLocationX += 25; break; case 4: - AbyssIsland(islandLocationX - 25, islandLocationY, 60, 66, 30, 36, true, false, hasVoidstone); - AbyssIsland(islandLocationX + 5, islandLocationY + 15, 60, 66, 30, 36, false, plantyMushSide, hasVoidstone); - AbyssIsland(islandLocationX + 35, islandLocationY + 5, 60, 66, 30, 36, false, !plantyMushSide, hasVoidstone); + AbyssIsland(islandLocationX - randomPositon, islandLocationY, 60, 66, 30, 36, true, false, hasVoidstone, false); + AbyssIsland(islandLocationX + 5, islandLocationY + 15, 60, 66, 30, 36, false, plantyMushSide, hasVoidstone, false); + AbyssIsland(islandLocationX + randomPositon, islandLocationY + 5, 60, 66, 30, 36, false, !plantyMushSide, hasVoidstone, false); islandLocationX -= 25; break; } @@ -415,14 +386,14 @@ namespace CalamityMod.World switch (randomIsland) { case 0: - AbyssIsland(abyssChasmX + WorldGen.genRand.Next(42, 48), voidIslandY, 55, 75, 35, 45, false, true, true); + AbyssIsland(abyssChasmX + WorldGen.genRand.Next(60, 78), voidIslandY, 65, 85, 35, 45, false, true, true, false); break; case 1: - AbyssIsland(abyssChasmX - WorldGen.genRand.Next(42, 48), voidIslandY, 55, 75, 35, 45, false, true, true); + AbyssIsland(abyssChasmX - WorldGen.genRand.Next(60, 78), voidIslandY, 65, 85, 35, 45, false, true, true, false); break; case 2: - AbyssIsland(abyssChasmX + WorldGen.genRand.Next(42, 48), voidIslandY, 55, 75, 35, 45, false, true, true); - AbyssIsland(abyssChasmX - WorldGen.genRand.Next(42, 48), voidIslandY, 55, 75, 35, 45, false, true, true); + AbyssIsland(abyssChasmX + WorldGen.genRand.Next(60, 78), voidIslandY, 65, 85, 35, 45, false, true, true, false); + AbyssIsland(abyssChasmX - WorldGen.genRand.Next(60, 78), voidIslandY, 65, 85, 35, 45, false, true, true, false); break; } @@ -434,93 +405,58 @@ namespace CalamityMod.World AbyssItemArray = CalamityUtils.ShuffleArray(AbyssItemArray); for (int abyssHouse = 0; abyssHouse < TotalPlacedIslandsSoFar; abyssHouse++) //11 15 19 { + bool hasVoidstone = AbyssIslandPositions[abyssHouse].Y + 5 > (rockLayer + y * 0.143); + if (abyssHouse != 20) { + //place an island below the houses + //place the island first so it doesnt destroy the house or chest + AbyssIsland(AbyssIslandPositions[abyssHouse].X, AbyssIslandPositions[abyssHouse].Y + 15, 55, 75, 35, 45, false, true, hasVoidstone, false); + AbyssIslandHouse(AbyssIslandPositions[abyssHouse].X, AbyssIslandPositions[abyssHouse].Y, AbyssItemArray[abyssHouse > 9 ? (abyssHouse - 10) : abyssHouse], //10 choices 0 to 9 - AbyssIslandPositions[abyssHouse].Y > (rockLayer + y * 0.143)); + hasVoidstone); } } //clean up - if (AtLeftSideOfWorld) + for (int abyssIndex = abyssMinX + 5; abyssIndex < abyssMaxX - 5; abyssIndex++) { - for (int abyssIndex = 5; abyssIndex < abyssChasmX + 80; abyssIndex++) //235 + for (int abyssIndex2 = 5; abyssIndex2 < abyssChasmY; abyssIndex2++) { - for (int abyssIndex2 = 5; abyssIndex2 < abyssChasmY; abyssIndex2++) + 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]; + + if (tile.TileType == ModContent.TileType() || tile.TileType == ModContent.TileType() || + tile.TileType == ModContent.TileType() || tile.TileType == ModContent.TileType() || + tile.TileType == ModContent.TileType()) { - 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]; + //slope tiles + Tile.SmoothSlope(abyssIndex, abyssIndex2, true); - if (tile.TileType == ModContent.TileType() || tile.TileType == ModContent.TileType() || - tile.TileType == ModContent.TileType() || tile.TileType == ModContent.TileType()) - { - //slope tiles - Tile.SmoothSlope(abyssIndex, abyssIndex2, true); - - //kill any individual floating tiles - if (!tileUp.HasTile && !tileDown.HasTile && !tileLeft.HasTile && !tileRight.HasTile) - { - WorldGen.KillTile(abyssIndex, abyssIndex2); - } - } - - if (!tile.HasTile && (tile.WallType == ModContent.WallType() || tile.WallType == ModContent.WallType())) - { - //fill up any air pockets with water - tile.LiquidType = LiquidID.Water; - tile.LiquidAmount = 255; - } - - //kill obsidian - if (tile.TileType == TileID.Obsidian) + //kill any individual floating tiles + if (!tileUp.HasTile && !tileDown.HasTile && !tileLeft.HasTile && !tileRight.HasTile) { WorldGen.KillTile(abyssIndex, abyssIndex2); } } - } - } - else - { - for (int abyssIndex = abyssChasmX - 80; abyssIndex < x - 5; abyssIndex++) //3965 - { - for (int abyssIndex2 = 5; abyssIndex2 < abyssChasmY; abyssIndex2++) + + if (!tile.HasTile && (tile.WallType == ModContent.WallType() || tile.WallType == ModContent.WallType() || + tile.WallType == ModContent.WallType())) { - 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]; + //fill up any air pockets with water + tile.LiquidType = LiquidID.Water; + tile.LiquidAmount = 255; + } - if (tile.TileType == ModContent.TileType() || tile.TileType == ModContent.TileType() || - tile.TileType == ModContent.TileType() || tile.TileType == ModContent.TileType()) - { - //slope tiles - Tile.SmoothSlope(abyssIndex, abyssIndex2, true); - - //kill any individual floating tiles - if (!tileUp.HasTile && !tileDown.HasTile && !tileLeft.HasTile && !tileRight.HasTile) - { - WorldGen.KillTile(abyssIndex, abyssIndex2); - } - } - - if (!tile.HasTile && (tile.WallType == ModContent.WallType() || tile.WallType == ModContent.WallType())) - { - //fill up any air pockets with water - tile.LiquidType = LiquidID.Water; - tile.LiquidAmount = 255; - } - - //kill obsidian - if (tile.TileType == TileID.Obsidian) - { - WorldGen.KillTile(abyssIndex, abyssIndex2); - } + //kill obsidian + if (tile.TileType == TileID.Obsidian) + { + WorldGen.KillTile(abyssIndex, abyssIndex2); } } } @@ -543,7 +479,7 @@ namespace CalamityMod.World if (Mosses.Contains(tile.TileType)) { - tile.TileType = TileID.Stone; + WorldGen.KillTile(abyssIndex, abyssIndex2); } } } @@ -565,140 +501,92 @@ namespace CalamityMod.World if (Mosses.Contains(tile.TileType)) { - tile.TileType = TileID.Stone; + WorldGen.KillTile(abyssIndex, abyssIndex2); } } } } //ambient tiles and pots - if (AtLeftSideOfWorld) + for (int abyssIndex = abyssMinX + 5; abyssIndex < abyssMaxX - 5; abyssIndex++) { - for (int abyssIndex = 0; abyssIndex < abyssChasmX + 80; abyssIndex++) //235 + for (int abyssIndex2 = 0; abyssIndex2 < abyssChasmY; abyssIndex2++) { - for (int abyssIndex2 = 0; abyssIndex2 < abyssChasmY; abyssIndex2++) + if (!Main.tile[abyssIndex, abyssIndex2].HasTile) { - if (!Main.tile[abyssIndex, abyssIndex2].HasTile) + //above the 4th layer + if (abyssIndex2 < (int)(rockLayer + y * 0.262) && WorldGen.SolidTile(abyssIndex, abyssIndex2 + 1)) { - //above the 4th layer - if (abyssIndex2 < (int)(rockLayer + y * 0.262) && WorldGen.SolidTile(abyssIndex, abyssIndex2 + 1)) + //giant kelp, more often in upper layers + if ((WorldGen.genRand.NextBool(18) && Main.tile[abyssIndex, abyssIndex2 + 1].TileType == ModContent.TileType()) || + (WorldGen.genRand.NextBool(35) && Main.tile[abyssIndex, abyssIndex2 + 1].TileType == ModContent.TileType())) { - //giant kelp, more often in upper layers - if ((WorldGen.genRand.NextBool(18) && Main.tile[abyssIndex, abyssIndex2 + 1].TileType == ModContent.TileType()) || - (WorldGen.genRand.NextBool(35) && Main.tile[abyssIndex, abyssIndex2 + 1].TileType == ModContent.TileType())) - { - ushort[] Kelps = new ushort[] { (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), - (ushort)ModContent.TileType(), (ushort)ModContent.TileType() }; + ushort[] Kelps = new ushort[] { (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), + (ushort)ModContent.TileType(), (ushort)ModContent.TileType() }; - WorldGen.PlaceObject(abyssIndex, abyssIndex2, WorldGen.genRand.Next(Kelps)); - } - - //bulb trees on voidstone - if (WorldGen.genRand.NextBool(25) && Main.tile[abyssIndex, abyssIndex2 + 1].TileType == ModContent.TileType()) - { - ushort[] BulbTrees = new ushort[] { (ushort)ModContent.TileType(), - (ushort)ModContent.TileType(), (ushort)ModContent.TileType() }; - - WorldGen.PlaceObject(abyssIndex, abyssIndex2, WorldGen.genRand.Next(BulbTrees)); - } + WorldGen.PlaceObject(abyssIndex, abyssIndex2, WorldGen.genRand.Next(Kelps)); } - //below 4th layer - if (abyssIndex2 >= (int)(rockLayer + y * 0.262) && WorldGen.SolidTile(abyssIndex, abyssIndex2 + 1)) + //bulb trees on voidstone + if (WorldGen.genRand.NextBool(25) && Main.tile[abyssIndex, abyssIndex2 + 1].TileType == ModContent.TileType()) { - //bulb trees on voidstone - if (WorldGen.genRand.NextBool(6) && Main.tile[abyssIndex, abyssIndex2 + 1].TileType == ModContent.TileType()) - { - ushort[] BulbTrees = new ushort[] { (ushort)ModContent.TileType(), - (ushort)ModContent.TileType(), (ushort)ModContent.TileType() }; + ushort[] BulbTrees = new ushort[] { (ushort)ModContent.TileType(), + (ushort)ModContent.TileType(), (ushort)ModContent.TileType() }; - WorldGen.PlaceObject(abyssIndex, abyssIndex2, WorldGen.genRand.Next(BulbTrees)); - } + WorldGen.PlaceObject(abyssIndex, abyssIndex2, WorldGen.genRand.Next(BulbTrees)); } - //pots - if (WorldGen.SolidTile(abyssIndex, abyssIndex2 + 1) && abyssIndex2 > rockLayer) + //sulphur shale stuff + if (Main.tile[abyssIndex, abyssIndex2 + 1].TileType == ModContent.TileType()) { - if (WorldGen.genRand.NextBool(5)) + if (WorldGen.genRand.NextBool(8)) { - WorldGen.PlacePot(abyssIndex, abyssIndex2, (ushort)ModContent.TileType()); - CalamityUtils.SafeSquareTileFrame(abyssIndex, abyssIndex2, true); + ushort[] SulphuricFossils = new ushort[] { (ushort)ModContent.TileType(), + (ushort)ModContent.TileType(), (ushort)ModContent.TileType() }; + + WorldGen.PlaceObject(abyssIndex, abyssIndex2, WorldGen.genRand.Next(SulphuricFossils)); } - } - //sulphur pots - else if (WorldGen.SolidTile(abyssIndex, abyssIndex2 + 1) && abyssIndex2 < (int)Main.worldSurface) - { - if (WorldGen.genRand.NextBool(3)) + + if (WorldGen.genRand.NextBool(6)) { - WorldGen.PlacePot(abyssIndex, abyssIndex2, (ushort)ModContent.TileType()); - CalamityUtils.SafeSquareTileFrame(abyssIndex, abyssIndex2, true); + ushort[] Ribs = new ushort[] { (ushort)ModContent.TileType(), + (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), + (ushort)ModContent.TileType(), (ushort)ModContent.TileType() }; + + WorldGen.PlaceObject(abyssIndex, abyssIndex2, WorldGen.genRand.Next(Ribs)); } } } - } - } - } - else - { - for (int abyssIndex = abyssChasmX - 80; abyssIndex < x; abyssIndex++) //3965 - { - for (int abyssIndex2 = 0; abyssIndex2 < abyssChasmY; abyssIndex2++) - { - if (!Main.tile[abyssIndex, abyssIndex2].HasTile) + + //below 4th layer + if (abyssIndex2 >= (int)(rockLayer + y * 0.262) && WorldGen.SolidTile(abyssIndex, abyssIndex2 + 1)) { - //above the 4th layer - if (abyssIndex2 < (int)(rockLayer + y * 0.262) && WorldGen.SolidTile(abyssIndex, abyssIndex2 + 1)) + //bulb trees on voidstone + if (WorldGen.genRand.NextBool(6) && Main.tile[abyssIndex, abyssIndex2 + 1].TileType == ModContent.TileType()) { - //giant kelp, more often in upper layers - if ((WorldGen.genRand.NextBool(18) && Main.tile[abyssIndex, abyssIndex2 + 1].TileType == ModContent.TileType()) || - (WorldGen.genRand.NextBool(35) && Main.tile[abyssIndex, abyssIndex2 + 1].TileType == ModContent.TileType())) - { - ushort[] Kelps = new ushort[] { (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), - (ushort)ModContent.TileType(), (ushort)ModContent.TileType() }; + ushort[] BulbTrees = new ushort[] { (ushort)ModContent.TileType(), + (ushort)ModContent.TileType(), (ushort)ModContent.TileType() }; - WorldGen.PlaceObject(abyssIndex, abyssIndex2, WorldGen.genRand.Next(Kelps)); - } - - //bulb trees on voidstone - if (WorldGen.genRand.NextBool(25) && Main.tile[abyssIndex, abyssIndex2 + 1].TileType == ModContent.TileType()) - { - ushort[] BulbTrees = new ushort[] { (ushort)ModContent.TileType(), - (ushort)ModContent.TileType(), (ushort)ModContent.TileType() }; - - WorldGen.PlaceObject(abyssIndex, abyssIndex2, WorldGen.genRand.Next(BulbTrees)); - } + WorldGen.PlaceObject(abyssIndex, abyssIndex2, WorldGen.genRand.Next(BulbTrees)); } + } - //below 4th layer - if (abyssIndex2 >= (int)(rockLayer + y * 0.262) && WorldGen.SolidTile(abyssIndex, abyssIndex2 + 1)) + //pots + if (WorldGen.SolidTile(abyssIndex, abyssIndex2 + 1) && abyssIndex2 > rockLayer) + { + if (WorldGen.genRand.NextBool(5)) { - //bulb trees on voidstone - if (WorldGen.genRand.NextBool(6) && Main.tile[abyssIndex, abyssIndex2 + 1].TileType == ModContent.TileType()) - { - ushort[] BulbTrees = new ushort[] { (ushort)ModContent.TileType(), - (ushort)ModContent.TileType(), (ushort)ModContent.TileType() }; - - WorldGen.PlaceObject(abyssIndex, abyssIndex2, WorldGen.genRand.Next(BulbTrees)); - } + WorldGen.PlacePot(abyssIndex, abyssIndex2, (ushort)ModContent.TileType()); + CalamityUtils.SafeSquareTileFrame(abyssIndex, abyssIndex2, true); } - - //pots - if (WorldGen.SolidTile(abyssIndex, abyssIndex2 + 1) && abyssIndex2 > rockLayer) + } + //sulphur pots + else if (WorldGen.SolidTile(abyssIndex, abyssIndex2 + 1) && abyssIndex2 < (int)Main.worldSurface) + { + if (WorldGen.genRand.NextBool(3)) { - if (WorldGen.genRand.NextBool(5)) - { - WorldGen.PlacePot(abyssIndex, abyssIndex2, (ushort)ModContent.TileType()); - CalamityUtils.SafeSquareTileFrame(abyssIndex, abyssIndex2, true); - } - } - //sulphur pots - else if (WorldGen.SolidTile(abyssIndex, abyssIndex2 + 1) && abyssIndex2 < (int)Main.worldSurface) - { - if (WorldGen.genRand.NextBool(3)) - { - WorldGen.PlacePot(abyssIndex, abyssIndex2, (ushort)ModContent.TileType()); - CalamityUtils.SafeSquareTileFrame(abyssIndex, abyssIndex2, true); - } + WorldGen.PlacePot(abyssIndex, abyssIndex2, (ushort)ModContent.TileType()); + CalamityUtils.SafeSquareTileFrame(abyssIndex, abyssIndex2, true); } } } @@ -707,7 +595,7 @@ namespace CalamityMod.World } #region Houses - public static void AbyssIsland(int i, int j, int sizeMin, int sizeMax, int sizeMin2, int sizeMax2, bool hasChest, bool hasPlantyMush, bool isVoid) + public static void AbyssIsland(int i, int j, int sizeMin, int sizeMax, int sizeMin2, int sizeMax2, bool hasChest, bool hasPlantyMush, bool isVoid, bool isShale) { float islandWidth = WorldGen.genRand.Next(sizeMin, sizeMax); //100 150 float smallIslandWidth = (float)WorldGen.genRand.Next(sizeMin, sizeMax) / (float)5; //20 30 @@ -777,7 +665,16 @@ namespace CalamityMod.World islandPositionY = l; } Main.tile[k, l].Get().HasTile = true; - Main.tile[k, l].TileType = (ushort)(isVoid ? ModContent.TileType() : ModContent.TileType()); + + if (!isShale) + { + Main.tile[k, l].TileType = (ushort)(isVoid ? ModContent.TileType() : ModContent.TileType()); + } + else + { + Main.tile[k, l].TileType = (ushort)ModContent.TileType(); + } + CalamityUtils.SafeSquareTileFrame(k, l, true); } } @@ -814,6 +711,7 @@ namespace CalamityMod.World num14 += WorldGen.genRand.Next(-3, 4); num15 = WorldGen.genRand.Next(4, 8); int num16 = isVoid ? ModContent.TileType() : ModContent.TileType(); + if (WorldGen.genRand.NextBool(4)) { num16 = hasChest ? ModContent.TileType() : ModContent.TileType(); @@ -829,7 +727,16 @@ namespace CalamityMod.World if (Math.Sqrt((double)(arg_409_0 * arg_409_0 + num18 * num18)) < (double)(num15 + WorldGen.genRand.Next(2))) { Main.tile[n, num17].Get().HasTile = true; - Main.tile[n, num17].TileType = (ushort)num16; + + if (!isShale) + { + Main.tile[n, num17].TileType = (ushort)num16; + } + else + { + Main.tile[n, num17].TileType = (ushort)ModContent.TileType(); + } + CalamityUtils.SafeSquareTileFrame(n, num17, true); } } diff --git a/World/AstralBiome.cs b/World/AstralBiome.cs index b10e3feb36..299432d374 100644 --- a/World/AstralBiome.cs +++ b/World/AstralBiome.cs @@ -57,12 +57,12 @@ namespace CalamityMod.World while (y < Main.worldSurface) { if (Main.tile[x, y].HasTile && - (Main.tile[x, y].TileType == ModContent.TileType() || Main.tile[x, y].TileType == ModContent.TileType() || - Main.tile[x, y].TileType == ModContent.TileType() || Main.tile[x, y].TileType == ModContent.TileType() || - Main.tile[x, y].TileType == ModContent.TileType() || Main.tile[x, y].TileType == ModContent.TileType() || - Main.tile[x, y].TileType == ModContent.TileType() || Main.tile[x, y].TileType == ModContent.TileType() || - Main.tile[x, y].TileType == ModContent.TileType() || Main.tile[x, y].TileType == ModContent.TileType() || - Main.tile[x, y].TileType == ModContent.TileType() || Main.tile[x, y].TileType == ModContent.TileType())) + (Main.tile[x, y].TileType == ModContent.TileType() || Main.tile[x, y].TileType == ModContent.TileType() || + Main.tile[x, y].TileType == ModContent.TileType() || Main.tile[x, y].TileType == ModContent.TileType() || + Main.tile[x, y].TileType == ModContent.TileType() || Main.tile[x, y].TileType == ModContent.TileType() || + Main.tile[x, y].TileType == ModContent.TileType() || Main.tile[x, y].TileType == ModContent.TileType() || + Main.tile[x, y].TileType == ModContent.TileType() || Main.tile[x, y].TileType == ModContent.TileType() || + Main.tile[x, y].TileType == ModContent.TileType() || Main.tile[x, y].TileType == ModContent.TileType())) { 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 - 400) : rand.Next(xLimit + 400, 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() || Main.tile[l, m].TileType == ModContent.TileType()) { 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; diff --git a/World/BrimstoneCrag.cs b/World/BrimstoneCrag.cs index 90da436b8e..86f1ca7b38 100644 --- a/World/BrimstoneCrag.cs +++ b/World/BrimstoneCrag.cs @@ -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() && !tileUp.HasTile && tileUp.LiquidAmount == 0) - { - tile.TileType = (ushort)ModContent.TileType(); - } - - 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() && !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() && !tileUp.HasTile && tileUp.LiquidAmount == 0) + { + tile.TileType = (ushort)ModContent.TileType(); + } + } + } } //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()) @@ -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()) + { + //place them often since they are pretty big tiles, also dont place them in lava + if (WorldGen.genRand.Next(3) == 0) { - TreeDelay--; + ushort[] Lillies = new ushort[] { (ushort)ModContent.TileType(), + (ushort)ModContent.TileType(), (ushort)ModContent.TileType() }; + + 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()) + { //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()); } } } } } + 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) { /* diff --git a/World/MiscWorldgenRoutines.cs b/World/MiscWorldgenRoutines.cs index ab1a5d1412..0d90b261cf 100644 --- a/World/MiscWorldgenRoutines.cs +++ b/World/MiscWorldgenRoutines.cs @@ -214,128 +214,6 @@ namespace CalamityMod.World } #endregion - /* - #region UnderworldIslandHouse - public static void UnderworldIslandHouse(int i, int j, int item) - { - ushort type = (ushort)ModContent.TileType(); //tile - int wall = ModContent.WallType(); //wall - Vector2 vector = new Vector2((float)i, (float)j); - int num = 1; - if (WorldGen.genRand.Next(2) == 0) - { - num = -1; - } - int num2 = WorldGen.genRand.Next(7, 12); - int num3 = WorldGen.genRand.Next(5, 7); - vector.X = (float)(i + (num2 + 2) * num); - for (int k = j - 15; k < j + 30; k++) - { - if (Main.tile[(int)vector.X, k].HasTile) - { - vector.Y = (float)(k - 1); - break; - } - } - vector.X = (float)i; - int num4 = (int)(vector.X - (float)num2 - 1f); - int num5 = (int)(vector.X + (float)num2 + 1f); - int num6 = (int)(vector.Y - (float)num3 - 1f); - int num7 = (int)(vector.Y + 2f); - if (num4 < 0) - { - num4 = 0; - } - if (num5 > Main.maxTilesX) - { - num5 = Main.maxTilesX; - } - if (num6 < 0) - { - num6 = 0; - } - if (num7 > Main.maxTilesY) - { - num7 = Main.maxTilesY; - } - for (int l = num4; l <= num5; l++) - { - for (int m = num6 - 1; m < num7 + 1; m++) - { - if (m != num6 - 1 || (l != num4 && l != num5)) - { - Main.tile[l, m].Get().HasTile = true; - Main.tile[l, m].LiquidAmount = 0; - Main.tile[l, m].TileType = type; - Main.tile[l, m].WallType = 0; - Main.tile[l, m].Get().IsHalfBlock = false; - Main.tile[l, m].Get().Slope = SlopeType.Solid; - } - } - } - num4 = (int)(vector.X - (float)num2); - num5 = (int)(vector.X + (float)num2); - num6 = (int)(vector.Y - (float)num3); - num7 = (int)(vector.Y + 1f); - if (num4 < 0) - { - num4 = 0; - } - if (num5 > Main.maxTilesX) - { - num5 = Main.maxTilesX; - } - if (num6 < 0) - { - num6 = 0; - } - if (num7 > Main.maxTilesY) - { - num7 = Main.maxTilesY; - } - for (int n = num4; n <= num5; n++) - { - for (int num8 = num6; num8 < num7; num8++) - { - if ((num8 != num6 || (n != num4 && n != num5)) && Main.tile[n, num8].WallType == 0) - { - Main.tile[n, num8].Get().HasTile = false; - Main.tile[n, num8].WallType = (ushort)wall; - } - } - } - int num9 = i + (num2 + 1) * num; - int num10 = (int)vector.Y; - for (int num11 = num9 - 2; num11 <= num9 + 2; num11++) - { - Main.tile[num11, num10].Get().HasTile = false; - Main.tile[num11, num10 - 1].Get().HasTile = false; - Main.tile[num11, num10 - 2].Get().HasTile = false; - } - WorldGen.PlaceTile(num9, num10, ModContent.TileType(), true, false, -1); //door - num9 = i + (num2 + 1) * -num - num; - for (int num12 = num6; num12 <= num7 + 1; num12++) - { - Main.tile[num9, num12].Get().HasTile = true; - Main.tile[num9, num12].LiquidAmount = 0; - Main.tile[num9, num12].TileType = type; - Main.tile[num9, num12].WallType = 0; - Main.tile[num9, num12].Get().IsHalfBlock = false; - Main.tile[num9, num12].Get().Slope = SlopeType.Solid; - } - WorldGen.AddBuriedChest(i, num10 - 3, item, false, 4); //chest - int num22 = i + (num2 / 2 + 1) * -num; - WorldGen.PlaceTile(num22, num7 - 1, ModContent.TileType(), true, false, -1); //table - WorldGen.PlaceTile(num22 - 2, num7 - 1, ModContent.TileType(), true, false, 0); //chair - Tile tile = Main.tile[num22 - 2, num7 - 1]; - tile.TileFrameX += 18; - Tile tile2 = Main.tile[num22 - 2, num7 - 2]; - tile2.TileFrameX += 18; - WorldGen.PlaceTile(num22 + 2, num7 - 1, ModContent.TileType(), true, false, 0); //chair - } - #endregion - */ - #region ChasmGenerator public static void ChasmGenerator(int i, int j, int steps, bool ocean = false) { diff --git a/World/SulphurousSea.cs b/World/SulphurousSea.cs index b06f86f7fe..75cf866050 100644 --- a/World/SulphurousSea.cs +++ b/World/SulphurousSea.cs @@ -313,7 +313,7 @@ namespace CalamityMod.World for (int y = top; y < bottom; y++) { if (y >= top + DepthForWater) - Main.tile[x, y + WorldGen.genRand.Next(15, 17)].WallType = (ushort)ModContent.WallType(); + Main.tile[x, y + WorldGen.genRand.Next(22, 25)].WallType = (ushort)ModContent.WallType(); Main.tile[x, y].LiquidAmount = byte.MaxValue; Main.tile[x, y].Get().HasTile = false; } @@ -867,7 +867,7 @@ namespace CalamityMod.World // Try again if there is no tile above or the ceiling is not level. if (!WorldUtils.Find(new(x, y), searchCondition, out Point top) || - !WorldUtils.Find(new(x + 1, y), searchCondition, out Point topRight) || top.Y != topRight.Y) + !WorldUtils.Find(new(x + 1, y), searchCondition, out Point topRight) || top.Y != topRight.Y) { tryAgain = true; } @@ -882,7 +882,10 @@ namespace CalamityMod.World continue; } - GenerateColumn(x, top.Y, y); + if (WorldGen.genRand.NextBool(2)) + { + GenerateColumn(x, top.Y, y); + } } } @@ -983,7 +986,7 @@ namespace CalamityMod.World if (WorldGen.InWorld(x + dx, y + dy)) { if (CalamityUtils.ParanoidTileRetrieval(x + dx, y + dy).TileType != sandstoneID && - SulphSeaTiles.Contains(CalamityUtils.ParanoidTileRetrieval(x + dx, y + dy).TileType)) + SulphSeaTiles.Contains(CalamityUtils.ParanoidTileRetrieval(x + dx, y + dy).TileType)) { Main.tile[x + dx, y + dy].WallType = sandstoneWallID; Main.tile[x + dx, y + dy].TileType = sandstoneID; @@ -1029,9 +1032,12 @@ namespace CalamityMod.World type++; int height = heightFromType(type); - PlaceStalactite(x, y, height, CalamityMod.Instance.Find($"SulphurousStalactite{type}").Type); - if (WorldGen.SolidTile(x, y + dy + 1)) + if ((Main.tile[x, y + dy + 1].TileType == ModContent.TileType() || + Main.tile[x, y + dy + 1].TileType == ModContent.TileType()) && + !Main.tile[x, y + dy + 1].LeftSlope && !Main.tile[x, y + dy + 1].RightSlope && !Main.tile[x, y + dy + 1].IsHalfBlock) + { PlaceStalacmite(x, y + dy, height, CalamityMod.Instance.Find($"SulphurousStalacmite{type}").Type); + } } } } diff --git a/build.txt b/build.txt index b8e27991ea..498ccb29d4 100644 --- a/build.txt +++ b/build.txt @@ -1,5 +1,5 @@ author = Fabsol and the Dev Team -version = 2.0.1.006 +version = 2.0.2.001 displayName = Calamity Mod homepage = https://discord.gg/calamity buildIgnore = .vs\*, Properties\*, *.csproj, *.user, obj\*, bin\*, *.config, .git\*, LICENSE, README.md, .editorconfig, .gitignore, .gitattributes