subtract ap when casting spell
Changes: + subtract AP when casting a spell
This commit is contained in:
parent
7bf0fd90b0
commit
db21ca93b0
|
|
@ -215,6 +215,12 @@ export class M5Item extends Item {
|
|||
}
|
||||
});
|
||||
|
||||
if (item.type === "spell" || item.type === "kampfkunst") {
|
||||
if (this.actor["system"].ap.value >= item.system.ap) {
|
||||
this.actor["system"].ap.value -= item.system.ap;
|
||||
}
|
||||
}
|
||||
|
||||
const roll = new M5Roll(rollData, this.actor, item.name);
|
||||
return roll.toMessage();
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -160,6 +160,7 @@ export default class M5CharacterSheet extends ActorSheet {
|
|||
const context = this.actor as any;
|
||||
const item = context.items.get(itemId) as M5Item;
|
||||
await item.roll();
|
||||
this.render();
|
||||
});
|
||||
|
||||
html.find(".roll-brawl-button").on("click", async (event) => {
|
||||
|
|
|
|||
Loading…
Reference in New Issue