UNPKG

@seroh/roll

Version:

An RPG dice-rolling library with a variety of built-in roll mechanics.

9 lines 335 B
import { Mechanic } from "./Mechanic"; export class DisadvantageMechanic extends Mechanic { do(min, max, randomizer) { const a = randomizer.generate(min, max); const b = randomizer.generate(min, max); return { result: Math.min(a, b), rolls: [a, b] }; } } //# sourceMappingURL=DisadvantageMechanic.js.map