X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=variants%2FApocalypse%2Fclass.js;h=3b735b1ea203ae4176ac244e397ede71a06c3af3;hb=03883a0d1495bc6e6fadc3a11aa99286aba5c9e1;hp=1f7cc7aa0533e1a172f84927a7b424914edf879b;hpb=b9877ed29697640d72b8f3d89848863fc87bd7e8;p=xogo.git diff --git a/variants/Apocalypse/class.js b/variants/Apocalypse/class.js index 1f7cc7a..3b735b1 100644 --- a/variants/Apocalypse/class.js +++ b/variants/Apocalypse/class.js @@ -68,7 +68,7 @@ export default class ApocalypseRules extends ChessRules { return { 'p': { "class": "pawn", - moves: [ + both: [ { steps: [[pawnShift, 0], [pawnShift, -1], [pawnShift, 1]], range: 1 @@ -102,7 +102,7 @@ export default class ApocalypseRules extends ChessRules { } } else { - const oppCol = C.GetOppCol(this.getColor(x, y)); + const oppCol = C.GetOppTurn(this.getColor(x, y)); moves = super.getPotentialMovesFrom([x, y]).filter(m => { // Remove pawn push toward own color (absurd) return ( @@ -222,7 +222,7 @@ export default class ApocalypseRules extends ChessRules { if (!res.wm || !res.bm) return; for (let c of ['w', 'b']) { - const myMove = res[c + 'm'], oppMove = res[C.GetOppCol(c) + 'm']; + const myMove = res[c + 'm'], oppMove = res[C.GetOppTurn(c) + 'm']; if ( // More general test than checking moves ends, // because of potential pawn relocation @@ -306,7 +306,7 @@ export default class ApocalypseRules extends ChessRules { }; this.playVisual(revFirstMove); } - this.turn = C.GetOppCol(color); + this.turn = C.GetOppTurn(color); this.movesCount++; this.subTurn = 1; this.firstMove = null;