diff --git a/ILEditing/ILHelperMethods.cs b/ILEditing/ILHelperMethods.cs index d86e761bb3..f11c936e0a 100644 --- a/ILEditing/ILHelperMethods.cs +++ b/ILEditing/ILHelperMethods.cs @@ -149,41 +149,6 @@ namespace CalamityMod.ILEditing initialColor.BottomRightColor *= 0.4f; } - private static void SelectSunkenSeaWaterColor(int x, int y, ref VertexColors initialColor) - { - if (SulphuricWaterSafeZoneSystem.NearbySafeTiles.Count >= 1) - { - Color cleanWaterColor = new(10, 62, 193); - Point closestSafeZone = SulphuricWaterSafeZoneSystem.NearbySafeTiles.Keys.OrderBy(t => t.ToVector2().DistanceSQ(new(x, y))).First(); - List points = new() - { - new Vector2(x - 0.5f, y - 0.5f), - new Vector2(x + 0.5f, y - 0.5f), - new Vector2(x - 0.5f, y + 0.5f), - new Vector2(x + 0.5f, y + 0.5f), - }; - - for (int i = 0; i < 4; i++) - { - float distanceToClosest = points[i].Distance(closestSafeZone.ToVector2()); - float acidicWaterInterpolant = Utils.GetLerpValue(12f, 20.5f, distanceToClosest + (1f - SulphuricWaterSafeZoneSystem.NearbySafeTiles[closestSafeZone]) * 21f, true); - if (i == 0) - initialColor.TopLeftColor = Color.Lerp(initialColor.TopLeftColor, cleanWaterColor, 1f - acidicWaterInterpolant); - if (i == 1) - initialColor.TopRightColor = Color.Lerp(initialColor.TopRightColor, cleanWaterColor, 1f - acidicWaterInterpolant); - if (i == 2) - initialColor.BottomLeftColor = Color.Lerp(initialColor.BottomLeftColor, cleanWaterColor, 1f - acidicWaterInterpolant); - if (i == 3) - initialColor.BottomRightColor = Color.Lerp(initialColor.BottomRightColor, cleanWaterColor, 1f - acidicWaterInterpolant); - } - } - - initialColor.TopLeftColor *= 0.4f; - initialColor.TopRightColor *= 0.4f; - initialColor.BottomLeftColor *= 0.4f; - initialColor.BottomRightColor *= 0.4f; - } - public static void DumpToLog(ILContext il) => CalamityMod.Instance.Logger.Debug(il.ToString()); public static void LogFailure(string name, string reason) => CalamityMod.Instance.Logger.Warn($"IL edit \"{name}\" failed! {reason}"); } diff --git a/ILEditing/MechanicILChanges.cs b/ILEditing/MechanicILChanges.cs index bdd62df0aa..38dd4dd9cc 100644 --- a/ILEditing/MechanicILChanges.cs +++ b/ILEditing/MechanicILChanges.cs @@ -838,7 +838,10 @@ namespace CalamityMod.ILEditing SelectSulphuricWaterColor(x, y, ref initialColor); if (liquidType == ModContent.Find("CalamityMod/SunkenSeaWater").Slot) - SelectSunkenSeaWaterColor(x, y, ref initialColor); + SelectSulphuricWaterColor(x, y, ref initialColor); + + if (liquidType == ModContent.Find("CalamityMod/AbyssWater").Slot) + SelectSulphuricWaterColor(x, y, ref initialColor); // Apply any extra color conditions. initialColor = ExtraColorChangeConditions?.Invoke(initialColor, liquidType, new(x, y)) ?? initialColor; diff --git a/Tiles/Abyss/AbyssAmbient/AbyssKelp.cs b/Tiles/Abyss/AbyssAmbient/AbyssKelp.cs new file mode 100644 index 0000000000..f3c36b967a --- /dev/null +++ b/Tiles/Abyss/AbyssAmbient/AbyssKelp.cs @@ -0,0 +1,44 @@ +using CalamityMod.Dusts; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.GameContent.Metadata; +using Terraria.ID; +using Terraria.ModLoader; +using Terraria.ObjectData; + +namespace CalamityMod.Tiles.Abyss.AbyssAmbient +{ + public class AbyssKelp : ModTile + { + public override void SetStaticDefaults() + { + Main.tileCut[Type] = true; + Main.tileSolid[Type] = false; + Main.tileNoAttach[Type] = true; + Main.tileNoFail[Type] = true; + Main.tileLavaDeath[Type] = true; + Main.tileWaterDeath[Type] = true; + Main.tileFrameImportant[Type] = true; + TileID.Sets.ReplaceTileBreakUp[Type] = true; + TileID.Sets.SwaysInWindBasic[Type] = true; + TileMaterials.SetForTileId(Type, TileMaterials._materialsByName["Plant"]); + + TileObjectData.newTile.CopyFrom(TileObjectData.Style1x2); + TileObjectData.addTile(Type); + + DustType = 2; + HitSound = SoundID.Grass; + + AddMapEntry(new Color(0, 60, 0)); + + base.SetStaticDefaults(); + } + + public override void SetDrawPositions(int i, int j, ref int width, ref int offsetY, ref int height, ref short tileFrameX, ref short tileFrameY) + { + offsetY = -16; + height = 32; + } + } +} diff --git a/Tiles/Abyss/AbyssAmbient/AbyssKelp.png b/Tiles/Abyss/AbyssAmbient/AbyssKelp.png new file mode 100644 index 0000000000..daa85f81c5 Binary files /dev/null and b/Tiles/Abyss/AbyssAmbient/AbyssKelp.png differ diff --git a/Tiles/Abyss/AbyssAmbient/AbyssKelpGiant.cs b/Tiles/Abyss/AbyssAmbient/AbyssKelpGiant.cs new file mode 100644 index 0000000000..c9512c21b0 --- /dev/null +++ b/Tiles/Abyss/AbyssAmbient/AbyssKelpGiant.cs @@ -0,0 +1,41 @@ +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.Abyss.AbyssAmbient +{ + public class AbyssKelpGiant : ModTile + { + public override void SetStaticDefaults() + { + Main.tileFrameImportant[Type] = true; + Main.tileLighted[Type] = true; + Main.tileSolid[Type] = false; + TileObjectData.newTile.Width = 2; + TileObjectData.newTile.Height = 6; + TileObjectData.newTile.Origin = new Point16(1, 5); + TileObjectData.newTile.CoordinateHeights = new int[] { 16, 16, 16, 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 = 2; + TileObjectData.addTile(Type); + AddMapEntry(new Color(0, 80, 0)); + DustType = 2; + HitSound = SoundID.Grass; + } + + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) + { + r = 0.42f; + g = 0.35f; + b = 0f; + } + } +} \ No newline at end of file diff --git a/Tiles/Abyss/AbyssAmbient/AbyssKelpGiant.png b/Tiles/Abyss/AbyssAmbient/AbyssKelpGiant.png new file mode 100644 index 0000000000..9a5a6778ed Binary files /dev/null and b/Tiles/Abyss/AbyssAmbient/AbyssKelpGiant.png differ diff --git a/Tiles/Abyss/AbyssAmbient/AbyssStalactite.cs b/Tiles/Abyss/AbyssAmbient/AbyssStalactite.cs new file mode 100644 index 0000000000..adcb27b80e --- /dev/null +++ b/Tiles/Abyss/AbyssAmbient/AbyssStalactite.cs @@ -0,0 +1,35 @@ +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using Terraria.ObjectData; +using Terraria.DataStructures; +using Terraria.Enums; +using Terraria.Audio; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; + +namespace CalamityMod.Tiles.Abyss.AbyssAmbient +{ + public class AbyssStalactite : ModTile + { + public override void SetStaticDefaults() + { + Main.tileFrameImportant[Type] = true; + Main.tileSolid[Type] = false; + TileObjectData.newTile.Width = 2; + TileObjectData.newTile.Height = 3; + TileObjectData.newTile.Origin = new Point16(1, 1); + TileObjectData.newTile.CoordinateHeights = new int[] { 16, 16, 16 }; + TileObjectData.newTile.StyleWrapLimit = 36; + TileObjectData.newTile.AnchorTop = new AnchorData(AnchorType.SolidTile, TileObjectData.newTile.Width, 0); + TileObjectData.newTile.AnchorBottom = default(AnchorData); + TileObjectData.newTile.CoordinateWidth = 16; + TileObjectData.newTile.CoordinatePadding = 2; + TileObjectData.newTile.DrawYOffset = -2; + TileObjectData.addTile(Type); + AddMapEntry(new Color(5, 8, 34)); + HitSound = SoundID.Dig; + DustType = 33; + } + } +} \ No newline at end of file diff --git a/Tiles/Abyss/AbyssAmbient/AbyssStalactite.png b/Tiles/Abyss/AbyssAmbient/AbyssStalactite.png new file mode 100644 index 0000000000..321e43405e Binary files /dev/null and b/Tiles/Abyss/AbyssAmbient/AbyssStalactite.png differ diff --git a/Tiles/Abyss/AbyssAmbient/AbyssStalagmite.cs b/Tiles/Abyss/AbyssAmbient/AbyssStalagmite.cs new file mode 100644 index 0000000000..8619c8fb25 --- /dev/null +++ b/Tiles/Abyss/AbyssAmbient/AbyssStalagmite.cs @@ -0,0 +1,34 @@ +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using Terraria.ObjectData; +using Terraria.DataStructures; +using Terraria.Enums; +using Terraria.Audio; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; + +namespace CalamityMod.Tiles.Abyss.AbyssAmbient +{ + public class AbyssStalagmite : ModTile + { + public override void SetStaticDefaults() + { + Main.tileFrameImportant[Type] = true; + Main.tileSolid[Type] = false; + TileObjectData.newTile.Width = 2; + TileObjectData.newTile.Height = 3; + TileObjectData.newTile.Origin = new Point16(1, 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 = 2; + TileObjectData.addTile(Type); + AddMapEntry(new Color(5, 8, 34)); + HitSound = SoundID.Dig; + DustType = 33; + } + } +} \ No newline at end of file diff --git a/Tiles/Abyss/AbyssAmbient/AbyssStalagmite.png b/Tiles/Abyss/AbyssAmbient/AbyssStalagmite.png new file mode 100644 index 0000000000..bc45068d07 Binary files /dev/null and b/Tiles/Abyss/AbyssAmbient/AbyssStalagmite.png differ diff --git a/Tiles/Abyss/AbyssAmbient/AbyssTendril.cs b/Tiles/Abyss/AbyssAmbient/AbyssTendril.cs new file mode 100644 index 0000000000..59c7a5e717 --- /dev/null +++ b/Tiles/Abyss/AbyssAmbient/AbyssTendril.cs @@ -0,0 +1,42 @@ +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.Abyss.AbyssAmbient +{ + public class AbyssTendril1 : ModTile + { + public override void SetStaticDefaults() + { + Main.tileFrameImportant[Type] = true; + Main.tileLighted[Type] = true; + Main.tileSolid[Type] = false; + TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2); + TileObjectData.newTile.Origin = new Point16(1, 1); + 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(104, 29, 29)); + HitSound = SoundID.Tink; + } + + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) + { + r = 0.2f; + g = 0f; + b = 0f; + } + } + + public class AbyssTendril2 : AbyssTendril1 + { + } +} \ No newline at end of file diff --git a/Tiles/Abyss/AbyssAmbient/AbyssTendril1.png b/Tiles/Abyss/AbyssAmbient/AbyssTendril1.png new file mode 100644 index 0000000000..5b0b865d30 Binary files /dev/null and b/Tiles/Abyss/AbyssAmbient/AbyssTendril1.png differ diff --git a/Tiles/Abyss/AbyssAmbient/AbyssTendril2.png b/Tiles/Abyss/AbyssAmbient/AbyssTendril2.png new file mode 100644 index 0000000000..45fe82f2ea Binary files /dev/null and b/Tiles/Abyss/AbyssAmbient/AbyssTendril2.png differ diff --git a/Tiles/Abyss/AbyssAmbient/AbyssWeeds.cs b/Tiles/Abyss/AbyssAmbient/AbyssWeeds.cs new file mode 100644 index 0000000000..228e289dea --- /dev/null +++ b/Tiles/Abyss/AbyssAmbient/AbyssWeeds.cs @@ -0,0 +1,44 @@ +using CalamityMod.Dusts; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.GameContent.Metadata; +using Terraria.ID; +using Terraria.ModLoader; +using Terraria.ObjectData; + +namespace CalamityMod.Tiles.Abyss.AbyssAmbient +{ + public class AbyssWeeds : ModTile + { + public override void SetStaticDefaults() + { + Main.tileCut[Type] = true; + Main.tileSolid[Type] = false; + Main.tileNoAttach[Type] = true; + Main.tileNoFail[Type] = true; + Main.tileLavaDeath[Type] = true; + Main.tileWaterDeath[Type] = true; + Main.tileFrameImportant[Type] = true; + TileID.Sets.ReplaceTileBreakUp[Type] = true; + TileID.Sets.SwaysInWindBasic[Type] = true; + TileMaterials.SetForTileId(Type, TileMaterials._materialsByName["Plant"]); + + TileObjectData.newTile.CopyFrom(TileObjectData.Style1x2); + TileObjectData.addTile(Type); + + DustType = 33; + HitSound = SoundID.Grass; + + AddMapEntry(new Color(5, 8, 34)); + + base.SetStaticDefaults(); + } + + public override void SetDrawPositions(int i, int j, ref int width, ref int offsetY, ref int height, ref short tileFrameX, ref short tileFrameY) + { + offsetY = -16; + height = 32; + } + } +} diff --git a/Tiles/Abyss/AbyssAmbient/AbyssWeeds.png b/Tiles/Abyss/AbyssAmbient/AbyssWeeds.png new file mode 100644 index 0000000000..2a2b758879 Binary files /dev/null and b/Tiles/Abyss/AbyssAmbient/AbyssWeeds.png differ diff --git a/Tiles/Abyss/AbyssAmbient/VoidBulbTree.cs b/Tiles/Abyss/AbyssAmbient/VoidBulbTree.cs new file mode 100644 index 0000000000..37a5dfa4c5 --- /dev/null +++ b/Tiles/Abyss/AbyssAmbient/VoidBulbTree.cs @@ -0,0 +1,41 @@ +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.Abyss.AbyssAmbient +{ + public class VoidBulbTree : ModTile + { + public override void SetStaticDefaults() + { + Main.tileFrameImportant[Type] = true; + Main.tileLighted[Type] = true; + Main.tileSolid[Type] = false; + TileObjectData.newTile.Width = 3; + TileObjectData.newTile.Height = 4; + TileObjectData.newTile.Origin = new Point16(2, 3); + TileObjectData.newTile.CoordinateHeights = new int[] { 16, 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 = 2; + TileObjectData.addTile(Type); + AddMapEntry(new Color(59, 72, 168)); + DustType = 33; + HitSound = SoundID.Dig; + } + + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) + { + r = 0.15f; + g = 0.3f; + b = 0.5f; + } + } +} \ No newline at end of file diff --git a/Tiles/Abyss/AbyssAmbient/VoidBulbTree.png b/Tiles/Abyss/AbyssAmbient/VoidBulbTree.png new file mode 100644 index 0000000000..8fb4202fe0 Binary files /dev/null and b/Tiles/Abyss/AbyssAmbient/VoidBulbTree.png differ diff --git a/Tiles/Abyss/AbyssAmbient/VoidStalactite.cs b/Tiles/Abyss/AbyssAmbient/VoidStalactite.cs new file mode 100644 index 0000000000..7df166af8a --- /dev/null +++ b/Tiles/Abyss/AbyssAmbient/VoidStalactite.cs @@ -0,0 +1,35 @@ +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using Terraria.ObjectData; +using Terraria.DataStructures; +using Terraria.Enums; +using Terraria.Audio; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; + +namespace CalamityMod.Tiles.Abyss.AbyssAmbient +{ + public class VoidStalactite : ModTile + { + public override void SetStaticDefaults() + { + Main.tileFrameImportant[Type] = true; + Main.tileSolid[Type] = false; + TileObjectData.newTile.Width = 2; + TileObjectData.newTile.Height = 3; + TileObjectData.newTile.Origin = new Point16(1, 1); + TileObjectData.newTile.CoordinateHeights = new int[] { 16, 16, 16 }; + TileObjectData.newTile.StyleWrapLimit = 36; + TileObjectData.newTile.AnchorTop = new AnchorData(AnchorType.SolidTile, TileObjectData.newTile.Width, 0); + TileObjectData.newTile.AnchorBottom = default(AnchorData); + TileObjectData.newTile.CoordinateWidth = 16; + TileObjectData.newTile.CoordinatePadding = 2; + TileObjectData.newTile.DrawYOffset = -2; + TileObjectData.addTile(Type); + AddMapEntry(new Color(2, 2, 2)); + HitSound = SoundID.Dig; + DustType = 33; + } + } +} \ No newline at end of file diff --git a/Tiles/Abyss/AbyssAmbient/VoidStalactite.png b/Tiles/Abyss/AbyssAmbient/VoidStalactite.png new file mode 100644 index 0000000000..85000caedd Binary files /dev/null and b/Tiles/Abyss/AbyssAmbient/VoidStalactite.png differ diff --git a/Tiles/Abyss/AbyssAmbient/VoidStalagmite.cs b/Tiles/Abyss/AbyssAmbient/VoidStalagmite.cs new file mode 100644 index 0000000000..595bbdadb7 --- /dev/null +++ b/Tiles/Abyss/AbyssAmbient/VoidStalagmite.cs @@ -0,0 +1,34 @@ +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using Terraria.ObjectData; +using Terraria.DataStructures; +using Terraria.Enums; +using Terraria.Audio; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; + +namespace CalamityMod.Tiles.Abyss.AbyssAmbient +{ + public class VoidStalagmite : ModTile + { + public override void SetStaticDefaults() + { + Main.tileFrameImportant[Type] = true; + Main.tileSolid[Type] = false; + TileObjectData.newTile.Width = 2; + TileObjectData.newTile.Height = 3; + TileObjectData.newTile.Origin = new Point16(1, 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 = 2; + TileObjectData.addTile(Type); + AddMapEntry(new Color(2, 2, 2)); + HitSound = SoundID.Dig; + DustType = 33; + } + } +} \ No newline at end of file diff --git a/Tiles/Abyss/AbyssAmbient/VoidStalagmite.png b/Tiles/Abyss/AbyssAmbient/VoidStalagmite.png new file mode 100644 index 0000000000..f5d2f37a69 Binary files /dev/null and b/Tiles/Abyss/AbyssAmbient/VoidStalagmite.png differ diff --git a/Tiles/Abyss/AbyssAmbient/VoidTendril.cs b/Tiles/Abyss/AbyssAmbient/VoidTendril.cs new file mode 100644 index 0000000000..cd66c6011f --- /dev/null +++ b/Tiles/Abyss/AbyssAmbient/VoidTendril.cs @@ -0,0 +1,43 @@ +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.Abyss.AbyssAmbient +{ + public class VoidTendril1 : ModTile + { + public override void SetStaticDefaults() + { + Main.tileFrameImportant[Type] = true; + Main.tileLighted[Type] = true; + Main.tileSolid[Type] = false; + TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2); + TileObjectData.newTile.Origin = new Point16(1, 1); + 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(59, 72, 168)); + DustType = 33; + HitSound = SoundID.Dig; + } + + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) + { + r = 0.00f; + g = 0.05f; + b = 0.2f; + } + } + + public class VoidTendril2 : VoidTendril1 + { + } +} \ No newline at end of file diff --git a/Tiles/Abyss/AbyssAmbient/VoidTendril1.png b/Tiles/Abyss/AbyssAmbient/VoidTendril1.png new file mode 100644 index 0000000000..99d6ab9f2d Binary files /dev/null and b/Tiles/Abyss/AbyssAmbient/VoidTendril1.png differ diff --git a/Tiles/Abyss/AbyssAmbient/VoidTendril2.png b/Tiles/Abyss/AbyssAmbient/VoidTendril2.png new file mode 100644 index 0000000000..1b577e5188 Binary files /dev/null and b/Tiles/Abyss/AbyssAmbient/VoidTendril2.png differ diff --git a/Tiles/Abyss/AbyssAmbient/VoidWeeds.cs b/Tiles/Abyss/AbyssAmbient/VoidWeeds.cs new file mode 100644 index 0000000000..6279e6c6a6 --- /dev/null +++ b/Tiles/Abyss/AbyssAmbient/VoidWeeds.cs @@ -0,0 +1,44 @@ +using CalamityMod.Dusts; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.GameContent.Metadata; +using Terraria.ID; +using Terraria.ModLoader; +using Terraria.ObjectData; + +namespace CalamityMod.Tiles.Abyss.AbyssAmbient +{ + public class VoidWeeds : ModTile + { + public override void SetStaticDefaults() + { + Main.tileCut[Type] = true; + Main.tileSolid[Type] = false; + Main.tileNoAttach[Type] = true; + Main.tileNoFail[Type] = true; + Main.tileLavaDeath[Type] = true; + Main.tileWaterDeath[Type] = true; + Main.tileFrameImportant[Type] = true; + TileID.Sets.ReplaceTileBreakUp[Type] = true; + TileID.Sets.SwaysInWindBasic[Type] = true; + TileMaterials.SetForTileId(Type, TileMaterials._materialsByName["Plant"]); + + TileObjectData.newTile.CopyFrom(TileObjectData.Style1x2); + TileObjectData.addTile(Type); + + DustType = 33; + HitSound = SoundID.Grass; + + AddMapEntry(new Color(2, 2, 2)); + + base.SetStaticDefaults(); + } + + public override void SetDrawPositions(int i, int j, ref int width, ref int offsetY, ref int height, ref short tileFrameX, ref short tileFrameY) + { + offsetY = -16; + height = 32; + } + } +} diff --git a/Tiles/Abyss/AbyssAmbient/VoidWeeds.png b/Tiles/Abyss/AbyssAmbient/VoidWeeds.png new file mode 100644 index 0000000000..33967c602c Binary files /dev/null and b/Tiles/Abyss/AbyssAmbient/VoidWeeds.png differ diff --git a/Tiles/Abyss/AbyssGravel.cs b/Tiles/Abyss/AbyssGravel.cs index b47504e4d1..b5e9dd98a0 100644 --- a/Tiles/Abyss/AbyssGravel.cs +++ b/Tiles/Abyss/AbyssGravel.cs @@ -1,4 +1,4 @@ - +using CalamityMod.Tiles.Abyss.AbyssAmbient; using Microsoft.Xna.Framework; using Terraria; using Terraria.Audio; @@ -31,6 +31,26 @@ namespace CalamityMod.Tiles.Abyss DustType = 33; } + public override void RandomUpdate(int i, int j) + { + Tile up = Main.tile[i, j - 1]; + Tile up2 = Main.tile[i, j - 2]; + + if (WorldGen.genRand.Next(5) == 0 && !up.HasTile && !up2.HasTile && up.LiquidAmount > 0) + { + up.TileType = (ushort)ModContent.TileType(); + up.HasTile = true; + up.TileFrameY = 0; + up.TileFrameX = (short)(WorldGen.genRand.Next(4) * 18); + WorldGen.SquareTileFrame(i, j - 1, true); + + if (Main.netMode == NetmodeID.Server) + { + NetMessage.SendTileSquare(-1, i, j - 1, 3, TileChangeType.None); + } + } + } + public override bool CanExplode(int i, int j) { return false; diff --git a/Tiles/Abyss/PlantyMush.cs b/Tiles/Abyss/PlantyMush.cs index a8f155029b..ff0f8f4f17 100644 --- a/Tiles/Abyss/PlantyMush.cs +++ b/Tiles/Abyss/PlantyMush.cs @@ -1,4 +1,5 @@ -using CalamityMod.Walls; +using CalamityMod.Tiles.Abyss.AbyssAmbient; +using CalamityMod.Walls; using Microsoft.Xna.Framework; using Terraria; using Terraria.Audio; @@ -49,6 +50,23 @@ namespace CalamityMod.Tiles.Abyss public override void RandomUpdate(int i, int j) { + Tile up = Main.tile[i, j - 1]; + Tile up2 = Main.tile[i, j - 2]; + + if (WorldGen.genRand.Next(2) == 0 && !up.HasTile && !up2.HasTile && up.LiquidAmount > 0) + { + up.TileType = (ushort)ModContent.TileType(); + up.HasTile = true; + up.TileFrameY = 0; + up.TileFrameX = (short)(WorldGen.genRand.Next(4) * 18); + WorldGen.SquareTileFrame(i, j - 1, true); + + if (Main.netMode == NetmodeID.Server) + { + NetMessage.SendTileSquare(-1, i, j - 1, 3, TileChangeType.None); + } + } + int num8 = WorldGen.genRand.Next((int)Main.rockLayer, (int)(Main.rockLayer + (double)Main.maxTilesY * 0.143)); if (Main.tile[i, j + 1] != null) { diff --git a/Tiles/Abyss/Voidstone.cs b/Tiles/Abyss/Voidstone.cs index e77f71ff31..fd956bac26 100644 --- a/Tiles/Abyss/Voidstone.cs +++ b/Tiles/Abyss/Voidstone.cs @@ -1,4 +1,4 @@ - +using CalamityMod.Tiles.Abyss.AbyssAmbient; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using ReLogic.Content; @@ -30,6 +30,27 @@ namespace CalamityMod.Tiles.Abyss ItemDrop = ModContent.ItemType(); AddMapEntry(new Color(15, 15, 15)); } + + public override void RandomUpdate(int i, int j) + { + Tile up = Main.tile[i, j - 1]; + Tile up2 = Main.tile[i, j - 2]; + + if (WorldGen.genRand.Next(5) == 0 && !up.HasTile && !up2.HasTile && up.LiquidAmount > 0) + { + up.TileType = (ushort)ModContent.TileType(); + up.HasTile = true; + up.TileFrameY = 0; + up.TileFrameX = (short)(WorldGen.genRand.Next(4) * 18); + WorldGen.SquareTileFrame(i, j - 1, true); + + if (Main.netMode == NetmodeID.Server) + { + NetMessage.SendTileSquare(-1, i, j - 1, 3, TileChangeType.None); + } + } + } + int animationFrameWidth = 288; public override bool CreateDust(int i, int j, ref int type) diff --git a/Tiles/CalamityGlobalTile.cs b/Tiles/CalamityGlobalTile.cs index 0fcc3addc1..d37b2b225e 100644 --- a/Tiles/CalamityGlobalTile.cs +++ b/Tiles/CalamityGlobalTile.cs @@ -2,6 +2,7 @@ using CalamityMod.Items.VanillaArmorChanges; using CalamityMod.Items.Weapons.Melee; using CalamityMod.Tiles.Abyss; +using CalamityMod.Tiles.Abyss.AbyssAmbient; using CalamityMod.Tiles.Astral; using CalamityMod.Tiles.AstralDesert; using CalamityMod.Tiles.DraedonStructures; @@ -46,7 +47,10 @@ namespace CalamityMod.Tiles TileID.CrimsonPlants, (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), - (ushort)ModContent.TileType() + (ushort)ModContent.TileType(), + (ushort)ModContent.TileType(), + (ushort)ModContent.TileType(), + (ushort)ModContent.TileType() }; public static List GrowthTiles = new List() diff --git a/Tiles/Crags/CragStalactite.cs b/Tiles/Crags/CragStalactite.cs index b68412f7dc..ebd9e49f5b 100644 --- a/Tiles/Crags/CragStalactite.cs +++ b/Tiles/Crags/CragStalactite.cs @@ -15,7 +15,6 @@ namespace CalamityMod.Tiles.Crags public override void SetStaticDefaults() { Main.tileFrameImportant[Type] = true; - Main.tileLighted[Type] = true; Main.tileSolid[Type] = false; TileObjectData.newTile.Width = 2; TileObjectData.newTile.Height = 5; @@ -26,7 +25,7 @@ namespace CalamityMod.Tiles.Crags TileObjectData.newTile.AnchorBottom = default(AnchorData); TileObjectData.newTile.CoordinateWidth = 16; TileObjectData.newTile.CoordinatePadding = 2; - TileObjectData.newTile.DrawYOffset = -2; + TileObjectData.newTile.DrawYOffset = -3; TileObjectData.addTile(Type); AddMapEntry(new Color(43, 23, 46)); HitSound = SoundID.Tink; @@ -49,7 +48,6 @@ namespace CalamityMod.Tiles.Crags public override void SetStaticDefaults() { Main.tileFrameImportant[Type] = true; - Main.tileLighted[Type] = true; Main.tileSolid[Type] = false; TileObjectData.newTile.Width = 2; TileObjectData.newTile.Height = 4; @@ -60,7 +58,7 @@ namespace CalamityMod.Tiles.Crags TileObjectData.newTile.AnchorBottom = default(AnchorData); TileObjectData.newTile.CoordinateWidth = 16; TileObjectData.newTile.CoordinatePadding = 2; - TileObjectData.newTile.DrawYOffset = -2; + TileObjectData.newTile.DrawYOffset = -3; TileObjectData.addTile(Type); AddMapEntry(new Color(43, 23, 46)); HitSound = SoundID.Tink; @@ -79,7 +77,6 @@ namespace CalamityMod.Tiles.Crags public override void SetStaticDefaults() { Main.tileFrameImportant[Type] = true; - Main.tileLighted[Type] = true; Main.tileSolid[Type] = false; TileObjectData.newTile.Width = 2; TileObjectData.newTile.Height = 3; @@ -90,7 +87,7 @@ namespace CalamityMod.Tiles.Crags TileObjectData.newTile.AnchorBottom = default(AnchorData); TileObjectData.newTile.CoordinateWidth = 16; TileObjectData.newTile.CoordinatePadding = 2; - TileObjectData.newTile.DrawYOffset = -2; + TileObjectData.newTile.DrawYOffset = -3; TileObjectData.addTile(Type); AddMapEntry(new Color(43, 23, 46)); HitSound = SoundID.Tink; @@ -113,7 +110,6 @@ namespace CalamityMod.Tiles.Crags public override void SetStaticDefaults() { Main.tileFrameImportant[Type] = true; - Main.tileLighted[Type] = true; Main.tileSolid[Type] = false; TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2); TileObjectData.newTile.Origin = new Point16(1, 1); @@ -122,7 +118,7 @@ namespace CalamityMod.Tiles.Crags TileObjectData.newTile.AnchorBottom = default(AnchorData); TileObjectData.newTile.CoordinateWidth = 16; TileObjectData.newTile.CoordinatePadding = 2; - TileObjectData.newTile.DrawYOffset = -2; + TileObjectData.newTile.DrawYOffset = -3; TileObjectData.addTile(Type); AddMapEntry(new Color(43, 23, 46)); HitSound = SoundID.Tink; diff --git a/Tiles/Crags/CragStalagmite.cs b/Tiles/Crags/CragStalagmite.cs index e1620d34a2..93e19924d6 100644 --- a/Tiles/Crags/CragStalagmite.cs +++ b/Tiles/Crags/CragStalagmite.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Tiles.Crags 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 = 2; + TileObjectData.newTile.DrawYOffset = 3; TileObjectData.addTile(Type); AddMapEntry(new Color(43, 23, 46)); HitSound = SoundID.Tink; @@ -56,7 +56,7 @@ namespace CalamityMod.Tiles.Crags 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 = 2; + TileObjectData.newTile.DrawYOffset = 3; TileObjectData.addTile(Type); AddMapEntry(new Color(43, 23, 46)); HitSound = SoundID.Tink; @@ -84,7 +84,7 @@ namespace CalamityMod.Tiles.Crags 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 = 2; + TileObjectData.newTile.DrawYOffset = 3; TileObjectData.addTile(Type); AddMapEntry(new Color(43, 23, 46)); HitSound = SoundID.Tink; @@ -114,7 +114,7 @@ namespace CalamityMod.Tiles.Crags 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 = 2; + TileObjectData.newTile.DrawYOffset = 3; TileObjectData.addTile(Type); AddMapEntry(new Color(43, 23, 46)); HitSound = SoundID.Tink; diff --git a/Utilities/TileFraming.cs b/Utilities/TileFraming.cs index 6fe3480fe7..b3d78ec8b2 100644 --- a/Utilities/TileFraming.cs +++ b/Utilities/TileFraming.cs @@ -1,4 +1,5 @@ using CalamityMod.Tiles.Abyss; +using CalamityMod.Tiles.Abyss.AbyssAmbient; using CalamityMod.Tiles.Astral; using CalamityMod.Tiles.AstralDesert; using CalamityMod.Tiles.AstralSnow; @@ -62,6 +63,9 @@ namespace CalamityMod PlantCheckAgainst[ModContent.TileType()] = new int[1] { ModContent.TileType() }; PlantCheckAgainst[ModContent.TileType()] = new int[1] { ModContent.TileType() }; PlantCheckAgainst[ModContent.TileType()] = new int[1] { ModContent.TileType() }; + PlantCheckAgainst[ModContent.TileType()] = new int[1] { ModContent.TileType() }; + PlantCheckAgainst[ModContent.TileType()] = new int[1] { ModContent.TileType() }; + PlantCheckAgainst[ModContent.TileType()] = new int[1] { ModContent.TileType() }; VineToGrass = new Dictionary { diff --git a/World/Abyss.cs b/World/Abyss.cs index 3d0b30e8ab..cfba3866c0 100644 --- a/World/Abyss.cs +++ b/World/Abyss.cs @@ -7,6 +7,7 @@ using CalamityMod.Items.Weapons.Ranged; using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Items.Weapons.Summon; using CalamityMod.Tiles.Abyss; +using CalamityMod.Tiles.Abyss.AbyssAmbient; using CalamityMod.Tiles.FurnitureVoid; using CalamityMod.Tiles.Ores; using CalamityMod.Walls; @@ -316,6 +317,68 @@ namespace CalamityMod.World { for (int abyssIndex2 = 0; abyssIndex2 < abyssChasmY; abyssIndex2++) { + //abyss gravel ambient stuff + if (Main.tile[abyssIndex, abyssIndex2].TileType == ModContent.TileType()) + { + //planty mush kelp + if (WorldGen.genRand.Next(150) == 0) + { + WorldGen.PlaceObject(abyssIndex, abyssIndex2 + 1, ModContent.TileType()); + WorldGen.PlaceObject(abyssIndex, abyssIndex2 + 2, ModContent.TileType()); + } + + if (WorldGen.genRand.Next(15) == 0) + { + WorldGen.PlaceObject(abyssIndex, abyssIndex2 + 1, ModContent.TileType()); + } + + if (WorldGen.genRand.Next(20) == 0) + { + WorldGen.PlaceObject(abyssIndex, abyssIndex2 - 1, ModContent.TileType()); + } + + if (WorldGen.genRand.Next(17) == 0) + { + ushort[] Tendrils = new ushort[] { (ushort)ModContent.TileType(), (ushort)ModContent.TileType() }; + + WorldGen.PlaceObject(abyssIndex, abyssIndex2 - 1, WorldGen.genRand.Next(Tendrils)); + } + } + + //voidstone ambient stuff + if (Main.tile[abyssIndex, abyssIndex2].TileType == ModContent.TileType()) + { + //planty mush kelp + if (WorldGen.genRand.Next(150) == 0) + { + WorldGen.PlaceObject(abyssIndex, abyssIndex2 + 1, ModContent.TileType()); + WorldGen.PlaceObject(abyssIndex, abyssIndex2 + 2, ModContent.TileType()); + } + + if (WorldGen.genRand.Next(15) == 0) + { + WorldGen.PlaceObject(abyssIndex, abyssIndex2 + 1, ModContent.TileType()); + } + + if (WorldGen.genRand.Next(20) == 0) + { + WorldGen.PlaceObject(abyssIndex, abyssIndex2 - 1, ModContent.TileType()); + } + + if (WorldGen.genRand.Next(17) == 0) + { + ushort[] Tendrils = new ushort[] { (ushort)ModContent.TileType(), (ushort)ModContent.TileType() }; + + WorldGen.PlaceObject(abyssIndex, abyssIndex2 - 1, WorldGen.genRand.Next(Tendrils)); + } + + if (WorldGen.genRand.Next(30) == 0) + { + WorldGen.PlaceObject(abyssIndex, abyssIndex2 - 1, ModContent.TileType()); + } + } + + //pots if (!Main.tile[abyssIndex, abyssIndex2].HasTile) { if (WorldGen.SolidTile(abyssIndex, abyssIndex2 + 1) && @@ -346,6 +409,68 @@ namespace CalamityMod.World { for (int abyssIndex2 = 0; abyssIndex2 < abyssChasmY; abyssIndex2++) { + //abyss gravel ambient stuff + if (Main.tile[abyssIndex, abyssIndex2].TileType == ModContent.TileType()) + { + //planty mush kelp + if (WorldGen.genRand.Next(150) == 0) + { + WorldGen.PlaceObject(abyssIndex, abyssIndex2 + 1, ModContent.TileType()); + WorldGen.PlaceObject(abyssIndex, abyssIndex2 + 2, ModContent.TileType()); + } + + if (WorldGen.genRand.Next(15) == 0) + { + WorldGen.PlaceObject(abyssIndex, abyssIndex2 + 1, ModContent.TileType()); + } + + if (WorldGen.genRand.Next(20) == 0) + { + WorldGen.PlaceObject(abyssIndex, abyssIndex2 - 1, ModContent.TileType()); + } + + if (WorldGen.genRand.Next(17) == 0) + { + ushort[] Tendrils = new ushort[] { (ushort)ModContent.TileType(), (ushort)ModContent.TileType() }; + + WorldGen.PlaceObject(abyssIndex, abyssIndex2 - 1, WorldGen.genRand.Next(Tendrils)); + } + } + + //voidstone ambient stuff + if (Main.tile[abyssIndex, abyssIndex2].TileType == ModContent.TileType()) + { + //planty mush kelp + if (WorldGen.genRand.Next(150) == 0) + { + WorldGen.PlaceObject(abyssIndex, abyssIndex2 + 1, ModContent.TileType()); + WorldGen.PlaceObject(abyssIndex, abyssIndex2 + 2, ModContent.TileType()); + } + + if (WorldGen.genRand.Next(15) == 0) + { + WorldGen.PlaceObject(abyssIndex, abyssIndex2 + 1, ModContent.TileType()); + } + + if (WorldGen.genRand.Next(20) == 0) + { + WorldGen.PlaceObject(abyssIndex, abyssIndex2 - 1, ModContent.TileType()); + } + + if (WorldGen.genRand.Next(17) == 0) + { + ushort[] Tendrils = new ushort[] { (ushort)ModContent.TileType(), (ushort)ModContent.TileType() }; + + WorldGen.PlaceObject(abyssIndex, abyssIndex2 - 1, WorldGen.genRand.Next(Tendrils)); + } + + if (WorldGen.genRand.Next(30) == 0) + { + WorldGen.PlaceObject(abyssIndex, abyssIndex2 - 1, ModContent.TileType()); + } + } + + //pots if (!Main.tile[abyssIndex, abyssIndex2].HasTile) { if (WorldGen.SolidTile(abyssIndex, abyssIndex2 + 1) && diff --git a/World/AstralBiome.cs b/World/AstralBiome.cs index a1895e5254..b00fa1cb0b 100644 --- a/World/AstralBiome.cs +++ b/World/AstralBiome.cs @@ -454,9 +454,26 @@ namespace CalamityMod.World // WorldGen.gen prevents NewItem from working, and thus prevents a bunch of dumb items from being spawned immediately and deleting the WoF/Aureus loot in the process. WorldGen.gen = true; - bool _ = true; - int xOffset = WorldGen.dungeonX < Main.maxTilesX / 2 ? -50 : 50; - SchematicManager.PlaceSchematic>(SchematicManager.AstralBeaconKey, new Point(i + xOffset, (int)height), SchematicAnchor.TopCenter, ref _); + bool place = true; + int xOffset = WorldGen.dungeonX < Main.maxTilesX / 2 ? WorldGen.genRand.Next(-65, -25) : WorldGen.genRand.Next(25, 65); + + bool altarPlaced = false; + int altarAttempts = 0; + int altarY = (int)height; + while (!altarPlaced && altarAttempts++ < 100000) + { + while (!WorldGen.SolidTile(xOffset, altarY) && altarY <= Main.worldSurface) + { + altarY++; + } + + if (Main.tile[xOffset, altarY].HasTile || Main.tile[xOffset, altarY].WallType > 0) + { + altarPlaced = true; + } + } + + SchematicManager.PlaceSchematic>(SchematicManager.AstralBeaconKey, new Point(i + xOffset, altarY), SchematicAnchor.TopCenter, ref place); WorldGen.gen = false; } } @@ -480,7 +497,7 @@ namespace CalamityMod.World int verticalRadius = (int)(constant / 16f); Vector2 fociOffset = Vector2.UnitY * fociSpacing; - Vector2 topFoci = center - new Vector2(0, -100) - fociOffset; + Vector2 topFoci = center - fociOffset; Vector2 bottomFoci = center + fociOffset; UnifiedRandom rand = WorldGen.genRand; @@ -1238,7 +1255,7 @@ namespace CalamityMod.World if (collapse) //Collapse ensures the ellipse is shrunk down a lot in terms of distance. { float distY = center.Y - point.Y; - point.Y -= distY * 8f; + point.Y -= distY * 4f; } float distance1 = Vector2.Distance(point, focus1); float distance2 = Vector2.Distance(point, focus2); diff --git a/World/BrimstoneCrag.cs b/World/BrimstoneCrag.cs index 8cbb72d2b2..1de7f38ae2 100644 --- a/World/BrimstoneCrag.cs +++ b/World/BrimstoneCrag.cs @@ -218,11 +218,11 @@ namespace CalamityMod.World Tile tileLeft = Main.tile[x - 1, y]; Tile tileRight = Main.tile[x + 1, y]; - if (WorldGen.genRand.Next(10) == 0 && tile.TileType == ModContent.TileType() && (tileUp.LiquidAmount > 0 || + if (tile.TileType == ModContent.TileType() && (tileUp.LiquidAmount > 0 || tileDown.LiquidAmount > 0 || tileLeft.LiquidAmount > 0 || tileRight.LiquidAmount > 0)) { WorldGen.TileRunner(x + WorldGen.genRand.Next(-15, 15), y + WorldGen.genRand.Next(-15, 15), - WorldGen.genRand.Next(8, 22), WorldGen.genRand.Next(8, 22), ModContent.TileType(), false, 0f, 0f, false, true); + WorldGen.genRand.Next(8, 12), WorldGen.genRand.Next(8, 12), ModContent.TileType(), false, 0f, 0f, false, true); } }