Skip to content

Commit

Permalink
FEAT: impl intuitive link (#6732)
Browse files Browse the repository at this point in the history
  • Loading branch information
Paliak authored Sep 25, 2023
1 parent e8b9d8e commit 4357ad2
Show file tree
Hide file tree
Showing 5 changed files with 120 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/Classes/ConfigTab.lua
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ local ConfigTabClass = newClass("ConfigTab", "UndoHandler", "ControlHost", "Cont
self:BuildModList()
self.build.buildFlag = true
end)
elseif varData.type == "count" or varData.type == "integer" or varData.type == "countAllowZero" then
control = new("EditControl", {"TOPLEFT",lastSection,"TOPLEFT"}, 234, 0, 90, 18, "", nil, varData.type == "integer" and "^%-%d" or "%D", 7, function(buf, placeholder)
elseif varData.type == "count" or varData.type == "integer" or varData.type == "countAllowZero" or varData.type == "float" then
control = new("EditControl", {"TOPLEFT",lastSection,"TOPLEFT"}, 234, 0, 90, 18, "", nil, (varData.type == "integer" and "^%-%d") or (varData.type == "float" and "^%d.") or "%D", 7, function(buf, placeholder)
if placeholder then
self.placeholder[varData.var] = tonumber(buf)
else
Expand Down Expand Up @@ -442,7 +442,7 @@ local ConfigTabClass = newClass("ConfigTab", "UndoHandler", "ControlHost", "Cont
end
if varData.type == "check" then
self.defaultState[varData.var] = varData.defaultState or false
elseif varData.type == "count" or varData.type == "integer" or varData.type == "countAllowZero" then
elseif varData.type == "count" or varData.type == "integer" or varData.type == "countAllowZero" or varData.type == "float" then
self.defaultState[varData.var] = varData.defaultState or 0
elseif varData.type == "list" then
self.defaultState[varData.var] = varData.list[varData.defaultIndex or 1].val
Expand Down Expand Up @@ -725,7 +725,7 @@ function ConfigTabClass:BuildModList()
if input[varData.var] then
varData.apply(true, modList, enemyModList, self.build)
end
elseif varData.type == "count" or varData.type == "integer" or varData.type == "countAllowZero" then
elseif varData.type == "count" or varData.type == "integer" or varData.type == "countAllowZero" or varData.type == "float" then
if input[varData.var] and (input[varData.var] ~= 0 or varData.type == "countAllowZero") then
varData.apply(input[varData.var], modList, enemyModList, self.build)
elseif placeholder[varData.var] and (placeholder[varData.var] ~= 0 or varData.type == "countAllowZero") then
Expand Down
81 changes: 81 additions & 0 deletions src/Data/Skills/act_dex.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10761,6 +10761,11 @@ skills["IntuitiveLink"] = {
skillTypes = { [SkillType.Spell] = true, [SkillType.Buff] = true, [SkillType.Duration] = true, [SkillType.Link] = true, },
statDescriptionScope = "buff_skill_stat_descriptions",
castTime = 0.5,
statMap = {
["display_trigger_link"] = {
-- Display only
},
},
baseFlags = {
spell = true,
duration = true,
Expand Down Expand Up @@ -10825,6 +10830,82 @@ skills["IntuitiveLink"] = {
[40] = { 11450, levelRequirement = 100, statInterpolation = { 1, }, cost = { ManaPerMinute = 2850, }, },
},
}
skills["SupportIntuitiveLink"] = {
name = "Intuitive Link",
description = "Supports spell skills, causing them to be triggered by Intuitive Link. Cannot support skills used by totems, traps, or mines. Vaal skills, channelling skills, and skills with a reservation cannot be triggered.",
color = 2,
support = true,
requireSkillTypes = { SkillType.Spell, SkillType.Triggerable, SkillType.AND, },
addSkillTypes = { SkillType.Triggered, SkillType.Cooldown, },
excludeSkillTypes = { SkillType.Trapped, SkillType.RemoteMined, SkillType.SummonsTotem, SkillType.HasReservation, SkillType.InbuiltTrigger, },
isTrigger = true,
statMap = {
["trigger_on_trigger_link_target_hit"] = {
-- Display only
},
["support_trigger_link_damage_+%_final"] = {
mod("Damage", "MORE", nil),
},
},
statDescriptionScope = "gem_stat_descriptions",
qualityStats = {
Default = {
{ "dummy_stat_display_nothing", 0 },
},
Alternate1 = {
{ "dummy_stat_display_nothing", 0 },
},
Alternate2 = {
{ "triggered_skill_damage_+%", 1 },
},
},
stats = {
"support_trigger_link_damage_+%_final",
"trigger_on_trigger_link_target_hit",
},
levels = {
[1] = { -44, storedUses = 1, levelRequirement = 34, cooldown = 0.5, statInterpolation = { 1, }, },
[2] = { -44, storedUses = 1, levelRequirement = 36, cooldown = 0.5, statInterpolation = { 1, }, },
[3] = { -44, storedUses = 1, levelRequirement = 38, cooldown = 0.5, statInterpolation = { 1, }, },
[4] = { -43, storedUses = 1, levelRequirement = 40, cooldown = 0.5, statInterpolation = { 1, }, },
[5] = { -43, storedUses = 1, levelRequirement = 42, cooldown = 0.5, statInterpolation = { 1, }, },
[6] = { -43, storedUses = 1, levelRequirement = 44, cooldown = 0.5, statInterpolation = { 1, }, },
[7] = { -42, storedUses = 1, levelRequirement = 46, cooldown = 0.5, statInterpolation = { 1, }, },
[8] = { -42, storedUses = 1, levelRequirement = 48, cooldown = 0.5, statInterpolation = { 1, }, },
[9] = { -42, storedUses = 1, levelRequirement = 50, cooldown = 0.5, statInterpolation = { 1, }, },
[10] = { -41, storedUses = 1, levelRequirement = 52, cooldown = 0.5, statInterpolation = { 1, }, },
[11] = { -41, storedUses = 1, levelRequirement = 54, cooldown = 0.5, statInterpolation = { 1, }, },
[12] = { -41, storedUses = 1, levelRequirement = 56, cooldown = 0.5, statInterpolation = { 1, }, },
[13] = { -40, storedUses = 1, levelRequirement = 58, cooldown = 0.5, statInterpolation = { 1, }, },
[14] = { -40, storedUses = 1, levelRequirement = 60, cooldown = 0.5, statInterpolation = { 1, }, },
[15] = { -40, storedUses = 1, levelRequirement = 62, cooldown = 0.5, statInterpolation = { 1, }, },
[16] = { -39, storedUses = 1, levelRequirement = 64, cooldown = 0.5, statInterpolation = { 1, }, },
[17] = { -39, storedUses = 1, levelRequirement = 66, cooldown = 0.5, statInterpolation = { 1, }, },
[18] = { -39, storedUses = 1, levelRequirement = 68, cooldown = 0.5, statInterpolation = { 1, }, },
[19] = { -38, storedUses = 1, levelRequirement = 69, cooldown = 0.5, statInterpolation = { 1, }, },
[20] = { -38, storedUses = 1, levelRequirement = 70, cooldown = 0.5, statInterpolation = { 1, }, },
[21] = { -38, storedUses = 1, levelRequirement = 72, cooldown = 0.5, statInterpolation = { 1, }, },
[22] = { -37, storedUses = 1, levelRequirement = 74, cooldown = 0.5, statInterpolation = { 1, }, },
[23] = { -37, storedUses = 1, levelRequirement = 76, cooldown = 0.5, statInterpolation = { 1, }, },
[24] = { -37, storedUses = 1, levelRequirement = 78, cooldown = 0.5, statInterpolation = { 1, }, },
[25] = { -36, storedUses = 1, levelRequirement = 80, cooldown = 0.5, statInterpolation = { 1, }, },
[26] = { -36, storedUses = 1, levelRequirement = 82, cooldown = 0.5, statInterpolation = { 1, }, },
[27] = { -36, storedUses = 1, levelRequirement = 84, cooldown = 0.5, statInterpolation = { 1, }, },
[28] = { -35, storedUses = 1, levelRequirement = 86, cooldown = 0.5, statInterpolation = { 1, }, },
[29] = { -35, storedUses = 1, levelRequirement = 88, cooldown = 0.5, statInterpolation = { 1, }, },
[30] = { -35, storedUses = 1, levelRequirement = 90, cooldown = 0.5, statInterpolation = { 1, }, },
[31] = { -34, storedUses = 1, levelRequirement = 91, cooldown = 0.5, statInterpolation = { 1, }, },
[32] = { -34, storedUses = 1, levelRequirement = 92, cooldown = 0.5, statInterpolation = { 1, }, },
[33] = { -34, storedUses = 1, levelRequirement = 93, cooldown = 0.5, statInterpolation = { 1, }, },
[34] = { -33, storedUses = 1, levelRequirement = 94, cooldown = 0.5, statInterpolation = { 1, }, },
[35] = { -33, storedUses = 1, levelRequirement = 95, cooldown = 0.5, statInterpolation = { 1, }, },
[36] = { -33, storedUses = 1, levelRequirement = 96, cooldown = 0.5, statInterpolation = { 1, }, },
[37] = { -32, storedUses = 1, levelRequirement = 97, cooldown = 0.5, statInterpolation = { 1, }, },
[38] = { -32, storedUses = 1, levelRequirement = 98, cooldown = 0.5, statInterpolation = { 1, }, },
[39] = { -32, storedUses = 1, levelRequirement = 99, cooldown = 0.5, statInterpolation = { 1, }, },
[40] = { -31, storedUses = 1, levelRequirement = 100, cooldown = 0.5, statInterpolation = { 1, }, },
},
}
skills["VampiricLink"] = {
name = "Vampiric Link",
color = 2,
Expand Down
16 changes: 16 additions & 0 deletions src/Export/Skills/act_dex.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2134,6 +2134,22 @@ local skills, mod, flag, skill = ...

#skill IntuitiveLink
#flags spell duration
statMap = {
["display_trigger_link"] = {
-- Display only
},
},
#mods

#skill SupportIntuitiveLink
statMap = {
["trigger_on_trigger_link_target_hit"] = {
-- Display only
},
["support_trigger_link_damage_+%_final"] = {

},
},
#mods

#skill VampiricLink
Expand Down
17 changes: 16 additions & 1 deletion src/Modules/CalcTriggers.lua
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ local function defaultTriggerHandler(env, config)
if config.assumingEveryHitKills then
t_insert(breakdown.EffectiveSourceRate, "Assuming every attack kills")
end
t_insert(breakdown.EffectiveSourceRate, s_format("%.2f ^8(%s %s)", trigRate, source.activeEffect.grantedEffect.name, config.useCastRate and "cast rate" or "attack rate"))
t_insert(breakdown.EffectiveSourceRate, s_format("%.2f ^8(%s %s)", trigRate, config.sourceName or source.activeEffect.grantedEffect.name, config.useCastRate and "cast rate" or "attack rate"))
end
end

Expand Down Expand Up @@ -1292,6 +1292,21 @@ local configTable = {
end,
ignoreSourceRate = true}
end,
["intuitive link"] = function(env)
if env.player.mainSkill.activeEffect.grantedEffect.name ~= "Intuitive Link" then
for _, skill in ipairs(env.player.activeSkillList) do
if skill.activeEffect.grantedEffect.name == "Intuitive Link" then
env.player.mainSkill.triggeredBy.mainSkill = skill
break
end
end
return {triggeredSkillCond = function(env, skill) return skill.skillTypes[SkillType.Spell] and slotMatch(env, skill) and skill ~= env.player.mainSkill.triggeredBy.mainSkill end,
trigRate = env.modDB:Sum("BASE", nil, "IntuitiveLinkSourceRate"),
source = env.player.mainSkill.triggeredBy.mainSkill,
sourceName = "Custom source",
useCastRate = true}
end
end,
}

-- Find unique item trigger name
Expand Down
3 changes: 3 additions & 0 deletions src/Modules/ConfigOptions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,9 @@ return {
{ var = "linkedToMinion", type = "check", label = "Linked To Minion?", ifSkill = { "Destructive Link", "Flame Link", "Intuitive Link", "Protective Link", "Soul Link", "Vampiric Link" }, ifFlag = "Condition:CanLinkToMinions", apply = function(val, modList, enemyModList)
modList:NewMod("Condition:LinkedToMinion", "FLAG", true, "Config")
end },
{ var = "linkedSourceRate", type = "float", label = "Source rate for Intuitive Link", ifSkill = "Intuitive Link", apply = function(val, modList, enemyModList)
modList:NewMod("IntuitiveLinkSourceRate", "BASE", val, "Config")
end },
{ label = "Meat Shield:", ifSkill = "Meat Shield" },
{ var = "meatShieldEnemyNearYou", type = "check", label = "Is the enemy near you?", ifSkill = "Meat Shield", apply = function(val, modList, enemyModList)
modList:NewMod("Condition:MeatShieldEnemyNearYou", "FLAG", true, "Config")
Expand Down

0 comments on commit 4357ad2

Please sign in to comment.