From 8b643824bb06c431f48735856dd5a2090ab4e63d Mon Sep 17 00:00:00 2001
From: dg <dg@51575b47-30f0-44d4-a5cc-537603b46e54>
Date: Fri, 17 Sep 2010 22:41:02 +0000
Subject: [PATCH] New race: Noldor (Elves)

git-svn-id: http://svn.net-core.org/repos/t-engine4@1247 51575b47-30f0-44d4-a5cc-537603b46e54
---
 game/modules/tome/data/birth/races/elf.lua   | 20 +++++++++++++++++++-
 game/modules/tome/data/talents/misc/misc.lua | 18 +++++++++++++++++-
 game/modules/tome/data/timed_effects.lua     | 18 ++++++++++++++++++
 game/modules/tome/dialogs/MapMenu.lua        |  2 ++
 4 files changed, 56 insertions(+), 2 deletions(-)

diff --git a/game/modules/tome/data/birth/races/elf.lua b/game/modules/tome/data/birth/races/elf.lua
index 8ce6d30c1f..fe67e01ac2 100644
--- a/game/modules/tome/data/birth/races/elf.lua
+++ b/game/modules/tome/data/birth/races/elf.lua
@@ -33,7 +33,7 @@ newBirthDescriptor{
 		subrace =
 		{
 			Nandor = "allow",
-			Avari = "allow",
+			Noldor = "allow",
 			__ALL__ = "disallow",
 		},
 		subclass =
@@ -75,6 +75,24 @@ newBirthDescriptor
 		life_rating = 9,
 	},
 }
+
+newBirthDescriptor
+{
+	type = "subrace",
+	name = "Noldor",
+	desc = {
+		"Originally the Second Clan of the elves in both order and size, Noldor were exiled in Middle-Earth by the Valar after the first kinslaying.",
+		"Most of the Noldor sailed back to Aman at the end of the First Age; but some, like Galadriel or Celebrimbor, refused the pardon of the Valar and remained.",
+		"In the Third Age, the Noldor dwindled, and by the end of the Third Age the only ones remaining in Middle-Earth were in Rivendell and in Lothlórien.",
+		"They possess the Wrath of the Eldar talent, which allows them a boost to the damage both inflicted and resisted once in a while.",
+	},
+	stats = { str=2, mag=-2, wil=1, cun=0, dex=3, con=1 },
+	experience = 1.3,
+	talents = { [ActorTalents.T_NOLDOR_WRATH]=1 },
+	copy = {
+		life_rating = 11,
+	},
+}
 --[[
 newBirthDescriptor
 {
diff --git a/game/modules/tome/data/talents/misc/misc.lua b/game/modules/tome/data/talents/misc/misc.lua
index 90c08c3abc..6e8dd00bfb 100644
--- a/game/modules/tome/data/talents/misc/misc.lua
+++ b/game/modules/tome/data/talents/misc/misc.lua
@@ -221,6 +221,22 @@ newTalent{
 	end,
 }
 
+-- Noldor's power: temporary damage increase and damage reduction
+newTalent{
+	short_name = "NOLDOR_WRATH",
+	name = "Wrath of the Eldar",
+	type = {"base/race", 1},
+	cooldown = 50,
+	action = function(self, t)
+		self:setEffect(self.EFF_NOLDOR_WRATH, 5, {power=7 + self:getWil(10)})
+		return true
+	end,
+	info = function(self)
+		return ([[Call upon the power of the ancient Noldor, increasing all damage by %d%% and reducing all damage taken by %d%% for 5 turns.
+		The bonus will increase with the Willpower stat]]):format(7 + self:getWil(10), 7 + self:getWil(10))
+	end,
+}
+
 -- Orc's power: temporary damage increase
 newTalent{
 	short_name = "ORC_FURY",
@@ -232,7 +248,7 @@ newTalent{
 		return true
 	end,
 	info = function(self)
-		return ([[Summons your lust for blood and destruction, increasing all damage by %d for 5 turns.
+		return ([[Summons your lust for blood and destruction, increasing all damage by %d%% for 5 turns.
 		The bonus will increase with the Willpower stat]]):format(10 + self:getWil(20))
 	end,
 }
diff --git a/game/modules/tome/data/timed_effects.lua b/game/modules/tome/data/timed_effects.lua
index 1898f4ea3e..42bad9c2ed 100644
--- a/game/modules/tome/data/timed_effects.lua
+++ b/game/modules/tome/data/timed_effects.lua
@@ -491,6 +491,24 @@ newEffect{
 	end,
 }
 
+newEffect{
+	name = "NOLDOR_WRATH",
+	desc = "Wrath of the Eldar",
+	type = "physical",
+	status = "beneficial",
+	parameters = { power=10 },
+	on_gain = function(self, err) return "#Target# radiates power." end,
+	on_lose = function(self, err) return "#Target# aura of power vanishes." end,
+	activate = function(self, eff)
+		eff.pid1 = self:addTemporaryValue("inc_damage", {all=eff.power})
+		eff.pid2 = self:addTemporaryValue("resists", {all=eff.power})
+	end,
+	deactivate = function(self, eff)
+		self:removeTemporaryValue("inc_damage", eff.pid1)
+		self:removeTemporaryValue("resists", eff.pid2)
+	end,
+}
+
 newEffect{
 	name = "ORC_FURY",
 	desc = "Orcish Fury",
diff --git a/game/modules/tome/dialogs/MapMenu.lua b/game/modules/tome/dialogs/MapMenu.lua
index 3c1b443bf5..88f932960f 100644
--- a/game/modules/tome/dialogs/MapMenu.lua
+++ b/game/modules/tome/dialogs/MapMenu.lua
@@ -71,6 +71,7 @@ function _M:use()
 	elseif act == "quests" then game.key:triggerVirtual("SHOW_QUESTS")
 	elseif act == "levelup" then game.key:triggerVirtual("LEVELUP")
 	elseif act == "inventory" then game.key:triggerVirtual("SHOW_INVENTORY")
+	elseif act == "rest" then game.key:triggerVirtual("REST")
 	elseif act == "talent" then
 		local d = self.list[self.sel]
 		if d.set_target then
@@ -96,6 +97,7 @@ function _M:generateList()
 	if g and g.change_level and self.on_player then list[#list+1] = {name="Change level", action="change_level", color=colors.simple(colors.VIOLET)} end
 	if o and self.on_player then list[#list+1] = {name="Pickup item", action="pickup", color=colors.simple(colors.ANTIQUE_WHITE)} end
 	if g and not self.on_player then list[#list+1] = {name="Move to", action="move_to", color=colors.simple(colors.ANTIQUE_WHITE)} end
+	if self.on_player then list[#list+1] = {name="Rest a while", action="rest", color=colors.simple(colors.ANTIQUE_WHITE)} end
 	if self.on_player then list[#list+1] = {name="Inventory", action="inventory", color=colors.simple(colors.ANTIQUE_WHITE)} end
 	if self.on_player then list[#list+1] = {name="Character Sheet", action="character_sheet", color=colors.simple(colors.ANTIQUE_WHITE)} end
 	if self.on_player then list[#list+1] = {name="Quest Log", action="quests", color=colors.simple(colors.ANTIQUE_WHITE)} end
-- 
GitLab