export default class AlapoRules extends ChessRules {
+ static get Options() {
+ return {
+ select: C.Options.select,
+ styles: C.Options.styles.filter(s => s != "teleport")
+ };
+ }
+
get hasFlags() {
return false;
}
);
}
+ // Triangles are rotated from opponent viewpoint (=> suffix "_inv")
pieces(color, x, y) {
+ const allSpecs = super.pieces(color, x, y);
return {
- 'r': super.pieces(color, x, y)['r'],
- 'q': super.pieces(color, x, y)['q'],
- 'b': {
- // Triangle is rotated from opponent viewpoint
- "class": "bishop" + (this.playerColor != color ? "_inv" : ""),
- moves: [ { steps: [[1, 1], [1, -1], [-1, 1], [-1, -1]] } ]
- },
+ 'r': allSpecs['r'],
+ 'q': allSpecs['q'],
+ 'b': Object.assign({}, allSpecs['b'],
+ {"class": "bishop" + (this.playerColor != color ? "_inv" : "")}),
's': { //"square"
"class": "babyrook",
moves: [
won[c] = this.board[goal].some((b,j) => {
return (
this.getColor(goal, j) == c &&
- this.findCapturesOn(
- [goal, j], {one: true, oppCol: oppCol}).length == 0
+ !this.findCapturesOn(
+ [goal, j],
+ {
+ one: true,
+ oppCol: oppCol,
+ segments: this.options["cylinder"]
+ }
+ )
);
});
}