From 8e9827e5aec8f22392b1218e62ff195ac9b04c95 Mon Sep 17 00:00:00 2001 From: Mike Bloy Date: Sun, 11 Aug 2024 13:40:19 -0500 Subject: [PATCH] Fix protection and other maintained status effects Protection and other system status effects still had a duration when being maintained. Fixes #44 --- CHANGELOG.md | 7 +++++++ src/module/powers/basePowers.js | 5 ++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7474a35..96f3f12 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## Unreleased + +### Fixed + +- #44: protection effect and other default system effects still had duration + when added by the power effect, instead of maintaining their own effect. + ## [3.1.1] 2024-07-26 - Added: 'Shape Change Ability' power effect diff --git a/src/module/powers/basePowers.js b/src/module/powers/basePowers.js index 3e08907..7ec9898 100644 --- a/src/module/powers/basePowers.js +++ b/src/module/powers/basePowers.js @@ -134,13 +134,12 @@ export class PowerEffect { static async getStatus(label, name, favorite = true) { const effect = foundry.utils.deepClone(CONFIG.statusEffects.find((se) => se.label === label || se.name === label)); effect.name = 'name' in effect ? effect.name : effect.label; + effect.duration = {}; if (!('flags' in effect)) { effect.flags = {}; } + effect.flags.swade = {}; if (favorite) { - if (!('swade' in effect.flags)) { - effect.flags.swade = {}; - } effect.flags.swade.favorite = true; } effect.statuses ??= [];