Fixed subtle trigger bugs that break LoV hit dice extension
This commit is contained in:
@@ -15,7 +15,7 @@ export default async function applyAdjustmentProperty(
|
||||
const damageTargetIds = prop.target === 'self' ? [action.creatureId] : task.targetIds;
|
||||
|
||||
if (damageTargetIds.length > 1) {
|
||||
return await applyTaskToEachTarget(action, task, damageTargetIds, userInput);
|
||||
return applyTaskToEachTarget(action, task, damageTargetIds, userInput);
|
||||
}
|
||||
|
||||
// Get the operation and value and push the damage hooks to the queue
|
||||
|
||||
@@ -41,7 +41,7 @@ export default async function applyDamageProperty(
|
||||
const logName = prop.damageType === 'healing' ? 'Healing' : 'Damage';
|
||||
|
||||
// roll the dice only and store that string
|
||||
recalculateCalculation(prop.amount, action, 'compile', inputProvider);
|
||||
await recalculateCalculation(prop.amount, action, 'compile', inputProvider);
|
||||
const { result: rolled } = await resolve('roll', prop.amount.valueNode, scope, context, inputProvider);
|
||||
if (rolled.parseType !== 'constant') {
|
||||
logValue.push(toString(rolled));
|
||||
@@ -99,7 +99,7 @@ export default async function applyDamageProperty(
|
||||
let damageOnSave, saveProp, saveRoll;
|
||||
if (prop.save) {
|
||||
if (prop.save.damageFunction?.calculation) {
|
||||
recalculateCalculation(prop.save.damageFunction, action, 'compile', inputProvider);
|
||||
await recalculateCalculation(prop.save.damageFunction, action, 'compile', inputProvider);
|
||||
context.errors = [];
|
||||
const { result: saveDamageRolled } = await resolve(
|
||||
'roll', prop.save.damageFunction.valueNode, scope, context, inputProvider
|
||||
|
||||
@@ -1,16 +1,26 @@
|
||||
import { EngineAction } from '/imports/api/engine/action/EngineActions';
|
||||
import { applyDefaultAfterPropTasks } from '/imports/api/engine/action/functions/applyTaskGroups';
|
||||
import recalculateInlineCalculations from '/imports/api/engine/action/functions/recalculateInlineCalculations';
|
||||
import { PropTask } from '/imports/api/engine/action/tasks/Task';
|
||||
import getPropertyTitle from '/imports/api/utility/getPropertyTitle';
|
||||
|
||||
|
||||
export default async function applyTriggerProperty(
|
||||
task: PropTask, action: EngineAction, result, userInput
|
||||
): Promise<void> {
|
||||
const prop = task.prop;
|
||||
result.appendLog({
|
||||
const logContent = {
|
||||
name: getPropertyTitle(prop),
|
||||
...prop.silent && { silenced: true },
|
||||
})
|
||||
}
|
||||
|
||||
// Add the trigger description to the log
|
||||
if (prop.description?.text) {
|
||||
await recalculateInlineCalculations(prop.description, action, 'reduce', userInput);
|
||||
if (prop.description.value) {
|
||||
logContent.value = prop.description.value;
|
||||
}
|
||||
}
|
||||
|
||||
result.appendLog(logContent);
|
||||
return applyDefaultAfterPropTasks(action, prop, task.targetIds, userInput);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user