feat: overhaul hype score algorithm with 9 hockey-driven improvements
- Empty net detection: pulled goalie triggers +150-250 bonus, stacks with PP - Playoff series importance: Game 7 Cup Final = 200, elimination games scale by round; fallback of 100 when series data unavailable - Period-aware score differential: 2-goal deficit penalty DECREASES in final 2 min of P3 (goalie-pull zone), 3+ goal games get harsher penalties late - Persistent comeback narrative: tracks max deficit, sustained bonus for 2+ goal recoveries instead of one-shot spike (0-3 to 3-3 = 150 persistent) - Shootout special handling: flat base 550 with no time component; ranks below dramatic close P3 games (skills competition, not hockey) - Multi-man advantage: parses situationCode for 5v3/4v3, applies 1.6x PP mult - Non-linear time priority: elapsed^1.5 curve weights final minutes more - Matchup multiplier rebalance: P1/P2 from 2.0/1.65 to 1.5, tiebreaker not dominant factor - Frontend gauge max raised from 700 to 1000 with adjusted color thresholds Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -157,10 +157,10 @@ function ppIndicator(game) {
|
||||
|
||||
function updateGauges() {
|
||||
document.querySelectorAll('.gauge').forEach(el => {
|
||||
const score = Math.min(700, Math.max(0, parseInt(el.dataset.score, 10)));
|
||||
el.style.width = `${(score / 700) * 100}%`;
|
||||
el.style.backgroundColor = score <= 300 ? '#4a90e2'
|
||||
: score <= 550 ? '#f97316'
|
||||
const score = Math.min(1000, Math.max(0, parseInt(el.dataset.score, 10)));
|
||||
el.style.width = `${(score / 1000) * 100}%`;
|
||||
el.style.backgroundColor = score <= 350 ? '#4a90e2'
|
||||
: score <= 650 ? '#f97316'
|
||||
: '#ef4444';
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user