allow rolling dexterity x5 for a weapons test

This commit is contained in:
TheLastScrub
2021-06-22 19:01:49 -07:00
parent dfd94129cd
commit 800ca01140
4 changed files with 38 additions and 7 deletions
+14
View File
@@ -347,6 +347,20 @@ export class DeltaGreenActorSheet extends ActorSheet {
targetVal = dataset.target;
label = game.i18n.localize(label).toUpperCase();
}
else if(rollType === "weaponskill"){
targetVal = dataset.target;
// some weapons randomly can just use dexterity x5, so try to trap on that
// otherwise roll a regular skill test
if(targetVal === "dex"){
label = game.i18n.localize("DG.Attributes.dex");
targetVal = this.actor.data.data.statistics.dex.x5;
}
else{
label = game.i18n.localize("DG.Skills." + targetVal);
targetVal = this.actor.data.data.skills[targetVal].proficiency;
}
}
else if(dataset.target === "statistic.x5"){
let stat = this.actor.data.data.statistics[key];
targetVal = stat.x5;
+18
View File
@@ -157,6 +157,24 @@ Hooks.once('init', async function() {
}
});
Handlebars.registerHelper('localizeWeaponSkill', function(skill) {
let label = skill;
try {
if(skill === 'dex'){
label = game.i18n.localize("DG.Attributes.dex");
}
else{
label = game.i18n.localize("DG.Skills." + skill);
}
} catch (error) {
console.log(error);
}
return label;
});
// looks at system setting for what font to use and returns the class that is then used in the handlebars template that
// generates the character sheet.
Handlebars.registerHelper('getFontFamilySystemSettingClass', function() {
+4 -4
View File
@@ -266,10 +266,10 @@
class="item-name rollable"
data-roll="d100"
data-rolltype="skill"
data-target="{{getActorSkillProp ../data item.data.data.skill 'proficiency'}}"
data-label="{{localize (concat 'DG.Skills.' item.data.data.skill)}}"
title="{{localize 'DG.Tooltip.SkillLabel'}} ({{localize (concat 'DG.Skills.' item.data.data.skill)}})"
data-rolltype="weaponskill"
data-target="{{item.data.data.skill}}"
data-label="{{localizeWeaponSkill item.data.data.skill}}"
title="{{localize 'DG.Tooltip.SkillLabel'}} ({{localizeWeaponSkill item.data.data.skill}})"
>
{{item.name}}
</h4>
+2 -3
View File
@@ -37,9 +37,8 @@
<option {{#if_eq data.data.skill 'athletics'}}selected{{/if_eq}} value="athletics">{{localize 'DG.Skills.athletics'}}</option>
<option {{#if_eq data.data.skill 'demolitions'}}selected{{/if_eq}} value="demolitions">{{localize 'DG.Skills.demolitions'}}</option>
<option {{#if_eq data.data.skill 'artillery'}}selected{{/if_eq}} value="artillery">{{localize 'DG.Skills.artillery'}}</option>
</select>
<option {{#if_eq data.data.skill 'dex'}}selected{{/if_eq}} value="dex">{{localize 'DG.Attributes.dex'}}</option>
</select>
<span class="resource-label">{{localize 'DG.ItemWindow.Weapons.IsLethality'}}:</span>
<input class="labeled-resource-checkbox" type="checkbox" name="data.isLethal" {{checked data.data.isLethal}} data-dtype="Boolean"