X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FFootball.js;h=ffe6736b1daf268e29d0972a7699015392c20906;hb=HEAD;hp=5b0b16df1b91c31667f313d8829980581521f558;hpb=f897a4ef9f30a51755e9180cf6ba9f9c2557616f;p=vchess.git diff --git a/client/src/variants/Football.js b/client/src/variants/Football.js index 5b0b16df..ffe6736b 100644 --- a/client/src/variants/Football.js +++ b/client/src/variants/Football.js @@ -290,7 +290,10 @@ export class FootballRules extends ChessRules { outerLoop: for (let i=0; i < V.size.x; i++) { for (let j=0; j < V.size.y; j++) { if (this.board[i][j] != V.EMPTY && this.getColor(i, j) == c) { - moves.push(super.getBasicMove([x, y], [i, j])); + moves.push({ + appear: [], vanish: [], + start: { x: x, y: y }, end: { x: i, y: j } + }); if (computer) break outerLoop; //no choice for computer } } @@ -360,7 +363,7 @@ export class FootballRules extends ChessRules { play(move) { // Special message saying "passes are over" - const passesOver = (move.vanish.length == 2); + const passesOver = (move.vanish.length == 0); if (!passesOver) { this.prePlay(move); V.PlayOnBoard(this.board, move); @@ -382,7 +385,7 @@ export class FootballRules extends ChessRules { } undo(move) { - const passesOver = (move.vanish.length == 2); + const passesOver = (move.vanish.length == 0); if (move.turn[0] != this.turn) { [this.turn, this.subTurn] = move.turn; this.movesCount--; @@ -436,7 +439,7 @@ export class FootballRules extends ChessRules { // NOTE: evalPosition() is wrong, but unused since bot plays at random getNotation(move) { - if (move.vanish.length == 2) return "pass"; + if (move.vanish.length == 0) return "pass"; if (move.vanish[0].p != 'a') return super.getNotation(move); // Kick: simple notation (TODO?) return V.CoordsToSquare(move.end);