X-Git-Url: https://git.auder.net/css/rpsls.css?a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FPandemonium.js;h=3997e2b0a8a282c3dc334a9f81030206adda5b1b;hb=822d71d68d98ab35989cc41683c93ce9a0714ffe;hp=f4ae3c44a55ae47d3f4446e74cd0d42f660e8963;hpb=7721a36a50b840b1dfe4cfaf5ed7abcbf525ffd5;p=vchess.git diff --git a/client/src/variants/Pandemonium.js b/client/src/variants/Pandemonium.js index f4ae3c44..3997e2b0 100644 --- a/client/src/variants/Pandemonium.js +++ b/client/src/variants/Pandemonium.js @@ -223,6 +223,7 @@ export class PandemoniumRules extends ChessRules { 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]); @@ -648,7 +649,7 @@ export class PandemoniumRules extends ChessRules { } 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; @@ -722,7 +723,10 @@ export class PandemoniumRules extends ChessRules { static get VALUES() { return Object.assign( + {}, + ChessRules.VALUES, { + n: 2.5, //knight is weaker g: 9, s: 5, h: 6, @@ -731,8 +735,7 @@ export class PandemoniumRules extends ChessRules { w: 9, m: 8, a: 9 - }, - ChessRules.VALUES + } ); }