X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=variants%2FGiveaway%2Fclass.js;h=69addf2191717300ec87f58535c21df593669298;hb=f3e90e30b6e7ff416afe288bc9dd865e5daf9860;hp=77f5c74770b1807b5e5db3f9ea1869e0c1621df6;hpb=8f57fbf250093488064401d503f1c621b122e95a;p=xogo.git diff --git a/variants/Giveaway/class.js b/variants/Giveaway/class.js index 77f5c74..69addf2 100644 --- a/variants/Giveaway/class.js +++ b/variants/Giveaway/class.js @@ -1,6 +1,6 @@ import ChessRules from "/base_rules.js"; -import { ArrayFun } from "/utils/array.js"; -import { Random } from "/utils/alea.js"; +import {ArrayFun} from "/utils/array.js"; +import {Random} from "/utils/alea.js"; export default class GiveawayRules extends ChessRules { @@ -37,6 +37,9 @@ export default class GiveawayRules extends ChessRules { } genRandInitFen(seed) { + if (this.options["mode"] == "losers") + return super.genRandInitFen(seed); + if (this.options["randomness"] == 0) { return ( 'rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w 0 {"enpassant":"-"}' @@ -81,10 +84,10 @@ export default class GiveawayRules extends ChessRules { super(o); } - underCheck([x, y], oppCol) { + underCheck(square, oppCol) { if (this.options["mode"] == "suicide") return false; - return super.underCheck([x, y], oppCol); + return super.underCheck(square, oppCol); } getCurrentScore() {