diff --git a/TODO b/TODO index 9a05bb700f..a96ec14bff 100644 --- a/TODO +++ b/TODO @@ -6,9 +6,6 @@ allow undoing a trade shootouts - hockey - need football/baseball scoringSummary style - build up from events? - - flavor? - - separate attempt from result - - fix play-by-play text - scoring summary - isScoringPlay -> formatScoringSummaryEvent - confirm for all sports diff --git a/src/ui/util/processLiveGameEvents.hockey.tsx b/src/ui/util/processLiveGameEvents.hockey.tsx index 53126c2988..caf60c4a95 100644 --- a/src/ui/util/processLiveGameEvents.hockey.tsx +++ b/src/ui/util/processLiveGameEvents.hockey.tsx @@ -163,8 +163,10 @@ const getText = ( ); } else if (event.type === "shootoutStart") { text = `The game will now be decided by a shootout with ${event.rounds} rounds!`; + } else if (event.type === "shootoutTeam") { + text = `${event.names[0]} takes the puck`; } else if (event.type === "shootoutShot") { - text = `Kick ${event.att}: ${event.made ? `Shot by ${event.names[0]} - saved by ${event.names[1]}` : `Shot by ${event.names[0]}`}`; + text = event.made ? "" : `Saved by ${event.names[0]}`; } else if (event.type === "shootoutTie") { text = `The shootout is tied! Teams will alternate penalty shots until there is a winner`; } diff --git a/src/worker/core/GameSim.hockey/PlayByPlayLogger.ts b/src/worker/core/GameSim.hockey/PlayByPlayLogger.ts index e06f15adb6..6d571f0036 100644 --- a/src/worker/core/GameSim.hockey/PlayByPlayLogger.ts +++ b/src/worker/core/GameSim.hockey/PlayByPlayLogger.ts @@ -15,9 +15,8 @@ type PlayByPlayEventInputScore = type: "shootoutShot"; clock: number; t: TeamNum; - names: [string, string]; + names: [string]; made: boolean; - att: number; goalType: "pn"; shotType: string; }; @@ -106,6 +105,12 @@ type PlayByPlayEventInput = rounds: number; clock: number; } + | { + type: "shootoutTeam"; + t: TeamNum; + names: [string]; + clock: number; + } | { type: "shootoutTie"; clock: number; diff --git a/src/worker/core/GameSim.hockey/index.ts b/src/worker/core/GameSim.hockey/index.ts index bb9abd0505..c5b3dbfd91 100644 --- a/src/worker/core/GameSim.hockey/index.ts +++ b/src/worker/core/GameSim.hockey/index.ts @@ -475,15 +475,23 @@ class GameSim extends GameSimBase { } doShootoutShot(t: TeamNum, p: PlayerGameSim, goalie: PlayerGameSim) { - // 20% to 80% - const skaterProb = 0.2 + 0.6 * p.compositeRating.scoring; - const goalieProb = 0.8 - 0.6 * goalie.compositeRating.goalkeeping; + // 50% to 100% + const skaterProb = 0.5 + 0.5 * p.compositeRating.scoring; + const goalieProb = 1 - 0.5 * goalie.compositeRating.goalkeeping; const probMake = skaterProb * goalieProb; const made = Math.random() < probMake; this.recordStat(t, undefined, "sAtt"); + + this.playByPlay.logEvent({ + type: "shootoutTeam", + clock: this.clock, + t, + names: [p.name], + }); + if (made) { this.recordStat(t, undefined, "sPts"); } @@ -492,8 +500,7 @@ class GameSim extends GameSimBase { type: "shootoutShot", clock: this.clock, t, - names: [p.name, goalie.name], - att: this.team[t].stat.sAtt, + names: [goalie.name], made, goalType: "pn", shotType: "penalty",