diff --git a/CHANGELOG.md b/CHANGELOG.md index 775dba72..37bf4b32 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,11 +7,12 @@ - Encumbrance related improvements. - Fix for 5e DAMAGE RESISTANCE and PD/ED purchased as a power, where the PD/ED was counted twice. [#1297](https://github.com/dmdorman/hero6e-foundryvtt/issues/1297) - Improved KNOWLEDGE_SKILL descriptions. [#1278](https://github.com/dmdorman/hero6e-foundryvtt/issues/1278) -- Initial NIGHTVISION, INFRAREDPERCEPTION, ULTRASONICPERCEPTION, and ULTRAVIOLETPERCEPTION support. +- Initial NIGHTVISION, INFRAREDPERCEPTION, ULTRASONICPERCEPTION, and ULTRAVIOLETPERCEPTION support. Also if you create a custom power with the word light in it, you can toggle it on/off like a lantern (QTY = meters of bright vision). - Fixes for CONTINUING CHARGES and auto expiration with SIMPLE CALENDAR. - Fixes for CHARACTERISTICS toggles that were subtracting instead of adding to values. [#1293](https://github.com/dmdorman/hero6e-foundryvtt/issues/1293) - Various minor improvements for tokens of type BASE in an effort to improve [Token Attacher](https://github.com/KayelGee/token-attacher) support. - Conditional defenses are now hidden when they provide no defense against a specific attack. There is a new setting to show All Conditional Defenses. +- Fix where some defenses were being ignored. ## Version 4.0.1 diff --git a/module/config.mjs b/module/config.mjs index 925fb458..927722f1 100644 --- a/module/config.mjs +++ b/module/config.mjs @@ -4342,7 +4342,7 @@ function addPower(powerDescription6e, powerOverrideFor5e) { { key: "DENSITYINCREASE", type: ["body-affecting", "standard"], - behaviors: ["activatable"], + behaviors: ["activatable", "defense"], perceivability: "obvious", duration: "constant", target: "self only", diff --git a/module/utility/defense.mjs b/module/utility/defense.mjs index dcba4d3a..bf2c2670 100644 --- a/module/utility/defense.mjs +++ b/module/utility/defense.mjs @@ -215,14 +215,18 @@ export function determineDefense(targetActor, attackItem, options) { // PD if (xmlid === "PD") { // Making sure this isn't an AE that is already included in the natural PD numbers - if (activeDefense.effects.size > 0) continue; + if (activeDefense.effects.size > 0) { + PD -= parseInt(activeDefense.system.LEVELS); + } activeDefense.system.defenseType = "pd"; } // ED if (xmlid === "ED") { // Making sure this isn't an AE that is already included in the natural ED numbers - if (activeDefense.effects.size > 0) continue; + if (activeDefense.effects.size > 0) { + ED -= parseInt(activeDefense.system.LEVELS); + } activeDefense.system.defenseType = "ed"; }