From 8fed92df09d0c8fc8b98e38a7e4c268a102bf701 Mon Sep 17 00:00:00 2001
From: Bunny <glisa825@gmail.com>
Date: Fri, 17 May 2019 22:54:15 -0400
Subject: [PATCH] Buffed Resilience and made it more straightforward

---
 .../talents/gifts/summon-augmentation.lua     |  5 +-
 .../data/talents/gifts/summon-distance.lua    | 49 ++++++++++++++++---
 .../tome/data/talents/gifts/summon-melee.lua  | 44 ++++++++++++++---
 .../data/talents/gifts/summon-utility.lua     | 24 +++++++--
 4 files changed, 99 insertions(+), 23 deletions(-)

diff --git a/game/modules/tome/data/talents/gifts/summon-augmentation.lua b/game/modules/tome/data/talents/gifts/summon-augmentation.lua
index 20917ef569..3cc4a80967 100644
--- a/game/modules/tome/data/talents/gifts/summon-augmentation.lua
+++ b/game/modules/tome/data/talents/gifts/summon-augmentation.lua
@@ -119,9 +119,10 @@ newTalent{
 	require = gifts_req3,
 	mode = "passive",
 	points = 5,
-	incCon = function(self, t) return math.floor(self:combatTalentScale(t, 2, 10, 0.75)) end,
+	incLife = function(self, t) return self:combatTalentLimit(t, 1, 0.05, 0.20) end,
+	incDur = function(self, t) return math.floor(self:combatTalentLimit(t, 6, 1, 2.8)) end,
 	info = function(self, t)
-		return ([[Improves all your summons' Constitution by %d, and adds %0.1f effective talent levels to your summon talents to determine your summons' lifetime.]]):format(t.incCon(self, t), self:getTalentLevel(t))
+		return ([[Increases all your summons' max life by %0.1f%% and extends your summons' maximum lifetime by %d turns.]]):format(100*t.incLife(self, t), t.incDur(self,t))
 	end,
 }
 
diff --git a/game/modules/tome/data/talents/gifts/summon-distance.lua b/game/modules/tome/data/talents/gifts/summon-distance.lua
index 4399167e20..a3271487a2 100644
--- a/game/modules/tome/data/talents/gifts/summon-distance.lua
+++ b/game/modules/tome/data/talents/gifts/summon-distance.lua
@@ -419,10 +419,10 @@ newTalent{
 		return{ 
 			wil=15 + (fake and mp or self:mindCrit(mp)) * 2 * self:combatTalentScale(t, 0.2, 1, 0.75),
 			cun=15 + (fake and mp or self:mindCrit(mp)) * 1.7 * self:combatTalentScale(t, 0.2, 1, 0.75),
-			con=10 + self:callTalent(self.T_RESILIENCE, "incCon")
+			con=10
 		}
 	end,
-	summonTime = function(self, t) return math.floor(self:combatScale(self:getTalentLevel(t) + self:getTalentLevel(self.T_RESILIENCE), 5, 0, 10, 5)) end,
+	summonTime = function(self, t) return math.floor(self:combatScale(self:getTalentLevel(t), 5, 0, 10, 5)) + self:callTalent(self.T_RESILIENCE, "incDur") end,
 	action = function(self, t)
 		local tg = {type="bolt", nowarning=true, range=self:getTalentRange(t), nolock=true, talent=t}
 		local tx, ty, target = self:getTarget(tg)
@@ -474,6 +474,13 @@ newTalent{
 			m[#m] = resolvers.talents{ [self.T_WILD_RITCH_FLAMESPITTER_BOLT]=self:getTalentLevelRaw(t) }
 		end
 		setupSummon(self, m, x, y)
+		
+		if self:knowTalent(self.T_RESILIENCE) then
+			local incLife = self:callTalent(self.T_RESILIENCE, "incLife") + 1
+			m.max_life = m.max_life * incLife
+			m.life = m.max_life
+		end
+		
 		game:playSoundNear(self, "talents/spell_generic")
 		return true
 	end,
@@ -525,13 +532,13 @@ newTalent{
 			nil, false, false
 		)
 	end,
-	summonTime = function(self, t) return math.floor(self:combatScale(self:getTalentLevel(t) + self:getTalentLevel(self.T_RESILIENCE), 5, 0, 10, 5)) end,
+	summonTime = function(self, t) return math.floor(self:combatScale(self:getTalentLevel(t), 5, 0, 10, 5)) + self:callTalent(self.T_RESILIENCE, "incDur") end,
 	incStats = function(self, t,fake)
 		local mp = self:combatMindpower()
 		return{ 
 			wil=15 + (fake and mp or self:mindCrit(mp)) * 1.6 * self:combatTalentScale(t, 0.2, 1, 0.75),
 			str = 18,
-			con=10 + self:combatTalentScale(t, 2, 10, 0.75) + self:callTalent(self.T_RESILIENCE, "incCon")
+			con=10 + self:combatTalentScale(t, 2, 10, 0.75)
 		}
 	end,
 	action = function(self, t)
@@ -588,6 +595,13 @@ newTalent{
 			m[#m+1] = resolvers.talents{ [self.T_POISON_SPIT_HYDRA]=self:getTalentLevelRaw(t) }
 		end
 		setupSummon(self, m, x, y)
+		
+		if self:knowTalent(self.T_RESILIENCE) then
+			local incLife = self:callTalent(self.T_RESILIENCE, "incLife") + 1
+			m.max_life = m.max_life * incLife
+			m.life = m.max_life
+		end
+		
 		game:playSoundNear(self, "talents/spell_generic")
 		return true
 	end,
@@ -634,13 +648,13 @@ newTalent{
   		self:project(tg, m.x, m.y, DamageType.TEMP_EFFECT, {foes=true, eff=self.EFF_LOWER_COLD_RESIST, dur=duration, p={power=reduction}}, {type="flame"})
 		self:project(tg, m.x, m.y, DamageType.TEMP_EFFECT, {foes=true, eff=self.EFF_LOWER_COLD_RESIST, dur=duration, p={power=self:combatTalentMindDamage(t, 15, 70)}}, {type="flame"})
 	end,
-	summonTime = function(self, t) return math.floor(self:combatScale(self:getTalentLevel(t) + self:getTalentLevel(self.T_RESILIENCE), 5, 0, 10, 5)) end,
+	summonTime = function(self, t) return math.floor(self:combatScale(self:getTalentLevel(t), 5, 0, 10, 5)) + self:callTalent(self.T_RESILIENCE, "incDur") end,
 	incStats = function(self, t,fake)
 		local mp = self:combatMindpower()
 		return{ 
 			wil=15 + (fake and mp or self:mindCrit(mp)) * 2 * self:combatTalentScale(t, 0.2, 1, 0.75),
 			cun=15 + (fake and mp or self:mindCrit(mp)) * 1.6 * self:combatTalentScale(t, 0.2, 1, 0.75),
-			con=10 + self:callTalent(self.T_RESILIENCE, "incCon")
+			con=10
 		}
 	end,
 	action = function(self, t)
@@ -696,6 +710,13 @@ newTalent{
 			m[#m] = resolvers.talents{ [self.T_WILD_WINTER_S_FURY]=self:getTalentLevelRaw(t) }
 		end
 		setupSummon(self, m, x, y)
+		
+		if self:knowTalent(self.T_RESILIENCE) then
+			local incLife = self:callTalent(self.T_RESILIENCE, "incLife") + 1
+			m.max_life = m.max_life * incLife
+			m.life = m.max_life
+		end
+		
 		game:playSoundNear(self, "talents/spell_generic")
 		return true
 	end,
@@ -778,15 +799,21 @@ newTalent{
 				ai_target = {actor=m.ai_target.actor}
 			}
 			setupSummon(self, mh, x, y)
+			
+			if self:knowTalent(self.T_RESILIENCE) then
+				local incLife = self:callTalent(self.T_RESILIENCE, "incLife") + 1
+				m.max_life = m.max_life * incLife
+				m.life = m.max_life
+			end
 		end
 	end,
-	summonTime = function(self, t) return math.floor(self:combatScale(self:getTalentLevel(t) + self:getTalentLevel(self.T_RESILIENCE), 2, 0, 7, 5)) end,
+	summonTime = function(self, t) return math.floor(self:combatScale(self:getTalentLevel(t), 2, 0, 7, 5)) + self:callTalent(self.T_RESILIENCE, "incDur") end,
 	incStats = function(self, t,fake)
 		local mp = self:combatMindpower()
 		return{ 
 			str=15 + (fake and mp or self:mindCrit(mp)) * 2 * self:combatTalentScale(t, 0.2, 1, 0.75),
 			wil = 38,
-			con=20 + (fake and mp or self:mindCrit(mp)) * 1.5 * self:combatTalentScale(t, 0.2, 1, 0.75) + self:callTalent(self.T_RESILIENCE, "incCon"),
+			con=20 + (fake and mp or self:mindCrit(mp)) * 1.5 * self:combatTalentScale(t, 0.2, 1, 0.75)
 		}
 	end,
 	action = function(self, t)
@@ -843,6 +870,12 @@ newTalent{
 			m[#m+1] = resolvers.talents{ [self.T_AURA_OF_SILENCE]=self:getTalentLevelRaw(t) }
 		end
 		setupSummon(self, m, x, y)
+		
+		if self:knowTalent(self.T_RESILIENCE) then
+			local incLife = self:callTalent(self.T_RESILIENCE, "incLife") + 1
+			m.max_life = m.max_life * incLife
+			m.life = m.max_life
+		end
 
 		game:playSoundNear(self, "talents/spell_generic")
 		return true
diff --git a/game/modules/tome/data/talents/gifts/summon-melee.lua b/game/modules/tome/data/talents/gifts/summon-melee.lua
index 521997d37a..f52297cdc0 100644
--- a/game/modules/tome/data/talents/gifts/summon-melee.lua
+++ b/game/modules/tome/data/talents/gifts/summon-melee.lua
@@ -106,13 +106,13 @@ newTalent{
 		self:project(tg, m.x, m.y, DamageType.TEMP_EFFECT, {foes=true, eff=self.EFF_LOWER_PHYSICAL_RESIST, dur=duration, p={power=reduction}})
 		game.level.map:particleEmitter(m.x, m.y, tg.radius, "shout", {size=4, distorion_factor=0.3, radius=tg.radius, life=30, nb_circles=8, rm=0.8, rM=1, gm=0.8, gM=1, bm=0.1, bM=0.2, am=0.6, aM=0.8})
 	end,
-	summonTime = function(self, t) return math.floor(self:combatScale(self:getTalentLevel(t) + self:getTalentLevel(self.T_RESILIENCE), 5, 0, 10, 5)) end,
+	summonTime = function(self, t) return math.floor(self:combatScale(self:getTalentLevel(t), 5, 0, 10, 5)) + self:callTalent(self.T_RESILIENCE, "incDur") end,
 	incStats = function(self, t,fake)
 		local mp = self:combatMindpower()
 		return{ 
 			str=15 + (fake and mp or self:mindCrit(mp)) * 2 * self:combatTalentScale(t, 0.2, 1, 0.75) + self:combatTalentScale(t, 2, 10, 0.75),
 			dex=15 + (fake and mp or self:mindCrit(mp)) * 1 * self:combatTalentScale(t, 0.2, 1, 0.75) + self:combatTalentScale(t, 2, 10, 0.75),
-			con=15 + self:callTalent(self.T_RESILIENCE, "incCon")
+			con=15 
 		}
 	end,
 	action = function(self, t)
@@ -160,6 +160,13 @@ newTalent{
 			m[#m+1] = resolvers.talents{ [self.T_TOTAL_THUGGERY]=self:getTalentLevelRaw(t) }
 		end
 		setupSummon(self, m, x, y)
+		
+		if self:knowTalent(self.T_RESILIENCE) then
+			local incLife = self:callTalent(self.T_RESILIENCE, "incLife") + 1
+			m.max_life = m.max_life * incLife
+			m.life = m.max_life
+		end
+		
 		game:playSoundNear(self, "talents/spell_generic")
 		return true
 	end,
@@ -205,11 +212,11 @@ newTalent{
 		local reduction = self:callTalent(self.T_GRAND_ARRIVAL,"resReduction")
 		self:project(tg, m.x, m.y, DamageType.TEMP_EFFECT, {foes=true, eff=self.EFF_LOWER_NATURE_RESIST, dur=duration, p={power=reduction}}, {type="flame"})
 	end,
-	summonTime = function(self, t) return math.floor(self:combatScale(self:getTalentLevel(t) + self:getTalentLevel(self.T_RESILIENCE), 5, 0, 10, 5)) end,
+	summonTime = function(self, t) return math.floor(self:combatScale(self:getTalentLevel(t), 5, 0, 10, 5)) + self:callTalent(self.T_RESILIENCE, "incDur") end,
 	incStats = function(self, t, fake)
 		local mp = self:combatMindpower()
 		return{ 
-			con=10 + (fake and mp or self:mindCrit(mp)) * 1.8 * self:combatTalentScale(t, 0.2, 1, 0.75) + self:combatTalentScale(self:getTalentLevel(self.T_RESILIENCE), 3, 15, 0.75),
+			con=10 + (fake and mp or self:mindCrit(mp)) * 1.6 * self:combatTalentScale(t, 0.2, 1, 0.75),
 			str=10 + self:combatTalentScale(t, 2, 10, 0.75)
 		}
 	end,
@@ -271,6 +278,13 @@ newTalent{
 			m[#m+1] = resolvers.talents{ [self.T_JELLY_MITOTIC_SPLIT]=self:getTalentLevelRaw(t) }
 		end
 		setupSummon(self, m, x, y)
+		
+		if self:knowTalent(self.T_RESILIENCE) then
+			local incLife = self:callTalent(self.T_RESILIENCE, "incLife") + 1
+			m.max_life = m.max_life * incLife
+			m.life = m.max_life
+		end
+		
 		game:playSoundNear(self, "talents/spell_generic")
 		return true
 	end,
@@ -316,13 +330,13 @@ newTalent{
 		local slowdown = self:callTalent(self.T_GRAND_ARRIVAL,"slowStrength") / 100 --divide by 100 to change percent to decimal
 		self:project(tg, m.x, m.y, DamageType.TEMP_EFFECT, {foes=true, eff=self.EFF_SLOW_MOVE, dur=duration, p={power=slowdown}}, {type="flame"})
 	end,
-	summonTime = function(self, t) return math.floor(self:combatScale(self:getTalentLevel(t) + self:getTalentLevel(self.T_RESILIENCE), 2, 0, 7, 5)) end,
+	summonTime = function(self, t) return math.floor(self:combatScale(self:getTalentLevel(t), 2, 0, 7, 5)) + self:callTalent(self.T_RESILIENCE, "incDur") end,
 	incStats = function(self, t,fake)
 		local mp = self:combatMindpower()
 		return{ 
 			str=25 + (fake and mp or self:mindCrit(mp)) * 2.1 * self:combatTalentScale(t, 0.2, 1, 0.75) + self:combatTalentScale(t, 2, 10, 0.75),
 			dex=10 + (fake and mp or self:mindCrit(mp)) * 1.8 * self:combatTalentScale(t, 0.2, 1, 0.75) + self:combatTalentScale(t, 2, 10, 0.75),
-			con=10 + self:combatTalentScale(t, 2, 10, 0.75) + self:callTalent(self.T_RESILIENCE, "incCon"),
+			con=10 + self:combatTalentScale(t, 2, 10, 0.75)
 		}
 	end,
 	action = function(self, t)
@@ -377,6 +391,13 @@ newTalent{
 			m[#m+1] = resolvers.talents{ [self.T_RUSH]=self:getTalentLevelRaw(t) }
 		end
 		setupSummon(self, m, x, y)
+		
+		if self:knowTalent(self.T_RESILIENCE) then
+			local incLife = self:callTalent(self.T_RESILIENCE, "incLife") + 1
+			m.max_life = m.max_life * incLife
+			m.life = m.max_life
+		end
+		
 		game:playSoundNear(self, "talents/spell_generic")
 		return true
 	end,
@@ -421,13 +442,13 @@ newTalent{
 		self:project(tg, m.x, m.y, DamageType.TEMP_EFFECT, {foes=true, eff=self.EFF_DAZED, check_immune="stun", dur=duration, p={}}, {type="flame"})
 	end,
 	requires_target = true,
-	summonTime = function(self, t) return math.floor(self:combatScale(self:getTalentLevel(t) + self:getTalentLevel(self.T_RESILIENCE), 5, 0, 10, 5)) end,
+	summonTime = function(self, t) return math.floor(self:combatScale(self:getTalentLevel(t), 5, 0, 10, 5)) + self:callTalent(self.T_RESILIENCE, "incDur") end,
 	incStats = function(self, t,fake)
 		local mp = self:combatMindpower()
 		return{ 
 			str=15 + (fake and mp or self:mindCrit(mp)) * 2 * self:combatTalentScale(t, 0.2, 1, 0.75) + self:combatTalentScale(t, 2, 10, 0.75),
 			dex=15 + (fake and mp or self:mindCrit(mp)) * 1.9 * self:combatTalentScale(t, 0.2, 1, 0.75) + self:combatTalentScale(t, 2, 10, 0.75),
-			con=10 + self:combatTalentScale(t, 2, 10, 0.75) + self:callTalent(self.T_RESILIENCE, "incCon"),
+			con=10 + self:combatTalentScale(t, 2, 10, 0.75)
 		}
 	end,
 	action = function(self, t)
@@ -484,6 +505,13 @@ newTalent{
 			m[#m+1] = resolvers.talents{ [self.T_SHATTERING_IMPACT]=self:getTalentLevelRaw(t) }
 		end
 		setupSummon(self, m, x, y)
+		
+		if self:knowTalent(self.T_RESILIENCE) then
+			local incLife = self:callTalent(self.T_RESILIENCE, "incLife") + 1
+			m.max_life = m.max_life * incLife
+			m.life = m.max_life
+		end
+		
 		game:playSoundNear(self, "talents/spell_generic")
 		return true
 	end,
diff --git a/game/modules/tome/data/talents/gifts/summon-utility.lua b/game/modules/tome/data/talents/gifts/summon-utility.lua
index e958ace582..4dba107ff6 100644
--- a/game/modules/tome/data/talents/gifts/summon-utility.lua
+++ b/game/modules/tome/data/talents/gifts/summon-utility.lua
@@ -116,13 +116,13 @@ newTalent{
 			target:setEffect(target.EFF_SHELL_SHIELD, 4, {power=self:mindCrit(self:combatTalentMindDamage(t, 10, 35))})
 		end, nil, {type="flame"})
 	end,
-	summonTime = function(self, t) return math.floor(self:combatScale(self:getTalentLevel(t) + self:getTalentLevel(self.T_RESILIENCE), 5, 0, 10, 5)) end,
+	summonTime = function(self, t) return math.floor(self:combatScale(self:getTalentLevel(t), 5, 0, 10, 5)) + self:callTalent(self.T_RESILIENCE, "incDur") end,
 	incStats = function(self, t,fake)
 		local mp = self:combatMindpower()
 		return{ 
-			con=15 + (fake and mp or self:mindCrit(mp)) * 2.1 * self:combatTalentScale(t, 0.2, 1, 0.75) + self:callTalent(self.T_RESILIENCE, "incCon"),
+			con=15 + (fake and mp or self:mindCrit(mp)) * 2.1 * self:combatTalentScale(t, 0.2, 1, 0.75),
 			wil = 18,
-			dex=10 + self:combatTalentScale(t, 2, 10, 0.75),
+			dex=10 + self:combatTalentScale(t, 2, 10, 0.75)
 		}
 	end,
 	on_arrival = function(self, t, m)
@@ -191,6 +191,13 @@ newTalent{
 			m[#m+1] = resolvers.talents{ [self.T_BATTLE_CALL]=self:getTalentLevelRaw(t) }
 		end
 		setupSummon(self, m, x, y)
+		
+		if self:knowTalent(self.T_RESILIENCE) then
+			local incLife = self:callTalent(self.T_RESILIENCE, "incLife") + 1
+			m.max_life = m.max_life * incLife
+			m.life = m.max_life
+		end
+			
 		game:playSoundNear(self, "talents/spell_generic")
 		return true
 	end,
@@ -241,14 +248,14 @@ newTalent{
 		local knockback = self:callTalent(self.T_GRAND_ARRIVAL,"knockbackDist")
 		self:project(tg, m.x, m.y, DamageType.FEARKNOCKBACK, {dist=knockback, x=m.x, y=m.y}, {type="acid"})
 	end,
-	summonTime = function(self, t) return math.floor(self:combatScale(self:getTalentLevel(t) + self:getTalentLevel(self.T_RESILIENCE), 5, 0, 10, 5)) end,
+	summonTime = function(self, t) return math.floor(self:combatScale(self:getTalentLevel(t), 5, 0, 10, 5)) + self:callTalent(self.T_RESILIENCE, "incDur") end,
 	incStats = function(self, t,fake)
 		local mp = self:combatMindpower()
 		return{ 
 			dex=15 + (fake and mp or self:mindCrit(mp)) * 2 * self:combatTalentScale(t, 0.2, 1, 0.75),
 			wil = 18,
 			str=10 + self:combatTalentScale(t, 2, 10, 0.75),
-			con=10 + self:callTalent(self.T_RESILIENCE, "incCon")
+			con=10
 		}
 	end,
 	action = function(self, t)
@@ -302,6 +309,13 @@ newTalent{
 			m[#m+1] = resolvers.inscription("INFUSION:_INSIDIOUS_POISON", {cooldown=12, range=6, heal_factor=60, power=self:getTalentLevel(t) * 60})
 		end
 		setupSummon(self, m, x, y)
+		
+		if self:knowTalent(self.T_RESILIENCE) then
+			local incLife = self:callTalent(self.T_RESILIENCE, "incLife") + 1
+			m.max_life = m.max_life * incLife
+			m.life = m.max_life
+		end
+		
 		game:playSoundNear(self, "talents/spell_generic")
 		return true
 	end,
-- 
GitLab