From e06d2befc421eebe9f1751647a6d01f24f71276a Mon Sep 17 00:00:00 2001 From: Stefan Zermatten Date: Sat, 19 Nov 2022 23:24:11 +0200 Subject: [PATCH] Fixed damage multipliers not using implicit tags --- .../api/engine/actions/applyPropertyByType/applyDamage.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/imports/api/engine/actions/applyPropertyByType/applyDamage.js b/app/imports/api/engine/actions/applyPropertyByType/applyDamage.js index f1c0c832..83ad5074 100644 --- a/app/imports/api/engine/actions/applyPropertyByType/applyDamage.js +++ b/app/imports/api/engine/actions/applyPropertyByType/applyDamage.js @@ -9,6 +9,7 @@ import { getPropertiesOfType } from '/imports/api/engine/loadCreatures.js'; import { applyNodeTriggers } from '/imports/api/engine/actions/applyTriggers.js'; +import getEffectivePropTags from '/imports/api/engine/computation/utility/getEffectivePropTags.js'; export default function applyDamage(node, actionContext) { applyNodeTriggers(node, 'before', actionContext); @@ -173,14 +174,15 @@ function applyDamageMultipliers({ target, damage, damageProp, logValue }) { function multiplierAppliesTo(damageProp, multiplierType) { return multiplier => { // Apply the default 'ignore x' tags - if (includes(damageProp.tags, `ignore ${multiplierType}`)) return false; + const effectiveTags = getEffectivePropTags(damageProp); + if (includes(effectiveTags, `ignore ${multiplierType}`)) return false; const hasRequiredTags = difference( - multiplier.includeTags, damageProp.tags + multiplier.includeTags, effectiveTags ).length === 0; const hasNoExcludedTags = intersection( - multiplier.excludeTags, damageProp.tags + multiplier.excludeTags, effectiveTags ).length === 0; return hasRequiredTags && hasNoExcludedTags;