-- 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

newBirthDescriptor{
	type = "class",
	name = "Mage",
	display_name= "法师系",
	desc = {
		"    法师们用魔法来武装他们自己， 能够释放破坏性的法术同时也能利 用冥想来治疗他们的伤害。",
	},
	descriptor_choices =
	{
		subclass =
		{
			__ALL__ = "disallow",
			Alchemist = "allow",
			Archmage = "allow-nochange",
			Necromancer = "allow-nochange",
		},
	},
	copy = {
		mana_regen = 0.5,
		mana_rating = 7,
		resolvers.inscription("RUNE:_MANASURGE", {cooldown=25, dur=10, mana=620}),
	},
}

newBirthDescriptor{
	type = "subclass",
	name = "Alchemist",
	display_name= "炼金术士",
	desc = {
		"    炼金术士使用魔法来操纵物质。",
		"    他们不使用那些陈旧的被禁止 的法术，那些法术自从魔法大爆炸 之后就被封印。",
		"    炼金术士可以将元素力量输入 进各种宝石，使它们变成火球、酸 流和其他效果。另外他们也可以利 用宝石来强化装甲并使用法杖发射 能量球。",
		"    炼金术士自身防御非常弱，通 过召唤魔法傀儡来保护他们。傀儡 服从主人的意志并依靠主人来强化 他们的力量。",
		"他们最重要的属性是：魔法和敏捷。",
		"#GOLD#属性修正：",
		"#LIGHT_BLUE# * +0 力量，+3 敏捷，+0 体质",
		"#LIGHT_BLUE# * +5 魔法，+1 意志，+0 灵巧",
	},
	stats = { mag=5, dex=3, wil=1, },
	talents_types = {
		["spell/explosives"]={true, 0.3},
		["spell/infusion"]={true, 0.3},
		["spell/golemancy"]={true, 0.3},
		["spell/advanced-golemancy"]={false, 0.3},
		["spell/stone-alchemy"]={true, 0.3},
		["spell/fire-alchemy"]={false, 0.3},
		["spell/staff-combat"]={true, 0.3},
		["cunning/survival"]={false, -0.1},
		["technique/combat-training"]={false, 0},
	},
	talents = {
		[ActorTalents.T_CREATE_ALCHEMIST_GEMS] = 1,
		[ActorTalents.T_REFIT_GOLEM] = 1,
		[ActorTalents.T_THROW_BOMB] = 1,
		[ActorTalents.T_FIRE_INFUSION] = 1,
		[ActorTalents.T_CHANNEL_STAFF] = 1,
	},
	copy = {
		max_life = 90,
		resolvers.equip{ id=true,
			{type="weapon", subtype="staff", name="榆木法杖", autoreq=true, ego_chance=-1000},
			{type="armor", subtype="cloth", name="亚麻长袍", autoreq=true, ego_chance=-1000}
		},
		resolvers.inventory{ id=true,
			{type="gem",},
			{type="gem",},
			{type="gem",},
		},
		resolvers.generic(function(self) self:birth_create_alchemist_golem() end),
		birth_create_alchemist_golem = function(self)
			-- Make and wield some alchemist gems
			local t = self:getTalentFromId(self.T_CREATE_ALCHEMIST_GEMS)
			local gem = t.make_gem(self, t, "GEM_AGATE")
			self:wearObject(gem, true, true)
			self:sortInven()

			-- Invoke the golem
			if not self.alchemy_golem then
				local t = self:getTalentFromId(self.T_REFIT_GOLEM)
				t.action(self, t)
			end
		end,
	},
	copy_add = {
		life_rating = -1,
	},
}

newBirthDescriptor{
	type = "subclass",
	name = "Archmage",
	display_name= "元素法师",
	locked = function() return profile.mod.allow_build.mage end,
	locked_desc = "憎恨、折磨、追捕、隐藏... 我们 的道路被禁止，但是我们的事业是 公正的。在我们隐藏的山谷里我们 自由学习我们自己的魔法艺术从这 个世界的愤怒中寻求抚慰。只有友 谊和宽容才能获得我们的信任。",
	desc = {
		"    对一个元素法师来说魔法超越一切， 他们尽其一生学习魔法。",
		"    元素法师缺乏最基本的物理格斗技 能，他们用魔法取而代之。",
		"    元素法师从学院里获得魔法知识， 他们通常拒绝任何妖术。",
		"    元素法师在一个名叫Angolwen的秘 密小镇接受训练，并拥有一个直接 传送到那里的独特技能。",
		"他们最重要的属性是：魔法和意志。",
		"#GOLD#属性修正：",
		"#LIGHT_BLUE# * +0 力量，+0 敏捷，+0 体质",
		"#LIGHT_BLUE# * +5 魔法，+3 意志，+1 灵巧",
	},
	stats = { mag=5, wil=3, cun=1, },
	talents_types = {
		["spell/arcane"]={true, 0.3},
		["spell/fire"]={true, 0.3},
		["spell/earth"]={true, 0.3},
		["spell/water"]={true, 0.3},
		["spell/air"]={true, 0.3},
		["spell/phantasm"]={true, 0.3},
		["spell/temporal"]={false, 0.3},
		["spell/meta"]={false, 0.3},
		["spell/divination"]={true, 0.3},
		["spell/conveyance"]={true, 0.3},
		["spell/aegis"]={true, 0.3},
		["cunning/survival"]={false, -0.1},
	},
	unlockable_talents_types = {
		["spell/wildfire"]={false, 0.3, "mage_pyromancer"},
		["spell/ice"]={false, 0.3, "mage_cryomancer"},
		["spell/stone"]={false, 0.3, "mage_geomancer"},
		["spell/storm"]={false, 0.3, "mage_tempest"},
	},
	birth_example_particles = "arcane_power",
	talents = {
		[ActorTalents.T_ARCANE_POWER] = 1,
		[ActorTalents.T_FLAME] = 1,
		[ActorTalents.T_LIGHTNING] = 1,
		[ActorTalents.T_PHASE_DOOR] = 1,
	},
	copy = {
		-- Mages start in angolwen
		class_start_check = function(self)
			if self.descriptor.world == "Maj'Eyal" and (self.descriptor.race == "Human" or self.descriptor.race == "Elf" or self.descriptor.race == "Halfling") then
				self.archmage_race_start_quest = self.starting_quest
				self.default_wilderness = {"zone-pop", "angolwen-portal"}
				self.starting_zone = "town-angolwen"
				self.starting_quest = "start-archmage"
				self.starting_intro = "archmage"
				self.faction = "angolwen"
				self:learnTalent(self.T_TELEPORT_ANGOLWEN, true, nil, {no_unlearn=true})
			end
		end,

		max_life = 90,
		resolvers.equip{ id=true,
			{type="weapon", subtype="staff", name="榆木法杖", autoreq=true, ego_chance=-1000},
			{type="armor", subtype="cloth", name="亚麻长袍", autoreq=true, ego_chance=-1000},
		},
	},
	copy_add = {
		life_rating = -4,
	},
}

newBirthDescriptor{
	type = "subclass",
	name = "Necromancer",
	display_name= "死灵法师",
	locked = function() return profile.mod.allow_build.mage_necromancer end,
	locked_desc = "通往死灵法师的道路是极其可怕的， 与死亡相伴随并沉溺在他们的黑暗 知识之中。",
	desc = {
		"    自从魔法大爆炸以来大部分魔 法受到质疑，自远古以来，死灵法 师的黑暗魔法始终笼罩着骂名。",
		"    这些黑暗的施法者泯灭生命、 扭曲死亡、召唤不死亡灵作为他们 的军队来满足他们对力量的渴求， 达到他们的最终目标：不死永生。",
		"他们最重要的属性：魔法和意志。",
		"#GOLD#属性修正：",
		"#LIGHT_BLUE# * +0 力量，+0 敏捷，+0 体质",
		"#LIGHT_BLUE# * +5 魔法，+3 意志，+1 灵巧",
	},
	stats = { mag=5, wil=3, cun=1, },
	talents_types = {
		["spell/conveyance"]={true, 0.2},
		["spell/divination"]={true, 0.2},
		["spell/necrotic-minions"]={true, 0.3},
		["spell/advanced-necrotic-minions"]={false, 0.3},
		["spell/shades"]={false, 0.3},
		["spell/necrosis"]={true, 0.3},
		["spell/nightfall"]={true, 0.3},
		["spell/grave"]={true, 0.3},
		["cunning/survival"]={true, -0.1},
	},
	unlockable_talents_types = {
		["spell/ice"]={false, 0.2, "mage_cryomancer"},
	},
	birth_example_particles = "necrotic-aura",
	talents = {
		[ActorTalents.T_NECROTIC_AURA] = 1,
		[ActorTalents.T_CREATE_MINIONS] = 1,
		[ActorTalents.T_ARCANE_EYE] = 1,
		[ActorTalents.T_INVOKE_DARKNESS] = 1,
		[ActorTalents.T_BLURRED_MORTALITY] = 1,
	},
	copy = {
		necrotic_aura_base_souls = 1,
		max_life = 90,
		resolvers.equip{ id=true,
			{type="weapon", subtype="staff", name="榆木法杖", autoreq=true, ego_chance=-1000},
--			{type="weapon", subtype="dagger", name="iron dagger", autoreq=true, ego_chance=-1000},
			{type="armor", subtype="cloth", name="亚麻长袍", autoreq=true, ego_chance=-1000},
		},
	},
	copy_add = {
		life_rating = -3,
		resolvers.generic(function(self) self:grantQuest("lichform") end),
	},
}
