From 524105a15ad6f085dce3086d6995d2fb644886e7 Mon Sep 17 00:00:00 2001
From: Andrew Minton <a@cowmuffins.net>
Date: Tue, 1 Aug 2017 23:43:07 -0600
Subject: [PATCH 3/5] Fix the Kinetic/Thermal/Charged Focus set

Previously, if you equipped all three mindstars, then removed Kinetic Focus, the
other two would lose ALL their set bonuses - including the Thermal/Charged set
bonus, even though both are still equipped. If you re-equipped the Kinetic
Focus, you would get the Kinetic/Thermal and Kinetic/Charged set bonuses, but
not the Thermal/Charged one.
In the general case, removing one item from any set would remove all set bonuses
from all items in that set. This worked fine for non-overlapping sets, but does
not work for overlapping ones: if X+Y, Y+Z, and X+Z are all sets, then removing
X would take away the set bonuses for Y+Z, which it obviously should not.

This commit changes set behaviour so that only set bonuses from the sets that
were *actually broken* are removed. If you remove X, the bonuses for X+Y and X+Z
are still removed, but the bonus for Y+Z remains. This fixes the
Kinetic/Thermal/Charged Focus set.

Object:specialSetAdd() now takes the set_id as a third parameter. This is
only needed for overlapping sets and can safely be omitted for sets that do not
overlap. Therefore, existing addons that use specialSetAdd() will not break.

There are still other problems with mindstar ego sets that need to be addressed
separately.
---
 game/modules/tome/class/Actor.lua                  |  23 ++-
 game/modules/tome/class/Object.lua                 |  17 ++-
 .../tome/data/general/objects/world-artifacts.lua  | 168 ++++++++++-----------
 3 files changed, 114 insertions(+), 94 deletions(-)

diff --git a/game/modules/tome/class/Actor.lua b/game/modules/tome/class/Actor.lua
index b989e76..8273e69 100644
--- a/game/modules/tome/class/Actor.lua
+++ b/game/modules/tome/class/Actor.lua
@@ -4067,19 +4067,30 @@ function _M:onTakeoff(o, inven_id, bypass_set, silent)
 				if type(broken) == "table" then broken = broken[set_id] end
 				if broken then broken(d.object, self, d.inven_id, set_objects) end
 				if d.object._special_set then
-					for k, id in pairs(d.object._special_set) do
-						d.object:removeTemporaryValue(k, id)
+					if d.object._special_set[set_id] then
+						for k, id in pairs(d.object._special_set[set_id]) do
+							d.object:removeTemporaryValue(k, id)
+						end
+						d.object._special_set[set_id] = nil
+						-- Remove if empty.
+						if not next(d.object._special_set) then
+							d.object._special_set = nil
+						end
+					else -- Object only has one set (old behaviour)
+						for k, id in pairs(d.object._special_set) do
+							d.object:removeTemporaryValue(k, id)
+						end
+						d.object._special_set = nil
 					end
-					d.object._special_set = nil
 				end
 				if d.object ~= o then self:onWear(d.object, d.inven_id, true) end
 				self:useObjectDisable(d.object)
 				self:useObjectEnable(d.object)
 				d.object.set_complete[set_id] = nil
 				-- Remove if empty.
-				local empty = true
-				for k, v in pairs(d.object.set_complete) do empty = false break end
-				if empty then d.object.set_complete = nil end
+				if not next(d.object.set_complete) then
+					d.object.set_complete = nil
+				end
 			end
 		end
 	end
diff --git a/game/modules/tome/class/Object.lua b/game/modules/tome/class/Object.lua
index 4fd44b0..ce0ba5f 100644
--- a/game/modules/tome/class/Object.lua
+++ b/game/modules/tome/class/Object.lua
@@ -2337,10 +2337,19 @@ function _M:specialWearAdd(prop, value)
 	self._special_wear[prop] = self:addTemporaryValue(prop, value)
 end
 
---- Add some special properties right when completting a set
-function _M:specialSetAdd(prop, value)
+--- Add some special properties right when completing a set
+-- Items with overlapping sets (such as Kinetic/Thermal/Charged focus) must
+-- include the set_id parameter identifying which of the overlapping sets the
+-- bonus belongs to. Otherwise, breaking one of the overlapping sets will
+-- remove ALL set bonuses from the other item(s).
+function _M:specialSetAdd(prop, value, set_id)
 	self._special_set = self._special_set or {}
-	self._special_set[prop] = self:addTemporaryValue(prop, value)
+	if set_id then
+		self._special_set[set_id] = self._special_set[set_id] or {}
+		self._special_set[set_id][prop] = self:addTemporaryValue(prop, value)
+	else
+		self._special_set[prop] = self:addTemporaryValue(prop, value)
+	end
 end
 
 function _M:getCharmPower(who, raw)
@@ -2512,4 +2521,4 @@ function _M:getStaffPreferredElement(who, force)
 	end
 	if wt > 0 then aspect = aspects[best] end
 	return wt > 0 and best, aspect, damweights
-end
\ No newline at end of file
+end
diff --git a/game/modules/tome/data/general/objects/world-artifacts.lua b/game/modules/tome/data/general/objects/world-artifacts.lua
index 4e3aad1..5cce0bf 100644
--- a/game/modules/tome/data/general/objects/world-artifacts.lua
+++ b/game/modules/tome/data/general/objects/world-artifacts.lua
@@ -2726,15 +2726,15 @@ newEntity{ base = "BASE_MINDSTAR",
 			if inven_id == "MAINHAND" then
 				game.logPlayer(who, "#PURPLE#You feel the spirit of the wyrm stirring inside you!")
 			end
-			self:specialSetAdd({"wielder","blind_immune"}, self.material_level / 10)
-			self:specialSetAdd({"wielder","stun_immune"}, self.material_level / 10)
+			self:specialSetAdd({"wielder","blind_immune"}, self.material_level / 10, "harmonious")
+			self:specialSetAdd({"wielder","stun_immune"}, self.material_level / 10, "harmonious")
 		end,
 		wyrm = function(self, who, inven_id)
 			if inven_id == "MAINHAND" then
 				game.logPlayer(who, "#PURPLE#You feel the spirit of the wyrm stirring inside you!")
 			end
-			self:specialSetAdd({"wielder","blind_immune"}, self.material_level / 10)
-			self:specialSetAdd({"wielder","stun_immune"}, self.material_level / 10)
+			self:specialSetAdd({"wielder","blind_immune"}, self.material_level / 10, "wyrm")
+			self:specialSetAdd({"wielder","stun_immune"}, self.material_level / 10, "wyrm")
 		end,
 	},
 	on_set_broken = {
@@ -7823,13 +7823,13 @@ newEntity{ base = "BASE_MINDSTAR", define_as = "EYE_OF_SUMMER",
 	on_set_complete = {
 		multiple = true,
 		seasons = function(self, who)
-			self:specialSetAdd({"wielder","resists"}, { [engine.DamageType.COLD]=20 })
-			self:specialSetAdd({"wielder","combat_mindpower"}, 4)
+			self:specialSetAdd({"wielder","resists"}, { [engine.DamageType.COLD]=20 }, "seasons")
+			self:specialSetAdd({"wielder","combat_mindpower"}, 4, "seasons")
 			game.logSeen(who, "#GREEN#You feel the seasons in perfect balance.")
 		end,
 		harmonious = function(self, who)
-			self:specialSetAdd({"wielder","resists"}, { [engine.DamageType.COLD]=20 })
-			self:specialSetAdd({"wielder","combat_mindpower"}, 4)
+			self:specialSetAdd({"wielder","resists"}, { [engine.DamageType.COLD]=20 }, "harmonious")
+			self:specialSetAdd({"wielder","combat_mindpower"}, 4, "harmonious")
 			game.logSeen(who, "#GREEN#You feel the seasons in perfect balance.")
 		end,
 	},
@@ -7879,12 +7879,12 @@ newEntity{ base = "BASE_MINDSTAR", define_as = "EYE_OF_WINTER",
 	on_set_complete = {
 		multiple = true,
 		seasons = function(self, who)
-			self:specialSetAdd({"wielder","resists"}, { [engine.DamageType.FIRE]=20 })
-			self:specialSetAdd({"wielder","combat_mindpower"}, 4)
+			self:specialSetAdd({"wielder","resists"}, { [engine.DamageType.FIRE]=20 }, "seasons")
+			self:specialSetAdd({"wielder","combat_mindpower"}, 4, "seasons")
 		end,
 		harmonious = function(self, who)
-			self:specialSetAdd({"wielder","resists"}, { [engine.DamageType.FIRE]=20 })
-			self:specialSetAdd({"wielder","combat_mindpower"}, 4)
+			self:specialSetAdd({"wielder","resists"}, { [engine.DamageType.FIRE]=20 }, "harmonious")
+			self:specialSetAdd({"wielder","combat_mindpower"}, 4, "harmonious")
 		end,
 	},
 	on_set_broken = function(self, who)
@@ -8085,36 +8085,36 @@ newEntity{ base = "BASE_MINDSTAR", define_as = "KINETIC_FOCUS",
 	on_set_complete = { 
 		multiple = true,
 		kinchar = function(self, who)
-			self:specialSetAdd({"wielder","combat_mindpower"}, 6)
-			self:specialSetAdd({"wielder","combat_mindcrit"}, 3)
-			self:specialSetAdd({"wielder","inc_damage"}, { [engine.DamageType.PHYSICAL]=10 })
-			self:specialSetAdd({"wielder","resists_pen"}, { [engine.DamageType.PHYSICAL]=6 })
-			self:specialSetAdd({"wielder","resists"}, { [engine.DamageType.PHYSICAL]=10 })
-			self:specialSetAdd({"wielder","psi_on_crit"}, 1)
-			self:specialSetAdd({"wielder","combat_physresist"}, 6)
-			self:specialSetAdd({"wielder","talents_types_mastery"},{ ["psionic/kinetic-mastery"] = 0.1 })
+			self:specialSetAdd({"wielder","combat_mindpower"}, 6, "kinchar")
+			self:specialSetAdd({"wielder","combat_mindcrit"}, 3, "kinchar")
+			self:specialSetAdd({"wielder","inc_damage"}, { [engine.DamageType.PHYSICAL]=10 }, "kinchar")
+			self:specialSetAdd({"wielder","resists_pen"}, { [engine.DamageType.PHYSICAL]=6 }, "kinchar")
+			self:specialSetAdd({"wielder","resists"}, { [engine.DamageType.PHYSICAL]=10 }, "kinchar")
+			self:specialSetAdd({"wielder","psi_on_crit"}, 1, "kinchar")
+			self:specialSetAdd({"wielder","combat_physresist"}, 6, "kinchar")
+			self:specialSetAdd({"wielder","talents_types_mastery"},{ ["psionic/kinetic-mastery"] = 0.1 }, "kinchar")
 			game.logSeen(who, "#YELLOW#You feel psionic energy linking the mindstars.")
 		end,
 		kinther = function(self, who)
-			self:specialSetAdd({"wielder","combat_mindpower"}, 6)
-			self:specialSetAdd({"wielder","combat_mindcrit"}, 3)
-			self:specialSetAdd({"wielder","inc_damage"}, { [engine.DamageType.PHYSICAL]=10 })
-			self:specialSetAdd({"wielder","resists_pen"}, { [engine.DamageType.PHYSICAL]=6 })
-			self:specialSetAdd({"wielder","resists"}, { [engine.DamageType.PHYSICAL]=10 })
-			self:specialSetAdd({"wielder","psi_on_crit"}, 1)
-			self:specialSetAdd({"wielder","combat_physresist"}, 6)
-			self:specialSetAdd({"wielder","talents_types_mastery"},{ ["psionic/kinetic-mastery"] = 0.1 })
+			self:specialSetAdd({"wielder","combat_mindpower"}, 6, "kinther")
+			self:specialSetAdd({"wielder","combat_mindcrit"}, 3, "kinther")
+			self:specialSetAdd({"wielder","inc_damage"}, { [engine.DamageType.PHYSICAL]=10 }, "kinther")
+			self:specialSetAdd({"wielder","resists_pen"}, { [engine.DamageType.PHYSICAL]=6 }, "kinther")
+			self:specialSetAdd({"wielder","resists"}, { [engine.DamageType.PHYSICAL]=10 }, "kinther")
+			self:specialSetAdd({"wielder","psi_on_crit"}, 1, "kinther")
+			self:specialSetAdd({"wielder","combat_physresist"}, 6, "kinther")
+			self:specialSetAdd({"wielder","talents_types_mastery"},{ ["psionic/kinetic-mastery"] = 0.1 }, "kinther")
 			game.logSeen(who, "#YELLOW#You feel psionic energy linking the mindstars.")
 		end,
 		resonating = function(self, who)
-			self:specialSetAdd({"wielder","combat_mindpower"}, 2)
-			self:specialSetAdd({"wielder","combat_mindcrit"}, 1)
-			self:specialSetAdd({"wielder","inc_damage"}, { [engine.DamageType.PHYSICAL]=5 })
-			self:specialSetAdd({"wielder","resists_pen"}, { [engine.DamageType.PHYSICAL]=3 })
-			self:specialSetAdd({"wielder","resists"}, { [engine.DamageType.PHYSICAL]=5 })
-			self:specialSetAdd({"wielder","psi_on_crit"}, 0.5)
-			self:specialSetAdd({"wielder","combat_physresist"}, 3)
-			self:specialSetAdd({"wielder","talents_types_mastery"},{ ["psionic/kinetic-mastery"] = 0.05 })
+			self:specialSetAdd({"wielder","combat_mindpower"}, 2, "resonating")
+			self:specialSetAdd({"wielder","combat_mindcrit"}, 1, "resonating")
+			self:specialSetAdd({"wielder","inc_damage"}, { [engine.DamageType.PHYSICAL]=5 }, "resonating")
+			self:specialSetAdd({"wielder","resists_pen"}, { [engine.DamageType.PHYSICAL]=3 }, "resonating")
+			self:specialSetAdd({"wielder","resists"}, { [engine.DamageType.PHYSICAL]=5 }, "resonating")
+			self:specialSetAdd({"wielder","psi_on_crit"}, 0.5, "resonating")
+			self:specialSetAdd({"wielder","combat_physresist"}, 3, "resonating")
+			self:specialSetAdd({"wielder","talents_types_mastery"},{ ["psionic/kinetic-mastery"] = 0.05 }, "resonating")
 			game.logSeen(who, "#YELLOW#You feel psionic energy linking the mindstars.")
 		end,
 	},
@@ -8166,34 +8166,34 @@ newEntity{ base = "BASE_MINDSTAR", define_as = "CHARGED_FOCUS",
 	on_set_complete = { 
 		multiple = true,
 		kinchar = function(self, who)
-			self:specialSetAdd({"wielder","combat_mindpower"}, 2)
-			self:specialSetAdd({"wielder","combat_mindcrit"}, 1)
-			self:specialSetAdd({"wielder","inc_damage"}, { [engine.DamageType.LIGHTNING]=5 })
-			self:specialSetAdd({"wielder","resists_pen"}, { [engine.DamageType.LIGHTNING]=3 })
-			self:specialSetAdd({"wielder","resists"}, { [engine.DamageType.LIGHTNING]=5 })
-			self:specialSetAdd({"wielder","max_psi"}, 10)
-			self:specialSetAdd({"wielder","combat_mentalresist"}, 3)
-			self:specialSetAdd({"wielder","talents_types_mastery"},{ ["psionic/charged-mastery"] = 0.05 })
+			self:specialSetAdd({"wielder","combat_mindpower"}, 2, "kinchar")
+			self:specialSetAdd({"wielder","combat_mindcrit"}, 1, "kinchar")
+			self:specialSetAdd({"wielder","inc_damage"}, { [engine.DamageType.LIGHTNING]=5 }, "kinchar")
+			self:specialSetAdd({"wielder","resists_pen"}, { [engine.DamageType.LIGHTNING]=3 }, "kinchar")
+			self:specialSetAdd({"wielder","resists"}, { [engine.DamageType.LIGHTNING]=5 }, "kinchar")
+			self:specialSetAdd({"wielder","max_psi"}, 10, "kinchar")
+			self:specialSetAdd({"wielder","combat_mentalresist"}, 3, "kinchar")
+			self:specialSetAdd({"wielder","talents_types_mastery"},{ ["psionic/charged-mastery"] = 0.05 }, "kinchar")
 		end,
 		charther = function(self, who)
-			self:specialSetAdd({"wielder","combat_mindpower"}, 6)
-			self:specialSetAdd({"wielder","combat_mindcrit"}, 3)
-			self:specialSetAdd({"wielder","inc_damage"}, { [engine.DamageType.LIGHTNING]=10 })
-			self:specialSetAdd({"wielder","resists_pen"}, { [engine.DamageType.LIGHTNING]=6 })
-			self:specialSetAdd({"wielder","resists"}, { [engine.DamageType.LIGHTNING]=10 })
-			self:specialSetAdd({"wielder","max_psi"}, 20)
-			self:specialSetAdd({"wielder","combat_mentalresist"}, 6)
-			self:specialSetAdd({"wielder","talents_types_mastery"},{ ["psionic/charged-mastery"] = 0.1 })
+			self:specialSetAdd({"wielder","combat_mindpower"}, 6, "charther")
+			self:specialSetAdd({"wielder","combat_mindcrit"}, 3, "charther")
+			self:specialSetAdd({"wielder","inc_damage"}, { [engine.DamageType.LIGHTNING]=10 }, "charther")
+			self:specialSetAdd({"wielder","resists_pen"}, { [engine.DamageType.LIGHTNING]=6 }, "charther")
+			self:specialSetAdd({"wielder","resists"}, { [engine.DamageType.LIGHTNING]=10 }, "charther")
+			self:specialSetAdd({"wielder","max_psi"}, 20, "charther")
+			self:specialSetAdd({"wielder","combat_mentalresist"}, 6, "charther")
+			self:specialSetAdd({"wielder","talents_types_mastery"},{ ["psionic/charged-mastery"] = 0.1 }, "charther")
 		end,
 		resonating = function(self, who)
-			self:specialSetAdd({"wielder","combat_mindpower"}, 2)
-			self:specialSetAdd({"wielder","combat_mindcrit"}, 1)
-			self:specialSetAdd({"wielder","inc_damage"}, { [engine.DamageType.LIGHTNING]=5 })
-			self:specialSetAdd({"wielder","resists_pen"}, { [engine.DamageType.LIGHTNING]=3 })
-			self:specialSetAdd({"wielder","resists"}, { [engine.DamageType.LIGHTNING]=5 })
-			self:specialSetAdd({"wielder","max_psi"}, 10)
-			self:specialSetAdd({"wielder","combat_mentalresist"}, 3)
-			self:specialSetAdd({"wielder","talents_types_mastery"},{ ["psionic/charged-mastery"] = 0.05 })
+			self:specialSetAdd({"wielder","combat_mindpower"}, 2, "resonating")
+			self:specialSetAdd({"wielder","combat_mindcrit"}, 1, "resonating")
+			self:specialSetAdd({"wielder","inc_damage"}, { [engine.DamageType.LIGHTNING]=5 }, "resonating")
+			self:specialSetAdd({"wielder","resists_pen"}, { [engine.DamageType.LIGHTNING]=3 }, "resonating")
+			self:specialSetAdd({"wielder","resists"}, { [engine.DamageType.LIGHTNING]=5 }, "resonating")
+			self:specialSetAdd({"wielder","max_psi"}, 10, "resonating")
+			self:specialSetAdd({"wielder","combat_mentalresist"}, 3, "resonating")
+			self:specialSetAdd({"wielder","talents_types_mastery"},{ ["psionic/charged-mastery"] = 0.05 }, "resonating")
 		end,
 	},
 	on_set_broken = function(self, who)
@@ -8247,34 +8247,34 @@ newEntity{ base = "BASE_MINDSTAR", define_as = "THERMAL_FOCUS",
 	on_set_complete = { 
 		multiple = true,
 		kinther = function(self, who)
-			self:specialSetAdd({"wielder","combat_mindpower"}, 2)
-			self:specialSetAdd({"wielder","combat_mindcrit"}, 1)
-			self:specialSetAdd({"wielder","inc_damage"}, { [engine.DamageType.FIRE]=5, [engine.DamageType.COLD]=5, })
-			self:specialSetAdd({"wielder","resists_pen"}, { [engine.DamageType.FIRE]=3, [engine.DamageType.COLD]=3, })
-			self:specialSetAdd({"wielder","resists"}, { [engine.DamageType.FIRE]=5, [engine.DamageType.COLD]=5, })
-			self:specialSetAdd({"wielder","psi_regen"}, 1)
-			self:specialSetAdd({"wielder","combat_spellresist"}, 3)
-			self:specialSetAdd({"wielder","talents_types_mastery"},{ ["psionic/thermal-mastery"] = 0.05 })
+			self:specialSetAdd({"wielder","combat_mindpower"}, 2, "kinther")
+			self:specialSetAdd({"wielder","combat_mindcrit"}, 1, "kinther")
+			self:specialSetAdd({"wielder","inc_damage"}, { [engine.DamageType.FIRE]=5, [engine.DamageType.COLD]=5, }, "kinther")
+			self:specialSetAdd({"wielder","resists_pen"}, { [engine.DamageType.FIRE]=3, [engine.DamageType.COLD]=3, }, "kinther")
+			self:specialSetAdd({"wielder","resists"}, { [engine.DamageType.FIRE]=5, [engine.DamageType.COLD]=5, }, "kinther")
+			self:specialSetAdd({"wielder","psi_regen"}, 1, "kinther")
+			self:specialSetAdd({"wielder","combat_spellresist"}, 3, "kinther")
+			self:specialSetAdd({"wielder","talents_types_mastery"},{ ["psionic/thermal-mastery"] = 0.05 }, "kinther")
 		end,
 		charther = function(self, who)
-			self:specialSetAdd({"wielder","combat_mindpower"}, 2)
-			self:specialSetAdd({"wielder","combat_mindcrit"}, 1)
-			self:specialSetAdd({"wielder","inc_damage"}, { [engine.DamageType.FIRE]=5, [engine.DamageType.COLD]=5, })
-			self:specialSetAdd({"wielder","resists_pen"}, { [engine.DamageType.FIRE]=3, [engine.DamageType.COLD]=3, })
-			self:specialSetAdd({"wielder","resists"}, { [engine.DamageType.FIRE]=5, [engine.DamageType.COLD]=5, })
-			self:specialSetAdd({"wielder","psi_regen"}, 1)
-			self:specialSetAdd({"wielder","combat_spellresist"}, 3)
-			self:specialSetAdd({"wielder","talents_types_mastery"},{ ["psionic/thermal-mastery"] = 0.05 })
+			self:specialSetAdd({"wielder","combat_mindpower"}, 2, "charther")
+			self:specialSetAdd({"wielder","combat_mindcrit"}, 1, "charther")
+			self:specialSetAdd({"wielder","inc_damage"}, { [engine.DamageType.FIRE]=5, [engine.DamageType.COLD]=5, }, "charther")
+			self:specialSetAdd({"wielder","resists_pen"}, { [engine.DamageType.FIRE]=3, [engine.DamageType.COLD]=3, }, "charther")
+			self:specialSetAdd({"wielder","resists"}, { [engine.DamageType.FIRE]=5, [engine.DamageType.COLD]=5, }, "charther")
+			self:specialSetAdd({"wielder","psi_regen"}, 1, "charther")
+			self:specialSetAdd({"wielder","combat_spellresist"}, 3, "charther")
+			self:specialSetAdd({"wielder","talents_types_mastery"},{ ["psionic/thermal-mastery"] = 0.05 }, "charther")
 		end,
 		resonating = function(self, who)
-			self:specialSetAdd({"wielder","combat_mindpower"}, 2)
-			self:specialSetAdd({"wielder","combat_mindcrit"}, 1)
-			self:specialSetAdd({"wielder","inc_damage"}, { [engine.DamageType.FIRE]=5, [engine.DamageType.COLD]=5, })
-			self:specialSetAdd({"wielder","resists_pen"}, { [engine.DamageType.FIRE]=3, [engine.DamageType.COLD]=3, })
-			self:specialSetAdd({"wielder","resists"}, { [engine.DamageType.FIRE]=5, [engine.DamageType.COLD]=5, })
-			self:specialSetAdd({"wielder","psi_regen"}, 1)
-			self:specialSetAdd({"wielder","combat_spellresist"}, 3)
-			self:specialSetAdd({"wielder","talents_types_mastery"},{ ["psionic/thermal-mastery"] = 0.05 })
+			self:specialSetAdd({"wielder","combat_mindpower"}, 2, "resonating")
+			self:specialSetAdd({"wielder","combat_mindcrit"}, 1, "resonating")
+			self:specialSetAdd({"wielder","inc_damage"}, { [engine.DamageType.FIRE]=5, [engine.DamageType.COLD]=5, }, "resonating")
+			self:specialSetAdd({"wielder","resists_pen"}, { [engine.DamageType.FIRE]=3, [engine.DamageType.COLD]=3, }, "resonating")
+			self:specialSetAdd({"wielder","resists"}, { [engine.DamageType.FIRE]=5, [engine.DamageType.COLD]=5, }, "resonating")
+			self:specialSetAdd({"wielder","psi_regen"}, 1, "resonating")
+			self:specialSetAdd({"wielder","combat_spellresist"}, 3, "resonating")
+			self:specialSetAdd({"wielder","talents_types_mastery"},{ ["psionic/thermal-mastery"] = 0.05 }, "resonating")
 		end,
 	},
 	on_set_broken = function(self, who)
-- 
2.7.4

