Skip to content

Commit be65db1

Browse files
github-actions[bot]PeecheyLocalIdentity
authored
[pob1-port] Fix calculations for skills that can repeat (#1791)
* Apply changes from PathOfBuildingCommunity/PathOfBuilding#9723 * Fix conflicts --------- Co-authored-by: Peechey <Peechey@users.noreply.github.com> Co-authored-by: LocalIdentity <localidentity2@gmail.com>
1 parent c0f2112 commit be65db1

3 files changed

Lines changed: 22 additions & 5 deletions

File tree

src/Data/SkillStatMap.lua

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,12 @@ return {
288288
mod("RepeatCount", "BASE", nil, 0, 0, { type = "ModFlagOr", modFlags = bit.bor(ModFlag.WeaponMelee, ModFlag.Unarmed) }),
289289
mod("RepeatCount", "BASE", nil, 0, 0, { type = "SkillType", skillType = SkillType.RequiresShield }),
290290
},
291+
["skill_repeat_count"] = {
292+
mod("RepeatCount", "BASE", nil, 0, 0, { type = "SkillType", skillType = SkillType.Multicastable }),
293+
},
294+
["disable_skill_repeats"] = {
295+
flag("CannotRepeat"),
296+
},
291297
["display_skill_minions_level_is_corpse_level"] = {
292298
skill("minionLevelIsEnemyLevel", true),
293299
},

src/Modules/CalcOffence.lua

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -919,7 +919,16 @@ function calcs.offence(env, actor, activeSkill)
919919
end
920920
end
921921
end
922-
output.Repeats = 1 + (skillModList:Sum("BASE", skillCfg, "RepeatCount") or 0)
922+
local function repeatSkillTypesCheck(activeSkillTypes)
923+
local excludeSkillTypes = { SkillType.Instant, SkillType.Channel, SkillType.Triggered, SkillType.Retaliation, SkillType.NonRepeatable }
924+
for _, type in ipairs(excludeSkillTypes) do
925+
if activeSkillTypes[type] then
926+
return false
927+
end
928+
end
929+
return not skillModList:Flag(nil, "CannotRepeat") and ((activeSkillTypes[SkillType.Attack] or activeSkillTypes[SkillType.Spell]))
930+
end
931+
output.Repeats = 1 + (repeatSkillTypesCheck(activeSkill.skillTypes) and skillModList:Sum("BASE", skillCfg, "RepeatCount") or 0)
923932
if output.Repeats > 1 then
924933
output.RepeatCount = output.Repeats
925934
-- handle all the multipliers from Repeats
@@ -1010,6 +1019,9 @@ function calcs.offence(env, actor, activeSkill)
10101019
skillModList:NewMod("Damage", "MORE", (100 * output.Repeats + DamageFinalMoreValueTotal) / (1 + DamageFinalMoreValueTotal / 100) - 100, value.mod.source, value.mod.flags, value.mod.keywordFlags, unpack(value.mod))
10111020
end
10121021
end
1022+
if skillFlags.trap or skillFlags.mine then
1023+
skillModList:NewMod("DPS", "MORE", (output.Repeats - 1) * 100, "Repeat Count")
1024+
end
10131025
end
10141026
end
10151027
if skillData.gainPercentBaseWandDamageToSpells then
@@ -5631,7 +5643,7 @@ function calcs.offence(env, actor, activeSkill)
56315643
if skillFlags.trap or skillFlags.mine then
56325644
local preSpeed = output.TrapThrowingSpeed or output.MineLayingSpeed
56335645
local cooldown = output.TrapCooldown or output.Cooldown
5634-
useSpeed = (cooldown and cooldown > 0 and 1 / cooldown or preSpeed) / repeats
5646+
useSpeed = (cooldown and cooldown > 0 and 1 / cooldown or preSpeed)
56355647
timeType = skillFlags.trap and "trap throwing" or "mine laying"
56365648
elseif skillFlags.totem then
56375649
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
@@ -2617,9 +2617,6 @@ local specialModList = {
26172617
-- Exerted Attacks
26182618
["exerted attacks deal (%d+)%% increased damage"] = function(num) return { mod("ExertIncrease", "INC", num, nil, ModFlag.Attack, 0) } end,
26192619
["exerted attacks have (%d+)%% chance to deal double damage"] = function(num) return { mod("ExertDoubleDamageChance", "BASE", num, nil, ModFlag.Attack, 0) } end,
2620-
-- Duelist (Fatal flourish)
2621-
["final repeat of attack skills deals (%d+)%% more damage"] = function(num) return { mod("RepeatFinalDamage", "MORE", num, nil, ModFlag.Attack, 0) } end,
2622-
["non%-travel attack skills repeat an additional time"] = { mod("RepeatCount", "BASE", 1, nil, ModFlag.Attack, 0, { type = "Condition", varList = {"averageRepeat", "alwaysFinalRepeat"} }) },
26232620
-- Leech Related
26242621
["life leech is instant"] = { mod("InstantLifeLeech", "BASE", 100), },
26252622
["mana leech is instant"] = { mod("InstantManaLeech", "BASE", 100), },
@@ -5835,6 +5832,8 @@ local specialModList = {
58355832
mod("PartialIgnoreEnemyPhysicalDamageReduction", "BASE", num),
58365833
} end,
58375834
["hits ignore non%-negative elemental resistances of frozen enemies"] = { flag("IgnoreNonNegativeEleRes", { type = "ActorCondition", actor = "enemy", var = "Frozen" }) },
5835+
["final repeat of attack skills deals (%d+)%% more damage"] = function(num) return { mod("RepeatFinalDamage", "MORE", num, nil, ModFlag.Attack, 0) } end,
5836+
["non%-travel attack skills repeat an additional time"] = { mod("RepeatCount", "BASE", 1, nil, ModFlag.Attack, 0, { type = "Condition", varList = {"averageRepeat", "alwaysFinalRepeat"} }) },
58385837
["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,
58395838
["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,
58405839
["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)