Typescript all the parser things

This commit is contained in:
Thaum Rystra
2024-02-20 23:21:12 +02:00
parent 3ea492ee78
commit ac15512bc5
86 changed files with 926 additions and 718 deletions

View File

@@ -8,7 +8,7 @@ import { getSingleProperty } from '/imports/api/engine/loadCreatures';
export default async function applyDamagePropTask(
task: DamagePropTask, action: EngineAction, result: TaskResult, userInput
): Promise<void> {
): Promise<number> {
const prop = task.prop;
if (task.targetIds.length > 1) {
@@ -74,7 +74,7 @@ export default async function applyDamagePropTask(
let damage, newValue, increment;
targetProp = await getSingleProperty(targetId, targetPropId);
if (!targetProp) return;
if (!targetProp) return value;
if (operation === 'set') {
const total = targetProp.total || 0;
@@ -128,4 +128,5 @@ export default async function applyDamagePropTask(
});
}
await applyTriggers(action, prop, [action.creatureId], 'damageProperty.after', userInput);
return increment;
}