Terraria ModLoader  0.11.7.8
A mod to make and play Terraria mods
ModWaterStyle.cs
Go to the documentation of this file.
1 using Microsoft.Xna.Framework;
2 
3 namespace Terraria.ModLoader
4 {
8  public abstract class ModWaterStyle
9  {
13  public Mod mod {
14  get;
15  internal set;
16  }
17 
21  public string Name {
22  get;
23  internal set;
24  }
25 
29  public int Type {
30  get;
31  internal set;
32  }
33 
34  internal string texture;
35  internal string blockTexture;
36 
40  public virtual bool Autoload(ref string name, ref string texture, ref string blockTexture) {
41  return mod.Properties.Autoload;
42  }
43 
47  public virtual bool ChooseWaterStyle() {
48  return false;
49  }
50 
54  public abstract int ChooseWaterfallStyle();
55 
59  public abstract int GetSplashDust();
60 
64  public abstract int GetDropletGore();
65 
69  public virtual void LightColorMultiplier(ref float r, ref float g, ref float b) {
70  r = 0.88f;
71  g = 0.96f;
72  b = 1.015f;
73  }
74 
78  public virtual Color BiomeHairColor() {
79  return new Color(28, 216, 94);
80  }
81  }
82 
86  public class ModWaterfallStyle
87  {
91  public Mod mod {
92  get;
93  internal set;
94  }
95 
99  public string Name {
100  get;
101  internal set;
102  }
103 
107  public int Type {
108  get;
109  internal set;
110  }
111 
112  internal string texture;
113 
117  public virtual bool Autoload(ref string name, ref string texture) {
118  return mod.Properties.Autoload;
119  }
120 
124  public virtual void AddLight(int i, int j) {
125  }
126 
130  public virtual void ColorMultiplier(ref float r, ref float g, ref float b, float a) {
131  }
132  }
133 }
virtual bool Autoload(ref string name, ref string texture, ref string blockTexture)
Allows you to automatically add a ModWaterStyle instead of using Mod.AddWaterStyle. Return true to allow autoloading; by default returns the mod's autoload property. Name is initialized to the overriding class name, and texture is initialized to the namespace and overriding class name with periods replaced with slashes. BlockTexture is initialized to texture with "_Block" added at the end. Use this to either force or stop an autoload, change the name that identifies this type of ModWaterStyle, and/or change the texture paths used by this ModWaterStyle.
Represents a style of water that gets drawn, based on factors such as the background. This is used to determine the color of the water, as well as other things as determined by the hooks below.
Definition: ModWaterStyle.cs:8
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 ...
virtual Color BiomeHairColor()
Allows you to change the hair color resulting from the biome hair dye when this water style is in use...
Represents a style of waterfalls that gets drawn. This is mostly used to determine the color of the w...
virtual void ColorMultiplier(ref float r, ref float g, ref float b, float a)
Allows you to determine the color multiplier acting on waterfalls of this style. Useful for waterfall...
virtual void AddLight(int i, int j)
Allows you to create light at a tile occupied by a waterfall of this style.
Mod is an abstract class that you will override. It serves as a central place from which the mod's co...
Definition: Mod.cs:24
virtual bool Autoload(ref string name, ref string texture)
Allows you to automatically add a ModWaterfallStyle instead of using Mod.AddWaterfallStyle. Return true to allow autoloading; by default returns the mod's autoload property. Name is initialized to the overriding class name, and texture is initialized to the namespace and overriding class name with periods replaced with slashes. Use this to either force or stop an autoload, change the name that identifies this type of ModWaterStyle, or change the texture path used by this ModWaterfallStyle.
virtual bool ChooseWaterStyle()
Whether the conditions have been met for this water style to be used. Typically Main.bgStyle is checked to determine whether a water style should be used. Returns false by default.