11describe (" TestAttacks" , function ()
2- before_each (function ()
3- newBuild ()
4- end )
2+ before_each (function ()
3+ newBuild ()
4+ end )
55
6- teardown (function ()
7- -- newBuild() takes care of resetting everything in setup()
8- end )
6+ teardown (function ()
7+ -- newBuild() takes care of resetting everything in setup()
8+ end )
99
10- it (" creates an item and has the correct crit chance" , function ()
11- assert .are .equals (build .calcsTab .mainOutput .CritChance , 0 )
12- build .itemsTab :CreateDisplayItemFromRaw (" New Item\n Maraketh Bow\n Crafted: true\n Prefix: None\n Prefix: None\n Prefix: None\n Suffix: None\n Suffix: None\n Suffix: None\n Quality: 20\n Sockets: G-G-G-G-G-G\n LevelReq: 71\n Implicits: 1\n {tags:speed}10% increased Movement Speed" )
13- build .itemsTab :AddDisplayItem ()
14- runCallback (" OnFrame" )
15- assert .are .equals (build .calcsTab .mainOutput .CritChance , 5.5 * build .calcsTab .mainOutput .HitChance / 100 )
16- end )
10+ it (" creates an item and has the correct crit chance" , function ()
11+ assert .are .equals (build .calcsTab .mainOutput .CritChance , 0 )
12+ build .itemsTab :CreateDisplayItemFromRaw (" New Item\n Maraketh Bow\n Crafted: true\n Prefix: None\n Prefix: None\n Prefix: None\n Suffix: None\n Suffix: None\n Suffix: None\n Quality: 20\n Sockets: G-G-G-G-G-G\n LevelReq: 71\n Implicits: 1\n {tags:speed}10% increased Movement Speed" )
13+ build .itemsTab :AddDisplayItem ()
14+ runCallback (" OnFrame" )
15+ assert .are .equals (build .calcsTab .mainOutput .CritChance , 5.5 * build .calcsTab .mainOutput .HitChance / 100 )
16+ end )
1717
18- it (" creates an item and has the correct crit multi" , function ()
19- assert .are .equals (1.5 , build .calcsTab .mainOutput .CritMultiplier )
20- build .itemsTab :CreateDisplayItemFromRaw (" New Item\n Assassin Bow\n Crafted: true\n Prefix: None\n Prefix: None\n Prefix: None\n Suffix: None\n Suffix: None\n Suffix: None\n Quality: 20\n Sockets: G-G-G-G-G-G\n LevelReq: 62\n Implicits: 1\n {tags:damage,critical}{range:0.5}+(15-25)% to Global Critical Strike Multiplier" )
21- build .itemsTab :AddDisplayItem ()
22- runCallback (" OnFrame" )
23- assert .are .equals (1.5 + 0.2 , build .calcsTab .mainOutput .CritMultiplier )
24- end )
18+ it (" creates an item and has the correct crit multi" , function ()
19+ assert .are .equals (1.5 , build .calcsTab .mainOutput .CritMultiplier )
20+ build .itemsTab :CreateDisplayItemFromRaw (" New Item\n Assassin Bow\n Crafted: true\n Prefix: None\n Prefix: None\n Prefix: None\n Suffix: None\n Suffix: None\n Suffix: None\n Quality: 20\n Sockets: G-G-G-G-G-G\n LevelReq: 62\n Implicits: 1\n {tags:damage,critical}{range:0.5}+(15-25)% to Global Critical Strike Multiplier" )
21+ build .itemsTab :AddDisplayItem ()
22+ runCallback (" OnFrame" )
23+ assert .are .equals (1.5 + 0.2 , build .calcsTab .mainOutput .CritMultiplier )
24+ end )
2525
26- it (" correctly converts spell damage per stat to attack damage" , function ()
27- assert .are .equals (0 , build .calcsTab .mainEnv .player .modDB :Sum (" INC" , { flags = ModFlag .Attack }, " Damage" ))
28- build .itemsTab :CreateDisplayItemFromRaw ([[
29- New Item
30- Coral Amulet
31- 10% increased attack damage
32- 10% increased spell damage
33- 1% increased spell damage per 10 intelligence
34- ]] )
35- build .itemsTab :AddDisplayItem ()
36- runCallback (" OnFrame" )
37- assert .are .equals (10 , build .calcsTab .mainEnv .player .modDB :Sum (" INC" , { flags = ModFlag .Attack }, " Damage" ))
38- -- Scion starts with 20 Intelligence
39- assert .are .equals (12 , build .calcsTab .mainEnv .player .modDB :Sum (" INC" , { flags = ModFlag .Spell }, " Damage" ))
26+ it (" correctly converts spell damage per stat to attack damage" , function ()
27+ assert .are .equals (0 , build .calcsTab .mainEnv .player .modDB :Sum (" INC" , { flags = ModFlag .Attack }, " Damage" ))
28+ build .itemsTab :CreateDisplayItemFromRaw ([[
29+ New Item
30+ Coral Amulet
31+ 10% increased attack damage
32+ 10% increased spell damage
33+ 1% increased spell damage per 10 intelligence
34+ ]] )
35+ build .itemsTab :AddDisplayItem ()
36+ runCallback (" OnFrame" )
37+ assert .are .equals (10 , build .calcsTab .mainEnv .player .modDB :Sum (" INC" , { flags = ModFlag .Attack }, " Damage" ))
38+ -- Scion starts with 20 Intelligence
39+ assert .are .equals (12 , build .calcsTab .mainEnv .player .modDB :Sum (" INC" , { flags = ModFlag .Spell }, " Damage" ))
4040
41- build .itemsTab :CreateDisplayItemFromRaw ([[
42- New Item
43- Coral Ring
44- increases and reductions to spell damage also apply to attacks
45- ]] )
46- build .itemsTab :AddDisplayItem ()
47- runCallback (" OnFrame" )
48- assert .are .equals (22 , build .calcsTab .mainEnv .player .mainSkill .skillModList :Sum (" INC" , { flags = ModFlag .Attack }, " Damage" ))
41+ build .itemsTab :CreateDisplayItemFromRaw ([[
42+ New Item
43+ Coral Ring
44+ increases and reductions to spell damage also apply to attacks
45+ ]] )
46+ build .itemsTab :AddDisplayItem ()
47+ runCallback (" OnFrame" )
48+ assert .are .equals (22 , build .calcsTab .mainEnv .player .mainSkill .skillModList :Sum (" INC" , { flags = ModFlag .Attack }, " Damage" ))
4949
50- end )
50+ end )
5151end )
0 commit comments