Skip to content

Commit

Permalink
update against damage over time to apply the modFlag directly (#6805)
Browse files Browse the repository at this point in the history
  • Loading branch information
Regisle authored Dec 1, 2023

Verified

This commit was signed with the committer’s verified signature.
simeonschaub Simeon David Schaub
1 parent 53cd1b7 commit 6eea10d
Showing 4 changed files with 12 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/Data/ModCache.lua
Original file line number Diff line number Diff line change
@@ -856,7 +856,7 @@ c["+30 to maximum Mana"]={{[1]={flags=0,keywordFlags=0,name="Mana",type="BASE",v
c["+30 to maximum Mana per Allocated Journey Tattoo of the Mind"]={{[1]={[1]={type="Multiplier",var="JourneyTattooMind"},flags=0,keywordFlags=0,name="Mana",type="BASE",value=30},[2]={flags=0,keywordFlags=0,name="Multiplier:JourneyTattooMind",type="BASE",value=1}},nil}
c["+30% Chance to Block Spell Damage during Effect"]={{[1]={[1]={type="Condition",var="UsingFlask"},flags=0,keywordFlags=0,name="SpellBlockChance",type="BASE",value=30}},nil}
c["+30% Chance to Block Spell Damage while on Low Life"]={{[1]={[1]={type="Condition",var="LowLife"},flags=0,keywordFlags=0,name="SpellBlockChance",type="BASE",value=30}},nil}
c["+30% Chaos Resistance against Damage Over Time"]={{[1]={[1]={type="Condition",varList={[1]="AgainstDamageOverTime"}},flags=0,keywordFlags=0,name="ChaosResist",type="BASE",value=30}},nil}
c["+30% Chaos Resistance against Damage Over Time"]={{[1]={flags=8,keywordFlags=0,name="ChaosResist",type="BASE",value=30}},nil}
c["+30% to Brand Critical Strike Multiplier"]={{[1]={[1]={skillType=75,type="SkillType"},flags=0,keywordFlags=0,name="CritMultiplier",type="BASE",value=30}},nil}
c["+30% to Chaos Resistance"]={{[1]={flags=0,keywordFlags=0,name="ChaosResist",type="BASE",value=30}},nil}
c["+30% to Chaos Resistance while stationary"]={{[1]={[1]={type="Condition",var="Stationary"},flags=0,keywordFlags=0,name="ChaosResist",type="BASE",value=30}},nil}
@@ -8944,7 +8944,7 @@ c["Nearby Enemies' Chaos Resistance is 0"]={{[1]={flags=0,keywordFlags=0,name="E
c["Nearby Enemy Monsters have at least 8% of Life Reserved"]={{[1]={flags=0,keywordFlags=0,name="EnemyModifier",type="LIST",value={mod={flags=0,keywordFlags=0,name="LifeReservationPercent",type="BASE",value=8}}}},nil}
c["Nearby Enemy Monsters' Action Speed is at most 92% of base value"]={{[1]={flags=0,keywordFlags=0,name="EnemyModifier",type="LIST",value={mod={flags=0,keywordFlags=0,name="MaximumActionSpeedReduction",type="MAX",value=8}}}},nil}
c["Nearby Enemy Monsters' Fire Resistance against"]={nil,"Fire Resistance against "}
c["Nearby Enemy Monsters' Fire Resistance against Damage over Time is -20% while you are Stationary"]={{[1]={flags=0,keywordFlags=0,name="EnemyModifier",type="LIST",value={mod={[1]={type="Condition",varList={[1]="AgainstDamageOverTime"}},[2]={actor="player",type="ActorCondition",var="Stationary"},flags=0,keywordFlags=0,name="FireResist",type="OVERRIDE",value=-20}}}},nil}
c["Nearby Enemy Monsters' Fire Resistance against Damage over Time is -20% while you are Stationary"]={{[1]={flags=0,keywordFlags=0,name="EnemyModifier",type="LIST",value={mod={[1]={actor="player",type="ActorCondition",var="Stationary"},flags=8,keywordFlags=0,name="FireResist",type="OVERRIDE",value=-20}}}},nil}
c["Nearby Hindered Enemies deal 15% reduced Damage over Time"]={{[1]={[1]={actor="enemy",type="ActorCondition",var="Hindered"},flags=0,keywordFlags=0,name="EnemyModifier",type="LIST",value={mod={flags=0,keywordFlags=0,name="DamageOverTime",type="INC",value=-15}}}},nil}
c["Nearby allies Recover 1% of your Maximum Life when you Die"]={nil,"Nearby allies Recover 1% of your Maximum Life when you Die "}
c["Nearby allies Recover 2% of your Maximum Life when you Die"]={nil,"Nearby allies Recover 2% of your Maximum Life when you Die "}
12 changes: 9 additions & 3 deletions src/Modules/CalcDefence.lua
Original file line number Diff line number Diff line change
@@ -355,15 +355,18 @@ function calcs.defence(env, actor)
end

for _, elem in ipairs(resistTypeList) do
local min, max, total, totemTotal, totemMax
local min, max, total, dotTotal, totemTotal, totemMax
min = data.misc.ResistFloor
max = modDB:Override(nil, elem.."ResistMax") or m_min(data.misc.MaxResistCap, modDB:Sum("BASE", nil, elem.."ResistMax", isElemental[elem] and "ElementalResistMax"))
total = modDB:Override(nil, elem.."Resist")
totemMax = modDB:Override(nil, "Totem"..elem.."ResistMax") or m_min(data.misc.MaxResistCap, modDB:Sum("BASE", nil, "Totem"..elem.."ResistMax", isElemental[elem] and "TotemElementalResistMax"))
totemTotal = modDB:Override(nil, "Totem"..elem.."Resist")
if not total then
local base = modDB:Sum("BASE", nil, elem.."Resist", isElemental[elem] and "ElementalResist")
total = base * m_max(calcLib.mod(modDB, nil, elem.."Resist", isElemental[elem] and "ElementalResist"), 0)
local inc = m_max(calcLib.mod(modDB, nil, elem.."Resist", isElemental[elem] and "ElementalResist"), 0)
total = base * inc
local dotBase = modDB:Sum("BASE", { flags = ModFlag.Dot, keywordFlags = 0 }, elem.."Resist", isElemental[elem] and "ElementalResist")
dotTotal = dotBase * inc
end
if not totemTotal then
local base = modDB:Sum("BASE", nil, "Totem"..elem.."Resist", isElemental[elem] and "TotemElementalResist")
@@ -372,19 +375,22 @@ function calcs.defence(env, actor)

-- Fractional resistances are truncated
total = m_modf(total)
dotTotal = dotTotal and m_modf(dotTotal) or total
totemTotal = m_modf(totemTotal)
min = m_modf(min)
max = m_modf(max)
totemMax = m_modf(totemMax)

local final = m_max(m_min(total, max), min)
local dotFinal = m_max(m_min(dotTotal, max), min)
local totemFinal = m_max(m_min(totemTotal, totemMax), min)

output[elem.."Resist"] = final
output[elem.."ResistTotal"] = total
output[elem.."ResistOverCap"] = m_max(0, total - max)
output[elem.."ResistOver75"] = m_max(0, final - 75)
output["Missing"..elem.."Resist"] = m_max(0, max - final)
output[elem.."ResistOverTime"] = dotFinal
output["Totem"..elem.."Resist"] = totemFinal
output["Totem"..elem.."ResistTotal"] = totemTotal
output["Totem"..elem.."ResistOverCap"] = m_max(0, totemTotal - totemMax)
@@ -1507,7 +1513,7 @@ function calcs.buildDefenceEstimations(env, actor)
takenInc = takenInc + modDB:Sum("INC", nil, "ElementalDamageTakenOverTime")
takenMore = takenMore * modDB:More(nil, "ElementalDamageTakenOverTime")
end
local resist = modDB:Flag(nil, "SelfIgnore"..damageType.."Resistance") and 0 or output[damageType.."Resist"]
local resist = modDB:Flag(nil, "SelfIgnore"..damageType.."Resistance") and 0 or output[damageType.."ResistOverTime"] or output[damageType.."Resist"]
local reduction = modDB:Flag(nil, "SelfIgnore".."Base"..damageType.."DamageReduction") and 0 or output["Base"..damageType.."DamageReduction"]
output[damageType.."TakenDotMult"] = m_max((1 - resist / 100) * (1 - reduction / 100) * (1 + takenInc / 100) * takenMore, 0)
if breakdown then
3 changes: 0 additions & 3 deletions src/Modules/ConfigOptions.lua
Original file line number Diff line number Diff line change
@@ -979,9 +979,6 @@ Huge sets the radius to 11.
{ var = "multiplierPoisonOnSelf", type = "count", label = "# of Poison on You:", ifMult = "PoisonStack", implyCond = "Poisoned", tooltip = "This also implies that you are Poisoned.", apply = function(val, modList, enemyModList)
modList:NewMod("Multiplier:PoisonStack", "BASE", val, "Config", { type = "Condition", var = "Effective" })
end },
{ var = "conditionAgainstDamageOverTime", type = "check", label = "Are you against Damage over Time?", ifCond = "AgainstDamageOverTime", apply = function(val, modList, enemyModList)
modList:NewMod("Condition:AgainstDamageOverTime", "FLAG", true, "Config", { type = "Condition", var = "Combat" })
end },
{ var = "multiplierWitheredStackCountSelf", type = "countAllowZero", label = "# of Withered Stacks on you:", ifFlag = "Condition:CanBeWithered", tooltip = "Withered applies 6% increased ^xD02090Chaos ^7Damage Taken to the self, up to 15 stacks.", defaultPlaceholderState = 15, apply = function(val, modList, enemyModList)
modList:NewMod("Multiplier:WitheredStack", "BASE", val, "Config", { type = "Condition", var = "Effective" })
end },
2 changes: 1 addition & 1 deletion src/Modules/ModParser.lua
Original file line number Diff line number Diff line change
@@ -864,6 +864,7 @@ local modFlagList = {
["for poison"] = { keywordFlags = bor(KeywordFlag.Poison, KeywordFlag.MatchAll) },
["for bleeding"] = { keywordFlags = KeywordFlag.Bleed },
["for ignite"] = { keywordFlags = KeywordFlag.Ignite },
["against damage over time"] = { flags = ModFlag.Dot },
["area"] = { flags = ModFlag.Area },
["mine"] = { keywordFlags = KeywordFlag.Mine },
["with mines"] = { keywordFlags = KeywordFlag.Mine },
@@ -1544,7 +1545,6 @@ local modTagList = {
["while you are poisoned"] = { tag = { type = "Condition", var = "Poisoned" } },
["while cursed"] = { tag = { type = "Condition", var = "Cursed" } },
["while not cursed"] = { tag = { type = "Condition", var = "Cursed", neg = true } },
["against damage over time"] = { tag = { type = "Condition", varList = { "AgainstDamageOverTime" } } },
["while there is only one nearby enemy"] = { tagList = { { type = "Multiplier", var = "NearbyEnemies", limit = 1 }, { type = "Condition", var = "OnlyOneNearbyEnemy" } } },
["while t?h?e?r?e? ?i?s? ?a rare or unique enemy i?s? ?nearby"] = { tag = { type = "ActorCondition", actor = "enemy", varList = { "NearbyRareOrUniqueEnemy", "RareOrUnique" } } },
["if you[' ]h?a?ve hit recently"] = { tag = { type = "Condition", var = "HitRecently" } },

0 comments on commit 6eea10d

Please sign in to comment.