forked from PathOfBuildingCommunity/PathOfBuilding-PoE2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestItemMods_spec.lua
More file actions
398 lines (344 loc) · 12.3 KB
/
Copy pathTestItemMods_spec.lua
File metadata and controls
398 lines (344 loc) · 12.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
describe("TetsItemMods", function()
before_each(function()
newBuild()
end)
teardown(function()
-- newBuild() takes care of resetting everything in setup()
end)
it("Both slots mod (evasion and es mastery)", function()
build.configTab.input.customMods = "\z
20% increased Maximum Energy Shield if both Equipped Rings have an Evasion Modifier\n\z
"
build.configTab:BuildModList()
runCallback("OnFrame")
build.itemsTab:CreateDisplayItemFromRaw([[
New Item
Elementalist Robe
Energy Shield: 116
]])
build.itemsTab:AddDisplayItem()
runCallback("OnFrame")
local baseEs = build.calcsTab.mainOutput.EnergyShield
build.itemsTab:CreateDisplayItemFromRaw([[
New Item
Ring
Implicits: 1
+71 to Evasion Rating
+10 to maximum life
]])
build.itemsTab:AddDisplayItem()
runCallback("OnFrame")
assert.are.equals(baseEs, build.calcsTab.mainOutput.EnergyShield) -- No change in es with just one ring.
build.itemsTab:CreateDisplayItemFromRaw([[
New Item
Ring
+71 to Evasion Rating
]])
build.itemsTab:AddDisplayItem()
runCallback("OnFrame")
assert.are_not.equals(baseEs, build.calcsTab.mainOutput.EnergyShield)
-- Es changes after adding another ring with mod. Regardless of the evasion mod on the first ring being implicit.
end)
it("Both slots explicit mod with mixed mod rings (evasion and es mastery)", function()
build.configTab.input.customMods = "\z
20% increased Maximum Energy Shield if both Equipped Rings have an Explicit Evasion Modifier\n\z
"
build.configTab:BuildModList()
runCallback("OnFrame")
build.itemsTab:CreateDisplayItemFromRaw([[
New Item
Elementalist Robe
Energy Shield: 116
]])
build.itemsTab:AddDisplayItem()
runCallback("OnFrame")
local baseEs = build.calcsTab.mainOutput.EnergyShield
build.itemsTab:CreateDisplayItemFromRaw([[
New Item
Ring
Implicits: 1
+71 to Evasion Rating
+10 to maximum life
]])
build.itemsTab:AddDisplayItem()
runCallback("OnFrame")
assert.are.equals(baseEs, build.calcsTab.mainOutput.EnergyShield) -- No change in es with just one ring.
build.itemsTab:CreateDisplayItemFromRaw([[
New Item
Ring
+71 to Evasion Rating
]])
build.itemsTab:AddDisplayItem()
runCallback("OnFrame")
assert.are.equals(baseEs, build.calcsTab.mainOutput.EnergyShield)
-- Es does not change after adding another ring with mod due to the first ring having an implicit evasion mod.
end)
it("Both slots explicit mod (evasion and es mastery)", function()
build.configTab.input.customMods = "\z
20% increased Maximum Energy Shield if both Equipped Rings have an Explicit Evasion Modifier\n\z
"
build.configTab:BuildModList()
runCallback("OnFrame")
build.itemsTab:CreateDisplayItemFromRaw([[
New Item
Elementalist Robe
Energy Shield: 116
]])
build.itemsTab:AddDisplayItem()
runCallback("OnFrame")
local baseEs = build.calcsTab.mainOutput.EnergyShield
build.itemsTab:CreateDisplayItemFromRaw([[
New Item
Ring
+71 to Evasion Rating
]])
build.itemsTab:AddDisplayItem()
runCallback("OnFrame")
assert.are.equals(baseEs, build.calcsTab.mainOutput.EnergyShield) -- No change in es with just one ring.
build.itemsTab:CreateDisplayItemFromRaw([[
New Item
Ring
+71 to Evasion Rating
]])
build.itemsTab:AddDisplayItem()
runCallback("OnFrame")
assert.are_not.equals(baseEs, build.calcsTab.mainOutput.EnergyShield)
-- Es changes after adding two rings with explicit mods.
end)
it("Both slots explicit mod no rings (evasion and es mastery)", function()
build.itemsTab:CreateDisplayItemFromRaw([[
New Item
Elementalist Robe
Energy Shield: 116
]])
build.itemsTab:AddDisplayItem()
runCallback("OnFrame")
local baseEs = build.calcsTab.mainOutput.EnergyShield
build.configTab.input.customMods = "\z
20% increased Maximum Energy Shield if both Equipped Rings have an Explicit Evasion Modifier\n\z
"
build.configTab:BuildModList()
runCallback("OnFrame")
assert.are.equals(baseEs, build.calcsTab.mainOutput.EnergyShield) -- No change in es with no rings.
end)
it("mod if no mod on x slot", function()
local baseLife = build.calcsTab.mainOutput.Life
build.configTab.input.customMods = "\z
15% increased maximum Life if there are no Life Modifiers on Equipped Body Armour\n\z
"
build.configTab:BuildModList()
runCallback("OnFrame")
assert.are_not.equals(baseLife, build.calcsTab.mainOutput.Life)
baseLife = build.calcsTab.mainOutput.Life
build.itemsTab:CreateDisplayItemFromRaw([[
New Item
Elementalist Robe
Energy Shield: 116
+95 to maximum Life
]])
build.itemsTab:AddDisplayItem()
runCallback("OnFrame")
assert.are_not.equals(baseLife, build.calcsTab.mainOutput.Life)
end)
it("globalLimit mods", function()
build.configTab.input.customMods = [[
-1000% to cold resistance
]]
build.configTab:BuildModList()
build.itemsTab:CreateDisplayItemFromRaw([[Replica Nebulis
Clasped Sceptre
League: Heist
Quality: 20
Sockets: B-B-B
LevelReq: 68
Implicits: 1
40% increased Elemental Damage
{fractured}{range:1}(15-20)% increased Cast Speed
{range:1}(15-20)% increased Cold Damage per 1% Missing Cold Resistance, up to a maximum of 300%
{range:1}(15-20)% increased Fire Damage per 1% Missing Fire Resistance, up to a maximum of 300%]])
build.itemsTab:AddDisplayItem()
build.skillsTab:PasteSocketGroup("Slot: Weapon 1\nFireball 20/0 Default 1\n")
runCallback("OnFrame")
assert.are_not.equals(340, build.calcsTab.mainEnv.modDB:Sum("INC", "FireDamage"))
assert.are_not.equals(340, build.calcsTab.mainEnv.modDB:Sum("INC", "ColdDamage"))
newBuild()
build.configTab.input.customMods = [[
Gain 25% increased Armour per 5 Power for 8 seconds when you Warcry, up to a maximum of 100%
Warcries have infinite Power
warcries grant arcane surge to you and allies, with 10% increased effect per 5 power, up to 100%
]]
build.configTab:BuildModList()
build.itemsTab:CreateDisplayItemFromRaw([[
New Item
Fur Plate
Armour: 60
]])
build.itemsTab:AddDisplayItem()
build.skillsTab:PasteSocketGroup("Arc 20/0 Default 1")
assert.are_not.equals(20, build.calcsTab.mainEnv.modDB:Sum("MORE", { flags = ModFlag.Cast }, "Speed"))
assert.are_not.equals(120, build.calcsTab.mainOutput.Armour)
runCallback("OnFrame")
end)
it("Jarngreipr - strength satisfies melee weapons and skills", function()
build.configTab.input.customMods = "+1000 Strength"
build.configTab:BuildModList()
build.itemsTab:CreateDisplayItemFromRaw([[
Rarity: UNIQUE
Chober Chaber
Leaden Greathammer
Variant: Pre 0.1.1
Variant: Current
Selected Variant: 2
Quality: 20
LevelReq: 33
Implicits: 0
+100 Intelligence Requirement
{variant:1}{range:0.5}(80-120)% increased Physical Damage
{variant:2}{range:0.5}Adds (58-65) to (102-110) Physical Damage
{range:0.5}+(80-100) to maximum Mana
{variant:2}+50 to Spirit
{variant:1}+5% to Critical Hit Chance
Increases and Reductions to Minion Damage also affect you
]])
build.itemsTab:AddDisplayItem()
runCallback("OnFrame")
assert.True(build.controls.warnings.lines[1]:match("Intelligence requirement") ~= nil)
assert.True(build.controls.warnings.lines[1]:match("Chober Chaber") ~= nil)
build.itemsTab:CreateDisplayItemFromRaw([[
Rarity: UNIQUE
Jarngreipr
Ringmail Gauntlets
Armour: 23
Evasion: 18
Variant: Pre 0.1.1
Variant: Current
Selected Variant: 2
Quality: 20
LevelReq: 6
Implicits: 0
{variant:2}50% increased Armour and Evasion
{range:0.5}Adds (2-3) to (5-6) Physical Damage to Attacks
{range:0.5}+(30-50) to maximum Life
{range:0.5}(4-8)% increased Attack Speed
Strength can satisfy other Attribute Requirements of Melee Weapons and Melee Skills
]])
build.itemsTab:AddDisplayItem()
runCallback("OnFrame")
assert.True(build.controls.warnings.lines[1] == nil) -- melee item check int
newBuild()
build.configTab.input.customMods = "+1000 Strength"
build.configTab:BuildModList()
build.skillsTab:PasteSocketGroup("Primal Strikes 20/0 1")
runCallback("OnFrame")
assert.True(build.controls.warnings.lines[1]:match("Dexterity requirement") ~= nil)
assert.True(build.controls.warnings.lines[1]:match("Primal Strikes") ~= nil)
build.itemsTab:CreateDisplayItemFromRaw([[
Rarity: UNIQUE
Jarngreipr
Ringmail Gauntlets
Armour: 23
Evasion: 18
Variant: Pre 0.1.1
Variant: Current
Selected Variant: 2
Quality: 20
LevelReq: 6
Implicits: 0
{variant:2}50% increased Armour and Evasion
{range:0.5}Adds (2-3) to (5-6) Physical Damage to Attacks
{range:0.5}+(30-50) to maximum Life
{range:0.5}(4-8)% increased Attack Speed
Strength can satisfy other Attribute Requirements of Melee Weapons and Melee Skills
]])
build.itemsTab:AddDisplayItem()
runCallback("OnFrame")
assert.True(build.controls.warnings.lines[1] == nil) -- melee skill check dex
build.skillsTab:PasteSocketGroup("Fireball 20/0 1")
runCallback("OnFrame")
-- make sure something like Fireball still needs the Int requirement and isn't being ignored
assert.True(build.controls.warnings.lines[1]:match("Intelligence requirement") ~= nil)
assert.True(build.controls.warnings.lines[1]:match("Fireball") ~= nil)
build.configTab.input.customMods = [[
+1000 Strength
+100 mana
Attribute Requirements of Gems can be satisified by your highest Attribute
]] -- fix mana warning
build.configTab:BuildModList()
runCallback("OnFrame")
assert.True(build.controls.warnings.lines[1] == nil) -- validate Gemling's Adaptive Capability still works
newBuild()
build.configTab.input.customMods = [[
+1000 Intelligence
+100 mana
Attribute Requirements of Gems can be satisified by your highest Attribute
]]
build.configTab:BuildModList()
build.skillsTab:PasteSocketGroup("Primal Strikes 20/0 1")
build.itemsTab:CreateDisplayItemFromRaw([[
Rarity: UNIQUE
Jarngreipr
Ringmail Gauntlets
Armour: 23
Evasion: 18
Variant: Pre 0.1.1
Variant: Current
Selected Variant: 2
Quality: 20
LevelReq: 6
Implicits: 0
{variant:2}50% increased Armour and Evasion
{range:0.5}Adds (2-3) to (5-6) Physical Damage to Attacks
{range:0.5}+(30-50) to maximum Life
{range:0.5}(4-8)% increased Attack Speed
Strength can satisfy other Attribute Requirements of Melee Weapons and Melee Skills
]])
build.itemsTab:AddDisplayItem()
runCallback("OnFrame")
assert.True(build.controls.warnings.lines[1] == nil) -- Gemling highest attribute still satisfies melee gems with Jarngreipr
end)
it("sacrosanctum - add life recoup to es recoup", function()
build.itemsTab:CreateDisplayItemFromRaw([[
Rarity: UNIQUE
Sacrosanctum
Corvus Mantle
Armour: 588
Energy Shield: 202
League: Dawn of the Hunt
Variant: Pre 0.4.0
Variant: Current
Selected Variant: 2
Quality: 20
LevelReq: 68
Implicits: 1
{range:0.5}+(20-30) to Spirit
{range:0.5}(80-120)% increased Armour and Energy Shield
{range:0.5}+(20-30) to Strength
{range:0.5}+(20-30) to Intelligence
{range:0.5}+(17-23)% to Chaos Resistance
{variant:1}{range:0.5}(5-10)% of Damage taken Recouped as Life
{variant:2}{range:0.5}(10-20)% of Damage taken Recouped as Life
Damage taken Recouped as Life is also Recouped as Energy Shield
]])
build.itemsTab:AddDisplayItem()
runCallback("OnFrame")
assert.True(build.calcsTab.calcsOutput.LifeRecoupRecoveryAvg > 0)
assert.True(build.calcsTab.calcsOutput.EnergyShieldRecoupRecoveryAvg > 0)
assert.True(build.calcsTab.calcsOutput.LifeRecoupRecoveryAvg == build.calcsTab.calcsOutput.EnergyShieldRecoupRecoveryAvg)
end)
it("solus ipse, max lineage count", function()
build.configTab.input.customMods = [[
You can Socket 2 additional copies of each Lineage Support Gem, in different Skills
]]
build.configTab:BuildModList()
runCallback("OnFrame")
build.skillsTab:PasteSocketGroup("Arc 20/0 1 \nZarokh's Refrain 1/0 1")
build.skillsTab:PasteSocketGroup("Ice Nova 20/0 1 \nZarokh's Refrain 1/0 1")
build.skillsTab:PasteSocketGroup("Fireball 20/0 1 \nZarokh's Refrain 1/0 1")
runCallback("OnFrame")
assert.are.equals(2, #build.controls.warnings.lines)
build.skillsTab:PasteSocketGroup("Comet 20/0 1 \nZarokh's Refrain 1/0 1")
runCallback("OnFrame")
assert.are.equals(3, #build.controls.warnings.lines)
assert.True(build.controls.warnings.lines[3]:match("lineage support gems allocated") ~= nil)
end)
end)