Applied HasSpecialPoint to OtherwordlyStone and UelibloomBrick
This commit is contained in:
1 parent
3a1424fa5e
commit
eb462c19aa
2 files changed
+42
-14
No files matched your search
@@ -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<Texture2D> ClothTexture;
|
||||
|
||||
private int extraFrameHeight = 36;
|
||||
private int extraFrameWidth = 90;
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
ClothTexture = ModContent.Request<Texture2D>("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<TileSpecialDrawData>().HasSpecialPoint = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
Main.tile[i, j].Get<TileSpecialDrawData>().HasSpecialPoint = false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public override void DrawEffects(int i, int j, SpriteBatch spriteBatch, ref TileDrawInfo drawData)
|
||||
{
|
||||
if (Main.tile[i, j].Get<TileSpecialDrawData>().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<Texture2D>("CalamityMod/Tiles/FurnitureOtherworldly/OtherworldlyStone_Cloth").Value;
|
||||
Texture2D cloth = ClothTexture.Value;
|
||||
|
||||
DrawExtraTop(i, j, cloth, drawOffset, drawColour);
|
||||
DrawExtraWallEnds(i, j, cloth, drawOffset, drawColour);
|
||||
|
||||
+20
-7
@@ -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<Texture2D> LeavesTexture;
|
||||
|
||||
private int extraFrameHeight = 36;
|
||||
private int extraFrameWidth = 90;
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
LeavesTexture = ModContent.Request<Texture2D>("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<TileSpecialDrawData>().HasSpecialPoint = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
Main.tile[i, j].Get<TileSpecialDrawData>().HasSpecialPoint = false;
|
||||
}
|
||||
}
|
||||
|
||||
public override void DrawEffects(int i, int j, SpriteBatch spriteBatch, ref TileDrawInfo drawData)
|
||||
{
|
||||
if (Main.tile[i, j].Get<TileSpecialDrawData>().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<Texture2D>("CalamityMod/Tiles/UelibloomBrick_Leaves").Value;
|
||||
Texture2D leaves = LeavesTexture.Value;
|
||||
|
||||
DrawExtraTop(i, j, leaves, drawOffset, drawColour);
|
||||
DrawExtraWallEnds(i, j, leaves, drawOffset, drawColour);
|
||||
|
||||
Reference in new issue
Block a user