getReserveMoves([x, y]) {
const color = this.turn;
+ const oppCol = V.GetOppCol(color);
const p = V.RESERVE_PIECES[y];
if (this.reserve[color][p] == 0) return [];
const bounds = (p == V.PAWN ? [1, V.size.x - 1] : [0, V.size.x]);
}
updateCastleFlags(move, piece) {
- if (move.appear.length == 2) {
+ if (piece == V.KING && move.appear.length == 2) {
// Castling (only move which disable flags)
this.castleFlags[move.appear[0].c][0] = 10;
this.castleFlags[move.appear[0].c][1] = 10;
static get VALUES() {
return Object.assign(
+ {},
+ ChessRules.VALUES,
{
+ n: 2.5, //knight is weaker
g: 9,
s: 5,
h: 6,
w: 9,
m: 8,
a: 9
- },
- ChessRules.VALUES
+ }
);
}