X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=variants%2FBaroque%2Fclass.js;h=84331a2a29a344cccd2c303385494124437b8dfd;hb=714ce6d8c8981175b3a2bdacdfc707ca5a1ce587;hp=f87d768275d5917227ca5fa6adc1c5467553bb2d;hpb=7c03823594cef3ce6e8da7ac1d7d3504c73695a9;p=xogo.git diff --git a/variants/Baroque/class.js b/variants/Baroque/class.js index f87d768..84331a2 100644 --- a/variants/Baroque/class.js +++ b/variants/Baroque/class.js @@ -1,4 +1,4 @@ -import AbstractSpecialCaptureRules from "/variants/_SpecialCaptures.js"; +import AbstractSpecialCaptureRules from "/variants/_SpecialCaptures/class.js"; import {FenUtil} from "/utils/setupPieces.js"; import {Random} from "/utils/alea.js"; @@ -34,7 +34,12 @@ export default class BaroqueRules extends AbstractSpecialCaptureRules { genRandInitBaseFen() { const s = FenUtil.setupPieces( - ['r', 'n', 'b', 'q', 'k', 'b', 'n', 'i'], {diffCol: ['b']}); + ['r', 'n', 'b', 'q', 'k', 'b', 'n', 'i'], + { + randomness: this.options["randomness"], + diffCol: ['b'] + } + ); if (this.options["randomness"] <= 1) { // Fix immobilizers/rooks pattern const toExchange1 = s.w.indexOf('r'), @@ -94,8 +99,8 @@ export default class BaroqueRules extends AbstractSpecialCaptureRules { isImmobilized([x, y]) { const piece = this.getPiece(x, y); const color = this.getColor(x, y); - const oppCol = C.GetOppCol(color); - const adjacentSteps = this.pieces()['k'].moves[0].steps; + const oppCol = C.GetOppTurn(color); + const adjacentSteps = this.pieces()['k'].both[0].steps; for (let step of adjacentSteps) { const [i, j] = [x + step[0], this.getY(y + step[1])]; if (