90 lines
3.9 KiB
C#
90 lines
3.9 KiB
C#
using CalamityMod.Dusts;
|
|
using Microsoft.Xna.Framework;
|
|
using Microsoft.Xna.Framework.Graphics;
|
|
using CalamityMod.Items.Placeables;
|
|
using Terraria;
|
|
using Terraria.DataStructures;
|
|
using Terraria.Enums;
|
|
using Terraria.GameContent;
|
|
using Terraria.ModLoader;
|
|
using Terraria.ObjectData;
|
|
|
|
namespace CalamityMod.Tiles.Rubblemaker.Abyss
|
|
{
|
|
public class BulbTree1Echo : ModTile
|
|
{
|
|
public override string Texture => "CalamityMod/Tiles/Abyss/AbyssAmbient/BulbTree1";
|
|
public override void SetStaticDefaults()
|
|
{
|
|
Main.tileLighted[Type] = true;
|
|
Main.tileFrameImportant[Type] = true;
|
|
TileObjectData.newTile.Width = 3;
|
|
TileObjectData.newTile.Height = 3;
|
|
TileObjectData.newTile.Origin = new Point16(1, 2);
|
|
TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.SolidWithTop | AnchorType.Table | AnchorType.SolidSide, TileObjectData.newTile.Width, 0);
|
|
TileObjectData.newTile.UsesCustomCanPlace = true;
|
|
TileObjectData.newTile.CoordinateHeights = new int[] { 16, 16, 16 };
|
|
TileObjectData.newTile.CoordinateWidth = 16;
|
|
TileObjectData.newTile.CoordinatePadding = 2;
|
|
TileObjectData.newTile.WaterDeath = false;
|
|
TileObjectData.newTile.LavaDeath = true;
|
|
TileObjectData.newTile.DrawYOffset = 2;
|
|
TileObjectData.addTile(Type);
|
|
AddMapEntry(new Color(52, 124, 153));
|
|
DustType = 33;
|
|
|
|
RegisterItemDrop(ModContent.ItemType<Voidstone>());
|
|
FlexibleTileWand.RubblePlacementLarge.AddVariations(ModContent.ItemType<Voidstone>(), Type, 0);
|
|
|
|
base.SetStaticDefaults();
|
|
}
|
|
|
|
public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b)
|
|
{
|
|
r = 49f / 500f;
|
|
g = 159f / 500f;
|
|
b = 242f / 500f;
|
|
}
|
|
|
|
public override void NumDust(int i, int j, bool fail, ref int num)
|
|
{
|
|
num = fail ? 1 : 2;
|
|
}
|
|
|
|
public override void PostDraw(int i, int j, SpriteBatch spriteBatch)
|
|
{
|
|
Tile tile = Framing.GetTileSafely(i, j);
|
|
Texture2D tex = ModContent.Request<Texture2D>("CalamityMod/Tiles/Abyss/AbyssAmbient/BulbTree1Glow").Value;
|
|
Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange, Main.offScreenRange);
|
|
|
|
spriteBatch.Draw(tex, new Vector2(i * 16, j * 16 + 2) - Main.screenPosition + zero, new Rectangle(tile.TileFrameX, tile.TileFrameY, 16, 16), Color.White);
|
|
}
|
|
}
|
|
|
|
public class BulbTree2Echo : BulbTree1Echo
|
|
{
|
|
public override string Texture => "CalamityMod/Tiles/Abyss/AbyssAmbient/BulbTree2";
|
|
public override void PostDraw(int i, int j, SpriteBatch spriteBatch)
|
|
{
|
|
Tile tile = Framing.GetTileSafely(i, j);
|
|
Texture2D tex = ModContent.Request<Texture2D>("CalamityMod/Tiles/Abyss/AbyssAmbient/BulbTree2Glow").Value;
|
|
Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange, Main.offScreenRange);
|
|
|
|
spriteBatch.Draw(tex, new Vector2(i * 16, j * 16 + 2) - Main.screenPosition + zero, new Rectangle(tile.TileFrameX, tile.TileFrameY, 16, 16), Color.White);
|
|
}
|
|
}
|
|
|
|
public class BulbTree3Echo : BulbTree1Echo
|
|
{
|
|
public override string Texture => "CalamityMod/Tiles/Abyss/AbyssAmbient/BulbTree3";
|
|
public override void PostDraw(int i, int j, SpriteBatch spriteBatch)
|
|
{
|
|
Tile tile = Framing.GetTileSafely(i, j);
|
|
Texture2D tex = ModContent.Request<Texture2D>("CalamityMod/Tiles/Abyss/AbyssAmbient/BulbTree3Glow").Value;
|
|
Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange, Main.offScreenRange);
|
|
|
|
spriteBatch.Draw(tex, new Vector2(i * 16, j * 16 + 2) - Main.screenPosition + zero, new Rectangle(tile.TileFrameX, tile.TileFrameY, 16, 16), Color.White);
|
|
}
|
|
}
|
|
}
|