Skip to content

Commit c559173

Browse files
Rework Cryogenesis to use ConvertMod, match 3.28 tree wording
ModParser entries now match the actual 3.28 tree text instead of guessed wording. Handles the "Lighting" typo with a pattern. CalcOffence uses ConvertMod to redirect added damage mods before the damage loop so breakdowns show the source properly. Base Elemental Hit is excluded per the node text. Added ConvertMod to ModStore/ModList/ModDB - like ReplaceMod but matches by oldName so it can change a mod's identity.
1 parent 2289e9f commit c559173

2 files changed

Lines changed: 28 additions & 20 deletions

File tree

src/Modules/CalcOffence.lua

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3048,35 +3048,42 @@ function calcs.offence(env, actor, activeSkill)
30483048

30493049
runSkillFunc("postCritFunc")
30503050

3051-
-- Check for added damage redirection (Cryogenesis)
3051+
-- Added damage redirection (Cryogenesis)
3052+
-- Convert all added damage mods to the target type before the damage loop
3053+
-- so breakdowns show the redirected source correctly.
3054+
-- Base Elemental Hit is excluded per the node text.
30523055
local addedDamageRedirectType = nil
30533056
if skillModList:Flag(cfg, "AllAddedDamageAsLightning") then
30543057
addedDamageRedirectType = "Lightning"
30553058
elseif skillModList:Flag(cfg, "AllAddedDamageAsCold") then
30563059
addedDamageRedirectType = "Cold"
30573060
end
3061+
if addedDamageRedirectType then
3062+
local skipRedirect = activeSkill.activeEffect.grantedEffect.name == "Elemental Hit"
3063+
if not skipRedirect then
3064+
for _, damageType in ipairs(dmgTypeList) do
3065+
if damageType ~= addedDamageRedirectType then
3066+
for _, value in ipairs(skillModList:Tabulate("BASE", cfg, damageType.."Min")) do
3067+
local mod = value.mod
3068+
skillModList:ConvertMod(damageType.."Min", addedDamageRedirectType.."Min", "BASE", mod.value, mod.source, mod.flags, mod.keywordFlags, unpack(mod))
3069+
end
3070+
for _, value in ipairs(skillModList:Tabulate("BASE", cfg, damageType.."Max")) do
3071+
local mod = value.mod
3072+
skillModList:ConvertMod(damageType.."Max", addedDamageRedirectType.."Max", "BASE", mod.value, mod.source, mod.flags, mod.keywordFlags, unpack(mod))
3073+
end
3074+
end
3075+
end
3076+
end
3077+
end
30583078

30593079
-- Calculate base hit damage
30603080
for _, damageType in ipairs(dmgTypeList) do
30613081
local damageTypeMin = damageType.."Min"
30623082
local damageTypeMax = damageType.."Max"
30633083
local baseMultiplier = activeSkill.activeEffect.grantedEffectLevel.baseMultiplier or skillData.baseMultiplier or 1
30643084
local damageEffectiveness = activeSkill.activeEffect.grantedEffectLevel.damageEffectiveness or skillData.damageEffectiveness or 1
3065-
local addedMin, addedMax
3066-
if addedDamageRedirectType then
3067-
if damageType == addedDamageRedirectType then
3068-
addedMin, addedMax = 0, 0
3069-
for _, srcType in ipairs(dmgTypeList) do
3070-
addedMin = addedMin + skillModList:Sum("BASE", cfg, srcType.."Min") + enemyDB:Sum("BASE", cfg, "Self"..srcType.."Min")
3071-
addedMax = addedMax + skillModList:Sum("BASE", cfg, srcType.."Max") + enemyDB:Sum("BASE", cfg, "Self"..srcType.."Max")
3072-
end
3073-
else
3074-
addedMin, addedMax = 0, 0
3075-
end
3076-
else
3077-
addedMin = skillModList:Sum("BASE", cfg, damageTypeMin) + enemyDB:Sum("BASE", cfg, "Self"..damageTypeMin)
3078-
addedMax = skillModList:Sum("BASE", cfg, damageTypeMax) + enemyDB:Sum("BASE", cfg, "Self"..damageTypeMax)
3079-
end
3085+
local addedMin = skillModList:Sum("BASE", cfg, damageTypeMin) + enemyDB:Sum("BASE", cfg, "Self"..damageTypeMin)
3086+
local addedMax = skillModList:Sum("BASE", cfg, damageTypeMax) + enemyDB:Sum("BASE", cfg, "Self"..damageTypeMax)
30803087
local addedMult = calcLib.mod(skillModList, cfg, "Added"..damageType.."Damage", "AddedDamage")
30813088
local baseMin = ((source[damageTypeMin] or 0) + (source[damageType.."BonusMin"] or 0)) * baseMultiplier + addedMin * damageEffectiveness * addedMult
30823089
local baseMax = ((source[damageTypeMax] or 0) + (source[damageType.."BonusMax"] or 0)) * baseMultiplier + addedMax * damageEffectiveness * addedMult

src/Modules/ModParser.lua

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5286,12 +5286,13 @@ local specialModList = {
52865286
["consecrated path and purifying flame create profane ground instead of consecrated ground"] = {
52875287
flag("Condition:CreateProfaneGround"),
52885288
},
5289-
["if intelligence is your single highest attribute, all added damage is treated as added lightning damage"] = {
5290-
flag("AllAddedDamageAsLightning", { type = "Condition", var = "IntSingleHighestAttribute" }),
5291-
},
5292-
["if dexterity is your single highest attribute, all added damage is treated as added cold damage"] = {
5289+
["you gain added cold damage instead of added damage of other types if dexterity exceeds both other attributes"] = {
52935290
flag("AllAddedDamageAsCold", { type = "Condition", var = "DexSingleHighestAttribute" }),
52945291
},
5292+
["you gain added lightn?ing damage instead of added damage of other types if intelligence exceeds both other attributes"] = {
5293+
flag("AllAddedDamageAsLightning", { type = "Condition", var = "IntSingleHighestAttribute" }),
5294+
},
5295+
["elemental hit's added damage cannot be replaced this way"] = { },
52955296
["you have consecrated ground around you while stationary if strength is your highest attribute"] = {
52965297
flag("Condition:OnConsecratedGround", { type = "Condition", var = "StrHighestAttribute" }, { type = "Condition", var = "Stationary" }),
52975298
},

0 commit comments

Comments
 (0)