This class serves as a place for you to place all your properties and hooks for each mount. Create instances of ModMoundData (preferably overriding this class) to pass as parameters to Mod.AddMount. Only one instance of ModMountData will exist for each mount, so storing player specific data on the ModMountData is not good. Modders can use player.mount._mountSpecificData or a ModPlayer class to store player specific data relating to a mount. Use SetMount to assign these fields.
More...
|
| ModMountData () |
| Constructor More...
|
|
virtual void | AimAbility (Player player, Vector2 mousePosition) |
| Allows you to make things happen when the mount ability is aiming (while charging). More...
|
|
virtual bool | Autoload (ref string name, ref string texture, IDictionary< MountTextureType, string > extraTextures) |
| Allows you to automatically load a mount instead of using Mod.AddMount. Return true to allow autoloading; by default returns the mod's autoload property. Name is initialized to the overriding class name, texture is initialized to the namespace and overriding class name with periods replaced with slashes, and extraTextures is initialized to a dictionary containing all MountTextureTypes as keys, with texture + "_" + the texture type name as values. Use this method to either force or stop an autoload, change the default display name and texture path, and to modify the extra mount textures. More...
|
|
virtual void | Dismount (Player player, ref bool skipDust) |
| Allows you to make things happen when this mount is de-spawned. Useful for player-specific cleanup, see SetMount. Custom dust spawning logic is also possible via the skipDust parameter. More...
|
|
virtual bool | Draw (List< DrawData > playerDrawData, int drawType, Player drawPlayer, ref Texture2D texture, ref Texture2D glowTexture, ref Vector2 drawPosition, ref Rectangle frame, ref Color drawColor, ref Color glowColor, ref float rotation, ref SpriteEffects spriteEffects, ref Vector2 drawOrigin, ref float drawScale, float shadow) |
| Allows for complete customization of mount drawing. This method will be called once for each supported mount texture layer that exists. Use drawType to conditionally apply changes. drawType corresponds to the following: 0: backTexture, 1: backTextureExtra, 2: frontTexture. 3: frontTextureExtra Corresponding glow textures, such as backTextureGlow, are paired with their corresponding texture and passed into this method as well. Return false if you are manually adding DrawData to playerDrawData to replace the vanilla draw behavior, otherwise tweak ref variables to customize the drawing and add additional DrawData to playerDrawData. More...
|
|
virtual void | JumpHeight (Player mountedPlayer, ref int jumpHeight, float xVelocity) |
| Allows you to modify the mount's jump height based on its state. More...
|
|
virtual void | JumpHeight (ref int jumpHeight, float xVelocity) |
|
virtual void | JumpSpeed (Player mountedPlayer, ref float jumpSeed, float xVelocity) |
| Allows you to modify the mount's jump speed based on its state. More...
|
|
virtual void | JumpSpeed (ref float jumpSeed, float xVelocity) |
|
virtual void | SetDefaults () |
| Allows you to set the properties of this type of mount. More...
|
|
virtual void | SetMount (Player player, ref bool skipDust) |
| Allows you to make things happen when this mount is spawned in. Useful for player-specific initialization, utilizing player.mount._mountSpecificData or a ModPlayer class since ModMountData is shared between all players. Custom dust spawning logic is also possible via the skipDust parameter. More...
|
|
virtual void | UpdateEffects (Player player) |
| Allows you to make things happen when mount is used (creating dust etc.) Can also be used for mount special abilities. More...
|
|
virtual bool | UpdateFrame (Player mountedPlayer, int state, Vector2 velocity) |
| Allows for manual updating of mount frame. Return false to stop the default frame behavior. Returns true by default. More...
|
|
virtual void | UseAbility (Player player, Vector2 mousePosition, bool toggleOn) |
| Allows you to make things happen while the mouse is pressed while the mount is active. Called each tick the mouse is pressed. More...
|
|
This class serves as a place for you to place all your properties and hooks for each mount. Create instances of ModMoundData (preferably overriding this class) to pass as parameters to Mod.AddMount. Only one instance of ModMountData will exist for each mount, so storing player specific data on the ModMountData is not good. Modders can use player.mount._mountSpecificData or a ModPlayer class to store player specific data relating to a mount. Use SetMount to assign these fields.
Definition at line 14 of file ModMountData.cs.
virtual bool Terraria.ModLoader.ModMountData.Autoload |
( |
ref string |
name, |
|
|
ref string |
texture, |
|
|
IDictionary< MountTextureType, string > |
extraTextures |
|
) |
| |
|
virtual |
Allows you to automatically load a mount instead of using Mod.AddMount. Return true to allow autoloading; by default returns the mod's autoload property. Name is initialized to the overriding class name, texture is initialized to the namespace and overriding class name with periods replaced with slashes, and extraTextures is initialized to a dictionary containing all MountTextureTypes as keys, with texture + "_" + the texture type name as values. Use this method to either force or stop an autoload, change the default display name and texture path, and to modify the extra mount textures.
- Parameters
-
name | |
texture | |
extraTextures | |
- Returns
Definition at line 64 of file ModMountData.cs.
64 {
66 }
Mod mod
The mod which has added this ModMountData.
bool Autoload
Whether or not this mod will autoload content by default. Autoloading content means you do not need t...
References Terraria.ModLoader.ModProperties.Autoload, Terraria.ModLoader.ModMountData.mod, and Terraria.ModLoader.Mod.Properties.
virtual bool Terraria.ModLoader.ModMountData.Draw |
( |
List< DrawData > |
playerDrawData, |
|
|
int |
drawType, |
|
|
Player |
drawPlayer, |
|
|
ref Texture2D |
texture, |
|
|
ref Texture2D |
glowTexture, |
|
|
ref Vector2 |
drawPosition, |
|
|
ref Rectangle |
frame, |
|
|
ref Color |
drawColor, |
|
|
ref Color |
glowColor, |
|
|
ref float |
rotation, |
|
|
ref SpriteEffects |
spriteEffects, |
|
|
ref Vector2 |
drawOrigin, |
|
|
ref float |
drawScale, |
|
|
float |
shadow |
|
) |
| |
|
virtual |
Allows for complete customization of mount drawing. This method will be called once for each supported mount texture layer that exists. Use drawType to conditionally apply changes. drawType corresponds to the following: 0: backTexture, 1: backTextureExtra, 2: frontTexture. 3: frontTextureExtra Corresponding glow textures, such as backTextureGlow, are paired with their corresponding texture and passed into this method as well. Return false if you are manually adding DrawData to playerDrawData to replace the vanilla draw behavior, otherwise tweak ref variables to customize the drawing and add additional DrawData to playerDrawData.
- Parameters
-
playerDrawData | |
drawType | Corresponds to the following: 0: backTexture, 1: backTextureExtra, 2: frontTexture. 3: frontTextureExtra |
drawPlayer | |
texture | |
glowTexture | The corresponding glow texture, if present |
drawPosition | |
frame | |
drawColor | |
glowColor | |
rotation | |
spriteEffects | |
drawOrigin | |
drawScale | |
shadow | |
- Returns
Definition at line 187 of file ModMountData.cs.
187 {
188 return true;
189 }