tModLoader v0.11.8.9
A mod to make and play Terraria mods
EquipTexture.cs
Go to the documentation of this file.
1using Microsoft.Xna.Framework;
2
3namespace 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) {
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}
This serves as a place for you to program behaviors of equipment textures. This is useful for equipme...
Definition: EquipTexture.cs:9
virtual void HorizontalWingSpeeds(Player player, ref float speed, ref float acceleration)
Allows you to modify horizontal wing speeds.
virtual bool DrawHead()
Return false to hide the player's head when this head equipment texture is worn. By default this will...
Mod mod
The mod that added this equipment texture.
Definition: EquipTexture.cs:21
int Slot
The slot (internal ID) of this equipment texture.
Definition: EquipTexture.cs:45
string Texture
The name and folders of the texture file used by this equipment texture.
Definition: EquipTexture.cs:13
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....
virtual void ArmorSetShadows(Player player)
Allows you to determine special visual effects this vanity set has on the player without having to co...
virtual bool DrawBody()
Return false to hide the player's body when this body equipment texture is worn. By default this will...
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 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 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.
virtual bool DrawLegs()
Return false to hide the player's legs when this leg or shoe equipment texture is worn....
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 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...
ModItem item
The item that is associated with this equipment texture. Null if no item is associated with this.
Definition: EquipTexture.cs:53
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 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...
string Name
The internal name of this equipment texture.
Definition: EquipTexture.cs:29
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,...
EquipType Type
The type of equipment that this equipment texture is used as.
Definition: EquipTexture.cs:37
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:25
This class serves as a place for you to place all your properties and hooks for each item....
Definition: ModItem.cs:17
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...
Definition: ModItem.cs:648
virtual bool DrawBody()
Return false to hide the player's body when this body armor is worn. Returns true by default....
Definition: ModItem.cs:731
virtual void HorizontalWingSpeeds(Player player, ref float speed, ref float acceleration)
Allows you to modify these wing's horizontal flight speed and acceleration.
Definition: ModItem.cs:783
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...
Definition: ModItem.cs:708
virtual void VerticalWingSpeeds(Player player, ref float ascentWhenFalling, ref float ascentWhenRising, ref float maxCanAscendMultiplier, ref float maxAscentMultiplier, ref float constantAscend)
Allows you to modify the speeds at which you rise and fall when these wings are equipped.
Definition: ModItem.cs:773
virtual bool DrawHead()
Return false to hide the player's head when this head armor is worn. Returns true by default....
Definition: ModItem.cs:723
virtual bool DrawLegs()
Return false to hide the player's legs when this leg armor or shoe accessory is worn....
Definition: ModItem.cs:739
virtual void UpdateVanitySet(Player player)
Allows you to create special effects (such as dust) when the player wears this item's vanity set....
Definition: ModItem.cs:629
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: ModItem.cs:602
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 armor is wor...
Definition: ModItem.cs:716
virtual void UpdateVanity(Player player, EquipType type)
Allows you to create special effects (such as dust) when this item's equipment texture of the given e...
Definition: ModItem.cs:576
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....
Definition: ModItem.cs:761
virtual bool WingUpdate(Player player, bool inUse)
Allows for Wings to do various things while in use. "inUse" is whether or not the jump button is curr...
Definition: ModItem.cs:792
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 and surrounding accessories are drawn,...
Definition: ModItem.cs:751
virtual void ArmorSetShadows(Player player)
Allows you to determine special visual effects this vanity set has on the player without having to co...
Definition: ModItem.cs:637
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: ModItem.cs:622
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:7