Files
CalamityModPublic/Tiles/DraedonStructures/LaboratoryScreen.cs
T
GinYuH 74b7abc666 a lot of fixes
1- Boss checklist reordering
2- Fixed Temporal Bats dealing rogue damage
3- Fixed Mineral Mortar shark rotations
4- Adjusted glowmask for dropped Eradicator.
5- Astral Arcanum rarity and price fixes
6- Removed boss Draconic Swarmer's bestiary entry
7- Fixed Brimseeker balls dealing no damage
8- Repair Units can no longer be homed in on
9- Fixed Lab/Exo Screens not breaking with walls
10- Anechoic Coating buff grammar fix
11- Bouncy Spiky Ball spelling fixes
12- Correct Seeking Scorcher pierce amount in tooltip
13- Virid Vanguard grammar fix
2022-06-13 11:21:08 -04:00

59 lines
2.5 KiB
C#

using CalamityMod.Items.Placeables.DraedonStructures;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;
using Terraria.ObjectData;
namespace CalamityMod.Tiles.DraedonStructures
{
public class LaboratoryScreen : ModTile
{
public override void SetStaticDefaults()
{
Main.tileFrameImportant[Type] = true;
Main.tileLavaDeath[Type] = false;
TileObjectData.newTile.CopyFrom(TileObjectData.Style3x3Wall);
TileObjectData.newTile.Height = 2;
TileObjectData.newTile.CoordinateHeights = new[] { 16, 16 };
TileObjectData.newTile.LavaDeath = false;
TileObjectData.addTile(Type);
ModTranslation name = CreateMapEntryName();
name.SetDefault("Screen");
AddMapEntry(Color.DarkGray, name);
TileID.Sets.FramesOnKillWall[Type] = true;
DustType = 8;
}
public override bool CanExplode(int i, int j) => false;
public override void NumDust(int i, int j, bool fail, ref int num)
{
num = fail ? 1 : 3;
}
public override void KillMultiTile(int i, int j, int frameX, int frameY)
{
Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 16, 32, ModContent.ItemType<LaboratoryScreenItem>());
}
public override void PostDraw(int i, int j, SpriteBatch spriteBatch)
{
int xFrameOffset = Main.tile[i, j].TileFrameX;
int yFrameOffset = Main.tile[i, j].TileFrameY;
Texture2D glowmask = ModContent.Request<Texture2D>("CalamityMod/Tiles/DraedonStructures/LaboratoryScreenGlow").Value;
Vector2 drawOffest = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange);
Vector2 drawPosition = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + drawOffest;
Color drawColour = Color.White;
Tile trackTile = Main.tile[i, j];
if (!trackTile.IsHalfBlock && trackTile.Slope == 0)
spriteBatch.Draw(glowmask, drawPosition, new Rectangle(xFrameOffset, yFrameOffset, 18, 18), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f);
else if (trackTile.IsHalfBlock)
spriteBatch.Draw(glowmask, drawPosition + new Vector2(0f, 8f), new Rectangle(xFrameOffset, yFrameOffset, 18, 8), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f);
}
}
}