Skip to content

Commit

Permalink
Adds parsing for local elemental inc damage (#8222)
Browse files Browse the repository at this point in the history
* adds parsing for local elemental inc damage

* fix it not applying to ele menetal
  • Loading branch information
Regisle committed Aug 31, 2024
1 parent 996d33c commit 982890e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Classes/Item.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1347,6 +1347,7 @@ function ItemClass:BuildModListForSlotNum(baseList, slotNum)
weaponData.AttackRate = round(self.base.weapon.AttackRateBase * (1 + weaponData.AttackSpeedInc / 100), 2)
weaponData.rangeBonus = calcLocal(modList, "WeaponRange", "BASE", 0) + 10 * calcLocal(modList, "WeaponRangeMetre", "BASE", 0) + m_floor(self.quality / 10 * calcLocal(modList, "AlternateQualityLocalWeaponRangePer10Quality", "BASE", 0))
weaponData.range = self.base.weapon.Range + weaponData.rangeBonus
local LocalIncEle = calcLocal(modList, "LocalElementalDamage", "INC", 0)
for _, dmgType in pairs(dmgTypeList) do
local min = (self.base.weapon[dmgType.."Min"] or 0) + calcLocal(modList, dmgType.."Min", "BASE", 0)
local max = (self.base.weapon[dmgType.."Max"] or 0) + calcLocal(modList, dmgType.."Max", "BASE", 0)
Expand All @@ -1358,6 +1359,10 @@ function ItemClass:BuildModListForSlotNum(baseList, slotNum)
end
min = round(min * (1 + physInc / 100) * (1 + qualityScalar / 100))
max = round(max * (1 + physInc / 100) * (1 + qualityScalar / 100))
elseif dmgType ~= "Physical" and dmgType ~= "Chaos" then
local localInc = calcLocal(modList, "Local"..dmgType.."Damage", "INC", 0) + LocalIncEle
min = round(min * (1 + localInc / 100))
max = round(max * (1 + localInc / 100))
end
if min > 0 and max > 0 then
weaponData[dmgType.."Min"] = min
Expand Down
1 change: 1 addition & 0 deletions src/Modules/ModParser.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2728,6 +2728,7 @@ local specialModList = {
["has (%d+) sockets?"] = function(num) return { mod("SocketCount", "BASE", num) } end,
["has (%d+) abyssal sockets?"] = function(num) return { mod("AbyssalSocketCount", "BASE", num) } end,
["no physical damage"] = { mod("WeaponData", "LIST", { key = "PhysicalMin" }), mod("WeaponData", "LIST", { key = "PhysicalMax" }), mod("WeaponData", "LIST", { key = "PhysicalDPS" }) },
["has (%d+)%% increased elemental damage"] = function(num) return { mod("LocalElementalDamage", "INC", num) } end,
["all attacks with this weapon are critical strikes"] = { mod("WeaponData", "LIST", { key = "CritChance", value = 100 }) },
["this weapon's critical strike chance is (%d+)%%"] = function(num) return { mod("WeaponData", "LIST", { key = "CritChance", value = num }) } end,
["counts as dual wielding"] = { mod("WeaponData", "LIST", { key = "countsAsDualWielding", value = true }) },
Expand Down

0 comments on commit 982890e

Please sign in to comment.