- 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
74 lines
2.9 KiB
C#
74 lines
2.9 KiB
C#
using CalamityMod.Dusts;
|
|
using Microsoft.Xna.Framework;
|
|
using Microsoft.Xna.Framework.Graphics;
|
|
using Terraria;
|
|
using Terraria.GameContent.Metadata;
|
|
using Terraria.ID;
|
|
using Terraria.ModLoader;
|
|
|
|
namespace CalamityMod.Tiles.Astral
|
|
{
|
|
public class AstralDirt : ModTile
|
|
{
|
|
public byte[,] tileAdjacency;
|
|
public byte[,] secondTileAdjacency;
|
|
public override void SetStaticDefaults()
|
|
{
|
|
Main.tileSolid[Type] = true;
|
|
Main.tileBlockLight[Type] = true;
|
|
TileMaterials.SetForTileId(Type, TileMaterials._materialsByName["Dirt"]);
|
|
|
|
CalamityUtils.MergeWithGeneral(Type);
|
|
CalamityUtils.MergeAstralTiles(Type);
|
|
CalamityUtils.MergeWithOres(Type);
|
|
CalamityUtils.SetMerge(Type, TileID.Grass);
|
|
CalamityUtils.SetMerge(Type, TileID.CorruptGrass);
|
|
CalamityUtils.SetMerge(Type, TileID.HallowedGrass);
|
|
CalamityUtils.SetMerge(Type, TileID.CrimsonGrass);
|
|
|
|
DustType = ModContent.DustType<AstralBasic>();
|
|
|
|
AddMapEntry(new Color(59, 50, 77));
|
|
|
|
TileID.Sets.ChecksForMerge[Type] = true;
|
|
TileID.Sets.CanBeDugByShovel[Type] = true;
|
|
TileID.Sets.CanBeClearedDuringOreRunner[Type] = true;
|
|
|
|
|
|
TileFraming.SetUpUniversalMerge(Type, TileID.Dirt, out tileAdjacency);
|
|
TileFraming.SetUpUniversalMerge(Type, TileID.Stone, out secondTileAdjacency);
|
|
}
|
|
|
|
public override void PostDraw(int i, int j, SpriteBatch spriteBatch)
|
|
{
|
|
TileFraming.DrawUniversalMergeFrames(i, j, secondTileAdjacency, "CalamityMod/Tiles/Merges/StoneMerge");
|
|
TileFraming.DrawUniversalMergeFrames(i, j, tileAdjacency, "CalamityMod/Tiles/Merges/DirtMerge");
|
|
}
|
|
|
|
public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak)
|
|
{
|
|
TileFraming.GetAdjacencyData(i, j, TileID.Dirt, out tileAdjacency[i, j]);
|
|
TileFraming.GetAdjacencyData(i, j, TileID.Stone, out secondTileAdjacency[i, j]);
|
|
return true;
|
|
}
|
|
|
|
public override void RandomUpdate(int i, int j)
|
|
{
|
|
//Make sure that astral grass only spreads to adjacent tiles, as opposed to appearing out of thin air
|
|
Tile up = Main.tile[i, j - 1];
|
|
Tile down = Main.tile[i, j + 1];
|
|
Tile left = Main.tile[i - 1, j];
|
|
Tile right = Main.tile[i + 1, j];
|
|
if (WorldGen.genRand.NextBool(3) && (up.TileType == ModContent.TileType<AstralGrass>() || down.TileType == ModContent.TileType<AstralGrass>() || left.TileType == ModContent.TileType<AstralGrass>() || right.TileType == ModContent.TileType<AstralGrass>()))
|
|
{
|
|
WorldGen.SpreadGrass(i, j, Type, ModContent.TileType<AstralGrass>(), false);
|
|
}
|
|
}
|
|
|
|
public override void NumDust(int i, int j, bool fail, ref int num)
|
|
{
|
|
num = fail ? 1 : 3;
|
|
}
|
|
}
|
|
}
|