+ getBasicMove([x1, y1], [x2, y2]) {
+ // Apply mushroom, bomb or banana effect (hidden to the player).
+ // Determine egg effect, too, and apply its first part if possible.
+ // add egg + add mushroom for pawns.
+ let move = super.getBasicMove([x1, y1], [x2, y2]);
+ // TODO
+ return move;
+ // Infer move type based on its effects (used to decide subTurn 1 --> 2)
+ // --> impossible étant donné juste first part (egg --> effect?)
+ // => stocker l'effet (i, ii ou iii) dans le coup directement,
+ // Pas terrible, mais y'aura pas 36 variantes comme ça. Disons end.effect == null, 0, 1, 2 ou 3
+ // 0 => tour ou fou, pose potentielle.
+ // If queen can be invisible, add move same start + end but final type changes
+ }
+
+ getPotentialKingMoves([x, y]) {
+ let moves = super.getPotentialKingMoves([x, y]);
+ // TODO: if flags allows it, add 'remote shell captures'
+ return moves;
+ }
+
+ getSlideNJumpMoves([x, y], steps, oneStep) {
+ let moves = [];
+ outerLoop: for (let step of steps) {
+ let i = x + step[0];
+ let j = y + step[1];
+ while (
+ V.OnBoard(i, j) &&
+ (
+ this.board[i][j] == V.EMPTY ||
+ (
+ this.getColor(i, j) == 'a' &&
+ [V.EGG, V.MUSHROOM].includes(this.getPiece(i, j))
+ )
+ )
+ ) {
+ moves.push(this.getBasicMove([x, y], [i, j]));
+ if (oneStep) continue outerLoop;
+ i += step[0];
+ j += step[1];
+ }
+ if (V.OnBoard(i, j) && this.canTake([x, y], [i, j]))
+ moves.push(this.getBasicMove([x, y], [i, j]));
+ }
+ return moves;
+ }
+
+ getAllPotentialMoves() {
+ if (this.subTurn == 1) return super.getAllPotentialMoves();
+ // TODO: subTurn == 2, switch on firstMove.end.effect --> lack firstMove, setOtherVariables, play/undo, see Dynamo