Support target-scoped trauma mechanics
This commit is contained in:
@@ -43,7 +43,7 @@ const shot = (
|
||||
|
||||
describe('trigger action registry', () => {
|
||||
it('owns every action and validates discriminated parameters', () => {
|
||||
expect(Object.keys(TRIGGER_ACTION_REGISTRY)).toHaveLength(15);
|
||||
expect(Object.keys(TRIGGER_ACTION_REGISTRY)).toHaveLength(16);
|
||||
expect(validateTriggerConfiguration('same_target_hits_within_window', {
|
||||
hitsRequired: 9,
|
||||
windowSeconds: 3
|
||||
@@ -197,6 +197,18 @@ describe('evaluateConditionalProgram', () => {
|
||||
});
|
||||
});
|
||||
|
||||
it('treats an explicit non-headshot hit as a body shot', () => {
|
||||
const result = evaluateConditionalProgram(program({
|
||||
action: 'body_shot',
|
||||
params: {}
|
||||
}), [
|
||||
shot(1, 'alpha', true, false),
|
||||
shot(2, 'alpha', true, true),
|
||||
shot(3, 'alpha', false, false)
|
||||
], { mode: 'encounter', encounterSeconds: 5 });
|
||||
expect(result.activations.map((activation) => activation.at)).toEqual([1]);
|
||||
});
|
||||
|
||||
it('refreshes one shared duration and clears every stack on expiry', () => {
|
||||
const result = evaluateConditionalProgram(program({
|
||||
action: 'damage_taken',
|
||||
|
||||
Reference in New Issue
Block a user