Removed CalamityModWaterStyle, Replaced to Interfaces
This commit is contained in:
1 parent
35515aa9d5
commit
b9b9dc2b1b
19 files changed
+132
-119
No files matched your search
@@ -1,33 +0,0 @@
|
||||
using Terraria;
|
||||
using Terraria.Graphics;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Systems
|
||||
{
|
||||
public abstract class CalamityModWaterStyle : ModWaterStyle
|
||||
{
|
||||
/// <summary>
|
||||
/// Allows water styles to manipulate what color the liquid is drawn to, this can allow waters to be see-throughable to see backgrounds (surface and underground backgrounds not walls)
|
||||
/// </summary>
|
||||
/// <param name="x">X position of the water</param>
|
||||
/// <param name="y">Y position of the water</param>
|
||||
/// <param name="liquidColor">The vertexColor of the water color, this is both used to get the current color and to set the color of the water</param>
|
||||
public virtual void DrawColor(int x, int y, ref VertexColors liquidColor, bool isSlope)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Allows you to determine how much light this water emits.<br />
|
||||
/// It can also let you light up the block in front of this water.<br />
|
||||
/// See <see cref="M:Terraria.Graphics.Light.TileLightScanner.ApplyLiquidLight(Terraria.Tile,Microsoft.Xna.Framework.Vector3@)" /> for vanilla tile light values to use as a reference.<br />
|
||||
/// </summary>
|
||||
/// <param name="i">The x position in tile coordinates.</param>
|
||||
/// <param name="j">The y position in tile coordinates.</param>
|
||||
/// <param name="r">The red component of light, usually a value between 0 and 1</param>
|
||||
/// <param name="g">The green component of light, usually a value between 0 and 1</param>
|
||||
/// <param name="b">The blue component of light, usually a value between 0 and 1</param>
|
||||
public virtual void ModifyLight(ref readonly Tile tile, int i, int j, ref float r, ref float g, ref float b)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,6 @@ namespace CalamityMod.Systems.Graphic.LiquidSystem
|
||||
{
|
||||
public interface IEmittableWaterStyle
|
||||
{
|
||||
void ModifyLight(ref readonly Tile tile, int i, int j, int type, ref float r, ref float g, ref float b);
|
||||
void ModifyLight(in Tile tile, int x, int y, ref float r, ref float g, ref float b);
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,10 @@
|
||||
using Terraria.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.Graphics;
|
||||
|
||||
namespace CalamityMod.Systems.Graphic.LiquidSystem
|
||||
{
|
||||
public interface IPaintableWaterStyle
|
||||
{
|
||||
void DrawColor(int x, int y, int type, ref VertexColors liquidColor, bool isSlope = false);
|
||||
public void ModifyDrawColor(in Tile tile, int x, int y, ref VertexColors liquidColor, bool isSlope);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
using Terraria;
|
||||
using Terraria.Graphics;
|
||||
|
||||
namespace CalamityMod.Systems.Graphic.LiquidSystem
|
||||
{
|
||||
public interface IPaintableWaterfallStyle
|
||||
{
|
||||
void ModifyDrawColor(in Tile tile, int x, int y, ref VertexColors liquidColor);
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using ReLogic.Content;
|
||||
using Terraria;
|
||||
@@ -12,8 +11,6 @@ namespace CalamityMod.Systems.Graphic.LiquidSystem
|
||||
[Autoload(Side = ModSide.Client)]
|
||||
public sealed partial class ModLavaStyleSystem : ModSystem
|
||||
{
|
||||
internal static readonly FastField<WaterfallManager, Asset<Texture2D>[]> WaterfallTextureField = new("waterfallTexture", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public);
|
||||
|
||||
public static ModLavaStyle[] LavaStyles = new ModLavaStyle[ModLavaStyleLoader.VanillaCount];
|
||||
public static Asset<Texture2D>[] Textures = new Asset<Texture2D>[ModLavaStyleLoader.VanillaCount];
|
||||
public static Asset<Texture2D>[] BlockTextures = new Asset<Texture2D>[ModLavaStyleLoader.VanillaCount];
|
||||
@@ -52,7 +49,7 @@ namespace CalamityMod.Systems.Graphic.LiquidSystem
|
||||
Textures[0] = LiquidRenderer.Instance._liquidTextures[1];
|
||||
SlopeTextures[0] = TextureAssets.LiquidSlope[1];
|
||||
BlockTextures[0] = TextureAssets.Liquid[1];
|
||||
WaterfallTextures[0] = WaterfallTextureField.Get(Main.instance.waterfallManager)[1];
|
||||
WaterfallTextures[0] = SpecialLiquidDrawingSystem.WaterfallTextureField.Get(Main.instance.waterfallManager)[1];
|
||||
|
||||
TextureArrayReady = true;
|
||||
}
|
||||
|
||||
@@ -18,9 +18,9 @@ namespace CalamityMod.Systems.Graphic.LiquidSystem
|
||||
}
|
||||
}
|
||||
|
||||
public static void DrawColorSetup(int x, int y, int type, ref VertexColors liquidColor, bool isSlope = false)
|
||||
public static void DrawColorSetup(int x, int y, int style, ref VertexColors liquidColor, bool isSlope = false)
|
||||
{
|
||||
if (LavaStyles[type] is ModLavaStyle styles)
|
||||
if (LavaStyles[style] is ModLavaStyle styles)
|
||||
{
|
||||
styles.DrawColor(x, y, ref liquidColor, isSlope);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using MonoMod.Cil;
|
||||
using ReLogic.Content;
|
||||
using Terraria;
|
||||
using Terraria.GameContent.Drawing;
|
||||
using Terraria.GameContent.Liquid;
|
||||
@@ -14,11 +17,14 @@ namespace CalamityMod.Systems.Graphic.LiquidSystem
|
||||
[Autoload(Side = ModSide.Client)]
|
||||
public sealed class SpecialLiquidDrawingSystem : ModSystem
|
||||
{
|
||||
public static readonly FastField<WaterfallManager, Asset<Texture2D>[]> WaterfallTextureField = new("waterfallTexture", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public);
|
||||
|
||||
public override void OnModLoad()
|
||||
{
|
||||
On_TileLightScanner.GetTileLight += ApplyLiquidEmit;
|
||||
IL_LiquidRenderer.DrawNormalLiquids += LiquidDrawColors; //Liquid Light
|
||||
On_TileDrawing.DrawPartialLiquid += LiquidSlopeDrawColors;
|
||||
On_WaterfallManager.DrawWaterfall_int_int_int_float_Vector2_Rectangle_Color_SpriteEffects += ModifyWaterfallColor;
|
||||
}
|
||||
|
||||
private static void ModifyEmit(Tile tile, int x, int y, ref Vector3 lightColor)
|
||||
@@ -32,7 +38,7 @@ namespace CalamityMod.Systems.Graphic.LiquidSystem
|
||||
float G = 0f;
|
||||
float B = 0f;
|
||||
|
||||
waterStyle.ModifyLight(in tile, x, y, Main.waterStyle, ref R, ref G, ref B);
|
||||
waterStyle.ModifyLight(in tile, x, y, ref R, ref G, ref B);
|
||||
|
||||
lightColor.X = Math.Max(lightColor.X, R);
|
||||
lightColor.Y = Math.Max(lightColor.Y, G);
|
||||
@@ -85,7 +91,8 @@ namespace CalamityMod.Systems.Graphic.LiquidSystem
|
||||
{
|
||||
if (liquidType == LiquidID.Water && TryGetModWaterStyleAs<IPaintableWaterStyle>(Main.waterStyle, out var waterStyle))
|
||||
{
|
||||
waterStyle.DrawColor(x, y, Main.waterStyle, ref initialColor, isSlope);
|
||||
var tile = Main.tile[x, y];
|
||||
waterStyle.ModifyDrawColor(in tile, x, y, ref initialColor, isSlope);
|
||||
}
|
||||
else if (liquidType == LiquidID.Lava && ModLavaStyleSystem.Initialized)
|
||||
{
|
||||
@@ -170,7 +177,7 @@ namespace CalamityMod.Systems.Graphic.LiquidSystem
|
||||
});
|
||||
}
|
||||
|
||||
private void LiquidSlopeDrawColors(On_TileDrawing.orig_DrawPartialLiquid orig, TileDrawing self, bool behindBlocks, Tile tileCache, ref Vector2 position, ref Rectangle liquidSize, int liquidType, ref VertexColors colors)
|
||||
private static void LiquidSlopeDrawColors(On_TileDrawing.orig_DrawPartialLiquid orig, TileDrawing self, bool behindBlocks, Tile tileCache, ref Vector2 position, ref Rectangle liquidSize, int liquidType, ref VertexColors colors)
|
||||
{
|
||||
tileCache.TilePos(out var x, out var y);
|
||||
var type = tileCache.TileType;
|
||||
@@ -179,6 +186,22 @@ namespace CalamityMod.Systems.Graphic.LiquidSystem
|
||||
orig(self, behindBlocks, tileCache, ref position, ref liquidSize, liquidType, ref colors);
|
||||
}
|
||||
|
||||
private static void ModifyWaterfallColor(On_WaterfallManager.orig_DrawWaterfall_int_int_int_float_Vector2_Rectangle_Color_SpriteEffects orig, WaterfallManager self, int waterfallType, int x, int y, float opacity, Vector2 position, Rectangle sourceRect, Color color, Microsoft.Xna.Framework.Graphics.SpriteEffects effects)
|
||||
{
|
||||
if (TryGetModWaterStyleAs<IPaintableWaterfallStyle>(waterfallType, out var style))
|
||||
{
|
||||
Tile tile = Main.tile[x, y];
|
||||
Texture2D texture = WaterfallTextureField.Get(self)[waterfallType].Value;
|
||||
Lighting.GetCornerColors(x, y, out var vertices, 1f);
|
||||
style.ModifyDrawColor(in tile, x, y, ref vertices);
|
||||
Main.tileBatch.Draw(texture, position, sourceRect, vertices, Vector2.Zero, 1f, effects);
|
||||
}
|
||||
else
|
||||
{
|
||||
orig(self, waterfallType, x, y, opacity, position, sourceRect, color, effects);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private static ModWaterStyle GetModWaterStyle(int type)
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using CalamityMod.Dusts.WaterSplash;
|
||||
using CalamityMod.Gores.WaterDroplet;
|
||||
using CalamityMod.Systems;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using ReLogic.Content;
|
||||
@@ -11,9 +10,9 @@ namespace CalamityMod.Waters
|
||||
{
|
||||
public class AstralWaterflow : ModWaterfallStyle { }
|
||||
|
||||
public class AstralWater : CalamityModWaterStyle
|
||||
public class AstralWater : ModWaterStyle
|
||||
{
|
||||
public static CalamityModWaterStyle Instance { get; private set; }
|
||||
public static ModWaterStyle Instance { get; private set; }
|
||||
public static ModWaterfallStyle WaterfallStyle { get; private set; }
|
||||
public static int SplashDust { get; private set; }
|
||||
public static int DropletGore { get; private set; }
|
||||
@@ -39,7 +38,7 @@ namespace CalamityMod.Waters
|
||||
public override int GetSplashDust() => SplashDust;
|
||||
public override int GetDropletGore() => DropletGore;
|
||||
public override Asset<Texture2D> GetRainTexture() => RainTexture ??= ModContent.Request<Texture2D>("CalamityMod/Waters/AstralRain");
|
||||
|
||||
|
||||
public override byte GetRainVariant() => (byte)Main.rand.Next(3);
|
||||
public override Color BiomeHairColor() => new Color(93, 78, 107);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using CalamityMod.Dusts.WaterSplash;
|
||||
using CalamityMod.Gores.WaterDroplet;
|
||||
using CalamityMod.Systems;
|
||||
using CalamityMod.Systems.Graphic.LiquidSystem;
|
||||
using CalamityMod.Tiles.Abyss;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
@@ -9,9 +9,12 @@ using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Waters
|
||||
{
|
||||
public class BasaltGullyWaterflow : ModWaterfallStyle { }
|
||||
public class BasaltGullyWaterflow : ModWaterfallStyle, IPaintableWaterfallStyle
|
||||
{
|
||||
public void ModifyDrawColor(in Tile tile, int x, int y, ref VertexColors liquidColor) => CalamityUtils.SulphuricWaterColor(x, y, ref liquidColor, true);
|
||||
}
|
||||
|
||||
public class BasaltGullyWater : CalamityModWaterStyle
|
||||
public class BasaltGullyWater : ModWaterStyle, IPaintableWaterStyle, IEmittableWaterStyle
|
||||
{
|
||||
public static int Type;
|
||||
|
||||
@@ -19,7 +22,7 @@ namespace CalamityMod.Waters
|
||||
|
||||
public override void SetStaticDefaults() => Type = Slot;
|
||||
|
||||
public override void ModifyLight(ref readonly Tile tile, int i, int j, ref float r, ref float g, ref float b)
|
||||
public void ModifyLight(in Tile tile, int i, int j, ref float r, ref float g, ref float b)
|
||||
{
|
||||
Vector3 outputColor = new Vector3(r, g, b);
|
||||
if (outputColor == Vector3.One || outputColor == new Vector3(0.25f, 0.25f, 0.25f) || outputColor == new Vector3(0.5f, 0.5f, 0.5f))
|
||||
@@ -35,7 +38,7 @@ namespace CalamityMod.Waters
|
||||
b = outputColor.Z;
|
||||
}
|
||||
|
||||
public override void DrawColor(int x, int y, ref VertexColors liquidColor, bool isSlope) => ILEditing.ILChanges.SelectSulphuricWaterColor(x, y, ref liquidColor, isSlope);
|
||||
public void ModifyDrawColor(in Tile tile, int x, int y, ref VertexColors liquidColor, bool isSlope) => CalamityUtils.SulphuricWaterColor(x, y, ref liquidColor, isSlope);
|
||||
|
||||
public override int ChooseWaterfallStyle() => ModContent.Find<ModWaterfallStyle>("CalamityMod/BasaltGullyWaterflow").Slot;
|
||||
public override int GetSplashDust() => ModContent.DustType<BasaltGullySplash>();
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
using CalamityMod.Systems;
|
||||
using CalamityMod.Tiles.Abyss;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
@@ -9,10 +6,10 @@ namespace CalamityMod.Waters
|
||||
{
|
||||
public class FloralParadiseWaterflow : ModWaterfallStyle { }
|
||||
|
||||
public class FloralParadiseWater : CalamityModWaterStyle
|
||||
public class FloralParadiseWater : ModWaterStyle
|
||||
{
|
||||
public static int Type { get; private set; }
|
||||
public static CalamityModWaterStyle Instance { get; private set; }
|
||||
public static ModWaterStyle Instance { get; private set; }
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
|
||||
@@ -1,17 +1,21 @@
|
||||
using CalamityMod.Dusts.WaterSplash;
|
||||
using CalamityMod.Gores.WaterDroplet;
|
||||
using CalamityMod.Systems;
|
||||
using CalamityMod.Systems.Graphic.LiquidSystem;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.Graphics;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Waters
|
||||
{
|
||||
public class MiddleAbyssWaterflow : ModWaterfallStyle { }
|
||||
|
||||
public class MiddleAbyssWater : CalamityModWaterStyle
|
||||
public class MiddleAbyssWaterflow : ModWaterfallStyle, IPaintableWaterfallStyle
|
||||
{
|
||||
public static CalamityModWaterStyle Instance { get; private set; }
|
||||
public void ModifyDrawColor(in Tile tile, int x, int y, ref VertexColors liquidColor) => CalamityUtils.SulphuricWaterColor(x, y, ref liquidColor, true);
|
||||
}
|
||||
|
||||
public class MiddleAbyssWater : ModWaterStyle, IPaintableWaterStyle
|
||||
{
|
||||
public static ModWaterStyle Instance { get; private set; }
|
||||
public static ModWaterfallStyle WaterfallStyle { get; private set; }
|
||||
public static int SplashDust { get; private set; }
|
||||
public static int DropletGore { get; private set; }
|
||||
@@ -36,6 +40,7 @@ namespace CalamityMod.Waters
|
||||
public override int GetSplashDust() => SplashDust;
|
||||
public override int GetDropletGore() => DropletGore;
|
||||
public override Color BiomeHairColor() => new Color(36, 23, 19);
|
||||
public override void DrawColor(int x, int y, ref VertexColors liquidColor, bool isSlope) => ILEditing.ILChanges.SelectSulphuricWaterColor(x, y, ref liquidColor, isSlope);
|
||||
|
||||
public void ModifyDrawColor(in Tile tile, int x, int y, ref VertexColors liquidColor, bool isSlope) => CalamityUtils.SulphuricWaterColor(x, y, ref liquidColor, isSlope);
|
||||
}
|
||||
}
|
||||
@@ -1,22 +1,23 @@
|
||||
using CalamityMod.Particles;
|
||||
using System;
|
||||
using CalamityMod.Systems;
|
||||
using CalamityMod.Dusts.WaterSplash;
|
||||
using CalamityMod.Gores.WaterDroplet;
|
||||
using CalamityMod.Systems.Graphic.LiquidSystem;
|
||||
using CalamityMod.Tiles.Abyss;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
using Terraria.Graphics;
|
||||
using CalamityMod.Dusts.WaterSplash;
|
||||
using CalamityMod.Gores.WaterDroplet;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Waters
|
||||
{
|
||||
public class SulphuricDepthsWaterflow : ModWaterfallStyle { }
|
||||
public class SulphuricDepthsWaterflow : ModWaterfallStyle, IPaintableWaterfallStyle
|
||||
{
|
||||
public void ModifyDrawColor(in Tile tile, int x, int y, ref VertexColors liquidColor) => CalamityUtils.SulphuricWaterColor(x, y, ref liquidColor, true);
|
||||
}
|
||||
|
||||
public class SulphuricDepthsWater : CalamityModWaterStyle
|
||||
public class SulphuricDepthsWater : ModWaterStyle, IPaintableWaterStyle, IEmittableWaterStyle
|
||||
{
|
||||
public static int Type { get; private set; }
|
||||
public static CalamityModWaterStyle Instance { get; private set; }
|
||||
public static ModWaterStyle Instance { get; private set; }
|
||||
public static ModWaterfallStyle WaterfallStyle { get; private set; }
|
||||
public static int SplashDust { get; private set; }
|
||||
public static int DropletGore { get; private set; }
|
||||
@@ -43,8 +44,8 @@ namespace CalamityMod.Waters
|
||||
public override int GetSplashDust() => SplashDust;
|
||||
public override int GetDropletGore() => DropletGore;
|
||||
public override Color BiomeHairColor() => new Color(35, 117, 89);
|
||||
public override void DrawColor(int x, int y, ref VertexColors liquidColor, bool isSlope) => ILEditing.ILChanges.SelectSulphuricWaterColor(x, y, ref liquidColor, isSlope);
|
||||
public override void ModifyLight(ref readonly Tile tile, int i, int j, ref float r, ref float g, ref float b)
|
||||
public void ModifyDrawColor(in Tile tile, int x, int y, ref VertexColors liquidColor, bool isSlope) => CalamityUtils.SulphuricWaterColor(x, y, ref liquidColor, isSlope);
|
||||
public void ModifyLight(in Tile tile, int i, int j, ref float r, ref float g, ref float b)
|
||||
{
|
||||
Vector3 outputColor = new Vector3(r, g, b);
|
||||
|
||||
|
||||
+16
-14
@@ -1,24 +1,26 @@
|
||||
using CalamityMod.Particles;
|
||||
using System;
|
||||
using CalamityMod.Systems;
|
||||
using System;
|
||||
using CalamityMod.Dusts.WaterSplash;
|
||||
using CalamityMod.Gores.WaterDroplet;
|
||||
using CalamityMod.Particles;
|
||||
using CalamityMod.Systems.Graphic.LiquidSystem;
|
||||
using CalamityMod.Tiles.Abyss;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using ReLogic.Content;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
using Terraria.Graphics;
|
||||
using Terraria.ID;
|
||||
using CalamityMod.Dusts.WaterSplash;
|
||||
using CalamityMod.Gores.WaterDroplet;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Waters
|
||||
{
|
||||
public class SulphuricWaterflow : ModWaterfallStyle { }
|
||||
|
||||
public class SulphuricWater : CalamityModWaterStyle
|
||||
public class SulphuricWaterflow : ModWaterfallStyle, IPaintableWaterfallStyle
|
||||
{
|
||||
public static CalamityModWaterStyle Instance { get; private set; }
|
||||
public void ModifyDrawColor(in Tile tile, int x, int y, ref VertexColors liquidColor) => CalamityUtils.SulphuricWaterColor(x, y, ref liquidColor, true);
|
||||
}
|
||||
|
||||
public class SulphuricWater : ModWaterStyle, IPaintableWaterStyle, IEmittableWaterStyle
|
||||
{
|
||||
public static ModWaterStyle Instance { get; private set; }
|
||||
public static ModWaterfallStyle WaterfallStyle { get; private set; }
|
||||
public static int SplashDust { get; private set; }
|
||||
public static int DropletGore { get; private set; }
|
||||
@@ -45,11 +47,11 @@ namespace CalamityMod.Waters
|
||||
public override int GetSplashDust() => SplashDust;
|
||||
public override int GetDropletGore() => DropletGore;
|
||||
public override Asset<Texture2D> GetRainTexture() => RainTexture ??= ModContent.Request<Texture2D>("CalamityMod/Waters/SulphuricRain");
|
||||
|
||||
|
||||
public override byte GetRainVariant() => (byte)Main.rand.Next(3);
|
||||
public override Color BiomeHairColor() => new Color(43, 168, 110);
|
||||
public override void DrawColor(int x, int y, ref VertexColors liquidColor, bool isSlope) => ILEditing.ILChanges.SelectSulphuricWaterColor(x, y, ref liquidColor, isSlope);
|
||||
public override void ModifyLight(ref readonly Tile tile, int i, int j, ref float r, ref float g, ref float b)
|
||||
public void ModifyDrawColor(in Tile tile, int x, int y, ref VertexColors liquidColor, bool isSlope) => CalamityUtils.SulphuricWaterColor(x, y, ref liquidColor, isSlope);
|
||||
public void ModifyLight(in Tile tile, int i, int j, ref float r, ref float g, ref float b)
|
||||
{
|
||||
Vector3 outputColor = new Vector3(r, g, b);
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using CalamityMod.Dusts.WaterSplash;
|
||||
using CalamityMod.Gores.WaterDroplet;
|
||||
using CalamityMod.Systems;
|
||||
using CalamityMod.Systems.Graphic.LiquidSystem;
|
||||
using CalamityMod.Tiles.Abyss;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
@@ -10,12 +10,12 @@ namespace CalamityMod.Waters
|
||||
{
|
||||
public class SunkenSeaBurrowsWaterflow : ModWaterfallStyle { }
|
||||
|
||||
public class SunkenSeaBurrowsWater : CalamityModWaterStyle
|
||||
public class SunkenSeaBurrowsWater : ModWaterStyle, IEmittableWaterStyle
|
||||
{
|
||||
private readonly Vector3 WaterGlowColor = new Color(76, 211, 231).ToVector3();
|
||||
|
||||
public static int Type { get; private set; }
|
||||
public static CalamityModWaterStyle Instance { get; private set; }
|
||||
public static ModWaterStyle Instance { get; private set; }
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
@@ -36,7 +36,7 @@ namespace CalamityMod.Waters
|
||||
b = 1.075f;
|
||||
}
|
||||
|
||||
public override void ModifyLight(ref readonly Tile tile, int i, int j, ref float r, ref float g, ref float b)
|
||||
public void ModifyLight(in Tile tile, int i, int j, ref float r, ref float g, ref float b)
|
||||
{
|
||||
Vector3 outputColor = new Vector3(r, g, b);
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using CalamityMod.Dusts.WaterSplash;
|
||||
using CalamityMod.Gores.WaterDroplet;
|
||||
using CalamityMod.Systems;
|
||||
using CalamityMod.Systems.Graphic.LiquidSystem;
|
||||
using CalamityMod.Tiles.Abyss;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
@@ -10,12 +10,12 @@ namespace CalamityMod.Waters
|
||||
{
|
||||
public class SunkenSeaPolypWaterflow : ModWaterfallStyle { }
|
||||
|
||||
public class SunkenSeaPolypWater : CalamityModWaterStyle
|
||||
public class SunkenSeaPolypWater : ModWaterStyle, IEmittableWaterStyle
|
||||
{
|
||||
private readonly Vector3 WaterGlowColor = new Color(213, 185, 178).ToVector3();
|
||||
|
||||
public static int Type { get; private set; }
|
||||
public static CalamityModWaterStyle Instance { get; private set; }
|
||||
public static ModWaterStyle Instance { get; private set; }
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
@@ -29,7 +29,7 @@ namespace CalamityMod.Waters
|
||||
Instance = null;
|
||||
}
|
||||
|
||||
public override void ModifyLight(ref readonly Tile tile, int i, int j, ref float r, ref float g, ref float b)
|
||||
public void ModifyLight(in Tile tile, int i, int j, ref float r, ref float g, ref float b)
|
||||
{
|
||||
Vector3 outputColor = new Vector3(r, g, b);
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using CalamityMod.Dusts.WaterSplash;
|
||||
using CalamityMod.Gores.WaterDroplet;
|
||||
using CalamityMod.Systems;
|
||||
using CalamityMod.Systems.Graphic.LiquidSystem;
|
||||
using CalamityMod.Tiles.Abyss;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
@@ -10,12 +10,12 @@ namespace CalamityMod.Waters
|
||||
{
|
||||
public class SunkenSeaReefsWaterflow : ModWaterfallStyle { }
|
||||
|
||||
public class SunkenSeaReefsWater : CalamityModWaterStyle
|
||||
public class SunkenSeaReefsWater : ModWaterStyle, IEmittableWaterStyle
|
||||
{
|
||||
private readonly Vector3 WaterGlowColor = new Color(140, 222, 240).ToVector3();
|
||||
|
||||
public static int Type { get; private set; }
|
||||
public static CalamityModWaterStyle Instance { get; private set; }
|
||||
public static ModWaterStyle Instance { get; private set; }
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
@@ -29,7 +29,7 @@ namespace CalamityMod.Waters
|
||||
Instance = null;
|
||||
}
|
||||
|
||||
public override void ModifyLight(ref readonly Tile tile, int i, int j, ref float r, ref float g, ref float b)
|
||||
public void ModifyLight(in Tile tile, int i, int j, ref float r, ref float g, ref float b)
|
||||
{
|
||||
Vector3 outputColor = new Vector3(r, g, b);
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using CalamityMod.Dusts.WaterSplash;
|
||||
using CalamityMod.Gores.WaterDroplet;
|
||||
using CalamityMod.Systems;
|
||||
using CalamityMod.Systems.Graphic.LiquidSystem;
|
||||
using CalamityMod.Tiles.Abyss;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
@@ -10,12 +10,12 @@ namespace CalamityMod.Waters
|
||||
{
|
||||
public class SunkenSeaShoresWaterflow : ModWaterfallStyle { }
|
||||
|
||||
public class SunkenSeaShoresWater : CalamityModWaterStyle
|
||||
public class SunkenSeaShoresWater : ModWaterStyle, IEmittableWaterStyle
|
||||
{
|
||||
private readonly Vector3 WaterGlowColor = new Color(82, 223, 255).ToVector3();
|
||||
|
||||
public static int Type { get; private set; }
|
||||
public static CalamityModWaterStyle Instance { get; private set; }
|
||||
public static ModWaterStyle Instance { get; private set; }
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
@@ -29,7 +29,7 @@ namespace CalamityMod.Waters
|
||||
Instance = null;
|
||||
}
|
||||
|
||||
public override void ModifyLight(ref readonly Tile tile, int i, int j, ref float r, ref float g, ref float b)
|
||||
public void ModifyLight(in Tile tile, int i, int j, ref float r, ref float g, ref float b)
|
||||
{
|
||||
Vector3 outputColor = new Vector3(r, g, b);
|
||||
|
||||
|
||||
@@ -1,17 +1,21 @@
|
||||
using CalamityMod.Dusts.WaterSplash;
|
||||
using CalamityMod.Gores.WaterDroplet;
|
||||
using CalamityMod.Systems;
|
||||
using CalamityMod.Systems.Graphic.LiquidSystem;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.Graphics;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Waters
|
||||
{
|
||||
public class UpperAbyssWaterflow : ModWaterfallStyle { }
|
||||
|
||||
public class UpperAbyssWater : CalamityModWaterStyle
|
||||
public class UpperAbyssWaterflow : ModWaterfallStyle, IPaintableWaterfallStyle
|
||||
{
|
||||
public static CalamityModWaterStyle Instance { get; private set; }
|
||||
public void ModifyDrawColor(in Tile tile, int x, int y, ref VertexColors liquidColor) => CalamityUtils.SulphuricWaterColor(x, y, ref liquidColor, true);
|
||||
}
|
||||
|
||||
public class UpperAbyssWater : ModWaterStyle, IPaintableWaterStyle
|
||||
{
|
||||
public static ModWaterStyle Instance { get; private set; }
|
||||
public static ModWaterfallStyle WaterfallStyle { get; private set; }
|
||||
public static int SplashDust { get; private set; }
|
||||
public static int DropletGore { get; private set; }
|
||||
@@ -36,6 +40,6 @@ namespace CalamityMod.Waters
|
||||
public override int GetSplashDust() => SplashDust;
|
||||
public override int GetDropletGore() => DropletGore;
|
||||
public override Color BiomeHairColor() => new Color(9, 69, 82);
|
||||
public override void DrawColor(int x, int y, ref VertexColors liquidColor, bool isSlope) => ILEditing.ILChanges.SelectSulphuricWaterColor(x, y, ref liquidColor, isSlope);
|
||||
public void ModifyDrawColor(in Tile tile, int x, int y, ref VertexColors liquidColor, bool isSlope) => CalamityUtils.SulphuricWaterColor(x, y, ref liquidColor, isSlope);
|
||||
}
|
||||
}
|
||||
+10
-6
@@ -1,17 +1,21 @@
|
||||
using CalamityMod.Dusts.WaterSplash;
|
||||
using CalamityMod.Gores.WaterDroplet;
|
||||
using CalamityMod.Systems;
|
||||
using CalamityMod.Systems.Graphic.LiquidSystem;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.Graphics;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Waters
|
||||
{
|
||||
public class VoidWaterflow : ModWaterfallStyle { }
|
||||
|
||||
public class VoidWater : CalamityModWaterStyle
|
||||
public class VoidWaterflow : ModWaterfallStyle, IPaintableWaterfallStyle
|
||||
{
|
||||
public static CalamityModWaterStyle Instance { get; private set; }
|
||||
public void ModifyDrawColor(in Tile tile, int x, int y, ref VertexColors liquidColor) => CalamityUtils.SulphuricWaterColor(x, y, ref liquidColor, true);
|
||||
}
|
||||
|
||||
public class VoidWater : ModWaterStyle, IPaintableWaterStyle
|
||||
{
|
||||
public static ModWaterStyle Instance { get; private set; }
|
||||
public static ModWaterfallStyle WaterfallStyle { get; private set; }
|
||||
public static int SplashDust { get; private set; }
|
||||
public static int DropletGore { get; private set; }
|
||||
@@ -36,6 +40,6 @@ namespace CalamityMod.Waters
|
||||
public override int GetSplashDust() => SplashDust;
|
||||
public override int GetDropletGore() => DropletGore;
|
||||
public override Color BiomeHairColor() => new Color(16, 8, 30);
|
||||
public override void DrawColor(int x, int y, ref VertexColors liquidColor, bool isSlope) => ILEditing.ILChanges.SelectSulphuricWaterColor(x, y, ref liquidColor, isSlope);
|
||||
public void ModifyDrawColor(in Tile tile, int x, int y, ref VertexColors liquidColor, bool isSlope) => CalamityUtils.SulphuricWaterColor(x, y, ref liquidColor, isSlope);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user