- if (this.subTurn == 1) {
- moves = super.getPotentialMovesFrom([x, y]);
+ 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;
+ }
+
+
+
+ tryMoveFollowup(move) {
+ if (this.getColor(move.end.x, move.end.y) == 'a') {
+ // effect, or bonus/malus
+ const endType = this.getPiece(m.end.x, m.end.y);
+ if (endType == V.EGG)
+ this.applyRandomBonus(m);
+ else {
+ this.moveStack.push(m);
+ switch (endType) {
+ case V.BANANA:
+ this.randomRedirect(
+ case V.BOMB:
+ case V.MUSHROOM:
+ // aller dans direction, saut par dessus pièce adverse
+ // ou amie (tjours), new step si roi caval pion
+ }
+ }
+ }
+
+