zenno: section speed does not use base wit
ci/woodpecker/push/horsebot Pipeline was successful
ci/woodpecker/push/zenno Pipeline was successful

Per analysis by Aya, only final wit is used for section speed.

Fixes #40.
This commit is contained in:
2026-09-03 15:30:29 -04:00
parent c7a847f677
commit d0c11aa527
6 changed files with 37 additions and 54 deletions
+4 -10
View File
@@ -504,14 +504,12 @@ export function baseTargetSpeed(
/**
* Calculate the range of section speed values for a horse in early or mid race.
* @param raceLen Length of the race in meters
* @param baseWit Base wit, after mood but before other modifiers
* @param witStat Final wit stat, including strategy proficiency and skills
* @param style Horse's running style
* @param phase Phase of the current section
*/
export function sectionSpeed(
raceLen: number,
baseWit: number,
witStat: number,
style: RunningStyle,
phase: Exclude<Phase, Phase.LateRace>,
@@ -520,7 +518,6 @@ export function sectionSpeed(
* Calculate the range of section speed values for a horse not spurting during late race.
* @param raceLen Length of the race in meters
* @param speedStat Final speed stat
* @param baseWit Base wit, after mood but before other modifiers
* @param witStat Final wit stat, including strategy proficiency and skills
* @param style Horse's running style
* @param distance Hores's distance proficiency aptitude
@@ -529,7 +526,6 @@ export function sectionSpeed(
export function sectionSpeed(
raceLen: number,
speedStat: number,
baseWit: number,
witStat: number,
style: RunningStyle,
distance: AptitudeLevel,
@@ -537,16 +533,14 @@ export function sectionSpeed(
): [number, number];
export function sectionSpeed(
raceLen: number,
speedStatOrBaseWit: number,
baseWitOrWitStat: number,
speedStatOrWitStat: number,
witStatOrStyle: number | RunningStyle,
styleOrPhase: RunningStyle | Phase,
distance?: AptitudeLevel,
lateRace?: Phase.LateRace,
): [number, number] {
const speedStat = lateRace !== undefined ? speedStatOrBaseWit : 0;
const baseWit = lateRace !== undefined ? baseWitOrWitStat : speedStatOrBaseWit;
const witStat = lateRace !== undefined ? witStatOrStyle : baseWitOrWitStat;
const speedStat = lateRace !== undefined ? speedStatOrWitStat : 0;
const witStat = lateRace !== undefined ? witStatOrStyle : speedStatOrWitStat;
const style = lateRace !== undefined ? (styleOrPhase as RunningStyle) : (witStatOrStyle as RunningStyle);
const phase = lateRace !== undefined ? lateRace : (styleOrPhase as Phase);
const base = baseSpeed(raceLen);
@@ -555,7 +549,7 @@ export function sectionSpeed(
phase === Phase.LateRace
? (math.sqrt(500 * speedStat) as number) * distanceProficiencyMod[distance ?? AptitudeLevel.A] * 0.002
: 0;
const u = (witStat / 550000) * math.log10(baseWit * 0.1);
const u = (witStat / 550000) * math.log10(witStat * 0.1);
const l = u - 0.0065;
return [baseTarget + late + base * l, baseTarget + late + base * u];
}