zenno/career/ismdata: start of auto career analysis
ci/woodpecker/push/horsebot Pipeline was successful
ci/woodpecker/push/zenno Pipeline failed

This commit is contained in:
2026-08-07 17:01:33 -04:00
parent 5a13519189
commit 1fe397ca81
13 changed files with 794 additions and 36 deletions
+70 -33
View File
@@ -20,6 +20,34 @@ export enum Stat {
*/
export const StatList = [Stat.Speed, Stat.Stamina, Stat.Power, Stat.Guts, Stat.Wit] as const;
/**
* Aptitude or proficiency levels.
*/
export enum AptitudeLevel {
G = 1,
F = 2,
E = 3,
D = 4,
C = 5,
B = 6,
A = 7,
S = 8,
}
/**
* Aptitude levels as a descending list for easy iterating.
*/
export const APTITUDE_LEVELS = [
AptitudeLevel.S,
AptitudeLevel.A,
AptitudeLevel.B,
AptitudeLevel.C,
AptitudeLevel.D,
AptitudeLevel.E,
AptitudeLevel.F,
AptitudeLevel.G,
] as const;
/**
* Mood levels.
*/
@@ -159,7 +187,16 @@ const powerStatGroundMod = {
},
} as const;
const strategyProficiencyMod = [0.1, 0.2, 0.4, 0.6, 0.75, 0.85, 1.0, 1.1] as const;
const strategyProficiencyMod: Readonly<Record<AptitudeLevel, number>> = {
[AptitudeLevel.G]: 0.1,
[AptitudeLevel.F]: 0.2,
[AptitudeLevel.E]: 0.4,
[AptitudeLevel.D]: 0.6,
[AptitudeLevel.C]: 0.75,
[AptitudeLevel.B]: 0.85,
[AptitudeLevel.A]: 1.0,
[AptitudeLevel.S]: 1.1,
} as const;
/**
* Compute adjusted speed for a race.
@@ -282,34 +319,6 @@ export const RUNNING_STYLES = [
['Runaway', RunningStyle.Runaway],
] as const;
/**
* Aptitude or proficiency levels.
*/
export enum AptitudeLevel {
G,
F,
E,
D,
C,
B,
A,
S,
}
/**
* Aptitude levels as a descending list for easy iterating.
*/
export const APTITUDE_LEVELS = [
AptitudeLevel.S,
AptitudeLevel.A,
AptitudeLevel.B,
AptitudeLevel.C,
AptitudeLevel.D,
AptitudeLevel.E,
AptitudeLevel.F,
AptitudeLevel.G,
] as const;
/**
* Race phases.
* While last spurt phase is also a phase, it is not distinguished here.
@@ -428,7 +437,16 @@ const speedStrategyPhaseCoeff = [
[1.063, 0.962, 0.95],
] as const;
const distanceProficiencyMod = [0.1, 0.2, 0.4, 0.6, 0.8, 0.9, 1.0, 1.05] as const;
const distanceProficiencyMod: Readonly<Record<AptitudeLevel, number>> = {
[AptitudeLevel.G]: 0.1,
[AptitudeLevel.F]: 0.2,
[AptitudeLevel.E]: 0.4,
[AptitudeLevel.D]: 0.6,
[AptitudeLevel.C]: 0.8,
[AptitudeLevel.B]: 0.9,
[AptitudeLevel.A]: 1.0,
[AptitudeLevel.S]: 1.05,
} as const;
/**
* Get a horse's base target speed outside of late race.
@@ -457,7 +475,7 @@ export function baseTargetSpeed(
style: RunningStyle,
phase: Phase,
speedStat?: number,
distanceApt?: number,
distanceApt?: AptitudeLevel,
): number {
const base = baseSpeed(raceLen);
const baseTarget = base * speedStrategyPhaseCoeff[style][phase];
@@ -598,8 +616,27 @@ const accelStrategyPhaseCoeff = {
[RunningStyle.Runaway]: [1.17, 0.94, 0.956],
} as const;
const surfaceProficiencyMod = [0.1, 0.3, 0.5, 0.7, 0.8, 0.9, 1.0, 1.05] as const;
const accelDistanceProficiencyMod = [0.4, 0.5, 0.6, 1, 1, 1, 1, 1] as const;
const surfaceProficiencyMod: Readonly<Record<AptitudeLevel, number>> = {
[AptitudeLevel.G]: 0.1,
[AptitudeLevel.F]: 0.3,
[AptitudeLevel.E]: 0.5,
[AptitudeLevel.D]: 0.7,
[AptitudeLevel.C]: 0.8,
[AptitudeLevel.B]: 0.9,
[AptitudeLevel.A]: 1.0,
[AptitudeLevel.S]: 1.05,
} as const;
const accelDistanceProficiencyMod: Readonly<Record<AptitudeLevel, number>> = {
[AptitudeLevel.G]: 0.4,
[AptitudeLevel.F]: 0.5,
[AptitudeLevel.E]: 0.6,
[AptitudeLevel.D]: 1.0,
[AptitudeLevel.C]: 1.0,
[AptitudeLevel.B]: 1.0,
[AptitudeLevel.A]: 1.0,
[AptitudeLevel.S]: 1.0,
} as const;
/**
* Calculate a horse's instantaneous acceleration value.