Eutro Glass glint, unimplented Crystal Glint (Not enough time) and New Yellow Coral
This commit is contained in:
1 parent
7e691f57a3
commit
eeed078bbc
5 files changed
+50
-3
No files matched your search
@@ -1,4 +1,6 @@
|
||||
using CalamityMod.Systems;
|
||||
using System;
|
||||
using CalamityMod.Systems;
|
||||
using Microsoft.CodeAnalysis.Text;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
@@ -40,12 +42,22 @@ namespace CalamityMod.Tiles.SunkenSea
|
||||
num = fail ? 1 : 3;
|
||||
}
|
||||
|
||||
private static float GetFade1(int i, int j)
|
||||
{
|
||||
return (MathF.Sin(Main.GlobalTimeWrappedHourly * 0.2f) + 1f) / 2f;
|
||||
}
|
||||
|
||||
private static float GetFade2(int i, int j)
|
||||
{
|
||||
return (MathF.Sin(Main.GlobalTimeWrappedHourly * 0.1f + i * 0.08f - j * 0.05f) + 1f) / 2f;
|
||||
}
|
||||
|
||||
public override void PostDraw(int i, int j, SpriteBatch spriteBatch)
|
||||
{
|
||||
if (Main.tile[i, j].IsTileActuallyInvisible())
|
||||
return;
|
||||
|
||||
float transparency = 0.6f;
|
||||
float transparency = 0.4f;
|
||||
|
||||
// Must be set here
|
||||
TileID.Sets.DrawsWalls[Type] = true;
|
||||
@@ -62,6 +74,41 @@ namespace CalamityMod.Tiles.SunkenSea
|
||||
|
||||
Color color = Lighting.GetColor(i, j) * transparency;
|
||||
TileFramingSystem.SlopedGlowmask(in tile, i, j, tex, frame, CalamityUtils.ApplyPaint(Main.tile[i, j].TileColor, color, false), default);
|
||||
|
||||
//IF this glint effect below runs poorly on lower end PC's we should keep it as a setting for those with good PC's
|
||||
|
||||
Vector2 offScreen = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange);
|
||||
Vector2 position = new Vector2(i * 16, j * 16) - Main.screenPosition + offScreen;
|
||||
Texture2D GlintTex = ModContent.Request<Texture2D>(Texture + "_Glint").Value;
|
||||
|
||||
Vector2 glintDir = new Vector2(1f, 1f);
|
||||
glintDir.Normalize();
|
||||
|
||||
Vector2 screenPos = position;
|
||||
|
||||
float projection = Vector2.Dot(screenPos, glintDir);
|
||||
|
||||
// this sets the length between the glints diagonally
|
||||
float screenDiagonalLength = Vector2.Dot(new Vector2(Main.screenWidth, Main.screenHeight), glintDir);
|
||||
float[] beamCenters = new float[]
|
||||
{
|
||||
screenDiagonalLength * 0.53f, // upper glint
|
||||
screenDiagonalLength * 0.63f, // middle glint
|
||||
screenDiagonalLength * 0.73f // lower glint
|
||||
};
|
||||
|
||||
float stripeWidth = 100f;
|
||||
|
||||
foreach (float bc in beamCenters)
|
||||
{
|
||||
float dist = Math.Abs(projection - bc);
|
||||
float strength = MathHelper.Clamp(1f - dist / stripeWidth, 0f, 1f);
|
||||
|
||||
if (strength > 0f)
|
||||
{
|
||||
spriteBatch.Draw(GlintTex, position, frame, (Lighting.GetColor(i, j) * 2 ) * (strength * 0.4f), 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak)
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 96 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 4.1 KiB |
@@ -107,7 +107,7 @@ namespace CalamityMod.Tiles.SunkenSea
|
||||
spriteBatch.Draw(tex1, position, sourceRect, Lighting.GetColor(i, j) * 1.5f * GetFade1(i, j));
|
||||
spriteBatch.Draw(tex2, position, sourceRect, Lighting.GetColor(i, j) * 1.5f * GetFade2(i, j));
|
||||
|
||||
//Not sure sure how everything below will run on stuff so we may need to kill this cool glint thing I did
|
||||
//IF this glint effect below runs poorly on lower end PC's we should keep it as a setting for those with good PC's
|
||||
|
||||
Texture2D GlintTex = ModContent.Request<Texture2D>("CalamityMod/Tiles/SunkenSea/SeaPrism_GlintMask").Value;
|
||||
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 12 KiB |
Reference in new issue
Block a user