zenno: stamina calculator first pass
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user