+ if (
+ !move.end.effect &&
+ move.appear.length > 0 &&
+ move.appear[0].p == V.INVISIBLE_QUEEN
+ ) {
+ return "Q??";
+ }
+ const finalSquare = V.CoordsToSquare(move.end);
+ let piece = undefined;
+ if (move.appear.length == 0) {
+ piece = this.getPiece(move.start.x, move.start.y);
+ if (piece == V.KING) return "Kx" + finalSquare;
+ // Koopa or Chomp:
+ return (
+ piece.toUpperCase() + "x" + finalSquare +
+ "*" + (move.end.effect == "koopa" ? "K" : "C")
+ );
+ }
+ else if (
+ move.appear.length == 1 &&
+ move.vanish.length == 1 &&
+ move.appear[0].c == 'a' &&
+ move.vanish[0].c == 'a'
+ ) {
+ // Bonus replacement:
+ piece = move.appear[0].p.toUpperCase();
+ return piece + "@" + finalSquare;
+ }
+ piece = move.vanish[0].p;
+ let notation = undefined;
+ if (piece == V.PAWN) {
+ // Pawn move
+ if (move.vanish.length >= 2) {
+ // Capture
+ const startColumn = V.CoordToColumn(move.start.y);
+ notation = startColumn + "x" + finalSquare;
+ }
+ else notation = finalSquare;
+ if (move.appear[0].p != V.PAWN)
+ // Promotion
+ notation += "=" + move.appear[0].p.toUpperCase();
+ }
+ else {
+ notation =
+ piece.toUpperCase() +
+ (move.vanish.length >= 2 ? "x" : "") +
+ finalSquare;
+ }
+ if (!!move.end.effect) {
+ switch (move.end.effect) {
+ case "kingboo":
+ notation += "*B";
+ break;
+ case "toadette":
+ notation += "*T";
+ break;
+ case "daisy":
+ notation += "*D";
+ break;
+ case "bowser":
+ notation += "*M";
+ break;
+ case "luigi":
+ notation += "*L";
+ break;
+ case "waluigi":
+ notation += "*W";
+ break;
+ }
+ }
+ return notation;