diff --git a/Items/Placeables/Walls/ChargedWulfrumEnergyBarrierWall.cs b/Items/Placeables/Walls/ChargedWulfrumEnergyBarrierWall.cs new file mode 100644 index 0000000000..e54857d01b --- /dev/null +++ b/Items/Placeables/Walls/ChargedWulfrumEnergyBarrierWall.cs @@ -0,0 +1,26 @@ +using CalamityMod.Items.Placeables.FurnitureWulfrum; +using Terraria.ID; +using Terraria.ModLoader; +using WallTiles = CalamityMod.Walls; + +namespace CalamityMod.Items.Placeables.Walls +{ + public class ChargedWulfrumEnergyBarrierWall : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetStaticDefaults() + { + Item.ResearchUnlockCount = 400; + } + + public override void SetDefaults() => Item.DefaultToPlaceableWall(ModContent.WallType()); + + public override void AddRecipes() + { + CreateRecipe(4). + AddIngredient(). + AddTile(TileID.WorkBenches). + Register(); + } + } +} diff --git a/Items/Placeables/Walls/ChargedWulfrumEnergyBarrierWall.png b/Items/Placeables/Walls/ChargedWulfrumEnergyBarrierWall.png new file mode 100644 index 0000000000..f179d2db1e Binary files /dev/null and b/Items/Placeables/Walls/ChargedWulfrumEnergyBarrierWall.png differ diff --git a/Items/Placeables/Walls/WulfrumEnergyBarrierWall.cs b/Items/Placeables/Walls/WulfrumEnergyBarrierWall.cs new file mode 100644 index 0000000000..7ce9e493b5 --- /dev/null +++ b/Items/Placeables/Walls/WulfrumEnergyBarrierWall.cs @@ -0,0 +1,26 @@ +using CalamityMod.Items.Placeables.FurnitureWulfrum; +using Terraria.ID; +using Terraria.ModLoader; +using WallTiles = CalamityMod.Walls; + +namespace CalamityMod.Items.Placeables.Walls +{ + public class WulfrumEnergyBarrierWall : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetStaticDefaults() + { + Item.ResearchUnlockCount = 400; + } + + public override void SetDefaults() => Item.DefaultToPlaceableWall(ModContent.WallType()); + + public override void AddRecipes() + { + CreateRecipe(4). + AddIngredient(). + AddTile(TileID.WorkBenches). + Register(); + } + } +} diff --git a/Items/Placeables/Walls/WulfrumEnergyBarrierWall.png b/Items/Placeables/Walls/WulfrumEnergyBarrierWall.png new file mode 100644 index 0000000000..212f4a7a8c Binary files /dev/null and b/Items/Placeables/Walls/WulfrumEnergyBarrierWall.png differ diff --git a/Localization/en-US/Mods.CalamityMod.Items.Placeables.hjson b/Localization/en-US/Mods.CalamityMod.Items.Placeables.hjson index c1baef275c..159ae929e0 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Placeables.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Placeables.hjson @@ -4213,3 +4213,13 @@ ChargedWulfrumEnergyBarrier: { DisplayName: Charged Wulfrum Energy Barrier Tooltip: "" } + +WulfrumEnergyBarrierWall: { + DisplayName: Wulfrum Energy Barrier Wall + Tooltip: "" +} + +ChargedWulfrumEnergyBarrierWall: { + DisplayName: Charged Wulfrum Energy Barrier Wall + Tooltip: "" +} diff --git a/Tiles/FurnitureWulfrum/ChargedWulfrumEnergyBarrier.cs b/Tiles/FurnitureWulfrum/ChargedWulfrumEnergyBarrier.cs index 79446da139..347f591e44 100644 --- a/Tiles/FurnitureWulfrum/ChargedWulfrumEnergyBarrier.cs +++ b/Tiles/FurnitureWulfrum/ChargedWulfrumEnergyBarrier.cs @@ -43,9 +43,9 @@ namespace CalamityMod.Tiles.FurnitureWulfrum Color value = Color.Lerp(cyan, blue, (MathF.Sin(-j / 80f + Main.GameUpdateCount * 0.017f + i / 40f) + 1f) / 2f); Color value1 = Color.Lerp(cyan, blue, (MathF.Sin((j - 100) / 50f + Main.GameUpdateCount * 0.004f + -i / 30f) + 1f) / 2f); - r = (value.R + value1.R) / 900f; - g = (value.G + value1.G) / 900f; - b = (value.B + value1.B) / 900f; + r = (value.R + value1.R) / 800f; + g = (value.G + value1.G) / 800f; + b = (value.B + value1.B) / 800f; r *= brightness; g *= brightness; b *= brightness; diff --git a/Tiles/FurnitureWulfrum/WulfrumEnergyBarrier.cs b/Tiles/FurnitureWulfrum/WulfrumEnergyBarrier.cs index aea77d80b8..872f025b5c 100644 --- a/Tiles/FurnitureWulfrum/WulfrumEnergyBarrier.cs +++ b/Tiles/FurnitureWulfrum/WulfrumEnergyBarrier.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Tiles.FurnitureWulfrum CalamityUtils.MergeDecorativeTiles(Type); DustType = 108; - AddMapEntry(new Color(110, 192, 93)); + AddMapEntry(new Color(194, 255, 67)); HitSound = SoundID.Shatter; MinPick = 55; } @@ -43,9 +43,9 @@ namespace CalamityMod.Tiles.FurnitureWulfrum Color value = Color.Lerp(lime, green, (MathF.Sin(-j / 80f + Main.GameUpdateCount * 0.017f + i / 40f) + 1f) / 2f); Color value1 = Color.Lerp(lime, green, (MathF.Sin((j - 100) / 50f + Main.GameUpdateCount * 0.004f + -i / 30f) + 1f) / 2f); - r = (value.R + value1.R) / 900f; - g = (value.G + value1.G) / 900f; - b = (value.B + value1.B) / 900f; + r = (value.R + value1.R) / 800f; + g = (value.G + value1.G) / 800f; + b = (value.B + value1.B) / 800f; r *= brightness; g *= brightness; b *= brightness; diff --git a/Tiles/FurnitureWulfrum/WulfrumPanels.cs b/Tiles/FurnitureWulfrum/WulfrumPanels.cs index 9b7bf9a799..3ac385ca08 100644 --- a/Tiles/FurnitureWulfrum/WulfrumPanels.cs +++ b/Tiles/FurnitureWulfrum/WulfrumPanels.cs @@ -17,10 +17,8 @@ namespace CalamityMod.Tiles.FurnitureWulfrum { Main.tileSolid[Type] = true; Main.tileBlockLight[Type] = true; - Main.tileBrick[Type] = true; CalamityUtils.MergeWithGeneral(Type); - CalamityUtils.MergeDecorativeTiles(Type); HitSound = MinePlatingSound; AddMapEntry(new Color(89, 113, 91)); diff --git a/Tiles/FurnitureWulfrum/WulfrumPanels.png b/Tiles/FurnitureWulfrum/WulfrumPanels.png index 264093b02e..9f68bf6a08 100644 Binary files a/Tiles/FurnitureWulfrum/WulfrumPanels.png and b/Tiles/FurnitureWulfrum/WulfrumPanels.png differ diff --git a/Walls/ChargedWulfrumEnergyBarrierWall.cs b/Walls/ChargedWulfrumEnergyBarrierWall.cs new file mode 100644 index 0000000000..44a1fc0707 --- /dev/null +++ b/Walls/ChargedWulfrumEnergyBarrierWall.cs @@ -0,0 +1,108 @@ +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 ChargedWulfrumEnergyBarrierWall : ModWall + { + internal static FramedMaskTexture GlowMask; + + public override void SetStaticDefaults() + { + GlowMask = new("CalamityMod/Walls/ChargedWulfrumEnergyBarrierWallReflect", 36, 36); + + Main.wallHouse[Type] = true; + Main.wallLight[Type] = true; + AddMapEntry(new Color(67, 146, 146)); + } + + 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 override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) + { + float brightness = 0.9f; + Color cyan = new Color(67, 146, 146); + Color blue = new Color(32, 93, 129); + Color value = Color.Lerp(cyan, blue, (MathF.Sin(-j / 80f + Main.GameUpdateCount * 0.017f + i / 40f) + 1f) / 2f); + Color value1 = Color.Lerp(cyan, blue, (MathF.Sin((j - 100) / 50f + Main.GameUpdateCount * 0.004f + -i / 30f) + 1f) / 2f); + + r = (value.R + value1.R) / 900f; + g = (value.G + value1.G) / 900f; + b = (value.B + value1.B) / 900f; + r *= brightness; + g *= brightness; + b *= brightness; + } + 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.094f; + 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; + } +} diff --git a/Walls/ChargedWulfrumEnergyBarrierWall.png b/Walls/ChargedWulfrumEnergyBarrierWall.png new file mode 100644 index 0000000000..d233bd32c2 Binary files /dev/null and b/Walls/ChargedWulfrumEnergyBarrierWall.png differ diff --git a/Walls/ChargedWulfrumEnergyBarrierWallReflect.png b/Walls/ChargedWulfrumEnergyBarrierWallReflect.png new file mode 100644 index 0000000000..75ab6e96d8 Binary files /dev/null and b/Walls/ChargedWulfrumEnergyBarrierWallReflect.png differ diff --git a/Walls/WulfrumEnergyBarrierWall.cs b/Walls/WulfrumEnergyBarrierWall.cs new file mode 100644 index 0000000000..c7e535a658 --- /dev/null +++ b/Walls/WulfrumEnergyBarrierWall.cs @@ -0,0 +1,108 @@ +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 WulfrumEnergyBarrierWall : ModWall + { + internal static FramedMaskTexture GlowMask; + + public override void SetStaticDefaults() + { + GlowMask = new("CalamityMod/Walls/WulfrumEnergyBarrierWallReflect", 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 override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) + { + float brightness = 0.9f; + Color lime = new Color(116, 153, 40); + Color green = new Color(46, 97, 56); + Color value = Color.Lerp(lime, green, (MathF.Sin(-j / 80f + Main.GameUpdateCount * 0.017f + i / 40f) + 1f) / 2f); + Color value1 = Color.Lerp(lime, green, (MathF.Sin((j - 100) / 50f + Main.GameUpdateCount * 0.004f + -i / 30f) + 1f) / 2f); + + r = (value.R + value1.R) / 900f; + g = (value.G + value1.G) / 900f; + b = (value.B + value1.B) / 900f; + r *= brightness; + g *= brightness; + b *= brightness; + } + 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; + } +} diff --git a/Walls/WulfrumEnergyBarrierWall.png b/Walls/WulfrumEnergyBarrierWall.png new file mode 100644 index 0000000000..3f5da8222a Binary files /dev/null and b/Walls/WulfrumEnergyBarrierWall.png differ diff --git a/Walls/WulfrumEnergyBarrierWallReflect.png b/Walls/WulfrumEnergyBarrierWallReflect.png new file mode 100644 index 0000000000..55748b217f Binary files /dev/null and b/Walls/WulfrumEnergyBarrierWallReflect.png differ