Skip to content

Commit d8011d0

Browse files
committed
Parse unscalable mods, increase mod precision, remove invalid mods from consideration, add more tests
1 parent 29d5fe9 commit d8011d0

3 files changed

Lines changed: 254 additions & 102 deletions

File tree

spec/System/TestItemParse_spec.lua

Lines changed: 181 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -523,37 +523,37 @@ describe("TestAdvancedItemParse #item", function()
523523

524524
assert.are.equals(advancedItem:BuildRaw(), equivalentCraftItem:BuildRaw())
525525

526-
local catalyst = new("Item", [[
526+
local vaaledCatalyst = new("Item", [[
527527
Item Class: Amulets
528528
Rarity: Unique
529529
Astramentis
530530
Onyx Amulet
531531
--------
532-
Quality (Attribute Modifiers): +20% (augmented)
532+
Quality (Attribute Modifiers): +19% (augmented)
533533
--------
534534
Requirements:
535535
Level: 20
536536
--------
537-
Item Level: 80
538-
--------
539-
Allocates Weathered Hunter (enchant)
537+
Item Level: 84
540538
--------
541-
{ Implicit Modifier — Attribute — 20% Increased }
539+
{ Implicit Modifier — Attribute — 19% Increased }
542540
+16(10-16) to all Attributes
543541
(Attributes are Strength, Dexterity, and Intelligence)
544542
--------
545-
{ Unique Modifier — Attribute — 20% Increased }
546-
+86(80-100) to all Attributes
543+
{ Unique Modifier — Attribute — 19% Increased }
544+
+120(80-100) to all Attributes
547545
(Attributes are Strength, Dexterity, and Intelligence)
548546
{ Unique Modifier — Physical, Attack }
549-
-4 Physical Damage taken from Attack Hits
547+
-3(-4) Physical Damage taken from Attack Hits
550548
--------
551549
Mindless rage will shake the world,
552550
Cunning lies will bend it.
553551
Reckless haste will break the world,
554552
And into darkness send it.
555553
--------
556-
Note: ~b/o 50 chaos
554+
Corrupted
555+
--------
556+
Note: ~b/o 1 mirror
557557
]])
558558

559559
local equivalentCatalystItem = new("Item", [[
@@ -566,76 +566,196 @@ describe("TestAdvancedItemParse #item", function()
566566
Implicits: 2
567567
{crafted}Allocates Weathered Hunter
568568
{tags:attribute}{range:1}+(10-16) to all Attributes
569-
{tags:attribute}{range:0.3}+(80-100) to all Attributes
569+
{tags:attribute}+120 to all Attributes
570570
{tags:physical,attack}-4 Physical Damage taken from Attack Hits
571571
]])
572572

573573
assert.are.equals(catalyst:BuildRaw(), equivalentCatalystItem:BuildRaw())
574-
local godTestItem = new("Item", [[
575-
Item Class: Sceptres
576-
Rarity: Unique
577-
Nebulis
578-
Synthesised Void Sceptre
574+
575+
local craftedWeapon = new("Item", [[
576+
Item Class: Staves
577+
Rarity: Rare
578+
Grim Beam
579+
Royal Staff
579580
--------
580-
Sceptre
581-
Physical Damage: 50-76
582-
Critical Strike Chance: 7.30%
583-
Attacks per Second: 1.25
584-
Weapon Range: 1.1 metres
585-
Memory Strands: 58
581+
Staff
582+
Physical Damage: 44-133 (augmented)
583+
Critical Strike Chance: 8.50%
584+
Attacks per Second: 1.15
585+
Weapon Range: 1.3 metres
586586
--------
587587
Requirements:
588-
Level: 68
589-
Str: 104
590-
Int: 122
588+
Level: 51
589+
Str: 51
590+
Int: 51
591591
--------
592-
Sockets: B R
592+
Sockets: G
593593
--------
594-
Item Level: 87
594+
Item Level: 68
595595
--------
596-
+30% to Fire Resistance (scourge)
597-
22% reduced Global Defences (scourge)
598-
(Armour, Evasion Rating and Energy Shield are the standard Defences) (scourge)
596+
{ Implicit Modifier }
597+
+20% Chance to Block Spell Damage while wielding a Staff
598+
(Warstaves are considered Staves)
599599
--------
600-
8% increased Explicit Cold Modifier magnitudes (enchant)
601-
Has 1 White Socket (enchant)
600+
{ Prefix Modifier "Warlock's" (Tier: 4) — Mana, Damage, Caster }
601+
32(30-37)% increased Spell Damage
602+
+46(42-47) to maximum Mana
603+
{ Prefix Modifier "Freezing" (Tier: 5) — Damage, Elemental, Cold, Caster }
604+
Adds 30(24-30) to 48(45-53) Cold Damage to Spells
605+
{ Prefix Modifier "Serrated" (Tier: 7) — Damage, Physical, Attack }
606+
64(50-64)% increased Physical Damage
607+
{ Suffix Modifier "of Anger" (Tier: 5) — Damage, Critical }
608+
+18(15-19)% to Global Critical Strike Multiplier
609+
{ Suffix Modifier "of Bliss" (Tier: 3) — Mana }
610+
71(59-72)% increased Mana Regeneration Rate
611+
{ Suffix Modifier "of Discharge" (Tier: 2) — Damage, Elemental, Lightning }
612+
40(40-44)% increased Lightning Damage
602613
--------
603-
{ Searing Exarch Implicit Modifier (Lesser) }
604-
Tempest Shield has 15(15-17)% increased Buff Effect
605-
{ Implicit Modifier — Damage, Critical — 106% Increased }
606-
+15(15-17)% to Global Critical Strike Multiplier
614+
Corrupted
607615
--------
608-
{ Prefix Modifier "Freezing" (Tier: 5) — Damage, Elemental, Cold, Caster — 8% Increased }
609-
Adds 17(16-20) to 35(30-36) Cold Damage to Spells
610-
{ Prefix Modifier "Beetle's" (Tier: 6) — Defences, Armour }
611-
9(6-13)% increased Armour
612-
7(6-7)% increased Stun and Block Recovery
613-
{ Master Crafted Prefix Modifier "Upgraded" — Life, Defences, Armour }
614-
21(18-21)% increased Armour
615-
+18(17-19) to maximum Life
616-
{ Unique Modifier }
617-
106(60-120)% increased Implicit Modifier magnitudes — Unscalable Value
618-
(Implicit Modifiers are those that come from an item's type, rather than its random properties)
619-
{ Master Crafted Suffix Modifier "of Craft" (Rank: 3) — Elemental, Cold, Resistance }
620-
+35(29-35)% to Cold Resistance
621-
{ Fractured Prefix Modifier "Thorny" (Tier: 2) — Damage, Physical }
622-
Reflects 3(1-4) Physical Damage to Melee Attackers
623-
{ Prefix Modifier "Veiled" }
624-
Veiled Prefix
625-
Searing Exarch Item
616+
Note: ~b/o 1 alch
617+
]])
618+
619+
-- This gives a range to maximum mana, because GGG rolls multi-line mods separately, while we don't (for now?)
620+
local equivCraftedWeapon = new("Item", [[
621+
Grim Beam
622+
Royal Staff
623+
Crafted: true
624+
Prefix: {range:0.286}SpellDamageAndManaOnTwoHandWeapon4
625+
Prefix: {range:0.375}LocalAddedColdDamageTwoHand5
626+
Prefix: {range:1}LocalIncreasedPhysicalDamagePercent2
627+
Suffix: {range:0.75}LocalCriticalMultiplier2
628+
Suffix: {range:0.923}ManaRegenerationTwoHand4
629+
Suffix: {range:0}LightningDamagePercentTwoHand5
630+
Item Level: 68
631+
Quality: 0
632+
Sockets: G
633+
LevelReq: 28
634+
Implicits: 1
635+
+20% Chance to Block Spell Damage while wielding a Staff
636+
{tags:mana,damage,caster}32% increased Spell Damage
637+
{tags:mana,damage,caster}{range:0.8}+(42-47) to maximum Mana
638+
{tags:damage,elemental,cold,caster}Adds 30 to 48 Cold Damage to Spells
639+
{tags:damage,physical,attack}64% increased Physical Damage
640+
{tags:damage,critical}+18% to Global Critical Strike Multiplier
641+
{tags:mana}71% increased Mana Regeneration Rate
642+
{tags:damage,elemental,lightning}40% increased Lightning Damage
643+
Corrupted
644+
]])
645+
646+
assert.are.equals(craftedWeapon:BuildRaw(), equivCraftedWeapon:BuildRaw())
647+
648+
local badUnique = new("Item", [[
649+
Item Class: Amulets
650+
Rarity: Unique
651+
Astramentis
652+
Onyx Amulet
626653
--------
627-
{ Allocated Crucible Passive Skill (Tier: 2) }
628-
Adds 2 to 6 Physical Damage to Spells
654+
Requirements:
655+
Level: 20
629656
--------
630-
Synthesised Item
657+
Item Level: 84
631658
--------
632-
Corrupted
659+
{ Implicit Modifier — Attribute }
660+
+12(10-16) to all Attributes
661+
(Attributes are Strength, Dexterity, and Intelligence)
633662
--------
634-
Scourged
663+
{ Unique Modifier — Attribute }
664+
+69(80-100) to all Attributes
665+
(Attributes are Strength, Dexterity, and Intelligence)
666+
{ Unique Modifier — Physical, Attack }
667+
-4 Physical Damage taken from Attack Hits
635668
--------
636-
Hinekora's Lock
669+
Mindless rage will shake the world,
670+
Cunning lies will bend it.
671+
Reckless haste will break the world,
672+
And into darkness send it.
637673
--------
638-
Note: ~b/o 2 chaos
674+
Corrupted
675+
--------
676+
Note: ~b/o 69 mirror
677+
]])
678+
679+
local equivBadUnique = new("Item", [[
680+
Astramentis
681+
Onyx Amulet
682+
Item Level: 84
683+
LevelReq: 20
684+
Implicits: 1
685+
{tags:attribute}{range:0.333}+(10-16) to all Attributes
686+
{tags:attribute}+69 to all Attributes
687+
{tags:physical,attack}-4 Physical Damage taken from Attack Hits
688+
Corrupted
689+
]])
690+
691+
assert.are.equals(badUnique:BuildRaw(), equivBadUnique:BuildRaw())
692+
693+
694+
local godTestItem = new("Item", [[
695+
Item Class: Sceptres
696+
Rarity: Unique
697+
Nebulis
698+
Synthesised Void Sceptre
699+
--------
700+
Sceptre
701+
Physical Damage: 50-76
702+
Critical Strike Chance: 7.30%
703+
Attacks per Second: 1.25
704+
Weapon Range: 1.1 metres
705+
Memory Strands: 58
706+
--------
707+
Requirements:
708+
Level: 68
709+
Str: 104
710+
Int: 122
711+
--------
712+
Sockets: B R
713+
--------
714+
Item Level: 87
715+
--------
716+
+30% to Fire Resistance (scourge)
717+
22% reduced Global Defences (scourge)
718+
(Armour, Evasion Rating and Energy Shield are the standard Defences) (scourge)
719+
--------
720+
8% increased Explicit Cold Modifier magnitudes (enchant)
721+
Has 1 White Socket (enchant)
722+
--------
723+
{ Searing Exarch Implicit Modifier (Lesser) }
724+
Tempest Shield has 15(15-17)% increased Buff Effect
725+
{ Implicit Modifier — Damage, Critical — 106% Increased }
726+
+15(15-17)% to Global Critical Strike Multiplier
727+
--------
728+
{ Prefix Modifier "Freezing" (Tier: 5) — Damage, Elemental, Cold, Caster — 8% Increased }
729+
Adds 17(16-20) to 35(30-36) Cold Damage to Spells
730+
{ Prefix Modifier "Beetle's" (Tier: 6) — Defences, Armour }
731+
9(6-13)% increased Armour
732+
7(6-7)% increased Stun and Block Recovery
733+
{ Master Crafted Prefix Modifier "Upgraded" — Life, Defences, Armour }
734+
21(18-21)% increased Armour
735+
+18(17-19) to maximum Life
736+
{ Unique Modifier }
737+
106(60-120)% increased Implicit Modifier magnitudes — Unscalable Value
738+
(Implicit Modifiers are those that come from an item's type, rather than its random properties)
739+
{ Master Crafted Suffix Modifier "of Craft" (Rank: 3) — Elemental, Cold, Resistance }
740+
+35(29-35)% to Cold Resistance
741+
{ Fractured Prefix Modifier "Thorny" (Tier: 2) — Damage, Physical }
742+
Reflects 3(1-4) Physical Damage to Melee Attackers
743+
{ Prefix Modifier "Veiled" }
744+
Veiled Prefix
745+
Searing Exarch Item
746+
--------
747+
{ Allocated Crucible Passive Skill (Tier: 2) }
748+
Adds 2 to 6 Physical Damage to Spells
749+
--------
750+
Synthesised Item
751+
--------
752+
Corrupted
753+
--------
754+
Scourged
755+
--------
756+
Hinekora's Lock
757+
--------
758+
Note: ~b/o 2 chaos
639759
]])
640760
end)
641761
end)

0 commit comments

Comments
 (0)