Changed task triggers to be stored differently so that attribute check and damage triggers don't overlap

This commit is contained in:
Thaum Rystra
2024-05-21 17:41:20 +02:00
parent 8eb702cde3
commit 772e55ece5
9 changed files with 154 additions and 173 deletions

View File

@@ -42,7 +42,7 @@ export default async function applyDamagePropTask(
}
// Run the before triggers which may change scope properties
await applyTriggers(action, targetProp, [action.creatureId], 'before', userInput);
await applyTriggers(action, targetProp, [targetId], 'damageTriggerIds.before', userInput);
// Create a new result after triggers have run
result = new TaskResult(task.prop._id, task.targetIds);
@@ -136,8 +136,8 @@ export default async function applyDamagePropTask(
});
setScope(result, targetProp, newValue, damage);
}
await applyTriggers(action, targetProp, [action.creatureId], 'after', userInput);
await applyTriggers(action, targetProp, [action.creatureId], 'afterChildren', userInput);
await applyTriggers(action, targetProp, [targetId], 'damageTriggerIds.after', userInput);
await applyTriggers(action, targetProp, [targetId], 'damageTriggerIds.afterChildren', userInput);
return increment;
}