Skip to content

Commit

Permalink
staging changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Muttley committed Oct 20, 2023
1 parent 78486a8 commit 126936e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
1 change: 1 addition & 0 deletions i18n/en.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,7 @@ SHADOWDARK.item.effect.predefined_effect.weaponAttackBonus: Weapon Attack Roll B
SHADOWDARK.item.effect.predefined_effect.weaponDamageBonus: Weapon Attack Damage Bonus
SHADOWDARK.item.effect.predefined_effect.weaponDamageDieD12: Weapon Damage Die D12
SHADOWDARK.item.effect.predefined_effect.weaponDamageDieImprovementByProperty: Weapon Damage Die Improvement By Property
SHADOWDARK.item.effect.predefined_effect.weaponDamageExtraDieByProperty: Extra Damage Die By Property
SHADOWDARK.item.effect.predefined_effect.weaponDamageMultiplier: Weapon Damage Multiplier
SHADOWDARK.item.effect.predefined_effect.weaponMastery: Weapon Mastery
SHADOWDARK.item.effect.show-on-panel: Show on panel
Expand Down
7 changes: 7 additions & 0 deletions system/assets/mappings/map-predefined-effects.json
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,13 @@
"lang": "SHADOWDARK.item.effect.predefined_effect.weaponDamageDieImprovementByProperty",
"mode": "CONST.ACTIVE_EFFECT_MODES.ADD"
},
"weaponDamageExtraDieByProperty": {
"defaultValue": "REPLACEME",
"effectKey": "system.bonuses.weaponDamageExtraDieByProperty",
"icon": "icons/skills/ranged/arrows-flying-salvo-blue-light.webp",
"lang": "SHADOWDARK.item.effect.predefined_effect.weaponDamageExtraDieByProperty",
"mode": "CONST.ACTIVE_EFFECT_MODES.ADD"
},
"weaponDamageMultiplier": {
"defaultValue": 2,
"effectKey": "system.bonuses.damageMultiplier",
Expand Down
12 changes: 7 additions & 5 deletions system/src/dice/RollSD.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ export default class RollSD extends Roll {

// Improve the base damage die if this weapon has the relevant property
const weaponDamageDieImprovementByProperty =
data.actor.system.bonuses.weaponDamageDieImprovementByProperty;
data.actor.system.bonuses.weaponDamageDieImprovementByProperty ?? [];

for (const property of weaponDamageDieImprovementByProperty) {
if (await data.item.hasProperty(property)) {
Expand All @@ -319,10 +319,12 @@ export default class RollSD extends Roll {
shadowdark.config.DAMAGE_DICE
);

versatileDamageDie = shadowdark.utils.getNextDieInList(
versatileDamageDie,
shadowdark.config.DAMAGE_DICE
);
if (versatileDamageDie) {
versatileDamageDie = shadowdark.utils.getNextDieInList(
versatileDamageDie,
shadowdark.config.DAMAGE_DICE
);
}
}
}

Expand Down

0 comments on commit 126936e

Please sign in to comment.