Skip to content
Snippets Groups Projects
Commit e5fb0f51 authored by dg's avatar dg
Browse files

Constitution does not grant damage reduction anymore

Health talent replaced with Thick Skin talent, granting damage reduction


git-svn-id: http://svn.net-core.org/repos/t-engine4@4160 51575b47-30f0-44d4-a5cc-537603b46e54
parent 1b35d472
No related branches found
No related tags found
No related merge requests found
...@@ -1689,7 +1689,6 @@ end ...@@ -1689,7 +1689,6 @@ end
function _M:onStatChange(stat, v) function _M:onStatChange(stat, v)
if stat == self.STAT_CON then if stat == self.STAT_CON then
self.max_life = self.max_life + 4 * v self.max_life = self.max_life + 4 * v
self:updateConDamageReduction()
elseif stat == self.STAT_WIL then elseif stat == self.STAT_WIL then
self:incMaxMana(5 * v) self:incMaxMana(5 * v)
self:incMaxStamina(2.5 * v) self:incMaxStamina(2.5 * v)
...@@ -1699,20 +1698,6 @@ function _M:onStatChange(stat, v) ...@@ -1699,20 +1698,6 @@ function _M:onStatChange(stat, v)
end end
end end
function _M:updateConDamageReduction()
self.resists = self.resists or {}
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
if self:knowTalent(self.T_IRON_SKIN) then
inc = inc * (1 + (self:getTalentLevel(self.T_IRON_SKIN) * 0.2))
end
self.temp_con_perc = inc
self.resists.all = self.resists.all + inc
end
--- Called when a temporary value changes (added or deleted) --- Called when a temporary value changes (added or deleted)
-- Takes care to call onStatChange when needed -- Takes care to call onStatChange when needed
-- @param prop the property changing -- @param prop the property changing
......
...@@ -164,7 +164,7 @@ TOOLTIP_DEX = [[#GOLD#Dexterity#LAST# ...@@ -164,7 +164,7 @@ 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. 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# TOOLTIP_CON = [[#GOLD#Constitution#LAST#
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. Constitution defines your character's ability to withstand and resist damage. It increases your maximum life and your chance to save against physical effects.
]] ]]
TOOLTIP_MAG = [[#GOLD#Magic#LAST# TOOLTIP_MAG = [[#GOLD#Magic#LAST#
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. 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.
......
...@@ -272,34 +272,34 @@ newTalent{ ...@@ -272,34 +272,34 @@ newTalent{
require = spells_req2, require = spells_req2,
points = 5, points = 5,
on_learn = function(self, t) on_learn = function(self, t)
self.alchemy_golem:learnTalent(Talents.T_HEALTH, true) self.alchemy_golem:learnTalent(Talents.T_THICK_SKIN, true)
self.alchemy_golem:learnTalent(Talents.T_HEALTH, true) self.alchemy_golem:learnTalent(Talents.T_THICK_SKIN, true)
self.alchemy_golem:learnTalent(Talents.T_ARMOUR_TRAINING, true) self.alchemy_golem:learnTalent(Talents.T_ARMOUR_TRAINING, true)
self.alchemy_golem:learnTalent(Talents.T_ARMOUR_TRAINING, true) self.alchemy_golem:learnTalent(Talents.T_ARMOUR_TRAINING, true)
self.alchemy_golem.healing_factor = (self.alchemy_golem.healing_factor or 1) + 0.1 self.alchemy_golem.healing_factor = (self.alchemy_golem.healing_factor or 1) + 0.1
end, end,
on_unlearn = function(self, t) on_unlearn = function(self, t)
self.alchemy_golem:unlearnTalent(Talents.T_HEALTH, true) self.alchemy_golem:unlearnTalent(Talents.T_THICK_SKIN, true)
self.alchemy_golem:unlearnTalent(Talents.T_HEALTH, true) self.alchemy_golem:unlearnTalent(Talents.T_THICK_SKIN, true)
self.alchemy_golem:unlearnTalent(Talents.T_ARMOUR_TRAINING, true) self.alchemy_golem:unlearnTalent(Talents.T_ARMOUR_TRAINING, true)
self.alchemy_golem:unlearnTalent(Talents.T_ARMOUR_TRAINING, true) self.alchemy_golem:unlearnTalent(Talents.T_ARMOUR_TRAINING, true)
self.alchemy_golem.healing_factor = (self.alchemy_golem.healing_factor or 1) - 0.1 self.alchemy_golem.healing_factor = (self.alchemy_golem.healing_factor or 1) - 0.1
end, end,
info = function(self, t) info = function(self, t)
local rawlev = self:getTalentLevelRaw(t) local rawlev = self:getTalentLevelRaw(t)
local oldh, olda = self.alchemy_golem.talents[Talents.T_HEALTH], self.alchemy_golem.talents[Talents.T_ARMOUR_TRAINING] local oldh, olda = self.alchemy_golem.talents[Talents.T_THICK_SKIN], self.alchemy_golem.talents[Talents.T_ARMOUR_TRAINING]
self.alchemy_golem.talents[Talents.T_HEALTH], self.alchemy_golem.talents[Talents.T_ARMOUR_TRAINING] = rawlev * 2, 4 + rawlev * 2 self.alchemy_golem.talents[Talents.T_THICK_SKIN], self.alchemy_golem.talents[Talents.T_ARMOUR_TRAINING] = rawlev * 2, 4 + rawlev * 2
local th, ta = self:getTalentFromId(Talents.T_HEALTH), self:getTalentFromId(Talents.T_ARMOUR_TRAINING) local th, ta = self:getTalentFromId(Talents.T_THICK_SKIN), self:getTalentFromId(Talents.T_ARMOUR_TRAINING)
local health = th.getHealth(self.alchemy_golem, th) local res = th.getRes(self.alchemy_golem, th)
local heavyarmor = ta.getArmor(self.alchemy_golem, ta) local heavyarmor = ta.getArmor(self.alchemy_golem, ta)
local hardiness = ta.getArmorHardiness(self.alchemy_golem, ta) local hardiness = ta.getArmorHardiness(self.alchemy_golem, ta)
local crit = ta.getCriticalChanceReduction(self.alchemy_golem, ta) local crit = ta.getCriticalChanceReduction(self.alchemy_golem, ta)
self.alchemy_golem.talents[Talents.T_HEALTH], self.alchemy_golem.talents[Talents.T_ARMOUR_TRAINING] = olda, oldh self.alchemy_golem.talents[Talents.T_THICK_SKIN], self.alchemy_golem.talents[Talents.T_ARMOUR_TRAINING] = olda, oldh
return ([[Improves your golem armour training and health. return ([[Improves your golem armour training and damage resistance.
Increases health by %d, increases armour value by %d, reduces chance to be critically hit by %d%% when wearing a heavy mail armour or a massive plate armour, increases armour hardiness by %d%% and increases healing factor by %d%%. Increases all damage resistance by %d%%, increases armour value by %d, reduces chance to be critically hit by %d%% when wearing a heavy mail armour or a massive plate armour, increases armour hardiness by %d%% and increases healing factor by %d%%.
The golem can always use all kind of armours, including massive ones.]]): The golem can always use all kind of armours, including massive ones.]]):
format(health, heavyarmor, crit, hardiness, rawlev * 10) format(res, heavyarmor, crit, hardiness, rawlev * 10)
end, end,
} }
......
...@@ -18,22 +18,22 @@ ...@@ -18,22 +18,22 @@
-- darkgod@te4.org -- darkgod@te4.org
newTalent{ newTalent{
name = "Health", name = "Thick Skin",
type = {"technique/combat-training", 1}, type = {"technique/combat-training", 1},
mode = "passive", mode = "passive",
points = 5, points = 5,
require = { stat = { con=function(level) return 14 + level * 9 end }, }, require = { stat = { con=function(level) return 14 + level * 9 end }, },
getHealth = function(self, t) return 40 * self:getTalentLevelRaw(t) end, getRes = function(self, t) return 3 * self:getTalentLevelRaw(t) end,
on_learn = function(self, t) on_learn = function(self, t)
self.max_life = self.max_life + 40 self.resists.all = (self.resists.all or 0) + 3
end, end,
on_unlearn = function(self, t) on_unlearn = function(self, t)
self.max_life = self.max_life - 40 self.resists.all = (self.resists.all or 0) - 3
end, end,
info = function(self, t) info = function(self, t)
local health = t.getHealth(self, t) local res = t.getRes(self, t)
return ([[Increases your maximum life by %d]]): return ([[Your skin becomes more resilient to damage. Increases resistance to all damage by %d%%]]):
format(health) format(res)
end, end,
} }
......
...@@ -64,10 +64,8 @@ newTalent{ ...@@ -64,10 +64,8 @@ newTalent{
points = 5, points = 5,
getPercent = function (self, t) return self:getTalentLevel(t) * 20 end, getPercent = function (self, t) return self:getTalentLevel(t) * 20 end,
on_learn = function(self, t) on_learn = function(self, t)
self:updateConDamageReduction()
end, end,
on_unlearn = function(self, t) on_unlearn = function(self, t)
self:updateConDamageReduction()
end, end,
info = function(self, t) info = function(self, t)
local percent = t.getPercent(self, t) local percent = t.getPercent(self, t)
......
...@@ -372,9 +372,6 @@ function _M:getStatDescription(stat_id) ...@@ -372,9 +372,6 @@ function _M:getStatDescription(stat_id)
text = text.."#LIGHT_BLUE#Stat gives:#LAST#\n" text = text.."#LIGHT_BLUE#Stat gives:#LAST#\n"
if stat_id == self.actor.STAT_CON then if stat_id == self.actor.STAT_CON then
text = text.."Max life: "..color..(diff * 4).."#LAST#\n" text = text.."Max life: "..color..(diff * 4).."#LAST#\n"
self.actor:updateConDamageReduction()
self.actor_dup:updateConDamageReduction()
text = text.."All resistance: "..color..("%.2f"):format(self.actor.temp_con_perc - self.actor_dup.temp_con_perc).."#LAST#\n"
text = text.."Physical save: "..color..(diff * 0.35).."#LAST#\n" text = text.."Physical save: "..color..(diff * 0.35).."#LAST#\n"
elseif stat_id == self.actor.STAT_WIL then elseif stat_id == self.actor.STAT_WIL then
if self.actor:knowTalent(self.actor.T_MANA_POOL) then if self.actor:knowTalent(self.actor.T_MANA_POOL) then
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment