UNPKG

@seroh/roll

Version:

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

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