From 6872c25b94388f7271ef91d548649ed2886fd1d4 Mon Sep 17 00:00:00 2001
From: dg <dg@51575b47-30f0-44d4-a5cc-537603b46e54>
Date: Sun, 16 Jan 2011 16:55:15 +0000
Subject: [PATCH] Improve the effect of stats on physical/magical/mental saves
 (and denote them correctly on tooltips) Constitution bonus to life reduced a
 bit but it now also provides global damage reduction%

git-svn-id: http://svn.net-core.org/repos/t-engine4@2394 51575b47-30f0-44d4-a5cc-537603b46e54
---
 game/modules/tome/class/Actor.lua             | 21 +++++++++----------
 game/modules/tome/class/interface/Combat.lua  |  6 +++---
 .../tome/class/interface/TooltipsData.lua     | 10 ++++-----
 3 files changed, 18 insertions(+), 19 deletions(-)

diff --git a/game/modules/tome/class/Actor.lua b/game/modules/tome/class/Actor.lua
index 13a65d2306..c4ee68bdfc 100644
--- a/game/modules/tome/class/Actor.lua
+++ b/game/modules/tome/class/Actor.lua
@@ -1206,7 +1206,6 @@ function _M:levelup()
 		local amount = math.min(self.hate_rating, self.absolute_max_hate - self.max_hate)
 		self:incMaxHate(amount)
 	end
-	self:updateLife()
 
 	-- Heal up on new level
 	self:resetToFull()
@@ -1257,7 +1256,8 @@ end
 --- Notifies a change of stat value
 function _M:onStatChange(stat, v)
 	if stat == self.STAT_CON then
-		self.max_life = self.max_life + 5 * v
+		self.max_life = self.max_life + 4 * v
+		self:updateConDamageReduction()
 	elseif stat == self.STAT_WIL then
 		self:incMaxMana(5 * v)
 		self:incMaxStamina(2 * v)
@@ -1265,17 +1265,16 @@ function _M:onStatChange(stat, v)
 	elseif stat == self.STAT_STR then
 		self:checkEncumbrance()
 	end
-
-	self:updateLife()
 end
 
-function _M:updateLife()
---	if self.temp_life_perc then
---		self.max_life = self.max_life - self.temp_life_perc
---	end
---	local inc = self.max_life * 0.25
---	self.temp_life_perc = inc
---	self.max_life = self.max_life + inc
+function _M:updateConDamageReduction()
+	self.resists.all = self.resists.all or 0
+	if self.temp_con_perc then
+		self.resists.all = self.resists.all - self.temp_con_perc
+	end
+	local inc = self:getCon() / 7
+	self.temp_con_perc = inc
+	self.resists.all = self.resists.all + inc
 end
 
 --- Called when a temporary value changes (added or deleted)
diff --git a/game/modules/tome/class/interface/Combat.lua b/game/modules/tome/class/interface/Combat.lua
index 6c3024755a..179fa65c29 100644
--- a/game/modules/tome/class/interface/Combat.lua
+++ b/game/modules/tome/class/interface/Combat.lua
@@ -649,17 +649,17 @@ end
 
 --- Computes physical resistance
 function _M:combatPhysicalResist()
-	return self.combat_physresist + (self:getCon() + self:getStr() + (self:getLck() - 50) * 0.5) * 0.25
+	return self.combat_physresist + (self:getCon() + self:getStr() + (self:getLck() - 50) * 0.5) * 0.35
 end
 
 --- Computes spell resistance
 function _M:combatSpellResist()
-	return self.combat_spellresist + (self:getMag() + self:getWil() + (self:getLck() - 50) * 0.5) * 0.25
+	return self.combat_spellresist + (self:getMag() + self:getWil() + (self:getLck() - 50) * 0.5) * 0.35
 end
 
 --- Computes mental resistance
 function _M:combatMentalResist()
-	return self.combat_mentalresist + (self:getCun() + self:getWil() + (self:getLck() - 50) * 0.5) * 0.25
+	return self.combat_mentalresist + (self:getCun() + self:getWil() + (self:getLck() - 50) * 0.5) * 0.35
 end
 
 --- Computes movement speed
diff --git a/game/modules/tome/class/interface/TooltipsData.lua b/game/modules/tome/class/interface/TooltipsData.lua
index f86f02dc84..3800ac26a7 100644
--- a/game/modules/tome/class/interface/TooltipsData.lua
+++ b/game/modules/tome/class/interface/TooltipsData.lua
@@ -109,22 +109,22 @@ Those inscriptions give the bearer always accessible powers. Usually most people
 -- Stats
 -------------------------------------------------------------
 TOOLTIP_STR = [[#GOLD#Strength#LAST#
-Strength defines your character's ability to apply physical force. It increases your melee damage, damage done with heavy weapons, your chance to hit, your chance to resist physical effects, and carrying capacity.
+Strength defines your character's ability to apply physical force. It increases your melee damage, damage done with heavy weapons, your chance to hit, your chance to save against physical effects, and carrying capacity.
 ]]
 TOOLTIP_DEX = [[#GOLD#Dexterity#LAST#
 Dexterity defines your character's ability to be agile and alert. It increases your chance to hit, your ability to avoid attacks, and your damage with light weapons.
 ]]
 TOOLTIP_CON = [[#GOLD#Constitution#LAST#
-Constitution defines your character's ability to withstand and resist damage. It increases your maximum life and physical resistance.
+Constitution defines your character's ability to withstand and resist damage. It increases your maximum life, your chance to save against physical effects and your global damage reduction.
 ]]
 TOOLTIP_MAG = [[#GOLD#Magic#LAST#
-Magic defines your character's ability to manipulate the magical energy of the world. It increases your spell power, and the effect of spells and other magic items.
+Magic defines your character's ability to manipulate the magical energy of the world. It increases your spell power, your chance to save against magical effects, and the effect of spells and other magic items.
 ]]
 TOOLTIP_WIL = [[#GOLD#Willpower#LAST#
-Willpower defines your character's ability to concentrate. It increases your mana and stamina capacity, and your chance to resist mental attacks.
+Willpower defines your character's ability to concentrate. It increases your mana and stamina capacity, and your chance to your chance to save against magical and mental effects.
 ]]
 TOOLTIP_CUN = [[#GOLD#Cunning#LAST#
-Cunning defines your character's ability to learn, think, and react. It allows you to learn many worldly abilities, and increases your mental resistance and critical chance.
+Cunning defines your character's ability to learn, think, and react. It allows you to learn many worldly abilities, and increases your chance to save against mental effects and critical chance.
 ]]
 TOOLTIP_STRDEXCON = "#AQUAMARINE#Physical stats#LAST#\n---\n"..TOOLTIP_STR.."\n---\n"..TOOLTIP_DEX.."\n---\n"..TOOLTIP_CON
 TOOLTIP_MAGWILCUN = "#AQUAMARINE#Mental stats#LAST#\n---\n"..TOOLTIP_MAG.."\n---\n"..TOOLTIP_WIL.."\n---\n"..TOOLTIP_CUN
-- 
GitLab