Compare commits

...
2 Commits
Author SHA1 Message Date
zephyr 8de957b59b zenno: allow both stats in threshold modifier to be null
ci/woodpecker/push/zenno Pipeline was successful
ci/woodpecker/push/horsebot Pipeline was successful
2026-08-26 18:57:31 -04:00
zephyr 206fee797c zenno/race/carryover: stat threshold modifier 2026-08-26 18:54:25 -04:00
2 changed files with 12 additions and 2 deletions
+7 -1
View File
@@ -275,7 +275,13 @@ export function adjustedStat(
}
}
export function thresholdMod(stat1: number, stat2?: number): number {
export function thresholdMod(stat1: number | null | undefined, stat2?: number | null): number {
if (stat1 == null) {
if (stat2 == null) {
return 1;
}
return thresholdMod(stat2);
}
if (stat2 != null) {
return 0.5 * (thresholdMod(stat1) + thresholdMod(stat2));
}
+5 -1
View File
@@ -255,6 +255,10 @@
<option value={per}>{per > 0 ? `Uphill +${per}` : per < 0 ? `Downhill ${per}` : 'Flat'}</option>
{/each}
</select>
<div class="col-span-full mx-2 mb-4 flex gap-4">
<label for="threshMod" class="my-auto flex-1">Track Threshold Mod</label>
<input type="number" id="threshMod" bind:value={threshMod} min="1.0" max="1.2" step="0.025" class="my-auto flex-1" />
</div>
</div>
<div class="mb-auto flex w-full max-w-4xl flex-col rounded-md text-center shadow-md ring md:col-span-6">
@@ -366,7 +370,7 @@
</table>
{/snippet}
<div class="mx-auto mt-8 grid max-w-4xl grid-cols-1 gap-8 md:grid-cols-2">
{@render seggsTable(slope < 0 && allowDAM ? 'Fastest Speed (Downhill)' : 'Fastest Speed', seggs[1])}
{@render seggsTable('Fastest Speed', seggs[1])}
{@render seggsTable('Slowest Speed', seggs[0])}
</div>