mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-11 19:25:21 +01:00
[PR]Add custom formula to weapon base attack (#964)
* Add custom formula to weapon base attack * Remove log * Update weapon custom damage formula label + update font-size in px
This commit is contained in:
parent
471cbd55df
commit
a72d4583cd
43 changed files with 161 additions and 140 deletions
|
|
@ -23,14 +23,14 @@ export class DHActionDiceData extends foundry.abstract.DataModel {
|
|||
multiplier: new fields.StringField({
|
||||
choices: CONFIG.DH.GENERAL.multiplierTypes,
|
||||
initial: 'prof',
|
||||
label: 'Multiplier'
|
||||
label: "DAGGERHEART.ACTIONS.Config.damage.multiplier"
|
||||
}),
|
||||
flatMultiplier: new fields.NumberField({ nullable: true, initial: 1, label: 'Flat Multiplier' }),
|
||||
dice: new fields.StringField({ choices: CONFIG.DH.GENERAL.diceTypes, initial: 'd6', label: 'Dice' }),
|
||||
bonus: new fields.NumberField({ nullable: true, initial: null, label: 'Bonus' }),
|
||||
flatMultiplier: new fields.NumberField({ nullable: true, initial: 1, label: "DAGGERHEART.ACTIONS.Config.damage.flatMultiplier" }),
|
||||
dice: new fields.StringField({ choices: CONFIG.DH.GENERAL.diceTypes, initial: 'd6', label: "DAGGERHEART.GENERAL.Dice.single" }),
|
||||
bonus: new fields.NumberField({ nullable: true, initial: null, label: "DAGGERHEART.GENERAL.bonus" }),
|
||||
custom: new fields.SchemaField({
|
||||
enabled: new fields.BooleanField({ label: 'Custom Formula' }),
|
||||
formula: new FormulaField({ label: 'Formula', initial: '' })
|
||||
enabled: new fields.BooleanField({ label: "DAGGERHEART.ACTIONS.Config.general.customFormula" }),
|
||||
formula: new FormulaField({ label: "DAGGERHEART.ACTIONS.Config.general.formula", initial: '' })
|
||||
})
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -199,8 +199,8 @@ export default class DHWeapon extends AttachableItem {
|
|||
];
|
||||
|
||||
for (const { value, type } of attack.damage.parts) {
|
||||
const parts = [value.dice];
|
||||
if (value.bonus) parts.push(value.bonus.signedString());
|
||||
const parts = value.custom.enabled ? [game.i18n.localize("DAGGERHEART.GENERAL.custom")] : [value.dice];
|
||||
if (!value.custom.enabled && value.bonus) parts.push(value.bonus.signedString());
|
||||
|
||||
if (type.size > 0) {
|
||||
const typeTags = Array.from(type)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue