diff --git a/module/actor/actor-sheet.js b/module/actor/actor-sheet.js index 2f85c23..a8c74b6 100644 --- a/module/actor/actor-sheet.js +++ b/module/actor/actor-sheet.js @@ -212,7 +212,6 @@ export class DeltaGreenActorSheet extends ActorSheet { }); // Rollable abilities - bind to everything with the 'Rollable' class - //html.find('.rollable').click(this._onRoll.bind(this)); html.find('.rollable').mouseup(this._onRoll.bind(this)); // Macro for toggling an item's equipped state diff --git a/module/roll/roll.js b/module/roll/roll.js index 149a645..dc24395 100644 --- a/module/roll/roll.js +++ b/module/roll/roll.js @@ -12,14 +12,17 @@ export class DGPercentileRoll extends Roll { switch (rollType) { case "stat": this.rollBasis = actor.system.statistics[key] - this.target = this.rollBasis.x5; - this.localizedKey = key.toUpperCase(); + this.target = actor.system.statistics[key].x5; + this.localizedKey = game.i18n.localize(`DG.Attributes.${key}`); break; case "skill": - this.rollBasis = actor.system.skills[key]; - this.target = this.rollBasis.proficiency; + this.target = actor.system.skills[key].proficiency; this.localizedKey = game.i18n.localize(`DG.Skills.${key}`); break; + case "sanity": + this.target = actor.system.sanity.value; + this.localizedKey = game.i18n.localize("DG.Attributes.SAN"); + break; default: break; } @@ -160,21 +163,6 @@ export async function sendPercentileTestToChat(roll){ ChatMessage.create(chatData); } -export function skillCheckResultIsCritical(rollResult){ - let isCritical = false; - - if(rollResult === 1 || rollResult === 100){ - // really good, or reeaaaally bad - isCritical = true; - } - else if(rollResult % 11 === 0){ - // any matching dice are a crit, i.e. 11, 22, 33...99. - isCritical = true; - } - - return isCritical; -} - export async function sendLethalityTestToChat(actor, weaponName, target, rollMode){ //let roll = new Roll('1D100', actor.data.data).evaluate(false);