|
71 | 71 | local lineFlags = { |
72 | 72 | ["crafted"] = true, ["crucible"] = true, ["custom"] = true, ["eater"] = true, ["enchant"] = true, |
73 | 73 | ["exarch"] = true, ["fractured"] = true, ["implicit"] = true, ["scourge"] = true, ["synthesis"] = true, |
| 74 | + ["mutated"] = true |
74 | 75 | } |
75 | 76 |
|
76 | 77 | -- Special function to store unique instances of modifier on specific item slots |
@@ -682,6 +683,9 @@ function ItemClass:ParseRaw(raw, rarity, highQuality) |
682 | 683 | if not (self.rarity == "NORMAL" or self.rarity == "MAGIC") then |
683 | 684 | self.title = self.name |
684 | 685 | end |
| 686 | + if self.title and self.title:find("Foulborn") then |
| 687 | + self.foulborn = true |
| 688 | + end |
685 | 689 | self.type = base.type |
686 | 690 | self.base = base |
687 | 691 | self.affixes = (self.base.subType and data.itemMods[self.base.type..self.base.subType]) |
@@ -778,6 +782,27 @@ function ItemClass:ParseRaw(raw, rarity, highQuality) |
778 | 782 | self.canHaveShieldCrucibleTree = true |
779 | 783 | elseif lineLower == "has a two handed sword crucible passive skill tree" then |
780 | 784 | self.canHaveTwoHandedSwordCrucibleTree = true |
| 785 | + elseif lineLower == "cannot roll caster modifiers" then |
| 786 | + self.restrictTag = true |
| 787 | + self.noCaster = true |
| 788 | + elseif lineLower == "cannot roll attack modifiers" then |
| 789 | + self.restrictTag = true |
| 790 | + self.noAttack = true |
| 791 | + elseif lineLower == "cannot roll modifiers of non-cold damage types" then |
| 792 | + self.restrictDamageType = true |
| 793 | + self.onlyColdDamage = true |
| 794 | + elseif lineLower == "cannot roll modifiers of non-fire damage types" then |
| 795 | + self.restrictDamageType = true |
| 796 | + self.onlyFireDamage = true |
| 797 | + elseif lineLower == "cannot roll modifiers of non-lightning damage types" then |
| 798 | + self.restrictDamageType = true |
| 799 | + self.onlyLightningDamage = true |
| 800 | + elseif lineLower == "cannot roll modifiers of non-chaos damage types" then |
| 801 | + self.restrictDamageType = true |
| 802 | + self.onlyChaosDamage = true |
| 803 | + elseif lineLower == "cannot roll modifiers of non-physical damage types" then |
| 804 | + self.restrictDamageType = true |
| 805 | + self.onlyPhysicalDamage = true |
781 | 806 | end |
782 | 807 |
|
783 | 808 | local modLines |
@@ -855,7 +880,7 @@ function ItemClass:ParseRaw(raw, rarity, highQuality) |
855 | 880 | self.affixLimit = 2 |
856 | 881 | end |
857 | 882 | elseif self.rarity == "RARE" then |
858 | | - self.affixLimit = ((self.type == "Jewel" and not (self.base.subType == "Abyss" and self.corrupted)) and 4 or 6) |
| 883 | + self.affixLimit = (((self.type == "Jewel" and not (self.base.subType == "Abyss" and self.corrupted)) or self.type == "Graft") and 4 or 6) |
859 | 884 | if self.prefixes.limit or self.suffixes.limit then |
860 | 885 | self.prefixes.limit = m_max(m_min((self.prefixes.limit or 0) + self.affixLimit / 2, self.affixLimit), 0) |
861 | 886 | self.suffixes.limit = m_max(m_min((self.suffixes.limit or 0) + self.affixLimit / 2, self.affixLimit), 0) |
@@ -954,6 +979,32 @@ function ItemClass:GetModSpawnWeight(mod, includeTags, excludeTags) |
954 | 979 | local function HasMavenInfluence(modAffix) |
955 | 980 | return modAffix:match("Elevated") |
956 | 981 | end |
| 982 | + if self.restrictTag then |
| 983 | + for _, key in ipairs(mod.modTags) do |
| 984 | + local flagName = "no" .. key:gsub("^%l", string.upper) |
| 985 | + if flagName and self[flagName] then |
| 986 | + return 0 |
| 987 | + end |
| 988 | + end |
| 989 | + end |
| 990 | + if self.restrictDamageType then |
| 991 | + local required, restricted = false, {} |
| 992 | + for _, element in ipairs({ "fire", "cold", "lightning", "chaos", "physical" }) do |
| 993 | + local flagName = "only" .. element:gsub("^%l", string.upper) .. "Damage" |
| 994 | + if self[flagName] then |
| 995 | + required = true |
| 996 | + else |
| 997 | + restricted[element] = true |
| 998 | + end |
| 999 | + end |
| 1000 | + if required then |
| 1001 | + for _, key in ipairs(mod.modTags) do |
| 1002 | + if restricted[key] then |
| 1003 | + return 0 |
| 1004 | + end |
| 1005 | + end |
| 1006 | + end |
| 1007 | + end |
957 | 1008 |
|
958 | 1009 | for i, key in ipairs(mod.weightKey) do |
959 | 1010 | if (self.base.tags[key] or (includeTags and includeTags[key]) or HasInfluenceTag(key)) and not (excludeTags and excludeTags[key]) then |
@@ -1068,6 +1119,9 @@ function ItemClass:BuildRaw() |
1068 | 1119 | if modLine.crucible then |
1069 | 1120 | line = "{crucible}" .. line |
1070 | 1121 | end |
| 1122 | + if modLine.mutated then |
| 1123 | + line = "{mutated}" .. line |
| 1124 | + end |
1071 | 1125 | if modLine.fractured then |
1072 | 1126 | line = "{fractured}" .. line |
1073 | 1127 | end |
@@ -1278,6 +1332,8 @@ function ItemClass:GetPrimarySlot() |
1278 | 1332 | return "Flask 1" |
1279 | 1333 | elseif self.type == "Tincture" then |
1280 | 1334 | return "Flask 1" |
| 1335 | + elseif self.type == "Graft" then |
| 1336 | + return "Graft 1" |
1281 | 1337 | else |
1282 | 1338 | return self.type |
1283 | 1339 | end |
@@ -1582,8 +1638,10 @@ function ItemClass:BuildModListForSlotNum(baseList, slotNum) |
1582 | 1638 |
|
1583 | 1639 | -- Small and Medium Curse Cluster Jewel passive mods are parsed the same so the medium cluster data overwrites small and the skills differ |
1584 | 1640 | -- This changes small curse clusters to have the correct clusterJewelSkill so it passes validation below and works as expected in the tree |
1585 | | - if jewelData.clusterJewelSkill == "affliction_curse_effect" and jewelData.clusterJewelNodeCount and jewelData.clusterJewelNodeCount < 4 then |
| 1641 | + if self.clusterJewel.size == "Small" and jewelData.clusterJewelSkill == "affliction_curse_effect" then |
1586 | 1642 | jewelData.clusterJewelSkill = "affliction_curse_effect_small" |
| 1643 | + elseif self.clusterJewel.size == "Medium" and jewelData.clusterJewelSkill == "affliction_curse_effect_small" then |
| 1644 | + jewelData.clusterJewelSkill = "affliction_curse_effect" |
1587 | 1645 | end |
1588 | 1646 |
|
1589 | 1647 | -- Validation |
|
0 commit comments