Terraria ModLoader  0.11.7.8
A mod to make and play Terraria mods
EquipTexture.cs
Go to the documentation of this file.
1 using Microsoft.Xna.Framework;
2 
3 namespace Terraria.ModLoader
4 {
8  public class EquipTexture
9  {
13  public string Texture {
14  get;
15  internal set;
16  }
17 
21  public Mod mod {
22  get;
23  internal set;
24  }
25 
29  public string Name {
30  get;
31  internal set;
32  }
33 
37  public EquipType Type {
38  get;
39  internal set;
40  }
41 
45  public int Slot {
46  get;
47  internal set;
48  }
49 
53  public ModItem item {
54  get;
55  internal set;
56  }
57 
63  public virtual void UpdateVanity(Player player, EquipType type) {
64  if (item != null) {
65  item.UpdateVanity(player, type);
66  }
67  }
68 
76  public virtual bool IsVanitySet(int head, int body, int legs) {
77  if (item == null) {
78  return false;
79  }
80  return item.IsVanitySet(head, body, legs);
81  }
82 
87  public virtual void PreUpdateVanitySet(Player player) {
88  if (item != null) {
89  item.PreUpdateVanitySet(player);
90  }
91  }
92 
97  public virtual void UpdateVanitySet(Player player) {
98  if (item != null) {
99  item.UpdateVanitySet(player);
100  }
101  }
102 
107  public virtual void ArmorSetShadows(Player player) {
108  if (item != null) {
109  item.ArmorSetShadows(player);
110  }
111  }
112 
121  public virtual void SetMatch(bool male, ref int equipSlot, ref bool robes) {
122  if (item != null) {
123  item.SetMatch(male, ref equipSlot, ref robes);
124  }
125  }
126 
132  public virtual void DrawHands(ref bool drawHands, ref bool drawArms) {
133  if (item != null) {
134  item.DrawHands(ref drawHands, ref drawArms);
135  }
136  }
137 
143  public virtual void DrawHair(ref bool drawHair, ref bool drawAltHair) {
144  if (item != null) {
145  item.DrawHair(ref drawHair, ref drawAltHair);
146  }
147  }
148 
153  public virtual bool DrawHead() {
154  return item == null || item.DrawHead();
155  }
156 
161  public virtual bool DrawBody() {
162  return item == null || item.DrawBody();
163  }
164 
169  public virtual bool DrawLegs() {
170  return item == null || item.DrawLegs();
171  }
172 
181  public virtual void DrawArmorColor(Player drawPlayer, float shadow, ref Color color, ref int glowMask, ref Color glowMaskColor) {
182  if (item != null) {
183  item.DrawArmorColor(drawPlayer, shadow, ref color, ref glowMask, ref glowMaskColor);
184  }
185  }
186 
194  public virtual void ArmorArmGlowMask(Player drawPlayer, float shadow, ref int glowMask, ref Color color) {
195  if (item != null) {
196  item.ArmorArmGlowMask(drawPlayer, shadow, ref glowMask, ref color);
197  }
198  }
199 
209  public virtual void VerticalWingSpeeds(Player player, ref float ascentWhenFalling, ref float ascentWhenRising,
210  ref float maxCanAscendMultiplier, ref float maxAscentMultiplier, ref float constantAscend) {
211  if (item != null) {
212  item.VerticalWingSpeeds(player, ref ascentWhenFalling, ref ascentWhenRising, ref maxCanAscendMultiplier,
213  ref maxAscentMultiplier, ref constantAscend);
214  }
215  }
216 
223  public virtual void HorizontalWingSpeeds(Player player, ref float speed, ref float acceleration) {
224  if (item != null) {
225  item.HorizontalWingSpeeds(player, ref speed, ref acceleration);
226  }
227  }
228 
235  public virtual bool WingUpdate(Player player, bool inUse) {
236  return item?.WingUpdate(player, inUse) ?? false;
237  }
238  }
239 }
virtual void UpdateVanitySet(Player player)
Allows you to create special effects (such as dust) when the player wears this equipment texture's va...
Definition: EquipTexture.cs:97
virtual void VerticalWingSpeeds(Player player, ref float ascentWhenFalling, ref float ascentWhenRising, ref float maxCanAscendMultiplier, ref float maxAscentMultiplier, ref float constantAscend)
Allows you to modify vertical wing speeds.
This serves as a place for you to program behaviors of equipment textures. This is useful for equipme...
Definition: EquipTexture.cs:8
virtual void PreUpdateVanitySet(Player player)
Allows you to create special effects (such as the necro armor's hurt noise) when the player wears thi...
Definition: EquipTexture.cs:87
virtual bool DrawBody()
Return false to hide the player's body when this body equipment texture is worn. By default this will...
EquipType
This is an enum of all the types of equipment that exist. An equipment type is defined as a type or l...
Definition: EquipType.cs:6
virtual bool WingUpdate(Player player, bool inUse)
Allows for wing textures to do various things while in use. "inUse" is whether or not the jump button...
virtual void DrawArmorColor(Player drawPlayer, float shadow, ref Color color, ref int glowMask, ref Color glowMaskColor)
Allows you to modify the colors in which this armor texture and surrounding accessories are drawn...
virtual void ArmorSetShadows(Player player)
Allows you to determine special visual effects this vanity set has on the player without having to co...
virtual void SetMatch(bool male, ref int equipSlot, ref bool robes)
Allows you to modify the equipment that the player appears to be wearing. This hook will only be call...
virtual bool IsVanitySet(int head, int body, int legs)
Returns whether or not the head armor, body armor, and leg armor textures make up a set...
Definition: EquipTexture.cs:76
virtual void DrawHair(ref bool drawHair, ref bool drawAltHair)
Allows you to determine whether the player's hair or alt (hat) hair draws when this head equipment te...
virtual void UpdateVanity(Player player, EquipType type)
Allows you to create special effects (such as dust) when this equipment texture is displayed on the p...
Definition: EquipTexture.cs:63
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
This class serves as a place for you to place all your properties and hooks for each item...
Definition: ModItem.cs:16
virtual bool DrawHead()
Return false to hide the player's head when this head equipment texture is worn. By default this will...
virtual bool DrawLegs()
Return false to hide the player's legs when this leg or shoe equipment texture is worn...
virtual void DrawHands(ref bool drawHands, ref bool drawArms)
Allows you to determine whether the skin/shirt on the player's arms and hands are drawn when this bod...
virtual void HorizontalWingSpeeds(Player player, ref float speed, ref float acceleration)
Allows you to modify horizontal wing speeds.
virtual void ArmorArmGlowMask(Player drawPlayer, float shadow, ref int glowMask, ref Color color)
Allows you to modify which glow mask and in what color is drawn on the player's arms. Note that this is only called for body equipment textures. By default this will call the associated ModItem's ArmorArmGlowMask if there is an associated ModItem.