Files
CalamityModPublic/Tiles/FurnitureStratus/StratusBricks.cs
T
Altixal 4c24f6ddbf Tile map localization complete
- Consistent cage map colors to vanilla
- Consistent map entry with Thank You painting
- Removed map entry names from vines
- Removed map entry names from some common decorative blocks
- Cleaned up the other furnitures and item drops
2023-04-23 04:47:05 +07:00

65 lines
2.4 KiB
C#

using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Tiles.FurnitureStratus
{
public class StratusBricks : ModTile
{
public override void SetStaticDefaults()
{
Main.tileSolid[Type] = true;
Main.tileBlockLight[Type] = true;
TileID.Sets.HasSlopeFrames[Type] = true;
CalamityUtils.MergeWithGeneral(Type);
HitSound = SoundID.Tink;
MineResist = 3f;
AddMapEntry(new Color(53, 57, 74));
}
public override bool CreateDust(int i, int j, ref int type)
{
Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 1, 0f, 0f, 1, new Color(100, 130, 150), 1f);
Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 132, 0f, 0f, 1, new Color(255, 255, 255), 1f);
return false;
}
public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak)
{
return TileFraming.BetterGemsparkFraming(i, j, resetFrame);
}
public override void PostDraw(int i, int j, SpriteBatch spriteBatch)
{
int xPos = Main.tile[i, j].TileFrameX;
int yPos = Main.tile[i, j].TileFrameY;
Texture2D glowmask = ModContent.Request<Texture2D>("CalamityMod/Tiles/FurnitureStratus/StratusBricksGlow").Value;
Color drawColour = GetDrawColour(i, j, new Color(100, 100, 100, 100));
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;
Tile trackTile = Main.tile[i, j];
double num6 = Main.time * 0.08;
TileFraming.SlopedGlowmask(i, j, 0, glowmask, drawOffset, null, GetDrawColour(i, j, drawColour), default);
}
private Color GetDrawColour(int i, int j, Color colour)
{
int colType = Main.tile[i, j].TileColor;
Color paintCol = WorldGen.paintColor(colType);
if (colType >= 13 && colType <= 24)
{
colour.R = (byte)(paintCol.R / 255f * colour.R);
colour.G = (byte)(paintCol.G / 255f * colour.G);
colour.B = (byte)(paintCol.B / 255f * colour.B);
}
return colour;
}
}
}