mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-03-07 06:26:13 +01:00
Added ArmoreEffect.armorInteraction option
This commit is contained in:
parent
c067fd0e10
commit
10baf0ba10
9 changed files with 62 additions and 24 deletions
|
|
@ -9,6 +9,7 @@ export default class ArmorActiveEffectConfig extends HandlebarsApplicationMixin(
|
|||
submitOnChange: true,
|
||||
closeOnSubmit: false
|
||||
},
|
||||
position: { width: 560 },
|
||||
actions: {
|
||||
finish: ArmorActiveEffectConfig.#finish
|
||||
}
|
||||
|
|
|
|||
|
|
@ -890,3 +890,9 @@ export const activeEffectModes = {
|
|||
label: 'EFFECT.CHANGES.TYPES.override'
|
||||
}
|
||||
};
|
||||
|
||||
export const activeEffectArmorInteraction = {
|
||||
none: { id: 'none', label: 'DAGGERHEART.CONFIG.ArmorInteraction.none.label' },
|
||||
active: { id: 'active', label: 'DAGGERHEART.CONFIG.ArmorInteraction.active.label' },
|
||||
inactive: { id: 'inactive', label: 'DAGGERHEART.CONFIG.ArmorInteraction.inactive.label' }
|
||||
};
|
||||
|
|
|
|||
|
|
@ -51,10 +51,30 @@ export default class ArmorEffect extends foundry.data.ActiveEffectTypeDataModel
|
|||
}
|
||||
]
|
||||
}
|
||||
)
|
||||
),
|
||||
armorInteraction: new fields.StringField({
|
||||
required: true,
|
||||
choices: CONFIG.DH.GENERAL.activeEffectArmorInteraction,
|
||||
initial: CONFIG.DH.GENERAL.activeEffectArmorInteraction.none.id,
|
||||
label: 'DAGGERHEART.EFFECTS.Armor.FIELDS.armorInteraction.label',
|
||||
hint: 'DAGGERHEART.EFFECTS.Armor.FIELDS.armorInteraction.hint'
|
||||
})
|
||||
};
|
||||
}
|
||||
|
||||
get isSuppressed() {
|
||||
if (this.parent.actor?.type !== 'character') return false;
|
||||
|
||||
switch (this.armorInteraction) {
|
||||
case CONFIG.DH.GENERAL.activeEffectArmorInteraction.active.id:
|
||||
return !this.parent.actor.system.armor;
|
||||
case CONFIG.DH.GENERAL.activeEffectArmorInteraction.inactive.id:
|
||||
return Boolean(this.parent.actor.system.armor);
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/* Type Functions */
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -8,6 +8,8 @@ export default class DhActiveEffect extends foundry.documents.ActiveEffect {
|
|||
|
||||
/**@override */
|
||||
get isSuppressed() {
|
||||
if (this.system.isSuppressed === true) return true;
|
||||
|
||||
// If this is a copied effect from an attachment, never suppress it
|
||||
// (These effects have attachmentSource metadata)
|
||||
if (this.flags?.daggerheart?.attachmentSource) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue