Files
claudeandClaude Opus 5.5 a691315db7
Ashlar checks / tooling (push) Successful in 9s
Add a stamina-driven sprint
New [Game] sprint setting, on by default, with sprint speed multiplier
(1.4 times run speed), sprint fatigue drain (10 per second on top of
running, halved at Athletics 100) and sprint fatigue threshold (0.1 of
maximum fatigue to start). A sprint ends when fatigue falls below 1% of
maximum; regeneration keeps fatigue just above 0 while running, so
exactly 0 is never reached.

Sprint is engine action 52, Lua input.ACTION.Sprint and the player's
'Sprint' Lua action, with self.controls.sprint. Defaults are Left Alt
and D-pad up, because L3 is already Sneak. Sprinting needs forward
movement within 45 degrees, and isn't possible while sneaking, in the
block stance, swimming, levitating, knocked down or paralyzed. Pressing
Use with a weapon or spell ready ends the sprint until Sprint is
released, so no attack starts while sprinting. A sprint counts as
running for animations, Athletics and the running fatigue cost. AI
doesn't sprint. With the setting off the control does nothing.

The rules are in mwmechanics/sprint.cpp with unit tests. The movement
scenario gains sprint, tiredsprint and sprintuse phases, run in a
circle from the start point so the player stays on land.

Closes #27

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 04:12:57 -05:00

78 lines
1.9 KiB
C++

#ifndef MWINPUT_ACTIONS_H
#define MWINPUT_ACTIONS_H
namespace MWInput
{
enum Actions
{
// Action IDs are used in the configuration file input_v3.xml
A_GameMenu = 0,
A_Screenshot = 2, // Take a screenshot
A_Inventory = 3, // Toggle inventory screen
A_Console = 4, // Toggle console screen
A_MoveLeft = 5, // Move player left / right
A_MoveRight = 6,
A_MoveForward = 7, // Forward / Backward
A_MoveBackward = 8,
A_Activate = 9,
A_Use = 10, // Use weapon, spell, etc.
A_Jump = 11,
A_AutoMove = 12, // Toggle Auto-move forward
A_Rest = 13, // Rest
A_Journal = 14, // Journal
A_Run = 17, // Run when held
A_CycleSpellLeft = 18, // cycling through spells
A_CycleSpellRight = 19,
A_CycleWeaponLeft = 20, // Cycling through weapons
A_CycleWeaponRight = 21,
A_AlwaysRun = 23, // Toggle Walking/Running
A_Sneak = 24,
A_QuickSave = 25,
A_QuickLoad = 26,
A_QuickMenu = 27,
A_ToggleWeapon = 28,
A_ToggleSpell = 29,
A_TogglePOV = 30,
A_QuickKey1 = 31,
A_QuickKey2 = 32,
A_QuickKey3 = 33,
A_QuickKey4 = 34,
A_QuickKey5 = 35,
A_QuickKey6 = 36,
A_QuickKey7 = 37,
A_QuickKey8 = 38,
A_QuickKey9 = 39,
A_QuickKey10 = 40,
A_QuickKeysMenu = 41,
A_ToggleHUD = 42,
A_ToggleDebug = 43,
A_LookUpDown = 44, // Joystick look
A_LookLeftRight = 45,
A_MoveForwardBackward = 46,
A_MoveLeftRight = 47,
A_ZoomIn = 48,
A_ZoomOut = 49,
A_TogglePostProcessorHUD = 50,
A_Block = 51, // Ashlar: hold to block
A_Sprint = 52, // Ashlar: hold to sprint
A_Last // Marker for the last item
};
}
#endif