zenno/spurt: take adjusted speed, not raw speed
This commit is contained in:
@@ -95,21 +95,20 @@ const distanceProficiencyMod = [0.1, 0.2, 0.4, 0.6, 0.8, 0.9, 1.0, 1.05] as cons
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Calculate an Uma's last spurt target speed.
|
* Calculate an Uma's last spurt target speed.
|
||||||
* @param rawSpeed Uma's speed stat. No accounting for mood lol.
|
* @param speedStat Adjusted speed stat
|
||||||
* @param gutsStat Uma's guts stat.
|
* @param gutsStat Adjusted guts stat
|
||||||
* @param style Running style
|
* @param style Running style
|
||||||
* @param distance Distance aptitude
|
* @param distance Distance aptitude
|
||||||
* @param raceLen Length of the race
|
* @param raceLen Length of the race
|
||||||
* @returns Target speed in the last spurt in m/s
|
* @returns Target speed in the last spurt in m/s
|
||||||
*/
|
*/
|
||||||
export function spurtSpeed(
|
export function spurtSpeed(
|
||||||
rawSpeed: number,
|
speedStat: number,
|
||||||
gutsStat: number,
|
gutsStat: number,
|
||||||
style: RunningStyle,
|
style: RunningStyle,
|
||||||
distance: AptitudeLevel,
|
distance: AptitudeLevel,
|
||||||
raceLen: number,
|
raceLen: number,
|
||||||
): number {
|
): number {
|
||||||
const speedStat = rawSpeed <= 1200 ? rawSpeed : 1200 + (rawSpeed - 1200) * 0.5;
|
|
||||||
const spc = speedStrategyPhaseCoeff[style][Phase.LateRace];
|
const spc = speedStrategyPhaseCoeff[style][Phase.LateRace];
|
||||||
const dpm = distanceProficiencyMod[distance];
|
const dpm = distanceProficiencyMod[distance];
|
||||||
const base = baseSpeed(raceLen);
|
const base = baseSpeed(raceLen);
|
||||||
@@ -149,9 +148,6 @@ export function inverseSpurtSpeed(
|
|||||||
const base = baseSpeed(raceLen);
|
const base = baseSpeed(raceLen);
|
||||||
const nr = spurtSpeed - base * (1.05 * spc + 0.0105) - Math.pow(450 * gutsStat, 0.597) * 0.0001;
|
const nr = spurtSpeed - base * (1.05 * spc + 0.0105) - Math.pow(450 * gutsStat, 0.597) * 0.0001;
|
||||||
const r = (nr * nr) / (0.008405 * dpm * dpm);
|
const r = (nr * nr) / (0.008405 * dpm * dpm);
|
||||||
if (r > 1200) {
|
|
||||||
return Math.round(2 * r - 1200);
|
|
||||||
}
|
|
||||||
return Math.round(r);
|
return Math.round(r);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user