mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-11 19:25:21 +01:00
The basic attack damage shown in the sidebar is modified if horde damage is active (#1071)
This commit is contained in:
parent
46ea4addd0
commit
fbeff1b908
2 changed files with 6 additions and 4 deletions
|
|
@ -51,11 +51,13 @@ export default class DHAttackAction extends DHDamageAction {
|
|||
const labels = [];
|
||||
const { roll, range, damage } = this;
|
||||
|
||||
if (roll.trait) labels.push(game.i18n.localize(`DAGGERHEART.CONFIG.Traits.${roll.trait}.short`))
|
||||
if (roll.trait) labels.push(game.i18n.localize(`DAGGERHEART.CONFIG.Traits.${roll.trait}.short`));
|
||||
if (range) labels.push(game.i18n.localize(`DAGGERHEART.CONFIG.Range.${range}.short`));
|
||||
|
||||
for (const { value, type } of damage.parts) {
|
||||
const str = Roll.replaceFormulaData(value.getFormula(), this.actor?.getRollData() ?? {});
|
||||
const useAltDamage = this.actor?.effects?.find(x => x.type === 'horde')?.active;
|
||||
for (const { value, valueAlt, type } of damage.parts) {
|
||||
const usedValue = useAltDamage ? valueAlt : value;
|
||||
const str = Roll.replaceFormulaData(usedValue.getFormula(), this.actor?.getRollData() ?? {});
|
||||
|
||||
const icons = Array.from(type)
|
||||
.map(t => CONFIG.DH.GENERAL.damageTypes[t]?.icon)
|
||||
|
|
|
|||
|
|
@ -129,7 +129,7 @@ export default class DhpAdversary extends BaseDataActor {
|
|||
CONFIG.DH.id,
|
||||
CONFIG.DH.SETTINGS.gameSettings.Automation
|
||||
).hordeDamage;
|
||||
if (autoHordeDamage && changes.system?.resources?.hitPoints?.value) {
|
||||
if (autoHordeDamage && changes.system?.resources?.hitPoints?.value !== undefined) {
|
||||
const hordeActiveEffect = this.parent.effects.find(x => x.type === 'horde');
|
||||
if (hordeActiveEffect) {
|
||||
const halfHP = Math.ceil(this.resources.hitPoints.max / 2);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue