diff --git a/spec/System/TestBrandAttachment_spec.lua b/spec/System/TestBrandAttachment_spec.lua new file mode 100644 index 00000000000..c5070eba330 --- /dev/null +++ b/spec/System/TestBrandAttachment_spec.lua @@ -0,0 +1,47 @@ +describe("TestBrandAttachment", function() + before_each(function() + newBuild() + end) + + teardown(function() + -- newBuild() takes care of resetting everything in setup() + end) + + it("parses the Seeker Runes line split across two lines", function() + local node + for _, treeNode in pairs(build.spec.tree.nodes) do + if treeNode.dn == "Seeker Runes" then + node = treeNode + end + end + assert.is_not_nil(node) + assert.is_nil(node.unknown) + assert.is_nil(node.extra) + local found = false + for _, mod in ipairs(node.modList) do + if mod.name == "BrandAttachmentRange" then + found = true + assert.are.equals("INC", mod.type) + assert.are.equals(20, mod.value) + end + end + assert.is_true(found) + end) + + it("scales unattached brand attachment range with seconds unattached up to the maximum", function() + build.skillsTab:PasteSocketGroup("Armageddon Brand 20/0 1") + -- 3.28+ wording, and the 3.11 to 3.27 wording kept by builds saved on older trees + for _, text in ipairs({ "per second, up to a maximum of 100%", "per second, up to 100%" }) do + build.configTab.input.customMods = "Unattached Brands gain 20% increased Brand Attachment Range "..text + local base + for _, case in ipairs({ { seconds = 0, inc = 0 }, { seconds = 3, inc = 60 }, { seconds = 10, inc = 100 } }) do + build.configTab.input.brandUnattachedSeconds = case.seconds + build.configTab:BuildModList() + runCallback("OnFrame") + local output = build.calcsTab.mainOutput + base = base or output.BrandAttachmentRange + assert.are.equals(base * (1 + case.inc / 100), output.BrandAttachmentRange) + end + end + end) +end) diff --git a/src/Data/ModCache.lua b/src/Data/ModCache.lua index 94ce6007e71..1277c7f02e2 100755 --- a/src/Data/ModCache.lua +++ b/src/Data/ModCache.lua @@ -22419,7 +22419,7 @@ c["Unaffected by Temporal Chains"]={{[1]={[1]={skillName="Temporal Chains",type= c["Unaffected by Temporal Chains while affected by Haste"]={{[1]={[1]={skillName="Temporal Chains",type="SkillName"},[2]={type="Condition",var="AffectedByHaste"},[3]={effectType="Global",type="GlobalEffect",unscalable=true},flags=0,keywordFlags=0,name="CurseEffectOnSelf",type="MORE",value=-100}},nil} c["Unaffected by Vulnerability while affected by Determination"]={{[1]={[1]={skillName="Vulnerability",type="SkillName"},[2]={type="Condition",var="AffectedByDetermination"},[3]={effectType="Global",type="GlobalEffect",unscalable=true},flags=0,keywordFlags=0,name="CurseEffectOnSelf",type="MORE",value=-100}},nil} c["Unattached Brands gain 20% increased Brand Attachment Range per"]={nil,"Unattached Brands gain 20% increased Brand Attachment Range per "} -c["Unattached Brands gain 20% increased Brand Attachment Range per second, up to a maximum of 100%"]={nil,"Unattached Brands gain 20% increased Brand Attachment Range per second, up to a maximum of 100% "} +c["Unattached Brands gain 20% increased Brand Attachment Range per second, up to a maximum of 100%"]={{[1]={[1]={limit=100,limitTotal=true,type="Multiplier",var="BrandUnattachedSeconds"},flags=0,keywordFlags=0,name="BrandAttachmentRange",type="INC",value=20}},nil} c["Unholy Might"]={{[1]={flags=0,keywordFlags=0,name="Condition:UnholyMight",type="FLAG",value=true},[2]={flags=0,keywordFlags=0,name="Condition:CanWither",type="FLAG",value=true}},nil} c["Unholy Might during Effect"]={{[1]={[1]={type="Condition",var="UsingFlask"},flags=0,keywordFlags=0,name="Condition:UnholyMight",type="FLAG",value=true},[2]={[1]={type="Condition",var="UsingFlask"},flags=0,keywordFlags=0,name="Condition:CanWither",type="FLAG",value=true}},nil} c["Unnerve Enemies for 4 seconds on Hit"]={nil,"Unnerve Enemies for 4 seconds on Hit "} diff --git a/src/Modules/ConfigOptions.lua b/src/Modules/ConfigOptions.lua index 18ca0dc1255..933410a2140 100644 --- a/src/Modules/ConfigOptions.lua +++ b/src/Modules/ConfigOptions.lua @@ -339,6 +339,9 @@ return { { var = "BrandsAttachedToEnemy", type = "count", label = "# of Brands attached to enemy (if not maximum):", ifSkillFlag = "brand", apply = function(val, modList, enemyModList) modList:NewMod("Multiplier:ConfigBrandsAttachedToEnemy", "BASE", val, "Config") end }, + { var = "brandUnattachedSeconds", type = "count", label = "Seconds Brands have been unattached:", ifMult = "BrandUnattachedSeconds", tooltip = "Applies mods that use `Unattached Brands gain ... per second`, such as Seeker Runes.", apply = function(val, modList, enemyModList) + modList:NewMod("Multiplier:BrandUnattachedSeconds", "BASE", m_max(0, val), "Config") + end }, { var = "targetBrandedEnemy", type = "check", label = "Skill is targeting the Branded enemy", ifCond = "TargetingBrandedEnemy", defaultState = true, apply = function(val, modList, enemyModList) modList:NewMod("Condition:TargetingBrandedEnemy", "FLAG", true, "Config") end }, diff --git a/src/Modules/ModParser.lua b/src/Modules/ModParser.lua index a7f29d28835..932a2cb8b68 100644 --- a/src/Modules/ModParser.lua +++ b/src/Modules/ModParser.lua @@ -4506,6 +4506,8 @@ local specialModList = { ["([%d%.]+)%% of damage dealt by y?o?u?r? ?mines is leeched to you as life"] = function(num) return { mod("DamageLifeLeechToPlayer", "BASE", num, nil, 0, KeywordFlag.Mine) } end, ["you can cast an additional brand"] = { mod("ActiveBrandLimit", "BASE", 1) }, ["you can cast (%d+) additional brands"] = function(num) return { mod("ActiveBrandLimit", "BASE", num) } end, + ["unattached brands gain (%d+)%% increased brand attachment range per second, up to a maximum of (%d+)%%"] = function(num, _, limit) return { mod("BrandAttachmentRange", "INC", num, { type = "Multiplier", var = "BrandUnattachedSeconds", limit = tonumber(limit), limitTotal = true }) } end, + ["unattached brands gain (%d+)%% increased brand attachment range per second, up to (%d+)%%"] = function(num, _, limit) return { mod("BrandAttachmentRange", "INC", num, { type = "Multiplier", var = "BrandUnattachedSeconds", limit = tonumber(limit), limitTotal = true }) } end, ["(%d+)%% increased damage while you are wielding a bow and have a totem"] = function(num) return { mod("Damage", "INC", num, { type = "Condition", var = "HaveTotem" }, { type = "Condition", var = "UsingBow" }) } end, ["each totem applies (%d+)%% increased damage taken to enemies near it"] = function(num) return { mod("EnemyModifier", "LIST", { mod = mod("DamageTaken", "INC", num, { type = "Multiplier", var = "TotemsSummoned" }) }) } end, ["totems gain %+(%d+)%% to (%w+) resistance"] = function(num, _, resistance) return { mod("Totem"..firstToUpper(resistance).."Resist", "BASE", num) } end,