Skip to content

Commit 419b53c

Browse files
committed
Support for Voltaxic Rift chaos invert mod
1 parent 3302e9e commit 419b53c

2 files changed

Lines changed: 10 additions & 4 deletions

File tree

src/Modules/CalcOffence.lua

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3262,10 +3262,14 @@ function calcs.offence(env, actor, activeSkill)
32623262
pen = skillModList:Sum("BASE", cfg, "ChaosPenetration")
32633263
end
32643264
end
3265-
local invertChance = m_max(m_min(skillModList:Sum("CHANCE", cfg, "HitsInvertEleResChance"), 1), 0)
3266-
if isElemental[damageType] and invertChance > 0 then
3267-
-- resist = (1 - invertChance) * resist + invertChance * (-1 * resist)
3268-
resist = resist - 2 * invertChance * resist
3265+
local invertChanceEle = m_max(m_min(skillModList:Sum("CHANCE", cfg, "HitsInvertEleResChance"), 1), 0)
3266+
if isElemental[damageType] and invertChanceEle > 0 then
3267+
-- resist = (1 - invertChanceEle) * resist + invertChanceEle * (-1 * resist)
3268+
resist = resist - 2 * invertChanceEle * resist
3269+
end
3270+
local invertChanceChaos = m_max(m_min(skillModList:Sum("CHANCE", cfg, "HitsInvertChaosResChance"), 1), 0)
3271+
if damageType == "Chaos" and invertChanceChaos > 0 then
3272+
resist = resist - 2 * invertChanceChaos * resist
32693273
end
32703274
sourceRes = env.modDB:Flag(nil, "Enemy"..sourceRes.."ResistEqualToYours") and "Your "..sourceRes.." Resistance" or (env.partyMembers.modDB:Flag(nil, "Enemy"..sourceRes.."ResistEqualToYours") and "Party Member "..sourceRes.." Resistance" or sourceRes)
32713275
if skillFlags.projectile then
@@ -3290,6 +3294,7 @@ function calcs.offence(env, actor, activeSkill)
32903294
if env.mode == "CALCS" then
32913295
output[damageType.."EffMult"] = effMult
32923296
end
3297+
local invertChance = (isElemental[damageType] and invertChanceEle) or (damageType == "Chaos" and invertChanceChaos) or 0
32933298
if pass == 2 and breakdown and (effMult ~= 1 or sourceRes ~= damageType) and skillModList:Flag(cfg, isElemental[damageType] and "CannotElePenIgnore" or nil) then
32943299
t_insert(breakdown[damageType], s_format("x %.3f ^8(effective DPS modifier)", effMult))
32953300
breakdown[damageType.."EffMult"] = breakdown.effMult(damageType, resist, 0, takenInc, effMult, takenMore, sourceRes, useRes, invertChance)

src/Modules/ModParser.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3326,6 +3326,7 @@ local specialModList = {
33263326
["critical strikes penetrate (%d+)%% of enemy elemental resistances while affected by zealotry"] = function(num) return { mod("ElementalPenetration", "BASE", num, { type = "Condition", var = "CriticalStrike" }, { type = "Condition", var = "AffectedByZealotry" }) } end,
33273327
["attack critical strikes ignore enemy monster elemental resistances"] = { flag("IgnoreElementalResistances", { type = "Condition", var = "CriticalStrike" }, { type = "SkillType", skillType = SkillType.Attack }) },
33283328
["treats enemy monster elemental resistance values as inverted"] = { mod("HitsInvertEleResChance", "CHANCE", 100, { type = "Condition", var = "{Hand}Attack" }) } ,
3329+
["treats enemy monster chaos resistance values as inverted"] = { mod("HitsInvertChaosResChance", "CHANCE", 100, { type = "Condition", var = "{Hand}Attack" }) },
33293330
["([%+%-]%d+)%% to critical strike multiplier if you've shattered an enemy recently"] = function(num) return { mod("CritMultiplier", "BASE", num, { type = "Condition", var = "ShatteredEnemyRecently" }) } end,
33303331
["(%d+)%% chance to gain a flask charge when you deal a critical strike"] = function(num) return{ mod("FlaskChargeOnCritChance", "BASE", num) } end,
33313332
["gain a flask charge when you deal a critical strike"] = { mod("FlaskChargeOnCritChance", "BASE", 100) },

0 commit comments

Comments
 (0)