Various cleanup
Added Vaal gems
This commit is contained in:
@@ -1,31 +1,28 @@
|
||||
-- Path of Building
|
||||
--
|
||||
-- Class: Item Slot
|
||||
-- Item Slot control, wrapper for the basic dropdown control
|
||||
-- Item Slot control, extends the basic dropdown control
|
||||
--
|
||||
local launch, main = ...
|
||||
|
||||
local ipairs = ipairs
|
||||
local t_insert = table.insert
|
||||
|
||||
local ItemSlotClass = common.NewClass("ItemSlot", function(self, itemsMain, x, y, slotName, slotLabel)
|
||||
self.itemsMain = itemsMain
|
||||
self.items = { }
|
||||
self.list = { }
|
||||
self.x = x
|
||||
self.y = y
|
||||
self.width = 320
|
||||
self.height = 20
|
||||
self.slotName = slotName
|
||||
self.label = slotLabel or slotName
|
||||
self.dropDown = common.New("DropDownControl", x, y, self.width, self.height, self.list, function(sel)
|
||||
if self.itemsMain[sel] ~= self.selItem then
|
||||
self.selItem = self.itemsMain[sel]
|
||||
local ItemSlotClass = common.NewClass("ItemSlot", "DropDownControl", function(self, itemsMain, x, y, slotName, slotLabel)
|
||||
self.DropDownControl(x, y, 320, 20, { }, function(sel)
|
||||
if self.items[sel] ~= self.selItem then
|
||||
self.selItem = self.items[sel]
|
||||
itemsMain:PopulateSlots()
|
||||
itemsMain.buildFlag = true
|
||||
itemsMain.modFlag = true
|
||||
end
|
||||
end)
|
||||
self.itemsMain = itemsMain
|
||||
self.items = { }
|
||||
self.baseX = x
|
||||
self.baseY = y
|
||||
self.slotName = slotName
|
||||
self.label = slotLabel or slotName
|
||||
itemsMain.slots[slotName] = self
|
||||
end)
|
||||
|
||||
@@ -34,13 +31,13 @@ function ItemSlotClass:Populate()
|
||||
wipeTable(self.list)
|
||||
self.items[1] = 0
|
||||
self.list[1] = "None"
|
||||
self.dropDown.sel = 1
|
||||
self.sel = 1
|
||||
for _, item in ipairs(self.itemsMain.list) do
|
||||
if self.itemsMain:IsItemValidForSlot(item, self.slotName) then
|
||||
t_insert(self.items, item.id)
|
||||
t_insert(self.list, data.colorCodes[item.rarity]..item.name)
|
||||
if item.id == self.selItem then
|
||||
self.dropDown.sel = #self.list
|
||||
self.sel = #self.list
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -49,35 +46,23 @@ function ItemSlotClass:Populate()
|
||||
end
|
||||
end
|
||||
|
||||
function ItemSlotClass:IsMouseOver()
|
||||
return self.dropDown:IsMouseOver()
|
||||
end
|
||||
|
||||
function ItemSlotClass:Draw(viewPort)
|
||||
self.dropDown.x = viewPort.x + self.x
|
||||
self.dropDown.y = viewPort.y + self.y
|
||||
DrawString(self.dropDown.x - 2, self.dropDown.y + 2, "RIGHT_X", self.height - 4, "VAR", "^7"..self.label..":")
|
||||
self.dropDown:Draw()
|
||||
if self.dropDown:IsMouseOver() then
|
||||
self.x = viewPort.x + self.baseX
|
||||
self.y = viewPort.y + self.baseY
|
||||
DrawString(self.x - 2, self.y + 2, "RIGHT_X", self.height - 4, "VAR", "^7"..self.label..":")
|
||||
self.DropDownControl:Draw()
|
||||
if self:IsMouseOver() then
|
||||
local ttItem
|
||||
if self.dropDown.dropped then
|
||||
if self.dropDown.hoverSel then
|
||||
ttItem = itemsMain.list[self.items[self.dropDown.hoverSel]]
|
||||
if self.dropped then
|
||||
if self.hoverSel then
|
||||
ttItem = self.itemsMain.list[self.items[self.hoverSel]]
|
||||
end
|
||||
elseif self.selItem and not self.itemsMain.selControl then
|
||||
ttItem = self.itemsMain.list[self.selItem]
|
||||
end
|
||||
if ttItem then
|
||||
self.itemsMain:AddItemTooltip(ttItem)
|
||||
main:DrawTooltip(self.dropDown.x, self.dropDown.y, self.width, self.height, viewPort, data.colorCodes[ttItem.rarity], true)
|
||||
main:DrawTooltip(self.x, self.y, self.width, self.height, viewPort, data.colorCodes[ttItem.rarity], true)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function ItemSlotClass:OnKeyDown(key)
|
||||
return self.dropDown:OnKeyDown(key)
|
||||
end
|
||||
|
||||
function ItemSlotClass:OnKeyUp(key)
|
||||
return self.dropDown:OnKeyUp(key)
|
||||
end
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
-- Class: Passive Tree View
|
||||
-- Passive skill tree viewer.
|
||||
--
|
||||
local launch = ...
|
||||
local launch, main = ...
|
||||
|
||||
local pairs = pairs
|
||||
local ipairs = ipairs
|
||||
@@ -12,9 +12,7 @@ local m_max = math.max
|
||||
local m_floor = math.floor
|
||||
local t_insert = table.insert
|
||||
|
||||
local TreeViewClass = common.NewClass("PassiveTreeView", function(self, main)
|
||||
self.main = main
|
||||
|
||||
local TreeViewClass = common.NewClass("PassiveTreeView", function(self)
|
||||
self.ring = NewImageHandle()
|
||||
self.ring:Load("Art/ring.png")
|
||||
|
||||
@@ -420,7 +418,7 @@ function TreeViewClass:DrawTree(build, viewPort, inputEvents)
|
||||
self:AddNodeTooltip(hoverNode, build)
|
||||
local scrX, scrY = treeToScreen(hoverNode.x, hoverNode.y)
|
||||
local size = m_floor(hoverNode.size * scale)
|
||||
self.main:DrawTooltip(m_floor(scrX - size), m_floor(scrY - size), size * 2, size * 2, viewPort)
|
||||
main:DrawTooltip(m_floor(scrX - size), m_floor(scrY - size), size * 2, size * 2, viewPort)
|
||||
end
|
||||
|
||||
SetDrawColor(0.05, 0.05, 0.05)
|
||||
@@ -460,22 +458,22 @@ function TreeViewClass:AddNodeTooltip(node, build)
|
||||
if jewel then
|
||||
build.items:AddItemTooltip(jewel, build)
|
||||
else
|
||||
self.main:AddTooltipLine(24, "^7"..node.dn..(IsKeyDown("ALT") and " ["..node.id.."]" or ""))
|
||||
main:AddTooltipLine(24, "^7"..node.dn..(IsKeyDown("ALT") and " ["..node.id.."]" or ""))
|
||||
end
|
||||
self.main:AddTooltipSeperator(14)
|
||||
self.main:AddTooltipLine(14, "^x80A080Tip: Right click this socket to go to the items page and choose the jewel for this socket.")
|
||||
main:AddTooltipSeperator(14)
|
||||
main:AddTooltipLine(14, "^x80A080Tip: Right click this socket to go to the items page and choose the jewel for this socket.")
|
||||
return
|
||||
end
|
||||
|
||||
-- Node name
|
||||
self.main:AddTooltipLine(24, "^7"..node.dn..(IsKeyDown("ALT") and " ["..node.id.."]" or ""))
|
||||
main:AddTooltipLine(24, "^7"..node.dn..(IsKeyDown("ALT") and " ["..node.id.."]" or ""))
|
||||
if IsKeyDown("ALT") and node.power and node.power.dps then
|
||||
self.main:AddTooltipLine(16, string.format("DPS power: %g Defence power: %g", node.power.dps, node.power.def))
|
||||
main:AddTooltipLine(16, string.format("DPS power: %g Defence power: %g", node.power.dps, node.power.def))
|
||||
end
|
||||
|
||||
-- Node description
|
||||
if node.sd[1] then
|
||||
self.main:AddTooltipLine(16, "")
|
||||
main:AddTooltipLine(16, "")
|
||||
for i, line in ipairs(node.sd) do
|
||||
if node.mods[i].list then
|
||||
if IsKeyDown("ALT") then
|
||||
@@ -491,22 +489,22 @@ function TreeViewClass:AddNodeTooltip(node, build)
|
||||
end
|
||||
end
|
||||
end
|
||||
self.main:AddTooltipLine(16, "^7"..line)
|
||||
main:AddTooltipLine(16, "^7"..line)
|
||||
end
|
||||
end
|
||||
|
||||
-- Reminder text
|
||||
if node.reminderText then
|
||||
self.main:AddTooltipSeperator(14)
|
||||
main:AddTooltipSeperator(14)
|
||||
for _, line in ipairs(node.reminderText) do
|
||||
self.main:AddTooltipLine(14, "^xA0A080"..line)
|
||||
main:AddTooltipLine(14, "^xA0A080"..line)
|
||||
end
|
||||
end
|
||||
|
||||
-- Mod differences
|
||||
local calcFunc, calcBase = build.calcs:GetNodeCalculator(build)
|
||||
if calcFunc then
|
||||
self.main:AddTooltipSeperator(14)
|
||||
main:AddTooltipSeperator(14)
|
||||
local count
|
||||
local nodeOutput, pathOutput
|
||||
if node.alloc then
|
||||
@@ -527,10 +525,10 @@ function TreeViewClass:AddNodeTooltip(node, build)
|
||||
if diff > 0.001 or diff < -0.001 then
|
||||
none = false
|
||||
if not header then
|
||||
self.main:AddTooltipLine(14, string.format("^7%s this node will give you:", node.alloc and "Unallocating" or "Allocating"))
|
||||
main:AddTooltipLine(14, string.format("^7%s this node will give you:", node.alloc and "Unallocating" or "Allocating"))
|
||||
header = true
|
||||
end
|
||||
self.main:AddTooltipLine(14, string.format("%s%+"..data.fmt.." %s", diff > 0 and "^x00FF44" or "^xFF3300", diff * (data.pc and 100 or 1), data.label))
|
||||
main:AddTooltipLine(14, string.format("%s%+"..data.fmt.." %s", diff > 0 and "^x00FF44" or "^xFF3300", diff * (data.pc and 100 or 1), data.label))
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -542,26 +540,26 @@ function TreeViewClass:AddNodeTooltip(node, build)
|
||||
if diff > 0.001 or diff < -0.001 then
|
||||
none = false
|
||||
if not header then
|
||||
self.main:AddTooltipLine(14, string.format("^7%s this node and all nodes %s will give you:", node.alloc and "Unallocating" or "Allocating", node.alloc and "depending on it" or "leading to it"))
|
||||
main:AddTooltipLine(14, string.format("^7%s this node and all nodes %s will give you:", node.alloc and "Unallocating" or "Allocating", node.alloc and "depending on it" or "leading to it"))
|
||||
header = true
|
||||
end
|
||||
self.main:AddTooltipLine(14, string.format("%s%+"..data.fmt.." %s", diff > 0 and "^x00FF44" or "^xFF3300", diff * (data.pc and 100 or 1), data.label))
|
||||
main:AddTooltipLine(14, string.format("%s%+"..data.fmt.." %s", diff > 0 and "^x00FF44" or "^xFF3300", diff * (data.pc and 100 or 1), data.label))
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
if none then
|
||||
self.main:AddTooltipLine(14, string.format("^7No changes from %s this node%s.", node.alloc and "unallocating" or "allocating", count > 1 and " or the nodes leading to it" or ""))
|
||||
main:AddTooltipLine(14, string.format("^7No changes from %s this node%s.", node.alloc and "unallocating" or "allocating", count > 1 and " or the nodes leading to it" or ""))
|
||||
end
|
||||
end
|
||||
|
||||
-- Pathing distance
|
||||
if node.path and #node.path > 0 then
|
||||
self.main:AddTooltipSeperator(14)
|
||||
self.main:AddTooltipLine(14, "^7"..#node.path .. " points to node")
|
||||
main:AddTooltipSeperator(14)
|
||||
main:AddTooltipLine(14, "^7"..#node.path .. " points to node")
|
||||
if #node.path > 1 then
|
||||
self.main:AddTooltipLine(14, "^x80A080")
|
||||
self.main:AddTooltipLine(14, "Tip: To reach this node by a different path, hold Shift, then trace the path and click this node")
|
||||
main:AddTooltipLine(14, "^x80A080")
|
||||
main:AddTooltipLine(14, "Tip: To reach this node by a different path, hold Shift, then trace the path and click this node")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
65
Common.lua
65
Common.lua
@@ -15,11 +15,41 @@ common.newEditField = require("simplegraphic/editfield")
|
||||
|
||||
-- Class library
|
||||
common.classes = { }
|
||||
function common.NewClass(className, initFunc)
|
||||
-- NewClass("<className>"[, "<parentClassName>"[, "<parentClassName>" ...]], constructorFunc)
|
||||
function common.NewClass(className, ...)
|
||||
local class = { }
|
||||
class.__index = class
|
||||
class._init = initFunc
|
||||
common.classes[className] = class
|
||||
class.__index = class
|
||||
class._className = className
|
||||
local numVarArg = select("#", ...)
|
||||
class._constructor = select(numVarArg, ...)
|
||||
if numVarArg > 1 then
|
||||
-- Build list of parent classes
|
||||
class._parents = { }
|
||||
for i = 1, numVarArg - 1 do
|
||||
local parentName = select(i, ...)
|
||||
if not common.classes[parentName] then
|
||||
error("Parent class '"..className.."' not defined")
|
||||
end
|
||||
class._parents[i] = common.classes[parentName]
|
||||
end
|
||||
if #class._parents == 1 then
|
||||
-- Single inheritance
|
||||
setmetatable(class, class._parents[1])
|
||||
else
|
||||
-- Multiple inheritance
|
||||
setmetatable(class, {
|
||||
__index = function(self, key)
|
||||
for _, parent in ipairs(class._parents) do
|
||||
local val = class._parents[key]
|
||||
if val ~= nil then
|
||||
return val
|
||||
end
|
||||
end
|
||||
end,
|
||||
})
|
||||
end
|
||||
end
|
||||
return class
|
||||
end
|
||||
function common.New(className, ...)
|
||||
@@ -27,8 +57,33 @@ function common.New(className, ...)
|
||||
if not class then
|
||||
error("Class '"..className.."' not defined")
|
||||
end
|
||||
if not class._constructor then
|
||||
error("Class '"..className.."' has no constructor")
|
||||
end
|
||||
local object = setmetatable({ }, class)
|
||||
class._init(object, ...)
|
||||
if class._parents then
|
||||
-- Add parent class proxies
|
||||
for _, parent in pairs(class._parents) do
|
||||
object[parent._className] = setmetatable({ }, {
|
||||
__index = function(self, key)
|
||||
local v = rawget(object, key)
|
||||
if v ~= nil then
|
||||
return v
|
||||
else
|
||||
return parent[key]
|
||||
end
|
||||
end,
|
||||
__newindex = object,
|
||||
__call = function(...)
|
||||
if not parent._constructor then
|
||||
error("Parent class '"..parent._className.."' of class '"..className.."' has no constructor")
|
||||
end
|
||||
parent._constructor(...)
|
||||
end,
|
||||
})
|
||||
end
|
||||
end
|
||||
class._constructor(object, ...)
|
||||
return object
|
||||
end
|
||||
|
||||
@@ -60,7 +115,7 @@ function common.controlsInput(host, inputEvents)
|
||||
end
|
||||
elseif event.type == "KeyUp" then
|
||||
if host.selControl then
|
||||
if host.selControl:OnKeyUp(event.key) then
|
||||
if host.selControl.OnKeyUp and host.selControl:OnKeyUp(event.key) then
|
||||
host.selControl = nil
|
||||
end
|
||||
inputEvents[id] = nil
|
||||
|
||||
@@ -56,6 +56,7 @@ gems["Barrage"] = {
|
||||
gems["Bear Trap"] = {
|
||||
cast = true,
|
||||
trap = true,
|
||||
showAverage = true,
|
||||
base = {
|
||||
skill_castTime = 1,
|
||||
skill_damageEff = 2,
|
||||
@@ -633,6 +634,7 @@ gems["Fire Trap"] = {
|
||||
aoe = true,
|
||||
duration = true,
|
||||
fire = true,
|
||||
showAverage = true,
|
||||
base = {
|
||||
skill_castTime = 1,
|
||||
skill_damageEff = 1,
|
||||
@@ -683,6 +685,7 @@ gems["Freeze Mine"] = {
|
||||
mine = true,
|
||||
aoe = true,
|
||||
cold = true,
|
||||
showAverage = true,
|
||||
base = {
|
||||
skill_castTime = 0.5,
|
||||
skill_damageEff = 0.5,
|
||||
@@ -1063,6 +1066,7 @@ gems["Ice Trap"] = {
|
||||
trap = true,
|
||||
aoe = true,
|
||||
cold = true,
|
||||
showAverage = true,
|
||||
base = {
|
||||
skill_castTime = 1,
|
||||
skill_damageEff = 1.1,
|
||||
|
||||
@@ -1186,6 +1186,7 @@ gems["Lightning Warp"] = {
|
||||
lightning = true,
|
||||
movement = true,
|
||||
duration = true,
|
||||
showAverage = true,
|
||||
base = {
|
||||
skill_castTime = 1,
|
||||
skill_damageEff = 0.6,
|
||||
|
||||
1208
Gems/other.lua
Normal file
1208
Gems/other.lua
Normal file
File diff suppressed because it is too large
Load Diff
@@ -11,8 +11,6 @@ local m_floor = math.floor
|
||||
local t_insert = table.insert
|
||||
local t_remove = table.remove
|
||||
|
||||
LoadModule("Classes/Grid", launch)
|
||||
|
||||
local calcs = { }
|
||||
|
||||
function calcs:Init(build)
|
||||
@@ -35,30 +33,6 @@ function calcs:Shutdown()
|
||||
self.undo = nil
|
||||
end
|
||||
|
||||
function calcs:DrawGrid(viewPort, inputEvents)
|
||||
self.grid.offX = viewPort.x + m_floor((viewPort.width - self.grid.realWidth) / 2)
|
||||
self.grid.offY = viewPort.y + 2
|
||||
for id, event in ipairs(inputEvents) do
|
||||
if event.type == "KeyDown" then
|
||||
if event.key == "r" and IsKeyDown("CTRL") then
|
||||
self:LoadControl()
|
||||
self.buildFlag = true
|
||||
elseif event.key == "z" and IsKeyDown("CTRL") then
|
||||
self:Undo()
|
||||
elseif event.key == "y" and IsKeyDown("CTRL") then
|
||||
self:Redo()
|
||||
else
|
||||
self.grid:OnKeyDown(event.key, event.doubleClick)
|
||||
end
|
||||
elseif event.type == "KeyUp" then
|
||||
self.grid:OnKeyUp(event.key)
|
||||
elseif event.type == "Char" then
|
||||
self.grid:OnChar(event.key)
|
||||
end
|
||||
end
|
||||
self.grid:Draw()
|
||||
end
|
||||
|
||||
function calcs:Load(xml, dbFileName)
|
||||
for _, node in ipairs(xml) do
|
||||
if type(node) == "table" then
|
||||
@@ -100,6 +74,30 @@ function calcs:Save(xml)
|
||||
end
|
||||
end
|
||||
|
||||
function calcs:DrawGrid(viewPort, inputEvents)
|
||||
self.grid.offX = viewPort.x + m_floor((viewPort.width - self.grid.realWidth) / 2)
|
||||
self.grid.offY = viewPort.y + 2
|
||||
for id, event in ipairs(inputEvents) do
|
||||
if event.type == "KeyDown" then
|
||||
if event.key == "r" and IsKeyDown("CTRL") then
|
||||
self:LoadControl()
|
||||
self.buildFlag = true
|
||||
elseif event.key == "z" and IsKeyDown("CTRL") then
|
||||
self:Undo()
|
||||
elseif event.key == "y" and IsKeyDown("CTRL") then
|
||||
self:Redo()
|
||||
else
|
||||
self.grid:OnKeyDown(event.key, event.doubleClick)
|
||||
end
|
||||
elseif event.type == "KeyUp" then
|
||||
self.grid:OnKeyUp(event.key)
|
||||
elseif event.type == "Char" then
|
||||
self.grid:OnChar(event.key)
|
||||
end
|
||||
end
|
||||
self.grid:Draw()
|
||||
end
|
||||
|
||||
function calcs:LoadControl()
|
||||
self.grid:Clear()
|
||||
local errMsg
|
||||
|
||||
@@ -7,25 +7,13 @@
|
||||
data = { }
|
||||
|
||||
data.gems = { }
|
||||
data.gems["_default"] = {
|
||||
attack = true,
|
||||
melee = true,
|
||||
bow = true,
|
||||
projectile = true,
|
||||
base = {
|
||||
},
|
||||
quality = {
|
||||
},
|
||||
levels = {
|
||||
[1] = { }
|
||||
},
|
||||
}
|
||||
LoadModule("Gems/act_str", data.gems)
|
||||
LoadModule("Gems/act_dex", data.gems)
|
||||
LoadModule("Gems/act_int", data.gems)
|
||||
LoadModule("Gems/sup_str", data.gems)
|
||||
LoadModule("Gems/sup_dex", data.gems)
|
||||
LoadModule("Gems/sup_int", data.gems)
|
||||
LoadModule("Gems/other", data.gems)
|
||||
|
||||
data.colorCodes = {
|
||||
NORMAL = "^xC8C8C8",
|
||||
@@ -34,7 +22,7 @@ data.colorCodes = {
|
||||
UNIQUE = "^xAF6025",
|
||||
FIRE = "^x960000",
|
||||
COLD = "^x366492",
|
||||
LIGHT = "^xFFD700",
|
||||
LIGHTNING = "^xFFD700",
|
||||
CHAOS = "^xD02090",
|
||||
}
|
||||
|
||||
|
||||
@@ -9,8 +9,6 @@ local t_insert = table.insert
|
||||
local m_floor = math.floor
|
||||
local s_format = string.format
|
||||
|
||||
LoadModule("Classes/ItemSlot", launch, main)
|
||||
|
||||
local baseSlots = { "Helmet", "Body Armour", "Gloves", "Boots", "Amulet", "Ring 1", "Ring 2", "Belt", "Weapon 1", "Weapon 2" }
|
||||
|
||||
local items = { }
|
||||
@@ -40,6 +38,9 @@ function items:Init(build)
|
||||
end
|
||||
|
||||
function items:Shutdown()
|
||||
self.controls = nil
|
||||
self.slots = nil
|
||||
self.list = nil
|
||||
end
|
||||
|
||||
function items:Load(xml, dbFileName)
|
||||
@@ -165,7 +166,7 @@ function items:UpdateJewels()
|
||||
local slot = self.sockets[nodeId]
|
||||
self.controls["socket"..nodeId] = slot
|
||||
slot.inactive = false
|
||||
slot.y = (#baseSlots + index - 1) * 20
|
||||
slot.baseY = (#baseSlots + index - 1) * 20
|
||||
end
|
||||
end
|
||||
|
||||
@@ -254,9 +255,23 @@ function items:ParseItemRaw(item)
|
||||
item.type = data.itemBases[item.baseName].type
|
||||
end
|
||||
item.modLines = { }
|
||||
item.implicitLines = 0
|
||||
local gameModeStage = "FINDIMPLICIT"
|
||||
local gameModeSection = 1
|
||||
local foundExplicit
|
||||
while item.rawLines[l] do
|
||||
local line = item.rawLines[l]
|
||||
if data.weaponTypeInfo[line] then
|
||||
if line == "--------" then
|
||||
gameModeSection = gameModeSection + 1
|
||||
if gameModeStage == "IMPLICIT" then
|
||||
item.implicitLines = #item.modLines
|
||||
gameModeStage = "FINDEXPLICIT"
|
||||
elseif gameModeStage == "EXPLICIT" then
|
||||
gameModeStage = "DONE"
|
||||
end
|
||||
elseif line == "Corrupted" then
|
||||
item.corrupted = true
|
||||
elseif data.weaponTypeInfo[line] then
|
||||
item.weaponType = line
|
||||
else
|
||||
local specName, specVal = line:match("^([%a ]+): %+?([%d%-%.]+)")
|
||||
@@ -280,11 +295,33 @@ function items:ParseItemRaw(item)
|
||||
local modList, extra = mod.parseMod(rangedLine or line)
|
||||
if modList then
|
||||
t_insert(item.modLines, { line = line, extra = extra, mods = modList, range = rangedLine and 1 })
|
||||
if mode == "GAME" then
|
||||
if gameModeStage == "FINDIMPLICIT" then
|
||||
gameModeStage = "IMPLICIT"
|
||||
elseif gameModeStage == "FINDEXPLICIT" then
|
||||
foundExplicit = true
|
||||
gameModeStage = "EXPLICIT"
|
||||
end
|
||||
end
|
||||
elseif mode == "GAME" then
|
||||
if gameModeStage == "IMPLICIT" or gameModeStage == "EXPLICIT" then
|
||||
t_insert(item.modLines, { line = line, extra = line, mods = { } })
|
||||
elseif gameModeStage == "FINDEXPLICIT" then
|
||||
gameModeStage = "DONE"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
l = l + 1
|
||||
end
|
||||
local base = data.itemBases[item.baseName]
|
||||
if base and base.implicit then
|
||||
if item.implicitLines == 0 then
|
||||
item.implicitLines = 1
|
||||
end
|
||||
elseif mode == "GAME" and not foundExplicit then
|
||||
item.implicitLines = 0
|
||||
end
|
||||
self:BuildItemModList(item)
|
||||
end
|
||||
|
||||
@@ -385,21 +422,39 @@ function items:AddItemTooltip(item)
|
||||
main:AddTooltipSeperator(10)
|
||||
main:AddTooltipLine(16, s_format("^x7F7F7F%s", base.type))
|
||||
main:AddTooltipLine(16, "^x7F7F7FQuality: "..data.colorCodes.MAGIC.."+20%")
|
||||
local totalDamage = 0
|
||||
local totalDamageTypes = 0
|
||||
if modList.weaponX_physicalMin then
|
||||
main:AddTooltipLine(16, s_format("^x7F7F7FPhysical Damage: "..data.colorCodes.MAGIC.."%d-%d", modList.weaponX_physicalMin, modList.weaponX_physicalMax))
|
||||
totalDamage = totalDamage + (modList.weaponX_physicalMin + modList.weaponX_physicalMax) / 2
|
||||
local physicalDPS = (modList.weaponX_physicalMin + modList.weaponX_physicalMax) / 2 * modList.weaponX_attackRate
|
||||
main:AddTooltipLine(16, s_format("^x7F7F7FPhysical Damage: "..data.colorCodes.MAGIC.."%d-%d (%.1f DPS)", modList.weaponX_physicalMin, modList.weaponX_physicalMax, physicalDPS))
|
||||
totalDamageTypes = totalDamageTypes + 1
|
||||
end
|
||||
local elemLine
|
||||
local elemTotal = 0
|
||||
for _, var in ipairs({"fire","cold","lightning"}) do
|
||||
if modList["weaponX_"..var.."Min"] then
|
||||
local min = modList["weaponX_"..var.."Min"]
|
||||
local max = modList["weaponX_"..var.."Max"]
|
||||
if min and max then
|
||||
elemLine = elemLine and elemLine.."^x7F7F7F, " or "^x7F7F7FElemental Damage: "
|
||||
elemLine = elemLine..s_format("%s%d-%d", data.colorCodes[var:upper()], modList["weaponX_"..var.."Min"], modList["weaponX_"..var.."Max"])
|
||||
elemLine = elemLine..s_format("%s%d-%d", data.colorCodes[var:upper()], min, max)
|
||||
elemTotal = elemTotal + (min + max) / 2
|
||||
end
|
||||
end
|
||||
totalDamage = totalDamage + elemTotal
|
||||
if elemLine then
|
||||
main:AddTooltipLine(16, elemLine)
|
||||
main:AddTooltipLine(16, s_format("^x7F7F7FElemental DPS: "..data.colorCodes.MAGIC.."%.1f", elemTotal * modList.weaponX_attackRate))
|
||||
totalDamageTypes = totalDamageTypes + 1
|
||||
end
|
||||
if modList.weaponX_chaosMin then
|
||||
main:AddTooltipLine(16, s_format("^x7F7F7FChaos Damage: "..data.colorCodes.CHAOS.."%d-%d", modList.weaponX_chaosMin, modList.weaponX_chaosMax))
|
||||
totalDamage = totalDamage + (modList.weaponX_chaosMin + modList.weaponX_chaosMax) / 2
|
||||
local chaosDPS = (modList.weaponX_chaosMin + modList.weaponX_chaosMax) / 2 * modList.weaponX_attackRate
|
||||
main:AddTooltipLine(16, s_format("^x7F7F7FChaos Damage: "..data.colorCodes.CHAOS.."%d-%d "..data.colorCodes.MAGIC.."(%.1f DPS)", modList.weaponX_chaosMin, modList.weaponX_chaosMax, chaosDPS))
|
||||
totalDamageTypes = totalDamageTypes + 1
|
||||
end
|
||||
if totalDamageTypes > 1 then
|
||||
main:AddTooltipLine(16, s_format("^x7F7F7FTotal DPS: "..data.colorCodes.MAGIC.."%.1f", totalDamage * modList.weaponX_attackRate))
|
||||
end
|
||||
main:AddTooltipLine(16, s_format("^x7F7F7FCritical Strike Chance: %s%.2f%%", modList.weaponX_critChanceBase ~= base.weapon.critChanceBase and data.colorCodes.MAGIC or "^7", modList.weaponX_critChanceBase))
|
||||
main:AddTooltipLine(16, s_format("^x7F7F7FAttacks per Second: %s%.2f", modList.weaponX_attackRate ~= base.weapon.attackRateBase and data.colorCodes.MAGIC or "^7", modList.weaponX_attackRate))
|
||||
@@ -424,11 +479,17 @@ function items:AddItemTooltip(item)
|
||||
for index, modLine in pairs(item.modLines) do
|
||||
local line = modLine.range and self:ApplyRange(modLine.line, modLine.range) or modLine.line
|
||||
main:AddTooltipLine(16, (modLine.extra and data.colorCodes.NORMAL or data.colorCodes.MAGIC)..line)
|
||||
if index == 1 and base.implicit and item.modLines[2] then
|
||||
if index == item.implicitLines and item.modLines[index + 1] then
|
||||
main:AddTooltipSeperator(10)
|
||||
end
|
||||
end
|
||||
end
|
||||
if item.corrupted then
|
||||
if #item.modLines == item.implicitLines then
|
||||
main:AddTooltipSeperator(10)
|
||||
end
|
||||
main:AddTooltipLine(16, "^1Corrupted")
|
||||
end
|
||||
self:UpdateJewels()
|
||||
for slotName, slot in pairs(self.slots) do
|
||||
local selItem = self.list[slot.selItem]
|
||||
|
||||
@@ -13,12 +13,14 @@ local t_insert = table.insert
|
||||
LoadModule("Modules/Data")
|
||||
LoadModule("Modules/ModTools")
|
||||
|
||||
LoadModule("Classes/PassiveTree", launch)
|
||||
LoadModule("Classes/PassiveSpec", launch)
|
||||
LoadModule("Classes/PassiveTreeView", launch)
|
||||
|
||||
local main = { }
|
||||
|
||||
LoadModule("Classes/PassiveTree", launch, main)
|
||||
LoadModule("Classes/PassiveSpec", launch, main)
|
||||
LoadModule("Classes/PassiveTreeView", launch, main)
|
||||
LoadModule("Classes/Grid", launch, main)
|
||||
LoadModule("Classes/ItemSlot", launch, main)
|
||||
|
||||
function main:Init()
|
||||
self.modes = { }
|
||||
self.modes["LIST"] = LoadModule("Modules/BuildList", launch, self)
|
||||
|
||||
@@ -33,6 +33,7 @@ local modNameList = {
|
||||
["strength and dexterity"] = { "str{suf}", "dex{suf}" },
|
||||
["strength and intelligence"] = { "str{suf}", "int{suf}" },
|
||||
["dexterity and intelligence"] = { "dex{suf}", "int{suf}" },
|
||||
["attributes"] = { "str{suf}", "dex{suf}", "int{suf}" },
|
||||
["all attributes"] = { "str{suf}", "dex{suf}", "int{suf}" },
|
||||
-- Life/mana
|
||||
["maximum life"] = "life{suf}",
|
||||
@@ -47,6 +48,7 @@ local modNameList = {
|
||||
["energy shield recharge rate"] = "energyShieldRecharge{suf}",
|
||||
["armour"] = "armour{suf}",
|
||||
["evasion rating"] = "evasion{suf}",
|
||||
["global evasion rating"] = "global_evasion{suf}",
|
||||
["energy shield"] = "energyShield{suf}",
|
||||
["armour and evasion"] = "armourAndEvasion{suf}",
|
||||
["armour and evasion rating"] = "armourAndEvasion{suf}",
|
||||
@@ -67,6 +69,7 @@ local modNameList = {
|
||||
["cold and lightning resistances"] = { "coldResist", "lightningResist" },
|
||||
["elemental resistances"] = "elemResist",
|
||||
["all elemental resistances"] = "elemResist",
|
||||
["all maximum resistances"] = { "fireResistMax", "coldResistMax", "lightningResistMax", "chaosResistMax" },
|
||||
["chaos resistance"] = "chaosResist",
|
||||
-- Other defences
|
||||
["to dodge attacks"] = "dodgeAttack",
|
||||
@@ -154,6 +157,7 @@ local modNameList = {
|
||||
["melee physical damage"] = "melee_physical{suf}",
|
||||
["wand damage"] = "wand_damage{suf}",
|
||||
["wand physical damage"] = "wand_physical{suf}",
|
||||
["claw physical damage"] = "claw_physical{suf}",
|
||||
["damage over time"] = "dot_damage{suf}",
|
||||
["physical damage over time"] = "dot_physical{suf}",
|
||||
["burning damage"] = "degen_fire{suf}",
|
||||
@@ -223,6 +227,7 @@ local namespaceList = {
|
||||
["with traps"] = "trap_",
|
||||
["totem"] = "totem_",
|
||||
["with totem skills"] = "totem_",
|
||||
["with movement skills"] = "movement_",
|
||||
["with lightning skills"] = "lightning_",
|
||||
["with cold skills"] = "cold_",
|
||||
["with fire skills"] = "fire_",
|
||||
@@ -275,6 +280,7 @@ local specialSpaceList = {
|
||||
["against bleeding enemies"] = "condMod_EnemyBleeding_",
|
||||
["against poisoned enemies"] = "condMod_EnemyPoisoned_",
|
||||
["against burning enemies"] = "condMod_EnemyBurning_",
|
||||
["against ignited enemies"] = "condMod_EnemyIgnited_",
|
||||
["enemies which are chilled"] = "condMod_EnemyChilled_",
|
||||
["against frozen, shocked or ignited enemies"] = "condMod_EnemyFrozenShockedIgnited_",
|
||||
["against enemies that are affected by elemental status ailments"] = "condMod_EnemyElementalStatus_",
|
||||
@@ -316,8 +322,8 @@ local specialModList = {
|
||||
["cannot be ignited"] = { avoidIgnite = 100 },
|
||||
["cannot be stunned"] = { stunImmunity = true },
|
||||
["deal no physical damage"] = { physicalFinalMore = 0 },
|
||||
["your critical strikes do not deal extra damage"] = { noCritMult = true },
|
||||
["iron will"] = { ironWill = true },
|
||||
["extra gore"] = { },
|
||||
-- Special item local modifiers
|
||||
["no physical damage"] = { weaponNoPhysical = true },
|
||||
["all attacks with this weapon are critical strikes"] = { weaponAlwaysCrit = true },
|
||||
@@ -326,9 +332,11 @@ local specialModList = {
|
||||
["causes bleeding on hit"] = { bleedChance = 100 },
|
||||
["poisonous hit"] = { poisonChance = 100 },
|
||||
["your chaos damage poisons enemies"] = { poisonChance = 100 },
|
||||
["has no sockets"] = { },
|
||||
["has 1 socket"] = { },
|
||||
["socketed gems have (.+)"] = { },
|
||||
["socketed gems are Supported by (.+)"] = { },
|
||||
["socketed gems are supported by (.+)"] = { },
|
||||
["+(%d) to level of socketed gems"] = { },
|
||||
["+(%d) to level of socketed (%a+) gems"] = { },
|
||||
["grants level (%d+) (.+) skill"] = { },
|
||||
-- Unique item modifiers
|
||||
|
||||
@@ -14,6 +14,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Gem DB", "Gem DB", "{EE9D06
|
||||
Gems\act_dex.lua = Gems\act_dex.lua
|
||||
Gems\act_int.lua = Gems\act_int.lua
|
||||
Gems\act_str.lua = Gems\act_str.lua
|
||||
Gems\other.lua = Gems\other.lua
|
||||
Gems\sup_dex.lua = Gems\sup_dex.lua
|
||||
Gems\sup_int.lua = Gems\sup_int.lua
|
||||
Gems\sup_str.lua = Gems\sup_str.lua
|
||||
|
||||
Reference in New Issue
Block a user