mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-03-07 22:46:12 +01:00
Added duration to all tier1 adversaries
This commit is contained in:
parent
0ba17117ea
commit
3d672baddf
22 changed files with 337 additions and 144 deletions
|
|
@ -491,6 +491,12 @@ export function refreshIsAllowed(allowedTypes, typeToCheck) {
|
|||
}
|
||||
}
|
||||
|
||||
function expireActiveEffectIsAllowed(allowedTypes, typeToCheck) {
|
||||
if (typeToCheck === CONFIG.DH.GENERAL.activeEffectDurations.act.id) return true;
|
||||
|
||||
return refreshIsAllowed(allowedTypes, typeToCheck);
|
||||
}
|
||||
|
||||
export function expireActiveEffects(actor, allowedTypes = null) {
|
||||
const shouldExpireEffects = game.settings.get(
|
||||
CONFIG.DH.id,
|
||||
|
|
@ -506,7 +512,7 @@ export function expireActiveEffects(actor, allowedTypes = null) {
|
|||
const { temporary, custom } = CONFIG.DH.GENERAL.activeEffectDurations;
|
||||
if ([temporary.id, custom.id].includes(effect.system.duration.type)) return false;
|
||||
|
||||
return refreshIsAllowed(allowedTypes, effect.system.duration.type);
|
||||
return expireActiveEffectIsAllowed(allowedTypes, effect.system.duration.type);
|
||||
})
|
||||
.map(x => x.id);
|
||||
|
||||
|
|
@ -527,6 +533,8 @@ export function htmlToText(html) {
|
|||
|
||||
export function getIconVisibleActiveEffects(effects) {
|
||||
return effects.filter(effect => {
|
||||
if (!(effect instanceof game.system.api.documents.DhActiveEffect)) return true;
|
||||
|
||||
const alwaysShown = effect.showIcon === CONST.ACTIVE_EFFECT_SHOW_ICON.ALWAYS;
|
||||
const conditionalShown = effect.showIcon === CONST.ACTIVE_EFFECT_SHOW_ICON.CONDITIONAL && !effect.transfer; // TODO: system specific logic
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue