feat(gameplay): enforce core SRD d20 rules
Co-authored-by: multica-agent <github@multica.ai>
This commit is contained in:
@@ -41,6 +41,21 @@ describe('round orchestration', () => {
|
||||
}, context)).toThrow('Unknown check actor outsider')
|
||||
})
|
||||
|
||||
it('requires complete SRD check inputs before rolling', () => {
|
||||
const context = buildRoundContext({
|
||||
scene: 'Scene', recentRounds: [], intents: [],
|
||||
characters: [character('hero', 'human'), character('foe', 'ai')], memories: [],
|
||||
})
|
||||
const basePlan = { aiActions: [], proposedEvents: [], relevantMemoryQueries: [] }
|
||||
|
||||
expect(() => validateAndOrderRoundPlan({
|
||||
...basePlan, checks: [{ actorId: 'hero', kind: 'skill', mode: 'normal', reason: 'Search' }],
|
||||
}, context)).toThrow('Skill checks require a skill')
|
||||
expect(() => validateAndOrderRoundPlan({
|
||||
...basePlan, checks: [{ actorId: 'hero', kind: 'attack', mode: 'normal', reason: 'Strike' }],
|
||||
}, context)).toThrow('Attack rolls require a target')
|
||||
})
|
||||
|
||||
it('schedules durable story summaries every third completed round', () => {
|
||||
expect([1, 2, 3, 4, 5, 6].filter(shouldUpdateStorySummary)).toEqual([3, 6])
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user