1using Microsoft.Xna.Framework.Graphics;
3using System.Collections.Generic;
4using Terraria.GameContent.Liquid;
19 internal static readonly IList<ModWaterStyle> waterStyles =
new List<ModWaterStyle>();
26 internal static int ReserveStyle() {
42 internal static void ResizeArrays() {
43 Array.Resize(ref LiquidRenderer.Instance._liquidTextures,
nextWaterStyle);
48 internal static void Unload() {
56 style = waterStyle.
Type;
65 if (k == 1 || k == 11) {
68 Main.liquidAlpha[k] -= 0.2f;
69 if (Main.liquidAlpha[k] < 0f) {
70 Main.liquidAlpha[k] = 0f;
75 int type = waterStyle.
Type;
76 if (Main.waterStyle == type) {
77 Main.liquidAlpha[type] += 0.2f;
78 if (Main.liquidAlpha[type] > 1f) {
79 Main.liquidAlpha[type] = 1f;
83 Main.liquidAlpha[type] -= 0.2f;
84 if (Main.liquidAlpha[type] < 0f) {
85 Main.liquidAlpha[type] = 0f;
93 if (Main.liquidAlpha[k] > 0f) {
95 if (Main.waterStyle < k) {
96 Main.instance.DrawWater(bg, k, Main.liquidAlpha[k]);
99 Main.instance.DrawWater(bg, k, 1f);
103 Main.instance.DrawWater(bg, k, Main.liquidAlpha[k]);
109 public static void DrawWaterfall(WaterfallManager waterfallManager, SpriteBatch spriteBatch) {
111 if (Main.liquidAlpha[waterStyle.
Type] > 0f) {
113 Main.liquidAlpha[waterStyle.
Type]);
120 if (waterStyle !=
null) {
122 r *= Lighting.negLight * Lighting.blueWave;
123 g *= Lighting.negLight * Lighting.blueWave;
124 b *= Lighting.negLight * Lighting.blueWave;
133 internal static readonly IList<ModWaterfallStyle> waterfallStyles =
new List<ModWaterfallStyle>();
135 internal static int ReserveStyle() {
151 internal static void ResizeArrays() {
152 Array.Resize(ref Main.instance.waterfallManager.waterfallTexture,
nextWaterfallStyle);
155 internal static void Unload() {
157 waterfallStyles.Clear();
Represents a style of water that gets drawn, based on factors such as the background....
int Type
The ID of the water style.
virtual bool ChooseWaterStyle()
Whether the conditions have been met for this water style to be used. Typically Main....
abstract int ChooseWaterfallStyle()
The ID of the waterfall style the game should use when this water style is in use.
virtual void LightColorMultiplier(ref float r, ref float g, ref float b)
Allows you to modify the light levels of the tiles behind the water. The light color components will ...
Represents a style of waterfalls that gets drawn. This is mostly used to determine the color of the w...
This serves as the central class from which WaterStyle functions are supported and carried out.
static ModWaterStyle GetWaterStyle(int style)
Returns the ModWaterStyle with the given ID.
static void LightColorMultiplier(int style, ref float r, ref float g, ref float b)
static void ChooseWaterStyle(ref int style)
static void DrawWaterfall(WaterfallManager waterfallManager, SpriteBatch spriteBatch)
static int WaterStyleCount
The number of water styles that exist in the game, both vanilla and modded.
const int vanillaWaterCount
The maximum amount of liquids in vanilla.
static void UpdateLiquidAlphas()
static int nextWaterStyle
static void DrawWatersToScreen(bool bg)
const int vanillaWaterfallCount
static ModWaterfallStyle GetWaterfallStyle(int style)
Returns the ModWaterfallStyle with the given ID.
static int nextWaterfallStyle
This is where all ModWorld hooks are gathered and called.
static void ChooseWaterStyle(ref int style)