Refactored actions, 'cast a spell' task now works
This commit is contained in:
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user