diff --git a/Classes/ImportTab.lua b/Classes/ImportTab.lua index a7585f3ea..238702aaa 100644 --- a/Classes/ImportTab.lua +++ b/Classes/ImportTab.lua @@ -124,7 +124,44 @@ You can get this from your web browser's cookies while logged into the Path of E self.controls.generateCodeCopy.enabled = function() return #self.controls.generateCodeOut.buf > 0 end - self.controls.generateCodeNote = common.New("LabelControl", {"TOPLEFT",self.controls.generateCodeOut,"BOTTOMLEFT"}, 0, 4, 0, 14, "^7Note: this code can be very long; it may be easiest to share it using Pastebin or similar.") + self.controls.generateCodePastebin = common.New("ButtonControl", {"LEFT",self.controls.generateCodeCopy,"RIGHT"}, 8, 0, 140, 20, "Share with Pastebin", function() + local id = LaunchSubScript([[ + local code = ... + local curl = require("lcurl.safe") + local page = "" + local easy = curl.easy() + easy:setopt_url("https://pastebin.com/api/api_post.php") + easy:setopt(curl.OPT_POST, true) + easy:setopt(curl.OPT_POSTFIELDS, "api_dev_key=c4757f22e50e65e21c53892fd8e0a9ff&api_option=paste&api_paste_code="..code) + easy:setopt_writefunction(function(data) + page = page..data + return true + end) + easy:perform() + easy:close() + if page:match("pastebin.com") then + return page + else + return nil, page + end + ]], "", "", self.controls.generateCodeOut.buf) + if id then + self.controls.generateCodeOut:SetText("") + self.controls.generateCodePastebin.label = "Creating paste..." + launch:RegisterSubScript(id, function(pasteLink, errMsg) + self.controls.generateCodePastebin.label = "Share with Pastebin" + if errMsg then + main:OpenMessagePopup("Pastebin.com", "Error creating paste:\n"..errMsg) + else + self.controls.generateCodeOut:SetText(pasteLink) + end + end) + end + end) + self.controls.generateCodePastebin.enabled = function() + return #self.controls.generateCodeOut.buf > 0 and not self.controls.generateCodeOut.buf:match("pastebin%.com") + end + self.controls.generateCodeNote = common.New("LabelControl", {"TOPLEFT",self.controls.generateCodeOut,"BOTTOMLEFT"}, 0, 4, 0, 14, "^7Note: this code can be very long; you can use 'Share with Pastebin' to shrink it.") self.controls.importCodeHeader = common.New("LabelControl", {"TOPLEFT",self.controls.generateCodeNote,"BOTTOMLEFT"}, 0, 26, 0, 16, "^7To import a build, enter the code here:") self.controls.importCodeIn = common.New("EditControl", {"TOPLEFT",self.controls.importCodeHeader,"BOTTOMLEFT"}, 0, 4, 250, 20, "", nil, "^%w_%-=", nil, function(buf) if #buf == 0 then @@ -146,6 +183,34 @@ You can get this from your web browser's cookies while logged into the Path of E self.controls.importCodeState.label = function() return (self.importCodeState == "VALID" and data.colorCodes.POSITIVE.."Code is valid") or (self.importCodeState == "INVALID" and data.colorCodes.NEGATIVE.."Invalid code") or "" end + self.controls.importCodePastebin = common.New("ButtonControl", {"LEFT",self.controls.importCodeIn,"RIGHT"}, 90, 0, 160, 20, "Import from Pastebin...", function() + local controls = { } + controls.editLabel = common.New("LabelControl", nil, 0, 20, 0, 16, "Enter Pastebin.com link:") + controls.edit = common.New("EditControl", nil, 0, 40, 250, 18, "", nil, nil, nil, function(buf) + controls.msg.label = "" + end) + controls.msg = common.New("LabelControl", nil, 0, 58, 0, 16, "") + controls.import = common.New("ButtonControl", nil, -45, 80, 80, 20, "Import", function() + controls.import.enabled = false + controls.msg.label = "Retrieving paste..." + launch:DownloadPage(controls.edit.buf:gsub("pastebin%.com/(%w+)$","pastebin.com/raw/%1"), function(page, errMsg) + if errMsg then + controls.msg.label = "^1"..errMsg + controls.import.enabled = true + else + self.controls.importCodeIn:SetText(page, true) + main:ClosePopup() + end + end) + end) + controls.import.enabled = function() + return #controls.edit.buf > 0 and controls.edit.buf:match("pastebin%.com/%w+") + end + controls.cancel = common.New("ButtonControl", nil, 45, 80, 80, 20, "Cancel", function() + main:ClosePopup() + end) + main:OpenPopup(280, 110, "Import from Pastebin", controls, "import", "edit") + end) self.controls.importCodeMode = common.New("DropDownControl", {"TOPLEFT",self.controls.importCodeIn,"BOTTOMLEFT"}, 0, 4, 160, 20, { "Import to this build", "Import to a new build:" }) self.controls.importCodeMode.enabled = function() return self.importCodeState == "VALID" and self.build.dbFileName diff --git a/Data/Bases/amulet.lua b/Data/Bases/amulet.lua index 9bfb3410f..b1c449218 100644 --- a/Data/Bases/amulet.lua +++ b/Data/Bases/amulet.lua @@ -161,7 +161,7 @@ itemBases["Splitnewt Talisman"] = { itemBases["Wereclaw Talisman"] = { type = "Amulet", subType = "Talisman", - implicit = "+(16-24)% to Global Critical Strike Multiplier", + implicit = "+(24-36)% to Global Critical Strike Multiplier", } itemBases["Longtooth Talisman"] = { type = "Amulet", diff --git a/Data/New.lua b/Data/New.lua index 1f7e43830..e56f6f1a6 100644 --- a/Data/New.lua +++ b/Data/New.lua @@ -85,7 +85,7 @@ Requires Level 8 Implicits: 0 During Flask Effect, 10% reduced Damage taken of each Element for which your Uncapped Elemental Resistance is lowest -During Flask Effect, Damage Penetrates 20% of Resistance of each Element for which your +During Flask Effect, Damage Penetrates 20% Resistance of each Element for which your Uncapped Elemental Resistance is highest ]],[[ Ahn's Heritage diff --git a/Data/Uniques/amulet.lua b/Data/Uniques/amulet.lua index 9f4dc6f78..4790d88f3 100644 --- a/Data/Uniques/amulet.lua +++ b/Data/Uniques/amulet.lua @@ -309,10 +309,14 @@ Cannot gain Power Charges ]],[[ Rigwald's Curse Wereclaw Talisman +Variant: Pre 2.2.0 +Variant: Current League: Talisman Standard Requires Level 28 Talisman Tier: 2 -+(16-24)% to Global Critical Strike Multiplier +Implicits: 2 +{variant:1}+(16-24)% to Global Critical Strike Multiplier +{variant:2}+(24-36)% to Global Critical Strike Multiplier +7% Base Unarmed Critical Strike Chance Modifiers to Claw Damage also apply to Unarmed Modifiers to Claw Attack Speed also apply to Unarmed diff --git a/Modules/Calcs.lua b/Modules/Calcs.lua index 266671782..350530cb5 100644 --- a/Modules/Calcs.lua +++ b/Modules/Calcs.lua @@ -1959,6 +1959,30 @@ local function performCalcs(env) end end end + if modDB:Sum("FLAG", nil, "ClawDamageAppliesToUnarmed") then + -- Claw Damage conversion from Rigwald's Curse + for i, mod in ipairs(modDB.mods.PhysicalDamage or { }) do + if band(mod.flags, ModFlag.Claw) ~= 0 then + modDB:NewMod("PhysicalDamage", mod.type, mod.value, mod.source, bor(band(mod.flags, bnot(ModFlag.Claw)), ModFlag.Unarmed), mod.keywordFlags, unpack(mod.tagList)) + end + end + end + if modDB:Sum("FLAG", nil, "ClawAttackSpeedAppliesToUnarmed") then + -- Claw Attack Speed conversion from Rigwald's Curse + for i, mod in ipairs(modDB.mods.Speed or { }) do + if band(mod.flags, ModFlag.Claw) ~= 0 and band(mod.flags, ModFlag.Attack) ~= 0 then + modDB:NewMod("Speed", mod.type, mod.value, mod.source, bor(band(mod.flags, bnot(ModFlag.Claw)), ModFlag.Unarmed), mod.keywordFlags, unpack(mod.tagList)) + end + end + end + if modDB:Sum("FLAG", nil, "ClawCritChanceAppliesToUnarmed") then + -- Claw Crit Chance conversion from Rigwald's Curse + for i, mod in ipairs(modDB.mods.CritChance or { }) do + if band(mod.flags, ModFlag.Claw) ~= 0 then + modDB:NewMod("CritChance", mod.type, mod.value, mod.source, bor(band(mod.flags, bnot(ModFlag.Claw)), ModFlag.Unarmed), mod.keywordFlags, unpack(mod.tagList)) + end + end + end local isAttack = (env.mode_skillType == "ATTACK") diff --git a/Modules/ModParser.lua b/Modules/ModParser.lua index 29086696a..c2519ea21 100644 --- a/Modules/ModParser.lua +++ b/Modules/ModParser.lua @@ -736,7 +736,7 @@ local specialModList = { ["socketed lightning spells have (%d+)%% increased spell damage if triggered"] = function(num) return { mod("Damage", "INC", num, nil, ModFlag.Spell, { type = "SocketedIn", keyword = "lightning" }, { type = "Condition", var = "SkillIsTriggered" }) } end, ["arrows always pierce"] = { mod("PierceChance", "BASE", 100, nil, ModFlag.Attack) }, ["arrows that pierce cause bleeding"] = { flag("ArrowsThatPierceCauseBleeding") }, - ["during flask effect, damage penetrates (%d+)%% of resistance of each element for which your uncapped elemental resistance is highest"] = function(num) return { + ["during flask effect, damage penetrates (%d+)%% o?f? ?resistance of each element for which your uncapped elemental resistance is highest"] = function(num) return { mod("LightningPenetration", "BASE", num, { type = "Condition", var = "UncappedLightningResistIsHighest" }), mod("ColdPenetration", "BASE", num, { type = "Condition", var = "UncappedColdResistIsHighest" }), mod("FirePenetration", "BASE", num, { type = "Condition", var = "UncappedFireResistIsHighest" }), @@ -746,6 +746,9 @@ local specialModList = { ["cannot leech mana"] = { flag("CannotLeechMana") }, ["cannot leech when on low life"] = { flag("CannotLeechLife", { type = "Condition", var = "LowLife" }), flag("CannotLeechMana", { type = "Condition", var = "LowLife" }) }, ["cannot leech life from critical strikes"] = { flag("CannotLeechLife", { type = "Condition", var = "CriticalStrike" }) }, + ["modifiers to claw damage also apply to unarmed"] = { flag("ClawDamageAppliesToUnarmed") }, + ["modifiers to claw attack speed also apply to unarmed"] = { flag("ClawAttackSpeedAppliesToUnarmed") }, + ["modifiers to claw critical strike chance also apply to unarmed"] = { flag("ClawCritChanceAppliesToUnarmed") }, } local keystoneList = { -- List of keystones that can be found on uniques diff --git a/README.md b/README.md index 5129b0bf5..2bc0551fa 100644 --- a/README.md +++ b/README.md @@ -47,6 +47,11 @@ 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.3.25 - 2017/04/06 + * You can now export and import builds directly to/from Pastebin.com links + * Added support for the "Claw X also apply to Unarmed" modifiers on Rigwald's Curse + * The conditional penetration modifier on imported copies of The Wise Oak should now be recognised correctly + ### 1.3.24 - 2017/04/05 This update adds support for Life/Mana Leech and Life/Mana/ES Gain on Hit: * All sources of Leech and Gain on Hit are supported, including "Damage dealt by your Totems is Leeched to you" diff --git a/changelog.txt b/changelog.txt index aeed9398f..37b01e1eb 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,7 @@ +VERSION[1.3.25][2017/04/06] + * You can now export and import builds directly to/from Pastebin.com links + * Added support for the "Claw X also apply to Unarmed" modifiers on Rigwald's Curse + * The conditional penetration modifier on imported copies of The Wise Oak should now be recognised correctly VERSION[1.3.24][2017/04/05] This update adds support for Life/Mana Leech and Life/Mana/ES Gain on Hit: * All sources of Leech and Gain on Hit are supported, including "Damage dealt by your Totems is Leeched to you" diff --git a/manifest.xml b/manifest.xml index f82bcee70..b38544e24 100644 --- a/manifest.xml +++ b/manifest.xml @@ -1,13 +1,13 @@ - + - + @@ -20,7 +20,7 @@ - + @@ -44,13 +44,13 @@ - + - + @@ -58,7 +58,7 @@ - + @@ -67,7 +67,7 @@ - + @@ -86,7 +86,7 @@ - +