diff --git a/spec/System/TestTriggers_spec.lua b/spec/System/TestTriggers_spec.lua index 3c09218809..95b58b3bfb 100644 --- a/spec/System/TestTriggers_spec.lua +++ b/spec/System/TestTriggers_spec.lua @@ -1395,4 +1395,11 @@ describe("TestTriggers", function() assert.True(build.calcsTab.mainOutput.SkillTriggerRate ~= nil) end) -end) \ No newline at end of file + + 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) diff --git a/src/Data/SkillStatMap.lua b/src/Data/SkillStatMap.lua index 18256bbfab..fb0b244934 100644 --- a/src/Data/SkillStatMap.lua +++ b/src/Data/SkillStatMap.lua @@ -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 }), }, diff --git a/src/Data/Skills/sup_int.lua b/src/Data/Skills/sup_int.lua index ac06f772c6..4d993aaa4f 100644 --- a/src/Data/Skills/sup_int.lua +++ b/src/Data/Skills/sup_int.lua @@ -381,6 +381,9 @@ skills["Automation"] = { statDescriptionScope = "skill_stat_descriptions", castTime = 0, statMap = { + ["automation_behaviour"] = { + -- Display only + } }, baseFlags = { }, diff --git a/src/Export/Skills/sup_int.txt b/src/Export/Skills/sup_int.txt index e214851c95..24272939f0 100644 --- a/src/Export/Skills/sup_int.txt +++ b/src/Export/Skills/sup_int.txt @@ -45,6 +45,9 @@ local skills, mod, flag, skill = ... #skill Automation statMap = { + ["automation_behaviour"] = { + -- Display only + } }, #mods diff --git a/src/Modules/CalcTriggers.lua b/src/Modules/CalcTriggers.lua index 0a63d7d2bb..16861dd968 100644 --- a/src/Modules/CalcTriggers.lua +++ b/src/Modules/CalcTriggers.lua @@ -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", @@ -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 @@ -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} diff --git a/src/Modules/ModParser.lua b/src/Modules/ModParser.lua index cf6bec5618..f5260b9b5e 100644 --- a/src/Modules/ModParser.lua +++ b/src/Modules/ModParser.lua @@ -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" } },