parent
6978a4df86
commit
83014281a5
|
|
@ -341,20 +341,20 @@ export class M5Item extends Item {
|
|||
}
|
||||
});
|
||||
|
||||
if (item.type === "spell" || item.type === "kampfkunst") {
|
||||
if (this.actor["system"].ap.value >= item.system.ap) {
|
||||
this.actor["update"]({
|
||||
data: {
|
||||
ap: {
|
||||
value: this.actor["system"].ap.value - item.system.ap,
|
||||
const roll = new M5Roll(rollData, this.actor, item.name, item.id);
|
||||
if (await roll.toMessage(toggleAutomatedRoll)) {
|
||||
if (item.type === "spell" || item.type === "kampfkunst") {
|
||||
if (this.actor["system"].ap.value >= item.system.ap) {
|
||||
this.actor["update"]({
|
||||
data: {
|
||||
ap: {
|
||||
value: this.actor["system"].ap.value - item.system.ap,
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const roll = new M5Roll(rollData, this.actor, item.name, item.id);
|
||||
return roll.toMessage(toggleAutomatedRoll);
|
||||
} else {
|
||||
ChatMessage.create({
|
||||
speaker: speaker,
|
||||
|
|
|
|||
|
|
@ -148,13 +148,13 @@ export class M5Roll {
|
|||
const rMode = (game as Game).settings.get("core", "rollMode");
|
||||
|
||||
if (!automatedRoll) {
|
||||
let checkOptions = await this.popUp({ isPW: this.data.rolls[0].label === (game as Game).i18n.localize("midgard5.pw") });
|
||||
if (checkOptions["cancelled"]) {
|
||||
return;
|
||||
} else {
|
||||
const rMode = checkOptions["rollMode"];
|
||||
this.data.b = checkOptions;
|
||||
}
|
||||
let checkOptions = await this.popUp({ isPW: this.data.rolls[0].label === (game as Game).i18n.localize("midgard5.pw") });
|
||||
if (checkOptions["cancelled"]) {
|
||||
return;
|
||||
} else {
|
||||
const rMode = checkOptions["rollMode"];
|
||||
this.data.b = checkOptions;
|
||||
}
|
||||
} else {
|
||||
this.data.b = { difficulty: 20, modifier: 0 };
|
||||
}
|
||||
|
|
@ -162,7 +162,6 @@ export class M5Roll {
|
|||
if (!this._evaluated) await this.evaluate();
|
||||
const faces = this.pool.dice.map((x) => x.faces);
|
||||
|
||||
|
||||
const chatData = {
|
||||
type: CONST.CHAT_MESSAGE_TYPES.ROLL,
|
||||
content: await this.render(),
|
||||
|
|
|
|||
Loading…
Reference in New Issue