projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix Cannibal variant. TODO: better kings images
[vchess.git]
/
client
/
src
/
variants
/
Allmate1.js
diff --git
a/client/src/variants/Allmate1.js
b/client/src/variants/Allmate1.js
index
bc10478
..
65e20b7
100644
(file)
--- a/
client/src/variants/Allmate1.js
+++ b/
client/src/variants/Allmate1.js
@@
-1,6
+1,6
@@
import { ChessRules, PiPo, Move } from "@/base_rules";
import { ChessRules, PiPo, Move } from "@/base_rules";
-export c
onst VariantRules = c
lass Allmate1Rules extends ChessRules {
+export class Allmate1Rules extends ChessRules {
static get HasEnpassant() {
return false;
}
static get HasEnpassant() {
return false;
}
@@
-32,7
+32,7
@@
export const VariantRules = class Allmate1Rules extends ChessRules {
let attacked = {};
for (let i=0; i<V.size.x; i++) {
for (let j=0; j<V.size.y; j++) {
let attacked = {};
for (let i=0; i<V.size.x; i++) {
for (let j=0; j<V.size.y; j++) {
- if (this.getColor(i,j) == oppCol && this.isAttacked([i,j],
[color]
))
+ if (this.getColor(i,j) == oppCol && this.isAttacked([i,j],
color
))
attacked[i+"_"+j] = [i,j];
}
}
attacked[i+"_"+j] = [i,j];
}
}
@@
-70,7
+70,7
@@
export const VariantRules = class Allmate1Rules extends ChessRules {
if (om.start.x == sq[0] && om.start.y == sq[1])
// Piece moved:
sq = [om.appear[0].x, om.appear[0].y];
if (om.start.x == sq[0] && om.start.y == sq[1])
// Piece moved:
sq = [om.appear[0].x, om.appear[0].y];
- if (!this.isAttacked(sq,
[color]
))
+ if (!this.isAttacked(sq,
color
))
delete attacked[origSq[0]+"_"+origSq[1]];
});
V.UndoOnBoard(this.board, om);
delete attacked[origSq[0]+"_"+origSq[1]];
});
V.UndoOnBoard(this.board, om);
@@
-222,7
+222,7
@@
export const VariantRules = class Allmate1Rules extends ChessRules {
if (em.start.x == attacked[0] && em.start.y == attacked[1])
// King moved:
sq = [em.appear[0].x, em.appear[0].y];
if (em.start.x == attacked[0] && em.start.y == attacked[1])
// King moved:
sq = [em.appear[0].x, em.appear[0].y];
- if (!this.isAttacked(sq,
[oppCol]
))
+ if (!this.isAttacked(sq,
oppCol
))
res = true;
V.UndoOnBoard(this.board, em);
if (res)
res = true;
V.UndoOnBoard(this.board, em);
if (res)