projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add Minishogi
[vchess.git]
/
client
/
src
/
variants
/
Rococo.js
diff --git
a/client/src/variants/Rococo.js
b/client/src/variants/Rococo.js
index
8489ae9
..
f075fe8
100644
(file)
--- a/
client/src/variants/Rococo.js
+++ b/
client/src/variants/Rococo.js
@@
-131,8
+131,9
@@
export class RococoRules extends ChessRules {
getPotentialMovesFrom([x, y]) {
// Pre-check: is thing on this square immobilized?
const imSq = this.isImmobilized([x, y]);
getPotentialMovesFrom([x, y]) {
// Pre-check: is thing on this square immobilized?
const imSq = this.isImmobilized([x, y]);
- if (!!imSq) {
- // Only option is suicide:
+ const piece = this.getPiece(x, y);
+ if (!!imSq && piece != V.KING) {
+ // Only option is suicide, if I'm not a king:
return [
new Move({
start: { x: x, y: y },
return [
new Move({
start: { x: x, y: y },
@@
-150,7
+151,7
@@
export class RococoRules extends ChessRules {
];
}
let moves = [];
];
}
let moves = [];
- switch (
this.getPiece(x, y)
) {
+ switch (
piece
) {
case V.IMMOBILIZER:
moves = this.getPotentialImmobilizerMoves([x, y]);
break;
case V.IMMOBILIZER:
moves = this.getPotentialImmobilizerMoves([x, y]);
break;
@@
-623,7
+624,7
@@
export class RococoRules extends ChessRules {
static GenRandInitFen(randomness) {
if (randomness == 0) {
return (
static GenRandInitFen(randomness) {
if (randomness == 0) {
return (
- "91/1r
nbkqbnm1/1pppppppp1/91/91/91/91/1PPPPPPPP1/1MNBQKBN
R1/91 w 0 -"
+ "91/1r
qnbknqm1/1pppppppp1/91/91/91/91/1PPPPPPPP1/1MQNBKNQ
R1/91 w 0 -"
);
}
);
}