Update entity.js

Bug fix of the OSE code. Wisdom bonus was glitching monster saves.
master
The Happy Anarchist 2020-09-03 22:14:10 -10:00
parent 8cf10371c2
commit ca7684f874
1 changed files with 24 additions and 12 deletions

View File

@ -117,23 +117,35 @@ export class AcksActor extends Actor {
rollSave(save, options = {}) { rollSave(save, options = {}) {
const label = game.i18n.localize(`ACKS.saves.${save}.long`); const label = game.i18n.localize(`ACKS.saves.${save}.long`);
const rollParts = ["1d20"]; const rollParts = ["1d20"];
let data = {};
const data = { if (this.data.type == "character") {
actor: this.data, data = {
roll: { actor: this.data,
type: "above", roll: {
target: this.data.data.saves[save].value, type: "above",
magic: this.data.data.scores.wis.mod target: this.data.data.saves[save].value,
}, magic: this.data.data.scores.wis.mod
details: game.i18n.format("ACKS.roll.details.save", { save: label }), },
}; details: game.i18n.format("ACKS.roll.details.save", { save: label }),
};
} else if (this.data.type == "monster") {
data = {
actor: this.data,
roll: {
type: "above",
target: this.data.data.saves[save].value,
},
details: game.i18n.format("ACKS.roll.details.save", { save: label }),
};
}
let skip = options.event && options.event.ctrlKey; let skip = options.event && options.event.ctrlKey;
const rollMethod = this.data.type == "character" ? OseDice.RollSave : OseDice.Roll; const rollMethod = this.data.type == "character" ? AcksDice.RollSave : AcksDice.Roll;
// Roll and return // Roll and return
return AcksDice.Roll({ return rollMethod({
event: options.event, event: options.event,
parts: rollParts, parts: rollParts,
data: data, data: data,