Astral Ice Changes (+ bg fixes for ug astral)

This commit is contained in:
Heart-Plus-Up committed 2024-10-08 04:50:43 -07:00
1 parent 12e7f8aff2
commit 8247fa2a84
15 files changed
+74 -12

No files matched your search

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 904 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1020 B

After

Width:  |  Height:  |  Size: 994 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

+43 -6
View File
@@ -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;
}
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.2 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

+31 -5
View File
@@ -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);
}
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.4 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

-1
View File
@@ -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);