Skip to content

Commit a7058f5

Browse files
PeecheyLocalIdentity
andauthored
Add support for Jarngreipr's Strength mod (#1871)
* add support for Jarngreipr * update test for Gemling's ascendancy * Fix interaction when using the gemling node --------- Co-authored-by: LocalIdentity <localidentity2@gmail.com>
1 parent 8f71bf5 commit a7058f5

4 files changed

Lines changed: 136 additions & 3 deletions

File tree

spec/System/TestItemMods_spec.lua

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,4 +220,128 @@ describe("TetsItemMods", function()
220220
assert.are_not.equals(120, build.calcsTab.mainOutput.Armour)
221221
runCallback("OnFrame")
222222
end)
223+
224+
it("Jarngreipr - strength satisfies melee weapons and skills", function()
225+
build.configTab.input.customMods = "+1000 Strength"
226+
build.configTab:BuildModList()
227+
build.itemsTab:CreateDisplayItemFromRaw([[
228+
Rarity: UNIQUE
229+
Chober Chaber
230+
Leaden Greathammer
231+
Variant: Pre 0.1.1
232+
Variant: Current
233+
Selected Variant: 2
234+
Quality: 20
235+
LevelReq: 33
236+
Implicits: 0
237+
+100 Intelligence Requirement
238+
{variant:1}{range:0.5}(80-120)% increased Physical Damage
239+
{variant:2}{range:0.5}Adds (58-65) to (102-110) Physical Damage
240+
{range:0.5}+(80-100) to maximum Mana
241+
{variant:2}+50 to Spirit
242+
{variant:1}+5% to Critical Hit Chance
243+
Increases and Reductions to Minion Damage also affect you
244+
]])
245+
build.itemsTab:AddDisplayItem()
246+
runCallback("OnFrame")
247+
assert.True(build.controls.warnings.lines[1]:match("Intelligence requirement") ~= nil)
248+
assert.True(build.controls.warnings.lines[1]:match("Chober Chaber") ~= nil)
249+
250+
build.itemsTab:CreateDisplayItemFromRaw([[
251+
Rarity: UNIQUE
252+
Jarngreipr
253+
Ringmail Gauntlets
254+
Armour: 23
255+
Evasion: 18
256+
Variant: Pre 0.1.1
257+
Variant: Current
258+
Selected Variant: 2
259+
Quality: 20
260+
LevelReq: 6
261+
Implicits: 0
262+
{variant:2}50% increased Armour and Evasion
263+
{range:0.5}Adds (2-3) to (5-6) Physical Damage to Attacks
264+
{range:0.5}+(30-50) to maximum Life
265+
{range:0.5}(4-8)% increased Attack Speed
266+
Strength can satisfy other Attribute Requirements of Melee Weapons and Melee Skills
267+
]])
268+
build.itemsTab:AddDisplayItem()
269+
runCallback("OnFrame")
270+
assert.True(build.controls.warnings.lines[1] == nil) -- melee item check int
271+
272+
newBuild()
273+
build.configTab.input.customMods = "+1000 Strength"
274+
build.configTab:BuildModList()
275+
build.skillsTab:PasteSocketGroup("Primal Strikes 20/0 1")
276+
runCallback("OnFrame")
277+
assert.True(build.controls.warnings.lines[1]:match("Dexterity requirement") ~= nil)
278+
assert.True(build.controls.warnings.lines[1]:match("Primal Strikes") ~= nil)
279+
280+
build.itemsTab:CreateDisplayItemFromRaw([[
281+
Rarity: UNIQUE
282+
Jarngreipr
283+
Ringmail Gauntlets
284+
Armour: 23
285+
Evasion: 18
286+
Variant: Pre 0.1.1
287+
Variant: Current
288+
Selected Variant: 2
289+
Quality: 20
290+
LevelReq: 6
291+
Implicits: 0
292+
{variant:2}50% increased Armour and Evasion
293+
{range:0.5}Adds (2-3) to (5-6) Physical Damage to Attacks
294+
{range:0.5}+(30-50) to maximum Life
295+
{range:0.5}(4-8)% increased Attack Speed
296+
Strength can satisfy other Attribute Requirements of Melee Weapons and Melee Skills
297+
]])
298+
build.itemsTab:AddDisplayItem()
299+
runCallback("OnFrame")
300+
assert.True(build.controls.warnings.lines[1] == nil) -- melee skill check dex
301+
302+
build.skillsTab:PasteSocketGroup("Fireball 20/0 1")
303+
runCallback("OnFrame")
304+
-- make sure something like Fireball still needs the Int requirement and isn't being ignored
305+
assert.True(build.controls.warnings.lines[1]:match("Intelligence requirement") ~= nil)
306+
assert.True(build.controls.warnings.lines[1]:match("Fireball") ~= nil)
307+
308+
build.configTab.input.customMods = [[
309+
+1000 Strength
310+
+100 mana
311+
Attribute Requirements of Gems can be satisified by your highest Attribute
312+
]] -- fix mana warning
313+
build.configTab:BuildModList()
314+
runCallback("OnFrame")
315+
assert.True(build.controls.warnings.lines[1] == nil) -- validate Gemling's Adaptive Capability still works
316+
317+
newBuild()
318+
build.configTab.input.customMods = [[
319+
+1000 Intelligence
320+
+100 mana
321+
Attribute Requirements of Gems can be satisified by your highest Attribute
322+
]]
323+
build.configTab:BuildModList()
324+
build.skillsTab:PasteSocketGroup("Primal Strikes 20/0 1")
325+
build.itemsTab:CreateDisplayItemFromRaw([[
326+
Rarity: UNIQUE
327+
Jarngreipr
328+
Ringmail Gauntlets
329+
Armour: 23
330+
Evasion: 18
331+
Variant: Pre 0.1.1
332+
Variant: Current
333+
Selected Variant: 2
334+
Quality: 20
335+
LevelReq: 6
336+
Implicits: 0
337+
{variant:2}50% increased Armour and Evasion
338+
{range:0.5}Adds (2-3) to (5-6) Physical Damage to Attacks
339+
{range:0.5}+(30-50) to maximum Life
340+
{range:0.5}(4-8)% increased Attack Speed
341+
Strength can satisfy other Attribute Requirements of Melee Weapons and Melee Skills
342+
]])
343+
build.itemsTab:AddDisplayItem()
344+
runCallback("OnFrame")
345+
assert.True(build.controls.warnings.lines[1] == nil) -- Gemling highest attribute still satisfies melee gems with Jarngreipr
346+
end)
223347
end)

src/Data/ModCache.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5997,7 +5997,7 @@ c["Storm and Plant Spells:"]={nil,"Storm and Plant Spells: "}
59975997
c["Storm and Plant Spells: deal 50% more damage"]={nil,"Storm and Plant Spells: deal 50% more damage "}
59985998
c["Storm and Plant Spells: deal 50% more damage cost 50% less"]={{},"Storm and Plant Spells: deal 50% more damage % less "}
59995999
c["Storm and Plant Spells: deal 50% more damage cost 50% less have 75% less duration"]={{[1]={[1]={skillTypeList={[1]=255,[2]=252},type="SkillType"},flags=0,keywordFlags=131072,name="Damage",type="MORE",value=50},[2]={[1]={skillTypeList={[1]=255,[2]=252},type="SkillType"},flags=0,keywordFlags=131072,name="Cost",type="MORE",value=-50},[3]={[1]={skillTypeList={[1]=255,[2]=252},type="SkillType"},flags=0,keywordFlags=131072,name="Duration",type="MORE",value=-75}},nil}
6000-
c["Strength can satisfy other Attribute Requirements of Melee Weapons and Melee Skills"]={nil,"Strength can satisfy other Attribute Requirements of Melee Weapons and Melee Skills "}
6000+
c["Strength can satisfy other Attribute Requirements of Melee Weapons and Melee Skills"]={{[1]={flags=0,keywordFlags=0,name="StrengthSatisfiesMeleeWeaponsAndSkills",type="FLAG",value=true}},nil}
60016001
c["Strike Skills you use yourself with Maces have 10% chance to deal Splash Damage"]={nil,"Strike Skills you use yourself with Maces have 10% chance to deal Splash Damage "}
60026002
c["Strikes deal Splash Damage"]={nil,"Strikes deal Splash Damage "}
60036003
c["Strikes deal Splash Damage 172% increased Physical Damage"]={nil,"Strikes deal Splash Damage 172% increased Physical Damage "}

src/Modules/CalcPerform.lua

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1587,6 +1587,7 @@ function calcs.perform(env, skipEHP)
15871587
end
15881588
end
15891589
local ignoreAttrReq = modDB:Flag(nil, "IgnoreAttributeRequirements")
1590+
local strengthSatisfiesMeleeFlag = modDB:Flag(nil, "StrengthSatisfiesMeleeWeaponsAndSkills")
15901591
for _, attr in ipairs(attrTable) do
15911592
local breakdownAttr = attr
15921593
if breakdown then
@@ -1616,13 +1617,20 @@ function calcs.perform(env, skipEHP)
16161617
elseif reqSource.source == "Support Gems" then
16171618
req = m_floor(reqSource[attr])
16181619
end
1619-
if req > (gemAttributeRequirementsSatisfiedByHighestAttribute and reqSource.source == "Gem" and highestAttributeValue or out.val) then
1620+
-- Jarngreipr // if it's a melee weapon or melee skill gem and your Strength is greater than or equal to the Dex/Int requirement
1621+
local strengthSatisfiesMelee = strengthSatisfiesMeleeFlag
1622+
and ((reqSource.source == "Item" and reqSource.sourceItem.base.weapon and env.data.weaponTypeInfo[reqSource.sourceItem.base.type].melee)
1623+
or (reqSource.source == "Gem" and reqSource.sourceGem.gemData.tags.melee))
1624+
local satisfyingAttributeValue = gemAttributeRequirementsSatisfiedByHighestAttribute and reqSource.source == "Gem" and highestAttributeValue or out.val
1625+
if req > (strengthSatisfiesMelee and attr ~= "Str" and m_max(satisfyingAttributeValue, output["Str"]) or satisfyingAttributeValue) then
16201626
out.val = req
16211627
out.source = reqSource
16221628
end
16231629
if breakdown then
1630+
local breakdownAttributeValue = gemAttributeRequirementsSatisfiedByHighestAttribute and reqSource.source == "Gem" and highestAttributeValue or output[breakdownAttr]
1631+
local reqBool = req > (strengthSatisfiesMelee and breakdownAttr ~= "Str" and m_max(breakdownAttributeValue, output["Str"]) or breakdownAttributeValue)
16241632
local row = {
1625-
req = req > (gemAttributeRequirementsSatisfiedByHighestAttribute and reqSource.source == "Gem" and highestAttributeValue or output[breakdownAttr]) and colorCodes.NEGATIVE..req or req,
1633+
req = reqBool and colorCodes.NEGATIVE..req or req,
16261634
reqNum = req,
16271635
source = reqSource.source,
16281636
}

src/Modules/ModParser.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5471,6 +5471,7 @@ local specialModList = {
54715471
["skill gems have (%d+)%% more attribute requirements"] = function(num) return { mod("GlobalGemAttributeRequirements", "MORE", num) } end,
54725472
["skill gems have no attribute requirements"] = function(num) return { mod("GlobalGemAttributeRequirements", "MORE", -100) } end,
54735473
["triple attribute requirements of martial weapons"] = function() return { mod("GlobalWeaponAttributeRequirements", "MORE", 200) } end,
5474+
["strength can satisfy other attribute requirements of melee weapons and melee skills"] = { flag("StrengthSatisfiesMeleeWeaponsAndSkills") },
54745475
["mana reservation of herald skills is always (%d+)%%"] = function(num) return { mod("SkillData", "LIST", { key = "ManaReservationPercentForced", value = num }, { type = "SkillType", skillType = SkillType.Herald }) } end,
54755476
["([%a%s]+) reserves no mana"] = function(_, name) return {
54765477
mod("SkillData", "LIST", { key = "manaReservationFlat", value = 0 }, { type = "SkillId", skillId = gemIdLookup[name] }, { type = "SkillType", skillType = SkillType.Blessing, neg = true }),

0 commit comments

Comments
 (0)