projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Rename Monochrome --> Monocolor , split Cannibal (forced captures or not)
[vchess.git]
/
client
/
src
/
variants
/
Teleport.js
diff --git
a/client/src/variants/Teleport.js
b/client/src/variants/Teleport.js
index
eadaf13
..
cbf6a78
100644
(file)
--- a/
client/src/variants/Teleport.js
+++ b/
client/src/variants/Teleport.js
@@
-2,7
+2,8
@@
import { ChessRules, Move, PiPo } from "@/base_rules";
import { randInt } from "@/utils/alea";
export class TeleportRules extends ChessRules {
import { randInt } from "@/utils/alea";
export class TeleportRules extends ChessRules {
- hoverHighlight(x, y) {
+
+ hoverHighlight([x, y]) {
// Testing move validity results in an infinite update loop.
// TODO: find a way to test validity anyway.
return (this.subTurn == 2 && this.board[x][y] == V.EMPTY);
// Testing move validity results in an infinite update loop.
// TODO: find a way to test validity anyway.
return (this.subTurn == 2 && this.board[x][y] == V.EMPTY);
@@
-18,6
+19,11
@@
export class TeleportRules extends ChessRules {
return this.subTurn == 1;
}
return this.subTurn == 1;
}
+ canIplay(side, [x, y]) {
+ if (this.subTurn == 2) return (this.board[x][y] == V.EMPTY);
+ return super.canIplay(side, [x, y]);
+ }
+
getPPpath(m) {
if (
m.vanish.length == 2 &&
getPPpath(m) {
if (
m.vanish.length == 2 &&
@@
-319,4
+325,5
@@
export class TeleportRules extends ChessRules {
move.appear[0].p != V.PAWN ? move.appear[0].p.toUpperCase() : "";
return piece + "@" + V.CoordsToSquare(move.end);
}
move.appear[0].p != V.PAWN ? move.appear[0].p.toUpperCase() : "";
return piece + "@" + V.CoordsToSquare(move.end);
}
+
};
};