projects
/
xogo.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
New variant idea
[xogo.git]
/
variants
/
Align4
/
class.js
diff --git
a/variants/Align4/class.js
b/variants/Align4/class.js
index
09a79ed
..
f5b8f83
100644
(file)
--- a/
variants/Align4/class.js
+++ b/
variants/Align4/class.js
@@
-13,6
+13,14
@@
export default class Align4Rules extends ChessRules {
{label: "Random", value: 1}
]
}],
{label: "Random", value: 1}
]
}],
+ input: [
+ {
+ label: "Pawn first",
+ variable: "pawnfirst",
+ type: "checkbox",
+ defaut: false
+ }
+ ],
styles: ["atomic", "capture", "cylinder"]
};
}
styles: ["atomic", "capture", "cylinder"]
};
}
@@
-39,6
+47,17
@@
export default class Align4Rules extends ChessRules {
// Just do not update any reserve (infinite supply)
updateReserve() {}
// Just do not update any reserve (infinite supply)
updateReserve() {}
+ canDrop([c, p], [i, j]) {
+ return (
+ this.board[i][j] == "" &&
+ (
+ p != "p" || this.options["pawnfirst"] ||
+ (c == 'w' && i < this.size.x - 1) ||
+ (c == 'b' && i > 0)
+ )
+ );
+ }
+
getCurrentScore(move_s) {
const score = super.getCurrentScore(move_s);
if (score != "*")
getCurrentScore(move_s) {
const score = super.getCurrentScore(move_s);
if (score != "*")