X-Git-Url: https://git.auder.net/?p=vchess.git;a=blobdiff_plain;f=public%2Fjavascripts%2Fvariants%2FAtomic.js;h=255444f2f026abec77b411793ce71052ff8aaf6b;hp=2adb98842aeb14316249abdafdf6813ab046d8df;hb=26b8e4f7c71030d49e44fe1d89632ef91b886d67;hpb=c018b304ba439ca92348dcb65715707f5cfcee05 diff --git a/public/javascripts/variants/Atomic.js b/public/javascripts/variants/Atomic.js index 2adb9884..255444f2 100644 --- a/public/javascripts/variants/Atomic.js +++ b/public/javascripts/variants/Atomic.js @@ -90,7 +90,7 @@ class AtomicRules extends ChessRules { super.unupdateVariables(move); const c = move.vanish[0].c; - const oppCol = this.getOppCol(c); + const oppCol = V.GetOppCol(c); if ([this.kingPos[c][0],this.kingPos[oppCol][0]].some(e => { return e < 0; })) { // There is a chance that last move blowed some king away.. @@ -104,7 +104,7 @@ class AtomicRules extends ChessRules underCheck(color) { - const oppCol = this.getOppCol(color); + const oppCol = V.GetOppCol(color); let res = undefined; // If our king disappeared, move is not valid if (this.kingPos[color][0] < 0) @@ -122,7 +122,7 @@ class AtomicRules extends ChessRules { let res = [ ]; if (this.kingPos[color][0] >= 0 //king might have exploded - && this.isAttacked(this.kingPos[color], [this.getOppCol(color)])) + && this.isAttacked(this.kingPos[color], [V.GetOppCol(color)])) { res = [ JSON.parse(JSON.stringify(this.kingPos[color])) ] } @@ -135,7 +135,7 @@ class AtomicRules extends ChessRules const kp = this.kingPos[color]; if (kp[0] < 0) //king disappeared return color == "w" ? "0-1" : "1-0"; - if (!this.isAttacked(kp, [this.getOppCol(color)])) + if (!this.isAttacked(kp, [V.GetOppCol(color)])) return "1/2"; return color == "w" ? "0-1" : "1-0"; //checkmate }