Fix Shogi.js
[vchess.git] / client / src / variants / Stealthbomb2.js
CommitLineData
278a28a1
BA
1import { Move, PiPo } from "@/base_rules";
2import { Stealthbomb1Rules } from "@/variants/Stealthbomb1";
3
4export class Stealthbomb2Rules extends Stealthbomb1Rules {
5
4313762d 6 // Initiate the game by choosing a pawn holding the bomb:
278a28a1
BA
7 doClick(square) {
8 const c = this.turn;
9 if (
10 this.movesCount >= 2 ||
11 (
12 (c == 'w' && square[0] != 6) ||
13 (c == 'b' && square[0] != 1)
14 )
15 ) {
16 return null;
17 }
18 const [x, y] = square;
19 return new Move({
20 appear: [ new PiPo({ x: x, y: y, c: c, p: 's' }) ],
21 vanish: [ new PiPo({ x: x, y: y, c: c, p: 'p' }) ],
22 start: { x: -1, y: -1 },
23 end: { x: x, y: y, noHighlight: true }
24 });
25 }
26
27};