From 2b944b6b286263f5ef2f449d1feb1c25513fc417 Mon Sep 17 00:00:00 2001
From: dg <dg@51575b47-30f0-44d4-a5cc-537603b46e54>
Date: Tue, 5 Jul 2011 13:23:46 +0000
Subject: [PATCH] New achievement "Fool of a Took!"

git-svn-id: http://svn.net-core.org/repos/t-engine4@3801 51575b47-30f0-44d4-a5cc-537603b46e54
---
 game/modules/tome/class/interface/PartyDeath.lua | 1 +
 game/modules/tome/data/achievements/player.lua   | 9 +++++++++
 2 files changed, 10 insertions(+)

diff --git a/game/modules/tome/class/interface/PartyDeath.lua b/game/modules/tome/class/interface/PartyDeath.lua
index 698e3f13e1..b61cf76a19 100644
--- a/game/modules/tome/class/interface/PartyDeath.lua
+++ b/game/modules/tome/class/interface/PartyDeath.lua
@@ -45,6 +45,7 @@ function _M:onPartyDeath(src, death_note)
 
 	-- No more player found! Switch back to main and die
 	if game_ender then
+		world:gainAchievement("HALFLING_SUICIDE", self)
 		game.party:setPlayer(game.party:findMember{main=true}, true)
 		game.paused = true
 		game.player.energy.value = game.energy_to_act
diff --git a/game/modules/tome/data/achievements/player.lua b/game/modules/tome/data/achievements/player.lua
index cb4aa9b63f..202698ae66 100644
--- a/game/modules/tome/data/achievements/player.lua
+++ b/game/modules/tome/data/achievements/player.lua
@@ -55,6 +55,15 @@ newAchievement{
 	desc = [[Died on the Eidolon Plane.]],
 }
 
+newAchievement{
+	name = "Fool of a Took!", id = "HALFLING_SUICIDE",
+	show = "name",
+	desc = [[Killed oneself as a halfling.]],
+	can_gain = function(self, who)
+		if who.descriptor and who.descriptor.race == "Halfling" then return true end
+	end
+}
+
 newAchievement{
 	name = "Emancipation", id = "EMANCIPATION",
 	image = "npc/alchemist_golem.png",
-- 
GitLab