@@ -8,26 +8,33 @@
|
|||||||
|
|
||||||
let rawPower = $state(1200);
|
let rawPower = $state(1200);
|
||||||
let rawGuts = $state(1200);
|
let rawGuts = $state(1200);
|
||||||
let surfApt = $state(race.AptitudeLevel.A);
|
let powerBonus = $state(0);
|
||||||
|
let gutsBonus = $state(0);
|
||||||
|
let surfaceApt = $state(race.AptitudeLevel.A);
|
||||||
let frontApt = $state(race.AptitudeLevel.A);
|
let frontApt = $state(race.AptitudeLevel.A);
|
||||||
|
let mood = $state(race.Mood.Normal);
|
||||||
let isRunaway = $state(false);
|
let isRunaway = $state(false);
|
||||||
let isCareer = $state(false);
|
|
||||||
|
|
||||||
let raceLen = $state(2000);
|
let raceLen = $state(2000);
|
||||||
|
let surface = $state(race.Surface.Turf);
|
||||||
|
let conditions = $state(race.GroundConditions.Firm);
|
||||||
|
|
||||||
const careerMod = $derived(isCareer ? 400 : 0);
|
|
||||||
const powerStat = $derived(rawPower + careerMod);
|
|
||||||
const gutsStat = $derived(rawGuts + careerMod);
|
|
||||||
const style = $derived(isRunaway ? race.RunningStyle.Runaway : race.RunningStyle.FrontRunner);
|
const style = $derived(isRunaway ? race.RunningStyle.Runaway : race.RunningStyle.FrontRunner);
|
||||||
|
const basePower = $derived(race.baseStat(mood, rawPower));
|
||||||
|
const baseGuts = $derived(race.baseStat(mood, rawGuts));
|
||||||
|
const adjPower = $derived(race.adjustedStat(race.Stat.Power, basePower, false, surface, conditions));
|
||||||
|
const adjGuts = $derived(race.adjustedStat(race.Stat.Guts, baseGuts, false));
|
||||||
|
const power = $derived(race.finalStat(adjPower, powerBonus));
|
||||||
|
const guts = $derived(race.finalStat(adjGuts, gutsBonus));
|
||||||
|
|
||||||
const phases = [race.Phase.EarlyRace, race.Phase.MidRace, race.Phase.LateRace] as const;
|
const phases = [race.Phase.EarlyRace, race.Phase.MidRace, race.Phase.LateRace] as const;
|
||||||
const accel = $derived(phases.map((p) => race.acceleration(powerStat, style, surfApt, p)));
|
const accel = $derived(phases.map((p) => race.acceleration(power, style, surfaceApt, p)));
|
||||||
const decel = phases.map((p) => race.deceleration(p));
|
const decel = phases.map((p) => race.deceleration(p));
|
||||||
|
|
||||||
const ssBoost = $derived(race.spotStruggleSpeed(gutsStat));
|
const ssBoost = $derived(race.spotStruggleSpeed(guts));
|
||||||
const ssDur = $derived(race.spotStruggleDuration(gutsStat, frontApt));
|
const ssDur = $derived(race.spotStruggleDuration(guts, frontApt));
|
||||||
|
|
||||||
const lcBoost = $derived(race.moveLaneModifier(powerStat));
|
const lcBoost = $derived(race.moveLaneModifier(power));
|
||||||
const lcDur = $derived(Math.min(race.skillDuration(3, raceLen), 6));
|
const lcDur = $derived(Math.min(race.skillDuration(3, raceLen), 6));
|
||||||
|
|
||||||
const uniques = [
|
const uniques = [
|
||||||
@@ -66,7 +73,7 @@
|
|||||||
{
|
{
|
||||||
label: 'Ideal Lane Combo',
|
label: 'Ideal Lane Combo',
|
||||||
y: (x) =>
|
y: (x) =>
|
||||||
race.speedGain(race.moveLaneModifier(x), lcDur, race.acceleration(x, style, surfApt, race.Phase.EarlyRace), decel[0]) /
|
race.speedGain(race.moveLaneModifier(x), lcDur, race.acceleration(x, style, surfaceApt, race.Phase.EarlyRace), decel[0]) /
|
||||||
race.HORSE_LENGTH,
|
race.HORSE_LENGTH,
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
@@ -85,102 +92,146 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<h1 class="text-4xl">Front Runner Mechanical Speed Comparator</h1>
|
<h1 class="text-4xl">Front Runner Mechanical Speed Comparator</h1>
|
||||||
<div class="mx-auto mt-8 grid max-w-4xl grid-cols-1 rounded-md text-center shadow-md ring md:grid-cols-8">
|
<form class="mx-auto mt-8 flex max-w-4xl flex-col gap-4 text-center">
|
||||||
<div class="m-4 md:col-span-2">
|
<div class="max-auto grid grid-cols-1 gap-2 rounded-md border p-2 shadow-md md:grid-cols-4">
|
||||||
<label for="powerStat">Power Stat</label>
|
<div>
|
||||||
<input type="number" id="powerStat" bind:value={rawPower} class="w-full" />
|
<label for="powerStat">Power</label>
|
||||||
|
<input type="number" id="powerStat" required bind:value={rawPower} class="w-full" />
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<label for="gutsStat">Guts</label>
|
||||||
|
<input type="number" id="gutsStat" required bind:value={rawGuts} class="w-full" />
|
||||||
|
</div>
|
||||||
|
<div class="self-center">
|
||||||
|
<label for="isRunaway" class="mr-1 align-middle">Runaway</label>
|
||||||
|
<input type="checkbox" id="isRunaway" role="switch" bind:checked={isRunaway} class="min-h-6 min-w-6 align-middle" />
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<label for="mood">Mood</label>
|
||||||
|
<select id="mood" required bind:value={mood} class="w-full">
|
||||||
|
{#each race.MOODS as mood (mood)}
|
||||||
|
<option value={mood}>{race.Mood[mood]}</option>
|
||||||
|
{/each}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<label for="powerBonus">Power Greens</label>
|
||||||
|
<input type="number" id="powerBonus" required bind:value={powerBonus} class="w-full" />
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<label for="gutsBonus">Guts Greens</label>
|
||||||
|
<input type="number" id="gutsBonus" required bind:value={gutsBonus} class="w-full" />
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<label for="surfaceApt">{race.Surface[surface]}</label>
|
||||||
|
<select id="surfaceApt" required bind:value={surfaceApt} class="w-full">
|
||||||
|
{#each race.APTITUDE_LEVELS as apt (apt)}
|
||||||
|
<option value={apt}>{race.AptitudeLevel[apt]}</option>
|
||||||
|
{/each}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<label for="frontApt">Front Runner</label>
|
||||||
|
<select id="frontApt" required bind:value={frontApt} class="w-full">
|
||||||
|
{#each race.APTITUDE_LEVELS as apt (apt)}
|
||||||
|
<option value={apt}>{race.AptitudeLevel[apt]}</option>
|
||||||
|
{/each}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="m-4 md:col-span-2">
|
<div class="mx-auto flex max-w-2xl flex-col gap-4 rounded-md border p-2 text-center shadow-md md:flex-row">
|
||||||
<label for="gutsStat">Guts Stat</label>
|
<div class="my-auto grow">
|
||||||
<input type="number" id="gutsStat" bind:value={rawGuts} class="w-full" />
|
<RaceLenSlider bind:value={raceLen} />
|
||||||
|
</div>
|
||||||
|
<div class="mx-auto my-auto w-32 flex-none">
|
||||||
|
<select id="surface" required bind:value={surface} class="w-full">
|
||||||
|
<option value={race.Surface.Turf}>Turf</option>
|
||||||
|
<option value={race.Surface.Dirt}>Dirt</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div class="mx-auto my-auto w-32 flex-none">
|
||||||
|
<select id="conditions" required bind:value={conditions} class="w-full">
|
||||||
|
<option value={race.GroundConditions.Firm}>Firm</option>
|
||||||
|
<option value={race.GroundConditions.Good}>Good</option>
|
||||||
|
<option value={race.GroundConditions.Soft}>Soft</option>
|
||||||
|
<option value={race.GroundConditions.Heavy}>Heavy</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="m-4 md:col-span-2">
|
</form>
|
||||||
<label for="surfaceApt">Surface Aptitude</label>
|
|
||||||
<select id="surfaceApt" required bind:value={surfApt} class="w-full">
|
<div class="mt-2 flex w-full flex-col gap-2 text-center">
|
||||||
{#each race.APTITUDE_LEVELS as apt (apt)}
|
<div class="w-full">
|
||||||
<option value={apt}>{race.AptitudeLevel[apt]}</option>
|
<span class="block text-lg">Mechanics</span>
|
||||||
|
<div class="mx-auto flex w-full flex-col place-items-center md:flex-row md:justify-center">
|
||||||
|
<SpeedDur speed={ssBoost} dur={ssDur} accel={accel[0]} decel={[decel[0], decel[1]]}>Spot Struggle</SpeedDur>
|
||||||
|
<SpeedDur speed={lcBoost} dur={lcDur} accel={accel[0]} decel={decel[0]}>Idealized Lane Combo (DDPP)</SpeedDur>
|
||||||
|
</div>
|
||||||
|
<div class="mx-auto mt-1 max-w-80 rounded-md border">
|
||||||
|
<table class="table-fixed text-sm">
|
||||||
|
<caption>Base Acceleration</caption>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th class="w-32" scope="col">Early Race</th>
|
||||||
|
<th class="w-32" scope="col">Mid Race</th>
|
||||||
|
<th class="w-32" scope="col">Late Race</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
{#each accel as v, i (i)}
|
||||||
|
<td class="text-center">{v.toFixed(3)} m/s²</td>
|
||||||
|
{/each}
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
{#each decel as v, i (i)}
|
||||||
|
<td class="text-center">{v.toFixed(3)} m/s²</td>
|
||||||
|
{/each}
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="w-full">
|
||||||
|
<span class="block text-lg">Unique Skills</span>
|
||||||
|
<div class="mx-auto flex flex-col place-items-center md:flex-row md:justify-center">
|
||||||
|
{#each uniques as [name, boost, dur, phase] (name)}
|
||||||
|
<SpeedDur speed={boost} dur={race.skillDuration(dur, raceLen)} accel={accel[phase]} decel={decel[phase]}>{name}</SpeedDur>
|
||||||
{/each}
|
{/each}
|
||||||
</select>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="m-4 md:col-span-2">
|
<div class="w-full">
|
||||||
<label for="frontApt">Front Runner Aptitude</label>
|
<span class="block text-lg">Inherited Uniques & Other Skills</span>
|
||||||
<select id="frontApt" required bind:value={frontApt} class="w-full">
|
<div class="mx-auto flex flex-col place-items-center md:flex-row md:justify-center">
|
||||||
{#each race.APTITUDE_LEVELS as apt (apt)}
|
{#each skills as [name, boost, dur, phase] (name)}
|
||||||
<option value={apt}>{race.AptitudeLevel[apt]}</option>
|
<SpeedDur speed={boost} dur={race.skillDuration(dur, raceLen)} accel={accel[phase]} decel={decel[phase]}>{name}</SpeedDur>
|
||||||
{/each}
|
{/each}
|
||||||
</select>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="m-4 md:col-span-2 md:col-start-2">
|
<div class="w-full">
|
||||||
<RaceLenSlider bind:value={raceLen} />
|
<div class="mx-auto grid h-96 grid-cols-1 py-4 md:grid-cols-2">
|
||||||
</div>
|
<StatChart
|
||||||
<div class="m-4 self-center md:col-span-2">
|
class="flex-1"
|
||||||
<label for="isRunaway" class="mr-1 align-middle">Runaway</label>
|
stat={race.Stat.Guts}
|
||||||
<input type="checkbox" id="isRunaway" role="switch" bind:checked={isRunaway} class="min-h-6 min-w-6 align-middle" />
|
y={ssY}
|
||||||
</div>
|
yLabel="Lengths Gained"
|
||||||
<div class="m-4 self-center md:col-span-2">
|
range={[0, 2]}
|
||||||
<label for="isCareer" class="mr-1 align-middle">In Career</label>
|
xRule={guts}
|
||||||
<input type="checkbox" id="isCareer" role="switch" bind:checked={isCareer} class="min-h-6 min-w-6 align-middle" />
|
yRule={ssYRule}
|
||||||
|
/>
|
||||||
|
<StatChart
|
||||||
|
class="flex-1"
|
||||||
|
stat={race.Stat.Power}
|
||||||
|
y={lcY}
|
||||||
|
yLabel="Lengths Gained"
|
||||||
|
range={[0, 1.3]}
|
||||||
|
xRule={power}
|
||||||
|
yRule={lcYRule}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<span class="mt-8 block w-full text-center text-lg">Mechanics</span>
|
|
||||||
<div class="mx-auto flex w-full flex-col place-items-center md:flex-row md:justify-center">
|
|
||||||
<SpeedDur speed={ssBoost} dur={ssDur} accel={accel[0]} decel={[decel[0], decel[1]]}>Spot Struggle</SpeedDur>
|
|
||||||
<SpeedDur speed={lcBoost} dur={lcDur} accel={accel[0]} decel={decel[0]}>Idealized Lane Combo (DDPP)</SpeedDur>
|
|
||||||
</div>
|
|
||||||
<table class="mx-auto mt-1 table-fixed rounded-b-md border border-t-0 text-sm">
|
|
||||||
<caption class="rounded-t-md border border-b-0">Base Acceleration</caption>
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th class="w-32" scope="col">Early Race</th>
|
|
||||||
<th class="w-32" scope="col">Mid Race</th>
|
|
||||||
<th class="w-32" scope="col">Late Race</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
<tr>
|
|
||||||
{#each accel as v, i (i)}
|
|
||||||
<td class="text-center">{v.toFixed(3)} m/s²</td>
|
|
||||||
{/each}
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
{#each decel as v, i (i)}
|
|
||||||
<td class="text-center">{v.toFixed(3)} m/s²</td>
|
|
||||||
{/each}
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
<span class="mt-8 block w-full text-center text-lg">Unique Skills</span>
|
|
||||||
<div class="mx-auto flex flex-col place-items-center md:flex-row md:justify-center">
|
|
||||||
{#each uniques as [name, boost, dur, phase] (name)}
|
|
||||||
<SpeedDur speed={boost} dur={race.skillDuration(dur, raceLen)} accel={accel[phase]} decel={decel[phase]}>{name}</SpeedDur>
|
|
||||||
{/each}
|
|
||||||
</div>
|
|
||||||
<span class="mt-8 block w-full text-center text-lg">Inherited Uniques & Other Skills</span>
|
|
||||||
<div class="mx-auto flex flex-col place-items-center md:flex-row md:justify-center">
|
|
||||||
{#each skills as [name, boost, dur, phase] (name)}
|
|
||||||
<SpeedDur speed={boost} dur={race.skillDuration(dur, raceLen)} accel={accel[phase]} decel={decel[phase]}>{name}</SpeedDur>
|
|
||||||
{/each}
|
|
||||||
</div>
|
|
||||||
<div class="mx-auto grid h-96 grid-cols-1 py-4 md:grid-cols-2">
|
|
||||||
<StatChart
|
|
||||||
class="flex-1"
|
|
||||||
stat={race.Stat.Guts}
|
|
||||||
y={ssY}
|
|
||||||
yLabel="Lengths Gained"
|
|
||||||
range={[0, 2]}
|
|
||||||
xRule={gutsStat}
|
|
||||||
yRule={ssYRule}
|
|
||||||
/>
|
|
||||||
<StatChart
|
|
||||||
class="flex-1"
|
|
||||||
stat={race.Stat.Power}
|
|
||||||
y={lcY}
|
|
||||||
yLabel="Lengths Gained"
|
|
||||||
range={[0, 1.1]}
|
|
||||||
xRule={powerStat}
|
|
||||||
yRule={lcYRule}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div class="mx-auto mt-12 w-full max-w-4xl border-t pt-4 md:mt-8">
|
<div class="mx-auto mt-12 w-full max-w-4xl border-t pt-4 md:mt-8">
|
||||||
<ul class="ml-4 list-disc">
|
<ul class="ml-4 list-disc">
|
||||||
<li>All lengths gained include acceleration at the beginning of each speed boost and deceleration after its end.</li>
|
<li>All lengths gained include acceleration at the beginning of each speed boost and deceleration after its end.</li>
|
||||||
|
|||||||
Reference in New Issue
Block a user