Skip to content

Commit

Permalink
#182 - adjust KSO play
Browse files Browse the repository at this point in the history
  • Loading branch information
AloisSeckar committed Feb 17, 2024
1 parent dc6f3ea commit f47e8d3
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 0 deletions.
8 changes: 8 additions & 0 deletions assets/json/library.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,14 @@
"file": "kso",
"name": "Strike out (S) + R3 out C to P at HP"
},
{
"file": "kso-r1-24-r3-hp",
"name": "Strike out (S) + R1 out C to 2B, R3 scores"
},
{
"file": "kso-r1-o-r3-21",
"name": "Strike out (L) + R1 to 2nd (O/2), R3 out C to P at HP"
},
{
"file": "ksfc",
"name": "Strike out (S) + R2 to 3B on PB"
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions public/json/kso-r1-24-r3-hp.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[{"group":"input-r3","baseAction":"fdc","specAction":"O/","origBase":3,"base":4,"tie":false,"runtype":"e","pos":"2"},{"group":"input-r1","baseAction":"out","specAction":"GOT","origBase":1,"base":2,"tie":false,"runtype":"e","pos":"24"},{"group":"input-b","baseAction":"StrikeOut","specAction":"KSO","origBase":0,"base":1,"tie":false,"runtype":"e","pos":"2"}]
1 change: 1 addition & 0 deletions public/json/kso-r1-o-r3-21.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[{"group":"input-r3","baseAction":"out","specAction":"GOT","origBase":3,"base":4,"tie":false,"runtype":"e","pos":"21"},{"group":"input-r2","baseAction":"fdc","specAction":"O/","origBase":2,"base":3,"tie":false,"runtype":"e","pos":"2"},{"group":"input-b","baseAction":"StrikeOut","specAction":"KLO","origBase":0,"base":1,"tie":false,"runtype":"e","pos":"2"}]
14 changes: 14 additions & 0 deletions utils/wbsc-processor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,20 @@ function connectSpecialCases (inputArr: WBSCInput[]) {
})
}
}

// #182 - connect "indifference" with runner out, not KSO (example 74)
const isKSO = batterAction === 'KSO' || batterAction === 'KLO'
if (isKSO) {
const playWithIndifference = inputArr.find(i => i.specAction === 'O/')
const playWithOut = inputArr.find(i => ['GO', 'GOT'].includes(i.specAction))
const playToFix = useEvalStore().concurrentPlays.find(p => p.base === 1)
if (playWithIndifference && playWithOut && playToFix) {
playToFix.base = playWithOut.base
playToFix.batter = playWithOut.output!.batter
playToFix.out = true
playToFix.text1 = playWithOut.specAction
}
}
}

export {
Expand Down

0 comments on commit f47e8d3

Please # to comment.