}
pieces(color, x, y) {
- return Object.assign(
- {
- 'a': {
- // Move like a king, no attacks
- "class": "antiking",
- moves: super.pieces(color, x, y)['k'].moves,
- attack: []
- }
- },
- super.pieces(color, x, y)
- );
+ let antikingSpec = super.pieces(color, x, y)['k'];
+ antikingSpec["class"] = "antiking";
+ return Object.assign({'a': antikingSpec}, super.pieces(color, x, y));
}
isKing(x, y, p) {
m.vanish.length == 1 || m.vanish[1].p != 'a');
}
- underCheck(squares, color) {
+ underCheck(square_s, color) {
let res = false;
- squares.forEach(sq => {
+ if (!Array.isArray(square_s[0]))
+ square_s = [square_s];
+ square_s.forEach(sq => {
switch (this.getPiece(sq[0], sq[1])) {
case 'k':
res ||= super.underAttack(sq, color);