Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
Openarl committed Mar 2, 2017
2 parents 4a08d4a + 9a24941 commit 5d7053b
Show file tree
Hide file tree
Showing 32 changed files with 409 additions and 362 deletions.
97 changes: 50 additions & 47 deletions Classes/PassiveTree.lua
Original file line number Diff line number Diff line change
Expand Up @@ -344,10 +344,7 @@ function PassiveTreeClass:BuildConnector(node1, node2)
-- This will occur when the tree is being drawn; .vert will map line state (Normal/Intermediate/Active) to the correct tree-space coordinates
}
if node1.g == node2.g and node1.o == node2.o then
-- Nodes are in the same orbit of the same group, so generate an arc
-- This is an arc texture mapped onto a kite-shaped quad
connector.type = "Orbit" .. node1.o

-- Nodes are in the same orbit of the same group
-- Calculate the starting angle (node1.angle) and arc angle
if node1.angle > node2.angle then
node1, node2 = node2, node1
Expand All @@ -357,50 +354,56 @@ function PassiveTreeClass:BuildConnector(node1, node2)
node1, node2 = node2, node1
arcAngle = m_pi * 2 - arcAngle
end
-- Calculate how much the arc needs to be clipped by
-- Both ends of the arc will be clipped by this amount, so 90 degree arc angle = no clipping and 30 degree arc angle = 75 degrees of clipping
-- The clipping is accomplished by effectively moving the bottom left and top right corners of the arc texture towards the top left corner
-- The arc texture only shows 90 degrees of an arc, but some arcs must go for more than 90 degrees
-- Fortunately there's nowhere on the tree where we can't just show the middle 90 degrees and rely on the node artwork to cover the gaps :)
local clipAngle = m_pi / 4 - arcAngle / 2
local p = 1 - m_max(m_tan(clipAngle), 0)
local angle = node1.angle - clipAngle
connector.vert = { }
for _, state in pairs({"Normal","Intermediate","Active"}) do
-- The different line states have differently-sized artwork, so the vertex coords must be calculated separately for each one
local art = self.assets[connector.type..state]
local size = art.width * 2 * 1.33
local oX, oY = size * m_sqrt(2) * m_sin(angle + m_pi/4), size * m_sqrt(2) * -m_cos(angle + m_pi/4)
local cX, cY = node1.group.x + oX, node1.group.y + oY
local vert = { }
vert[1], vert[2] = node1.group.x, node1.group.y
vert[3], vert[4] = cX + (size * m_sin(angle) - oX) * p, cY + (size * -m_cos(angle) - oY) * p
vert[5], vert[6] = cX, cY
vert[7], vert[8] = cX + (size * m_cos(angle) - oX) * p, cY + (size * m_sin(angle) - oY) * p
connector.vert[state] = vert
if arcAngle < m_pi * 0.9 then
-- Angle is less than 180 degrees, draw an arc
connector.type = "Orbit" .. node1.o
-- This is an arc texture mapped onto a kite-shaped quad
-- Calculate how much the arc needs to be clipped by
-- Both ends of the arc will be clipped by this amount, so 90 degree arc angle = no clipping and 30 degree arc angle = 75 degrees of clipping
-- The clipping is accomplished by effectively moving the bottom left and top right corners of the arc texture towards the top left corner
-- The arc texture only shows 90 degrees of an arc, but some arcs must go for more than 90 degrees
-- Fortunately there's nowhere on the tree where we can't just show the middle 90 degrees and rely on the node artwork to cover the gaps :)
local clipAngle = m_pi / 4 - arcAngle / 2
local p = 1 - m_max(m_tan(clipAngle), 0)
local angle = node1.angle - clipAngle
connector.vert = { }
for _, state in pairs({"Normal","Intermediate","Active"}) do
-- The different line states have differently-sized artwork, so the vertex coords must be calculated separately for each one
local art = self.assets[connector.type..state]
local size = art.width * 2 * 1.33
local oX, oY = size * m_sqrt(2) * m_sin(angle + m_pi/4), size * m_sqrt(2) * -m_cos(angle + m_pi/4)
local cX, cY = node1.group.x + oX, node1.group.y + oY
local vert = { }
vert[1], vert[2] = node1.group.x, node1.group.y
vert[3], vert[4] = cX + (size * m_sin(angle) - oX) * p, cY + (size * -m_cos(angle) - oY) * p
vert[5], vert[6] = cX, cY
vert[7], vert[8] = cX + (size * m_cos(angle) - oX) * p, cY + (size * m_sin(angle) - oY) * p
connector.vert[state] = vert
end
connector.c[9], connector.c[10] = 1, 1
connector.c[11], connector.c[12] = 0, p
connector.c[13], connector.c[14] = 0, 0
connector.c[15], connector.c[16] = p, 0
return connector
end
connector.c[9], connector.c[10] = 1, 1
connector.c[11], connector.c[12] = 0, p
connector.c[13], connector.c[14] = 0, 0
connector.c[15], connector.c[16] = p, 0
else
-- Generate a straight line
connector.type = "LineConnector"
local art = self.assets.LineConnectorNormal
local vX, vY = node2.x - node1.x, node2.y - node1.y
local dist = m_sqrt(vX * vX + vY * vY)
local scale = art.height * 1.33 / dist
local nX, nY = vX * scale, vY * scale
local endS = dist / (art.width * 1.33)
connector[1], connector[2] = node1.x - nY, node1.y + nX
connector[3], connector[4] = node1.x + nY, node1.y - nX
connector[5], connector[6] = node2.x + nY, node2.y - nX
connector[7], connector[8] = node2.x - nY, node2.y + nX
connector.c[9], connector.c[10] = 0, 1
connector.c[11], connector.c[12] = 0, 0
connector.c[13], connector.c[14] = endS, 0
connector.c[15], connector.c[16] = endS, 1
connector.vert = { Normal = connector, Intermediate = connector, Active = connector }
end

-- Generate a straight line
connector.type = "LineConnector"
local art = self.assets.LineConnectorNormal
local vX, vY = node2.x - node1.x, node2.y - node1.y
local dist = m_sqrt(vX * vX + vY * vY)
local scale = art.height * 1.33 / dist
local nX, nY = vX * scale, vY * scale
local endS = dist / (art.width * 1.33)
connector[1], connector[2] = node1.x - nY, node1.y + nX
connector[3], connector[4] = node1.x + nY, node1.y - nX
connector[5], connector[6] = node2.x + nY, node2.y - nX
connector[7], connector[8] = node2.x - nY, node2.y + nX
connector.c[9], connector.c[10] = 0, 1
connector.c[11], connector.c[12] = 0, 0
connector.c[13], connector.c[14] = endS, 0
connector.c[15], connector.c[16] = endS, 1
connector.vert = { Normal = connector, Intermediate = connector, Active = connector }
return connector
end
4 changes: 4 additions & 0 deletions Classes/PassiveTreeView.lua
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@ function PassiveTreeViewClass:Draw(build, viewPort, inputEvents)
end

-- Draw the connecting lines between nodes
SetDrawLayer(nil, 1)
for _, connector in pairs(tree.connectors) do
local node1, node2 = spec.nodes[connector.nodeId1], spec.nodes[connector.nodeId2]

Expand Down Expand Up @@ -320,12 +321,14 @@ function PassiveTreeViewClass:Draw(build, viewPort, inputEvents)
for nodeId, node in pairs(spec.nodes) do
-- Determine the base and overlay images for this node based on type and state
local base, overlay
SetDrawLayer(nil, 1)
if node.type == "classStart" then
overlay = node.alloc and node.startArt or "PSStartNodeBackgroundInactive"
elseif node.type == "ascendClassStart" then
overlay = "PassiveSkillScreenAscendancyMiddle"
elseif node.type == "mastery" then
-- This is the icon that appears in the center of many groups
SetDrawLayer(nil, 0)
base = node.sprites.mastery
else
local state
Expand Down Expand Up @@ -436,6 +439,7 @@ function PassiveTreeViewClass:Draw(build, viewPort, inputEvents)
end

-- Draw ring overlays for jewel sockets
SetDrawLayer(nil, 1)
for nodeId, slot in pairs(build.itemsTab.sockets) do
local node = spec.nodes[nodeId]
if node == hoverNode then
Expand Down
20 changes: 11 additions & 9 deletions Classes/SkillsTab.lua
Original file line number Diff line number Diff line change
Expand Up @@ -422,16 +422,18 @@ function SkillsTabClass:ProcessSocketGroup(socketGroup)
-- Empty gem, remove it
t_remove(socketGroup.gemList, index)

-- Update the other gem slot controls
for index2 = index, #socketGroup.gemList do
local gem = socketGroup.gemList[index2]
if not self.gemSlots[index2] then
self:CreateGemSlot(index2)
if socketGroup == self.displayGroup then
-- Update the other gem slot controls
for index2 = index, #socketGroup.gemList do
local gem = socketGroup.gemList[index2]
if not self.gemSlots[index2] then
self:CreateGemSlot(index2)
end
self.gemSlots[index2].nameSpec:SetText(gem.nameSpec)
self.gemSlots[index2].level:SetText(gem.level)
self.gemSlots[index2].quality:SetText(gem.quality)
self.gemSlots[index2].enabled.state = gem.enabled
end
self.gemSlots[index2].nameSpec:SetText(gem.nameSpec)
self.gemSlots[index2].level:SetText(gem.level)
self.gemSlots[index2].quality:SetText(gem.quality)
self.gemSlots[index2].enabled.state = gem.enabled
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion Data/Bases/amulet.lua
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ itemBases["Monkey Paw Talisman"] = {
itemBases["Monkey Twins Talisman"] = {
type = "Amulet",
subType = "Talisman",
implicit = "(5-8)% increased Radius of Area Skills",
implicit = "(5-8)% increased Area of Effect of Area Skills",
}
itemBases["Rotfeather Talisman"] = {
type = "Amulet",
Expand Down
46 changes: 23 additions & 23 deletions Data/Bases/mace.lua
Original file line number Diff line number Diff line change
Expand Up @@ -163,14 +163,14 @@ itemBases["Driftwood Sceptre"] = {
itemBases["Darkwood Sceptre"] = {
type = "One Handed Mace",
subType = "Sceptre",
implicit = "10% increased Elemental Damage",
implicit = "12% increased Elemental Damage",
weapon = { PhysicalMin = 7, PhysicalMax = 10, critChanceBase = 6, attackRateBase = 1.5, },
req = { level = 5, str = 14, int = 14, },
}
itemBases["Bronze Sceptre"] = {
type = "One Handed Mace",
subType = "Sceptre",
implicit = "10% increased Elemental Damage",
implicit = "12% increased Elemental Damage",
weapon = { PhysicalMin = 10, PhysicalMax = 19, critChanceBase = 6, attackRateBase = 1.25, },
req = { level = 10, str = 22, int = 22, },
}
Expand All @@ -184,35 +184,35 @@ itemBases["Quartz Sceptre"] = {
itemBases["Iron Sceptre"] = {
type = "One Handed Mace",
subType = "Sceptre",
implicit = "10% increased Elemental Damage",
implicit = "14% increased Elemental Damage",
weapon = { PhysicalMin = 18, PhysicalMax = 27, critChanceBase = 6, attackRateBase = 1.25, },
req = { level = 20, str = 38, int = 38, },
}
itemBases["Ochre Sceptre"] = {
type = "One Handed Mace",
subType = "Sceptre",
implicit = "10% increased Elemental Damage",
implicit = "16% increased Elemental Damage",
weapon = { PhysicalMin = 15, PhysicalMax = 28, critChanceBase = 6, attackRateBase = 1.4, },
req = { level = 24, str = 44, int = 44, },
}
itemBases["Ritual Sceptre"] = {
type = "One Handed Mace",
subType = "Sceptre",
implicit = "10% increased Elemental Damage",
implicit = "16% increased Elemental Damage",
weapon = { PhysicalMin = 18, PhysicalMax = 41, critChanceBase = 6, attackRateBase = 1.2, },
req = { level = 28, str = 51, int = 51, },
}
itemBases["Shadow Sceptre"] = {
type = "One Handed Mace",
subType = "Sceptre",
implicit = "15% increased Elemental Damage",
implicit = "22% increased Elemental Damage",
weapon = { PhysicalMin = 25, PhysicalMax = 37, critChanceBase = 6.5, attackRateBase = 1.25, },
req = { level = 32, str = 52, int = 62, },
}
itemBases["Grinning Fetish"] = {
type = "One Handed Mace",
subType = "Sceptre",
implicit = "10% increased Elemental Damage",
implicit = "18% increased Elemental Damage",
weapon = { PhysicalMin = 21, PhysicalMax = 32, critChanceBase = 6, attackRateBase = 1.5, },
req = { level = 35, str = 62, int = 62, },
}
Expand All @@ -226,42 +226,42 @@ itemBases["Horned Sceptre"] = {
itemBases["Sekhem"] = {
type = "One Handed Mace",
subType = "Sceptre",
implicit = "10% increased Elemental Damage",
implicit = "18% increased Elemental Damage",
weapon = { PhysicalMin = 25, PhysicalMax = 46, critChanceBase = 6, attackRateBase = 1.25, },
req = { level = 38, str = 67, int = 67, },
}
itemBases["Crystal Sceptre"] = {
type = "One Handed Mace",
subType = "Sceptre",
implicit = "20% increased Elemental Damage",
implicit = "30% increased Elemental Damage",
weapon = { PhysicalMin = 29, PhysicalMax = 43, critChanceBase = 7, attackRateBase = 1.25, },
req = { level = 41, str = 59, int = 85, },
}
itemBases["Lead Sceptre"] = {
type = "One Handed Mace",
subType = "Sceptre",
implicit = "10% increased Elemental Damage",
implicit = "22% increased Elemental Damage",
weapon = { PhysicalMin = 32, PhysicalMax = 48, critChanceBase = 6, attackRateBase = 1.25, },
req = { level = 44, str = 77, int = 77, },
}
itemBases["Blood Sceptre"] = {
type = "One Handed Mace",
subType = "Sceptre",
implicit = "10% increased Elemental Damage",
implicit = "24% increased Elemental Damage",
weapon = { PhysicalMin = 25, PhysicalMax = 47, critChanceBase = 6, attackRateBase = 1.4, },
req = { level = 47, str = 81, int = 81, },
}
itemBases["Royal Sceptre"] = {
type = "One Handed Mace",
subType = "Sceptre",
implicit = "10% increased Elemental Damage",
implicit = "24% increased Elemental Damage",
weapon = { PhysicalMin = 29, PhysicalMax = 67, critChanceBase = 6, attackRateBase = 1.2, },
req = { level = 50, str = 86, int = 86, },
}
itemBases["Abyssal Sceptre"] = {
type = "One Handed Mace",
subType = "Sceptre",
implicit = "15% increased Elemental Damage",
implicit = "30% increased Elemental Damage",
weapon = { PhysicalMin = 38, PhysicalMax = 57, critChanceBase = 6.5, attackRateBase = 1.25, },
req = { level = 53, str = 83, int = 99, },
}
Expand All @@ -275,49 +275,49 @@ itemBases["Stag Sceptre"] = {
itemBases["Karui Sceptre"] = {
type = "One Handed Mace",
subType = "Sceptre",
implicit = "10% increased Elemental Damage",
implicit = "26% increased Elemental Damage",
weapon = { PhysicalMin = 32, PhysicalMax = 47, critChanceBase = 6, attackRateBase = 1.5, },
req = { level = 56, str = 96, int = 96, },
}
itemBases["Tyrant's Sekhem"] = {
type = "One Handed Mace",
subType = "Sceptre",
implicit = "10% increased Elemental Damage",
implicit = "26% increased Elemental Damage",
weapon = { PhysicalMin = 36, PhysicalMax = 67, critChanceBase = 6, attackRateBase = 1.25, },
req = { level = 58, str = 99, int = 99, },
}
itemBases["Opal Sceptre"] = {
type = "One Handed Mace",
subType = "Sceptre",
implicit = "20% increased Elemental Damage",
implicit = "40% increased Elemental Damage",
weapon = { PhysicalMin = 40, PhysicalMax = 60, critChanceBase = 7, attackRateBase = 1.25, },
req = { level = 60, str = 95, int = 131, },
}
itemBases["Platinum Sceptre"] = {
type = "One Handed Mace",
subType = "Sceptre",
implicit = "10% increased Elemental Damage",
implicit = "30% increased Elemental Damage",
weapon = { PhysicalMin = 42, PhysicalMax = 63, critChanceBase = 6, attackRateBase = 1.25, },
req = { level = 62, str = 113, int = 113, },
}
itemBases["Vaal Sceptre"] = {
type = "One Handed Mace",
subType = "Sceptre",
implicit = "10% increased Elemental Damage",
implicit = "32% increased Elemental Damage",
weapon = { PhysicalMin = 31, PhysicalMax = 58, critChanceBase = 6, attackRateBase = 1.4, },
req = { level = 64, str = 113, int = 113, },
}
itemBases["Carnal Sceptre"] = {
type = "One Handed Mace",
subType = "Sceptre",
implicit = "10% increased Elemental Damage",
implicit = "32% increased Elemental Damage",
weapon = { PhysicalMin = 34, PhysicalMax = 78, critChanceBase = 6, attackRateBase = 1.2, },
req = { level = 66, str = 113, int = 113, },
}
itemBases["Void Sceptre"] = {
type = "One Handed Mace",
subType = "Sceptre",
implicit = "15% increased Elemental Damage",
implicit = "40% increased Elemental Damage",
weapon = { PhysicalMin = 42, PhysicalMax = 63, critChanceBase = 6.5, attackRateBase = 1.25, },
req = { level = 68, str = 104, int = 122, },
}
Expand Down Expand Up @@ -374,7 +374,7 @@ itemBases["Fright Maul"] = {
}
itemBases["Morning Star"] = {
type = "Two Handed Mace",
implicit = "4% increased Radius of Area Skills",
implicit = "4% increased Area of Effect of Area Skills",
weapon = { PhysicalMin = 39, PhysicalMax = 58, critChanceBase = 5, attackRateBase = 1.25, },
req = { level = 34, str = 118, },
}
Expand Down Expand Up @@ -416,7 +416,7 @@ itemBases["Dread Maul"] = {
}
itemBases["Solar Maul"] = {
type = "Two Handed Mace",
implicit = "4% increased Radius of Area Skills",
implicit = "4% increased Area of Effect of Area Skills",
weapon = { PhysicalMin = 64, PhysicalMax = 97, critChanceBase = 5, attackRateBase = 1.25, },
req = { level = 56, str = 187, },
}
Expand Down Expand Up @@ -458,7 +458,7 @@ itemBases["Terror Maul"] = {
}
itemBases["Coronal Maul"] = {
type = "Two Handed Mace",
implicit = "6% increased Radius of Area Skills",
implicit = "6% increased Area of Effect of Area Skills",
weapon = { PhysicalMin = 74, PhysicalMax = 110, critChanceBase = 5, attackRateBase = 1.25, },
req = { level = 69, str = 220, },
}
Loading

0 comments on commit 5d7053b

Please sign in to comment.