Skip to content

Commit

Permalink
#191 - POA + CS
Browse files Browse the repository at this point in the history
  • Loading branch information
AloisSeckar committed Jan 16, 2024
1 parent c797ef4 commit 91bdb52
Show file tree
Hide file tree
Showing 10 changed files with 35 additions and 1 deletion.
8 changes: 8 additions & 0 deletions assets/json/library.json
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,14 @@
"file": "pocs-r1-1364",
"name": "Pick off + Caught stealing - P to 1B to SS to 2B (R1)"
},
{
"file": "pocse-r1",
"name": "Pick off + Caught stealing + throwing error by P (R1)"
},
{
"file": "pocsen-r3",
"name": "Pick off + Caught stealing + throwing error by P, no advance (R1)"
},
{
"file": "error-poa-r1",
"name": "Pick off attempt - e1T (R1)"
Expand Down
2 changes: 2 additions & 0 deletions assets/lang/cs.json
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,8 @@
"CSNT" : "Caught stealing + throwing error (no advance)",
"POE" : "Pick off attempt + (throwing) error",
"POEN" : "Pick off attempt + (throwing) error (no advance)",
"POCSE" : "Pick off attempt + CS + (throwing) error",
"POCSEN" : "Pick off attempt + CS + (throwing) error (no advance)",
"CSO" : "Caught stealing",
"PO" : "Picked off",
"POCS" : "Picked off + caught stealing"
Expand Down
2 changes: 2 additions & 0 deletions assets/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,8 @@
"CSNT" : "Caught stealing with throwing error (no advance)",
"POE" : "Pick off attempt with (throwing) error",
"POEN" : "Pick off attempt with (throwing) error (no advance)",
"POCSE" : "Pick off attempt + CS with (throwing) error",
"POCSEN" : "Pick off attempt + CS with (throwing) error (no advance)",
"CSO" : "Caught stealing",
"PO" : "Picked off",
"POCS" : "Picked off + caught stealing"
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/pocse-r1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[{"group":"input-r1","baseAction":"ste","specAction":"POCSE","origBase":1,"base":2,"tie":false,"runtype":"e","pos":"1"}]
1 change: 1 addition & 0 deletions public/json/pocsen-r3.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[{"group":"input-r3","baseAction":"ste","specAction":"POCSEN","origBase":3,"base":4,"tie":false,"runtype":"e","pos":"1"}]
11 changes: 10 additions & 1 deletion utils/wbsc-eval.ts
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,10 @@ function changeRunnerSpecificAction (group: string) {
minPosItems = 1
targetPosItems = 2
break
case 'POCSE':
case 'POCSN':
minPosItems = targetPosItems = 1
break
case 'OBR_rol':
case 'OBR_rin':
case 'A':
Expand Down Expand Up @@ -620,17 +624,22 @@ function processInput (input: WBSCInput, batter: number): WBSCOutput {
possibleConcurrentPlay = true
break
case 'POEN':
case 'POCSEN':
output.na = true
// falls through
case 'POE':
case 'POCSE':
output.text1 = 'POA'
if (action.includes('CS')) {
output.text1 += 'CS'
}
if (pos.length > 1) {
output.text2 = pos?.substring(0, pos.length - 1) + 'E' + pos?.substring(pos.length - 1)
} else {
output.text2 = (action === 'POE' ? 'e' : 'E') + pos + 'T'
}
output.num = true
output.base = action === 'POE' ? output.origBase + 1 : input.origBase
output.base = !action.includes('N') ? output.origBase + 1 : input.origBase
output.errorTarget = output.base
possibleConcurrentPlay = true
break
Expand Down
2 changes: 2 additions & 0 deletions utils/wbsc-html.ts
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,8 @@ function renderRunnerSpecificActionOptions (action: string, group: string) {
options.push(`<option value="CSNT">${useT('editor.action.sb.CSNT')}</option>`)
options.push(`<option value="POE">${useT('editor.action.sb.POE')}</option>`)
options.push(`<option value="POEN">${useT('editor.action.sb.POEN')}</option>`)
options.push(`<option value="POCSE">${useT('editor.action.sb.POCSE')}</option>`)
options.push(`<option value="POCSEN">${useT('editor.action.sb.POCSEN')}</option>`)
options.push('</optgroup>')
options.push(`<optgroup label="${rOut}">`)
options.push(`<option value="CSO">${useT('editor.action.sb.CSO')}</option>`)
Expand Down
9 changes: 9 additions & 0 deletions utils/wbsc-output.ts
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,9 @@ function writeSituation (output: WBSCOutput) {
} else if (text2) {
row1font = FONT_BASE_MEDIUM
row1offset = 8
if (text1.length > 4) {
row1font = FONT_BASE_TINY
}
row2font = FONT_BASE_MEDIUM
row2offset = 30
if (text2.length > 4) {
Expand Down Expand Up @@ -595,6 +598,9 @@ function writeSituation (output: WBSCOutput) {
} else if (text2) {
row1font = FONT_BASE_MEDIUM
row1offset = 8
if (text1.length > 4) {
row1font = FONT_BASE_TINY
}
row2font = FONT_BASE_MEDIUM
row2offset = 30
if (text2.length > 4) {
Expand Down Expand Up @@ -649,6 +655,9 @@ function writeSituation (output: WBSCOutput) {
ctx.font = FONT_BASE_SMALL
} else {
ctx.font = FONT_BASE_MEDIUM
if (text1.length > 4) {
ctx.font = FONT_BASE_TINY
}
}
ctx.fillText(text1, w2 * 0.5 + hOffset, h2 * 1.5 + vOffset)
offset = 32
Expand Down

0 comments on commit 91bdb52

Please # to comment.