X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FMakpong.js;fp=client%2Fsrc%2Fvariants%2FMakpong.js;h=057666513343a3ca6fea9bc6f62ddd61969dd4d0;hb=dbc79ee67847c36aad6b640b15d25d6fb7f361e5;hp=0000000000000000000000000000000000000000;hpb=95bc4bf5248120712946500416543bbfc6b7ae85;p=vchess.git diff --git a/client/src/variants/Makpong.js b/client/src/variants/Makpong.js new file mode 100644 index 00000000..05766651 --- /dev/null +++ b/client/src/variants/Makpong.js @@ -0,0 +1,14 @@ +import { MakrukRules } from "@/variants/Makruk"; + +export class MakpongRules extends MakrukRules { + + filterValid(moves) { + const color = this.turn; + if (this.underCheck(color)) { + // Filter out all moves involving king + return super.filterValid(moves.filter(m => m.vanish[0].p != V.KING)); + } + return super.filterValid(moves); + } + +};