Skip to content

Commit 57cedf5

Browse files
PeecheyLocalIdentity
andauthored
Fix calculations for skills that can repeat (#9723)
* update Fatal Flourish parsing to ignore Travel and Retaliation skills * update for Channel, Instant, and Triggered skills * add skillTypeCheck to repeats logic in CalcOffence * update to allow traps and mines, fix dps and cost for traps and mines * fix damage to be 160 more, fix Ranged Attacks like Ice Shot or Kinetic Blast * fix var usage * Fixes More generic handling for skills that can't repeat Support skill stat for cannot repeat Add DPS multiplier for traps and mines that can repeat spells / attacks Fix parsing of mods in modparser --------- Co-authored-by: LocalIdentity <localidentity2@gmail.com>
1 parent fc1e5be commit 57cedf5

File tree

4 files changed

+22
-7
lines changed

4 files changed

+22
-7
lines changed

src/Data/ModCache.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8539,7 +8539,7 @@ c["Exposure you inflict applies an extra -6% to the affected Resistance"]={{[1]=
85398539
c["Exposure you inflict applies at least -18% to the affected Resistance"]={{[1]={flags=0,keywordFlags=0,name="ExposureMin",type="OVERRIDE",value=-18}},nil}
85408540
c["Extra gore"]={{},nil}
85418541
c["Far Shot"]={{[1]={flags=0,keywordFlags=0,name="FarShot",type="FLAG",value=true}},nil}
8542-
c["Final Repeat of Attack Skills deals 60% more Damage"]={{[1]={flags=1,keywordFlags=0,name="RepeatFinalDamage",type="MORE",value=60}},nil}
8542+
c["Final Repeat of Attack Skills deals 60% more Damage"]={{[1]={flags=0,keywordFlags=65536,name="RepeatFinalDamage",type="MORE",value=60}},nil}
85438543
c["Final Repeat of Spells has 40% increased Area of Effect"]={{[1]={[1]={neg=true,type="Condition",var="CastOnFrostbolt"},[2]={type="Condition",varList={[1]="averageRepeat",[2]="alwaysFinalRepeat"}},flags=2,keywordFlags=0,name="RepeatFinalAreaOfEffect",type="INC",value=40}},nil}
85448544
c["Fire Exposure you inflict applies an extra -5% to Fire Resistance"]={{[1]={flags=0,keywordFlags=0,name="ExtraFireExposure",type="BASE",value=-5}},nil}
85458545
c["Fire Resistance is 75%"]={{[1]={flags=0,keywordFlags=0,name="FireResist",type="OVERRIDE",value=75}},nil}
@@ -10213,7 +10213,7 @@ c["Non-Damaging Elemental Ailments you inflict spread to nearby enemies within 2
1021310213
c["Non-Damaging Elemental Ailments you inflict spread to nearby enemies within 2 metres Non-Damaging Elemental Ailments you inflict have 100% more Effect"]={nil,"Non-Damaging Elemental Ailments you inflict spread to nearby enemies within 2 metres Non-Damaging Elemental Ailments you inflict have 100% more Effect "}
1021410214
c["Non-Exerted Attacks deal no Damage"]={nil,"Non-Exerted Attacks deal no Damage "}
1021510215
c["Non-Instant Warcries ignore their Cooldown when Used"]={{[1]={[1]={neg=true,skillType=74,type="SkillType"},flags=0,keywordFlags=4,name="CooldownRecovery",type="OVERRIDE",value=0}},nil}
10216-
c["Non-Travel Attack Skills Repeat an additional Time"]={{[1]={[1]={type="Condition",varList={[1]="averageRepeat",[2]="alwaysFinalRepeat"}},flags=1,keywordFlags=0,name="RepeatCount",type="BASE",value=1}},nil}
10216+
c["Non-Travel Attack Skills Repeat an additional Time"]={{[1]={[1]={neg=true,skillType=90,type="SkillType"},[2]={type="Condition",varList={[1]="averageRepeat",[2]="alwaysFinalRepeat"}},flags=0,keywordFlags=65536,name="RepeatCount",type="BASE",value=1}},nil}
1021710217
c["Non-Unique Jewels cause Small and Notable Passive Skills in a Large Radius to"]={nil,"Non-Unique Jewels cause Small and Notable Passive Skills in a Large Radius to "}
1021810218
c["Non-Unique Utility Flasks you Use apply to Linked Targets"]={{[1]={flags=0,keywordFlags=0,name="ExtraLinkEffect",type="LIST",value={mod={[1]={effectType="Global",type="GlobalEffect",unscalable=true},flags=0,keywordFlags=0,name="ParentNonUniqueFlasksAppliedToYou",type="FLAG",value=true}}}},nil}
1021910219
c["Non-Vaal Strike Skills target 1 additional nearby Enemy"]={{[1]={[1]={skillType=25,type="SkillType"},[2]={neg=true,skillType=42,type="SkillType"},flags=0,keywordFlags=0,name="AdditionalStrikeTarget",type="BASE",value=1}},nil}

src/Data/SkillStatMap.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,9 @@ return {
295295
["skill_repeat_count"] = {
296296
mod("RepeatCount", "BASE", nil, 0, 0, { type = "SkillType", skillType = SkillType.Multicastable }),
297297
},
298+
["disable_skill_repeats"] = {
299+
flag("CannotRepeat"),
300+
},
298301
["display_skill_minions_level_is_corpse_level"] = {
299302
skill("minionLevelIsEnemyLevel", true),
300303
},

src/Modules/CalcOffence.lua

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -759,7 +759,17 @@ function calcs.offence(env, actor, activeSkill)
759759
-- Applies DPS multiplier based on projectile count
760760
skillData.dpsMultiplier = skillModList:Sum("BASE", skillCfg, "ProjectileCount")
761761
end
762-
output.Repeats = 1 + (skillModList:Sum("BASE", skillCfg, "RepeatCount") or 0)
762+
763+
local function repeatSkillTypesCheck(activeSkillTypes)
764+
local excludeSkillTypes = { SkillType.Instant, SkillType.Channel, SkillType.Triggered, SkillType.Retaliation, SkillType.NonRepeatable }
765+
for _, type in ipairs(excludeSkillTypes) do
766+
if activeSkillTypes[type] then
767+
return false
768+
end
769+
end
770+
return not skillModList:Flag(nil, "CannotRepeat") and ((activeSkillTypes[SkillType.Attack] or activeSkillTypes[SkillType.Spell]))
771+
end
772+
output.Repeats = 1 + (repeatSkillTypesCheck(activeSkill.skillTypes) and skillModList:Sum("BASE", skillCfg, "RepeatCount") or 0)
763773
if output.Repeats > 1 then
764774
output.RepeatCount = output.Repeats
765775
-- handle all the multipliers from Repeats
@@ -842,6 +852,9 @@ function calcs.offence(env, actor, activeSkill)
842852
skillModList:NewMod("Damage", "MORE", (100 * output.Repeats + DamageFinalMoreValueTotal) / (1 + DamageFinalMoreValueTotal / 100) - 100, value.mod.source, value.mod.flags, value.mod.keywordFlags, unpack(value.mod))
843853
end
844854
end
855+
if skillFlags.trap or skillFlags.mine then
856+
skillModList:NewMod("DPS", "MORE", (output.Repeats - 1) * 100, "Repeat Count")
857+
end
845858
end
846859
end
847860
if skillModList:Flag(nil, "WeaponPhysAppliesToSpells") then
@@ -5618,7 +5631,7 @@ function calcs.offence(env, actor, activeSkill)
56185631
if skillFlags.trap or skillFlags.mine then
56195632
local preSpeed = output.TrapThrowingSpeed or output.MineLayingSpeed
56205633
local cooldown = output.TrapCooldown or output.Cooldown
5621-
useSpeed = (cooldown and cooldown > 0 and 1 / cooldown or preSpeed) / repeats
5634+
useSpeed = (cooldown and cooldown > 0 and 1 / cooldown or preSpeed)
56225635
timeType = skillFlags.trap and "trap throwing" or "mine laying"
56235636
elseif skillFlags.totem then
56245637
useSpeed = (output.Cooldown and output.Cooldown > 0 and (output.TotemPlacementSpeed > 0 and output.TotemPlacementSpeed or 1 / output.Cooldown) or output.TotemPlacementSpeed) / repeats

src/Modules/ModParser.lua

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2399,9 +2399,6 @@ local specialModList = {
23992399
-- Exerted Attacks
24002400
["exerted attacks deal (%d+)%% increased damage"] = function(num) return { mod("ExertIncrease", "INC", num, nil, ModFlag.Attack, 0) } end,
24012401
["exerted attacks have (%d+)%% chance to deal double damage"] = function(num) return { mod("ExertDoubleDamageChance", "BASE", num, nil, ModFlag.Attack, 0) } end,
2402-
-- Duelist (Fatal flourish)
2403-
["final repeat of attack skills deals (%d+)%% more damage"] = function(num) return { mod("RepeatFinalDamage", "MORE", num, nil, ModFlag.Attack, 0) } end,
2404-
["non%-travel attack skills repeat an additional time"] = { mod("RepeatCount", "BASE", 1, nil, ModFlag.Attack, 0, { type = "Condition", varList = {"averageRepeat", "alwaysFinalRepeat"} }) },
24052402
-- Ascendant
24062403
["grants (%d+) passive skill points?"] = function(num) return { mod("ExtraPoints", "BASE", num) } end,
24072404
["can allocate passives from the %a+'s starting point"] = { },
@@ -5498,6 +5495,8 @@ local specialModList = {
54985495
["attacks you use yourself repeat an additional time"] = {
54995496
mod("RepeatCount", "BASE", 1, nil, ModFlag.Attack, 0, { type = "SkillType", neg = true, skillTypeList = { SkillType.SummonsTotem, SkillType.RemoteMined, SkillType.Trapped, SkillType.Triggered } }, { type = "Condition", neg = true, var = "usedByMirage" }, { type = "Condition", varList = { "averageRepeat", "alwaysFinalRepeat" } }),
55005497
},
5498+
["final repeat of attack skills deals (%d+)%% more damage"] = function(num) return { mod("RepeatFinalDamage", "MORE", num, nil, 0, KeywordFlag.Attack) } end,
5499+
["non%-travel attack skills repeat an additional time"] = { mod("RepeatCount", "BASE", 1, nil, 0, KeywordFlag.Attack, { type = "SkillType", skillType = SkillType.Travel, neg = true }, { type = "Condition", varList = { "averageRepeat", "alwaysFinalRepeat" } }) },
55015500
["viper strike and pestilent strike deal (%d+)%% increased attack damage per frenzy charge"] = function(num) return { mod("Damage", "INC", num, nil, ModFlag.Attack, { type = "Multiplier", var = "FrenzyCharge" }, { type = "SkillName", skillNameList = { "Viper Strike", "Pestilent Strike" }, includeTransfigured = true }) } end,
55025501
["shield charge and chain hook have (%d+)%% increased attack speed per (%d+) rampage kills"] = function(inc, _, num) return { mod("Speed", "INC", inc, nil, ModFlag.Attack, { type = "Multiplier", var = "Rampage", div = num, limit = 1000 / num, limitTotal = true }, { type = "SkillName", skillNameList = { "Shield Charge", "Chain Hook" }, includeTransfigured = true }) } end,
55035502
["tectonic slam and infernal blow deal (%d+)%% increased attack damage per (%d+) armour"] = function(inc, _, num) return { mod("Damage", "INC", inc, nil, ModFlag.Attack, { type = "PerStat", stat = "Armour", div = num }, { type = "SkillName", skillNameList = { "Tectonic Slam", "Infernal Blow" }, includeTransfigured = true }) } end,

0 commit comments

Comments
 (0)