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,8 +117,10 @@ 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") {
data = {
actor: this.data, actor: this.data,
roll: { roll: {
type: "above", type: "above",
@ -127,13 +129,23 @@ export class AcksActor extends Actor {
}, },
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,