Terraria ModLoader  0.10.1.5
A framework for Terraria mods
Terraria.ModLoader.ModMountData Class Reference

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. More...

+ Collaboration diagram for Terraria.ModLoader.ModMountData:

Public Member Functions

 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 JumpHeight (ref int jumpHeight, float xVelocity)
 Allows you to modify the mount's jump height based on its state. More...
 
virtual void JumpSpeed (ref float jumpSeed, float xVelocity)
 Allows you to modify the mount's jump speed based on its state. More...
 
virtual void SetDefaults ()
 Allows you to set the properties of this type of mount. 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...
 

Properties

Mod mod [get, set]
 The mod which has added this ModMountData. More...
 
Mount.MountData mountData [get, set]
 The vanilla MountData object that is controlled by this ModMountData. More...
 
string Name [get, set]
 The name of this type of mount. More...
 
int Type [get, set]
 The index of this ModMountData in the Mount.mounts array. More...
 

Detailed Description

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.

Definition at line 9 of file ModMountData.cs.

Constructor & Destructor Documentation

Terraria.ModLoader.ModMountData.ModMountData ( )

Constructor

Definition at line 48 of file ModMountData.cs.

48  {
49  mountData = new Mount.MountData();
50  }
Mount.MountData mountData
The vanilla MountData object that is controlled by this ModMountData.
Definition: ModMountData.cs:16

Member Function Documentation

virtual void Terraria.ModLoader.ModMountData.AimAbility ( Player  player,
Vector2  mousePosition 
)
virtual

Allows you to make things happen when the mount ability is aiming (while charging).

Parameters
player
mousePosition

Definition at line 130 of file ModMountData.cs.

130  {
131  }
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 59 of file ModMountData.cs.

References Terraria.ModLoader.ModMountData.mod, Terraria.ModLoader.ModMountData.mountData, and Terraria.ModLoader.ModMountData.SetDefaults().

59  {
60  return mod.Properties.Autoload;
61  }
Mod mod
The mod which has added this ModMountData.
Definition: ModMountData.cs:24
ModProperties Properties
Definition: Mod.cs:49
bool Autoload
Whether or not this mod will autoload content by default. Autoloading content means you do not need t...

+ Here is the call graph for this function:

virtual void Terraria.ModLoader.ModMountData.JumpHeight ( ref int  jumpHeight,
float  xVelocity 
)
virtual

Allows you to modify the mount's jump height based on its state.

Parameters
jumpHeight
xVelocity

Definition at line 82 of file ModMountData.cs.

82  {
83  }
virtual void Terraria.ModLoader.ModMountData.JumpSpeed ( ref float  jumpSeed,
float  xVelocity 
)
virtual

Allows you to modify the mount's jump speed based on its state.

Parameters
jumpSeed
xVelocity

Definition at line 90 of file ModMountData.cs.

90  {
91  }
virtual void Terraria.ModLoader.ModMountData.SetDefaults ( )
virtual

Allows you to set the properties of this type of mount.

Definition at line 74 of file ModMountData.cs.

Referenced by Terraria.ModLoader.ModMountData.Autoload().

74  {
75  }

+ Here is the caller graph for this function:

virtual void Terraria.ModLoader.ModMountData.UpdateEffects ( Player  player)
virtual

Allows you to make things happen when mount is used (creating dust etc.) Can also be used for mount special abilities.

Parameters
player

Definition at line 97 of file ModMountData.cs.

97  {
98  }
virtual bool Terraria.ModLoader.ModMountData.UpdateFrame ( Player  mountedPlayer,
int  state,
Vector2  velocity 
)
virtual

Allows for manual updating of mount frame. Return false to stop the default frame behavior. Returns true by default.

Parameters
mountedPlayer
state
velocity
Returns

Definition at line 107 of file ModMountData.cs.

107  {
108  return true;
109  }
virtual void Terraria.ModLoader.ModMountData.UseAbility ( Player  player,
Vector2  mousePosition,
bool  toggleOn 
)
virtual

Allows you to make things happen while the mouse is pressed while the mount is active. Called each tick the mouse is pressed.

Parameters
player
mousePosition
toggleOnDoes nothing yet

Definition at line 122 of file ModMountData.cs.

122  {
123  }

Property Documentation

Mod Terraria.ModLoader.ModMountData.mod
getset
Mount.MountData Terraria.ModLoader.ModMountData.mountData
getset

The vanilla MountData object that is controlled by this ModMountData.

Definition at line 16 of file ModMountData.cs.

Referenced by Terraria.ModLoader.ModMountData.Autoload(), and Terraria.ModLoader.Mod.LoadEffect().

string Terraria.ModLoader.ModMountData.Name
getset

The name of this type of mount.

Definition at line 40 of file ModMountData.cs.

Referenced by Terraria.ModLoader.Mod.AddMount().

int Terraria.ModLoader.ModMountData.Type
getset

The index of this ModMountData in the Mount.mounts array.

Definition at line 32 of file ModMountData.cs.

Referenced by Terraria.ModLoader.Mod.AddMount(), and Terraria.ModLoader.Mod.LoadEffect().