Skip to content

Commit

Permalink
FEAT: implement settlers trigger enchant (#8240)
Browse files Browse the repository at this point in the history
  • Loading branch information
Paliak authored Aug 31, 2024
1 parent dd8004a commit fd4463a
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 0 deletions.
20 changes: 20 additions & 0 deletions spec/System/TestTriggers_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1339,4 +1339,24 @@ describe("TestTriggers", function()

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

it("Trigger settlers enchant", function()
build.itemsTab:CreateDisplayItemFromRaw([[Physical 1H Axe
Runic Hatchet
Quality: 0
Sockets: R-R-R
LevelReq: 71
Implicits: 0
Trigger a Socketed Fire Spell on Hit, with a 0.25 second Cooldown]])
build.itemsTab:AddDisplayItem()
runCallback("OnFrame")

build.skillsTab:PasteSocketGroup("Slot: Weapon 1\nFireball 20/0 Default 1\n")
runCallback("OnFrame")

build.skillsTab:PasteSocketGroup("Smite 20/0 Default 1\n")
runCallback("OnFrame")

assert.True(build.calcsTab.mainOutput.SkillTriggerRate ~= nil)
end)
end)
23 changes: 23 additions & 0 deletions src/Data/Skills/other.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3856,6 +3856,29 @@ skills["SupportUniqueCastCurseOnCurse"] = {
[1] = { storedUses = 1, levelRequirement = 0, cooldown = 0.25, },
},
}
skills["SupportTriggerFireSpellOnHit"] = {
name = "SupportTriggerFireSpellOnHit",
hidden = true,
color = 4,
support = true,
requireSkillTypes = { SkillType.Spell, SkillType.Triggerable, SkillType.AND, SkillType.Fire, SkillType.AND, },
addSkillTypes = { SkillType.Triggered, SkillType.Cooldown, },
excludeSkillTypes = { SkillType.Trapped, SkillType.RemoteMined, SkillType.SummonsTotem, SkillType.Aura, SkillType.InbuiltTrigger, },
isTrigger = true,
statDescriptionScope = "gem_stat_descriptions",
fromItem = true,
statMap = {
["spell_is_triggered_on_hit"] = {
skill("triggeredBySettlersEnchantTrigger", true)
}
},
stats = {
"spell_is_triggered_on_hit",
},
levels = {
[1] = { storedUses = 1, levelRequirement = 1, cooldown = 0.25, },
},
}
skills["EnemyExplode"] = {
name = "On Kill Monster Explosion",
hidden = true,
Expand Down
9 changes: 9 additions & 0 deletions src/Export/Skills/other.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1044,6 +1044,15 @@ local skills, mod, flag, skill = ...
fromItem = true,
#mods

#skill SupportTriggerFireSpellOnHit
fromItem = true,
statMap = {
["spell_is_triggered_on_hit"] = {
skill("triggeredBySettlersEnchantTrigger", true)
}
},
#mods

skills["EnemyExplode"] = {
name = "On Kill Monster Explosion",
hidden = true,
Expand Down
9 changes: 9 additions & 0 deletions src/Modules/CalcTriggers.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1399,6 +1399,15 @@ local configTable = {
return slotMatch(env, skill) and skill.triggeredBy and calcLib.canGrantedEffectSupportActiveSkill(skill.triggeredBy.grantedEffect, skill)
end}
end,
["supporttriggerfirespellonhit"] = function(env)
return {triggerSkillCond = function(env, skill)
-- Skill is triggered only when the weapon with the enchant on it hits
return skill.skillTypes[SkillType.Melee]
end,
triggeredSkillCond = function(env, skill)
return skill.skillData.triggeredBySettlersEnchantTrigger and slotMatch(env, skill)
end}
end,
}

-- Find unique item trigger name
Expand Down
1 change: 1 addition & 0 deletions src/Modules/ModParser.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2783,6 +2783,7 @@ local specialModList = {
mod("KitavaRequiredManaCost", "BASE", tonumber(amount), "Kitava's Thirst"),
mod("ExtraSupport", "LIST", { skillId = "SupportCastOnManaSpent", level = 1 }, { type = "SocketedIn", slotName = "{SlotName}" }),
} end,
["trigger a socketed fire spell on hit, with a ([%d%.]+) second cooldown"] = { mod("ExtraSupport", "LIST", { skillId = "SupportTriggerFireSpellOnHit", level = 1 }, { type = "SocketedIn", slotName = "{SlotName}" }) },
-- Socketed gem modifiers
["([%+%-]%d+) to level of socketed gems"] = function(num) return { mod("GemProperty", "LIST", { keyword = "all", key = "level", value = num }, { type = "SocketedIn", slotName = "{SlotName}" }) } end,
["([%+%-]%d+)%%? to (%a+) of socketed ?([%a%- ]*) gems"] = function(num, _, property, type)
Expand Down

0 comments on commit fd4463a

Please sign in to comment.