Skip to content

Commit 1e539f4

Browse files
committed
Add pin buildup
Add data table Clean up code
1 parent 03ccf97 commit 1e539f4

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
@@ -1322,8 +1322,8 @@ c["12% increased Spell Damage if you have consumed an Elemental Infusion Recentl
13221322
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}
13231323
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}
13241324
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}
1325-
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 "}
1326-
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 "}
1325+
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}
1326+
c["12% increased Stun Buildup"]={{[1]={flags=0,keywordFlags=0,name="EnemyStunBuildup",type="INC",value=12}},nil}
13271327
c["12% increased Stun Threshold"]={{[1]={flags=0,keywordFlags=0,name="StunThreshold",type="INC",value=12}},nil}
13281328
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}
13291329
c["12% increased Thorns damage"]={{[1]={flags=0,keywordFlags=0,name="ThornsDamage",type="INC",value=12}},nil}
@@ -1497,7 +1497,7 @@ c["15% increased Melee Damage with Hits at Close Range"]={{[1]={[1]={type="Condi
14971497
c["15% increased Minion Duration"]={{[1]={[1]={skillType=77,type="SkillType"},flags=0,keywordFlags=0,name="Duration",type="INC",value=15}},nil}
14981498
c["15% increased Movement Speed"]={{[1]={flags=0,keywordFlags=0,name="MovementSpeed",type="INC",value=15}},nil}
14991499
c["15% increased Parried Debuff Duration"]={{[1]={flags=0,keywordFlags=0,name="Duration",type="INC",value=15}}," Parried Debuff "}
1500-
c["15% increased Pin Buildup"]={{}," Pin Buildup "}
1500+
c["15% increased Pin Buildup"]={{[1]={flags=0,keywordFlags=0,name="EnemyPinBuildup",type="INC",value=15}},nil}
15011501
c["15% increased Pin duration"]={{[1]={flags=0,keywordFlags=0,name="Duration",type="INC",value=15}}," Pin "}
15021502
c["15% increased Poison Duration"]={{[1]={flags=0,keywordFlags=0,name="EnemyPoisonDuration",type="INC",value=15}},nil}
15031503
c["15% increased Presence Area of Effect"]={{[1]={flags=0,keywordFlags=0,name="PresenceArea",type="INC",value=15}},nil}
@@ -1649,7 +1649,7 @@ c["2% increased Movement Speed"]={{[1]={flags=0,keywordFlags=0,name="MovementSpe
16491649
c["2% increased Movement Speed while Sprinting"]={{[1]={[1]={type="Condition",var="Sprinting"},flags=0,keywordFlags=0,name="MovementSpeed",type="INC",value=2}},nil}
16501650
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 "}
16511651
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}
1652-
c["2% increased Stun Buildup per 10 Tribute"]={{}," Stun Buildup "}
1652+
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}
16531653
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}
16541654
c["2% increased maximum Life"]={{[1]={flags=0,keywordFlags=0,name="Life",type="INC",value=2}},nil}
16551655
c["2% increased maximum Mana"]={{[1]={flags=0,keywordFlags=0,name="Mana",type="INC",value=2}},nil}
@@ -1807,7 +1807,7 @@ c["20% increased Parried Debuff Duration"]={{[1]={flags=0,keywordFlags=0,name="D
18071807
c["20% increased Parry Damage"]={{[1]={[1]={includeTransfigured=true,skillName="Parry",type="SkillName"},flags=0,keywordFlags=0,name="Damage",type="INC",value=20}},nil}
18081808
c["20% increased Parry Range"]={{[1]={[1]={includeTransfigured=true,skillName="Parry",type="SkillName"},flags=0,keywordFlags=0,name="WeaponRange",type="INC",value=20}},nil}
18091809
c["20% increased Physical Damage"]={{[1]={flags=0,keywordFlags=0,name="PhysicalDamage",type="INC",value=20}},nil}
1810-
c["20% increased Pin Buildup"]={{}," Pin Buildup "}
1810+
c["20% increased Pin Buildup"]={{[1]={flags=0,keywordFlags=0,name="EnemyPinBuildup",type="INC",value=20}},nil}
18111811
c["20% increased Pin duration"]={{[1]={flags=0,keywordFlags=0,name="Duration",type="INC",value=20}}," Pin "}
18121812
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 "}
18131813
c["20% increased Poison Duration"]={{[1]={flags=0,keywordFlags=0,name="EnemyPoisonDuration",type="INC",value=20}},nil}
@@ -2279,9 +2279,7 @@ c["30% increased Movement Speed"]={{[1]={flags=0,keywordFlags=0,name="MovementSp
22792279
c["30% increased Parried Debuff Magnitude"]={{}," Parried Debuff Magnitude "}
22802280
c["30% increased Parry Damage"]={{[1]={[1]={includeTransfigured=true,skillName="Parry",type="SkillName"},flags=0,keywordFlags=0,name="Damage",type="INC",value=30}},nil}
22812281
c["30% increased Parry Range"]={{[1]={[1]={includeTransfigured=true,skillName="Parry",type="SkillName"},flags=0,keywordFlags=0,name="WeaponRange",type="INC",value=30}},nil}
2282-
c["30% increased Pin Buildup"]={{}," Pin Buildup "}
2283-
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 "}
2284-
c["30% increased Pin Buildup Bleeding you inflict on Pinned Enemies is Aggravated"]={{}," Pin Buildup Bleeding you inflict on Pinned Enemies is Aggravated "}
2282+
c["30% increased Pin Buildup"]={{[1]={flags=0,keywordFlags=0,name="EnemyPinBuildup",type="INC",value=30}},nil}
22852283
c["30% increased Presence Area of Effect"]={{[1]={flags=0,keywordFlags=0,name="PresenceArea",type="INC",value=30}},nil}
22862284
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}
22872285
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
@@ -4896,14 +4896,8 @@ function calcs.offence(env, actor, activeSkill)
48964896

48974897

48984898
-- Calculate poise-related debuffs
4899-
for _, ailment in ipairs({"Freeze", "Electrocute", "HeavyStun"}) do
4900-
local damageTypes
4901-
if ailment == "HeavyStun" then
4902-
damageTypes = { DamageType = "Physical" }
4903-
else
4904-
damageTypes = data.defaultAilmentDamageTypes[ailment].ScalesFrom
4905-
end
4906-
local hitMin, hitMax, critMin, critMax = calcMinMaxUnmitigatedAilmentSourceDamage(ailment, damageTypes)
4899+
for _, ailment in ipairs({"Freeze", "Electrocute", "HeavyStun", "Pin"}) do
4900+
local hitMin, hitMax, critMin, critMax = calcMinMaxUnmitigatedAilmentSourceDamage(ailment, data.buildupTypes[ailment].ScalesFrom)
49074901
-- TODO: average for now, can do more complicated calculation later
49084902
local hitAvg = hitMin + (hitMax - hitMin) / 2
49094903
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)