-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
daggerheartenhancementNew feature or requestNew feature or requestgame-packageA game-specific dice packageA game-specific dice packagephaseA phase within an epicA phase within an epic
Description
Parent Epic
Schema Prerequisites
- [E-GCNV-1a] Schema: dynamic pool sides from boolean input #980 ([E-GCNV-1a] dynamic pool sides from boolean input)
- [E-GCNV-1b] Schema: conditional extra pool with arithmetic #981 ([E-GCNV-1b] conditional extra pool with arithmetic)
Spec
{
"$schema": "https://randsum.dev/schemas/v1/randsum.json",
"name": "Daggerheart",
"shortcode": "daggerheart",
"version": "1.0.0",
"game_url": "https://darringtonpress.com/daggerheart/",
"pools": {
"hope": { "sides": 12 },
"fear": { "sides": 12 }
},
"roll": {
"inputs": {
"modifier": { "type": "integer", "minimum": -30, "maximum": 30, "default": 0 },
"amplifyHope": { "type": "boolean", "default": false },
"amplifyFear": { "type": "boolean", "default": false },
"rollingWith": { "type": "string", "enum": ["Advantage", "Disadvantage"] }
},
"dicePools": {
"hope": { "pool": { "sides": { "$input": "amplifyHope", "ifTrue": 20, "ifFalse": 12 } } },
"fear": { "pool": { "sides": { "$input": "amplifyFear", "ifTrue": 20, "ifFalse": 12 } } }
},
"conditionalPools": [
{
"condition": { "input": "rollingWith", "operator": "=", "value": "Advantage" },
"pool": { "sides": 6 },
"arithmetic": "add"
},
{
"condition": { "input": "rollingWith", "operator": "=", "value": "Disadvantage" },
"pool": { "sides": 6 },
"arithmetic": "subtract"
}
],
"resolve": {
"comparePoolHighest": {
"pools": ["hope", "fear"],
"ties": "critical hope",
"outcomes": { "hope": "hope", "fear": "fear" }
}
},
"postResolveModifiers": [{ "add": { "$input": "modifier" } }]
}
}Migration Steps
- Create
games/daggerheart/daggerheart.randsum.jsonwith the spec above - Run
bun run codegen— verifydaggerheart.tsgenerates correctly - Add
daggerheart.tsto.gitignore - Delete
games/daggerheart/src/andtsconfig.json - Update
package.json(same pattern as previous migrations) - Update
__tests__/roll.test.ts:- Change import to
import { roll } from '@randsum/daggerheart' - Input field names are unchanged; all expectations unchanged
- Change import to
- Run
bun run --filter @randsum/daggerheart test— must pass
Acceptance Criteria
-
daggerheart.randsum.jsonexists and is valid -
daggerheart.tsis gitignored and generates cleanly - All existing test expectations pass
-
amplifyHope/amplifyFearcorrectly change pool sides to d20 -
rollingWith: 'Advantage'/'Disadvantage'correctly adds/subtracts a d6 -
critical hoperesult on tied pools - No
src/directory remains
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
daggerheartenhancementNew feature or requestNew feature or requestgame-packageA game-specific dice packageA game-specific dice packagephaseA phase within an epicA phase within an epic