return true;
}
+ // Allow to take (moving: not disappearing) own pieces?
+ get hasSelfCaptures() {
+ return (
+ this.options["recycle"] ||
+ (this.options["teleport"] && this.subTurnTeleport == 1)
+ );
+ }
+
get hasReserve() {
return (
!!this.options["crazyhouse"] ||
}
pieces(color, x, y) {
- const pawnShift = this.getPawnShift(color);
+ const pawnShift = this.getPawnShift(color || 'w');
return {
'p': {
"class": "pawn",
});
Array.prototype.push.apply(squares, zenCaptures);
}
- if (
- this.options["recycle"] ||
- (this.options["teleport"] && this.subTurnTeleport == 1)
- ) {
+ if (this.hasSelfCaptures) {
const selfCaptures = this.findDestSquares(
[x, y],
{