Fixed damage multipliers not using implicit tags
This commit is contained in:
@@ -9,6 +9,7 @@ import {
|
|||||||
getPropertiesOfType
|
getPropertiesOfType
|
||||||
} from '/imports/api/engine/loadCreatures.js';
|
} from '/imports/api/engine/loadCreatures.js';
|
||||||
import { applyNodeTriggers } from '/imports/api/engine/actions/applyTriggers.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) {
|
export default function applyDamage(node, actionContext) {
|
||||||
applyNodeTriggers(node, 'before', actionContext);
|
applyNodeTriggers(node, 'before', actionContext);
|
||||||
@@ -173,14 +174,15 @@ function applyDamageMultipliers({ target, damage, damageProp, logValue }) {
|
|||||||
function multiplierAppliesTo(damageProp, multiplierType) {
|
function multiplierAppliesTo(damageProp, multiplierType) {
|
||||||
return multiplier => {
|
return multiplier => {
|
||||||
// Apply the default 'ignore x' tags
|
// 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(
|
const hasRequiredTags = difference(
|
||||||
multiplier.includeTags, damageProp.tags
|
multiplier.includeTags, effectiveTags
|
||||||
).length === 0;
|
).length === 0;
|
||||||
|
|
||||||
const hasNoExcludedTags = intersection(
|
const hasNoExcludedTags = intersection(
|
||||||
multiplier.excludeTags, damageProp.tags
|
multiplier.excludeTags, effectiveTags
|
||||||
).length === 0;
|
).length === 0;
|
||||||
|
|
||||||
return hasRequiredTags && hasNoExcludedTags;
|
return hasRequiredTags && hasNoExcludedTags;
|
||||||
|
|||||||
Reference in New Issue
Block a user