projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add unambiguous section in the PGN + some fixes + code formatting and fix typos
[vchess.git]
/
client
/
src
/
variants
/
Ball.js
diff --git
a/client/src/variants/Ball.js
b/client/src/variants/Ball.js
index
cd504a9
..
0f84bae
100644
(file)
--- a/
client/src/variants/Ball.js
+++ b/
client/src/variants/Ball.js
@@
-7,19
+7,16
@@
export class BallRules extends ChessRules {
return Object.assign(
{},
ChessRules.PawnSpecs,
return Object.assign(
{},
ChessRules.PawnSpecs,
- { promotions: ChessRules.PawnSpecs.promotions.concat([V.
CHAMPION
]) }
+ { promotions: ChessRules.PawnSpecs.promotions.concat([V.
PHOENIX
]) }
);
}
static get HasFlags() {
return false;
}
);
}
static get HasFlags() {
return false;
}
- static get HasCastle() {
- return false;
- }
- static get
CHAMPION
() {
- return '
c
';
+ static get
PHOENIX
() {
+ return '
h
';
}
static get BALL() {
}
static get BALL() {
@@
-41,7
+38,7
@@
export class BallRules extends ChessRules {
'b': 'd',
'q': 't',
'k': 'l',
'b': 'd',
'q': 't',
'k': 'l',
- '
c': 'h
'
+ '
h': 'i
'
};
}
};
}
@@
-53,13
+50,13
@@
export class BallRules extends ChessRules {
'd': 'b',
't': 'q',
'l': 'k',
'd': 'b',
't': 'q',
'l': 'k',
- '
h': 'c
'
+ '
i': 'h
'
};
}
static get PIECES() {
return ChessRules.PIECES
};
}
static get PIECES() {
return ChessRules.PIECES
- .concat([V.
CHAMPION
])
+ .concat([V.
PHOENIX
])
.concat(Object.keys(V.HAS_BALL_DECODE))
.concat(['a']);
}
.concat(Object.keys(V.HAS_BALL_DECODE))
.concat(['a']);
}
@@
-108,7
+105,7
@@
export class BallRules extends ChessRules {
let prefix = "";
const withPrefix =
Object.keys(V.HAS_BALL_DECODE)
let prefix = "";
const withPrefix =
Object.keys(V.HAS_BALL_DECODE)
- .concat([V.
CHAMPION
])
+ .concat([V.
PHOENIX
])
.concat(['a']);
if (withPrefix.includes(b[1])) prefix = "Ball/";
return prefix + b;
.concat(['a']);
if (withPrefix.includes(b[1])) prefix = "Ball/";
return prefix + b;
@@
-176,16
+173,12
@@
export class BallRules extends ChessRules {
return Object.assign(
{},
ChessRules.steps,
return Object.assign(
{},
ChessRules.steps,
- // Add
champion
moves
+ // Add
phoenix
moves
{
{
-
c
: [
+
h
: [
[-2, -2],
[-2, -2],
- [-2, 0],
[-2, 2],
[-2, 2],
- [0, -2],
- [0, 2],
[2, -2],
[2, -2],
- [2, 0],
[2, 2],
[-1, 0],
[1, 0],
[2, 2],
[-1, 0],
[1, 0],
@@
-261,8
+254,8
@@
export class BallRules extends ChessRules {
// So base implementation is fine.
getPotentialMovesFrom([x, y]) {
// So base implementation is fine.
getPotentialMovesFrom([x, y]) {
- if (this.getPiece(x, y) == V.
CHAMPION
)
- return this.getPotential
Champion
Moves([x, y]);
+ if (this.getPiece(x, y) == V.
PHOENIX
)
+ return this.getPotential
Phoenix
Moves([x, y]);
return super.getPotentialMovesFrom([x, y]);
}
return super.getPotentialMovesFrom([x, y]);
}
@@
-286,8
+279,8
@@
export class BallRules extends ChessRules {
return moves;
}
return moves;
}
- getPotential
Champion
Moves(sq) {
- return this.getSlideNJumpMoves(sq, V.steps[V.
CHAMPION
], "oneStep");
+ getPotential
Phoenix
Moves(sq) {
+ return this.getSlideNJumpMoves(sq, V.steps[V.
PHOENIX
], "oneStep");
}
filterValid(moves) {
}
filterValid(moves) {
@@
-324,10
+317,10
@@
export class BallRules extends ChessRules {
return {
p: 1,
r: 3,
return {
p: 1,
r: 3,
- n:
4
,
+ n:
3
,
b: 2,
q: 5,
b: 2,
q: 5,
-
c: 4
,
+
h: 3
,
a: 0 //ball: neutral
};
}
a: 0 //ball: neutral
};
}