projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Hamilton: no postPlay/Undo
[vchess.git]
/
client
/
src
/
variants
/
Makruk.js
diff --git
a/client/src/variants/Makruk.js
b/client/src/variants/Makruk.js
index
2da534f
..
75fb1da
100644
(file)
--- a/
client/src/variants/Makruk.js
+++ b/
client/src/variants/Makruk.js
@@
-3,6
+3,7
@@
import { ArrayFun } from "@/utils/array";
import { randInt, shuffle } from "@/utils/alea";
export class MakrukRules extends ChessRules {
import { randInt, shuffle } from "@/utils/alea";
export class MakrukRules extends ChessRules {
+
static get HasFlags() {
return false;
}
static get HasFlags() {
return false;
}
@@
-11,14
+12,19
@@
export class MakrukRules extends ChessRules {
return false;
}
return false;
}
+ static get Monochrome() {
+ return true;
+ }
+
+ static get Notoodark() {
+ return true;
+ }
+
static get PawnSpecs() {
return Object.assign(
{},
ChessRules.PawnSpecs,
static get PawnSpecs() {
return Object.assign(
{},
ChessRules.PawnSpecs,
- {
- twoSquares: false,
- promotions: [V.QUEEN]
- }
+ { promotions: [V.QUEEN] }
);
}
);
}
@@
-103,8
+109,14
@@
export class MakrukRules extends ChessRules {
);
}
);
}
+ isAttacked(sq, color) {
+ return (
+ super.isAttacked(sq, color) || this.isAttackedByPromoted(sq, color)
+ );
+ }
+
isAttackedByBishop(sq, color) {
isAttackedByBishop(sq, color) {
- const forward = (
this.turn
== 'w' ? 1 : -1);
+ const forward = (
color
== 'w' ? 1 : -1);
return this.isAttackedBySlideNJump(
sq,
color,
return this.isAttackedBySlideNJump(
sq,
color,
@@
-124,6
+136,16
@@
export class MakrukRules extends ChessRules {
);
}
);
}
+ isAttackedByPromoted(sq, color) {
+ return super.isAttackedBySlideNJump(
+ sq,
+ color,
+ V.PROMOTED,
+ V.steps[V.BISHOP],
+ "oneStep"
+ );
+ }
+
static get VALUES() {
return {
p: 1,
static get VALUES() {
return {
p: 1,
@@
-135,4
+157,5
@@
export class MakrukRules extends ChessRules {
k: 1000
};
}
k: 1000
};
}
+
};
};