X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FSpartan.js;h=2400e0408e5f85703ed7c78bdb0ea6eb048577e5;hb=eaa5ad3e93b761fefb16b32071be0b439761f843;hp=3b4fc7714ba6ea828a041f4de2723203dbe6533a;hpb=26580d874deaea68cfb1b926549b1ee2720e9ec9;p=vchess.git diff --git a/client/src/variants/Spartan.js b/client/src/variants/Spartan.js index 3b4fc771..2400e040 100644 --- a/client/src/variants/Spartan.js +++ b/client/src/variants/Spartan.js @@ -12,8 +12,7 @@ export class SpartanRules extends ChessRules { } getPpath(b) { - if ([V.LIEUTENANT, V.GENERAL, V.CAPTAIN, V.WARLORD].includes(b[1])) - return "Spartan/" + b; + if (b[0] == 'b' && b[1] != 'k') return "Spartan/" + b; return b; } @@ -275,9 +274,9 @@ export class SpartanRules extends ChessRules { isAttackedByWarlord(sq) { return ( - super.isAttackedBySlideNJump(sq, 'b', V.GENERAL, - V.steps[V.ROOK].concat(V.steps[V.BISHOP]), "oneStep") || - super.isAttackedBySlideNJump(sq, 'b', V.GENERAL, V.steps[V.ROOK]) + super.isAttackedBySlideNJump( + sq, 'b', V.WARLORD, V.steps[V.KNIGHT], "oneStep") || + super.isAttackedBySlideNJump(sq, 'b', V.WARLORD, V.steps[V.BISHOP]) ); }