X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FFanorona.js;h=e1e653a32df0401d8b443fcd11df7e8bd4eae99a;hb=4313762da3237b04f204e121a20cab3ba7bb5dd2;hp=399116353e9a940dde808678dd1d61701c9f62be;hpb=d982fffc441a0443be90ba6f57a94d1d60b702c8;p=vchess.git diff --git a/client/src/variants/Fanorona.js b/client/src/variants/Fanorona.js index 39911635..e1e653a3 100644 --- a/client/src/variants/Fanorona.js +++ b/client/src/variants/Fanorona.js @@ -3,6 +3,10 @@ import { randInt } from "@/utils/alea"; export class FanoronaRules extends ChessRules { + static get Options() { + return null; + } + static get HasFlags() { return false; } @@ -80,13 +84,14 @@ export class FanoronaRules extends ChessRules { return "Fanorona/" + b; } - getPPpath(m) { + getPPpath(m, orientation) { // m.vanish.length >= 2, first capture gives direction const ref = (Math.abs(m.vanish[1].x - m.start.x) == 1 ? m.start : m.end); const step = [m.vanish[1].x - ref.x, m.vanish[1].y - ref.y]; + const multStep = (orientation == 'w' ? 1 : -1); const normalizedStep = [ - step[0] / Math.abs(step[0]), - step[1] / Math.abs(step[1]) + multStep * step[0] / Math.abs(step[0]), + multStep * step[1] / Math.abs(step[1]) ]; return ( "Fanorona/arrow_" +