Quantcast

Updated critical damage/healing (percent) to critical efect (percent)

Kevin Lyles [01-07-12 - 05:29]
Updated critical damage/healing (percent) to critical efect (percent)
Filename
GemIds.lua
Locales/enUS/patterns-stacking-equip-effects.lua
Locales/enUS/patterns.lua
Locales/enUS/stats.lua
Upgrade.lua
defaults.lua
diff --git a/GemIds.lua b/GemIds.lua
index dacf15a..729254b 100644
--- a/GemIds.lua
+++ b/GemIds.lua
@@ -547,7 +547,7 @@ ww_gems = {
 				[3154] = {
 					"meta",
 					"Relentless Earthstorm Diamond",
-					{[L["agility"]] = 12, [L["critical damage (percent)"]] = 3},
+					{[L["agility"]] = 12, [L["critical effect (percent)"]] = 3},
 				},
 				[3155] = {
 					"meta",
@@ -567,7 +567,7 @@ ww_gems = {
 				[3261] = {
 					"meta",
 					"Chaotic Skyfire Diamond",
-					{[L["critical damage (percent)"]] = 3, [L["critical strike rating"]] = 12},
+					{[L["critical effect (percent)"]] = 3, [L["critical strike rating"]] = 12},
 				},
 				[3270] = {
 					"yellow",
@@ -1528,7 +1528,7 @@ ww_gems = {
 				[3621] = {
 					"meta",
 					"Chaotic Skyflare Diamond",
-					{[L["critical damage (percent)"]] = 3, [L["critical strike rating"]] = 21},
+					{[L["critical effect (percent)"]] = 3, [L["critical strike rating"]] = 21},
 				},
 				[3622] = {
 					"meta",
@@ -1563,7 +1563,7 @@ ww_gems = {
 				[3628] = {
 					"meta",
 					"Relentless Earthsiege Diamond",
-					{[L["agility"]] = 21, [L["critical damage (percent)"]] = 3},
+					{[L["agility"]] = 21, [L["critical effect (percent)"]] = 3},
 				},
 				[3631] = {
 					"meta",
@@ -1578,7 +1578,7 @@ ww_gems = {
 				[3633] = {
 					"meta",
 					"Revitalizing Skyflare Diamond",
-					{[L["critical healing (percent)"]] = 3, [L["spirit"]] = 22},
+					{[L["critical effect (percent)"]] = 3, [L["spirit"]] = 22},
 				},
 				[3634] = {
 					"meta",
@@ -2484,7 +2484,7 @@ ww_gems = {
 				[4046] = {
 					"meta",
 					"Chaotic Shadowspirit Diamond",
-					{[L["critical damage (percent)"]] = 3, [L["critical strike rating"]] = 54},
+					{[L["critical effect (percent)"]] = 3, [L["critical strike rating"]] = 54},
 				},
 				[4047] = {
 					"meta",
@@ -2514,7 +2514,7 @@ ww_gems = {
 				[4052] = {
 					"meta",
 					"Revitalizing Shadowspirit Diamond",
-					{[L["critical healing (percent)"]] = 3, [L["spirit"]] = 54},
+					{[L["critical effect (percent)"]] = 3, [L["spirit"]] = 54},
 				},
 				[4053] = {
 					"meta",
@@ -2564,17 +2564,17 @@ ww_gems = {
 				[4251] = {
 					"meta",
 					"Agile Shadowspirit Diamond",
-					{[L["agility"]] = 54, [L["critical damage (percent)"]] = 3},
+					{[L["agility"]] = 54, [L["critical effect (percent)"]] = 3},
 				},
 				[4252] = {
 					"meta",
 					"Reverberating Shadowspirit Diamond",
-					{[L["critical damage (percent)"]] = 3, [L["strength"]] = 54},
+					{[L["critical effect (percent)"]] = 3, [L["strength"]] = 54},
 				},
 				[4253] = {
 					"meta",
 					"Burning Shadowspirit Diamond",
-					{[L["critical damage (percent)"]] = 3, [L["intellect"]] = 54},
+					{[L["critical effect (percent)"]] = 3, [L["intellect"]] = 54},
 				},
 			},
 		},
diff --git a/Locales/enUS/patterns-stacking-equip-effects.lua b/Locales/enUS/patterns-stacking-equip-effects.lua
index a9568be..863487b 100644
--- a/Locales/enUS/patterns-stacking-equip-effects.lua
+++ b/Locales/enUS/patterns-stacking-equip-effects.lua
@@ -14,6 +14,7 @@ local triggerGroups = {
 	["rangedDamageDealt"] = {"rangedDamage"},
 	["spellDamageDealt"] = {"harmfulSpell"},
 	["damagingSpellCast"] = {"harmfulSpell"},
+	["harmfulSpellCast"] = {"harmfulSpell"},
 	["harmfulSpellHit"] = {"harmfulSpell"},
 	["spellCast"] = {"harmfulSpell", "helpfulSpell"},
 	["healingSpellCast"] = {"helpfulSpell"},
@@ -76,12 +77,14 @@ local function parseStackingEquipEffectTriggers(trigger)
 				if subType == "" then
 					trigger = trigger:sub(1, 1):lower() .. trigger:sub(2)
 				end
-				for _, group in ipairs(triggerGroups[subType .. trigger]) do
+				for _, group in ipairs(triggerGroups[subType .. trigger] or {}) do
 					triggers[group] = true
 				end
 			end

-			return triggers
+			for _ in pairs(triggers) do
+				return triggers
+			end
 		end
 	end
 end
@@ -104,7 +107,6 @@ local function parseStackingEquipEffect(text, section)
 	if not stat or not stat.stats then
 		return
 	end
-	-- TODO: figure out/fix this?
 	local amount
 	for name, value in pairs(stat.stats) do
 		stat = name
diff --git a/Locales/enUS/patterns.lua b/Locales/enUS/patterns.lua
index eb14dec..1988532 100644
--- a/Locales/enUS/patterns.lua
+++ b/Locales/enUS/patterns.lua
@@ -563,15 +563,9 @@ ww_SingleStatLines = {
 		end,
 		{"generic"},
 	},
-	{"^(%d+)%% increased critical damage$",
+	{"^(%d+)%% increased critical effect$",
 		function(text, pattern)
-			return WeightsWatcher.singleStatValueOnly(text, pattern, "critical damage (percent)")
-		end,
-		{"generic"},
-	},
-	{"^(%d+)%% increased critical healing effect$",
-		function(text, pattern)
-			return WeightsWatcher.singleStatValueOnly(text, pattern, "critical healing (percent)")
+			return WeightsWatcher.singleStatValueOnly(text, pattern, "critical effect (percent)")
 		end,
 		{"generic"},
 	},
diff --git a/Locales/enUS/stats.lua b/Locales/enUS/stats.lua
index 794f494..3e84541 100644
--- a/Locales/enUS/stats.lua
+++ b/Locales/enUS/stats.lua
@@ -31,8 +31,9 @@ ww_localizedStats = {
 	["chance to restore health on hit"] = "chance to restore health on hit",
 	["chance to restore mana on spellcast"] = "chance to restore mana on spellcast",
 	["chance to stun target"] = "chance to stun target",
-	["critical damage (percent)"] = "critical damage (percent)",
-	["critical healing (percent)"] = "critical healing (percent)",
+	["critical effect (percent)"] = "critical effect (percent)",
+--	["critical damage (percent)"] = "critical damage (percent)",
+--	["critical healing (percent)"] = "critical healing (percent)",
 	["critical strike rating"] = "critical strike rating",
 	["crusader"] = "crusader",
 	["damage absorption (2% chance)"] = "damage absorption (2% chance)",
@@ -172,8 +173,9 @@ ww_statDisplayNames = {
 	[ww_localizedStats["chance to restore health on hit"]] = "Chance to Restore Health on Hit",
 	[ww_localizedStats["chance to restore mana on spellcast"]] = "Chance to Restore Mana on Spellcast",
 	[ww_localizedStats["chance to stun target"]] = "Chance to Stun Target",
-	[ww_localizedStats["critical damage (percent)"]] = "Critical Damage (Percent)",
-	[ww_localizedStats["critical healing (percent)"]] = "Critical Healing (Percent)",
+	[ww_localizedStats["critical effect (percent)"]] = "Critical Effect (Percent)",
+--	[ww_localizedStats["critical damage (percent)"]] = "Critical Damage (Percent)",
+--	[ww_localizedStats["critical healing (percent)"]] = "Critical Healing (Percent)",
 	[ww_localizedStats["critical strike rating"]] = "Critical Strike Rating",
 	[ww_localizedStats["crusader"]] = "Crusader",
 	[ww_localizedStats["damage absorption (2% chance)"]] = "Damage Absorption (2% Chance)",
diff --git a/Upgrade.lua b/Upgrade.lua
index c5a0f31..e02aa14 100644
--- a/Upgrade.lua
+++ b/Upgrade.lua
@@ -36,6 +36,22 @@ local function noop_major_up(vars)
 	return vars
 end

+local function upgradeAccountToCriticalEffect(vars)
+	for _, class in ipairs(vars.weightsList) do
+		for _, weight in ipairs(vars.weightsList[class]) do
+			if vars.weightsList[class][weight]["critical effect (percent)"] == nil then
+				local value = (vars.weightsList[class][weight]["critical damage (percent)"] or 0) + (vars.weightsList[class][weight]["critical healing (percent)"] or 0)
+				if value ~= 0 then
+					vars.weightsList[class][weight]["critical effect (percent)"] = value
+				end
+			end
+		end
+	end
+
+	vars.dataMinorVersion = 1
+	return vars
+end
+
 local function upgradeAccountToEnchants(vars)
 	if not vars.options.calculation then
 		vars.options.calculation = {}
@@ -1094,6 +1110,9 @@ local upgradeAccountFunctions = {
 		[24] = UpgradeAccountToShowZeroScores,
 		[25] = upgradeAccountToEnchants,
 	},
+	[2] = {
+		[0] = upgradeAccountToCriticalEffect,
+	},
 }

 local downgradeAccountFunctions = {
@@ -1138,6 +1157,7 @@ local downgradeAccountFunctions = {
 	},
 	[2] = {
 		[0] = downgradeAccountFromEnchants,
+		[1] = noop_down,
 	},
 }

diff --git a/defaults.lua b/defaults.lua
index a46f6ca..237fad5 100644
--- a/defaults.lua
+++ b/defaults.lua
@@ -17,10 +17,14 @@ ww_trackedStats = {
 			"hit rating",
 			ww_statCategories["Enchant/Meta Gem Effects"],
 			[ww_statCategories["Enchant/Meta Gem Effects"]] = {
-				"critical damage (percent)",
+--				"critical damage (percent)",
 				"threat reduction (percent)",
 			},
 		},
+		ww_statCategories["Enchant/Meta Gem Effects"],
+		[ww_statCategories["Enchant/Meta Gem Effects"]] = {
+			"critical effect (percent)",
+		},
 	},
 	[ww_statCategories["Physical DPS"]] = {
 		"agility",
@@ -111,7 +115,7 @@ ww_trackedStats = {
 			["helpfulSpell"] = "ww_triggerFrame",
 			[ww_statCategories["Enchant/Meta Gem Effects"]] = {
 				"chance to restore mana on spellcast",
-				"critical healing (percent)",
+--				"critical healing (percent)",
 				"mana (percent)",
 			},
 		},
@@ -238,7 +242,7 @@ ww_classNameOptions = {

 ww_defaultVars = {
 	dataMajorVersion = 2,
-	dataMinorVersion = 0,
+	dataMinorVersion = 1,
 	weightsList = {
 		"DEATHKNIGHT",
 		"DRUID",