Started implementing spells in action engine

This commit is contained in:
ThaumRystra
2024-10-27 12:51:48 +02:00
parent 01df7898cc
commit 804c5f3aee
9 changed files with 131 additions and 147 deletions

View File

@@ -340,20 +340,19 @@ export default {
// Cantrips and no-slot spells
return slotId && slotId === 'no-slot'
} else {
// Leveled spells
// Levelled spells
return slotId !== 'no-slot' && slot && spell && (
spell.level <= slot.spellSlotLevel.value
);
}
},
cast({ advantage }) {
cast() {
let selectedSlotId = this.selectedSlotId;
const ritual = selectedSlotId === 'ritual';
if (selectedSlotId === 'no-slot' || selectedSlotId === 'ritual') selectedSlotId = undefined;
this.$store.dispatch('popDialogStack', {
spellId: this.selectedSpellId,
slotId: selectedSlotId,
advantage,
ritual,
});
}