+ // Moving something. Potential effects resolved after playing
+ getPotentialMovesFrom([x, y], bonus) {
+ let moves = [];
+ if (bonus == "toadette")
+ return this.getDropMovesFrom([x, y]);
+ else if (bonus == "kingboo") {
+ // Only allow to swap pieces
+ // TODO (end of move, as for toadette)
+ return moves;
+ }
+ // Normal case (including bonus daisy)
+ switch (this.getPiece(x, y)) {
+ case 'p':
+ moves = this.getPawnMovesFrom([x, y]); //apply promotions
+ break;
+ case 'q':
+ moves = this.getQueenMovesFrom([x, y]);
+ break;
+ case 'k',
+ moves = this.getKingMoves([x, y]);
+ break;
+ default:
+ moves = super.getPotentialMovesFrom([x, y]);
+ }
+ return moves;
+ }