Refactored actions, 'cast a spell' task now works

This commit is contained in:
Thaum Rystra
2024-10-28 12:28:36 +02:00
parent 804c5f3aee
commit 8f8c9c28aa
39 changed files with 423 additions and 399 deletions

View File

@@ -615,16 +615,20 @@ export default {
incrementChange(_id, { type, value, ack }) {
const model = CreatureProperties.findOne(_id);
if (type === 'increment') value = -value;
doAction(model, this.$store, model._id, {
subtaskFn: 'damageProp',
prop: model,
targetIds: [model.root.id],
params: {
title: getPropertyTitle(model),
operation: type,
value,
targetProp: model,
}
doAction({
creatureId: model.root.id,
$store: this.$store,
elementId: `${model._id}-${type}`,
task: {
subtaskFn: 'damageProp',
targetIds: [model.root.id],
params: {
title: getPropertyTitle(model),
operation: type,
value,
targetProp: model,
},
},
}).then(() =>{
ack?.();
}).catch((error) => {