Fixed so that horde damage reduction is only applied to the standard attack

This commit is contained in:
WBHarry 2026-02-22 21:20:27 +01:00
parent 267de9a8cf
commit 32b6e732fe
3 changed files with 15 additions and 2 deletions

View file

@ -86,7 +86,8 @@ export default class DhpAdversary extends DhCreature {
amount: 1
},
roll: {
type: 'attack'
type: 'attack',
isStandardAttack: true
},
damage: {
parts: [
@ -405,4 +406,10 @@ export default class DhpAdversary extends DhCreature {
return result;
}
static migrateData(source) {
if (!source.attack.roll.isStandardAttack) source.attack.roll.isStandardAttack = true;
return super.migrateData(source);
}
}

View file

@ -165,7 +165,8 @@ export default class DamageField extends fields.SchemaField {
if (data.hasRoll && part.resultBased && data.roll.result.duality === -1) return part.valueAlt;
const isAdversary = this.actor.type === 'adversary';
if (isAdversary && this.actor.system.type === CONFIG.DH.ACTOR.adversaryTypes.horde.id) {
const isHorde = this.actor.system.type === CONFIG.DH.ACTOR.adversaryTypes.horde.id;
if (isAdversary && isHorde && this.roll?.isStandardAttack) {
const hasHordeDamage = this.actor.effects.find(x => x.type === 'horde');
if (hasHordeDamage && !hasHordeDamage.disabled) return part.valueAlt;
}

View file

@ -11,6 +11,11 @@ export class DHActionRollData extends foundry.abstract.DataModel {
choices: CONFIG.DH.ACTOR.abilities,
label: 'DAGGERHEART.GENERAL.Trait.single'
}),
isStandardAttack: new fields.BooleanField({
required: true,
nullable: false,
initial: false
}),
difficulty: new fields.NumberField({ nullable: true, initial: null, integer: true, min: 0 }),
bonus: new fields.NumberField({ nullable: true, initial: null, integer: true }),
advState: new fields.StringField({