From 83eee3c6c4efe176f13a644579fffa6c9a952d43 Mon Sep 17 00:00:00 2001 From: Openarl Date: Sun, 5 Feb 2017 01:17:40 +1000 Subject: [PATCH] Release 1.2.37 - Added weapon compatibility check for attacks - DW attacks can now use offhand if mainhand is incompatible - Added skill parts to Blast Rain - Added "Blocked Recently" condition - Added Tempest Shield's block chance buff --- Classes/CalcSectionControl.lua | 30 +++-- Classes/ConfigTab.lua | 3 + Data/Gems/act_dex.lua | 226 +++++++++++++++++++++++++++++++++ Data/Gems/act_int.lua | 11 +- Data/Gems/act_str.lua | 180 ++++++++++++++++++++++++++ Modules/CalcSections.lua | 5 +- Modules/Calcs.lua | 174 +++++++++++++++---------- Modules/Common.lua | 4 +- Modules/Data.lua | 18 +-- Modules/ModParser.lua | 9 +- README.md | 8 ++ changelog.txt | 7 + manifest.xml | 24 ++-- 13 files changed, 594 insertions(+), 105 deletions(-) diff --git a/Classes/CalcSectionControl.lua b/Classes/CalcSectionControl.lua index c47fec55..468b6c76 100644 --- a/Classes/CalcSectionControl.lua +++ b/Classes/CalcSectionControl.lua @@ -18,6 +18,7 @@ local CalcSectionClass = common.NewClass("CalcSection", "Control", "ControlHost" self.data = data self.extra = data.extra self.flag = data.flag + self.notFlag = data.notFlag self.updateFunc = updateFunc for _, data in ipairs(self.data) do for _, colData in ipairs(data) do @@ -74,8 +75,8 @@ end function CalcSectionClass:UpdateSize() local skillFlags = self.calcsTab.calcsEnv.mainSkill.skillFlags - self.enabled = not self.flag or skillFlags[self.flag] - if self.collapsed or not self.enabled then + self.enabled = (not self.flag or skillFlags[self.flag]) and (not self.notFlag or not skillFlags[self.notFlag]) + if not self.enabled then self.height = 22 return end @@ -85,7 +86,7 @@ function CalcSectionClass:UpdateSize() self.enabled = false local yOffset = 22 for _, rowData in ipairs(self.data) do - rowData.enabled = not rowData.flag or skillFlags[rowData.flag] + rowData.enabled = (not rowData.flag or skillFlags[rowData.flag]) and (not rowData.notFlag or not skillFlags[rowData.notFlag]) if rowData.enabled then self.enabled = true local xOffset = 134 @@ -99,8 +100,11 @@ function CalcSectionClass:UpdateSize() yOffset = yOffset + 18 self.height = self.height + 18 end + if self.collapsed then + rowData.enabled = false + end end - if self.enabled then + if self.enabled and not self.collapsed then self.height = self.height + 24 if self.updateFunc then self:updateFunc() @@ -131,11 +135,21 @@ function CalcSectionClass:UpdatePos() end function CalcSectionClass:FormatStr(str, output, colData) - str = str:gsub("{output:([%a:]+)}", function(c) - return output[c] or "" + str = str:gsub("{output:([%a%.:]+)}", function(c) + local ns, var = c:match("^(%a+)%.(%a+)$") + if ns then + return output[ns][var] or "" + else + return output[c] or "" + end end) - str = str:gsub("{(%d+):output:([%a:]+)}", function(p, c) - return formatRound(output[c] or 0, tonumber(p)) + str = str:gsub("{(%d+):output:([%a%.:]+)}", function(p, c) + local ns, var = c:match("^(%a+)%.(%a+)$") + if ns then + return formatRound(output[ns][var] or 0, tonumber(p)) + else + return formatRound(output[c] or 0, tonumber(p)) + end end) str = str:gsub("{(%d+):mod:(%d+)}", function(p, n) local sectionData = colData[tonumber(n)] diff --git a/Classes/ConfigTab.lua b/Classes/ConfigTab.lua index 93da6d0d..6157afbb 100644 --- a/Classes/ConfigTab.lua +++ b/Classes/ConfigTab.lua @@ -76,6 +76,9 @@ local varList = { { var = "conditionBeenSavageHitRecently", type = "check", label = "Have you been Savage Hit Recently?", ifCond = "BeenSavageHitRecently", apply = function(val, modList, enemyModList) modList:NewMod("Misc", "LIST", { type = "Condition", var = "BeenSavageHitRecently" }, "Config", { type = "Condition", var = "Combat" }) end }, + { var = "conditionBlockedRecently", type = "check", label = "Have you Blocked Recently?", ifCond = "BlockedRecently", apply = function(val, modList, enemyModList) + modList:NewMod("Misc", "LIST", { type = "Condition", var = "BlockedRecently" }, "Config", { type = "Condition", var = "Combat" }) + end }, { var = "buffPendulum", type = "check", label = "Is Pendulum of Destruction active?", ifNode = 57197, apply = function(val, modList, enemyModList) modList:NewMod("Misc", "LIST", { type = "Condition", var = "PendulumOfDestruction" }, "Config", { type = "Condition", var = "Combat" }) end }, diff --git a/Data/Gems/act_dex.lua b/Data/Gems/act_dex.lua index b33e12d5..8d9340d6 100644 --- a/Data/Gems/act_dex.lua +++ b/Data/Gems/act_dex.lua @@ -83,6 +83,10 @@ gems["Barrage"] = { projectile = true, }, skillTypes = { [1] = true, [48] = true, [6] = true, [3] = true, [22] = true, [17] = true, [19] = true, }, + weaponTypes = { + ["Wand"] = true, + ["Bow"] = true, + }, baseMods = { skill("castTime", 1), mod("ProjectileCount", "BASE", 3), --"number_of_additional_projectiles" = 3 @@ -221,6 +225,11 @@ gems["Blade Flurry"] = { area = true, }, skillTypes = { [1] = true, [11] = true, [6] = true, [58] = true, [24] = true, }, + weaponTypes = { + ["One Handed Sword"] = true, + ["Dagger"] = true, + ["Claw"] = true, + }, baseMods = { skill("castTime", 1), skill("manaCost", 4), @@ -430,6 +439,14 @@ gems["Blast Rain"] = { attack = true, area = true, bow = true, + parts = { + { + name = "1 explosion", + }, + { + name = "4 explosions", + }, + }, color = 2, baseFlags = { attack = true, @@ -438,6 +455,9 @@ gems["Blast Rain"] = { fire = true, }, skillTypes = { [1] = true, [11] = true, [14] = true, [22] = true, [17] = true, [19] = true, [33] = true, [48] = true, }, + weaponTypes = { + ["Bow"] = true, + }, baseMods = { skill("castTime", 1), mod("PhysicalDamageConvertToFire", "BASE", 50, 0, 0, nil), --"base_physical_damage_%_to_convert_to_fire" = 50 @@ -445,6 +465,7 @@ gems["Blast Rain"] = { --"blast_rain_arrow_delay_ms" = 80 --"base_is_projectile" = ? --"is_area_damage" = ? + skill("dpsMultiplier", 4, { type = "SkillPart", skillPart = 2 }), }, qualityMods = { mod("AreaRadius", "INC", 0.5), --"base_skill_area_of_effect_+%" = 0.5 @@ -570,6 +591,9 @@ gems["Burning Arrow"] = { fire = true, }, skillTypes = { [1] = true, [48] = true, [3] = true, [22] = true, [17] = true, [19] = true, [33] = true, [53] = true, [55] = true, }, + weaponTypes = { + ["Bow"] = true, + }, baseMods = { skill("castTime", 1), mod("EnemyIgniteChance", "BASE", 20), --"base_chance_to_ignite_%" = 20 @@ -634,6 +658,9 @@ gems["Vaal Burning Arrow"] = { vaal = true, }, skillTypes = { [1] = true, [48] = true, [3] = true, [22] = true, [17] = true, [19] = true, [11] = true, [43] = true, [33] = true, [55] = true, }, + weaponTypes = { + ["Bow"] = true, + }, baseMods = { skill("castTime", 1), mod("EnemyIgniteChance", "BASE", 20), --"base_chance_to_ignite_%" = 20 @@ -699,6 +726,9 @@ gems["Caustic Arrow"] = { chaos = true, }, skillTypes = { [1] = true, [48] = true, [3] = true, [11] = true, [12] = true, [17] = true, [19] = true, [22] = true, [40] = true, [50] = true, }, + weaponTypes = { + ["Bow"] = true, + }, baseMods = { skill("castTime", 1), --"skill_can_fire_arrows" = 1 @@ -760,6 +790,18 @@ gems["Cyclone"] = { movement = true, }, skillTypes = { [1] = true, [6] = true, [11] = true, [24] = true, [38] = true, }, + weaponTypes = { + ["None"] = true, + ["One Handed Mace"] = true, + ["Two Handed Sword"] = true, + ["Dagger"] = true, + ["Staff"] = true, + ["Two Handed Axe"] = true, + ["Two Handed Mace"] = true, + ["One Handed Axe"] = true, + ["Claw"] = true, + ["One Handed Sword"] = true, + }, baseMods = { skill("castTime", 1), skill("manaCost", 12), @@ -826,6 +868,18 @@ gems["Vaal Cyclone"] = { vaal = true, }, skillTypes = { [1] = true, [6] = true, [11] = true, [24] = true, [12] = true, [43] = true, }, + weaponTypes = { + ["None"] = true, + ["One Handed Mace"] = true, + ["Two Handed Sword"] = true, + ["Dagger"] = true, + ["Staff"] = true, + ["Two Handed Axe"] = true, + ["Two Handed Mace"] = true, + ["One Handed Axe"] = true, + ["Claw"] = true, + ["One Handed Sword"] = true, + }, baseMods = { skill("castTime", 1), mod("Speed", "MORE", 100, ModFlag.Attack), --"active_skill_attack_speed_+%_final" = 100 @@ -964,6 +1018,17 @@ gems["Double Strike"] = { melee = true, }, skillTypes = { [1] = true, [6] = true, [7] = true, [25] = true, [28] = true, [24] = true, }, + weaponTypes = { + ["One Handed Mace"] = true, + ["Two Handed Sword"] = true, + ["Dagger"] = true, + ["Staff"] = true, + ["Two Handed Axe"] = true, + ["Two Handed Mace"] = true, + ["One Handed Axe"] = true, + ["Claw"] = true, + ["One Handed Sword"] = true, + }, baseMods = { skill("castTime", 1), skill("manaCost", 5), @@ -1024,6 +1089,17 @@ gems["Vaal Double Strike"] = { vaal = true, }, skillTypes = { [1] = true, [6] = true, [7] = true, [25] = true, [28] = true, [24] = true, [12] = true, [43] = true, }, + weaponTypes = { + ["One Handed Mace"] = true, + ["Two Handed Sword"] = true, + ["Dagger"] = true, + ["Staff"] = true, + ["Two Handed Axe"] = true, + ["Two Handed Mace"] = true, + ["One Handed Axe"] = true, + ["Claw"] = true, + ["One Handed Sword"] = true, + }, baseMods = { skill("castTime", 1), --"base_skill_number_of_additional_hits" = 1 @@ -1248,6 +1324,9 @@ gems["Explosive Arrow"] = { fire = true, }, skillTypes = { [1] = true, [48] = true, [3] = true, [10] = true, [11] = true, [12] = true, [22] = true, [17] = true, [19] = true, [33] = true, }, + weaponTypes = { + ["Bow"] = true, + }, baseMods = { skill("castTime", 1), skill("critChance", 6), @@ -1381,6 +1460,17 @@ gems["Flicker Strike"] = { movement = true, }, skillTypes = { [1] = true, [6] = true, [24] = true, [25] = true, [28] = true, [38] = true, }, + weaponTypes = { + ["One Handed Mace"] = true, + ["Two Handed Sword"] = true, + ["Dagger"] = true, + ["Staff"] = true, + ["Two Handed Axe"] = true, + ["Two Handed Mace"] = true, + ["One Handed Axe"] = true, + ["Claw"] = true, + ["One Handed Sword"] = true, + }, baseMods = { skill("castTime", 1), skill("manaCost", 10), @@ -1584,6 +1674,17 @@ gems["Frost Blades"] = { cold = true, }, skillTypes = { [1] = true, [3] = true, [6] = true, [25] = true, [28] = true, [24] = true, [34] = true, [48] = true, }, + weaponTypes = { + ["One Handed Mace"] = true, + ["Two Handed Sword"] = true, + ["Dagger"] = true, + ["Staff"] = true, + ["Two Handed Axe"] = true, + ["Two Handed Mace"] = true, + ["One Handed Axe"] = true, + ["Claw"] = true, + ["One Handed Sword"] = true, + }, baseMods = { skill("castTime", 1), skill("manaCost", 6), @@ -2032,6 +2133,9 @@ gems["Ice Shot"] = { cold = true, }, skillTypes = { [1] = true, [48] = true, [3] = true, [11] = true, [12] = true, [22] = true, [17] = true, [19] = true, [34] = true, }, + weaponTypes = { + ["Bow"] = true, + }, baseMods = { skill("castTime", 1), mod("SkillPhysicalDamageConvertToCold", "BASE", 40), --"skill_physical_damage_%_to_convert_to_cold" = 40 @@ -2160,6 +2264,12 @@ gems["Lacerate"] = { area = true, }, skillTypes = { [1] = true, [6] = true, [11] = true, [28] = true, [24] = true, }, + weaponTypes = { + ["Two Handed Axe"] = true, + ["Two Handed Sword"] = true, + ["One Handed Axe"] = true, + ["One Handed Sword"] = true, + }, baseMods = { skill("castTime", 1), skill("manaCost", 8), @@ -2220,6 +2330,9 @@ gems["Lightning Arrow"] = { lightning = true, }, skillTypes = { [1] = true, [48] = true, [11] = true, [3] = true, [22] = true, [17] = true, [19] = true, [35] = true, }, + weaponTypes = { + ["Bow"] = true, + }, baseMods = { skill("castTime", 1), mod("SkillPhysicalDamageConvertToLightning", "BASE", 50), --"skill_physical_damage_%_to_convert_to_lightning" = 50 @@ -2293,6 +2406,17 @@ gems["Lightning Strike"] = { lightning = true, }, skillTypes = { [1] = true, [48] = true, [3] = true, [6] = true, [25] = true, [28] = true, [24] = true, [35] = true, }, + weaponTypes = { + ["One Handed Mace"] = true, + ["Two Handed Sword"] = true, + ["Dagger"] = true, + ["Staff"] = true, + ["Two Handed Axe"] = true, + ["Two Handed Mace"] = true, + ["One Handed Axe"] = true, + ["Claw"] = true, + ["One Handed Sword"] = true, + }, baseMods = { skill("castTime", 1), skill("manaCost", 6), @@ -2366,6 +2490,17 @@ gems["Vaal Lightning Strike"] = { vaal = true, }, skillTypes = { [1] = true, [6] = true, [25] = true, [28] = true, [24] = true, [12] = true, [43] = true, [35] = true, }, + weaponTypes = { + ["One Handed Mace"] = true, + ["Two Handed Sword"] = true, + ["Dagger"] = true, + ["Staff"] = true, + ["Two Handed Axe"] = true, + ["Two Handed Mace"] = true, + ["One Handed Axe"] = true, + ["Claw"] = true, + ["One Handed Sword"] = true, + }, baseMods = { skill("castTime", 1), mod("SkillPhysicalDamageConvertToLightning", "BASE", 50), --"skill_physical_damage_%_to_convert_to_lightning" = 50 @@ -2628,6 +2763,13 @@ gems["Puncture"] = { duration = true, }, skillTypes = { [1] = true, [48] = true, [3] = true, [6] = true, [12] = true, [17] = true, [19] = true, [22] = true, [25] = true, [28] = true, [24] = true, [40] = true, }, + weaponTypes = { + ["Bow"] = true, + ["Claw"] = true, + ["Two Handed Sword"] = true, + ["Dagger"] = true, + ["One Handed Sword"] = true, + }, baseMods = { skill("castTime", 1), skill("manaCost", 6), @@ -2750,6 +2892,9 @@ gems["Rain of Arrows"] = { area = true, }, skillTypes = { [1] = true, [48] = true, [11] = true, [14] = true, [22] = true, [17] = true, [19] = true, }, + weaponTypes = { + ["Bow"] = true, + }, baseMods = { skill("castTime", 1), --"base_is_projectile" = ? @@ -2813,6 +2958,9 @@ gems["Vaal Rain of Arrows"] = { vaal = true, }, skillTypes = { [1] = true, [48] = true, [11] = true, [14] = true, [22] = true, [17] = true, [19] = true, [12] = true, [43] = true, }, + weaponTypes = { + ["Bow"] = true, + }, baseMods = { skill("castTime", 1), --"base_is_projectile" = ? @@ -2874,6 +3022,11 @@ gems["Reave"] = { area = true, }, skillTypes = { [1] = true, [6] = true, [11] = true, [28] = true, [24] = true, }, + weaponTypes = { + ["One Handed Sword"] = true, + ["Dagger"] = true, + ["Claw"] = true, + }, baseMods = { skill("castTime", 1), skill("manaCost", 6), @@ -2934,6 +3087,11 @@ gems["Vaal Reave"] = { vaal = true, }, skillTypes = { [1] = true, [6] = true, [11] = true, [28] = true, [24] = true, [43] = true, }, + weaponTypes = { + ["One Handed Sword"] = true, + ["Dagger"] = true, + ["Claw"] = true, + }, baseMods = { skill("castTime", 1), --"reave_area_of_effect_+%_final_per_stage" = 20 @@ -2996,6 +3154,18 @@ gems["Riposte"] = { melee = true, }, skillTypes = { [1] = true, [24] = true, [25] = true, [6] = true, [47] = true, [57] = true, }, + weaponTypes = { + ["None"] = true, + ["One Handed Mace"] = true, + ["Two Handed Sword"] = true, + ["Dagger"] = true, + ["Staff"] = true, + ["Two Handed Axe"] = true, + ["Two Handed Mace"] = true, + ["One Handed Axe"] = true, + ["Claw"] = true, + ["One Handed Sword"] = true, + }, baseMods = { skill("castTime", 1), --"melee_counterattack_trigger_on_block_%" = 100 @@ -3067,6 +3237,9 @@ gems["Shrapnel Shot"] = { lightning = true, }, skillTypes = { [1] = true, [3] = true, [11] = true, [22] = true, [17] = true, [19] = true, [35] = true, [48] = true, }, + weaponTypes = { + ["Bow"] = true, + }, baseMods = { skill("castTime", 1), --"base_arrow_pierce_%" = 100 @@ -3131,6 +3304,9 @@ gems["Siege Ballista"] = { duration = true, }, skillTypes = { [1] = true, [3] = true, [48] = true, [17] = true, [19] = true, [30] = true, [12] = true, }, + weaponTypes = { + ["Bow"] = true, + }, skillTotemId = 12, baseMods = { skill("castTime", 1), @@ -3261,6 +3437,17 @@ gems["Spectral Throw"] = { projectile = true, }, skillTypes = { [1] = true, [48] = true, [3] = true, [6] = true, }, + weaponTypes = { + ["One Handed Mace"] = true, + ["Two Handed Sword"] = true, + ["Dagger"] = true, + ["Staff"] = true, + ["Two Handed Axe"] = true, + ["Two Handed Mace"] = true, + ["One Handed Axe"] = true, + ["Claw"] = true, + ["One Handed Sword"] = true, + }, baseMods = { skill("castTime", 1), --"base_is_projectile" = ? @@ -3319,6 +3506,17 @@ gems["Vaal Spectral Throw"] = { vaal = true, }, skillTypes = { [1] = true, [48] = true, [3] = true, [6] = true, [43] = true, }, + weaponTypes = { + ["One Handed Mace"] = true, + ["Two Handed Sword"] = true, + ["Dagger"] = true, + ["Staff"] = true, + ["Two Handed Axe"] = true, + ["Two Handed Mace"] = true, + ["One Handed Axe"] = true, + ["Claw"] = true, + ["One Handed Sword"] = true, + }, baseMods = { skill("castTime", 1), --"projectiles_nova" = ? @@ -3375,6 +3573,9 @@ gems["Split Arrow"] = { projectile = true, }, skillTypes = { [1] = true, [48] = true, [3] = true, [22] = true, [17] = true, [19] = true, }, + weaponTypes = { + ["Bow"] = true, + }, baseMods = { skill("castTime", 1), --"skill_can_fire_arrows" = ? @@ -3560,6 +3761,9 @@ gems["Tornado Shot"] = { projectile = true, }, skillTypes = { [1] = true, [3] = true, [17] = true, [19] = true, [22] = true, [48] = true, }, + weaponTypes = { + ["Bow"] = true, + }, baseMods = { skill("castTime", 1), --"tornado_shot_num_of_secondary_projectiles" = 3 @@ -3621,6 +3825,12 @@ gems["Viper Strike"] = { chaos = true, }, skillTypes = { [1] = true, [6] = true, [12] = true, [28] = true, [24] = true, [25] = true, [40] = true, [50] = true, }, + weaponTypes = { + ["One Handed Sword"] = true, + ["Two Handed Sword"] = true, + ["Dagger"] = true, + ["Claw"] = true, + }, baseMods = { skill("castTime", 1), skill("manaCost", 5), @@ -3681,6 +3891,11 @@ gems["Whirling Blades"] = { movement = true, }, skillTypes = { [1] = true, [6] = true, [24] = true, [38] = true, }, + weaponTypes = { + ["Claw"] = true, + ["Dagger"] = true, + ["One Handed Sword"] = true, + }, baseMods = { skill("castTime", 2.6), skill("manaCost", 15), @@ -3794,6 +4009,17 @@ gems["Wild Strike"] = { fire = true, }, skillTypes = { [1] = true, [6] = true, [25] = true, [28] = true, [24] = true, [35] = true, [34] = true, [33] = true, [3] = true, [11] = true, [23] = true, [48] = true, }, + weaponTypes = { + ["One Handed Mace"] = true, + ["Two Handed Sword"] = true, + ["Dagger"] = true, + ["Staff"] = true, + ["Two Handed Axe"] = true, + ["Two Handed Mace"] = true, + ["One Handed Axe"] = true, + ["Claw"] = true, + ["One Handed Sword"] = true, + }, baseMods = { skill("castTime", 1), skill("manaCost", 6), diff --git a/Data/Gems/act_int.lua b/Data/Gems/act_int.lua index e6451f5d..3b402910 100644 --- a/Data/Gems/act_int.lua +++ b/Data/Gems/act_int.lua @@ -2518,6 +2518,9 @@ gems["Kinetic Blast"] = { area = true, }, skillTypes = { [1] = true, [48] = true, [3] = true, [6] = true, [11] = true, [17] = true, [19] = true, [22] = true, }, + weaponTypes = { + ["Wand"] = true, + }, baseMods = { skill("castTime", 1), --"cluster_burst_spawn_amount" = 4 @@ -3050,6 +3053,9 @@ gems["Power Siphon"] = { projectile = true, }, skillTypes = { [1] = true, [48] = true, [6] = true, [3] = true, [22] = true, [17] = true, [19] = true, }, + weaponTypes = { + ["Wand"] = true, + }, baseMods = { skill("castTime", 1), --"kill_enemy_on_hit_if_under_10%_life" = ? @@ -3108,6 +3114,9 @@ gems["Vaal Power Siphon"] = { vaal = true, }, skillTypes = { [1] = true, [48] = true, [6] = true, [3] = true, [22] = true, [17] = true, [19] = true, [43] = true, }, + weaponTypes = { + ["Wand"] = true, + }, baseMods = { skill("castTime", 1), --"power_siphon_fire_at_all_targets" = ? @@ -4011,7 +4020,7 @@ gems["Tempest Shield"] = { skill("castTime", 0.5), skill("damageEffectiveness", 0.6), skill("critChance", 6), - --"shield_block_%" = 3 + mod("BlockChance", "BASE", 3, 0, 0, { type = "GlobalEffect", effectType = "Buff" }), --"shield_block_%" = 3 --"skill_override_pvp_scaling_time_ms" = 700 mod("ChainCount", "BASE", 1), --"number_of_additional_projectiles_in_chain" = 1 skill("duration", 12), --"base_skill_effect_duration" = 12000 diff --git a/Data/Gems/act_str.lua b/Data/Gems/act_str.lua index 0bd874dd..3b47e594 100644 --- a/Data/Gems/act_str.lua +++ b/Data/Gems/act_str.lua @@ -85,6 +85,18 @@ gems["Ancestral Protector"] = { duration = true, }, skillTypes = { [1] = true, [30] = true, [12] = true, [6] = true, [25] = true, [24] = true, [17] = true, [19] = true, }, + weaponTypes = { + ["None"] = true, + ["One Handed Mace"] = true, + ["Two Handed Sword"] = true, + ["Dagger"] = true, + ["Staff"] = true, + ["Two Handed Axe"] = true, + ["Two Handed Mace"] = true, + ["One Handed Axe"] = true, + ["Claw"] = true, + ["One Handed Sword"] = true, + }, skillTotemId = 13, baseMods = { skill("castTime", 1), @@ -156,6 +168,18 @@ gems["Ancestral Warchief"] = { duration = true, }, skillTypes = { [1] = true, [30] = true, [12] = true, [6] = true, [24] = true, [17] = true, [19] = true, [11] = true, }, + weaponTypes = { + ["None"] = true, + ["One Handed Mace"] = true, + ["Two Handed Sword"] = true, + ["Dagger"] = true, + ["Staff"] = true, + ["Two Handed Axe"] = true, + ["Two Handed Mace"] = true, + ["One Handed Axe"] = true, + ["Claw"] = true, + ["One Handed Sword"] = true, + }, skillTotemId = 15, baseMods = { skill("castTime", 1), @@ -295,6 +319,12 @@ gems["Cleave"] = { area = true, }, skillTypes = { [1] = true, [6] = true, [8] = true, [11] = true, [28] = true, [24] = true, }, + weaponTypes = { + ["Two Handed Axe"] = true, + ["One Handed Axe"] = true, + ["Two Handed Sword"] = true, + ["One Handed Sword"] = true, + }, baseMods = { skill("castTime", 1), skill("manaCost", 6), @@ -489,6 +519,18 @@ gems["Dominating Blow"] = { duration = true, }, skillTypes = { [1] = true, [6] = true, [9] = true, [12] = true, [21] = true, [25] = true, [28] = true, [24] = true, }, + weaponTypes = { + ["None"] = true, + ["One Handed Mace"] = true, + ["Two Handed Sword"] = true, + ["Dagger"] = true, + ["Staff"] = true, + ["Two Handed Axe"] = true, + ["Two Handed Mace"] = true, + ["One Handed Axe"] = true, + ["Claw"] = true, + ["One Handed Sword"] = true, + }, baseMods = { skill("castTime", 1), skill("duration", 20), --"base_skill_effect_duration" = 20000 @@ -558,6 +600,13 @@ gems["Earthquake"] = { duration = true, }, skillTypes = { [1] = true, [6] = true, [11] = true, [24] = true, [7] = true, [10] = true, [28] = true, [12] = true, }, + weaponTypes = { + ["One Handed Mace"] = true, + ["Two Handed Axe"] = true, + ["Two Handed Mace"] = true, + ["One Handed Axe"] = true, + ["Staff"] = true, + }, baseMods = { skill("castTime", 1), skill("manaCost", 10), @@ -750,6 +799,11 @@ gems["Glacial Hammer"] = { cold = true, }, skillTypes = { [1] = true, [6] = true, [25] = true, [28] = true, [24] = true, [34] = true, }, + weaponTypes = { + ["Two Handed Mace"] = true, + ["One Handed Mace"] = true, + ["Staff"] = true, + }, baseMods = { skill("castTime", 1), skill("manaCost", 5), @@ -816,6 +870,11 @@ gems["Vaal Glacial Hammer"] = { vaal = true, }, skillTypes = { [1] = true, [6] = true, [25] = true, [28] = true, [24] = true, [12] = true, [11] = true, [43] = true, [34] = true, }, + weaponTypes = { + ["Two Handed Mace"] = true, + ["One Handed Mace"] = true, + ["Staff"] = true, + }, baseMods = { skill("castTime", 1), mod("SkillPhysicalDamageConvertToCold", "BASE", 50), --"skill_physical_damage_%_to_convert_to_cold" = 50 @@ -876,6 +935,11 @@ gems["Ground Slam"] = { area = true, }, skillTypes = { [1] = true, [6] = true, [7] = true, [11] = true, [28] = true, [24] = true, }, + weaponTypes = { + ["Two Handed Mace"] = true, + ["One Handed Mace"] = true, + ["Staff"] = true, + }, baseMods = { skill("castTime", 1), skill("manaCost", 6), @@ -937,6 +1001,11 @@ gems["Vaal Ground Slam"] = { vaal = true, }, skillTypes = { [1] = true, [6] = true, [7] = true, [11] = true, [28] = true, [24] = true, [43] = true, }, + weaponTypes = { + ["Two Handed Mace"] = true, + ["One Handed Mace"] = true, + ["Staff"] = true, + }, baseMods = { skill("castTime", 1), --"knockback_distance_+%" = 100 @@ -997,6 +1066,15 @@ gems["Heavy Strike"] = { melee = true, }, skillTypes = { [1] = true, [6] = true, [25] = true, [28] = true, [24] = true, }, + weaponTypes = { + ["One Handed Sword"] = true, + ["One Handed Mace"] = true, + ["Two Handed Axe"] = true, + ["Two Handed Mace"] = true, + ["Two Handed Sword"] = true, + ["One Handed Axe"] = true, + ["Staff"] = true, + }, baseMods = { skill("castTime", 1), skill("manaCost", 5), @@ -1126,6 +1204,16 @@ gems["Ice Crash"] = { cold = true, }, skillTypes = { [1] = true, [6] = true, [11] = true, [24] = true, [7] = true, [34] = true, }, + weaponTypes = { + ["None"] = true, + ["Two Handed Sword"] = true, + ["One Handed Mace"] = true, + ["Two Handed Axe"] = true, + ["Two Handed Mace"] = true, + ["One Handed Axe"] = true, + ["One Handed Sword"] = true, + ["Staff"] = true, + }, baseMods = { skill("castTime", 1), skill("manaCost", 8), @@ -1303,6 +1391,16 @@ gems["Infernal Blow"] = { fire = true, }, skillTypes = { [1] = true, [6] = true, [11] = true, [25] = true, [28] = true, [24] = true, [33] = true, }, + weaponTypes = { + ["None"] = true, + ["Staff"] = true, + ["One Handed Mace"] = true, + ["Two Handed Axe"] = true, + ["Two Handed Mace"] = true, + ["Two Handed Sword"] = true, + ["One Handed Axe"] = true, + ["One Handed Sword"] = true, + }, baseMods = { skill("castTime", 1), skill("manaCost", 6), @@ -1365,6 +1463,15 @@ gems["Leap Slam"] = { movement = true, }, skillTypes = { [1] = true, [6] = true, [7] = true, [11] = true, [24] = true, [38] = true, }, + weaponTypes = { + ["Two Handed Sword"] = true, + ["One Handed Mace"] = true, + ["Two Handed Axe"] = true, + ["Two Handed Mace"] = true, + ["One Handed Axe"] = true, + ["One Handed Sword"] = true, + ["Staff"] = true, + }, baseMods = { skill("castTime", 1.4), skill("manaCost", 15), @@ -1579,6 +1686,17 @@ gems["Molten Strike"] = { fire = true, }, skillTypes = { [1] = true, [3] = true, [6] = true, [11] = true, [24] = true, [25] = true, [28] = true, [33] = true, [48] = true, }, + weaponTypes = { + ["One Handed Mace"] = true, + ["Two Handed Sword"] = true, + ["Dagger"] = true, + ["Staff"] = true, + ["Two Handed Axe"] = true, + ["Two Handed Mace"] = true, + ["One Handed Axe"] = true, + ["Claw"] = true, + ["One Handed Sword"] = true, + }, baseMods = { skill("castTime", 1), skill("manaCost", 6), @@ -1771,6 +1889,14 @@ gems["Reckoning"] = { melee = true, }, skillTypes = { [1] = true, [7] = true, [13] = true, [24] = true, [11] = true, [47] = true, [57] = true, }, + weaponTypes = { + ["None"] = true, + ["One Handed Mace"] = true, + ["Claw"] = true, + ["One Handed Axe"] = true, + ["Dagger"] = true, + ["One Handed Sword"] = true, + }, baseMods = { skill("castTime", 1), --"melee_counterattack_trigger_on_block_%" = 100 @@ -1965,6 +2091,14 @@ gems["Shield Charge"] = { movement = true, }, skillTypes = { [1] = true, [7] = true, [13] = true, [24] = true, [11] = true, [38] = true, }, + weaponTypes = { + ["None"] = true, + ["One Handed Mace"] = true, + ["Claw"] = true, + ["One Handed Axe"] = true, + ["Dagger"] = true, + ["One Handed Sword"] = true, + }, baseMods = { skill("castTime", 1), skill("manaCost", 8), @@ -2111,6 +2245,17 @@ gems["Static Strike"] = { lightning = true, }, skillTypes = { [1] = true, [6] = true, [25] = true, [28] = true, [24] = true, [11] = true, [12] = true, [35] = true, }, + weaponTypes = { + ["One Handed Mace"] = true, + ["Two Handed Sword"] = true, + ["Dagger"] = true, + ["Staff"] = true, + ["Two Handed Axe"] = true, + ["Two Handed Mace"] = true, + ["One Handed Axe"] = true, + ["Claw"] = true, + ["One Handed Sword"] = true, + }, baseMods = { skill("castTime", 1), skill("manaCost", 6), @@ -2307,6 +2452,13 @@ gems["Sunder"] = { area = true, }, skillTypes = { [1] = true, [6] = true, [7] = true, [11] = true, [28] = true, [24] = true, }, + weaponTypes = { + ["One Handed Mace"] = true, + ["Two Handed Axe"] = true, + ["Two Handed Mace"] = true, + ["One Handed Axe"] = true, + ["Staff"] = true, + }, baseMods = { skill("castTime", 1), skill("manaCost", 8), @@ -2366,6 +2518,12 @@ gems["Sweep"] = { area = true, }, skillTypes = { [1] = true, [11] = true, [28] = true, [24] = true, }, + weaponTypes = { + ["Two Handed Mace"] = true, + ["Two Handed Sword"] = true, + ["Staff"] = true, + ["Two Handed Axe"] = true, + }, baseMods = { skill("castTime", 1.15), skill("manaCost", 8), @@ -2426,6 +2584,17 @@ gems["Vengeance"] = { area = true, }, skillTypes = { [1] = true, [11] = true, [24] = true, [47] = true, [6] = true, [57] = true, }, + weaponTypes = { + ["One Handed Mace"] = true, + ["Two Handed Sword"] = true, + ["Dagger"] = true, + ["Staff"] = true, + ["Two Handed Axe"] = true, + ["Two Handed Mace"] = true, + ["One Handed Axe"] = true, + ["Claw"] = true, + ["One Handed Sword"] = true, + }, baseMods = { skill("castTime", 1), --"melee_counterattack_trigger_on_hit_%" = 30 @@ -2483,6 +2652,17 @@ gems["Vigilant Strike"] = { melee = true, }, skillTypes = { [1] = true, [5] = true, [24] = true, [6] = true, [28] = true, [25] = true, [53] = true, }, + weaponTypes = { + ["One Handed Mace"] = true, + ["Two Handed Sword"] = true, + ["Dagger"] = true, + ["Staff"] = true, + ["Two Handed Axe"] = true, + ["Two Handed Mace"] = true, + ["One Handed Axe"] = true, + ["Claw"] = true, + ["One Handed Sword"] = true, + }, baseMods = { skill("castTime", 1), skill("manaCost", 6), diff --git a/Modules/CalcSections.lua b/Modules/CalcSections.lua index efa95197..e86e9788 100644 --- a/Modules/CalcSections.lua +++ b/Modules/CalcSections.lua @@ -214,13 +214,12 @@ return { { label = "Dmg. per Ignite", flag = "igniteCanStack", { format = "{1:output:IgniteDamage}", { breakdown = "IgniteDamage" }, }, }, } }, { 1, "MiscEffects", 1, "Other Effects", data.colorCodes.OFFENCE, { - flag = "hit", { label = "Chance to Shock", flag = "shock", { format = "{0:output:ShockChance}%", { breakdown = "ShockChance" }, { label = "Player modifiers", modName = "EnemyShockChance", cfg = "skill" }, { label = "Enemy modifiers", modName = "SelfShockChance", enemy = true }, }, }, { label = "Shock Dur. Mod", flag = "shock", { format = "x {2:output:ShockDurationMod}", { breakdown = "ShockDPS" }, { label = "Player modifiers", modName = "EnemyShockDuration", cfg = "skill" }, { label = "Enemy modifiers", modName = "SelfShockDuration", enemy = true }, }, }, { label = "Chance to Freeze", flag = "freeze", { format = "{0:output:FreezeChance}%", { breakdown = "FreezeChance" }, { label = "Player modifiers", modName = "EnemyFreezeChance", cfg = "skill" }, { label = "Enemy modifiers", modName = "SelfFreezeChance", enemy = true }, }, }, { label = "Freeze Dur. Mod", flag = "freeze", { format = "x {2:output:FreezeDurationMod}", { breakdown = "FreezeDPS" }, { label = "Player modifiers", modName = "EnemyFreezeDuration", cfg = "skill" }, { label = "Enemy modifiers", modName = "SelfFreezeDuration", enemy = true }, }, }, - { label = "Stun Thresh. Mod", { format = "x {2:output:EnemyStunThresholdMod}", { modName = "EnemyStunThreshold", cfg = "skill" }, }, }, - { label = "Stun Duration", { format = "{2:output:EnemyStunDuration}s", { breakdown = "EnemyStunDuration" }, { label = "Player modifiers", modName = { "EnemyStunDuration" }, cfg = "skill" }, { label = "Enemy modifiers", modName = { "StunRecovery" }, enemy = true }, }, }, + { label = "Stun Thresh. Mod", flag = "hit", { format = "x {2:output:EnemyStunThresholdMod}", { modName = "EnemyStunThreshold", cfg = "skill" }, }, }, + { label = "Stun Duration", flag = "hit", { format = "{2:output:EnemyStunDuration}s", { breakdown = "EnemyStunDuration" }, { label = "Player modifiers", modName = { "EnemyStunDuration" }, cfg = "skill" }, { label = "Enemy modifiers", modName = { "StunRecovery" }, enemy = true }, }, }, { label = "Inc. Item Quantity", { format = "{0:mod:1}%", { modName = "LootQuantity", modType = "INC", cfg = "skill" }, }, }, { label = "Inc. Item Rarity", { format = "{0:mod:1}%", { modName = "LootRarity", modType = "INC", cfg = "skill" }, }, }, } }, diff --git a/Modules/Calcs.lua b/Modules/Calcs.lua index 5ba8ee75..15ca1af2 100644 --- a/Modules/Calcs.lua +++ b/Modules/Calcs.lua @@ -159,8 +159,38 @@ local function createActiveSkill(activeGem, supportList) return activeSkill end +local function getWeaponFlags(weaponData, weaponTypes) + local info = data.weaponTypeInfo[weaponData.type] + if not info then + return + end + if weaponTypes and not weaponTypes[weaponData.type] and + (not weaponData.countsAsAll1H or not (weaponTypes["Claw"] or weaponTypes["Dagger"] or weaponTypes["One Handed Axe"] or weaponTypes["One Handed Mace"] or weaponTypes["One Handed Sword"])) then + return + end + local flags = info.flag + if weaponData.countsAsAll1H then + flags = bor(ModFlag.Axe, ModFlag.Claw, ModFlag.Dagger, ModFlag.Mace, ModFlag.Sword) + end + if weaponData.type ~= "None" then + flags = bor(flags, ModFlag.Weapon) + if info.oneHand then + flags = bor(flags, ModFlag.Weapon1H) + else + flags = bor(flags, ModFlag.Weapon2H) + end + if info.melee then + flags = bor(flags, ModFlag.WeaponMelee) + else + flags = bor(flags, ModFlag.WeaponRanged) + end + end + return flags, info +end + -- Build list of modifiers for given active skill local function buildActiveSkillModList(env, activeSkill) + local skillTypes = activeSkill.skillTypes local skillFlags = activeSkill.skillFlags -- Handle multipart skills @@ -183,31 +213,40 @@ local function buildActiveSkillModList(env, activeSkill) skillFlags.multiPart = #activeGemParts > 1 end - -- Set weapon flags - local weapon1Type = env.itemList["Weapon 1"] and env.itemList["Weapon 1"].type or "None" - local weapon2Type = env.itemList["Weapon 2"] and env.itemList["Weapon 2"].type or "" - skillFlags.mainIs1H = true - local weapon1Info = data.weaponTypeInfo[weapon1Type] - if weapon1Info then - if not weapon1Info.oneHand then - skillFlags.mainIs1H = nil - end - if skillFlags.attack then + if skillTypes[SkillType.Shield] and (not env.itemList["Weapon 2"] or env.itemList["Weapon 2"].type ~= "Shield") then + -- Skill requires a shield to be equipped + skillFlags.disable = true + end + + if skillFlags.attack then + -- Set weapon flags + local weaponTypes = activeSkill.activeGem.data.weaponTypes + local weapon1Flags, weapon1Info = getWeaponFlags(env.weaponData1, weaponTypes) + if weapon1Flags then + activeSkill.weapon1Flags = weapon1Flags skillFlags.weapon1Attack = true if weapon1Info.melee and skillFlags.melee then skillFlags.projectile = nil elseif not weapon1Info.melee and skillFlags.projectile then skillFlags.melee = nil end + elseif skillTypes[SkillType.DualWield] or not skillTypes[SkillType.CanDualWield] or skillTypes[SkillType.MainHandOnly] then + -- Skill requires a compatible main hand weapon + skillFlags.disable = true end - end - local weapon2Info = data.weaponTypeInfo[weapon2Type] - if weapon2Info and skillFlags.mainIs1H then - if skillFlags.attack then - skillFlags.weapon2Attack = true + if skillTypes[SkillType.DualWield] or skillTypes[SkillType.CanDualWield] then + local weapon2Flags = getWeaponFlags(env.weaponData2, weaponTypes) + if weapon2Flags then + activeSkill.weapon2Flags = weapon2Flags + skillFlags.weapon2Attack = true + elseif skillTypes[SkillType.DualWield] or not skillFlags.weapon1Attack then + -- Skill requires a compatible off hand weapon + skillFlags.disable = true + end end + skillFlags.bothWeaponAttack = skillFlags.weapon1Attack and skillFlags.weapon2Attack end - + -- Build skill mod flag set local skillModFlags = 0 if skillFlags.hit then @@ -218,22 +257,6 @@ local function buildActiveSkillModList(env, activeSkill) elseif skillFlags.attack then skillModFlags = bor(skillModFlags, ModFlag.Attack) end - if skillFlags.weapon1Attack then - skillModFlags = bor(skillModFlags, env.weaponData1.flag or weapon1Info.flag) - if weapon1Type ~= "None" then - skillModFlags = bor(skillModFlags, ModFlag.Weapon) - if skillFlags.mainIs1H then - skillModFlags = bor(skillModFlags, ModFlag.Weapon1H) - else - skillModFlags = bor(skillModFlags, ModFlag.Weapon2H) - end - if weapon1Info.melee then - skillModFlags = bor(skillModFlags, ModFlag.WeaponMelee) - else - skillModFlags = bor(skillModFlags, ModFlag.WeaponRanged) - end - end - end if skillFlags.melee then skillModFlags = bor(skillModFlags, ModFlag.Melee) elseif skillFlags.projectile then @@ -242,7 +265,6 @@ local function buildActiveSkillModList(env, activeSkill) if skillFlags.area then skillModFlags = bor(skillModFlags, ModFlag.Area) end - activeSkill.skillFlags = skillFlags -- Build skill keyword flag set local skillKeywordFlags = 0 @@ -282,7 +304,6 @@ local function buildActiveSkillModList(env, activeSkill) elseif skillFlags.mine then skillKeywordFlags = bor(skillKeywordFlags, KeywordFlag.Mine) end - activeSkill.skillKeywordFlags = skillKeywordFlags -- Get skill totem ID for totem skills -- This is used to calculate totem life @@ -301,7 +322,7 @@ local function buildActiveSkillModList(env, activeSkill) -- Build config structure for modifier searches activeSkill.skillCfg = { - flags = skillModFlags, + flags = bor(skillModFlags, activeSkill.weapon1Flags or activeSkill.weapon2Flags or 0), keywordFlags = skillKeywordFlags, skillName = activeSkill.activeGem.name:gsub("^Vaal ",""), -- This allows modifiers that target specific skills to also apply to their Vaal counterpart skillGem = activeSkill.activeGem, @@ -309,6 +330,14 @@ local function buildActiveSkillModList(env, activeSkill) skillTypes = activeSkill.skillTypes, slotName = activeSkill.slotName, } + if skillFlags.weapon1Attack then + activeSkill.weapon1Cfg = copyTable(activeSkill.skillCfg, true) + activeSkill.weapon1Cfg.flags = bor(skillModFlags, activeSkill.weapon1Flags) + end + if skillFlags.weapon2Attack then + activeSkill.weapon2Cfg = copyTable(activeSkill.skillCfg, true) + activeSkill.weapon2Cfg.flags = bor(skillModFlags, activeSkill.weapon2Flags) + end -- Apply gem property modifiers from the item this skill is socketed into for _, value in ipairs(env.modDB:Sum("LIST", activeSkill.skillCfg, "GemProperty")) do @@ -323,6 +352,10 @@ local function buildActiveSkillModList(env, activeSkill) local skillModList = common.New("ModList") activeSkill.skillModList = skillModList + if skillFlags.disable then + return + end + -- Add support gem modifiers to skill mod list for _, gem in pairs(activeSkill.gemList) do if gem.data.support then @@ -948,14 +981,6 @@ local function performCalcs(env) end -- Set modes - if env.mainSkill.skillFlags.attack then - env.mode_skillType = "ATTACK" - else - env.mode_skillType = "SPELL" - end - if env.mainSkill.skillData.showAverage then - env.mode_average = true - end if env.buffMode == "EFFECTIVE" then env.mode_buffs = true env.mode_combat = true @@ -999,9 +1024,6 @@ local function performCalcs(env) if env.weaponData1.type and env.weaponData2.type then condList["DualWielding"] = true end - if env.mode_skillType == "ATTACK" then - condList["MainHandAttack"] = true - end if not env.weaponData1.type then condList["Unarmed"] = true end @@ -1615,12 +1637,28 @@ local function performCalcs(env) -- Offensive Calculations -- -- ---------------------- -- + if env.mainSkill.skillFlags.disable then + -- Skill is disabled + wipeTable(env.mainSkill.skillFlags) + return + end + -- Merge main skill mods modDB:AddList(env.mainSkill.skillModList) local skillData = env.mainSkill.skillData local skillFlags = env.mainSkill.skillFlags local skillCfg = env.mainSkill.skillCfg + if env.mainSkill.skillFlags.attack then + env.mode_skillType = "ATTACK" + else + env.mode_skillType = "SPELL" + end + if env.mainSkill.skillData.showAverage then + env.mode_average = true + else + skillFlags.notAverage = true + end if env.mode_buffs then skillFlags.buffs = true end @@ -1630,9 +1668,6 @@ local function performCalcs(env) if env.mode_effective then skillFlags.effective = true end - if not env.mode_average then - skillFlags.notAverage = true - end -- Update skill data for _, value in ipairs(modDB:Sum("LIST", skillCfg, "Misc")) do @@ -1668,6 +1703,8 @@ local function performCalcs(env) end end + local isAttack = (env.mode_skillType == "ATTACK") + -- Calculate skill type stats if skillFlags.projectile then output.ProjectileCount = modDB:Sum("BASE", skillCfg, "ProjectileCount") @@ -1754,8 +1791,6 @@ local function performCalcs(env) end end - local isAttack = (env.mode_skillType == "ATTACK") - -- Cache global damage disabling flags local canDeal = { } for _, damageType in pairs(dmgTypeList) do @@ -1840,13 +1875,27 @@ local function performCalcs(env) t_insert(breakdown.ManaCost, s_format("= %d", output.ManaCost)) end end - + + -- Determine source for skill damage + local source + if isAttack then + if skillFlags.weapon1Attack then + source = env.weaponData1 + condList["MainHandAttack"] = true + else + source = env.weaponData2 + condList["OffHandAttack"] = true + end + else + source = env.mainSkill.skillData + end + -- Calculate hit chance output.Accuracy = calcVal(modDB, "Accuracy", skillCfg) if breakdown then simpleBreakdown(nil, skillCfg, "Accuracy") end - if not isAttack or modDB:Sum("FLAG", skillCfg, "CannotBeEvaded") or env.weaponData1.CannotBeEvaded or skillData.cannotBeEvaded then + if not isAttack or modDB:Sum("FLAG", skillCfg, "CannotBeEvaded") or skillData.cannotBeEvaded then output.HitChance = 100 else local enemyEvasion = round(calcVal(enemyDB, "Evasion")) @@ -1870,9 +1919,9 @@ local function performCalcs(env) if isAttack then if skillData.castTimeOverridesAttackTime then -- Skill is overriding weapon attack speed - baseSpeed = 1 / skillData.castTime * (1 + (env.weaponData1.AttackSpeedInc or 0) / 100) + baseSpeed = 1 / skillData.castTime * (1 + (source.AttackSpeedInc or 0) / 100) else - baseSpeed = env.weaponData1.attackRate or 1 + baseSpeed = source.attackRate or 1 end else baseSpeed = 1 / (skillData.castTime or 1) @@ -1895,12 +1944,7 @@ local function performCalcs(env) output.CritMultiplier = 0 output.CritEffect = 1 else - local baseCrit - if isAttack then - baseCrit = env.weaponData1.critChance or 0 - else - baseCrit = skillData.critChance or 0 - end + local baseCrit = source.critChance or 0 if baseCrit == 100 then output.CritChance = 100 else @@ -1993,7 +2037,6 @@ local function performCalcs(env) for pass = 1, 2 do -- Pass 1 is critical strike damage, pass 2 is non-critical strike condList["CriticalStrike"] = (pass == 1) - local hitSource = (env.mode_skillType == "ATTACK") and env.weaponData1 or env.mainSkill.skillData for _, damageType in ipairs(dmgTypeList) do local min, max if skillFlags.hit and canDeal[damageType] then @@ -2002,7 +2045,7 @@ local function performCalcs(env) damageComponents = { } } end - min, max = calcHitDamage(env, hitSource, damageType) + min, max = calcHitDamage(env, source, damageType) local convMult = env.conversionTable[damageType].mult if breakdown then t_insert(breakdown[damageType], "Hit damage:") @@ -2574,7 +2617,7 @@ local function performCalcs(env) output.CombinedDPS = output.CombinedDPS + output.HitChance / 100 * output.PoisonChance / 100 * output.PoisonDamage output.WithPoisonAverageDamage = output.CombinedDPS else - output.CombinedDPS = output.CombinedDPS + output.HitChance / 100 * output.PoisonChance / 100 * output.PoisonDamage * (output.HitSpeed or output.Speed) + output.CombinedDPS = output.CombinedDPS + output.HitChance / 100 * output.PoisonChance / 100 * output.PoisonDamage * (output.HitSpeed or output.Speed) * (skillData.dpsMultiplier or 1) output.WithPoisonDPS = output.CombinedDPS end end @@ -2585,7 +2628,7 @@ local function performCalcs(env) igniteDPS = output.HitChance / 100 * output.IgniteChance / 100 * output.IgniteDamage output.WithIgniteAverageDamage = baseDPS + igniteDPS else - igniteDPS = output.HitChance / 100 * output.IgniteChance / 100 * output.IgniteDamage * (output.HitSpeed or output.Speed) + igniteDPS = output.HitChance / 100 * output.IgniteChance / 100 * output.IgniteDamage * (output.HitSpeed or output.Speed) * (skillData.dpsMultiplier or 1) output.WithIgniteDPS = baseDPS + igniteDPS end output.CombinedDPS = output.CombinedDPS + igniteDPS @@ -2757,7 +2800,6 @@ function calcs.buildOutput(build, mode) end end end - ConPrintTable(env.conditionsUsed) elseif mode == "CALCS" then local buffList = { } local combatList = { } diff --git a/Modules/Common.lua b/Modules/Common.lua index 8ae71ae6..e72c4cec 100644 --- a/Modules/Common.lua +++ b/Modules/Common.lua @@ -144,10 +144,10 @@ function isMouseInRegion(region) end -- Make a copy of a table and all subtables -function copyTable(tbl) +function copyTable(tbl, noRecurse) local out = {} for k, v in pairs(tbl) do - if type(v) == "table" then + if not noRecurse and type(v) == "table" then out[k] = copyTable(v) else out[k] = v diff --git a/Modules/Data.lua b/Modules/Data.lua index 21384242..c704346f 100644 --- a/Modules/Data.lua +++ b/Modules/Data.lua @@ -108,14 +108,14 @@ SkillType = { MinionSpell = 49, ChaosSkill = 50, Type51 = 51, -- Not used by any skill - Type52 = 52, -- Allows Contagion to be supported by Iron Will + Type52 = 52, -- Allows Contagion, Blight and Scorching Ray to be supported by Iron Will Type53 = 53, -- Allows Burning Arrow and Vigilant Strike to be supported by Inc AoE and Conc Effect Type54 = 54, -- Not used by any skill Type55 = 55, -- Allows Burning Arrow to be supported by Inc/Less Duration and Rapid Decay Type56 = 56, -- Not used by any skill Type57 = 57, -- Appears to be the same as 47 Channelled = 58, - Type59 = 59, -- Allows Contagion to be supported by Controlled Destruction + Type59 = 59, -- Allows Contagion, Blight and Scorching Ray to be supported by Controlled Destruction ColdSpell = 60, -- Used for Cospri's Malice } @@ -222,13 +222,13 @@ data.weaponTypeInfo = { } data.unarmedWeaponData = { - [0] = { attackRate = 1.2, critChance = 0, PhysicalMin = 2, PhysicalMax = 6 }, -- Scion - [1] = { attackRate = 1.2, critChance = 0, PhysicalMin = 2, PhysicalMax = 8 }, -- Marauder - [2] = { attackRate = 1.2, critChance = 0, PhysicalMin = 2, PhysicalMax = 5 }, -- Ranger - [3] = { attackRate = 1.2, critChance = 0, PhysicalMin = 2, PhysicalMax = 5 }, -- Witch - [4] = { attackRate = 1.2, critChance = 0, PhysicalMin = 2, PhysicalMax = 6 }, -- Duelist - [5] = { attackRate = 1.2, critChance = 0, PhysicalMin = 2, PhysicalMax = 6 }, -- Templar - [6] = { attackRate = 1.2, critChance = 0, PhysicalMin = 2, PhysicalMax = 5 }, -- Shadow + [0] = { type = "None", attackRate = 1.2, critChance = 0, PhysicalMin = 2, PhysicalMax = 6 }, -- Scion + [1] = { type = "None", attackRate = 1.2, critChance = 0, PhysicalMin = 2, PhysicalMax = 8 }, -- Marauder + [2] = { type = "None", attackRate = 1.2, critChance = 0, PhysicalMin = 2, PhysicalMax = 5 }, -- Ranger + [3] = { type = "None", attackRate = 1.2, critChance = 0, PhysicalMin = 2, PhysicalMax = 5 }, -- Witch + [4] = { type = "None", attackRate = 1.2, critChance = 0, PhysicalMin = 2, PhysicalMax = 6 }, -- Duelist + [5] = { type = "None", attackRate = 1.2, critChance = 0, PhysicalMin = 2, PhysicalMax = 6 }, -- Templar + [6] = { type = "None", attackRate = 1.2, critChance = 0, PhysicalMin = 2, PhysicalMax = 5 }, -- Shadow } data.itemBases = { } diff --git a/Modules/ModParser.lua b/Modules/ModParser.lua index a64b0d99..b71f3cda 100644 --- a/Modules/ModParser.lua +++ b/Modules/ModParser.lua @@ -385,6 +385,7 @@ local modTagList = { ["if you were hit recently"] = { tag = { type = "Condition", var = "BeenHitRecently" } }, ["if you were damaged by a hit recently"] = { tag = { type = "Condition", var = "BeenHitRecently" } }, ["if you've taken a savage hit recently"] = { tag = { type = "Condition", var = "BeenSavageHitRecently" } }, + ["if you've blocked recently"] = { tag = { type = "Condition", var = "BlockedRecently" } }, ["if you haven't been hit recently"] = { tag = { type = "Condition", var = "NotBeenHitRecently" } }, ["if you've taken no damage from hits recently"] = { tag = { type = "Condition", var = "NotBeenHitRecently" } }, ["if you've blocked a hit from a unique enemy recently"] = { tag = { type = "Condition", var = "BlockedHitFromUniqueEnemyRecently" } }, @@ -511,10 +512,10 @@ local specialModList = { -- Special item local modifiers ["no physical damage"] = { mod("Misc", "LIST", { type = "WeaponData", key = "PhysicalMin" }), mod("Misc", "LIST", { type = "WeaponData", key = "PhysicalMax" }), mod("Misc", "LIST", { type = "WeaponData", key = "PhysicalDPS" }) }, ["all attacks with this weapon are critical strikes"] = { mod("Misc", "LIST", { type = "WeaponData", key = "critChance", value = 100 }) }, - ["hits can't be evaded"] = { mod("Misc", "LIST", { type = "WeaponData", key = "CannotBeEvaded", value = true }) }, ["no block chance"] = { mod("Misc", "LIST", { type = "ArmourData", key = "BlockChance", value = 0 }) }, - ["causes bleeding on hit"] = { mod("BleedChance", "BASE", 100, nil, ModFlag.Attack) }, - ["poisonous hit"] = { mod("PoisonChance", "BASE", 100, nil, ModFlag.Attack) }, + ["hits can't be evaded"] = { flag("CannotBeEvaded", { type = "Condition", var = "XHandAttack" }) }, + ["causes bleeding on hit"] = { mod("BleedChance", "BASE", 100, { type = "Condition", var = "XHandAttack" }) }, + ["poisonous hit"] = { mod("PoisonChance", "BASE", 100, { type = "Condition", var = "XHandAttack" }) }, ["has no sockets"] = { }, ["has 1 socket"] = { }, ["attacks have blood magic"] = { flag("SkillBloodMagic", nil, ModFlag.Attack) }, @@ -564,7 +565,7 @@ local specialModList = { ["gain (%d+) mana per grand spectrum"] = function(num) return { mod("Mana", "BASE", num, { type = "Multiplier", var = "GrandSpectrum" }), mod("Misc", "LIST", { type = "Multiplier", var = "GrandSpectrum", value = 1}) } end, ["(%d+)%% increased elemental damage per grand spectrum"] = function(num) return { mod("ElementalDamage", "INC", num, { type = "Multiplier", var = "GrandSpectrum" }), mod("Misc", "LIST", { type = "Multiplier", var = "GrandSpectrum", value = 1}) } end, ["counts as dual wielding"] = { mod("Misc", "LIST", { type = "Condition", var = "DualWielding"}) }, - ["counts as all one handed melee weapon types"] = { mod("Misc", "LIST", { type = "WeaponData", key = "flag", value = bor(ModFlag.Axe, ModFlag.Claw, ModFlag.Dagger, ModFlag.Mace, ModFlag.Sword)}) }, + ["counts as all one handed melee weapon types"] = { mod("Misc", "LIST", { type = "WeaponData", key = "countsAsAll1H", value = true }) }, ["gain (%d+)%% of bow physical damage as extra damage of each element"] = function(num) return { mod("PhysicalDamageGainAsLightning", "BASE", num, nil, ModFlag.Bow), mod("PhysicalDamageGainAsCold", "BASE", num, nil, ModFlag.Bow), mod("PhysicalDamageGainAsFire", "BASE", num, nil, ModFlag.Bow) } end, ["totems fire (%d+) additional projectiles"] = function(num) return { mod("ProjectileCount", "BASE", num, nil, 0, KeywordFlag.Totem) } end, ["when at maximum frenzy charges, attacks poison enemies"] = { mod("PoisonChance", "BASE", 100, nil, ModFlag.Attack, { type = "Condition", var = "AtMaxFrenzyCharges" }) }, diff --git a/README.md b/README.md index 1badc85e..fbcba015 100644 --- a/README.md +++ b/README.md @@ -48,6 +48,14 @@ 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.2.37 - 2017/02/05 + * Attack skills will now only work if your equipped weapons can be used with that skill + * Dual Wield attack skills will now use the off hand weapon if the main hand isn't compatible with the skill + * If both weapons are compatible the calculations will still only use the main hand; full dual wield support is coming soon + * Added skill parts to Blast Rain to allow calculation of DPS against a target that's being hit by all 4 explosions + * Added a "Have you Blocked Recently?" option to the Configuration tab + * Added the block chance buff for Tempest Shield + ### 1.2.36 - 2017/01/31 * Condition toggles in the Configuration tab will now only appear if the condition is actually used by the build * Added support for "Ignited Enemies Burn faster" modifiers diff --git a/changelog.txt b/changelog.txt index 54b6f229..d63a10ae 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,10 @@ +VERSION[1.2.37][2017/02/05] + * Attack skills will now only work if your equipped weapons can be used with that skill + * Dual Wield attack skills will now use the off hand weapon if the main hand isn't compatible with the skill + * If both weapons are compatible the calculations will still only use the main hand; full dual wield support is coming soon + * Added skill parts to Blast Rain to allow calculation of DPS against a target that's being hit by all 4 explosions + * Added a "Have you Blocked Recently?" option to the Configuration tab + * Added the block chance buff for Tempest Shield VERSION[1.2.36][2017/01/31] * Condition toggles in the Configuration tab will now only appear if the condition is actually used by the build * Added support for "Ignited Enemies Burn faster" modifiers diff --git a/manifest.xml b/manifest.xml index 45036bc8..eace5397 100644 --- a/manifest.xml +++ b/manifest.xml @@ -1,20 +1,20 @@ - + - + - + - + @@ -44,21 +44,21 @@ - - - - + + + + - + - - - + + +