diff --git a/Tiles/FurnitureOtherworldly/OtherworldlyStone.cs b/Tiles/FurnitureOtherworldly/OtherworldlyStone.cs index 3948395809..1d736949b8 100644 --- a/Tiles/FurnitureOtherworldly/OtherworldlyStone.cs +++ b/Tiles/FurnitureOtherworldly/OtherworldlyStone.cs @@ -1,6 +1,8 @@ using CalamityMod.Dusts.Furniture; +using CalamityMod.Systems; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; using Terraria; using Terraria.DataStructures; using Terraria.ID; @@ -11,11 +13,15 @@ namespace CalamityMod.Tiles.FurnitureOtherworldly [LegacyName("OccultStone")] public class OtherworldlyStone : ModTile { + public Asset ClothTexture; + private int extraFrameHeight = 36; private int extraFrameWidth = 90; public override void SetStaticDefaults() { + ClothTexture = ModContent.Request("CalamityMod/Tiles/FurnitureOtherworldly/OtherworldlyStone_Cloth"); + Main.tileSolid[Type] = true; Main.tileMergeDirt[Type] = false; Main.tileBlockLight[Type] = true; @@ -36,16 +42,25 @@ namespace CalamityMod.Tiles.FurnitureOtherworldly return false; } - public override void DrawEffects(int i, int j, SpriteBatch spriteBatch, ref TileDrawInfo drawData) + public override void PostTileFrame(int i, int j, int up, int down, int left, int right, int upLeft, int upRight, int downLeft, int downRight) { 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 { } + Main.tile[i, j].Get().HasSpecialPoint = true; + } + else + { + Main.tile[i, j].Get().HasSpecialPoint = false; + } + + } + + public override void DrawEffects(int i, int j, SpriteBatch spriteBatch, ref TileDrawInfo drawData) + { + if (Main.tile[i, j].Get().HasSpecialPoint) + { + Main.instance.TilesRenderer.AddSpecialLegacyPoint(i, j); } } @@ -57,7 +72,7 @@ namespace CalamityMod.Tiles.FurnitureOtherworldly 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 = CalamityUtils.ApplyPaint(Main.tile[i, j].TileColor, Lighting.GetColor(i, j), false); - Texture2D cloth = ModContent.Request("CalamityMod/Tiles/FurnitureOtherworldly/OtherworldlyStone_Cloth").Value; + Texture2D cloth = ClothTexture.Value; DrawExtraTop(i, j, cloth, drawOffset, drawColour); DrawExtraWallEnds(i, j, cloth, drawOffset, drawColour); diff --git a/Tiles/UelibloomBrick.cs b/Tiles/UelibloomBrick.cs index c5db4bca43..d4f08a90bf 100644 --- a/Tiles/UelibloomBrick.cs +++ b/Tiles/UelibloomBrick.cs @@ -2,6 +2,7 @@ using CalamityMod.Systems; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; using Terraria; using Terraria.DataStructures; using Terraria.GameContent.Metadata; @@ -12,11 +13,15 @@ namespace CalamityMod.Tiles { public class UelibloomBrick : ModTile { + public Asset LeavesTexture; + private int extraFrameHeight = 36; private int extraFrameWidth = 90; public override void SetStaticDefaults() { + LeavesTexture = ModContent.Request("CalamityMod/Tiles/UelibloomBrick_Leaves"); + Main.tileSolid[Type] = true; Main.tileMergeDirt[Type] = false; Main.tileBlockLight[Type] = true; @@ -41,16 +46,24 @@ namespace CalamityMod.Tiles return false; } - public override void DrawEffects(int i, int j, SpriteBatch spriteBatch, ref TileDrawInfo drawData) + public override void PostTileFrame(int i, int j, int up, int down, int left, int right, int upLeft, int upRight, int downLeft, int downRight) { 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 { } + Main.tile[i, j].Get().HasSpecialPoint = true; + } + else + { + Main.tile[i, j].Get().HasSpecialPoint = false; + } + } + + public override void DrawEffects(int i, int j, SpriteBatch spriteBatch, ref TileDrawInfo drawData) + { + if (Main.tile[i, j].Get().HasSpecialPoint) + { + Main.instance.TilesRenderer.AddSpecialLegacyPoint(i, j); } } @@ -62,7 +75,7 @@ namespace CalamityMod.Tiles 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 = CalamityUtils.ApplyPaint(Main.tile[i, j].TileColor, Lighting.GetColor(i, j), false); - Texture2D leaves = ModContent.Request("CalamityMod/Tiles/UelibloomBrick_Leaves").Value; + Texture2D leaves = LeavesTexture.Value; DrawExtraTop(i, j, leaves, drawOffset, drawColour); DrawExtraWallEnds(i, j, leaves, drawOffset, drawColour);