Exemple #1
0
        public override bool PreDraw(int i, int j, SpriteBatch spriteBatch)
        {
            TileEntities.Quarry quarry = Utility.GetTileEntity <TileEntities.Quarry>(i, j);
            if (quarry == null || !Main.tile[i, j].IsTopLeft())
            {
                return(false);
            }

            Texture2D texture  = ModContent.GetTexture(Texture);
            Vector2   position = quarry.Position.ToScreenCoordinates();

            spriteBatch.Draw(texture, position + new Vector2(24), null, Color.White, quarry.Angle - MathHelper.PiOver2, new Vector2(24), Vector2.One, SpriteEffects.None, 0f);

            if (quarry.Targetted)
            {
                Main.instance.LoadProjectile(632);
                DelegateMethods.f_1 = 1f;
                DelegateMethods.c_1 = Color.Red * 0.9f;

                Vector2 beamStart = position + new Vector2(24) + 30 * quarry.Angle.ToRotationVector2();
                Utils.DrawLaser(spriteBatch, Main.projectileTexture[632], beamStart, beamStart + quarry.Angle.ToRotationVector2() * quarry.Lenght, Vector2.One * 0.5f, DelegateMethods.RainbowLaserDraw);
            }

            return(false);
        }
Exemple #2
0
        public override void KillMultiTile(int i, int j, int frameX, int frameY)
        {
            TileEntities.Quarry quarry = Utility.GetTileEntity <TileEntities.Quarry>(i, j);

            BaseLibrary.BaseLibrary.PanelGUI.UI.CloseUI(quarry);

            Item.NewItem(i * 16, j * 16, 48, 48, mod.ItemType <Items.Quarry>());
            quarry.Kill(i, j);
        }
Exemple #3
0
        public override void SpecialDraw(int i, int j, SpriteBatch spriteBatch)
        {
            TileEntities.Quarry quarry = Utility.GetTileEntity <TileEntities.Quarry>(i, j);
            if (quarry == null || !Main.tile[i, j].IsTopLeft())
            {
                return;
            }

            Vector2 position = quarry.CurrentTile.ToScreenCoordinates();

            spriteBatch.Draw(Main.magicPixel, new Rectangle((int)position.X, (int)position.Y, 16, 16), Color.Red * 0.5f);
        }
Exemple #4
0
        public override void RightClick(int i, int j)
        {
            TileEntities.Quarry quarry = Utility.GetTileEntity <TileEntities.Quarry>(i, j);

            BaseLibrary.BaseLibrary.PanelGUI.UI.HandleUI(quarry);
        }