tModLoader v2024.10
A mod to make and play Terraria mods
MountLoader Class Reference

This serves as the central place from which mounts are stored and mount-related functions are carried out. More...

Static Public Member Functions

static void AimAbility (Mount mount, Player player, Vector2 mousePosition)
 Allows you to make things happen when the mount ability is aiming (while charging). More...
 
static void Dismount (Mount mount, 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...
 
static bool Draw (Mount mount, 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)
 See ModMount.Draw(List<DrawData>, int, Player, ref Texture2D, ref Texture2D, ref Vector2, ref Rectangle, ref Color, ref Color, ref float, ref SpriteEffects, ref Vector2, ref float, float)
 
static ModMount GetMount (int type)
 Gets the ModMount instance corresponding to the given type. Returns null if no ModMount has the given type. More...
 
static void JumpHeight (Player mountedPlayer, Mount.MountData mount, ref int jumpHeight, float xVelocity)
 
static void JumpSpeed (Player mountedPlayer, Mount.MountData mount, ref float jumpSpeed, float xVelocity)
 
static void SetMount (Mount mount, 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 ModMount is shared between all players. Custom dust spawning logic is also possible via the skipDust parameter. More...
 
static 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

static int MountCount = MountID.Count [get]
 

Detailed Description

This serves as the central place from which mounts are stored and mount-related functions are carried out.

Member Function Documentation

◆ AimAbility()

static void MountLoader.AimAbility ( Mount  mount,
Player  player,
Vector2  mousePosition 
)
static

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

Parameters
mount
player
mousePosition

◆ Dismount()

static void MountLoader.Dismount ( Mount  mount,
Player  player,
ref bool  skipDust 
)
static

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.

Parameters
mount
player
skipDustSet to true to skip the vanilla dust spawning logic

◆ GetMount()

static ModMount MountLoader.GetMount ( int  type)
static

Gets the ModMount instance corresponding to the given type. Returns null if no ModMount has the given type.

Parameters
typeThe type of the mount.
Returns
Null if not found, otherwise the ModMount associated with the mount.

◆ SetMount()

static void MountLoader.SetMount ( Mount  mount,
Player  player,
ref bool  skipDust 
)
static

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 ModMount is shared between all players. Custom dust spawning logic is also possible via the skipDust parameter.

Parameters
mount
player
skipDustSet to true to skip the vanilla dust spawning logic

◆ UseAbility()

static void MountLoader.UseAbility ( Player  player,
Vector2  mousePosition,
bool  toggleOn 
)
static

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