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'
|
value: '-1'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: 'system.bonuses.damage.primaryWeapon.extraDice',
|
key: 'system.bonuses.damage.primaryWeapon.addDiceAndDiscardLowest',
|
||||||
mode: 2,
|
mode: 2,
|
||||||
value: '1'
|
value: true
|
||||||
},
|
|
||||||
{
|
|
||||||
key: 'system.rules.weapon.dropLowestDamageDice',
|
|
||||||
mode: 5,
|
|
||||||
value: '1'
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
@ -1048,31 +1043,16 @@ export const weaponFeatures = {
|
||||||
powerful: {
|
powerful: {
|
||||||
label: 'DAGGERHEART.CONFIG.WeaponFeature.powerful.name',
|
label: 'DAGGERHEART.CONFIG.WeaponFeature.powerful.name',
|
||||||
description: 'DAGGERHEART.CONFIG.WeaponFeature.powerful.description',
|
description: 'DAGGERHEART.CONFIG.WeaponFeature.powerful.description',
|
||||||
actions: [
|
effects: [
|
||||||
{
|
{
|
||||||
type: 'effect',
|
|
||||||
actionType: 'action',
|
|
||||||
chatDisplay: true,
|
|
||||||
name: 'DAGGERHEART.CONFIG.WeaponFeature.powerful.name',
|
name: 'DAGGERHEART.CONFIG.WeaponFeature.powerful.name',
|
||||||
description: 'DAGGERHEART.CONFIG.WeaponFeature.powerful.description',
|
description: 'DAGGERHEART.CONFIG.WeaponFeature.powerful.description',
|
||||||
img: 'icons/magic/control/buff-flight-wings-runes-red-yellow.webp',
|
img: 'icons/magic/control/buff-flight-wings-runes-red-yellow.webp',
|
||||||
effects: [
|
changes: [
|
||||||
{
|
{
|
||||||
name: 'DAGGERHEART.CONFIG.WeaponFeature.powerful.name',
|
key: 'system.bonuses.damage.primaryWeapon.addDiceAndDiscardLowest',
|
||||||
description: 'DAGGERHEART.CONFIG.WeaponFeature.powerful.description',
|
mode: 2,
|
||||||
img: 'icons/magic/control/buff-flight-wings-runes-red-yellow.webp',
|
value: true
|
||||||
changes: [
|
|
||||||
{
|
|
||||||
key: 'system.bonuses.damage.primaryWeapon.extraDice',
|
|
||||||
mode: 2,
|
|
||||||
value: '1'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: 'system.rules.weapon.dropLowestDamageDice',
|
|
||||||
mode: 5,
|
|
||||||
value: '1'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -132,6 +132,16 @@ export default class DamageRoll extends DHRoll {
|
||||||
criticalBonus = tmpRoll.total - this.constructor.calculateTotalModifiers(tmpRoll);
|
criticalBonus = tmpRoll.total - this.constructor.calculateTotalModifiers(tmpRoll);
|
||||||
part.roll.terms.push(...this.formatModifier(criticalBonus));
|
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));
|
return (part.roll._formula = this.constructor.getFormula(part.roll.terms));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue