Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement settlers trigger enchant #8240

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@
return slotMatch(env, skill) and skill.triggeredBy and calcLib.canGrantedEffectSupportActiveSkill(skill.triggeredBy.grantedEffect, skill)
end}
end,
["supporttriggerfirespellonhit"] = function(env)

Check warning on line 1402 in src/Modules/CalcTriggers.lua

View workflow job for this annotation

GitHub Actions / spellcheck

Unknown word (supporttriggerfirespellonhit)
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
Loading