-- 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 = "Strength of Purpose",
	display_name = "意志之力",
	type = {"chronomancy/temporal-combat", 1},
	require = temporal_req1,
	mode = "sustained",
	points = 5,
	sustain_paradox = 100,
	cooldown = 18,
	tactical = { BUFF = 2 },
	getPower = function(self, t) return math.ceil((self:getTalentLevel(t) * 1.5) + self:combatTalentStatDamage(t, "wil", 5, 20)) end,
	activate = function(self, t)
		game:playSoundNear(self, "talents/arcane")
		return {
			stats = self:addTemporaryValue("inc_stats", {[self.STAT_STR] = t.getPower(self, t)}),
			phys = self:addTemporaryValue("combat_physresist", t.getPower(self, t)),
			particle = self:addParticles(Particles.new("temporal_focus", 1)),
		}
	end,
	deactivate = function(self, t, p)
		self:removeParticles(p.particle)
		self:removeTemporaryValue("inc_stats", p.stats)
		self:removeTemporaryValue("combat_physresist", p.phys)
		return true
	end,
	info = function(self, t)
		local power = t.getPower(self, t)
		return ([[你已经学会通过控制时空的流动来增强力量。增加 %d 点力量和物理抵抗。
		受意志影响，效果按比例加成。]]):format(power)
	end
}

newTalent{
	name = "Invigorate",
	display_name = "时空回复",
	type = {"chronomancy/temporal-combat", 2},
	require = temporal_req2,
	points = 5,
	paradox = 10,
	cooldown = 50,
	tactical = { STAMINA = 2 },
	getPower = function(self, t) return (20 + self:getTalentLevel(t) * 12)/5 end,
	action = function(self, t)
		self:setEffect(self.EFF_INVIGORATE, 5, {power=t.getPower(self, t)})
		return true
	end,
	info = function(self, t)
		local power = t.getPower(self, t)
		return ([[在接下来5回合，每回合回复 %d 点耐力。]]):format(power)
	end,
}

newTalent{
	name = "Quantum Feed",
	display_name = "量子充能",
	type = {"chronomancy/temporal-combat", 3},
	require = temporal_req3,
	mode = "sustained",
	points = 5,
	sustain_paradox = 100,
	cooldown = 18,
	tactical = { BUFF = 2 },
	getPower = function(self, t) return math.ceil((self:getTalentLevel(t) * 1.5) + self:combatTalentStatDamage(t, "wil", 5, 20)) end,
	activate = function(self, t)
		game:playSoundNear(self, "talents/arcane")
		return {
			stats = self:addTemporaryValue("inc_stats", {[self.STAT_MAG] = t.getPower(self, t)}),
			spell = self:addTemporaryValue("combat_spellresist", t.getPower(self, t)),
			particle = self:addParticles(Particles.new("arcane_power", 1)),
		}
	end,
	deactivate = function(self, t, p)
		self:removeTemporaryValue("inc_stats", p.stats)
		self:removeTemporaryValue("combat_spellresist", p.spell)
		self:removeParticles(p.particle)
		return true
	end,
	info = function(self, t)
		local power = t.getPower(self, t)
		return ([[你已经学会通过控制时空的流动来增强力量。增加 %d点魔法和法术抵抗。
		受意志影响，效果按比例加成。]]):format(power)
	end
}

newTalent{
	name = "Damage Smearing",
	display_name = "时空转化",
	type = {"chronomancy/temporal-combat",4},
	require = temporal_req4,
	points = 5,
	paradox = 25,
	cooldown = 25,
	tactical = { DEFEND = 2 },
	getDuration = function(self, t) return 2 + math.ceil(self:getTalentLevel(t) * getParadoxModifier(self, pm)) end,
	action = function(self, t)
		self:setEffect(self.EFF_DAMAGE_SMEARING, t.getDuration(self,t), {power=10})
		game:playSoundNear(self, "talents/spell_generic")
		return true
	end,
	info = function(self, t)
		local duration = t.getDuration(self, t)
		return ([[在接下来 %d 回合内，你转化所有受到的非时空伤害为持续6回合的时空伤害。
		受紊乱值影响，持续时间按比例加成。]]):format (duration)
	end,
}
