refactor: replace all hardcoded numbers in scoring.ts with named constants

All magic numbers in scoring.ts now reference constants from
lib/constants.ts: damage multipliers, score thresholds, quality
parameters, narration margins, and rounding factors.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Dorian
2026-03-09 07:26:50 +00:00
co-authored by Claude Opus 4.6
parent 1d6826c6e2
commit 276cbd6e31
2 changed files with 58 additions and 52 deletions
+5
View File
@@ -74,3 +74,8 @@ export const RETRO_SPEED_BONUS_CAP = 0.2 // Retro mode speed bonus c
export const LARGE_WIN_MARGIN = 5 // Margin for "big win" narration
export const CLOSE_MATCH_MARGIN = 3 // Margin for "close match" narration
export const WHIFF_NARRATION_THRESHOLD = 2 // Whiff count for narration trigger
// --- Scoring: score ranges ---
export const TIMEOUT_WINNER_SCORE = 10 // Score awarded to winner when opponent times out
export const CREATIVE_TOTAL_SCORE = 10 // Total score pool for creative challenges
export const SCORE_ROUNDING_FACTOR = 10 // Multiply/divide for rounding to 1 decimal