Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tinctures #7749

Merged
merged 12 commits into from
Jul 22, 2024
2 changes: 1 addition & 1 deletion src/Classes/ImportTab.lua
Original file line number Diff line number Diff line change
Expand Up @@ -840,7 +840,7 @@ function ImportTabClass:ImportItem(itemData, slotName)
if itemData.ilvl > 0 then
item.itemLevel = itemData.ilvl
end
if item.base.weapon or item.base.armour or item.base.flask then
if item.base.weapon or item.base.armour or item.base.flask or item.base.tincture then
item.quality = 0
end
if itemData.properties then
Expand Down
24 changes: 23 additions & 1 deletion src/Classes/Item.lua
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,7 @@ function ItemClass:ParseRaw(raw, rarity, highQuality)
self.baseLines = { }
local importedLevelReq
local flaskBuffLines
local tinctureBuffLines
local deferJewelRadiusIndexAssignment
local gameModeStage = "FINDIMPLICIT"
local foundExplicit, foundImplicit
Expand All @@ -370,6 +371,8 @@ function ItemClass:ParseRaw(raw, rarity, highQuality)
local line = self.rawLines[l]
if flaskBuffLines and flaskBuffLines[line] then
flaskBuffLines[line] = nil
elseif tinctureBuffLines and tinctureBuffLines[line] then
tinctureBuffLines[line] = nil
elseif line == "--------" then
self.checkSection = true
elseif line == "Split" then
Expand Down Expand Up @@ -702,6 +705,14 @@ function ItemClass:ParseRaw(raw, rarity, highQuality)
t_insert(self.buffModLines, { line = line, extra = extra, modList = modList or { } })
end
end
if self.base.tincture and self.base.tincture.buff and not tinctureBuffLines then
tinctureBuffLines = { }
for _, line in ipairs(self.base.tincture.buff) do
tinctureBuffLines[line] = true
local modList, extra = modLib.parseMod(line)
t_insert(self.buffModLines, { line = line, extra = extra, modList = modList or { } })
end
end
end
-- Base lines don't need mod parsing, skip it
goto continue
Expand Down Expand Up @@ -1470,10 +1481,18 @@ function ItemClass:BuildModListForSlotNum(baseList, slotNum)
flaskData.chargesMax = self.base.flask.chargesMax + calcLocal(modList, "FlaskCharges", "BASE", 0)
flaskData.chargesUsed = m_floor(self.base.flask.chargesUsed * (1 + calcLocal(modList, "FlaskChargesUsed", "INC", 0) / 100))
flaskData.gainMod = 1 + calcLocal(modList, "FlaskChargeRecovery", "INC", 0) / 100
flaskData.effectInc = calcLocal(modList, "FlaskEffect", "INC", 0)
flaskData.effectInc = calcLocal(modList, "FlaskEffect", "INC", 0) + calcLocal(modList, "LocalEffect", "INC", 0)
for _, value in ipairs(modList:List(nil, "FlaskData")) do
flaskData[value.key] = value.value
end
elseif self.base.tincture then
local tinctureData = self.tinctureData
tinctureData.manaBurn = self.base.tincture.manaBurn * (1 + calcLocal(modList, "TinctureManaBurnRate", "INC", 0) / 100) * (1 + calcLocal(modList, "TinctureManaBurnRate", "MORE", 0) / 100)
tinctureData.cooldown = self.base.tincture.cooldown / (1 + calcLocal(modList, "TinctureCooldownRecovery", "INC", 0) / 100)
tinctureData.effectInc = calcLocal(modList, "TinctureEffect", "INC", 0) + calcLocal(modList, "LocalEffect", "INC", 0)
for _, value in ipairs(modList:List(nil, "TinctureData")) do
tinctureData[value.key] = value.value
end
elseif self.type == "Jewel" then
if self.name:find("Grand Spectrum") then
local spectrumMod = modLib.createMod("Multiplier:GrandSpectrum", "BASE", 1, self.name)
Expand Down Expand Up @@ -1539,6 +1558,9 @@ function ItemClass:BuildModList()
elseif self.base.flask then
self.flaskData = { }
self.buffModList = { }
elseif self.base.tincture then
self.tinctureData = { }
self.buffModList = { }
elseif self.type == "Jewel" then
self.jewelData = { }
end
Expand Down
2 changes: 1 addition & 1 deletion src/Classes/ItemDBControl.lua
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ function ItemDBClass:ListBuilder()
item.measuredPower = 0
for slotName, slot in pairs(self.itemsTab.slots) do
if self.itemsTab:IsItemValidForSlot(item, slotName) and not slot.inactive and (not slot.weaponSet or slot.weaponSet == (self.itemsTab.activeItemSet.useSecondWeaponSet and 2 or 1)) then
local output = calcFunc(item.base.flask and { toggleFlask = item } or { repSlotName = slotName, repItem = item }, { nodeAlloc = true, requirementsGems = true })
local output = calcFunc(item.base.flask and { toggleFlask = item } or item.base.tincture and { toggleTincture = item } or { repSlotName = slotName, repItem = item }, { nodeAlloc = true, requirementsGems = true })
local measuredPower = output.Minion and output.Minion[self.sortMode] or output[self.sortMode] or 0
if self.sortDetail.transform then
measuredPower = self.sortDetail.transform(measuredPower)
Expand Down
50 changes: 50 additions & 0 deletions src/Classes/ItemsTab.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3261,6 +3261,17 @@ function ItemsTabClass:AddItemTooltip(tooltip, item, slot, dbMode)
for _, modLine in pairs(item.buffModLines) do
tooltip:AddLine(16, (modLine.extra and colorCodes.UNSUPPORTED or colorCodes.MAGIC) .. modLine.line)
end
elseif base.tincture then
-- Tincture-specific info
local tinctureData = item.tinctureData
if item.quality > 0 then
tooltip:AddLine(16, s_format("^x7F7F7FQuality: "..colorCodes.MAGIC.."+%d%%", item.quality))
end
tooltip:AddLine(16, s_format("^x7F7F7FInflicts Mana Burn every %s%.2f ^x7F7F7FSeconds", main:StatColor(tinctureData.manaBurn, base.tincture.manaBurn), tinctureData.manaBurn))
tooltip:AddLine(16, s_format("^x7F7F7F%s%.2f ^x7F7F7FSecond Cooldown When Deactivated", main:StatColor(tinctureData.cooldown, base.tincture.cooldown), tinctureData.cooldown))
for _, modLine in pairs(item.buffModLines) do
tooltip:AddLine(16, (modLine.extra and colorCodes.UNSUPPORTED or colorCodes.MAGIC) .. modLine.line)
end
elseif item.type == "Jewel" then
-- Jewel-specific info
if item.limit then
Expand Down Expand Up @@ -3592,6 +3603,45 @@ function ItemsTabClass:AddItemTooltip(tooltip, item, slot, dbMode)
header = "^7Activating this flask will give you:"
end
self.build:AddStatComparesToTooltip(tooltip, calcBase, output, header)
elseif base.tincture then
-- Special handling for tinctures
local stats = { }
local tinctureData = item.tinctureData
local modDB = self.build.calcsTab.mainEnv.modDB
local output = self.build.calcsTab.mainOutput
local effectInc = modDB:Sum("INC", { actor = "player" }, "TinctureEffect")

if item.rarity == "MAGIC" then
effectInc = effectInc + modDB:Sum("INC", { actor = "player" }, "MagicTinctureEffect")
end
local effectMod = 1 + (tinctureData.effectInc + effectInc) / 100
if effectMod ~= 1 then
t_insert(stats, s_format("^8Tincture effect modifier: ^7%+d%%", effectMod * 100 - 100))
end
t_insert(stats, s_format("^8Mana Burn Inflicted Every Second: ^7%.2f", tinctureData.manaBurn * (1 + modDB:Sum("INC", { actor = "player" }, "TinctureManaBurnRate")/100) * (1 + modDB:Sum("MORE", { actor = "player" }, "TinctureManaBurnRate")/100)))
local TincturesNotInflictManaBurn = m_min(modDB:Sum("BASE", nil, "TincturesNotInflictManaBurn"), 100)
if TincturesNotInflictManaBurn ~= 0 then
t_insert(stats, s_format("^8Chance to not inflict Mana Burn: ^7%d%%", TincturesNotInflictManaBurn))
end
t_insert(stats, s_format("^8Tincture Cooldown when deactivated: ^7%.2f^8 seconds", tinctureData.cooldown / (1 + modDB:Sum("INC", { actor = "player" }, "TinctureCooldownRecovery")/100)))

if stats[1] then
tooltip:AddLine(14, "^7Effective tincture stats:")
for _, stat in ipairs(stats) do
tooltip:AddLine(14, stat)
end
end
local storedGlobalCacheDPSView = GlobalCache.useFullDPS
GlobalCache.useFullDPS = GlobalCache.numActiveSkillInFullDPS > 0
local output = calcFunc({ toggleTincture = item }, {})
GlobalCache.useFullDPS = storedGlobalCacheDPSView
local header
if self.build.calcsTab.mainEnv.tinctures[item] then
header = "^7Deactivating this tincture will give you:"
else
header = "^7Activating this tincture will give you:"
end
self.build:AddStatComparesToTooltip(tooltip, calcBase, output, header)
else
self:UpdateSockets()
-- Build sorted list of slots to compare with
Expand Down
58 changes: 33 additions & 25 deletions src/Data/Bases/tincture.lua
Original file line number Diff line number Diff line change
@@ -1,68 +1,76 @@
-- This file is automatically generated, do not edit!
-- This file is currently manually edited, data will be wrong!
-- Item data (c) Grinding Gear Games
local itemBases = ...

itemBases["Ironwood Tincture"] = {
type = "Tincture",
hidden = true,
tags = { tincture = true, default = true, },
implicit = "Damaging Hits always Stun Enemies that are on Full Life",
implicitModTypes = { { "attack" }, },
implicit = "Damaging Hits with Melee Weapons always Stun Enemies that are on Full Life",
implicitModTypes = { },
tincture = { manaBurn = 0.6, cooldown = 7 },
req = { },
}
itemBases["Ashbark Tincture"] = {
type = "Tincture",
hidden = true,
tags = { tincture = true, default = true, },
implicit = "All Damage can Ignite",
implicitModTypes = { { "elemental", "fire", "attack", "ailment" }, },
implicit = "(20-30)% Chance to Ignite with Melee Weapons\n(80-100)% Increased Damage with Ignite From Melee Weapons",
implicitModTypes = { },
tincture = { manaBurn = 0.6, cooldown = 7 },
req = { },
}
itemBases["Fulgurite Tincture"] = {
type = "Tincture",
hidden = true,
tags = { tincture = true, default = true, },
implicit = "All Damage can Shock",
implicitModTypes = { { "elemental", "lightning", "attack", "ailment" }, },
implicit = "(20-30)% Chance to Shock with Melee Weapons\n(35-40)% Increased Effect of Shock from Melee Weapons",
implicitModTypes = { },
tincture = { manaBurn = 0.6, cooldown = 7 },
req = { },
}
itemBases["Poisonberry Tincture"] = {
type = "Tincture",
hidden = true,
tags = { tincture = true, default = true, },
implicit = "All Damage can Poison",
implicitModTypes = { { "poison", "chaos", "attack", "ailment" }, },
implicit = "(20-30)% Chance to Poison with Melee Weapons\n(80-100)% Increased Damage with Poison From Melee Weapons",
implicitModTypes = { },
tincture = { manaBurn = 0.6, cooldown = 7 },
req = { },
}
itemBases["Rosethorn Tincture"] = {
type = "Tincture",
hidden = true,
tags = { tincture = true, default = true, },
implicit = "+25% to Critical Strike Chance against Enemies that are on Full Life",
implicitModTypes = { { "attack", "critical" }, },
implicit = "(100-150)% Increased Critical Strike Chance with Melee Weapons",
implicitModTypes = { },
tincture = { manaBurn = 0.6, cooldown = 7 },
req = { },
}
itemBases["Oakbranch Tincture"] = {
type = "Tincture",
hidden = true,
tags = { tincture = true, default = true, },
implicit = "Culling Strike",
implicitModTypes = { { "attack" }, },
implicit = "Culling Strike with Melee Weapons",
implicitModTypes = { },
tincture = { manaBurn = 0.6, cooldown = 7 },
req = { },
}
itemBases["Borealwood Tincture"] = {
type = "Tincture",
hidden = true,
tags = { tincture = true, default = true, },
implicit = "All Damage can Freeze",
implicitModTypes = { { "elemental", "cold", "attack", "ailment" }, },
implicit = "(20-30)% Chance to Freeze with Melee Weapons",
implicitModTypes = { },
tincture = { manaBurn = 0.6, cooldown = 7 },
req = { },
}
itemBases["Blood Sap Tincture"] = {
type = "Tincture",
hidden = true,
tags = { tincture = true, default = true, },
implicit = "Bleeding you inflict on non-Bleeding Enemies deals 30% more Damage",
implicitModTypes = { { "bleed", "physical", "attack", "ailment" }, },
implicit = "(20-30)% Chance to Bleed with Melee Weapons\n(80-100)% Increased Damage with Bleed From Melee Weapons",
implicitModTypes = { },
tincture = { manaBurn = 0.6, cooldown = 7 },
req = { },
}
itemBases["Prismatic Tincture"] = {
type = "Tincture",
tags = { tincture = true, default = true, },
implicit = "(80-100)% Increased Elemental Damage with Melee Weapons",
implicitModTypes = { },
tincture = { manaBurn = 0.6, cooldown = 7 },
req = { },
}
Loading
Loading