-class UltimaRules extends ChessRules
+class BaroqueRules extends ChessRules
{
static get HasFlags() { return false; }
static getPpath(b)
{
if (b[1] == "m") //'m' for Immobilizer (I is too similar to 1)
- return "Ultima/" + b;
+ return "Baroque/" + b;
return b; //usual piece
}
{
const piece = this.getPiece(x,y);
const color = this.getColor(x,y);
- const oppCol = this.getOppCol(color);
+ const oppCol = V.GetOppCol(color);
const adjacentSteps = V.steps[V.ROOK].concat(V.steps[V.BISHOP]);
outerLoop:
for (let step of adjacentSteps)
{
const steps = V.steps[V.ROOK];
const color = this.turn;
- const oppCol = this.getOppCol(color);
+ const oppCol = V.GetOppCol(color);
moves.forEach(m => {
if (!!byChameleon && m.start.x!=m.end.x && m.start.y!=m.end.y)
return; //chameleon not moving as pawn
});
}
- // "Pincher"
+ // "Pincer"
getPotentialPawnMoves([x,y])
{
let moves = super.getPotentialRookMoves([x,y]);
addRookCaptures(moves, byChameleon)
{
const color = this.turn;
- const oppCol = this.getOppCol(color);
+ const oppCol = V.GetOppCol(color);
const kp = this.kingPos[color];
moves.forEach(m => {
// Check piece-king rectangle (if any) corners for enemy pieces
// Look in every direction for captures
const steps = V.steps[V.ROOK].concat(V.steps[V.BISHOP]);
const color = this.turn;
- const oppCol = this.getOppCol(color);
+ const oppCol = V.GetOppCol(color);
let moves = [];
const [x,y] = [startSquare[0],startSquare[1]];
const piece = this.getPiece(x,y); //might be a chameleon!
const adjacentSteps = V.steps[V.ROOK].concat(V.steps[V.BISHOP]);
let capturingDirections = [];
const color = this.turn;
- const oppCol = this.getOppCol(color);
+ const oppCol = V.GetOppCol(color);
adjacentSteps.forEach(step => {
const [i,j] = [x+step[0],y+step[1]];
if (V.OnBoard(i,j) && this.board[i][j] != V.EMPTY && this.getColor(i,j) == oppCol
return false;
}
- updateVariables(move)
- {
- // Just update king(s) position(s)
- const piece = move.vanish[0].p;
- const c = move.vanish[0].c;
- if (piece == V.KING && move.appear.length > 0)
- {
- this.kingPos[c][0] = move.appear[0].x;
- this.kingPos[c][1] = move.appear[0].y;
- }
- }
-
static get VALUES()
{
// TODO: totally experimental!
}
}
-const VariantRules = UltimaRules;
+const VariantRules = BaroqueRules;