zenno/race/stam: remove the hard parts for now
This commit is contained in:
@@ -30,9 +30,9 @@
|
||||
let thresh1: race.Stat | undefined = $state();
|
||||
let thresh2: race.Stat | undefined = $state();
|
||||
|
||||
const rushedOpts = ['No Rushed', 'Rushed Enabled', 'Rushed Forced'] as const;
|
||||
let rushedType: (typeof rushedOpts)[number] = $state('No Rushed');
|
||||
let spotStruggleEnabled = $state(false);
|
||||
// const rushedOpts = ['No Rushed', 'Rushed Enabled', 'Rushed Forced'] as const;
|
||||
// let rushedType: (typeof rushedOpts)[number] = $state('No Rushed');
|
||||
// let spotStruggleEnabled = $state(false);
|
||||
|
||||
const baseStats = $derived({
|
||||
[race.Stat.Speed]: race.baseStat(mood, rawStats[race.Stat.Speed]),
|
||||
@@ -94,8 +94,8 @@
|
||||
] as [number, number],
|
||||
});
|
||||
|
||||
const isFront = $derived(style === race.RunningStyle.FrontRunner || style === race.RunningStyle.Runaway);
|
||||
const spotStruggle = $derived(spotStruggleEnabled && isFront);
|
||||
// const isFront = $derived(style === race.RunningStyle.FrontRunner || style === race.RunningStyle.Runaway);
|
||||
// const spotStruggle = $derived(spotStruggleEnabled && isFront);
|
||||
|
||||
const maxHP = $derived(race.maxHP(raceLen, style, stats[race.Stat.Stamina]));
|
||||
|
||||
@@ -129,6 +129,7 @@
|
||||
),
|
||||
);
|
||||
const needHP = $derived(race.fullSpurtHP(raceLen, phaseSpeed[race.Phase.LateRace][0], spurtHPRate));
|
||||
const needHPPer = $derived((100 * needHP) / maxHP);
|
||||
const spurtStartHP = $derived(sections.findLast((s) => s.phase !== race.Phase.LateRace)?.remain);
|
||||
|
||||
let slopeAddParams: course.Slope = $state({ per: 1, span: [0, 0] });
|
||||
@@ -144,11 +145,11 @@
|
||||
slopesRaw.splice(i, 1);
|
||||
}
|
||||
|
||||
const phaseNames = {
|
||||
[race.Phase.EarlyRace]: 'Early',
|
||||
[race.Phase.MidRace]: 'Mid',
|
||||
[race.Phase.LateRace]: 'Late',
|
||||
} as const;
|
||||
// const phaseNames = {
|
||||
// [race.Phase.EarlyRace]: 'Early',
|
||||
// [race.Phase.MidRace]: 'Mid',
|
||||
// [race.Phase.LateRace]: 'Late',
|
||||
// } as const;
|
||||
</script>
|
||||
|
||||
<h1 class="text-4xl">Stamina Calculator</h1>
|
||||
@@ -260,6 +261,7 @@
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<!--
|
||||
<div class="mx-auto mt-8 grid max-w-lg grid-cols-2 gap-4 rounded-md p-4 text-center shadow-md ring">
|
||||
<select id="rushed" class="w-full" bind:value={rushedType}>
|
||||
{#each rushedOpts as opt (opt)}
|
||||
@@ -271,7 +273,8 @@
|
||||
<input type="checkbox" class="min-h-6 min-w-6 align-middle" id="rushed" role="switch" bind:checked={spotStruggleEnabled} />
|
||||
</div>
|
||||
</div>
|
||||
<div class="mx-auto mt-8 max-w-4xl rounded-md p-4 text-center shadow-md ring">
|
||||
-->
|
||||
<div class="mx-auto mt-8 hidden max-w-4xl rounded-md p-4 text-center shadow-md ring">
|
||||
<!-- TODO(zeph): this doesn't work for mobile -->
|
||||
<table class="w-full table-fixed border-spacing-4">
|
||||
<caption>Slopes</caption>
|
||||
@@ -302,7 +305,7 @@
|
||||
{/each}
|
||||
<tr>
|
||||
<td>
|
||||
<select id={`slopeAddPer`} bind:value={slopeAddParams.per}>
|
||||
<select id="slopeAddPer" bind:value={slopeAddParams.per}>
|
||||
<option value={2}>Uphill +2</option>
|
||||
<option value={1.5}>Uphill +1.5</option>
|
||||
<option value={1}>Uphill +1</option>
|
||||
@@ -334,7 +337,7 @@
|
||||
</div>
|
||||
<div class="m-2 flex-1 rounded-md border text-center shadow-sm transition-shadow hover:shadow-md">
|
||||
<span class="block text-lg">Spurt Threshold</span>
|
||||
<span class="block text-2xl">{Math.ceil(needHP)}</span>
|
||||
<span class="block text-2xl">{Math.ceil(needHP)} ({needHPPer.toFixed(1)}%)</span>
|
||||
</div>
|
||||
<div class="m-2 flex-1 rounded-md border text-center shadow-sm transition-shadow hover:shadow-md">
|
||||
<span class="block text-lg">Late Race Start</span>
|
||||
@@ -343,6 +346,7 @@
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
<!--
|
||||
<table class="mt-8 w-full border text-center">
|
||||
<thead>
|
||||
<tr>
|
||||
@@ -388,3 +392,4 @@
|
||||
{/each}
|
||||
</tbody>
|
||||
</table>
|
||||
-->
|
||||
|
||||
Reference in New Issue
Block a user