Skip to content

Commit

Permalink
Merge branch 'dev' of https://github.com/Paliak/PathOfBuilding into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Paliak committed Jun 28, 2024
2 parents d8422a8 + 4e94dfa commit 6ceb81f
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 4 deletions.
9 changes: 8 additions & 1 deletion spec/System/TestTriggers_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1395,4 +1395,11 @@ describe("TestTriggers", function()

assert.True(build.calcsTab.mainOutput.SkillTriggerRate ~= nil)
end)
end)

it("Trigger Automation", function()
build.skillsTab:PasteSocketGroup("Steelskin 20/0 Default 1\nAutomation 20/0 Default 1\n")
runCallback("OnFrame")

assert.True(build.calcsTab.mainOutput.SkillTriggerRate ~= nil)
end)
end)
3 changes: 3 additions & 0 deletions src/Data/SkillStatMap.lua
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,9 @@ return {
["cast_on_damage_taken_threshold"] = {
skill("triggeredByDamageTaken", nil, { type = "SkillType", skillType = SkillType.Triggerable }, { type = "SkillType", skillType = SkillType.Spell }),
},
["support_autocast_instant_spells"] = {
skill("triggeredByAutomation", nil, { type = "SkillType", skillTypeList = {SkillType.Triggerable, SkillType.Spell, SkillType.Instant} }),
},
["support_autocast_warcries"] = {
skill("triggeredByAutoCry", nil, { type = "SkillType", skillType = SkillType.Triggerable }, { type = "SkillType", skillType = SkillType.Warcry }),
},
Expand Down
3 changes: 3 additions & 0 deletions src/Data/Skills/sup_int.lua
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,9 @@ skills["Automation"] = {
statDescriptionScope = "skill_stat_descriptions",
castTime = 0,
statMap = {
["automation_behaviour"] = {
-- Display only
}
},
baseFlags = {
},
Expand Down
3 changes: 3 additions & 0 deletions src/Export/Skills/sup_int.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ local skills, mod, flag, skill = ...

#skill Automation
statMap = {
["automation_behaviour"] = {
-- Display only
}
},
#mods

Expand Down
23 changes: 21 additions & 2 deletions src/Modules/CalcTriggers.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1086,6 +1086,26 @@ local configTable = {
return {triggerChance = env.player.mainSkill.skillData.chanceToTriggerOnStun,
source = env.player.mainSkill}
end,
["automation"] = function(env)
if env.player.mainSkill.activeEffect.grantedEffect.name == "Automation" then
-- This calculated the trigger rate of the Automation gem it self
env.player.mainSkill.skillFlags.globalTrigger = true
return {source = env.player.mainSkill}
end
env.player.mainSkill.skillData.sourceRateIsFinal = true

-- Trigger rate of the triggered skill is capped by the cooldown of Automation
-- which will likely be different from the cooldown of the triggered skill
-- and is affected by different cooldown modifiers
env.player.mainSkill.skillData.ignoresTickRate = true

-- This basically does min(trigger rate of steelskin assuming no trigger cooldown, trigger rate of Automation)
return {triggerOnUse = true,
useCastRate = true,
triggerSkillCond = function(env, skill)
return skill.activeEffect.grantedEffect.name == "Automation"
end}
end,
["spellslinger"] = function(env)
if env.player.mainSkill.activeEffect.grantedEffect.name == "Spellslinger" then
return {triggerName = "Spellslinger",
Expand Down Expand Up @@ -1138,7 +1158,7 @@ local configTable = {
env.player.mainSkill.skillFlags.globalTrigger = true
local uuid = cacheSkillUUID(env.player.mainSkill, env)
if not GlobalCache.cachedData[env.mode][uuid] or env.mode == "CALCULATOR" then
calcs.buildActiveSkill(env, env.mode, env.player.mainSkill, {[uuid] = true})
calcs.buildActiveSkill(env, env.mode, env.player.mainSkill, uuid, {[uuid] = true})
end
env.player.mainSkill.skillData.triggerRateCapOverride = 1 / GlobalCache.cachedData[env.mode][uuid].Env.player.output.Duration
if env.player.breakdown then
Expand Down Expand Up @@ -1183,7 +1203,6 @@ local configTable = {
env.player.mainSkill.triggeredBy.activationFreqInc = activationFreqInc
env.player.mainSkill.triggeredBy.activationFreqMore = activationFreqMore
env.player.mainSkill.triggeredBy.ignoresTickRate = true
env.player.output.EffectiveSourceRate = trigRate
return {trigRate = env.player.mainSkill.triggeredBy.mainSkill.skillData.repeatFrequency * activationFreqInc * activationFreqMore,
source = env.player.mainSkill.triggeredBy.mainSkill,
triggeredSkillCond = function(env, skill) return skill.skillData.triggeredByBrand and slotMatch(env, skill) end}
Expand Down
2 changes: 1 addition & 1 deletion src/Modules/ModParser.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1716,7 +1716,7 @@ local modTagList = {
["against enemies that are on full life"] = { tag = { type = "ActorCondition", actor = "enemy", var = "FullLife" } },
["against enemies on low life"] = { tag = { type = "ActorCondition", actor = "enemy", var = "LowLife" } },
["against enemies that are on low life"] = { tag = { type = "ActorCondition", actor = "enemy", var = "LowLife" } },
["to enemies which have energy shield"] = { tag = { type = "ActorCondition", actor = "enemy", var = "HaveEnergyShield" } },
["to enemies which have energy shield"] = { tag = { type = "ActorCondition", actor = "enemy", var = "HaveEnergyShield" }, keywordFlags = bor(KeywordFlag.Hit, KeywordFlag.Ailment) },
["against cursed enemies"] = { tag = { type = "ActorCondition", actor = "enemy", var = "Cursed" } },
["against stunned enemies"] = { tag = { type = "ActorCondition", actor = "enemy", var = "Stunned" } },
["on cursed enemies"] = { tag = { type = "ActorCondition", actor = "enemy", var = "Cursed" } },
Expand Down

0 comments on commit 6ceb81f

Please sign in to comment.