From bfe0b01c19f07cbfe7f236ab5739d270066ca1c1 Mon Sep 17 00:00:00 2001 From: Openarl Date: Fri, 2 Sep 2016 02:24:21 +1000 Subject: [PATCH] Release 1.0.15 - Added support for more trigger gems - Added support for Radiant Faith - Blinged up number edit controls - Other minor changes --- Classes/ButtonControl.lua | 3 +- Classes/EditControl.lua | 54 ++++++++++++++-- Classes/SkillsTab.lua | 4 +- Data/Gems/sup_dex.lua | 41 +++++++++++- Data/Gems/sup_int.lua | 43 ++++++++++++- Data/Gems/sup_str.lua | 41 +++++++++++- Modules/Build.lua | 7 +- Modules/Calcs.lua | 120 ++++++++++++++++++++--------------- Modules/CalcsView.lua | 130 +++++++++++++++++++------------------- Modules/ModParser.lua | 2 + README.md | 9 +++ manifest.xml | 22 +++---- 12 files changed, 337 insertions(+), 139 deletions(-) diff --git a/Classes/ButtonControl.lua b/Classes/ButtonControl.lua index 07f931c1..19ae30e6 100644 --- a/Classes/ButtonControl.lua +++ b/Classes/ButtonControl.lua @@ -50,7 +50,8 @@ function ButtonClass:Draw() else SetDrawColor(0.33, 0.33, 0.33) end - DrawString(x + width / 2, y + 2, "CENTER_X", height - 4, "VAR", self:GetProperty("label")) + local overSize = self.overSizeText or 0 + DrawString(x + width / 2, y + 2 - overSize, "CENTER_X", height - 4 + overSize * 2, "VAR", self:GetProperty("label")) end function ButtonClass:OnKeyDown(key) diff --git a/Classes/EditControl.lua b/Classes/EditControl.lua index d646c290..1efed353 100644 --- a/Classes/EditControl.lua +++ b/Classes/EditControl.lua @@ -5,7 +5,10 @@ -- local launch, main = ... -local EditClass = common.NewClass("EditControl", "Control", function(self, anchor, x, y, width, height, init, prompt, filter, limit, changeFunc, style) +local m_floor = math.floor + +local EditClass = common.NewClass("EditControl", "ControlHost", "Control", function(self, anchor, x, y, width, height, init, prompt, filter, limit, changeFunc, style) + self.ControlHost() self.Control(anchor, x, y, width, height) self:SetText(init or "") self.prompt = prompt @@ -18,18 +21,39 @@ local EditClass = common.NewClass("EditControl", "Control", function(self, ancho self.selCol = (style and style.selCol) or "^0" self.selBGCol = (style and style.selBGCol) or "^xBBBBBB" self.blinkStart = GetTime() + if self.filter == "[%d]" then + -- Add +/- buttons for integer number edits + local function buttonSize() + local width, height = self:GetSize() + return height - 4 + end + self.controls.buttonDown = common.New("ButtonControl", {"RIGHT",self,"RIGHT"}, -2, 0, buttonSize, buttonSize, "-", function() + self:OnKeyUp("DOWN") + end) + self.controls.buttonDown.overSizeText = 6 + self.controls.buttonUp = common.New("ButtonControl", {"RIGHT",self.controls.buttonDown,"LEFT"}, 0, 0, buttonSize, buttonSize, "+", function() + self:OnKeyUp("UP") + end) + self.controls.buttonUp.overSizeText = 6 + end end) -function EditClass:SetText(text) +function EditClass:SetText(text, notify) self.buf = tostring(text) self.caret = #self.buf + 1 self.sel = nil + if notify and self.changeFunc then + self.changeFunc(self.buf) + end end function EditClass:IsMouseOver() if not self:IsShown() then return false end + if self:GetMouseOverControl() then + return true + end local x, y = self:GetPos() local width, height = self:GetSize() local cursorX, cursorY = GetCursorPos() @@ -76,7 +100,7 @@ function EditClass:Insert(text) end end -function EditClass:Draw() +function EditClass:Draw(viewPort) local x, y = self:GetPos() local width, height = self:GetSize() local enabled = self:IsEnabled() @@ -111,6 +135,9 @@ function EditClass:Draw() if not enabled then return end + SetDrawLayer(nil, 5) + self:DrawControls(viewPort) + SetDrawLayer(nil, 0) SetViewport(textX, textY, width - 2 - (textX - x), textHeight) if not self.hasFocus then DrawString(0, 0, "LEFT", textHeight, "VAR", self.inactiveCol..self.buf) @@ -162,6 +189,10 @@ function EditClass:OnKeyDown(key, doubleClick) if not self:IsShown() or not self:IsEnabled() then return end + local mOverControl = self:GetMouseOverControl() + if mOverControl and mOverControl.OnKeyDown then + return mOverControl:OnKeyDown(key) + end local shift = IsKeyDown("SHIFT") if key == "LEFTBUTTON" then if not self:IsMouseOver() then @@ -267,7 +298,22 @@ function EditClass:OnKeyUp(key) if self.drag then self.drag = false end - end + elseif self.filter == "[%d]" then + local cur = tonumber(self.buf) + if key == "WHEELUP" or key == "UP" then + if cur then + self:SetText(tostring(cur + 1), true) + else + self:SetText("1", true) + end + elseif key == "WHEELDOWN" or key == "DOWN" then + if cur and cur > 0 then + self:SetText(tostring(cur - 1), true) + else + self:SetText("0", true) + end + end + end return self.hasFocus and self end diff --git a/Classes/SkillsTab.lua b/Classes/SkillsTab.lua index d2e80e29..c93a4941 100644 --- a/Classes/SkillsTab.lua +++ b/Classes/SkillsTab.lua @@ -156,7 +156,7 @@ function SkillsTabClass:CreateGemSlot(index) self.controls["gemSlotName"..index] = slot.nameSpec -- Gem level - slot.level = common.New("EditControl", {"LEFT",slot.nameSpec,"RIGHT"}, 2, 0, 50, 20, nil, nil, "[%d]", 2, function(buf) + slot.level = common.New("EditControl", {"LEFT",slot.nameSpec,"RIGHT"}, 2, 0, 60, 20, nil, nil, "[%d]", 2, function(buf) if not self.displaySkill.gemList[index] then self.displaySkill.gemList[index] = { nameSpec = "", level = 1, quality = 0 } end @@ -169,7 +169,7 @@ function SkillsTabClass:CreateGemSlot(index) self.controls["gemSlotLevel"..index] = slot.level -- Gem quality - slot.quality = common.New("EditControl", {"LEFT",slot.level,"RIGHT"}, 2, 0, 50, 20, nil, nil, "[%d]", 2, function(buf) + slot.quality = common.New("EditControl", {"LEFT",slot.level,"RIGHT"}, 2, 0, 60, 20, nil, nil, "[%d]", 2, function(buf) if not self.displaySkill.gemList[index] then self.displaySkill.gemList[index] = { nameSpec = "", level = 1, quality = 0 } end diff --git a/Data/Gems/sup_dex.lua b/Data/Gems/sup_dex.lua index fbe29004..dae6e6d9 100644 --- a/Data/Gems/sup_dex.lua +++ b/Data/Gems/sup_dex.lua @@ -140,7 +140,46 @@ gems["Cast on Critical Strike"] = { } gems["Cast on Death"] = { dexterity = true, - unsupported = true, + support = true, + spell = true, + trigger = true, + base = { + }, + quality = { + aoeRadiusInc = 3, + }, + levels = { + [1] = { damageMore = 1, }, + [2] = { damageMore = 1.16, }, + [3] = { damageMore = 1.32, }, + [4] = { damageMore = 1.48, }, + [5] = { damageMore = 1.64, }, + [6] = { damageMore = 1.8, }, + [7] = { damageMore = 1.96, }, + [8] = { damageMore = 2.12, }, + [9] = { damageMore = 2.28, }, + [10] = { damageMore = 2.44, }, + [11] = { damageMore = 2.6, }, + [12] = { damageMore = 2.76, }, + [13] = { damageMore = 2.92, }, + [14] = { damageMore = 3.08, }, + [15] = { damageMore = 3.24, }, + [16] = { damageMore = 3.4, }, + [17] = { damageMore = 3.56, }, + [18] = { damageMore = 3.72, }, + [19] = { damageMore = 3.88, }, + [20] = { damageMore = 4.04, }, + [21] = { damageMore = 4.2, }, + [22] = { damageMore = 4.36, }, + [23] = { damageMore = 4.52, }, + [24] = { damageMore = 4.68, }, + [25] = { damageMore = 4.84, }, + [26] = { damageMore = 5, }, + [27] = { damageMore = 5.16, }, + [28] = { damageMore = 5.32, }, + [29] = { damageMore = 5.48, }, + [30] = { damageMore = 5.64, }, + } } gems["Chain"] = { dexterity = true, diff --git a/Data/Gems/sup_int.lua b/Data/Gems/sup_int.lua index 5ae10abf..d5d73ee1 100644 --- a/Data/Gems/sup_int.lua +++ b/Data/Gems/sup_int.lua @@ -135,9 +135,48 @@ gems["Blasphemy"] = { [30] = { curse_aoeRadiusInc = 58, }, } } -gems["Cast When Stunned"] = { +gems["Cast when Stunned"] = { intelligence = true, - unsupported = true, + support = true, + spell = true, + trigger = true, + base = { + }, + quality = { + damageInc = 0.5, + }, + levels = { + [1] = { }, + [2] = { }, + [3] = { }, + [4] = { }, + [5] = { }, + [6] = { }, + [7] = { }, + [8] = { }, + [9] = { }, + [10] = { }, + [11] = { }, + [12] = { }, + [13] = { }, + [14] = { }, + [15] = { }, + [16] = { }, + [17] = { }, + [18] = { }, + [19] = { }, + [20] = { }, + [21] = { }, + [22] = { }, + [23] = { }, + [24] = { }, + [25] = { }, + [26] = { }, + [27] = { }, + [28] = { }, + [29] = { }, + [30] = { }, + } } gems["Chance to Ignite"] = { intelligence = true, diff --git a/Data/Gems/sup_str.lua b/Data/Gems/sup_str.lua index 9a96f80d..85f433e9 100644 --- a/Data/Gems/sup_str.lua +++ b/Data/Gems/sup_str.lua @@ -140,7 +140,46 @@ gems["Cast on Melee Kill"] = { } gems["Cast when Damage Taken"] = { strength = true, - unsupported = true, + support = true, + spell = true, + trigger = true, + base = { + }, + quality = { + damageInc = 0.5, + }, + levels = { + [1] = { damageMore = 0.3, }, + [2] = { damageMore = 0.34, }, + [3] = { damageMore = 0.38, }, + [4] = { damageMore = 0.42, }, + [5] = { damageMore = 0.46, }, + [6] = { damageMore = 0.5, }, + [7] = { damageMore = 0.54, }, + [8] = { damageMore = 0.58, }, + [9] = { damageMore = 0.62, }, + [10] = { damageMore = 0.66, }, + [11] = { damageMore = 0.7, }, + [12] = { damageMore = 0.74, }, + [13] = { damageMore = 0.78, }, + [14] = { damageMore = 0.82, }, + [15] = { damageMore = 0.86, }, + [16] = { damageMore = 0.9, }, + [17] = { damageMore = 0.94, }, + [18] = { damageMore = 0.98, }, + [19] = { damageMore = 1.02, }, + [20] = { damageMore = 1.06, }, + [21] = { damageMore = 1.1, }, + [22] = { damageMore = 1.14, }, + [23] = { damageMore = 1.18, }, + [24] = { damageMore = 1.22, }, + [25] = { damageMore = 1.26, }, + [26] = { damageMore = 1.3, }, + [27] = { damageMore = 1.34, }, + [28] = { damageMore = 1.38, }, + [29] = { damageMore = 1.42, }, + [30] = { damageMore = 1.46, }, + } } gems["Cold to Fire"] = { strength = true, diff --git a/Modules/Build.lua b/Modules/Build.lua index 9a35002c..76e83ee1 100644 --- a/Modules/Build.lua +++ b/Modules/Build.lua @@ -82,7 +82,7 @@ function buildMode:Init(dbFileName, buildName) SetDrawColor(1, 1, 1) DrawString(x + 4, y + 2, "LEFT", 16, "FIXED", str) end - self.controls.characterLevel = common.New("EditControl", {"LEFT",self.anchorTopBarRight,"RIGHT"}, 0, 0, 75, 20, "", "Level", "[%d]", 3, function(buf) + self.controls.characterLevel = common.New("EditControl", {"LEFT",self.anchorTopBarRight,"RIGHT"}, 0, 0, 106, 20, "", "Level", "[%d]", 3, function(buf) self.characterLevel = tonumber(buf) or 1 self.buildFlag = true end) @@ -186,19 +186,24 @@ function buildMode:Init(dbFileName, buildName) { mod = "poison_dps", label = "Poison DPS", fmt = ".1f" }, { }, { mod = "total_life", label = "Total Life", fmt = "d" }, + { mod = "spec_lifeInc", label = "%Inc Life from Tree", fmt = "d%%", condFunc = function(v,o) return v > 0 and o.total_life > 1 end }, { mod = "total_lifeUnreserved", label = "Unreserved Life", fmt = "d", condFunc = function(v,o) return v < o.total_life end }, { mod = "total_lifeUnreservedPercent", label = "Unreserved Life", fmt = "d%%", pc = true, condFunc = function(v,o) return v < 1 end }, { mod = "total_lifeRegen", label = "Life Regen", fmt = ".1f" }, { }, { mod = "total_mana", label = "Total Mana", fmt = "d" }, + { mod = "spec_manaInc", label = "%Inc Mana from Tree", fmt = "d%%" }, { mod = "total_manaUnreserved", label = "Unreserved Mana", fmt = "d", condFunc = function(v,o) return v < o.total_mana end }, { mod = "total_manaUnreservedPercent", label = "Unreserved Mana", fmt = "d%%", pc = true, condFunc = function(v,o) return v < 1 end }, { mod = "total_manaRegen", label = "Mana Regen", fmt = ".1f" }, { }, { mod = "total_energyShield", label = "Energy Shield", fmt = "d" }, + { mod = "spec_energyShieldInc", label = "%Inc ES from Tree", fmt = "d%%" }, { mod = "total_energyShieldRegen", label = "Energy Shield Regen", fmt = ".1f" }, { mod = "total_evasion", label = "Evasion rating", fmt = "d" }, + { mod = "spec_evasionInc", label = "%Inc Evasion from Tree", fmt = "d%%" }, { mod = "total_armour", label = "Armour", fmt = "d" }, + { mod = "spec_armourInc", label = "%Inc Armour from Tree", fmt = "d%%" }, { mod = "total_blockChance", label = "Block Chance", fmt = "d%%", pc = true }, { mod = "total_spellBlockChance", label = "Spell Block Chance", fmt = "d%%", pc = true }, { mod = "total_dodgeAttacks", label = "Attack Dodge Chance", fmt = "d%%", pc = true }, diff --git a/Modules/Calcs.lua b/Modules/Calcs.lua index a320406f..477ff5b4 100644 --- a/Modules/Calcs.lua +++ b/Modules/Calcs.lua @@ -788,10 +788,6 @@ local function finaliseMods(env, output) buildSpaceTable(modDB) -- Merge skill modifiers and calculate life and mana reservations - output.lifeReservedBase = 0 - output.lifeReservedPercent = 0 - output.manaReservedBase = 0 - output.manaReservedPercent = 0 for _, skill in pairs(env.skills) do if skill == env.mainSkill or skill.active then local skillModList = skill.skillModList @@ -824,9 +820,9 @@ local function finaliseMods(env, output) cost = m_ceil(cost * sumMods(modDB, true, "manaReservedMore") * (skillModList.manaReservedMore or 1)) cost = m_ceil(cost * (1 + sumMods(modDB, false, "manaReservedInc") / 100 + (skillModList.manaReservedInc or 0) / 100)) if getMiscVal(modDB, nil, "bloodMagic", false) or skillModList.skill_bloodMagic then - output["lifeReserved"..suffix] = output["lifeReserved"..suffix] + cost + mod_dbMerge(modDB, "reserved", "life"..suffix, cost) else - output["manaReserved"..suffix] = output["manaReserved"..suffix] + cost + mod_dbMerge(modDB, "reserved", "mana"..suffix, cost) end end end @@ -1032,20 +1028,47 @@ end local function performCalcs(env, output) local modDB = env.modDB - -- Calculate life/mana pools and defences - - if startWatch(env, "lifeES") then + -- Calculate life/mana pools + if startWatch(env, "life") then if getMiscVal(modDB, nil, "chaosInoculation", false) then output.total_life = 1 else output.total_life = calcVal(modDB, "life") end + endWatch(env, "life") + end + if startWatch(env, "mana") then + output.total_mana = calcVal(modDB, "mana") + mod_dbMerge(modDB, "", "manaRegenBase", output.total_mana * 0.0175) + output.total_manaRegen = sumMods(modDB, false, "manaRegenBase") * (1 + sumMods(modDB, false, "manaRegenInc", "manaRecoveryInc") / 100) * sumMods(modDB, true, "manaRegenMore", "manaRecoveryMore") + endWatch(env, "mana") + end + + -- Calculate life/mana reservation + for _, pool in pairs({"life", "mana"}) do + if startWatch(env, pool.."Reservation", pool) then + local max = output["total_"..pool] + local reserved = getMiscVal(modDB, "reserved", pool.."Base", 0) + m_floor(max * getMiscVal(modDB, "reserved", pool.."Percent", 0) / 100 + 0.5) + output["total_"..pool.."Reserved"] = reserved + output["total_"..pool.."ReservedPercent"] = reserved / max + output["total_"..pool.."Unreserved"] = max - reserved + output["total_"..pool.."UnreservedPercent"] = (max - reserved) / max + endWatch(env, pool.."Reservation") + end + end + + -- Calculate primary defences + if startWatch(env, "energyShield", "mana") then local convManaToES = getMiscVal(modDB, nil, "manaGainAsEnergyShield", 0) if convManaToES > 0 then output.total_energyShield = sumMods(modDB, false, "manaBase") * (1 + sumMods(modDB, false, "energyShieldInc", "defencesInc", "manaInc") / 100) * sumMods(modDB, true, "energyShieldMore", "defencesMore", "manaMore") * convManaToES / 100 else output.total_energyShield = 0 end + local energyShieldFromReservedMana = getMiscVal(modDB, nil, "energyShieldFromReservedMana", 0) + if energyShieldFromReservedMana > 0 then + output.total_energyShield = output.total_energyShield + output.total_manaReserved * (1 + sumMods(modDB, false, "energyShieldInc", "defencesInc") / 100) * sumMods(modDB, true, "energyShieldMore", "defencesMore") * energyShieldFromReservedMana / 100 + end output.total_gear_energyShieldBase = env.itemModList.energyShieldBase or 0 for _, slot in pairs({"global","slot:Helmet","slot:Body Armour","slot:Gloves","slot:Boots","slot:Shield"}) do buildSpaceTable(modDB, { [slot] = true }) @@ -1060,31 +1083,16 @@ local function performCalcs(env, output) buildSpaceTable(modDB) output.total_energyShieldRecharge = output.total_energyShield * 0.2 * (1 + sumMods(modDB, false, "energyShieldRechargeInc", "energyShieldRecoveryInc") / 100) * sumMods(modDB, true, "energyShieldRechargeMore", "energyShieldRecoveryMore") output.total_energyShieldRechargeDelay = 2 / (1 + getMiscVal(modDB, nil, "energyShieldRechargeFaster", 0) / 100) - if getMiscVal(modDB, nil, "noLifeRegen", false) then - output.total_lifeRegen = 0 - elseif getMiscVal(modDB, nil, "zealotsOath", false) then - output.total_lifeRegen = 0 - mod_dbMerge(modDB, "", "energyShieldRegenBase", sumMods(modDB, false, "lifeRegenBase")) - mod_dbMerge(modDB, "", "energyShieldRegenPercent", sumMods(modDB, false, "lifeRegenPercent")) - else - mod_dbMerge(modDB, "", "lifeRegenBase", output.total_life * sumMods(modDB, false, "lifeRegenPercent") / 100) - output.total_lifeRegen = sumMods(modDB, false, "lifeRegenBase") * (1 + sumMods(modDB, false, "lifeRecoveryInc") / 100) * sumMods(modDB, true, "lifeRecoveryMore") - end - mod_dbMerge(modDB, "", "energyShieldRegenBase", output.total_energyShield * sumMods(modDB, false, "energyShieldRegenPercent") / 100) - output.total_energyShieldRegen = sumMods(modDB, false, "energyShieldRegenBase") * (1 + sumMods(modDB, false, "energyShieldRecoveryInc") / 100) * sumMods(modDB, true, "energyShieldRecoveryMore") - endWatch(env, "lifeES") + endWatch(env, "energyShield") end - - if startWatch(env, "mana") then - output.total_mana = calcVal(modDB, "mana") - mod_dbMerge(modDB, "", "manaRegenBase", output.total_mana * 0.0175) - output.total_manaRegen = sumMods(modDB, false, "manaRegenBase") * (1 + sumMods(modDB, false, "manaRegenInc", "manaRecoveryInc") / 100) * sumMods(modDB, true, "manaRegenMore", "manaRecoveryMore") - endWatch(env, "mana") - end - - if startWatch(env, "armourEvasion") then + if startWatch(env, "armourEvasion", "life") then output.total_evasion = 0 - output.total_armour = 0 + local armourFromReservedLife = getMiscVal(modDB, nil, "armourFromReservedLife", 0) + if armourFromReservedLife > 0 then + output.total_armour = output.total_lifeReserved * (1 + sumMods(modDB, false, "armourInc", "armourAndEvasionInc", "defencesInc") / 100) * sumMods(modDB, true, "armourMore", "defencesMore") * armourFromReservedLife / 100 + else + output.total_armour = 0 + end output.total_gear_evasionBase = env.itemModList.evasionBase or 0 output.total_gear_armourBase = env.itemModList.armourBase or 0 local ironReflexes = getMiscVal(modDB, nil, "ironReflexes", false) @@ -1123,17 +1131,36 @@ local function performCalcs(env, output) endWatch(env, "armourEvasion") end + if startWatch(env, "lifeEnergyShieldRegen", "life", "energyShield") then + if getMiscVal(modDB, nil, "noLifeRegen", false) then + output.total_lifeRegen = 0 + elseif getMiscVal(modDB, nil, "zealotsOath", false) then + output.total_lifeRegen = 0 + mod_dbMerge(modDB, "", "energyShieldRegenBase", sumMods(modDB, false, "lifeRegenBase")) + mod_dbMerge(modDB, "", "energyShieldRegenPercent", sumMods(modDB, false, "lifeRegenPercent")) + else + mod_dbMerge(modDB, "", "lifeRegenBase", output.total_life * sumMods(modDB, false, "lifeRegenPercent") / 100) + output.total_lifeRegen = sumMods(modDB, false, "lifeRegenBase") * (1 + sumMods(modDB, false, "lifeRecoveryInc") / 100) * sumMods(modDB, true, "lifeRecoveryMore") + end + mod_dbMerge(modDB, "", "energyShieldRegenBase", output.total_energyShield * sumMods(modDB, false, "energyShieldRegenPercent") / 100) + output.total_energyShieldRegen = sumMods(modDB, false, "energyShieldRegenBase") * (1 + sumMods(modDB, false, "energyShieldRecoveryInc") / 100) * sumMods(modDB, true, "energyShieldRecoveryMore") + endWatch(env, "lifeEnergyShieldRegen") + end + if startWatch(env, "resist") then for _, elem in pairs({"fire", "cold", "lightning"}) do output["total_"..elem.."ResistMax"] = sumMods(modDB, false, elem.."ResistMax") - output["total_"..elem.."Resist"] = m_min(sumMods(modDB, false, elem.."Resist", "elementalResist") - 60, output["total_"..elem.."ResistMax"]) + output["total_"..elem.."ResistTotal"] = sumMods(modDB, false, elem.."Resist", "elementalResist") - 60 + output["total_"..elem.."Resist"] = m_min(output["total_"..elem.."ResistTotal"], output["total_"..elem.."ResistMax"]) end if getMiscVal(modDB, nil, "chaosInoculation", false) then output.total_chaosResistMax = 100 + output.total_chaosResistTotal = 100 output.total_chaosResist = 100 else output.total_chaosResistMax = sumMods(modDB, false, "chaosResistMax") - output.total_chaosResist = sumMods(modDB, false, "chaosResist") - 60 + output.total_chaosResistTotal = sumMods(modDB, false, "chaosResist") - 60 + output.total_chaosResist = m_min(output.total_chaosResistTotal, output.total_chaosResistMax) end endWatch(env, "resist") end @@ -1162,16 +1189,6 @@ local function performCalcs(env, output) endWatch(env, "otherDef") end - -- Calculate life/mana reservation - for _, pool in pairs({"life", "mana"}) do - local max = output["total_"..pool] - local reserved = output[pool.."ReservedBase"] + m_floor(max * output[pool.."ReservedPercent"] / 100 + 0.5) - output["total_"..pool.."Reserved"] = reserved - output["total_"..pool.."ReservedPercent"] = reserved / max - output["total_"..pool.."Unreserved"] = max - reserved - output["total_"..pool.."UnreservedPercent"] = (max - reserved) / max - end - -- Enable skill namespaces buildSpaceTable(modDB, env.skillSpaceFlags) @@ -1815,14 +1832,15 @@ function calcs.buildOutput(build, input, output, mode) output.total_extraPoints = getMiscVal(env.modDB, nil, "extraPoints", 0) + -- Add extra display-only stats + for k, v in pairs(env.specModList) do + output["spec_"..k] = v + end + for k, v in pairs(env.itemModList) do + output["gear_"..k] = v + end + if mode == "GRID" then - -- Add extra display-only stats - for k, v in pairs(env.specModList) do - output["spec_"..k] = v - end - for k, v in pairs(env.itemModList) do - output["gear_"..k] = v - end for i, aux in pairs(env.auxSkills) do output["buff_label"..i] = aux.displayLabel end diff --git a/Modules/CalcsView.lua b/Modules/CalcsView.lua index 82f947d2..242c64f2 100644 --- a/Modules/CalcsView.lua +++ b/Modules/CalcsView.lua @@ -18,7 +18,7 @@ local function fieldNames(pre, suf, spec) end local columnWidths = { - 140, 60, + 160, 60, 160, 60, 160, 60, 160, 95, 95, 95, 95, 95, 95, 70 @@ -45,31 +45,31 @@ columns[1] = { { "output", "Experience:", "monster_xp", formatPercent }, { }, { "Life:" }, - { "output", "Spec +:", "spec_lifeBase" }, - { "output", "Spec %:", "spec_lifeInc" }, - { "output", "Gear +:", "gear_lifeBase" }, - { "output", "Gear %:", "gear_lifeInc" }, + { "output", "Base from Tree:", "spec_lifeBase" }, + { "output", "Inc. from Tree %:", "spec_lifeInc" }, + { "output", "Base from Gear:", "gear_lifeBase" }, + { "output", "Inc. from Gear %:", "gear_lifeInc" }, { "output", "Total:", "total_life", formatRound }, { "output", "Reserved:", "total_lifeReserved", formatRound }, { "output", "Unreserved:", "total_lifeUnreserved", formatRound }, { "output", "Unreserved %:", "total_lifeUnreservedPercent", formatPercent }, - { "output", "Spec Regen %:", "spec_lifeRegenPercent" }, - { "output", "Gear Regen +:", "gear_lifeRegenBase" }, - { "output", "Gear Regen %:", "gear_lifeRegenPercent" }, + { "output", "Regen from Tree %:", "spec_lifeRegenPercent" }, + { "output", "Base Regen from Gear:", "gear_lifeRegenBase" }, + { "output", "Regen from Gear %:", "gear_lifeRegenPercent" }, { "output", "Total Regen:", "total_lifeRegen", getFormatRound(1) }, { }, { "Mana:" }, - { "output", "Spec +:", "spec_manaBase" }, - { "output", "Spec %:", "spec_manaInc" }, - { "output", "Gear +:", "gear_manaBase" }, - { "output", "Gear %:", "gear_manaInc" }, + { "output", "Base from Tree:", "spec_manaBase" }, + { "output", "Inc. from Tree %:", "spec_manaInc" }, + { "output", "Base from Gear:", "gear_manaBase" }, + { "output", "Inc. from Gear:", "gear_manaInc" }, { "output", "Total:", "total_mana", formatRound }, { "output", "Reserved:", "total_manaReserved", formatRound }, { "output", "Unreserved:", "total_manaUnreserved", formatRound }, { "output", "Unreserved %:", "total_manaUnreservedPercent", formatPercent }, - { "output", "Spec Regen %:", "spec_manaRegenInc" }, - { "output", "Gear Regen +:", "gear_manaRegenBase" }, - { "output", "Gear Regen %:", "gear_manaRegenInc" }, + { "output", "Inc. Regen from Tree %:", "spec_manaRegenInc" }, + { "output", "Base Regen from Gear:", "gear_manaRegenBase" }, + { "output", "Inc. Regen from Gear %:", "gear_manaRegenInc" }, { "output", "Total Regen:", "total_manaRegen", getFormatRound(1) }, { }, { "Supporting Skills:" }, @@ -80,29 +80,29 @@ columns[1] = { columns[3] = { { { "Energy Shield:" }, - { "output", "Spec +:", "spec_energyShieldBase" }, - { "output", "Spec %:", "spec_energyShieldInc" }, - { "output", "Gear +:", "total_gear_energyShieldBase" }, - { "output", "Gear %:", "gear_energyShieldInc" }, + { "output", "Base from Tree:", "spec_energyShieldBase" }, + { "output", "Inc. from Tree %:", "spec_energyShieldInc" }, + { "output", "Base from Gear:", "total_gear_energyShieldBase" }, + { "output", "Inc. from Gear %:", "gear_energyShieldInc" }, { "output", "Total:", "total_energyShield", formatRound }, { "output", "Recharge rate:", "total_energyShieldRecharge", getFormatRound(1) }, { "output", "Recharge delay:", "total_energyShieldRechargeDelay", getFormatSec(2) }, { "output", "Regen:", "total_energyShieldRegen", getFormatRound(1) }, { }, { "Evasion:" }, - { "output", "Spec +:", "spec_evasionBase" }, - { "output", "Spec %:", "spec_evasionInc" }, - { "output", "Gear +:", "total_gear_evasionBase" }, - { "output", "Gear %:", "gear_evasionInc" }, + { "output", "Base from Tree:", "spec_evasionBase" }, + { "output", "Inc. from Tree %:", "spec_evasionInc" }, + { "output", "Base from Gear:", "total_gear_evasionBase" }, + { "output", "Inc. from Gear %:", "gear_evasionInc" }, { "output", "Total:", "total_evasion", formatRound }, { "input", "Use Monster Level?", "misc_evadeMonsterLevel", "check" }, { "output", "Evade Chance:", "total_evadeChance", formatPercent }, { }, { "Armour:" }, - { "output", "Spec +:", "spec_armourBase" }, - { "output", "Spec %:", "spec_armourInc" }, - { "output", "Gear +:", "total_gear_armourBase" }, - { "output", "Gear %:", "gear_armourInc" }, + { "output", "Base from Tree:", "spec_armourBase" }, + { "output", "Inc. from Tree %:", "spec_armourInc" }, + { "output", "Base from Gear:", "total_gear_armourBase" }, + { "output", "Inc. from Gear %:", "gear_armourInc" }, { "output", "Total:", "total_armour", formatRound }, { }, { "Block and Stun:" }, @@ -166,51 +166,51 @@ columns[5] = { flag = "attack", { "output", "Weapon Crit %:", "gear_weapon1_critChanceBase" }, }, { - { "output", "Spec Global Crit %:", "spec_critChanceInc" }, + { "output", "Tree Global Crit %:", "spec_critChanceInc" }, { "output", "Gear Global Crit %:", "gear_global_critChanceInc" }, }, { flag = "spell", - { "output", "Spec Spell Crit %:", "spec_spell_critChanceInc" }, + { "output", "Tree Spell Crit %:", "spec_spell_critChanceInc" }, { "output", "Gear Spell Crit %:", "gear_spell_critChanceInc" }, }, { flag = "melee", - { "output", "Spec Melee Crit %:", "spec_melee_critChanceInc" }, + { "output", "Tree Melee Crit %:", "spec_melee_critChanceInc" }, }, { flag = "totem", - { "output", "Spec Totem Crit %:", "spec_totem_critChanceInc" }, + { "output", "Tree Totem Crit %:", "spec_totem_critChanceInc" }, }, { flag = "trap", - { "output", "Spec Trap Crit %:", "spec_trap_critChanceInc" }, + { "output", "Tree Trap Crit %:", "spec_trap_critChanceInc" }, }, { flag = "mine", - { "output", "Spec Mine Crit %:", "spec_mine_critChanceInc" }, + { "output", "Tree Mine Crit %:", "spec_mine_critChanceInc" }, }, { { "output", "Crit Chance:", "total_critChance", getFormatPercent(2) }, - { "output", "Spec Global Multi %:", "spec_critMultiplier" }, + { "output", "Tree Global Multi %:", "spec_critMultiplier" }, { "output", "Gear Global Multi %:", "gear_critMultiplier" }, }, { flag = "spell", - { "output", "Spec Spell Multi %:", "spec_spell_critMultiplier" }, + { "output", "Tree Spell Multi %:", "spec_spell_critMultiplier" }, }, { flag = "melee", - { "output", "Spec Melee Multi %:", "spec_melee_critMultiplier" }, + { "output", "Tree Melee Multi %:", "spec_melee_critMultiplier" }, }, { flag = "totem", - { "output", "Spec Totem Multi %:", "spec_totem_critMultiplier" }, + { "output", "Tree Totem Multi %:", "spec_totem_critMultiplier" }, }, { flag = "trap", - { "output", "Spec Trap Multi %:", "spec_trap_critMultiplier" }, + { "output", "Tree Trap Multi %:", "spec_trap_critMultiplier" }, }, { flag = "mine", - { "output", "Spec Mine Multi %:", "spec_mine_critMultiplier" }, + { "output", "Tree Mine Multi %:", "spec_mine_critMultiplier" }, }, { { "output", "Multiplier:", "total_critMultiplier", formatPercent }, }, { flag = "attack", { }, { "Accuracy:" }, - { "output", "Spec Accuracy+:", "spec_accuracyBase" }, - { "output", "Spec Accuracy %:", "spec_accuracyInc" }, + { "output", "Tree Accuracy+:", "spec_accuracyBase" }, + { "output", "Tree Accuracy %:", "spec_accuracyInc" }, { "output", "Gear Accuracy+:", "gear_accuracyBase" }, { "output", "Gear Accuracy %:", "gear_accuracyInc" }, { "output", "Total Accuracy:", "total_accuracy", formatRound }, @@ -248,36 +248,36 @@ columns[7] = { { "output", "Weapon DPS:", fieldNames("gear_weapon2", "DPS", "plcfhae"), getFormatRound(2) }, }, { flag = "attack", - { "output", "Spec Attack Dmg %:", fieldNames("spec_attack", "Inc", "pa") }, - { "output", "Spec Weapon Dmg %:", fieldNames("spec_weapon", "Inc", "plcfae") }, + { "output", "Tree Attack Dmg %:", fieldNames("spec_attack", "Inc", "pa") }, + { "output", "Tree Weapon Dmg %:", fieldNames("spec_weapon", "Inc", "plcfae") }, { "output", "Gear Weapon Dmg %:", fieldNames("gear_weapon", "Inc", "plcfae") }, }, { flag = "spell", { { "Spell:", "Physical", "Lightning", "Cold", "Fire", "Chaos", "Combined", "Elemental" } }, - { "output", "Spec Spell Dmg %:", fieldNames("spec_spell", "Inc", "a") }, + { "output", "Tree Spell Dmg %:", fieldNames("spec_spell", "Inc", "a") }, { "output", "Gear Spell Dmg %:", fieldNames("gear_spell", "Inc", "a") }, }, { flag = "projectile", - { "output", "Spec Projectile Dmg %:", fieldNames("spec_projectile", "Inc", "a") }, + { "output", "Tree Projectile Dmg %:", fieldNames("spec_projectile", "Inc", "a") }, { "output", "Gear Projectile Dmg %:", fieldNames("gear_projectile", "Inc", "a") }, }, { flag = "aoe", - { "output", "Spec Area Dmg %:", fieldNames("spec_aoe", "Inc", "a") }, + { "output", "Tree Area Dmg %:", fieldNames("spec_aoe", "Inc", "a") }, { "output", "Gear Area Dmg %:", fieldNames("gear_aoe", "Inc", "a") }, }, { flag = "totem", - { "output", "Spec Totem Dmg %:", fieldNames("spec_totem", "Inc", "a") }, + { "output", "Tree Totem Dmg %:", fieldNames("spec_totem", "Inc", "a") }, { "output", "Gear Totem Dmg %:", fieldNames("gear_totem", "Inc", "a") }, }, { flag = "trap", - { "output", "Spec Trap Dmg %:", fieldNames("spec_trap", "Inc", "a") }, + { "output", "Tree Trap Dmg %:", fieldNames("spec_trap", "Inc", "a") }, { "output", "Gear Trap Dmg %:", fieldNames("gear_trap", "Inc", "a") }, }, { flag = "mine", - { "output", "Spec Mine Dmg %:", fieldNames("spec_mine", "Inc", "a") }, + { "output", "Tree Mine Dmg %:", fieldNames("spec_mine", "Inc", "a") }, { "output", "Gear Mine Dmg %:", fieldNames("gear_mine", "Inc", "a") }, }, { - { "output", "Spec Global %:", fieldNames("spec", "Inc", "plcfhe") }, + { "output", "Tree Global %:", fieldNames("spec", "Inc", "plcfhe") }, { "output", "Gear Global %:", fieldNames("gear", "Inc", "plcfhae") }, }, { flag = "attack", @@ -289,9 +289,9 @@ columns[7] = { { "output", "Gear Spell Max+:", fieldNames("gear_spell", "Max", "plcfh") }, }, { flag = "attack", - { "output", "Spec Attack Speed %:", "spec_attackSpeedInc" }, + { "output", "Tree Attack Speed %:", "spec_attackSpeedInc" }, { "output", "Gear Attack Speed %:", "gear_attackSpeedInc" }, - { "output", "Spec Attack&Cast Sp. %:", "spec_speedInc" }, + { "output", "Tree Attack&Cast Sp. %:", "spec_speedInc" }, { "output", "Gear Attack&Cast Sp. %:", "gear_speedInc" }, { "output", "Enemy Resists:", fieldNames("enemy", "Resist", "lcfh") }, { "output", "Attack Damage:", fieldNames("total", "", "plcfha") }, @@ -301,9 +301,9 @@ columns[7] = { { "output", "Attack DPS:", "total_dps", getFormatRound(1) }, }, { flag = "spell", - { "output", "Spec Cast Speed %:", "spec_castSpeedInc" }, + { "output", "Tree Cast Speed %:", "spec_castSpeedInc" }, { "output", "Gear Cast Speed %:", "gear_castSpeedInc" }, - { "output", "Spec Attack&Cast Sp. %:", "spec_speedInc" }, + { "output", "Tree Attack&Cast Sp. %:", "spec_speedInc" }, { "output", "Gear Attack&Cast Sp. %:", "gear_speedInc" }, { "output", "Enemy Resists:", fieldNames("enemy", "Resist", "lcfh") }, { "output", "Spell Damage:", fieldNames("total", "", "plcfha") }, @@ -313,9 +313,9 @@ columns[7] = { { "output", "Spell DPS:", "total_dps", getFormatRound(1) }, }, { flag = "cast", - { "output", "Spec Cast Speed %:", "spec_castSpeedInc" }, + { "output", "Tree Cast Speed %:", "spec_castSpeedInc" }, { "output", "Gear Cast Speed %:", "gear_castSpeedInc" }, - { "output", "Spec Attack&Cast Sp. %:", "spec_speedInc" }, + { "output", "Tree Attack&Cast Sp. %:", "spec_speedInc" }, { "output", "Gear Attack&Cast Sp. %:", "gear_speedInc" }, { "output", "Enemy Resists:", fieldNames("enemy", "Resist", "lcfh") }, { "output", "Secondary Damage:", fieldNames("total", "", "plcfha") }, @@ -327,7 +327,7 @@ columns[7] = { }, { flag = "projectile", { "output", "Projectile Count:", "total_projectileCount" }, - { "output", "Spec Pierce Chance %:", "spec_pierceChance" }, + { "output", "Tree Pierce Chance %:", "spec_pierceChance" }, { "output", "Gear Pierce Chance %:", "gear_pierceChance" }, { "output", "Pierce Chance:", "total_pierce", formatPercent }, { "output", "Projectile Speed Mod:", "total_projectileSpeedMod", formatPercent }, @@ -336,7 +336,7 @@ columns[7] = { { "output", "AoE Radius Mod:", "total_aoeRadiusMod", formatPercent }, }, { flag = "duration", - { "output", "Spec Duration %:", "spec_durationInc" }, + { "output", "Tree Duration %:", "spec_durationInc" }, { "output", "Skill Duration Mod:", "total_durationMod", formatPercent }, { "output", "Skill Duration:", "total_duration", getFormatSec(2) }, }, { @@ -348,40 +348,40 @@ columns[7] = { { "output", "Active Mine Limit:", "total_activeMineLimit" }, }, { flag = "dot", - { "output", "Spec DoT Dmg %:", fieldNames("spec_dot", "Inc", "pfa") }, + { "output", "Tree DoT Dmg %:", fieldNames("spec_dot", "Inc", "pfa") }, { "output", "Gear DoT Dmg %:", fieldNames("gear_dot", "Inc", "pfa") }, { "output", "DoT:", fieldNames("total", "Dot", "plcfha"), getFormatRound(1) }, }, { flag = "bleed", - { "output", "Spec Bleed Chance %:", "spec_bleedChance" }, + { "output", "Tree Bleed Chance %:", "spec_bleedChance" }, { "output", "Gear Bleed Chance %:", "gear_bleedChance" }, { "output", "Bleed Chance:", "bleed_chance", formatPercent }, { "output", "Bleed DPS:", "bleed_dps", getFormatRound(1) }, { "output", "Bleed Duration:", "bleed_duration", getFormatSec(2) }, }, { flag = "poison", - { "output", "Spec Poison Chance %:", "spec_poisonChance" }, + { "output", "Tree Poison Chance %:", "spec_poisonChance" }, { "output", "Gear Poison Chance %:", "gear_poisonChance" }, - { "output", "Spec Poison Dmg %:", "spec_poison_damageInc" }, + { "output", "Tree Poison Dmg %:", "spec_poison_damageInc" }, { "output", "Poison Chance:", "poison_chance", formatPercent }, { "output", "Poison DPS:", "poison_dps", getFormatRound(1) }, { "output", "Poison Duration:", "poison_duration", getFormatSec(2) }, }, { flag = "ignite", - { "output", "Spec Ignite Chance %:", "spec_igniteChance" }, + { "output", "Tree Ignite Chance %:", "spec_igniteChance" }, { "output", "Gear Ignite Chance %:", "gear_igniteChance" }, { "output", "Ignite Chance:", "ignite_chance", formatPercent }, { "output", "Ignite DPS:", "ignite_dps", getFormatRound(1) }, { "output", "Ignite Duration:", "ignite_duration", getFormatSec(2) }, }, { flag = "shock", - { "output", "Spec Shock Chance %:", "spec_shockChance" }, + { "output", "Tree Shock Chance %:", "spec_shockChance" }, { "output", "Gear Shock Chance %:", "gear_shockChance" }, { "output", "Shock Chance:", "shock_chance", formatPercent }, { "output", "Shock Duration Mod:", "shock_durationMod", formatPercent }, }, { flag = "freeze", - { "output", "Spec Freeze Chance %:", "spec_freezeChance" }, + { "output", "Tree Freeze Chance %:", "spec_freezeChance" }, { "output", "Gear Freeze Chance %:", "gear_freezeChance" }, { "output", "Freeze Chance:", "freeze_chance", formatPercent }, { "output", "Freeze Duration Mod:", "freeze_durationMod", formatPercent }, diff --git a/Modules/ModParser.lua b/Modules/ModParser.lua index 0155d3ac..bb498701 100644 --- a/Modules/ModParser.lua +++ b/Modules/ModParser.lua @@ -364,6 +364,8 @@ local specialModList = { ["(%d+)%% increased damage of each damage type for which you have a matching golem"] = function(num) return { CondMod_HavePhysicalGolem_physicalInc = num, CondMod_HaveLightningGolem_lightningInc = num, CondMod_HaveColdGolem_coldInc = num, CondMod_HaveFireGolem_fireInc = num, CondMod_HaveChaosGolem_chaosInc = num } end, ["100%% increased effect of buffs granted by your elemental golems"] = { Cond_LiegeOfThePrimordial = true }, ["enemies you curse take (%d+)%% increased damage"] = function(num) return { CondMod_EnemyCursed_effective_damageTakenInc = num } end, + ["grants armour equal to (%d+)%% of your reserved life to you and nearby allies"] = function(num) return { armourFromReservedLife = num } end, + ["grants maximum energy shield equal to (%d+)%% of your reserved mana to you and nearby allies"] = function(num) return { energyShieldFromReservedMana = num } end, -- Special node types ["(%d+)%% of block chance applied to spells"] = function(num) return { blockChanceConv = num } end, ["(%d+)%% additional block chance with staves"] = function(num) return { CondMod_UsingStaff_blockChance = num } end, diff --git a/README.md b/README.md index 09c2a278..3462ed98 100644 --- a/README.md +++ b/README.md @@ -48,16 +48,25 @@ Head over to the [Releases](https://github.com/Openarl/PathOfBuilding/releases) ![ss3](https://cloud.githubusercontent.com/assets/19189971/18089780/f0ff234a-6f04-11e6-8c88-6193fe59a5c4.png) ## Changelog +### 1.0.15 - 2016/09/02 + * Added support for Cast when Damage Taken, Cast when Stunned and Cast on Death (yes, really!) + * Added support for Radiant Faith + * Enabled mousewheel support on number edits, and added +/- buttons (character level, gem level etc) + * Clarified many of the field labels in the Calcs tab + * Added some tree %inc stats to the side bar + ### 1.0.14 - 2016/09/01 * Fixed tags on certain multipart skills not correctly applying * Fixed energy shield not showing up on Sin Trek * Dual Wielding modifiers will now apply * Skills that can use both weapons still only use the main hand at the moment; that requires a bit more work to implement + ### 1.0.13 - 2016/09/01 * Added a scroll bar to the Items tab to fix the issue with low screen resolutions * The scroll bar will automatically jump to the right when you start editing an item, then jump back when you save it * This might be a little disorienting; need feedback on this * Also fixed some minor issues with scroll bars (mouse wheel should now work on all of them) + ### 1.0.12 - 2016/09/01 * Updated tree to 2.4.0 * Added latest patch note changes \ No newline at end of file diff --git a/manifest.xml b/manifest.xml index 1db20a07..fb30593c 100644 --- a/manifest.xml +++ b/manifest.xml @@ -1,6 +1,6 @@ - + @@ -8,13 +8,13 @@ - + - + @@ -29,20 +29,20 @@ - + - + - - + + - + @@ -51,9 +51,9 @@ - - - + + +