diff --git a/Backgrounds/AstralUG0.png b/Backgrounds/AstralUG0.png index 8e436e758b..dce8a3ae1f 100644 Binary files a/Backgrounds/AstralUG0.png and b/Backgrounds/AstralUG0.png differ diff --git a/Backgrounds/AstralUG1.png b/Backgrounds/AstralUG1.png index 478e62a308..697df413cf 100644 Binary files a/Backgrounds/AstralUG1.png and b/Backgrounds/AstralUG1.png differ diff --git a/Backgrounds/AstralUG2.png b/Backgrounds/AstralUG2.png index 1641e95d7b..3e77d6a2f2 100644 Binary files a/Backgrounds/AstralUG2.png and b/Backgrounds/AstralUG2.png differ diff --git a/Backgrounds/AstralUG3.png b/Backgrounds/AstralUG3.png index 5baacb89cb..7cf25fbff6 100644 Binary files a/Backgrounds/AstralUG3.png and b/Backgrounds/AstralUG3.png differ diff --git a/Backgrounds/AstralUG4_0.png b/Backgrounds/AstralUG4_0.png index 73f3bad550..1140e6875a 100644 Binary files a/Backgrounds/AstralUG4_0.png and b/Backgrounds/AstralUG4_0.png differ diff --git a/Backgrounds/AstralUG4_1.png b/Backgrounds/AstralUG4_1.png index bf9978ceeb..36c91a0ee8 100644 Binary files a/Backgrounds/AstralUG4_1.png and b/Backgrounds/AstralUG4_1.png differ diff --git a/Backgrounds/AstralUG4_2.png b/Backgrounds/AstralUG4_2.png index b36e95b213..cb5b86584b 100644 Binary files a/Backgrounds/AstralUG4_2.png and b/Backgrounds/AstralUG4_2.png differ diff --git a/Tiles/AstralSnow/AstralIce.cs b/Tiles/AstralSnow/AstralIce.cs index 767b6e94dd..84290b3cfe 100644 --- a/Tiles/AstralSnow/AstralIce.cs +++ b/Tiles/AstralSnow/AstralIce.cs @@ -1,24 +1,27 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; +using CalamityMod.Systems; using CalamityMod.Tiles.Astral; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.DataStructures; using Terraria.GameContent.Metadata; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Tiles.AstralSnow { - public class AstralIce : ModTile + public class AstralIce : GlowMaskTile { - - public override void SetStaticDefaults() + public override string GlowMaskAsset => "CalamityMod/Tiles/AstralSnow/AstralIceLightmask"; + public override void SetupStatic() { Main.tileSolid[Type] = true; - Main.tileBlockLight[Type] = true; + Main.tileBlockLight[Type] = false; Main.tileBrick[Type] = true; TileMaterials.SetForTileId(Type, TileMaterials._materialsByName["Ice"]); - + Main.tileLighted[Type] = true; CalamityUtils.MergeWithGeneral(Type); CalamityUtils.MergeWithSnow(Type); CalamityUtils.MergeAstralTiles(Type); @@ -29,6 +32,7 @@ namespace CalamityMod.Tiles.AstralSnow AddMapEntry(new Color(153, 143, 168)); + TileID.Sets.HasSlopeFrames[Type] = true; TileID.Sets.Ices[Type] = true; TileID.Sets.IcesSlush[Type] = true; TileID.Sets.IcesSnow[Type] = true; @@ -56,5 +60,38 @@ namespace CalamityMod.Tiles.AstralSnow sightColor = Color.Cyan; return true; } + public override Color GetGlowMaskColor(int i, int j, TileDrawInfo drawData) + { + int time = (int)(Main.timeForVisualEffects * 0.11); + float brightness = 0.2f; + brightness += (float)MathF.Sin(-j / 1f + Main.GameUpdateCount * 0.002f + -i / 30f); + brightness -= (float)MathF.Sin(j / 8f + Main.GameUpdateCount * 0.002f - i / 11f); + brightness -= (float)MathF.Sin(j / 1f + Main.GameUpdateCount * 0.001f - i / 2f); + brightness -= (float)MathF.Sin(-j / 2f + Main.GameUpdateCount * 0.003f - i / 4f); + brightness += (float)MathF.Sin(-j / 4f + Main.GameUpdateCount * 0.003f - i / 8f); + return new Color(brightness, brightness, brightness); + } + public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) + { + return TileFramingSystem.BetterGemsparkFraming(i, j, resetFrame); + } + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) + { + float brightness = 0.2f; + brightness *= (float)MathF.Sin(-j / 40f + Main.GameUpdateCount * 0.005f + i / 8f); + r = 131f / 1500f; + g = 111f / 1500f; + b = 171f / 1500f; + brightness += (float)MathF.Sin(-j / 1f + Main.GameUpdateCount * 0.002f + -i / 30f); + brightness -= (float)MathF.Sin(j / 8f + Main.GameUpdateCount * 0.002f - i / 11f); + brightness -= (float)MathF.Sin(j / 1f + Main.GameUpdateCount * 0.001f - i / 2f); + brightness -= (float)MathF.Sin(-j / 2f + Main.GameUpdateCount * 0.003f - i / 4f); + brightness += (float)MathF.Sin(-j / 4f + Main.GameUpdateCount * 0.003f - i / 8f); + + brightness -= 0.05f; + r *= brightness; + g *= brightness; + b *= brightness; + } } } diff --git a/Tiles/AstralSnow/AstralIce.png b/Tiles/AstralSnow/AstralIce.png index e3891a1e21..924cc4a6fc 100644 Binary files a/Tiles/AstralSnow/AstralIce.png and b/Tiles/AstralSnow/AstralIce.png differ diff --git a/Tiles/AstralSnow/AstralIceLightmask.png b/Tiles/AstralSnow/AstralIceLightmask.png new file mode 100644 index 0000000000..f3d3a35b3e Binary files /dev/null and b/Tiles/AstralSnow/AstralIceLightmask.png differ diff --git a/Tiles/AstralSnow/AstralSnow.cs b/Tiles/AstralSnow/AstralSnow.cs index 7fc6237c15..734f17698b 100644 --- a/Tiles/AstralSnow/AstralSnow.cs +++ b/Tiles/AstralSnow/AstralSnow.cs @@ -1,19 +1,25 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; +using CalamityMod.Systems; using CalamityMod.Tiles.Astral; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.DataStructures; using Terraria.GameContent.Metadata; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Tiles.AstralSnow { - public class AstralSnow : ModTile + public class AstralSnow : GlowMaskTile { - - public override void SetStaticDefaults() + public override string GlowMaskAsset => "CalamityMod/Tiles/AstralSnow/AstralSnowLightmask"; + public GrayscaleTexture2D NoiseTexture; + public override void SetupStatic() { + NoiseTexture = new("CalamityMod/ExtraTextures/GreyscaleGradients/BlobbyNoise"); + Main.tileSolid[Type] = true; Main.tileBlockLight[Type] = true; Main.tileBrick[Type] = true; @@ -28,7 +34,7 @@ namespace CalamityMod.Tiles.AstralSnow HitSound = SoundID.Item48; AddMapEntry(new Color(189, 211, 221)); - + TileID.Sets.HasSlopeFrames[Type] = true; TileID.Sets.Snow[Type] = true; TileID.Sets.Conversion.Snow[Type] = true; TileID.Sets.ChecksForMerge[Type] = true; @@ -42,11 +48,31 @@ namespace CalamityMod.Tiles.AstralSnow { num = fail ? 1 : 3; } + public override void OnUnload() + { + NoiseTexture?.Unload(); + NoiseTexture = null; + } public override bool IsTileBiomeSightable(int i, int j, ref Color sightColor) { sightColor = Color.Cyan; return true; } + public override Color GetGlowMaskColor(int i, int j, TileDrawInfo drawData) + { + int time = (int)(Main.timeForVisualEffects * 0.11); + float brightness = 1.0f - NoiseTexture.GetRepeat((i * 60) + time, (j * 50) + time); + brightness += (float)MathF.Sin(-j / 1f + Main.GameUpdateCount * 0.02f + -i / 30f); + brightness -= (float)MathF.Sin(j / 8f + Main.GameUpdateCount * 0.02f - i / 11f); + brightness -= (float)MathF.Sin(j / 1f + Main.GameUpdateCount * 0.01f - i / 2f); + brightness -= (float)MathF.Sin(-j / 2f + Main.GameUpdateCount * 0.03f - i / 4f); + brightness += (float)MathF.Sin(-j / 4f + Main.GameUpdateCount * 0.03f - i / 8f); + return new Color(brightness, brightness, brightness); + } + public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) + { + return TileFramingSystem.BetterGemsparkFraming(i, j, resetFrame); + } } } diff --git a/Tiles/AstralSnow/AstralSnow.png b/Tiles/AstralSnow/AstralSnow.png index dd0facc49d..ab1fff1134 100644 Binary files a/Tiles/AstralSnow/AstralSnow.png and b/Tiles/AstralSnow/AstralSnow.png differ diff --git a/Tiles/AstralSnow/AstralSnowLightmask.png b/Tiles/AstralSnow/AstralSnowLightmask.png new file mode 100644 index 0000000000..6fcc9110e1 Binary files /dev/null and b/Tiles/AstralSnow/AstralSnowLightmask.png differ diff --git a/Tiles/Merges/AstralSnowMerge.png b/Tiles/Merges/AstralSnowMerge.png index 405cb2e833..3ec74aa6a7 100644 Binary files a/Tiles/Merges/AstralSnowMerge.png and b/Tiles/Merges/AstralSnowMerge.png differ diff --git a/Tiles/SunkenSea/Shellstone.cs b/Tiles/SunkenSea/Shellstone.cs index eea56209a5..fc65591926 100644 --- a/Tiles/SunkenSea/Shellstone.cs +++ b/Tiles/SunkenSea/Shellstone.cs @@ -14,7 +14,6 @@ namespace CalamityMod.Tiles.SunkenSea Main.tileSolid[Type] = true; Main.tileBlockLight[Type] = true; - TileID.Sets.HasSlopeFrames[Type] = true; CalamityUtils.MergeWithGeneral(Type); CalamityUtils.MergeWithDesert(Type);