projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix Emergo: no simple moves in entering stage
[vchess.git]
/
client
/
src
/
variants
/
Checkered2.js
diff --git
a/client/src/variants/Checkered2.js
b/client/src/variants/Checkered2.js
index
db28876
..
997c1c7
100644
(file)
--- a/
client/src/variants/Checkered2.js
+++ b/
client/src/variants/Checkered2.js
@@
-1,6
+1,7
@@
import { ChessRules, Move, PiPo } from "@/base_rules";
export class Checkered2Rules extends ChessRules {
import { ChessRules, Move, PiPo } from "@/base_rules";
export class Checkered2Rules extends ChessRules {
+
static board2fen(b) {
const checkered_codes = {
p: "s",
static board2fen(b) {
const checkered_codes = {
p: "s",
@@
-350,8
+351,13
@@
export class Checkered2Rules extends ChessRules {
postPlay(move) {
super.postPlay(move);
// Does this move turn off a 2-squares pawn flag?
postPlay(move) {
super.postPlay(move);
// Does this move turn off a 2-squares pawn flag?
- if ([1, 6].includes(move.start.x) && move.vanish[0].p == V.PAWN)
+ if (
+ [1, 6].includes(move.start.x) &&
+ move.vanish[0].p == V.PAWN &&
+ Math.abs(move.end.x - move.start.x) == 2
+ ) {
this.pawnFlags[move.start.x == 6 ? "w" : "b"][move.start.y] = false;
this.pawnFlags[move.start.x == 6 ? "w" : "b"][move.start.y] = false;
+ }
this.cmoves.push(this.getCmove(move));
}
this.cmoves.push(this.getCmove(move));
}
@@
-462,4
+468,5
@@
export class Checkered2Rules extends ChessRules {
notation += "=" + move.appear[0].p.toUpperCase();
return notation;
}
notation += "=" + move.appear[0].p.toUpperCase();
return notation;
}
+
};
};