From 5ee02241a88d437b96b814ee8d8aa412f5e21d7f Mon Sep 17 00:00:00 2001 From: Ean Milligan Date: Sat, 28 Jun 2025 21:56:25 -0400 Subject: [PATCH] prepare for grouped rolls --- src/artigen/dice/getRollConf.ts | 2 +- .../dice/{diceOptions.ts => rollOptions.ts} | 20 +++++++++++-------- 2 files changed, 13 insertions(+), 9 deletions(-) rename src/artigen/dice/{diceOptions.ts => rollOptions.ts} (95%) diff --git a/src/artigen/dice/getRollConf.ts b/src/artigen/dice/getRollConf.ts index 0bdea52..74edd06 100644 --- a/src/artigen/dice/getRollConf.ts +++ b/src/artigen/dice/getRollConf.ts @@ -4,7 +4,7 @@ import { RollConf } from 'artigen/dice/dice.d.ts'; import { getLoopCount, loopCountCheck } from 'artigen/managers/loopManager.ts'; -import { DiceOptions, NumberlessDiceOptions } from 'artigen/dice/diceOptions.ts'; +import { DiceOptions, NumberlessDiceOptions } from './rollOptions.ts'; import { loggingEnabled } from 'artigen/utils/logFlag.ts'; import { addToRange, gtrAddToRange, ltAddToRange } from 'artigen/utils/rangeAdder.ts'; diff --git a/src/artigen/dice/diceOptions.ts b/src/artigen/dice/rollOptions.ts similarity index 95% rename from src/artigen/dice/diceOptions.ts rename to src/artigen/dice/rollOptions.ts index d242750..1bd08c1 100644 --- a/src/artigen/dice/diceOptions.ts +++ b/src/artigen/dice/rollOptions.ts @@ -1,10 +1,21 @@ -export const DiceOptions = Object.freeze({ +export const GroupOptions = Object.freeze({ Drop: 'd', DropLow: 'dl', DropHigh: 'dh', Keep: 'k', KeepLow: 'kl', KeepHigh: 'kh', + SuccessLt: '<', + SuccessGtr: '>', + SuccessEqu: '=', + Fail: 'f', + FailLt: 'f<', + FailGtr: 'f>', + FailEqu: 'f=', +}); + +export const DiceOptions = Object.freeze({ + ...GroupOptions, Reroll: 'r', RerollLt: 'r<', RerollGtr: 'r>', @@ -42,13 +53,6 @@ export const DiceOptions = Object.freeze({ Sort: 's', SortAsc: 'sa', SortDesc: 'sd', - SuccessLt: '<', - SuccessGtr: '>', - SuccessEqu: '=', - Fail: 'f', - FailLt: 'f<', - FailGtr: 'f>', - FailEqu: 'f=', }); // Should be ordered such that 'mt' will be encountered before 'm'