projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Several small improvements + integrate options + first working draft of Cwda
[vchess.git]
/
client
/
src
/
variants
/
Omega.js
diff --git
a/client/src/variants/Omega.js
b/client/src/variants/Omega.js
index
a688a2e
..
29b58e5
100644
(file)
--- a/
client/src/variants/Omega.js
+++ b/
client/src/variants/Omega.js
@@
-140,8
+140,8
@@
export class OmegaRules extends ChessRules {
);
}
);
}
- static GenRandInitFen(
randomnes
s) {
- if (randomness == 0) {
+ static GenRandInitFen(
option
s) {
+ if (
options.
randomness == 0) {
return (
"wxxxxxxxxxxw/xcrnbqkbnrcx/xppppppppppx/x91x/x91x/x91x/" +
"x91x/x91x/x91x/xPPPPPPPPPPx/xCRNBQKBNRCx/WxxxxxxxxxxW " +
return (
"wxxxxxxxxxxw/xcrnbqkbnrcx/xppppppppppx/x91x/x91x/x91x/" +
"x91x/x91x/x91x/xPPPPPPPPPPx/xCRNBQKBNRCx/WxxxxxxxxxxW " +
@@
-153,7
+153,7
@@
export class OmegaRules extends ChessRules {
let flags = "";
// Shuffle pieces on first (and last rank if randomness == 2)
for (let c of ["w", "b"]) {
let flags = "";
// Shuffle pieces on first (and last rank if randomness == 2)
for (let c of ["w", "b"]) {
- if (c == 'b' && randomness == 1) {
+ if (c == 'b' &&
options.
randomness == 1) {
pieces['b'] = pieces['w'];
flags += flags;
break;
pieces['b'] = pieces['w'];
flags += flags;
break;
@@
-320,11
+320,11
@@
export class OmegaRules extends ChessRules {
}
getPotentialChampionMoves(sq) {
}
getPotentialChampionMoves(sq) {
- return this.getSlideNJumpMoves(sq, V.steps[V.CHAMPION],
"oneStep"
);
+ return this.getSlideNJumpMoves(sq, V.steps[V.CHAMPION],
1
);
}
getPotentialWizardMoves(sq) {
}
getPotentialWizardMoves(sq) {
- return this.getSlideNJumpMoves(sq, V.steps[V.WIZARD],
"oneStep"
);
+ return this.getSlideNJumpMoves(sq, V.steps[V.WIZARD],
1
);
}
getCastleMoves([x, y]) {
}
getCastleMoves([x, y]) {
@@
-346,14
+346,14
@@
export class OmegaRules extends ChessRules {
isAttackedByWizard(sq, color) {
return (
this.isAttackedBySlideNJump(
isAttackedByWizard(sq, color) {
return (
this.isAttackedBySlideNJump(
- sq, color, V.WIZARD, V.steps[V.WIZARD],
"oneStep"
)
+ sq, color, V.WIZARD, V.steps[V.WIZARD],
1
)
);
}
isAttackedByChampion(sq, color) {
return (
this.isAttackedBySlideNJump(
);
}
isAttackedByChampion(sq, color) {
return (
this.isAttackedBySlideNJump(
- sq, color, V.CHAMPION, V.steps[V.CHAMPION],
"oneStep"
)
+ sq, color, V.CHAMPION, V.steps[V.CHAMPION],
1
)
);
}
);
}