-- ToME - Tales of Maj'Eyal
-- Copyright (C) 2009, 2010, 2011 Nicolas Casalini
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program.  If not, see <http://www.gnu.org/licenses/>.
--
-- Nicolas Casalini "DarkGod"
-- darkgod@te4.org

newTalent{
	name = "Corrupted Strength",
	display_name = "堕落力量",
	type = {"corruption/reaving-combat", 1},
	mode = "passive",
	points = 5,
	require = str_corrs_req1,
	on_learn = function(self, t)
		self:attr("allow_any_dual_weapons", 1)
	end,
	on_unlearn = function(self, t)
		if not self:knowTalent(t) then
			self:attr("allow_any_dual_weapons", -1)
		end
	end,
	info = function(self, t)
		return ([[允许你双持单手武器并增加 %d%% 副手武器伤害。]]):format(100 / (2 - self:getTalentLevel(t) / 9))
	end,
}

newTalent{
	name = "Bloodlust",
	display_name = "嗜血杀戮",
	type = {"corruption/reaving-combat", 2},
	mode = "passive",
	require = str_corrs_req2,
	points = 5,
	info = function(self, t)
		return ([[当你对敌人造成伤害时，你进入嗜血状态，每个目标增加1点法术强度，每回合最大增加 %d 点。
		最多增加 %d 点法术强度。
		每回合减少1点额外法术强度。]]):
		format(math.floor(self:getTalentLevel(t)), math.floor(6 * self:getTalentLevel(t)))
	end,
}

newTalent{
	name = "Carrier",
	display_name = "携带者",
	type = {"corruption/reaving-combat", 3},
	mode = "passive",
	require = str_corrs_req3,
	points = 5,
	on_learn = function(self, t)
		self:attr("disease_immune", 0.2)
	end,
	on_unlearn = function(self, t)
		self:attr("disease_immune", -0.2)
	end,
	info = function(self, t)
		return ([[你增加 %d%% 疾病抵抗并有 %d%% 概率在近战时散播你目标身上现有的疾病。]]):
		format(20 * self:getTalentLevelRaw(t), 4 * self:getTalentLevelRaw(t))
	end,
}

newTalent{
	name = "Acid Blood",
	display_name = "酸性血液",
	type = {"corruption/reaving-combat", 4},
	mode = "passive",
	require = str_corrs_req4,
	points = 5,
	do_splash = function(self, t, target)
		local dam = self:combatTalentSpellDamage(t, 5, 30)
		local atk = self:combatTalentSpellDamage(t, 15, 35)
		local armor = self:combatTalentSpellDamage(t, 15, 40)
		if self:getTalentLevel(t) >= 3 then
			target:setEffect(target.EFF_ACID_SPLASH, 5, {src=self, dam=dam, atk=atk, armor=armor})
		else
			target:setEffect(target.EFF_ACID_SPLASH, 5, {src=self, dam=dam, atk=atk})
		end
	end,
	info = function(self, t)
		return ([[你的血液变成酸性混合物。当你受伤害时，攻击者会受到酸性溅射。
		每回合造成 %0.2f 酸性伤害，持续5回合。同时减少攻击者 %d 点命中。
		在等级3时，酸性溅射会减少目标 %d 点护甲，持续5回合。
		受魔法影响，伤害有额外加成。]]):
		format(damDesc(self, DamageType.ACID, self:combatTalentSpellDamage(t, 5, 30)), self:combatTalentSpellDamage(t, 15, 35), self:combatTalentSpellDamage(t, 15, 40))
	end,
}
