mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-03-11 03:27:08 +01:00
Feat: add massive and powerful feature on weapon
This commit is contained in:
parent
4defe69c21
commit
952551ac83
2 changed files with 17 additions and 27 deletions
|
|
@ -946,14 +946,9 @@ export const weaponFeatures = {
|
|||
value: '-1'
|
||||
},
|
||||
{
|
||||
key: 'system.bonuses.damage.primaryWeapon.extraDice',
|
||||
key: 'system.bonuses.damage.primaryWeapon.addDiceAndDiscardLowest',
|
||||
mode: 2,
|
||||
value: '1'
|
||||
},
|
||||
{
|
||||
key: 'system.rules.weapon.dropLowestDamageDice',
|
||||
mode: 5,
|
||||
value: '1'
|
||||
value: true
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -1048,14 +1043,6 @@ export const weaponFeatures = {
|
|||
powerful: {
|
||||
label: 'DAGGERHEART.CONFIG.WeaponFeature.powerful.name',
|
||||
description: 'DAGGERHEART.CONFIG.WeaponFeature.powerful.description',
|
||||
actions: [
|
||||
{
|
||||
type: 'effect',
|
||||
actionType: 'action',
|
||||
chatDisplay: true,
|
||||
name: 'DAGGERHEART.CONFIG.WeaponFeature.powerful.name',
|
||||
description: 'DAGGERHEART.CONFIG.WeaponFeature.powerful.description',
|
||||
img: 'icons/magic/control/buff-flight-wings-runes-red-yellow.webp',
|
||||
effects: [
|
||||
{
|
||||
name: 'DAGGERHEART.CONFIG.WeaponFeature.powerful.name',
|
||||
|
|
@ -1063,16 +1050,9 @@ export const weaponFeatures = {
|
|||
img: 'icons/magic/control/buff-flight-wings-runes-red-yellow.webp',
|
||||
changes: [
|
||||
{
|
||||
key: 'system.bonuses.damage.primaryWeapon.extraDice',
|
||||
key: 'system.bonuses.damage.primaryWeapon.addDiceAndDiscardLowest',
|
||||
mode: 2,
|
||||
value: '1'
|
||||
},
|
||||
{
|
||||
key: 'system.rules.weapon.dropLowestDamageDice',
|
||||
mode: 5,
|
||||
value: '1'
|
||||
}
|
||||
]
|
||||
value: true
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -132,6 +132,16 @@ export default class DamageRoll extends DHRoll {
|
|||
criticalBonus = tmpRoll.total - this.constructor.calculateTotalModifiers(tmpRoll);
|
||||
part.roll.terms.push(...this.formatModifier(criticalBonus));
|
||||
}
|
||||
|
||||
if ( config.data.bonuses.damage.primaryWeapon?.addDiceAndDiscardLowest) {
|
||||
const index = part.roll.terms.findIndex(t => t instanceof foundry.dice.terms.Die);
|
||||
if (index !== -1) {
|
||||
const diceTerm = part.roll.terms[index];
|
||||
diceTerm.modifiers = ['k' + diceTerm.number];
|
||||
diceTerm.number += 1;
|
||||
}
|
||||
}
|
||||
|
||||
return (part.roll._formula = this.constructor.getFormula(part.roll.terms));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue