diff --git a/src/Modules/CalcPerform.lua b/src/Modules/CalcPerform.lua index b9bc986004..8394123f3b 100644 --- a/src/Modules/CalcPerform.lua +++ b/src/Modules/CalcPerform.lua @@ -365,6 +365,20 @@ local function doActorAttribsConditions(env, actor) modDB:NewMod("StunThreshold", "INC", 50, "Wyvern Form") modDB:NewMod("AilmentThreshold", "INC", 50, "Wyvern Form") end + -- Demon Form is a toggled shapeshift buff applied via the inDemonForm config option; flag its + -- presence so those config-applied Shapeshifted/DemonForm conditions only take effect on builds + -- that actually have the Demon Form skill. + for _, activeSkill in ipairs(actor.activeSkillList or { }) do + local activeEffect = activeSkill.activeEffect + local grantedEffect = activeEffect and activeEffect.grantedEffect + if grantedEffect and grantedEffect.name == "Demon Form" then + local statSet = env.mode == "CALCS" and activeEffect.statSetCalcs or activeEffect.statSet + if not (statSet and statSet.skillFlags.disable) then + condList["HaveDemonForm"] = true + break + end + end + end if skillFlags.hit and not skillFlags.trap and not skillFlags.mine and not skillFlags.totem then condList["HitRecently"] = true if skillFlags.spell then diff --git a/src/Modules/ConfigOptions.lua b/src/Modules/ConfigOptions.lua index fa9f3beb03..a897c56758 100644 --- a/src/Modules/ConfigOptions.lua +++ b/src/Modules/ConfigOptions.lua @@ -342,8 +342,12 @@ local configSettings = { end }, { label = "Demon Form:", ifSkill = "Demon Form" }, { var = "inDemonForm", type = "check", label = "Are you in Demon Form?", ifSkill = "Demon Form", defaultState = true, tooltip = "Players need a minimum of 2 ^xE05030Life ^7to enter Demon Form, so you cannot use it with Chaos Inoculation", apply = function(val, modList, enemyModList) - modList:NewMod("Condition:Shapeshifted", "FLAG", true, "Config") - modList:NewMod("Condition:DemonForm", "FLAG", true, "Config", { type = "StatThreshold", stat = "Life", threshold = 2 }) + -- Gate on HaveDemonForm (set in CalcPerform when the Demon Form skill is present). ifSkill only + -- hides the UI control, not this apply(), and defaultState is true, so without a gate these would + -- grant Condition:Shapeshifted (an untagged global flag) on every build, making all + -- "while Shapeshifted" modifiers apply. + modList:NewMod("Condition:Shapeshifted", "FLAG", true, "Config", { type = "Condition", var = "HaveDemonForm" }, { type = "StatThreshold", stat = "Life", threshold = 2 }) + modList:NewMod("Condition:DemonForm", "FLAG", true, "Config", { type = "Condition", var = "HaveDemonForm" }, { type = "StatThreshold", stat = "Life", threshold = 2 }) end }, { var = "demonFormStacks", type = "count", label = "Demonflame Stacks", ifSkill = "Demon Form", defaultPlaceholderState = 10, apply = function(val, modList, enemyModList) modList:NewMod("Multiplier:DemonFlameStacks", "BASE", val, "Config", { type = "Condition", var = "DemonForm" } )