Skip to content

Commit

Permalink
Add support for Storm Secret self damage calculation
Browse files Browse the repository at this point in the history
Adds support for the self damage calculated when a Herald of Thunder Storm hits an enemy
  • Loading branch information
LocalIdentity committed Aug 30, 2024
1 parent 31d6bc5 commit 0c3c2e8
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Data/ModCache.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11151,7 +11151,7 @@ c["Take 200 Physical Damage when you use a Movement Skill"]={{[1]={flags=0,keywo
c["Take 200 Physical Damage when you use a Movement Skill You have no Armour or Maximum Energy Shield"]={{[1]={flags=0,keywordFlags=0,name="PhysicalDamageTaken",type="BASE",value=200}}," when you use a Movement Skill You have no Armour or Maximum Energy Shield "}
c["Take 25% less Damage"]={{[1]={flags=0,keywordFlags=0,name="DamageTaken",type="MORE",value=-25}},nil}
c["Take 250 Chaos Damage per Second during Effect"]={{[1]={[1]={type="Condition",var="UsingFlask"},flags=0,keywordFlags=0,name="ChaosDegen",type="BASE",value=250}},nil}
c["Take 250 Lightning Damage when Herald of Thunder Hits an Enemy"]={{[1]={[1]={includeTransfigured=true,skillName="Herald of Thunder",type="SkillName"},flags=0,keywordFlags=0,name="LightningDamageTaken",type="BASE",value=250}}," whenHits an Enemy "}
c["Take 250 Lightning Damage when Herald of Thunder Hits an Enemy"]={{[1]={flags=0,keywordFlags=0,name="StormSecretSelfDamage",type="LIST",value={baseDamage=250,damageType="lightning"}}},nil}
c["Take 30 Chaos Damage per Second during Effect"]={{[1]={[1]={type="Condition",var="UsingFlask"},flags=0,keywordFlags=0,name="ChaosDegen",type="BASE",value=30}},nil}
c["Take 300 Chaos Damage per Second during Effect"]={{[1]={[1]={type="Condition",var="UsingFlask"},flags=0,keywordFlags=0,name="ChaosDegen",type="BASE",value=300}},nil}
c["Take 40% less Damage from Hits for 5 seconds"]={{[1]={[1]={type="Condition",var="HeartstopperHIT"},flags=0,keywordFlags=0,name="DamageTakenWhenHit",type="MORE",value=-40},[2]={[1]={type="Condition",var="HeartstopperAVERAGE"},flags=0,keywordFlags=0,name="DamageTakenWhenHit",type="MORE",value=-20}},nil}
Expand Down
14 changes: 14 additions & 0 deletions src/Modules/CalcOffence.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5301,6 +5301,20 @@ function calcs.offence(env, actor, activeSkill)
return dmgBreakdown, totalDmgTaken * output.SummonedMinionsPerCast
end
end,
["Storm Secret"] = function(activeSkill, output, breakdown)
local dmgType, dmgVal
for _, value in ipairs(activeSkill.skillModList:List(nil, "StormSecretSelfDamage")) do -- Combines dmg taken from both rings accounting for catalysts
dmgVal = (dmgVal or 0) + value.baseDamage
dmgType = string.gsub(" "..value.damageType, "%W%l", string.upper):sub(2) -- This assumes both rings deal the same damage type
end
if activeSkill.activeEffect.grantedEffect.name == "Herald of Thunder" and dmgType and dmgVal then

This comment has been minimized.

Copy link
@Regisle

Regisle Aug 30, 2024

Member

Should probably have the if activeSkill.activeEffect.grantedEffect.name == "Herald of Thunder" check at the start of the function so that it doesnt need to make/loop through the base damage list if its not herald of thunder, but its a minor issue.

This comment has been minimized.

Copy link
@LocalIdentity

LocalIdentity Aug 30, 2024

Contributor

I was thinking about that. Should probs change it for Heartbound Loop too then as it also suffers from the same issue

local dmgBreakdown, totalDmgTaken = calcs.applyDmgTakenConversion(activeSkill, output, breakdown, dmgType, dmgVal)
t_insert(dmgBreakdown, 1, s_format("Storm Secret base damage: %d", dmgVal))
t_insert(dmgBreakdown, 2, s_format(""))
t_insert(dmgBreakdown, s_format("Total Storm Secret damage taken per Herald of Thunder Hit: %.2f",totalDmgTaken))
return dmgBreakdown, totalDmgTaken
end
end,
["Eye of Innocence"] = function(activeSkill, output, breakdown)
local dmgType, dmgVal
for _, value in ipairs(activeSkill.skillModList:List(nil, "EyeOfInnocenceSelfDamage")) do
Expand Down
3 changes: 3 additions & 0 deletions src/Modules/ModParser.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2860,6 +2860,9 @@ local specialModList = {
["(%d+) (.+) damage taken on minion death"] = function(dmg, _, dmgType) return {
mod("HeartboundLoopSelfDamage", "LIST", {baseDamage = dmg, damageType = dmgType})
}end,
["take (%d+) (.+) damage when herald of thunder hits an enemy"] = function(dmg, _, dmgType) return {
mod("StormSecretSelfDamage", "LIST", {baseDamage = dmg, damageType = dmgType})
}end,
["your skills deal you (%d+)%% of mana cost as (.+) damage"] = function(dmgMult, _, dmgType) return {
mod("ScoldsBridleSelfDamage", "LIST", {dmgMult = dmgMult, damageType = dmgType})
}end,
Expand Down

0 comments on commit 0c3c2e8

Please sign in to comment.