X-Git-Url: https://git.auder.net/?p=vchess.git;a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FStealthbomb1.js;h=a82d1700e830d886cb6e64143b2093db55b4e369;hp=dce7f5a907fb526160b159ef79427182dd94512c;hb=4313762da3237b04f204e121a20cab3ba7bb5dd2;hpb=cee75a57d2f4f89c89d64cefbab55d839a238ed9 diff --git a/client/src/variants/Stealthbomb1.js b/client/src/variants/Stealthbomb1.js index dce7f5a9..a82d1700 100644 --- a/client/src/variants/Stealthbomb1.js +++ b/client/src/variants/Stealthbomb1.js @@ -16,8 +16,7 @@ export class Stealthbomb1Rules extends ChessRules { t: "q", u: "r", c: "b", - o: "n", - l: "k" + o: "n" }; } static get BOMB_CODE() { @@ -26,8 +25,7 @@ export class Stealthbomb1Rules extends ChessRules { q: "t", r: "u", b: "c", - n: "o", - k: "l" + n: "o" }; } @@ -77,7 +75,7 @@ export class Stealthbomb1Rules extends ChessRules { ); } - // Initiate the game by choosing a square for the bomb: + // Initiate the game by choosing a piece holding the bomb: doClick(square) { const c = this.turn; if ( @@ -91,6 +89,7 @@ export class Stealthbomb1Rules extends ChessRules { } const [x, y] = square; const piece = super.getPiece(x, y); + if (piece == V.KING) return null; //no bomb on king! return new Move({ appear: [ new PiPo({ x: x, y: y, c: c, p: V.BOMB_CODE[piece] }) ], vanish: [ new PiPo({ x: x, y: y, c: c, p: piece }) ],