Sprint and Dash Mod Redux

SMAPI Sprint and Dash Mod Redux 2.1.0

This is an extension of OrSpeeder's excellent Sprint and Dash mod. It adds the following functions to the game:
  • Sprinting: Moving faster than usual in exchange for stamina while moving. By default, this uses the Space Key to toggle this behavior on or off, but it can be configured to only activate when the key is held down.
  • Dashing: A temporary skill-scaling powerup that buffs your speed, attack power, and defense for a time, with an associated cooldown/vulnerability phase. Think of it as a combat panic button. By default activated with the Q Key.
  • Getting winded: Progressive stamina drain over time such that the longer you sprint for, the more stamina you will lose every second.
Gamepad/controller users: Although I use the word "key" throughout this description, under the hood the code can recognize controller buttons too. The only limitation (for now) is some logic used to detect whether you are running still expects a key. Since I think 99% of users probably autorun, this will likely not matter.

Configuration

Note that while this section refers to the config file, you can change settings in game using the Generic Mod Config Menu interface.

Sprint and Dash Mod Redux can be configured in the following ways:
  • SprintKey: Button used to activate sprinting. See this page for info on how to set buttons.
  • DashKey: Button used to activate the dash. See this page for info on how to set buttons.
  • StamCost: Measured in points of stamina, how much sprinting costs per second. By default, this is 2. Minimum is 1, lower values will be treated as 1.
  • DashDuration: Measured in seconds. By default this is 4 seconds. Note that the cooldown will last for 2.5x as long as whatever you set its length to (i.e., by default 10 seconds). Minimum is 1 second, maximum is 10 seconds. Values beyond the maximum will be treated as the maximum. Values below the minimum (e.g., 0) will turn the dash feature off.
  • WindedStep: Measured in seconds. By default, this is 5 seconds. Set to 0 to ignore/deactivate this system. Explained in more depth below.
  • QuitSprintingAt: Stop player from sprinting when stamina drops to a percentage of max stamina equal to this value. Default is 30. Minimum is 0, lower values will be treated as 0.
  • ToggleMode: Whether to use the sprint (and normal "run") keys as a toggle, where pressing once turns it on until you press again to turn it off. By default, this is true. Note that this will turn the run key into a toggle, due to the need to avoid applying the sprint buff while walking. (I kind of assume everyone is using autorun tbh.) When set to false, you only sprint while the button is pressed.
Finally, there are two "hidden" config items that are advanced and not needed by most players. These do not appear in the config file by default but can be added.
  • TimeInterval: How often, in seconds, to actually perform regeneration calculations. By default this is 0.1, meaning every tenth of a second (or about 6 game ticks). This value is validated such that we always end up with an interval between 1 and 60 ticks (inclusive), therefore it makes no sense to enter more than 1, or 0 or less. This setting is not really useful unless you have major performance issues. The higher this number is, the less frequently the mod will do any real calculations and therefore the less work it makes your computer do. The lower this number is, though, the more responsive the mod will be to changes in state. Setting this value too low may cause some issues if you rapidly press the sprint key for some reason.
  • VerboseMode: By default it is "false" and controls whether to output regular calibration data.
Getting Winded

This system puts a brake on sprinting for long periods of time beyond the basic per-second stamina cost. The idea is that the longer you sprint for, the more it tires you out, making you "winded" after a certain amount of time set by the config value.

For every (windedStep) seconds you run, the stamina cost per second of running increases by 100% of the base. For example, at the default config values: for the first five seconds, it costs 2 stam/sec, then after that for the next five (6-10) seconds, 4 stam/sec, then after that for the next five (11-15) seconds, 6 stam/sec, etc... It will also keep track of your sprint time if you sprint for less than the step time, and pick back up where you left off. No cheesing with 4-second sprint bursts!

You will also need to take a bit of a break from sprinting if you want this to go away. It takes one second to lower the penalty by 100% of base. Continuing the example above: when you stop sprinting, if you immediately start again, the 6 stam/sec cost remains. If you stop sprinting for 1 second, it goes down to 4/sec, and if you stop sprinting for another second, it goes down to 2/sec (base).

Permissions

I don't really care if you redistribute it or alter it or use it in compilations. I'd ask that you give credit to myself and OrSpeeder, that's all. It has the same GNU Public License 3 (with permissions to modify and redistribute given credit and notice of alteration) as the original and the source code is included in the download as a resource.

Credits

This is an adaption of the work of OrSpeeder, who created the original Sprint and Dash Mod. I recommend checking his version of the mod out if this isn't your thing, or to check out his other mods.
Author
LittleRaskol
Downloads
2,036
Views
4,765
First release
Last update
Rating
0.00 star(s) 0 ratings

More resources from LittleRaskol

  • ReRegeneration
    SMAPI ReRegeneration
    Provides configurable health and stamina regeneration under a variety of conditions.

Latest updates

  1. Version 2.1.0

    Now with Generic Mod Config Menu support. (GMCM not required for anything but in-game...
  2. Hotfix 2.0.1 (9/15/20)

    Fixed bug with interval system that prevented proper continuity of sprint buff and activation of...
Top