From: Benjamin Auder Date: Wed, 12 Dec 2018 02:12:07 +0000 (+0100) Subject: Basic fixes in Ultima, still unimplemented X-Git-Url: https://git.auder.net/%7B%7B%20asset%28%27mixstore/images/assets/doc/pieces/mini-custom.min.css?a=commitdiff_plain;h=45338cdd7f037ba7b8c9e25d000ce351d86567a6;p=vchess.git Basic fixes in Ultima, still unimplemented --- diff --git a/public/javascripts/variants/Ultima.js b/public/javascripts/variants/Ultima.js index 9212afba..4612da10 100644 --- a/public/javascripts/variants/Ultima.js +++ b/public/javascripts/variants/Ultima.js @@ -52,6 +52,7 @@ class UltimaRules extends ChessRules getPotentialMovesFrom([x,y]) { + // TODO: pre-check: is thing on this square immobilized? If yes, return [] switch (this.getPiece(x,y)) { case VariantRules.IMMOBILIZER: @@ -121,6 +122,11 @@ class UltimaRules extends ChessRules return super.getPotentialQueenMoves(sq); } + getPotentialImmobilizerMoves(sq) + { + return super.getPotentialQueenMoves(sq); + } + getPotentialKingMoves(sq) { const V = VariantRules; @@ -223,7 +229,7 @@ class UltimaRules extends ChessRules randIndex = _.random(1); const rookPos = positions[randIndex]; positions.splice(randIndex, 1); - const immobilizerPos = positions[2]; + const immobilizerPos = positions[0]; pieces[c][bishop1Pos] = 'b'; pieces[c][bishop2Pos] = 'b';