Dashing Hook

This Hook was created by Pie75

The Preliminary Values
This Hook Basically makes your mount initiate its dashing frame when it reaches half of its max speed

The Max Speed
The Max Speed is determined the value put in "mountData.dashSpeed" multiplied by the value put in "mountData.Acceleration"

The speed at which Max Speed is reached is determined by the put in "mountData.dashSpeed" divided by the value put in "mountData.runspeed"

Example of Use of Max Speed values
If you wanted your mount to reach a max speed of 51mph in about 2 seconds you'd set the values to the following:

mountData.runSpeed = 5;

mountData.dashSpeed = 10;

mountData.acceleration = 0.5f;

The Dashing and Running Animations
Your Dashing and Running Animations will need to be set correctly in order for your Mount to display correctly, they are set through "mountData.runningFrameCount", "mountData.runningFrameDelay", "mountData.runningFrameStart", and "mountData.dashingFrameCount", "mountData.dashingFrameDelay", "mountData.dashingFrameStart", please note, for these values to be calculated coorectly, the value put in "mountData.totalFrames" must be correct.

The Frame Count
The Frame Count of your Mount is the amount of times your mount appears in your animation sprite in a vertical line

The Frame Delay
The Frame Delay is how long it takes for your mount to switch to the next frame, in ticks, not seconds

(1 tick = 100th of a second)

The Frame Start
The Frame start is the Frame at which your Mount begins the specified animation, where 0 is the topmost frame in your animation and 1 is below that.

Example use of Frames
if my Mount had sixteen Frames and 9 were running animation, 6 were dashing animation and 1 was the In air frame (which is neccesary) and they appeared on the sheet in that order, and you wanted them to have a delay of 15 ticks between each frame, you'd set the values like this:

mountData.totalFrames = 16;

mountData.runningFrameCount = 9;

mountData.runningFrameDelay = 20;

mountData.runningFrameStart = 0;

mountData.inAirFrameCount = 1;

mountData.inAirFrameDelay = 0;

mountData.inAirFrameStart = 15;

mountData.dashingFrameStart = 9;

mountData.dashingFrameDelay = 30;

mountData.dashingFrameCount = 6;

The Dashing Hook
public override void UpdateEffects(Player player)         { {                 if (player.direction >0) {                     if (player.velocity.X <= (mountData.dashSpeed/ 2)) {                         mountData.runningFrameCount = 9; mountData.runningFrameDelay = 20; mountData.runningFrameStart = 0; }                     else if (player.velocity.X > (mountData.dashSpeed/ 2)) {                         mountData.runningFrameCount = mountData.dashingFrameCount; mountData.runningFrameDelay = mountData.dashingFrameDelay; mountData.runningFrameStart = mountData.dashingFrameStart; }                 }                  else if (player.velocity.X <0) {                          if (player.velocity.X >= ((mountData.dashSpeed - 2 * (mountData.dashSpeed))/ 2)) {                         mountData.runningFrameCount = 9; mountData.runningFrameDelay = 20; mountData.runningFrameStart = 0; }                          else if (player.velocity.X < ((mountData.dashSpeed - 2 * (mountData.dashSpeed))/ 2)) {                         mountData.runningFrameCount = mountData.dashingFrameCount; mountData.runningFrameDelay = mountData.dashingFrameDelay; mountData.runningFrameStart = mountData.dashingFrameStart; }                 }               }

The proper use of this code
To use this code effectively, you'll need to change the values a bit, and insert it after the SetDefaults code

you'll need to change the runningFrameCount, runningFrameDelay, and runninFrameStart to suit your mounts needs, your SetDefaults Hook Will also need to have the dashingFrameCount, dashingFrameDelay ad dashingFrameStart, changing anything else may lead to unexpected results