X-Git-Url: https://git.auder.net/?p=xogo.git;a=blobdiff_plain;f=variants%2FAlign4%2Fclass.js;fp=variants%2FAlign4%2Fclass.js;h=f5b8f8364830dfff5ff2d3f180eb0adfde541b6a;hp=09a79ed797c61b62a75e55eb1d888b8cb76c66fa;hb=d66135396f3a6e140947545630004ce11f8eee7b;hpb=4fcd7ab062f5250757804d633df01bd0d06da137 diff --git a/variants/Align4/class.js b/variants/Align4/class.js index 09a79ed..f5b8f83 100644 --- a/variants/Align4/class.js +++ b/variants/Align4/class.js @@ -13,6 +13,14 @@ export default class Align4Rules extends ChessRules { {label: "Random", value: 1} ] }], + input: [ + { + label: "Pawn first", + variable: "pawnfirst", + type: "checkbox", + defaut: false + } + ], styles: ["atomic", "capture", "cylinder"] }; } @@ -39,6 +47,17 @@ export default class Align4Rules extends ChessRules { // 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 != "*")