diff --git a/src/Modules/CalcPerform.lua b/src/Modules/CalcPerform.lua index 18083c1007..365ac70dcf 100644 --- a/src/Modules/CalcPerform.lua +++ b/src/Modules/CalcPerform.lua @@ -751,9 +751,21 @@ local function doActorCharges(env, actor) output.PowerChargesMin = m_max(modDB:Sum("BASE", nil, "PowerChargesMin"), 0) output.PowerChargesMax = m_max(modDB:Sum("BASE", nil, "PowerChargesMax"), 0) output.PowerChargesDuration = m_floor(modDB:Sum("BASE", nil, "ChargeDuration") * (1 + modDB:Sum("INC", nil, "PowerChargesDuration", "ChargeDuration") / 100)) + if modDB:Flag(nil, "MaximumFrenzyChargesIsMaximumPowerCharges") then + local source = modDB.mods["MaximumFrenzyChargesIsMaximumPowerCharges"][1].source + if not modDB:HasMod("OVERRIDE", {source = source:match("[^:]+")}, "FrenzyChargesMax") then + modDB:NewMod("FrenzyChargesMax", "OVERRIDE", output.PowerChargesMax, source) + end + end output.FrenzyChargesMin = m_max(modDB:Sum("BASE", nil, "FrenzyChargesMin"), 0) output.FrenzyChargesMax = m_max(modDB:Flag(nil, "MaximumFrenzyChargesIsMaximumPowerCharges") and output.PowerChargesMax or modDB:Sum("BASE", nil, "FrenzyChargesMax"), 0) output.FrenzyChargesDuration = m_floor(modDB:Sum("BASE", nil, "ChargeDuration") * (1 + modDB:Sum("INC", nil, "FrenzyChargesDuration", "ChargeDuration") / 100)) + if modDB:Flag(nil, "MaximumEnduranceChargesIsMaximumFrenzyCharges") then + local source = modDB.mods["MaximumEnduranceChargesIsMaximumFrenzyCharges"][1].source + if not modDB:HasMod("OVERRIDE", {source = source:match("[^:]+")}, "EnduranceChargesMax") then + modDB:NewMod("EnduranceChargesMax", "OVERRIDE", output.FrenzyChargesMax, source) + end + end output.EnduranceChargesMin = m_max(modDB:Sum("BASE", nil, "EnduranceChargesMin"), 0) output.EnduranceChargesMax = m_max(env.partyMembers.modDB:Flag(nil, "PartyMemberMaximumEnduranceChargesEqualToYours") and env.partyMembers.output.EnduranceChargesMax or (modDB:Flag(nil, "MaximumEnduranceChargesIsMaximumFrenzyCharges") and output.FrenzyChargesMax or modDB:Sum("BASE", nil, "EnduranceChargesMax")), 0) output.EnduranceChargesDuration = m_floor(modDB:Sum("BASE", nil, "ChargeDuration") * (1 + modDB:Sum("INC", nil, "EnduranceChargesDuration", "ChargeDuration") / 100))