[Feature] Beastform Types (#372)

* Temp

* Finished Evolved

* Fixed hybrid

* Changed generalConfig.tiers to be number based

* Weaponhandling while in beastform

* Added unarmed strike in sidebar

* Added DamageEnricher

* Added effect enricher

* Corrected downtime buttons and actions

* Added BeastformTooltip

* Split the BeastformDialog into parts with tabs

* Added temp beastform features

* rollData change

* Improvement

* character.getRollData cleanup
This commit is contained in:
WBHarry 2025-07-20 21:56:22 +02:00 committed by GitHub
parent 867947c2c5
commit 42a705a870
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
93 changed files with 2795 additions and 538 deletions

View file

@ -22,31 +22,32 @@ export default class DHDamageAction extends DHBaseAction {
formatFormulas(formulas, systemData) {
const formattedFormulas = [];
formulas.forEach(formula => {
if (isNaN(formula.formula)) formula.formula = Roll.replaceFormulaData(formula.formula, this.getRollData(systemData));
const same = formattedFormulas.find(f => setsEqual(f.damageTypes, formula.damageTypes) && f.applyTo === formula.applyTo);
if(same)
same.formula += ` + ${formula.formula}`;
else
formattedFormulas.push(formula);
})
if (isNaN(formula.formula))
formula.formula = Roll.replaceFormulaData(formula.formula, this.getRollData(systemData));
const same = formattedFormulas.find(
f => setsEqual(f.damageTypes, formula.damageTypes) && f.applyTo === formula.applyTo
);
if (same) same.formula += ` + ${formula.formula}`;
else formattedFormulas.push(formula);
});
return formattedFormulas;
}
async rollDamage(event, data) {
const systemData = data.system ?? data;
let formulas = this.damage.parts.map(p => ({
formula: this.getFormulaValue(p, data).getFormula(this.actor),
damageTypes: p.applyTo === 'hitPoints' && !p.type.size ? new Set(['physical']) : p.type,
applyTo: p.applyTo
}));
if(!formulas.length) return;
if (!formulas.length) return;
formulas = this.formatFormulas(formulas, systemData);
const config = {
title: game.i18n.format('DAGGERHEART.UI.Chat.damageRoll.title', { damage: this.name }),
title: game.i18n.format('DAGGERHEART.UI.Chat.damageRoll.title', { damage: game.i18n.localize(this.name) }),
roll: formulas,
targets: systemData.targets.filter(t => t.hit) ?? data.targets,
hasSave: this.hasSave,