zenno: stamina calculator first pass
ci/woodpecker/push/horsebot Pipeline was successful
ci/woodpecker/push/zenno Pipeline was successful

This commit is contained in:
2026-09-03 06:51:47 -04:00
parent e5f18d3c78
commit 0791fdd3d4
7 changed files with 304 additions and 27 deletions
+11
View File
@@ -354,6 +354,17 @@ export function maxHP(raceLen: number, style: RunningStyle, stamStat: number): n
return 0.8 * hpStrategyCoeff[style] * stamStat + raceLen;
}
/**
* Compute the stamina stat that would produce a given effective HP
* @param raceLen Length of the race in meters
* @param style Horse's running style
* @param hp Effective HP, i.e. max HP plus recoveries minus debuffs
* @returns Stamina
*/
export function effectiveStam(raceLen: number, style: RunningStyle, hp: number): number {
return (hp - raceLen) / (0.8 * hpStrategyCoeff[style]);
}
const groundHPRateMod = {
[Surface.Turf]: {
[GroundConditions.Firm]: 1,