projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add Stealthbomb
[vchess.git]
/
client
/
src
/
variants
/
Shinobi.js
diff --git
a/client/src/variants/Shinobi.js
b/client/src/variants/Shinobi.js
index
8f7f11f
..
faa4cd7
100644
(file)
--- a/
client/src/variants/Shinobi.js
+++ b/
client/src/variants/Shinobi.js
@@
-60,7
+60,7
@@
export class ShinobiRules extends ChessRules {
if (!ChessRules.IsGoodFen(fen)) return false;
const fenParsed = V.ParseFen(fen);
// 5) Check reserve
if (!ChessRules.IsGoodFen(fen)) return false;
const fenParsed = V.ParseFen(fen);
// 5) Check reserve
- if (!fenParsed.reserve || !fenParsed.reserve.match(/^[0-9]{
6,6
}$/))
+ if (!fenParsed.reserve || !fenParsed.reserve.match(/^[0-9]{
5,5
}$/))
return false;
return true;
}
return false;
return true;
}
@@
-73,12
+73,12
@@
export class ShinobiRules extends ChessRules {
);
}
);
}
- // In hand initially:
captain,
ninja, samurai + 2 x monk, horse, lance.
+ // In hand initially: ninja, samurai + 2 x monk, horse, lance.
static GenRandInitFen(randomness) {
const baseFen = ChessRules.GenRandInitFen(Math.min(randomness, 1));
return (
baseFen.substr(0, 35) + "3CK3 " +
static GenRandInitFen(randomness) {
const baseFen = ChessRules.GenRandInitFen(Math.min(randomness, 1));
return (
baseFen.substr(0, 35) + "3CK3 " +
- "w 0 " + baseFen.substr(48, 2) + " - 11
1
222"
+ "w 0 " + baseFen.substr(48, 2) + " - 11222"
);
}
);
}
@@
-101,12
+101,11
@@
export class ShinobiRules extends ChessRules {
V.ParseFen(fen).reserve.split("").map(x => parseInt(x, 10));
this.reserve = {
w: {
V.ParseFen(fen).reserve.split("").map(x => parseInt(x, 10));
this.reserve = {
w: {
- [V.CAPTAIN]: reserve[0],
- [V.NINJA]: reserve[1],
- [V.SAMURAI]: reserve[2],
- [V.MONK]: reserve[3],
- [V.HORSE]: reserve[4],
- [V.LANCE]: reserve[5]
+ [V.NINJA]: reserve[0],
+ [V.SAMURAI]: reserve[1],
+ [V.MONK]: reserve[2],
+ [V.HORSE]: reserve[3],
+ [V.LANCE]: reserve[4]
}
};
}
}
};
}
@@
-122,7
+121,7
@@
export class ShinobiRules extends ChessRules {
}
static get RESERVE_PIECES() {
}
static get RESERVE_PIECES() {
- return [V.
CAPTAIN, V.
NINJA, V.SAMURAI, V.MONK, V.HORSE, V.LANCE];
+ return [V.NINJA, V.SAMURAI, V.MONK, V.HORSE, V.LANCE];
}
getReserveMoves([x, y]) {
}
getReserveMoves([x, y]) {
@@
-174,7
+173,7
@@
export class ShinobiRules extends ChessRules {
if ([V.ROOK, V.KNIGHT, V.BISHOP, V.QUEEN].includes(piece))
return super.getPotentialMovesFrom(sq);
switch (piece) {
if ([V.ROOK, V.KNIGHT, V.BISHOP, V.QUEEN].includes(piece))
return super.getPotentialMovesFrom(sq);
switch (piece) {
- case V.KING: return
super
.getPotentialKingMoves(sq);
+ case V.KING: return
this
.getPotentialKingMoves(sq);
case V.CAPTAIN: return this.getPotentialCaptainMoves(sq);
case V.NINJA: return this.getPotentialNinjaMoves(sq);
case V.SAMURAI: return this.getPotentialSamuraiMoves(sq);
case V.CAPTAIN: return this.getPotentialCaptainMoves(sq);
case V.NINJA: return this.getPotentialNinjaMoves(sq);
case V.SAMURAI: return this.getPotentialSamuraiMoves(sq);
@@
-250,6
+249,7
@@
export class ShinobiRules extends ChessRules {
// Attacked by white:
return (
super.isAttackedByKing(sq, 'w') ||
// Attacked by white:
return (
super.isAttackedByKing(sq, 'w') ||
+ super.isAttackedByPawn(sq, 'w') ||
this.isAttackedByCaptain(sq, 'w') ||
this.isAttackedByNinja(sq, 'w') ||
this.isAttackedBySamurai(sq, 'w') ||
this.isAttackedByCaptain(sq, 'w') ||
this.isAttackedByNinja(sq, 'w') ||
this.isAttackedBySamurai(sq, 'w') ||