hathora-et-labora-game
Version:
Plays Uwe Rosenberg's Ora et Labora for the Hathora engine. It reduces a list of moves into a board game state.
21 lines • 762 B
JavaScript
import { T, __, always, cond, curry, gte } from 'ramda';
import { match } from 'ts-pattern';
import { getCost, withActivePlayer } from '../board/player';
export const spinningMill = () => {
return withActivePlayer((player) => {
var _a;
// TODO: this could be an evolve?
return getCost({
penny: cond([
[gte(__, 9), always(6)],
[gte(__, 5), always(5)],
[gte(__, 1), always(3)],
[T, always(0)],
])((_a = player.sheep) !== null && _a !== void 0 ? _a : 0),
})(player);
});
};
export const complete = curry((partial, _state) => match(partial)
.with([], always(['']))
.otherwise(always([])));
//# sourceMappingURL=spinningMill.js.map