Skip to content

Commit f2f98df

Browse files
committed
Add pin buildup
Add data table Clean up code
1 parent a51ff24 commit f2f98df

File tree

4 files changed

+32
-16
lines changed

4 files changed

+32
-16
lines changed

src/Data/ModCache.lua

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1323,8 +1323,8 @@ c["12% increased Spell Damage if you have consumed an Elemental Infusion Recentl
13231323
c["12% increased Spell Damage per 10 Spirit"]={{[1]={[1]={div=10,stat="Spirit",type="PerStat"},flags=2,keywordFlags=0,name="Damage",type="INC",value=12}},nil}
13241324
c["12% increased Spell Damage while on Full Energy Shield"]={{[1]={[1]={type="Condition",var="FullEnergyShield"},flags=2,keywordFlags=0,name="Damage",type="INC",value=12}},nil}
13251325
c["12% increased Spell Damage while wielding a Melee Weapon"]={{[1]={[1]={type="Condition",var="UsingMeleeWeapon"},flags=2,keywordFlags=0,name="Damage",type="INC",value=12}},nil}
1326-
c["12% increased Stun Buildup 10% increased Damage with Maces"]={{[1]={flags=1048580,keywordFlags=0,name="Damage",type="INC",value=12}}," Stun Buildup 10% increased "}
1327-
c["12% increased Stun Buildup Gain additional Stun Threshold equal to 10% of maximum Energy Shield"]={{[1]={flags=0,keywordFlags=0,name="StunThreshold",type="INC",value=12}}," Stun Buildup Gain additional equal to 10% of maximum Energy Shield "}
1326+
c["12% increased Spell Damage with Spells that cost Life"]={{[1]={[1]={stat="LifeCost",threshold=1,type="StatThreshold"},flags=2,keywordFlags=131072,name="Damage",type="INC",value=12}},nil}
1327+
c["12% increased Stun Buildup"]={{[1]={flags=0,keywordFlags=0,name="EnemyStunBuildup",type="INC",value=12}},nil}
13281328
c["12% increased Stun Threshold"]={{[1]={flags=0,keywordFlags=0,name="StunThreshold",type="INC",value=12}},nil}
13291329
c["12% increased Stun Threshold if you haven't been Stunned Recently"]={{[1]={[1]={neg=true,type="Condition",var="StunnedRecently"},flags=0,keywordFlags=0,name="StunThreshold",type="INC",value=12}},nil}
13301330
c["12% increased Thorns damage"]={{[1]={flags=0,keywordFlags=0,name="ThornsDamage",type="INC",value=12}},nil}
@@ -1499,7 +1499,7 @@ c["15% increased Melee Damage with Hits at Close Range"]={{[1]={[1]={type="Condi
14991499
c["15% increased Minion Duration"]={{[1]={[1]={skillType=77,type="SkillType"},flags=0,keywordFlags=0,name="Duration",type="INC",value=15}},nil}
15001500
c["15% increased Movement Speed"]={{[1]={flags=0,keywordFlags=0,name="MovementSpeed",type="INC",value=15}},nil}
15011501
c["15% increased Parried Debuff Duration"]={{[1]={flags=0,keywordFlags=0,name="Duration",type="INC",value=15}}," Parried Debuff "}
1502-
c["15% increased Pin Buildup"]={{}," Pin Buildup "}
1502+
c["15% increased Pin Buildup"]={{[1]={flags=0,keywordFlags=0,name="EnemyPinBuildup",type="INC",value=15}},nil}
15031503
c["15% increased Pin duration"]={{[1]={flags=0,keywordFlags=0,name="Duration",type="INC",value=15}}," Pin "}
15041504
c["15% increased Poison Duration"]={{[1]={flags=0,keywordFlags=0,name="EnemyPoisonDuration",type="INC",value=15}},nil}
15051505
c["15% increased Presence Area of Effect"]={{[1]={flags=0,keywordFlags=0,name="PresenceArea",type="INC",value=15}},nil}
@@ -1650,7 +1650,7 @@ c["2% increased Movement Speed"]={{[1]={flags=0,keywordFlags=0,name="MovementSpe
16501650
c["2% increased Movement Speed while Sprinting"]={{[1]={[1]={type="Condition",var="Sprinting"},flags=0,keywordFlags=0,name="MovementSpeed",type="INC",value=2}},nil}
16511651
c["2% increased Parried Debuff Duration per 10 Tribute"]={{[1]={[1]={actor="parent",div=10,stat="Tribute",type="PerStat"},flags=0,keywordFlags=0,name="Duration",type="INC",value=2}}," Parried Debuff "}
16521652
c["2% increased Spirit per socketed Grand Spectrum"]={{[1]={[1]={type="Multiplier",var="GrandSpectrum"},flags=0,keywordFlags=0,name="Spirit",type="INC",value=2}},nil}
1653-
c["2% increased Stun Buildup per 10 Tribute"]={{}," Stun Buildup "}
1653+
c["2% increased Stun Buildup per 10 Tribute"]={{[1]={[1]={actor="parent",div=10,stat="Tribute",type="PerStat"},flags=0,keywordFlags=0,name="EnemyStunBuildup",type="INC",value=2}},nil}
16541654
c["2% increased Thorns damage per 10 Tribute"]={{[1]={[1]={actor="parent",div=10,stat="Tribute",type="PerStat"},flags=0,keywordFlags=0,name="ThornsDamage",type="INC",value=2}},nil}
16551655
c["2% increased maximum Life"]={{[1]={flags=0,keywordFlags=0,name="Life",type="INC",value=2}},nil}
16561656
c["2% increased maximum Mana"]={{[1]={flags=0,keywordFlags=0,name="Mana",type="INC",value=2}},nil}
@@ -1808,7 +1808,7 @@ c["20% increased Parried Debuff Duration"]={{[1]={flags=0,keywordFlags=0,name="D
18081808
c["20% increased Parry Damage"]={{[1]={[1]={includeTransfigured=true,skillName="Parry",type="SkillName"},flags=0,keywordFlags=0,name="Damage",type="INC",value=20}},nil}
18091809
c["20% increased Parry Range"]={{[1]={[1]={includeTransfigured=true,skillName="Parry",type="SkillName"},flags=0,keywordFlags=0,name="WeaponRange",type="INC",value=20}},nil}
18101810
c["20% increased Physical Damage"]={{[1]={flags=0,keywordFlags=0,name="PhysicalDamage",type="INC",value=20}},nil}
1811-
c["20% increased Pin Buildup"]={{}," Pin Buildup "}
1811+
c["20% increased Pin Buildup"]={{[1]={flags=0,keywordFlags=0,name="EnemyPinBuildup",type="INC",value=20}},nil}
18121812
c["20% increased Pin duration"]={{[1]={flags=0,keywordFlags=0,name="Duration",type="INC",value=20}}," Pin "}
18131813
c["20% increased Pin duration Pinned Enemies cannot deal Critical Hits"]={{[1]={flags=0,keywordFlags=0,name="Duration",type="INC",value=20}}," Pin Pinned Enemies cannot deal Critical Hits "}
18141814
c["20% increased Poison Duration"]={{[1]={flags=0,keywordFlags=0,name="EnemyPoisonDuration",type="INC",value=20}},nil}
@@ -2283,9 +2283,7 @@ c["30% increased Movement Speed"]={{[1]={flags=0,keywordFlags=0,name="MovementSp
22832283
c["30% increased Parried Debuff Magnitude"]={{}," Parried Debuff Magnitude "}
22842284
c["30% increased Parry Damage"]={{[1]={[1]={includeTransfigured=true,skillName="Parry",type="SkillName"},flags=0,keywordFlags=0,name="Damage",type="INC",value=30}},nil}
22852285
c["30% increased Parry Range"]={{[1]={[1]={includeTransfigured=true,skillName="Parry",type="SkillName"},flags=0,keywordFlags=0,name="WeaponRange",type="INC",value=30}},nil}
2286-
c["30% increased Pin Buildup"]={{}," Pin Buildup "}
2287-
c["30% increased Pin Buildup 5% increased Movement Speed if you've Pinned an Enemy Recently"]={{[1]={[1]={type="Condition",var="PinnedEnemyRecently"},flags=0,keywordFlags=0,name="MovementSpeed",type="INC",value=30}}," Pin Buildup 5% increased "}
2288-
c["30% increased Pin Buildup Bleeding you inflict on Pinned Enemies is Aggravated"]={{}," Pin Buildup Bleeding you inflict on Pinned Enemies is Aggravated "}
2286+
c["30% increased Pin Buildup"]={{[1]={flags=0,keywordFlags=0,name="EnemyPinBuildup",type="INC",value=30}},nil}
22892287
c["30% increased Presence Area of Effect"]={{[1]={flags=0,keywordFlags=0,name="PresenceArea",type="INC",value=30}},nil}
22902288
c["30% increased Projectile Damage if you've dealt a Melee Hit in the past eight seconds"]={{[1]={[1]={type="Condition",var="HitMeleeRecently"},flags=1024,keywordFlags=0,name="Damage",type="INC",value=30}},nil}
22912289
c["30% increased Projectile Speed"]={{[1]={flags=0,keywordFlags=0,name="ProjectileSpeed",type="INC",value=30}},nil}

src/Modules/CalcOffence.lua

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4862,14 +4862,8 @@ function calcs.offence(env, actor, activeSkill)
48624862

48634863

48644864
-- Calculate poise-related debuffs
4865-
for _, ailment in ipairs({"Freeze", "Electrocute", "HeavyStun"}) do
4866-
local damageTypes
4867-
if ailment == "HeavyStun" then
4868-
damageTypes = { DamageType = "Physical" }
4869-
else
4870-
damageTypes = data.defaultAilmentDamageTypes[ailment].ScalesFrom
4871-
end
4872-
local hitMin, hitMax, critMin, critMax = calcMinMaxUnmitigatedAilmentSourceDamage(ailment, damageTypes)
4865+
for _, ailment in ipairs({"Freeze", "Electrocute", "HeavyStun", "Pin"}) do
4866+
local hitMin, hitMax, critMin, critMax = calcMinMaxUnmitigatedAilmentSourceDamage(ailment, data.buildupTypes[ailment].ScalesFrom)
48734867
-- TODO: average for now, can do more complicated calculation later
48744868
local hitAvg = hitMin + (hitMax - hitMin) / 2
48754869
local critAvg = critMin + (critMax - critMin) / 2

src/Modules/Data.lua

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,29 @@ data.nonDamagingAilment = {
342342
["Shock"] = { associatedType = "Lightning", alt = false, default = 20, min = 20, max = 100, precision = 0, duration = data.gameConstants["BaseShockDuration"] },
343343
}
344344

345+
data.buildupTypes = {
346+
["Electrocute"] = {
347+
["ScalesFrom"] = {
348+
["Lightning"] = true,
349+
}
350+
},
351+
["Freeze"] = {
352+
["ScalesFrom"] = {
353+
["Cold"] = true,
354+
}
355+
},
356+
["HeavyStun"] = {
357+
["ScalesFrom"] = {
358+
["Physical"] = true,
359+
}
360+
},
361+
["Pin"] = {
362+
["ScalesFrom"] = {
363+
["Physical"] = true,
364+
}
365+
},
366+
}
367+
345368
data.defaultAilmentDamageTypes = {
346369
-- damaging
347370
["Bleed"] = {

src/Modules/ModParser.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -838,6 +838,7 @@ local modNameList = {
838838
["electrocute buildup"] = "EnemyElectrocuteBuildup",
839839
["stun buildup"] = "EnemyStunBuildup",
840840
["freeze buildup"] = "EnemyFreezeBuildup",
841+
["pin buildup"] = "EnemyPinBuildup",
841842
-- Misc modifiers
842843
["movement speed"] = "MovementSpeed",
843844
["attack, cast and movement speed"] = { "Speed", "MovementSpeed" },

0 commit comments

Comments
 (0)