Small push
This commit is contained in:
1 parent
8e37d6f092
commit
273580985a
6 files changed
+122
No files matched your search
@@ -0,0 +1,29 @@
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Items.Placeables.FurnitureWulfrum;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using WallTiles = CalamityMod.Walls;
|
||||
|
||||
namespace CalamityMod.Items.Placeables.Walls
|
||||
{
|
||||
public class WulfrumComplexPanelWall : ModItem, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Placeables";
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Item.ResearchUnlockCount = 400;
|
||||
}
|
||||
|
||||
public override void SetDefaults() => Item.DefaultToPlaceableWall(ModContent.WallType<WallTiles.WulfrumComplexPanelWall>());
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe(8).
|
||||
AddIngredient<AnodizedWulfrumMetal>().
|
||||
AddIngredient<WulfrumMetalScrap>().
|
||||
AddIngredient<AnodizedWulfrumMetal>().
|
||||
AddTile(TileID.WorkBenches).
|
||||
Register();
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 315 B |
@@ -0,0 +1,93 @@
|
||||
using System;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using ReLogic.Content;
|
||||
using Terraria;
|
||||
using Terraria.GameContent;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Walls
|
||||
{
|
||||
public class WulfrumComplexPanelWall : ModWall
|
||||
{
|
||||
internal static FramedMaskTexture GlowMask;
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
GlowMask = new("CalamityMod/Walls/WulfrumComplexPanelWall_Glow", 36, 36);
|
||||
|
||||
Main.wallHouse[Type] = true;
|
||||
Main.wallLight[Type] = true;
|
||||
AddMapEntry(new Color(116, 153, 40));
|
||||
}
|
||||
|
||||
public override void Unload()
|
||||
{
|
||||
GlowMask?.Unload();
|
||||
GlowMask = null;
|
||||
}
|
||||
|
||||
public override bool CreateDust(int i, int j, ref int type)
|
||||
{
|
||||
Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, DustID.DungeonSpirit, 0f, 0f, 1, new Color(255, 255, 255), 1f);
|
||||
return false;
|
||||
}
|
||||
public static void DrawWallGlow(int wallType, int i, int j, SpriteBatch spriteBatch)
|
||||
{
|
||||
if (GlowMask.Texture is null)
|
||||
return;
|
||||
|
||||
Tile tile = Main.tile[i, j];
|
||||
int xLength = 32;
|
||||
int xOff = 0;
|
||||
|
||||
int xPos = tile.WallFrameX + xOff;
|
||||
int yPos = tile.WallFrameY;
|
||||
|
||||
Rectangle frame = new Rectangle(xPos, yPos, xLength, 32);
|
||||
Color drawcolor;
|
||||
drawcolor = WorldGen.paintColor(tile.WallColor);
|
||||
drawcolor.A = 255;
|
||||
Vector2 zero = new Vector2(Main.offScreenRange, Main.offScreenRange);
|
||||
|
||||
if (Main.drawToScreen)
|
||||
zero = Vector2.Zero;
|
||||
|
||||
Vector2 pos = new Vector2(i * 16 - (int)Main.screenPosition.X, j * 16 - (int)Main.screenPosition.Y) + zero;
|
||||
Color lightColor = Lighting.GetColor(i, j, Color.White);
|
||||
|
||||
spriteBatch.Draw(TextureAssets.Wall[wallType].Value, pos + new Vector2(-8 + xOff, -8), frame, lightColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f);
|
||||
|
||||
if (GlowMask.HasContentInFramePos(xPos, yPos))
|
||||
{
|
||||
float brightness = MathHelper.Clamp(0.2f - (j / 680), 0f, 0.2f);
|
||||
|
||||
float time = Main.GameUpdateCount;
|
||||
float waveScale1 = time * 0.064f;
|
||||
int scalar = i - (j / 2);
|
||||
float wave1 = waveScale1 * -50 + scalar * 12;
|
||||
float wave1angle = 0.30f + 0.25f * MathF.Sin(MathHelper.ToRadians(wave1));
|
||||
|
||||
drawcolor *= brightness;
|
||||
|
||||
float transparency = 0.02f + (wave1angle / 4);
|
||||
Color glowColor = Color.White * transparency;
|
||||
|
||||
for (int k = 0; k < 3; k++)
|
||||
{
|
||||
//Vector2 offset = new Vector2(Main.rand.NextFloat(-1, 1f), Main.rand.NextFloat(-1, 1f)) * 0.2f * k;
|
||||
spriteBatch.Draw(GlowMask.Texture, pos + new Vector2(-8 + xOff, -8), frame, glowColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override bool PreDraw(int i, int j, SpriteBatch spriteBatch)
|
||||
{
|
||||
DrawWallGlow(Type, i, j, spriteBatch);
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void NumDust(int i, int j, bool fail, ref int num) => num = fail ? 1 : 3;
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 8.7 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 693 B |
Binary file not shown.
|
Before Width: | Height: | Size: 7.0 KiB After Width: | Height: | Size: 7.0 KiB |
Reference in new issue
Block a user