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

@@ -95,17 +95,22 @@ export default {
damageProperty({value, type, ack}) {
const model = this.model;
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: this.dataId,
task: {
subtaskFn: 'damageProp',
prop: model,
targetIds: [model.root.id],
params: {
title: getPropertyTitle(model),
operation: type,
value,
targetProp: model,
}
}
}).then(() =>{
}).then(() => {
ack?.();
}).catch((error) => {
if (ack) {
@@ -127,4 +132,4 @@ export default {
.pointer {
cursor: pointer;
}
</style>
</style>