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"] ||
});
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],
{
}
}
+ // TODO here: should/could use getPotentialMovesFrom ?! (not sure)
+ // --> would be useful for variants like Copycat.
// Search for enemy (or not) pieces attacking [x, y]
findCapturesOn([x, y], o, allowed) {
if (!o.byCol)