diff --git a/Items/Placeables/Walls/EutrophicGlassWall.cs b/Items/Placeables/Walls/EutrophicGlassWall.cs new file mode 100644 index 0000000000..64ab1c799f --- /dev/null +++ b/Items/Placeables/Walls/EutrophicGlassWall.cs @@ -0,0 +1,25 @@ +using Terraria.ID; +using Terraria.ModLoader; +using WallTiles = CalamityMod.Walls; + +namespace CalamityMod.Items.Placeables.Walls +{ + public class EutrophicGlassWall : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetStaticDefaults() + { + Item.ResearchUnlockCount = 400; + } + + public override void SetDefaults() => Item.DefaultToPlaceableWall(ModContent.WallType()); + + public override void AddRecipes() + { + CreateRecipe(4). + AddIngredient(). + AddTile(TileID.WorkBenches). + Register(); + } + } +} diff --git a/Items/Placeables/Walls/EutrophicGlassWall.png b/Items/Placeables/Walls/EutrophicGlassWall.png new file mode 100644 index 0000000000..9f7cfe4799 Binary files /dev/null and b/Items/Placeables/Walls/EutrophicGlassWall.png differ diff --git a/Localization/en-US/Mods.CalamityMod.Items.Placeables.hjson b/Localization/en-US/Mods.CalamityMod.Items.Placeables.hjson index 9ec39deefb..55acfc7fca 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Placeables.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Placeables.hjson @@ -4053,3 +4053,8 @@ BranchCoral: { DisplayName: Branch Coral Tooltip: "" } + +EutrophicGlassWall: { + DisplayName: Eutrophic Glass Wall + Tooltip: "" +} diff --git a/Tiles/SunkenSea/Ambient/DigitateCoral.cs b/Tiles/SunkenSea/Ambient/DigitateCoral.cs index 93a9c60346..7ffaa8c332 100644 --- a/Tiles/SunkenSea/Ambient/DigitateCoral.cs +++ b/Tiles/SunkenSea/Ambient/DigitateCoral.cs @@ -29,9 +29,9 @@ namespace CalamityMod.Tiles.SunkenSea.Ambient } public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) { - r = 62f / 400f; - g = 89f / 400f; - b = 171f / 400f; + r = 56f / 400f; + g = 164f / 400f; + b = 180f / 400f; } } @@ -39,9 +39,9 @@ namespace CalamityMod.Tiles.SunkenSea.Ambient { public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) { - r = 62f / 400f; - g = 89f / 400f; - b = 171f / 400f; + r = 56f / 400f; + g = 164f / 400f; + b = 180f / 400f; } } @@ -49,9 +49,9 @@ namespace CalamityMod.Tiles.SunkenSea.Ambient { public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) { - r = 62f / 400f; - g = 89f / 400f; - b = 171f / 400f; + r = 56f / 400f; + g = 164f / 400f; + b = 180f / 400f; } } } diff --git a/Tiles/SunkenSea/Ambient/DigitateCoral.png b/Tiles/SunkenSea/Ambient/DigitateCoral.png index 5218390f43..4af501b5ec 100644 Binary files a/Tiles/SunkenSea/Ambient/DigitateCoral.png and b/Tiles/SunkenSea/Ambient/DigitateCoral.png differ diff --git a/Tiles/SunkenSea/Ambient/DigitateCoral2.png b/Tiles/SunkenSea/Ambient/DigitateCoral2.png index 4f3fbfd024..7012604abd 100644 Binary files a/Tiles/SunkenSea/Ambient/DigitateCoral2.png and b/Tiles/SunkenSea/Ambient/DigitateCoral2.png differ diff --git a/Tiles/SunkenSea/Ambient/DigitateCoral3.png b/Tiles/SunkenSea/Ambient/DigitateCoral3.png index 791a86c2ae..53d503eb5f 100644 Binary files a/Tiles/SunkenSea/Ambient/DigitateCoral3.png and b/Tiles/SunkenSea/Ambient/DigitateCoral3.png differ diff --git a/Tiles/SunkenSea/Ambient/TallDigitateCoral.cs b/Tiles/SunkenSea/Ambient/TallDigitateCoral.cs index 6cc522de92..a8afc72874 100644 --- a/Tiles/SunkenSea/Ambient/TallDigitateCoral.cs +++ b/Tiles/SunkenSea/Ambient/TallDigitateCoral.cs @@ -32,9 +32,9 @@ namespace CalamityMod.Tiles.SunkenSea.Ambient } public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) { - r = 62f / 400f; - g = 89f / 400f; - b = 171f / 400f; + r = 56f / 400f; + g = 164f / 400f; + b = 180f / 400f; } } @@ -61,9 +61,9 @@ namespace CalamityMod.Tiles.SunkenSea.Ambient } public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) { - r = 62f / 400f; - g = 89f / 400f; - b = 171f / 400f; + r = 56f / 400f; + g = 164f / 400f; + b = 180f / 400f; } } public class TallDigitateCoral3 : ModTile @@ -89,9 +89,9 @@ namespace CalamityMod.Tiles.SunkenSea.Ambient } public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) { - r = 62f / 400f; - g = 89f / 400f; - b = 171f / 400f; + r = 56f / 400f; + g = 164f / 400f; + b = 180f / 400f; } } public class TallDigitateCoral4 : ModTile @@ -117,9 +117,9 @@ namespace CalamityMod.Tiles.SunkenSea.Ambient } public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) { - r = 62f / 400f; - g = 89f / 400f; - b = 171f / 400f; + r = 56f / 400f; + g = 164f / 400f; + b = 180f / 400f; } } } diff --git a/Tiles/SunkenSea/Ambient/TallDigitateCoral.png b/Tiles/SunkenSea/Ambient/TallDigitateCoral.png index 0512683f07..432a9bfed7 100644 Binary files a/Tiles/SunkenSea/Ambient/TallDigitateCoral.png and b/Tiles/SunkenSea/Ambient/TallDigitateCoral.png differ diff --git a/Tiles/SunkenSea/Ambient/TallDigitateCoral2.png b/Tiles/SunkenSea/Ambient/TallDigitateCoral2.png index 41a9b1e465..2602cb0363 100644 Binary files a/Tiles/SunkenSea/Ambient/TallDigitateCoral2.png and b/Tiles/SunkenSea/Ambient/TallDigitateCoral2.png differ diff --git a/Tiles/SunkenSea/Ambient/TallDigitateCoral3.png b/Tiles/SunkenSea/Ambient/TallDigitateCoral3.png index 9252c77b21..d7898fe9c4 100644 Binary files a/Tiles/SunkenSea/Ambient/TallDigitateCoral3.png and b/Tiles/SunkenSea/Ambient/TallDigitateCoral3.png differ diff --git a/Tiles/SunkenSea/Ambient/TallDigitateCoral4.png b/Tiles/SunkenSea/Ambient/TallDigitateCoral4.png index b6ee8aa9f1..b1b1bca49a 100644 Binary files a/Tiles/SunkenSea/Ambient/TallDigitateCoral4.png and b/Tiles/SunkenSea/Ambient/TallDigitateCoral4.png differ diff --git a/Tiles/SunkenSea/PolypSand.cs b/Tiles/SunkenSea/PolypSand.cs index be0e7c92b7..be11c3400a 100644 --- a/Tiles/SunkenSea/PolypSand.cs +++ b/Tiles/SunkenSea/PolypSand.cs @@ -42,18 +42,18 @@ namespace CalamityMod.Tiles.SunkenSea { num = fail ? 1 : 3; } - public override void DrawEffects(int i, int j, SpriteBatch spriteBatch, ref TileDrawInfo drawData) - { - if (Main.tile[i - 1, j - 1].TileType != Type || Main.tile[i, j - 1].TileType != Type || Main.tile[i + 1, j - 1].TileType != Type || - Main.tile[i - 1, j - 2].TileType != Type || Main.tile[i, j - 2].TileType != Type || Main.tile[i + 1, j - 2].TileType != Type) - { - try - { - Main.instance.TilesRenderer.AddSpecialLegacyPoint(i, j); - } - catch { } - } - } + //public override void DrawEffects(int i, int j, SpriteBatch spriteBatch, ref TileDrawInfo drawData) + //{ + // if (Main.tile[i - 1, j - 1].TileType != Type || Main.tile[i, j - 1].TileType != Type || Main.tile[i + 1, j - 1].TileType != Type || + // Main.tile[i - 1, j - 2].TileType != Type || Main.tile[i, j - 2].TileType != Type || Main.tile[i + 1, j - 2].TileType != Type) + // { + // try + // { + // Main.instance.TilesRenderer.AddSpecialLegacyPoint(i, j); + // } + // catch { } + // } + //} private Color GetDrawColour(int i, int j) { int colType = Main.tile[i, j].TileColor; @@ -74,189 +74,191 @@ namespace CalamityMod.Tiles.SunkenSea col.B = (byte)(paintCol.B / 255f * col.B); return col; } - public override void SpecialDraw(int i, int j, SpriteBatch spriteBatch) - { - Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); - Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero; - Color drawColour = GetDrawColour(i, j); - Texture2D leaves = ModContent.Request("CalamityMod/Tiles/SunkenSea/ScarletSeaGrass").Value; + //public override void SpecialDraw(int i, int j, SpriteBatch spriteBatch) + //{ + // Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); + // Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero; + // Color drawColour = GetDrawColour(i, j); + // Texture2D leaves = ModContent.Request("CalamityMod/Tiles/SunkenSea/ScarletSeaGrass").Value; - DrawExtraTop(i, j, leaves, drawOffset, drawColour); - DrawExtraWallEnds(i, j, leaves, drawOffset, drawColour); - DrawExtraDrapes(i, j, leaves, drawOffset, drawColour); - } + // DrawExtraTop(i, j, leaves, drawOffset, drawColour); + // DrawExtraWallEnds(i, j, leaves, drawOffset, drawColour); + // DrawExtraDrapes(i, j, leaves, drawOffset, drawColour); + //} public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) { return TileFramingSystem.BetterGemsparkFraming(i, j, resetFrame); } - public override void RandomUpdate(int i, int j) - { - Tile tile = Main.tile[i, j]; - Tile up = Main.tile[i, j - 1]; - Tile up2 = Main.tile[i, j - 2]; + //public override void RandomUpdate(int i, int j) + //{ + // Tile tile = Main.tile[i, j]; + // Tile up = Main.tile[i, j - 1]; + // Tile up2 = Main.tile[i, j - 2]; - // Place LongScarletSeagrass - if (WorldGen.genRand.NextBool(1) && !up.HasTile && !up2.HasTile && up.LiquidAmount > 0 && up2.LiquidAmount > 0 && !tile.LeftSlope && !tile.RightSlope && !tile.IsHalfBlock) - { - up.TileType = (ushort)ModContent.TileType(); - up.HasTile = true; - up.TileFrameY = 0; + // // Place LongScarletSeagrass + // if (WorldGen.genRand.NextBool(1) && !up.HasTile && !up2.HasTile && up.LiquidAmount > 0 && up2.LiquidAmount > 0 && !tile.LeftSlope && !tile.RightSlope && !tile.IsHalfBlock) + // { + // up.TileType = (ushort)ModContent.TileType(); + // up.HasTile = true; + // up.TileFrameY = 0; - // 16 different frames, choose a random one - up.TileFrameX = (short)(WorldGen.genRand.Next(16) * 18); - WorldGen.SquareTileFrame(i, j - 1, true); + // // 16 different frames, choose a random one + // up.TileFrameX = (short)(WorldGen.genRand.Next(16) * 18); + // WorldGen.SquareTileFrame(i, j - 1, true); - if (Main.dedServ) - NetMessage.SendTileSquare(-1, i, j - 1, 3, TileChangeType.None); - } - } - - #region 'Extra Drapes' Drawing - private void DrawExtraTop(int i, int j, Texture2D extras, Vector2 drawOffset, Color drawColour) - { - /* - If the tile directly above this tile is not otherworldly stone, or if it is, there is air to both sides of that tile, draw the Extra surface - */ - if ( - CheckTile(Type, false, 0, 1, i, j) || - (CheckTile(Type, true, 0, 1, i, j) && CheckTile(Type, false, 1, 1, i, j) && CheckTile(Type, false, -1, 1, i, j) && CheckTile(Type, true, 1, 0, i, j) && CheckTile(Type, true, -1, 0, i, j)) - ) - { - Main.spriteBatch.Draw(extras, drawOffset, new Rectangle?(new Rectangle(GetExtraState("middle") + GetExtraVariant(i, j), GetExtraPattern(i), 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); - Main.spriteBatch.Draw(extras, drawOffset + new Vector2(0f, 16f), new Rectangle?(new Rectangle(GetExtraState("middle") + GetExtraVariant(i, j), GetExtraPattern(i) + 18, 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); - - DrawExtraOverhang(i, j, extras, drawOffset, drawColour); - } - } - private bool CheckTile(int type, bool equal, int x, int y, int i, int j) - { - //Subtract y so that y is vertical for ease of readability - return Main.tile[i + x, j - y].TileType == type == equal; - } - private void DrawExtraWallEnds(int i, int j, Texture2D extras, Vector2 drawOffset, Color drawColour) - { - /* - Ending the Extra when a wall is reached - */ - - //Left - if ( - CheckTile(Type, true, 1, 0, i, j) && CheckTile(Type, false, 1, 1, i, j) && CheckTile(Type, true, 0, 1, i, j) && - (CheckTile(Type, true, -1, 1, i, j) || CheckTile(Type, false, -1, 0, i, j)) - ) - { - Main.spriteBatch.Draw(extras, drawOffset, new Rectangle?(new Rectangle(GetExtraState("wallEndLeft") + GetExtraVariant(i + 1, j), GetExtraPattern(i), 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); - Main.spriteBatch.Draw(extras, drawOffset + new Vector2(0f, 16f), new Rectangle?(new Rectangle(GetExtraState("wallEndLeft") + GetExtraVariant(i + 1, j), GetExtraPattern(i) + 18, 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); - } - //Right - if ( - CheckTile(Type, true, -1, 0, i, j) && CheckTile(Type, false, -1, 1, i, j) && CheckTile(Type, true, 0, 1, i, j) && - (CheckTile(Type, true, 1, 1, i, j) || CheckTile(Type, false, 1, 0, i, j)) - ) - { - Main.spriteBatch.Draw(extras, drawOffset, new Rectangle?(new Rectangle(GetExtraState("wallEndRight") + GetExtraVariant(i - 1, j), GetExtraPattern(i), 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); - Main.spriteBatch.Draw(extras, drawOffset + new Vector2(0f, 16f), new Rectangle?(new Rectangle(GetExtraState("wallEndRight") + GetExtraVariant(i - 1, j), GetExtraPattern(i) + 18, 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); - } - } - private void DrawExtraOverhang(int i, int j, Texture2D extras, Vector2 drawOffset, Color drawColour) - { - /* - Called from DrawExtraTop(). Ending the Extra when the edge of the tile is reached - */ - - //Left - if ( - CheckTile(Type, false, -1, 0, i, j) - ) - { - Main.spriteBatch.Draw(extras, drawOffset + new Vector2(-16f, 0f), new Rectangle?(new Rectangle(GetExtraState("overhangLeft") + GetExtraVariant(i, j), GetExtraPattern(i - 1), 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); - Main.spriteBatch.Draw(extras, drawOffset + new Vector2(-16f, 16f), new Rectangle?(new Rectangle(GetExtraState("overhangLeft") + GetExtraVariant(i, j), GetExtraPattern(i - 1) + 18, 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); - } - //Right - if ( - CheckTile(Type, false, 1, 0, i, j) - ) - { - Main.spriteBatch.Draw(extras, drawOffset + new Vector2(16f, 0f), new Rectangle?(new Rectangle(GetExtraState("overhangRight") + GetExtraVariant(i, j), GetExtraPattern(i + 1), 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); - Main.spriteBatch.Draw(extras, drawOffset + new Vector2(16f, 16f), new Rectangle?(new Rectangle(GetExtraState("overhangRight") + GetExtraVariant(i, j), GetExtraPattern(i + 1) + 18, 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); - } - } - private void DrawExtraDrapes(int i, int j, Texture2D extras, Vector2 drawOffset, Color drawColour) - { - /* - Hanging 'drapes' of the extra element - */ - - //Base - if ( - (CheckTile(Type, true, 0, 1, i, j) && CheckTile(Type, false, 0, 2, i, j)) || - (CheckTile(Type, true, 0, 2, i, j) && CheckTile(Type, false, 1, 2, i, j) && CheckTile(Type, false, -1, 2, i, j) && CheckTile(Type, true, 1, 1, i, j) && CheckTile(Type, true, -1, 1, i, j)) - ) - { - Main.spriteBatch.Draw(extras, drawOffset, new Rectangle?(new Rectangle(GetExtraState("middle") + GetExtraVariant(i, j - 1), GetExtraPattern(i) + 18, 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); - } - //Left Wall - if ( - CheckTile(Type, true, 1, 1, i, j) && CheckTile(Type, false, 1, 2, i, j) && CheckTile(Type, true, 0, 2, i, j) && - (CheckTile(Type, true, -1, 2, i, j) || CheckTile(Type, false, -1, 1, i, j)) - ) - { - Main.spriteBatch.Draw(extras, drawOffset, new Rectangle?(new Rectangle(GetExtraState("wallEndLeft") + GetExtraVariant(i + 1, j - 1), GetExtraPattern(i) + 18, 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); - } - //Right Wall - if ( - CheckTile(Type, true, -1, 1, i, j) && CheckTile(Type, false, -1, 2, i, j) && CheckTile(Type, true, 0, 2, i, j) && - (CheckTile(Type, true, 1, 2, i, j) || CheckTile(Type, false, 1, 1, i, j)) - ) - { - Main.spriteBatch.Draw(extras, drawOffset, new Rectangle?(new Rectangle(GetExtraState("wallEndRight") + GetExtraVariant(i - 1, j - 1), GetExtraPattern(i) + 18, 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); - } - //Left Overhang - if ( - CheckTile(Type, true, 1, 1, i, j) && CheckTile(Type, false, 0, 1, i, j) && CheckTile(Type, false, 0, 2, i, j) && CheckTile(Type, false, 1, 2, i, j) - ) - { - Main.spriteBatch.Draw(extras, drawOffset, new Rectangle?(new Rectangle(GetExtraState("overhangLeft") + GetExtraVariant(i + 1, j - 1), GetExtraPattern(i) + 18, 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); - } - //Right Overhang - if ( - CheckTile(Type, true, -1, 1, i, j) && CheckTile(Type, false, 0, 1, i, j) && CheckTile(Type, false, 0, 2, i, j) && CheckTile(Type, false, -1, 2, i, j) - ) - { - Main.spriteBatch.Draw(extras, drawOffset, new Rectangle?(new Rectangle(GetExtraState("overhangRight") + GetExtraVariant(i - 1, j - 1), GetExtraPattern(i) + 18, 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); - } - } - - private int GetExtraState(string type) - { - switch (type) - { - case "middle": - return 36; - case "overhangLeft": - return 18; - case "overhangRight": - return 54; - case "wallEndLeft": - return 0; - case "wallEndRight": - return 72; - default: - Main.NewText(type.ToString() + " is not a valid Extra sheet state"); - return 0; - } - } - - private int GetExtraPattern(int i) - { - return i % 3 * extraFrameHeight; - } - - private int GetExtraVariant(int i, int j) - { - return Main.tile[i, j].TileFrameNumber * extraFrameWidth; - } + // if (Main.dedServ) + // NetMessage.SendTileSquare(-1, i, j - 1, 3, TileChangeType.None); + // } + //} } } -#endregion + +// #region 'Extra Drapes' Drawing +// private void DrawExtraTop(int i, int j, Texture2D extras, Vector2 drawOffset, Color drawColour) +// { +// /* +// If the tile directly above this tile is not otherworldly stone, or if it is, there is air to both sides of that tile, draw the Extra surface +// */ +// if ( +// CheckTile(Type, false, 0, 1, i, j) || +// (CheckTile(Type, true, 0, 1, i, j) && CheckTile(Type, false, 1, 1, i, j) && CheckTile(Type, false, -1, 1, i, j) && CheckTile(Type, true, 1, 0, i, j) && CheckTile(Type, true, -1, 0, i, j)) +// ) +// { +// Main.spriteBatch.Draw(extras, drawOffset, new Rectangle?(new Rectangle(GetExtraState("middle") + GetExtraVariant(i, j), GetExtraPattern(i), 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); +// Main.spriteBatch.Draw(extras, drawOffset + new Vector2(0f, 16f), new Rectangle?(new Rectangle(GetExtraState("middle") + GetExtraVariant(i, j), GetExtraPattern(i) + 18, 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); + +// DrawExtraOverhang(i, j, extras, drawOffset, drawColour); +// } +// } +// private bool CheckTile(int type, bool equal, int x, int y, int i, int j) +// { +// //Subtract y so that y is vertical for ease of readability +// return Main.tile[i + x, j - y].TileType == type == equal; +// } +// private void DrawExtraWallEnds(int i, int j, Texture2D extras, Vector2 drawOffset, Color drawColour) +// { +// /* +// Ending the Extra when a wall is reached +// */ + +// //Left +// if ( +// CheckTile(Type, true, 1, 0, i, j) && CheckTile(Type, false, 1, 1, i, j) && CheckTile(Type, true, 0, 1, i, j) && +// (CheckTile(Type, true, -1, 1, i, j) || CheckTile(Type, false, -1, 0, i, j)) +// ) +// { +// Main.spriteBatch.Draw(extras, drawOffset, new Rectangle?(new Rectangle(GetExtraState("wallEndLeft") + GetExtraVariant(i + 1, j), GetExtraPattern(i), 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); +// Main.spriteBatch.Draw(extras, drawOffset + new Vector2(0f, 16f), new Rectangle?(new Rectangle(GetExtraState("wallEndLeft") + GetExtraVariant(i + 1, j), GetExtraPattern(i) + 18, 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); +// } +// //Right +// if ( +// CheckTile(Type, true, -1, 0, i, j) && CheckTile(Type, false, -1, 1, i, j) && CheckTile(Type, true, 0, 1, i, j) && +// (CheckTile(Type, true, 1, 1, i, j) || CheckTile(Type, false, 1, 0, i, j)) +// ) +// { +// Main.spriteBatch.Draw(extras, drawOffset, new Rectangle?(new Rectangle(GetExtraState("wallEndRight") + GetExtraVariant(i - 1, j), GetExtraPattern(i), 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); +// Main.spriteBatch.Draw(extras, drawOffset + new Vector2(0f, 16f), new Rectangle?(new Rectangle(GetExtraState("wallEndRight") + GetExtraVariant(i - 1, j), GetExtraPattern(i) + 18, 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); +// } +// } +// private void DrawExtraOverhang(int i, int j, Texture2D extras, Vector2 drawOffset, Color drawColour) +// { +// /* +// Called from DrawExtraTop(). Ending the Extra when the edge of the tile is reached +// */ + +// //Left +// if ( +// CheckTile(Type, false, -1, 0, i, j) +// ) +// { +// Main.spriteBatch.Draw(extras, drawOffset + new Vector2(-16f, 0f), new Rectangle?(new Rectangle(GetExtraState("overhangLeft") + GetExtraVariant(i, j), GetExtraPattern(i - 1), 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); +// Main.spriteBatch.Draw(extras, drawOffset + new Vector2(-16f, 16f), new Rectangle?(new Rectangle(GetExtraState("overhangLeft") + GetExtraVariant(i, j), GetExtraPattern(i - 1) + 18, 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); +// } +// //Right +// if ( +// CheckTile(Type, false, 1, 0, i, j) +// ) +// { +// Main.spriteBatch.Draw(extras, drawOffset + new Vector2(16f, 0f), new Rectangle?(new Rectangle(GetExtraState("overhangRight") + GetExtraVariant(i, j), GetExtraPattern(i + 1), 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); +// Main.spriteBatch.Draw(extras, drawOffset + new Vector2(16f, 16f), new Rectangle?(new Rectangle(GetExtraState("overhangRight") + GetExtraVariant(i, j), GetExtraPattern(i + 1) + 18, 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); +// } +// } +// private void DrawExtraDrapes(int i, int j, Texture2D extras, Vector2 drawOffset, Color drawColour) +// { +// /* +// Hanging 'drapes' of the extra element +// */ + +// //Base +// if ( +// (CheckTile(Type, true, 0, 1, i, j) && CheckTile(Type, false, 0, 2, i, j)) || +// (CheckTile(Type, true, 0, 2, i, j) && CheckTile(Type, false, 1, 2, i, j) && CheckTile(Type, false, -1, 2, i, j) && CheckTile(Type, true, 1, 1, i, j) && CheckTile(Type, true, -1, 1, i, j)) +// ) +// { +// Main.spriteBatch.Draw(extras, drawOffset, new Rectangle?(new Rectangle(GetExtraState("middle") + GetExtraVariant(i, j - 1), GetExtraPattern(i) + 18, 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); +// } +// //Left Wall +// if ( +// CheckTile(Type, true, 1, 1, i, j) && CheckTile(Type, false, 1, 2, i, j) && CheckTile(Type, true, 0, 2, i, j) && +// (CheckTile(Type, true, -1, 2, i, j) || CheckTile(Type, false, -1, 1, i, j)) +// ) +// { +// Main.spriteBatch.Draw(extras, drawOffset, new Rectangle?(new Rectangle(GetExtraState("wallEndLeft") + GetExtraVariant(i + 1, j - 1), GetExtraPattern(i) + 18, 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); +// } +// //Right Wall +// if ( +// CheckTile(Type, true, -1, 1, i, j) && CheckTile(Type, false, -1, 2, i, j) && CheckTile(Type, true, 0, 2, i, j) && +// (CheckTile(Type, true, 1, 2, i, j) || CheckTile(Type, false, 1, 1, i, j)) +// ) +// { +// Main.spriteBatch.Draw(extras, drawOffset, new Rectangle?(new Rectangle(GetExtraState("wallEndRight") + GetExtraVariant(i - 1, j - 1), GetExtraPattern(i) + 18, 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); +// } +// //Left Overhang +// if ( +// CheckTile(Type, true, 1, 1, i, j) && CheckTile(Type, false, 0, 1, i, j) && CheckTile(Type, false, 0, 2, i, j) && CheckTile(Type, false, 1, 2, i, j) +// ) +// { +// Main.spriteBatch.Draw(extras, drawOffset, new Rectangle?(new Rectangle(GetExtraState("overhangLeft") + GetExtraVariant(i + 1, j - 1), GetExtraPattern(i) + 18, 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); +// } +// //Right Overhang +// if ( +// CheckTile(Type, true, -1, 1, i, j) && CheckTile(Type, false, 0, 1, i, j) && CheckTile(Type, false, 0, 2, i, j) && CheckTile(Type, false, -1, 2, i, j) +// ) +// { +// Main.spriteBatch.Draw(extras, drawOffset, new Rectangle?(new Rectangle(GetExtraState("overhangRight") + GetExtraVariant(i - 1, j - 1), GetExtraPattern(i) + 18, 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); +// } +// } + +// private int GetExtraState(string type) +// { +// switch (type) +// { +// case "middle": +// return 36; +// case "overhangLeft": +// return 18; +// case "overhangRight": +// return 54; +// case "wallEndLeft": +// return 0; +// case "wallEndRight": +// return 72; +// default: +// Main.NewText(type.ToString() + " is not a valid Extra sheet state"); +// return 0; +// } +// } + +// private int GetExtraPattern(int i) +// { +// return i % 3 * extraFrameHeight; +// } + +// private int GetExtraVariant(int i, int j) +// { +// return Main.tile[i, j].TileFrameNumber * extraFrameWidth; +// } +// } +//} +//#endregion diff --git a/Tiles/SunkenSea/ScarletSeaGrassTile.cs b/Tiles/SunkenSea/ScarletSeaGrassTile.cs new file mode 100644 index 0000000000..03754300a1 --- /dev/null +++ b/Tiles/SunkenSea/ScarletSeaGrassTile.cs @@ -0,0 +1,275 @@ +using System; +using CalamityMod.Systems; +using CalamityMod.Tiles.Abyss.AbyssAmbient; +using CalamityMod.Tiles.SunkenSea.Ambient; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; + + + +namespace CalamityMod.Tiles.SunkenSea +{ + public class ScarletSeaGrassTile : ModTile + { + private int extraFrameHeight = 36; + private int extraFrameWidth = 90; + public override void SetStaticDefaults() + { + TileID.Sets.GeneralPlacementTiles[Type] = false; + + Main.tileSolid[Type] = true; + Main.tileBlockLight[Type] = false; + + CalamityUtils.MergeWithGeneral(Type); + CalamityUtils.MergeWithDesert(Type); + + TileID.Sets.HasSlopeFrames[Type] = true; + TileID.Sets.ChecksForMerge[Type] = true; + TileID.Sets.CanBeDugByShovel[Type] = true; + + DustType = 147; + AddMapEntry(new Color(187, 43, 44)); + + this.RegisterUniversalMerge(TileID.Sandstone, "CalamityMod/Tiles/Merges/SandstoneMerge"); + this.RegisterUniversalMerge(TileID.Sand, "CalamityMod/Tiles/Merges/SandMerge"); + this.RegisterUniversalMerge(TileID.HardenedSand, "CalamityMod/Tiles/Merges/HardenedSandMerge"); + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + public override void DrawEffects(int i, int j, SpriteBatch spriteBatch, ref TileDrawInfo drawData) + { + if (Main.tile[i - 1, j - 1].TileType != Type || Main.tile[i, j - 1].TileType != Type || Main.tile[i + 1, j - 1].TileType != Type || + Main.tile[i - 1, j - 2].TileType != Type || Main.tile[i, j - 2].TileType != Type || Main.tile[i + 1, j - 2].TileType != Type) + { + try + { + Main.instance.TilesRenderer.AddSpecialLegacyPoint(i, j); + } + catch { } + } + } + private Color GetDrawColour(int i, int j) + { + int colType = Main.tile[i, j].TileColor; + Color paintCol = WorldGen.paintColor(colType); + if (colType < 13) + { + paintCol.R = (byte)((paintCol.R / 2f) + 128); + paintCol.G = (byte)((paintCol.G / 2f) + 128); + paintCol.B = (byte)((paintCol.B / 2f) + 128); + } + if (colType == 29) + { + paintCol = Color.Black; + } + Color col = Lighting.GetColor(i, j); + col.R = (byte)(paintCol.R / 255f * col.R); + col.G = (byte)(paintCol.G / 255f * col.G); + col.B = (byte)(paintCol.B / 255f * col.B); + return col; + } + public override void SpecialDraw(int i, int j, SpriteBatch spriteBatch) + { + Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); + Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero; + Color drawColour = GetDrawColour(i, j); + Texture2D leaves = ModContent.Request("CalamityMod/Tiles/SunkenSea/ScarletSeaGrass").Value; + + DrawExtraTop(i, j, leaves, drawOffset, drawColour); + DrawExtraWallEnds(i, j, leaves, drawOffset, drawColour); + DrawExtraDrapes(i, j, leaves, drawOffset, drawColour); + } + + public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) + { + return TileFramingSystem.BetterGemsparkFraming(i, j, resetFrame); + } + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) + { + float brightness = 0.7f; + brightness *= (float)MathF.Sin(-j / 40f + Main.GameUpdateCount * 0.01f + i); + brightness += 0.5f; + r = 187f / 255f; + g = 43f / 255f; + b = 44f / 255f; + r *= brightness; + g *= brightness; + b *= brightness; + } + public override void RandomUpdate(int i, int j) + { + Tile tile = Main.tile[i, j]; + Tile up = Main.tile[i, j - 1]; + Tile up2 = Main.tile[i, j - 2]; + + // Place LongScarletSeagrass + if (WorldGen.genRand.NextBool(1) && !up.HasTile && !up2.HasTile && up.LiquidAmount > 0 && up2.LiquidAmount > 0 && !tile.LeftSlope && !tile.RightSlope && !tile.IsHalfBlock) + { + up.TileType = (ushort)ModContent.TileType(); + up.HasTile = true; + up.TileFrameY = 0; + + // 16 different frames, choose a random one + up.TileFrameX = (short)(WorldGen.genRand.Next(16) * 18); + WorldGen.SquareTileFrame(i, j - 1, true); + + if (Main.dedServ) + NetMessage.SendTileSquare(-1, i, j - 1, 3, TileChangeType.None); + } + } + + #region 'Extra Drapes' Drawing + private void DrawExtraTop(int i, int j, Texture2D extras, Vector2 drawOffset, Color drawColour) + { + /* + If the tile directly above this tile is not otherworldly stone, or if it is, there is air to both sides of that tile, draw the Extra surface + */ + if ( + CheckTile(Type, false, 0, 1, i, j) || + (CheckTile(Type, true, 0, 1, i, j) && CheckTile(Type, false, 1, 1, i, j) && CheckTile(Type, false, -1, 1, i, j) && CheckTile(Type, true, 1, 0, i, j) && CheckTile(Type, true, -1, 0, i, j)) + ) + { + Main.spriteBatch.Draw(extras, drawOffset, new Rectangle?(new Rectangle(GetExtraState("middle") + GetExtraVariant(i, j), GetExtraPattern(i), 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); + Main.spriteBatch.Draw(extras, drawOffset + new Vector2(0f, 16f), new Rectangle?(new Rectangle(GetExtraState("middle") + GetExtraVariant(i, j), GetExtraPattern(i) + 18, 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); + + DrawExtraOverhang(i, j, extras, drawOffset, drawColour); + } + } + private bool CheckTile(int type, bool equal, int x, int y, int i, int j) + { + //Subtract y so that y is vertical for ease of readability + return Main.tile[i + x, j - y].TileType == type == equal; + } + private void DrawExtraWallEnds(int i, int j, Texture2D extras, Vector2 drawOffset, Color drawColour) + { + /* + Ending the Extra when a wall is reached + */ + + //Left + if ( + CheckTile(Type, true, 1, 0, i, j) && CheckTile(Type, false, 1, 1, i, j) && CheckTile(Type, true, 0, 1, i, j) && + (CheckTile(Type, true, -1, 1, i, j) || CheckTile(Type, false, -1, 0, i, j)) + ) + { + Main.spriteBatch.Draw(extras, drawOffset, new Rectangle?(new Rectangle(GetExtraState("wallEndLeft") + GetExtraVariant(i + 1, j), GetExtraPattern(i), 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); + Main.spriteBatch.Draw(extras, drawOffset + new Vector2(0f, 16f), new Rectangle?(new Rectangle(GetExtraState("wallEndLeft") + GetExtraVariant(i + 1, j), GetExtraPattern(i) + 18, 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); + } + //Right + if ( + CheckTile(Type, true, -1, 0, i, j) && CheckTile(Type, false, -1, 1, i, j) && CheckTile(Type, true, 0, 1, i, j) && + (CheckTile(Type, true, 1, 1, i, j) || CheckTile(Type, false, 1, 0, i, j)) + ) + { + Main.spriteBatch.Draw(extras, drawOffset, new Rectangle?(new Rectangle(GetExtraState("wallEndRight") + GetExtraVariant(i - 1, j), GetExtraPattern(i), 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); + Main.spriteBatch.Draw(extras, drawOffset + new Vector2(0f, 16f), new Rectangle?(new Rectangle(GetExtraState("wallEndRight") + GetExtraVariant(i - 1, j), GetExtraPattern(i) + 18, 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); + } + } + private void DrawExtraOverhang(int i, int j, Texture2D extras, Vector2 drawOffset, Color drawColour) + { + /* + Called from DrawExtraTop(). Ending the Extra when the edge of the tile is reached + */ + + //Left + if ( + CheckTile(Type, false, -1, 0, i, j) + ) + { + Main.spriteBatch.Draw(extras, drawOffset + new Vector2(-16f, 0f), new Rectangle?(new Rectangle(GetExtraState("overhangLeft") + GetExtraVariant(i, j), GetExtraPattern(i - 1), 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); + Main.spriteBatch.Draw(extras, drawOffset + new Vector2(-16f, 16f), new Rectangle?(new Rectangle(GetExtraState("overhangLeft") + GetExtraVariant(i, j), GetExtraPattern(i - 1) + 18, 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); + } + //Right + if ( + CheckTile(Type, false, 1, 0, i, j) + ) + { + Main.spriteBatch.Draw(extras, drawOffset + new Vector2(16f, 0f), new Rectangle?(new Rectangle(GetExtraState("overhangRight") + GetExtraVariant(i, j), GetExtraPattern(i + 1), 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); + Main.spriteBatch.Draw(extras, drawOffset + new Vector2(16f, 16f), new Rectangle?(new Rectangle(GetExtraState("overhangRight") + GetExtraVariant(i, j), GetExtraPattern(i + 1) + 18, 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); + } + } + private void DrawExtraDrapes(int i, int j, Texture2D extras, Vector2 drawOffset, Color drawColour) + { + /* + Hanging 'drapes' of the extra element + */ + + //Base + if ( + (CheckTile(Type, true, 0, 1, i, j) && CheckTile(Type, false, 0, 2, i, j)) || + (CheckTile(Type, true, 0, 2, i, j) && CheckTile(Type, false, 1, 2, i, j) && CheckTile(Type, false, -1, 2, i, j) && CheckTile(Type, true, 1, 1, i, j) && CheckTile(Type, true, -1, 1, i, j)) + ) + { + Main.spriteBatch.Draw(extras, drawOffset, new Rectangle?(new Rectangle(GetExtraState("middle") + GetExtraVariant(i, j - 1), GetExtraPattern(i) + 18, 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); + } + //Left Wall + if ( + CheckTile(Type, true, 1, 1, i, j) && CheckTile(Type, false, 1, 2, i, j) && CheckTile(Type, true, 0, 2, i, j) && + (CheckTile(Type, true, -1, 2, i, j) || CheckTile(Type, false, -1, 1, i, j)) + ) + { + Main.spriteBatch.Draw(extras, drawOffset, new Rectangle?(new Rectangle(GetExtraState("wallEndLeft") + GetExtraVariant(i + 1, j - 1), GetExtraPattern(i) + 18, 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); + } + //Right Wall + if ( + CheckTile(Type, true, -1, 1, i, j) && CheckTile(Type, false, -1, 2, i, j) && CheckTile(Type, true, 0, 2, i, j) && + (CheckTile(Type, true, 1, 2, i, j) || CheckTile(Type, false, 1, 1, i, j)) + ) + { + Main.spriteBatch.Draw(extras, drawOffset, new Rectangle?(new Rectangle(GetExtraState("wallEndRight") + GetExtraVariant(i - 1, j - 1), GetExtraPattern(i) + 18, 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); + } + //Left Overhang + if ( + CheckTile(Type, true, 1, 1, i, j) && CheckTile(Type, false, 0, 1, i, j) && CheckTile(Type, false, 0, 2, i, j) && CheckTile(Type, false, 1, 2, i, j) + ) + { + Main.spriteBatch.Draw(extras, drawOffset, new Rectangle?(new Rectangle(GetExtraState("overhangLeft") + GetExtraVariant(i + 1, j - 1), GetExtraPattern(i) + 18, 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); + } + //Right Overhang + if ( + CheckTile(Type, true, -1, 1, i, j) && CheckTile(Type, false, 0, 1, i, j) && CheckTile(Type, false, 0, 2, i, j) && CheckTile(Type, false, -1, 2, i, j) + ) + { + Main.spriteBatch.Draw(extras, drawOffset, new Rectangle?(new Rectangle(GetExtraState("overhangRight") + GetExtraVariant(i - 1, j - 1), GetExtraPattern(i) + 18, 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); + } + } + + private int GetExtraState(string type) + { + switch (type) + { + case "middle": + return 36; + case "overhangLeft": + return 18; + case "overhangRight": + return 54; + case "wallEndLeft": + return 0; + case "wallEndRight": + return 72; + default: + Main.NewText(type.ToString() + " is not a valid Extra sheet state"); + return 0; + } + } + + private int GetExtraPattern(int i) + { + return i % 3 * extraFrameHeight; + } + + private int GetExtraVariant(int i, int j) + { + return Main.tile[i, j].TileFrameNumber * extraFrameWidth; + } + } +} +#endregion diff --git a/Tiles/SunkenSea/ScarletSeaGrassTile.png b/Tiles/SunkenSea/ScarletSeaGrassTile.png new file mode 100644 index 0000000000..561c962c9e Binary files /dev/null and b/Tiles/SunkenSea/ScarletSeaGrassTile.png differ diff --git a/Walls/EutrophicGlassWall.cs b/Walls/EutrophicGlassWall.cs new file mode 100644 index 0000000000..a3faeb192f --- /dev/null +++ b/Walls/EutrophicGlassWall.cs @@ -0,0 +1,34 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; + +namespace CalamityMod.Walls +{ + public class EutrophicGlassWall : MultiVariantModWall + { + public override void SetStaticDefaults() + { + Main.wallHouse[Type] = true; + Main.BackgroundEnabled = true; + Main.wallLight[Type] = true; + + AddMapEntry(new Color(23, 39, 48)); + } + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, DustID.Chlorophyte, 0f, 0f, 1, new Color(255, 255, 255), 1f); + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, DustID.RedTorch, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) => num = fail ? 1 : 3; + + public override void PopulateWallVariant(int i, int j, ref int frameXOffset, ref int frameYOffset) + { + + frameYOffset = (j % 10) * 180; + frameXOffset = (i % 10) * 468; + } + } +} diff --git a/Walls/EutrophicGlassWall.png b/Walls/EutrophicGlassWall.png new file mode 100644 index 0000000000..d1ac8acd11 Binary files /dev/null and b/Walls/EutrophicGlassWall.png differ diff --git a/Walls/PlantyMushWall.cs b/Walls/PlantyMushWall.cs new file mode 100644 index 0000000000..9fb3f4b25d --- /dev/null +++ b/Walls/PlantyMushWall.cs @@ -0,0 +1,60 @@ +using System; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Walls +{ + public class PlantyMushWall : ModWall + { + public static Asset leafTexture = null; + + public static Vector2 TileAdj => (Lighting.Mode == Terraria.Graphics.Light.LightMode.Retro || Lighting.Mode == Terraria.Graphics.Light.LightMode.Trippy) ? Vector2.Zero : Vector2.One * 12; + /*public override bool Autoload(ref string name, ref string texture) + { + mod.AddWall("AstralGrassWallUnsafe", this, texture); + return base.Autoload(ref name, ref texture); + }*/ + public override void SetStaticDefaults() + { + DustType = DustID.Grass; + AddMapEntry(new Color(54, 72, 9)); + if (!Main.dedServ) + { + leafTexture = ModContent.Request("CalamityMod/Walls/PlantyMushWallLeaves"); + } + } + public override void PostDraw(int i, int j, SpriteBatch spriteBatch) + { + if (i > Main.screenPosition.X / 16 && i < Main.screenPosition.X / 16 + Main.screenWidth / 16 && j > Main.screenPosition.Y / 16 && j < Main.screenPosition.Y / 16 + Main.screenHeight / 16) + { + Texture2D tex = leafTexture.Value; + var rand = new Random(i + (j * 100000)); + + float offset = i * j % 6.28f + (float)rand.NextDouble() / 8f; + float sin = (float)Math.Sin(Main.GameUpdateCount / 45f + offset); + + spriteBatch.Draw(tex, (new Vector2(i + 0.5f, j + 0.5f) + TileAdj) * 16 + new Vector2(1, 0.5f) * sin * 2.2f - Main.screenPosition, + new Rectangle(rand.Next(4) * 26, 0, 24, 24), Lighting.GetColor(i, j), offset + sin * 0.09f, new Vector2(12, 12), 1 + sin / 14f, 0, 0); + } + } + + public override void RandomUpdate(int i, int j) + { + if (Main.tile[i, j].LiquidAmount <= 0 && j < Main.maxTilesY - 205) + { + Main.tile[i, j].LiquidAmount = 255; + Main.tile[i, j].Get().LiquidType = LiquidID.Water; + } + } + + public override void KillWall(int i, int j, ref bool fail) => fail = true; + + public override bool CanExplode(int i, int j) => false; + + public override void NumDust(int i, int j, bool fail, ref int num) => num = fail ? 1 : 3; + } +} diff --git a/Walls/PlantyMushWall.png b/Walls/PlantyMushWall.png new file mode 100644 index 0000000000..7eb6849c01 Binary files /dev/null and b/Walls/PlantyMushWall.png differ diff --git a/Walls/PlantyMushWallLeaves.png b/Walls/PlantyMushWallLeaves.png new file mode 100644 index 0000000000..f058242830 Binary files /dev/null and b/Walls/PlantyMushWallLeaves.png differ diff --git a/Waters/SunkenSeaBurrowsWater.png b/Waters/SunkenSeaBurrowsWater.png index eab9dc5435..1dd5bd9f12 100644 Binary files a/Waters/SunkenSeaBurrowsWater.png and b/Waters/SunkenSeaBurrowsWater.png differ diff --git a/Waters/SunkenSeaBurrowsWater_Block.png b/Waters/SunkenSeaBurrowsWater_Block.png index 975fbe6dee..bbf43cea00 100644 Binary files a/Waters/SunkenSeaBurrowsWater_Block.png and b/Waters/SunkenSeaBurrowsWater_Block.png differ diff --git a/Waters/SunkenSeaBurrowsWaterflow.png b/Waters/SunkenSeaBurrowsWaterflow.png index 4a4540f32f..f2ea06818a 100644 Binary files a/Waters/SunkenSeaBurrowsWaterflow.png and b/Waters/SunkenSeaBurrowsWaterflow.png differ diff --git a/Waters/SunkenSeaPolypWater.png b/Waters/SunkenSeaPolypWater.png index ff90d56704..682fb25774 100644 Binary files a/Waters/SunkenSeaPolypWater.png and b/Waters/SunkenSeaPolypWater.png differ diff --git a/Waters/SunkenSeaPolypWater_Block.png b/Waters/SunkenSeaPolypWater_Block.png index 31eaa237d0..1f823d0ea9 100644 Binary files a/Waters/SunkenSeaPolypWater_Block.png and b/Waters/SunkenSeaPolypWater_Block.png differ diff --git a/Waters/SunkenSeaPolypWater_Slope.png b/Waters/SunkenSeaPolypWater_Slope.png index 8c28641b1b..9404893b7c 100644 Binary files a/Waters/SunkenSeaPolypWater_Slope.png and b/Waters/SunkenSeaPolypWater_Slope.png differ diff --git a/Waters/SunkenSeaPolypWaterflow.png b/Waters/SunkenSeaPolypWaterflow.png index 7632d15e9a..ee3de90b50 100644 Binary files a/Waters/SunkenSeaPolypWaterflow.png and b/Waters/SunkenSeaPolypWaterflow.png differ diff --git a/World/Abyss.cs b/World/Abyss.cs index 9bb6d96d14..6ed995d68d 100644 --- a/World/Abyss.cs +++ b/World/Abyss.cs @@ -289,7 +289,7 @@ namespace CalamityMod.World if (WorldGen.genRand.NextBool(2)) { tile.TileType = (ushort)ModContent.TileType(); - tile.WallType = (ushort)ModContent.WallType(); + tile.WallType = (ushort)ModContent.WallType(); } else { @@ -307,7 +307,7 @@ namespace CalamityMod.World else { tile.TileType = (ushort)ModContent.TileType(); - tile.WallType = (ushort)ModContent.WallType(); + tile.WallType = (ushort)ModContent.WallType(); } } } diff --git a/World/SunkenSea.cs b/World/SunkenSea.cs index d867a23cac..562abd2448 100644 --- a/World/SunkenSea.cs +++ b/World/SunkenSea.cs @@ -751,11 +751,35 @@ namespace CalamityMod.World if (canPlaceSand) { - PlaceSand(X, Y, 5, ModContent.TileType()); + PlaceSand(X, Y, 4, ModContent.TileType()); + } + + } + } + }); + ForLoop.Invoke(origin.X - biomeSize - 3, origin.X + biomeSize + 3, 1, (X) => + { + for (int Y = (int)(origin.Y - verticalRadius * 0.4f) - 20; Y <= origin.Y + verticalRadius + 20; Y++) + { + if (CheckInBiomeArea(new Point(X, Y), topFoci, bottomFoci, constant, center, out float dist, false, Y > origin.Y)) + { + bool canPlaceGrass = false; + + //place sand clumps on top of exposed limestone + if (Main.tile[X, Y].TileType == ModContent.TileType() && !Main.tile[X, Y - 1].HasTile && !Main.tile[X, Y - 2].HasTile && + !Main.tile[X, Y - 3].HasTile && !Main.tile[X, Y - 4].HasTile && !Main.tile[X, Y - 5].HasTile) + { + canPlaceGrass = true; + } + + if (canPlaceGrass) + { + PlaceSand(X, Y, 0, ModContent.TileType()); } } } }); + //cleanup again ForLoop.Invoke(origin.X - biomeSize - 3, origin.X + biomeSize + 3, 1, (X) => @@ -1413,7 +1437,7 @@ namespace CalamityMod.World WorldGen.PlaceObject(X, Y + 1, WorldGen.genRand.Next(BranchCorals), true, 0, 0, 6); } } - if (Main.tile[X, Y].TileType == ModContent.TileType()) + if (Main.tile[X, Y].TileType == ModContent.TileType()) { //BranchCoralsOnSand if (WorldGen.genRand.NextBool(15))