From 6ae8ee65b253330353c235b1050db0bc0929f138 Mon Sep 17 00:00:00 2001
From: dg <dg@51575b47-30f0-44d4-a5cc-537603b46e54>
Date: Tue, 29 Mar 2011 16:56:34 +0000
Subject: [PATCH] Inverted Campaign and Difficulty selection on birth. Removed
 stupid combos (like Arena/Adventure as extra lifes never worked there)

git-svn-id: http://svn.net-core.org/repos/t-engine4@3103 51575b47-30f0-44d4-a5cc-537603b46e54
---
 game/engines/default/engine/Birther.lua      |  1 +
 game/modules/tome/class/Game.lua             |  2 +-
 game/modules/tome/data/birth/descriptors.lua | 23 ++++++++--
 game/modules/tome/data/birth/worlds.lua      | 48 ++++----------------
 4 files changed, 29 insertions(+), 45 deletions(-)

diff --git a/game/engines/default/engine/Birther.lua b/game/engines/default/engine/Birther.lua
index 1d6f1fc599..7dad06cfd2 100644
--- a/game/engines/default/engine/Birther.lua
+++ b/game/engines/default/engine/Birther.lua
@@ -203,6 +203,7 @@ function _M:selectType(type)
 	self.current_type = type
 	self:updateList()
 	self.c_list.sel = default
+	self.c_list:onSelect()
 end
 
 function _M:makeKey(letter)
diff --git a/game/modules/tome/class/Game.lua b/game/modules/tome/class/Game.lua
index d99dd076b6..224f565d20 100644
--- a/game/modules/tome/class/Game.lua
+++ b/game/modules/tome/class/Game.lua
@@ -201,7 +201,7 @@ function _M:newGame()
 	local nb_unlocks, max_unlocks = self:countBirthUnlocks()
 
 	self.creating_player = true
-	local birth; birth = Birther.new("Character Creation: "..self.player.name.." ("..nb_unlocks.."/"..max_unlocks.." unlocked birth options)", self.player, {"base", "difficulty", "world", "race", "subrace", "sex", "class", "subclass" }, function()
+	local birth; birth = Birther.new("Character Creation: "..self.player.name.." ("..nb_unlocks.."/"..max_unlocks.." unlocked birth options)", self.player, {"base", "world", "difficulty", "race", "subrace", "sex", "class", "subclass" }, function()
 		self.calendar = Calendar.new("/data/calendar_"..(self.player.calendar or "allied")..".lua", "Today is the %s %s of the %s year of the Age of Ascendancy of Maj'Eyal.\nThe time is %02d:%02d.", 122, 167, 11)
 		self.player:check("make_tile")
 		self.player.make_tile = nil
diff --git a/game/modules/tome/data/birth/descriptors.lua b/game/modules/tome/data/birth/descriptors.lua
index da04163a62..ef1da42a0c 100644
--- a/game/modules/tome/data/birth/descriptors.lua
+++ b/game/modules/tome/data/birth/descriptors.lua
@@ -102,11 +102,26 @@ newBirthDescriptor{
 	},
 	descriptor_choices =
 	{
-		world =
+		race =
+		{
+			__ALL__ = "forbid",
+			["Tutorial Human"] = "allow",
+		},
+		subrace =
+		{
+			__ALL__ = "forbid",
+			["Tutorial Human"] = "allow",
+		},
+		class =
 		{
-			__ALL__ = "disallow",
-			Tutorial = "allow",
-		}
+			__ALL__ = "forbid",
+			["Tutorial Adventurer"] = "allow",
+		},
+		subclass =
+		{
+			__ALL__ = "forbid",
+			["Tutorial Adventurer"] = "allow",
+		},
 	},
 	copy = {
 		no_birth_levelup = true,
diff --git a/game/modules/tome/data/birth/worlds.lua b/game/modules/tome/data/birth/worlds.lua
index b0708144a7..691a6ea7f5 100644
--- a/game/modules/tome/data/birth/worlds.lua
+++ b/game/modules/tome/data/birth/worlds.lua
@@ -17,43 +17,8 @@
 -- Nicolas Casalini "DarkGod"
 -- darkgod@te4.org
 
-newBirthDescriptor{
-	type = "world",
-	name = "Tutorial",
-	desc =
-	{
-		"The tutorial will explain the basics of the game to get you started.",
-	},
---	on_select = function(what)
---		setAuto("subclass", false)
---		setAuto("subrace", false)
---	end,
-	descriptor_choices =
-	{
-		race =
-		{
-			__ALL__ = "forbid",
-			["Tutorial Human"] = "allow",
-		},
-		subrace =
-		{
-			__ALL__ = "forbid",
-			["Tutorial Human"] = "allow",
-		},
-		class =
-		{
-			__ALL__ = "forbid",
-			["Tutorial Adventurer"] = "allow",
-		},
-		subclass =
-		{
-			__ALL__ = "forbid",
-			["Tutorial Adventurer"] = "allow",
-		},
-	},
-}
-
-local default_eyal_descriptors = {
+local default_eyal_descriptors = function(add)
+	local base = {
 	race =
 	{
 		__ALL__ = "disallow",
@@ -87,6 +52,9 @@ local default_eyal_descriptors = {
 		Psionic = function() return profile.mod.allow_build.psionic and "allow" or "disallow" end,
 	},
 }
+	if add then table.merge(base, add) end
+	return base
+end
 
 -- Player worlds/campaigns
 newBirthDescriptor{
@@ -100,7 +68,7 @@ newBirthDescriptor{
 		"You are an adventurer, setting out to find lost treasure and glory.",
 		"But what lurks in the shadows of the world?",
 	},
-	descriptor_choices = default_eyal_descriptors,
+	descriptor_choices = default_eyal_descriptors{},
 	copy = {
 		__allow_rod_recall = true,
 	}
@@ -115,7 +83,7 @@ newBirthDescriptor{
 		"Play as your favorite race and class and venture into the infinite dungeon.",
 		"The only limit to how far you can go is your own skill!",
 	},
-	descriptor_choices = default_eyal_descriptors,
+	descriptor_choices = default_eyal_descriptors{ difficulty = { Tutorial = "never"} },
 	copy = {
 		-- Give the orb of knowledge
 		resolvers.inventory{ id=true, {defined="ORB_KNOWLEDGE"}},
@@ -143,7 +111,7 @@ newBirthDescriptor{
 		"See how far you can go! Can you become the new Master of the Arena?",
 		"If so, you will battle your own champion next time!",
 	},
-	descriptor_choices = default_eyal_descriptors,
+	descriptor_choices = default_eyal_descriptors{ difficulty = { Tutorial = "never", Easy = "never", Normal = "never" } },
 	copy = {
 		death_dialog = "ArenaFinish",
 
-- 
GitLab