File tree Expand file tree Collapse file tree 4 files changed +22
-11
lines changed
worker/core/GameSim.hockey Expand file tree Collapse file tree 4 files changed +22
-11
lines changed Original file line number Diff line number Diff line change @@ -6,9 +6,6 @@ allow undoing a trade
6
6
shootouts
7
7
- hockey
8
8
- need football/baseball scoringSummary style - build up from events?
9
- - flavor?
10
- - separate attempt from result
11
- - fix play-by-play text
12
9
- scoring summary
13
10
- isScoringPlay -> formatScoringSummaryEvent
14
11
- confirm for all sports
Original file line number Diff line number Diff line change @@ -163,8 +163,10 @@ const getText = (
163
163
) ;
164
164
} else if ( event . type === "shootoutStart" ) {
165
165
text = `The game will now be decided by a shootout with ${ event . rounds } rounds!` ;
166
+ } else if ( event . type === "shootoutTeam" ) {
167
+ text = `${ event . names [ 0 ] } takes the puck` ;
166
168
} else if ( event . type === "shootoutShot" ) {
167
- text = `Kick ${ event . att } : ${ event . made ? `Shot by ${ event . names [ 0 ] } - saved by ${ event . names [ 1 ] } ` : `Shot by ${ event . names [ 0 ] } ` } `;
169
+ text = event . made ? "" : `Saved by ${ event . names [ 0 ] } ` ;
168
170
} else if ( event . type === "shootoutTie" ) {
169
171
text = `The shootout is tied! Teams will alternate penalty shots until there is a winner` ;
170
172
}
Original file line number Diff line number Diff line change @@ -15,9 +15,8 @@ type PlayByPlayEventInputScore =
15
15
type : "shootoutShot" ;
16
16
clock : number ;
17
17
t : TeamNum ;
18
- names : [ string , string ] ;
18
+ names : [ string ] ;
19
19
made : boolean ;
20
- att : number ;
21
20
goalType : "pn" ;
22
21
shotType : string ;
23
22
} ;
@@ -106,6 +105,12 @@ type PlayByPlayEventInput =
106
105
rounds : number ;
107
106
clock : number ;
108
107
}
108
+ | {
109
+ type : "shootoutTeam" ;
110
+ t : TeamNum ;
111
+ names : [ string ] ;
112
+ clock : number ;
113
+ }
109
114
| {
110
115
type : "shootoutTie" ;
111
116
clock : number ;
Original file line number Diff line number Diff line change @@ -475,15 +475,23 @@ class GameSim extends GameSimBase {
475
475
}
476
476
477
477
doShootoutShot ( t : TeamNum , p : PlayerGameSim , goalie : PlayerGameSim ) {
478
- // 20 % to 80 %
479
- const skaterProb = 0.2 + 0.6 * p . compositeRating . scoring ;
480
- const goalieProb = 0.8 - 0.6 * goalie . compositeRating . goalkeeping ;
478
+ // 50 % to 100 %
479
+ const skaterProb = 0.5 + 0.5 * p . compositeRating . scoring ;
480
+ const goalieProb = 1 - 0.5 * goalie . compositeRating . goalkeeping ;
481
481
482
482
const probMake = skaterProb * goalieProb ;
483
483
484
484
const made = Math . random ( ) < probMake ;
485
485
486
486
this . recordStat ( t , undefined , "sAtt" ) ;
487
+
488
+ this . playByPlay . logEvent ( {
489
+ type : "shootoutTeam" ,
490
+ clock : this . clock ,
491
+ t,
492
+ names : [ p . name ] ,
493
+ } ) ;
494
+
487
495
if ( made ) {
488
496
this . recordStat ( t , undefined , "sPts" ) ;
489
497
}
@@ -492,8 +500,7 @@ class GameSim extends GameSimBase {
492
500
type : "shootoutShot" ,
493
501
clock : this . clock ,
494
502
t,
495
- names : [ p . name , goalie . name ] ,
496
- att : this . team [ t ] . stat . sAtt ,
503
+ names : [ goalie . name ] ,
497
504
made,
498
505
goalType : "pn" ,
499
506
shotType : "penalty" ,
You can’t perform that action at this time.
0 commit comments