projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Update Cwda - RR pieces
[vchess.git]
/
client
/
src
/
variants
/
Takenmake.js
diff --git
a/client/src/variants/Takenmake.js
b/client/src/variants/Takenmake.js
index
6cea420
..
d37edf6
100644
(file)
--- a/
client/src/variants/Takenmake.js
+++ b/
client/src/variants/Takenmake.js
@@
-2,6
+2,7
@@
import { ChessRules } from "@/base_rules";
import { randInt } from "@/utils/alea";
export class TakenmakeRules extends ChessRules {
import { randInt } from "@/utils/alea";
export class TakenmakeRules extends ChessRules {
+
setOtherVariables(fen) {
super.setOtherVariables(fen);
// Stack of "last move" only for intermediate captures
setOtherVariables(fen) {
super.setOtherVariables(fen);
// Stack of "last move" only for intermediate captures
@@
-12,17
+13,16
@@
export class TakenmakeRules extends ChessRules {
const L = this.lastMoveEnd.length;
if (!asA && !!this.lastMoveEnd[L-1]) {
asA = this.lastMoveEnd[L-1].p;
const L = this.lastMoveEnd.length;
if (!asA && !!this.lastMoveEnd[L-1]) {
asA = this.lastMoveEnd[L-1].p;
- if (x != this.lastMoveEnd[L-1].x || y != this.lastMoveEnd[L-1].y)
{
+ if (x != this.lastMoveEnd[L-1].x || y != this.lastMoveEnd[L-1].y)
// A capture was played: wrong square
return [];
// A capture was played: wrong square
return [];
- }
}
let moves = [];
const piece = this.getPiece(x, y);
switch (asA || piece) {
case V.PAWN:
if (!asA || piece == V.PAWN)
}
let moves = [];
const piece = this.getPiece(x, y);
switch (asA || piece) {
case V.PAWN:
if (!asA || piece == V.PAWN)
- moves =
this
.getPotentialPawnMoves([x, y]);
+ moves =
super
.getPotentialPawnMoves([x, y]);
else {
// Special case: we don't want promotion, since just moving like
// a pawn, but I'm in fact not a pawn :)
else {
// Special case: we don't want promotion, since just moving like
// a pawn, but I'm in fact not a pawn :)
@@
-197,4
+197,5
@@
export class TakenmakeRules extends ChessRules {
delete moves[mIdx]["next"];
return [moves[mIdx], move2];
}
delete moves[mIdx]["next"];
return [moves[mIdx], move2];
}
+
};
};