From e3b249beed986c0a8b423c65b22793b989b54514 Mon Sep 17 00:00:00 2001
From: dg <dg@51575b47-30f0-44d4-a5cc-537603b46e54>
Date: Sun, 21 Aug 2011 14:20:27 +0000
Subject: [PATCH] Permadeath mode: Exploration Mode with infinite lives.
 Donators feature

git-svn-id: http://svn.net-core.org/repos/t-engine4@4209 51575b47-30f0-44d4-a5cc-537603b46e54
---
 COPYING-TILES                                |  2 +-
 game/modules/tome/data/birth/descriptors.lua |  5 ++--
 game/modules/tome/dialogs/Birther.lua        | 25 ++++++++++++++++++--
 game/modules/tome/dialogs/Donation.lua       |  3 ++-
 4 files changed, 28 insertions(+), 7 deletions(-)

diff --git a/COPYING-TILES b/COPYING-TILES
index 7be5782e0b..ad78805f8e 100644
--- a/COPYING-TILES
+++ b/COPYING-TILES
@@ -1,4 +1,4 @@
-All the tiles of the "shockbolt" tileset, located in all the "gfx/shockbolt"
+All the tiles of the "shockbolt" tileset, located in all the "gfx/shockbolt" and "gfx/lore"
 folders are granted to use with the Tales of Maj'Eyal game only.
 
 Please contact darkgod@te4.org for more informations.
diff --git a/game/modules/tome/data/birth/descriptors.lua b/game/modules/tome/data/birth/descriptors.lua
index 0f819b3788..e0d215121f 100644
--- a/game/modules/tome/data/birth/descriptors.lua
+++ b/game/modules/tome/data/birth/descriptors.lua
@@ -189,12 +189,12 @@ newBirthDescriptor{
 }
 
 --------------- Permadeath
---[[
 newBirthDescriptor{
 	type = "permadeath",
 	name = "Exploration",
-	locked = function(birther) return birther:isDonator() or "hide" end,
+	locked = function(birther) return birther:isDonator() end,
 	locked_desc = "Exploration mode: Infinite lives (donator feature)",
+	locked_select = function(birther) birther:selectExplorationNoDonations() end,
 	selection_default = config.settings.tome.default_birth and config.settings.tome.default_birth.permadeath == "Exploration",
 	desc =
 	{
@@ -208,7 +208,6 @@ newBirthDescriptor{
 		infinite_lifes = 1,
 	},
 }
---]]
 newBirthDescriptor{
 	type = "permadeath",
 	name = "Adventure",
diff --git a/game/modules/tome/dialogs/Birther.lua b/game/modules/tome/dialogs/Birther.lua
index 2e8ccc15f6..907ba1edb1 100644
--- a/game/modules/tome/dialogs/Birther.lua
+++ b/game/modules/tome/dialogs/Birther.lua
@@ -359,6 +359,7 @@ function _M:permadeathUse(item)
 	if not item then return end
 	if item.locked then
 		self.c_permadeath.c_list.sel = self.c_permadeath.previous
+		if item.locked_select then item.locked_select(self) end
 	else
 		self:setDescriptor("permadeath", item.id)
 
@@ -543,7 +544,7 @@ function _M:generatePermadeaths()
 		if self:isDescriptorAllowed(d) then
 			local locked = self:getLock(d)
 			if locked == true then
-				list[#list+1] = { name = tstring{{"font", "italic"}, {"color", "GREY"}, "-- locked --", {"font", "normal"}}:toString(), id=d.name, locked=true, desc=d.locked_desc..locktext }
+				list[#list+1] = { name = tstring{{"font", "italic"}, {"color", "GREY"}, "-- locked --", {"font", "normal"}}:toString(), id=d.name, locked=true, desc=d.locked_desc..locktext, locked_select=d.locked_select }
 			elseif locked == false then
 				local desc = d.desc
 				if type(desc) == "table" then desc = table.concat(d.desc, "\n") end
@@ -907,6 +908,24 @@ function _M:setTile(f, w, h, last)
 	end
 end
 
+function _M:selectExplorationNoDonations()
+	Dialog:yesnoLongPopup("Exploration mode",
+	[[Exploration mode provides the characters using it with infinite lives.
+Tales of Maj'Eyal is meant to be a very replayable game in which you get better by learning from mistakes (and thus from dying too).
+I realize this can not please everybody and after multiple requests I have decided to grant exploration mode to donators, because it will allow player that like the game to see it all if they wish.
+Beware though, infinite lives does not mean the difficulty is reduced, only that you can try as much as you want without restarting.
+
+If you'd like to use this feature and find this game good you should consider donating. It will help ensure its survival.
+While this is a free game that I am doing for fun, if it can help feed my family a bit I certainly will not complain as real life can be harsh sometimes.
+You will need an online profile active and connected for the tile selector to enable. If you choose to donate now you will need to restart the game to be granted access.
+
+Donators will also gain access to the custom tiles for their characters.]], 400, function(ret)
+		if not ret then
+			game:registerDialog(require("mod.dialogs.Donation").new("exploration-mode"))
+		end
+	end, "Later", "Donate!")
+end
+
 function _M:selectTileNoDonations()
 	Dialog:yesnoLongPopup("Custom tiles",
 	[[Custom Tiles have been added as a thank you to everyone that has donated to ToME.
@@ -914,7 +933,9 @@ They are a fun cosmetic feature that allows you to choose a tile for your charac
 
 If you'd like to use this feature and find this game good you should consider donating. It will help ensure its survival.
 While this is a free game that I am doing for fun, if it can help feed my family a bit I certainly will not complain as real life can be harsh sometimes.
-You will need an online profile active and connected for the tile selector to enable. If you choose to donate now you will need to restart the game to be granted access.]], 400, function(ret)
+You will need an online profile active and connected for the tile selector to enable. If you choose to donate now you will need to restart the game to be granted access.
+
+Donators will also gain access to the Exploration Mode featuring infinite lives.]], 400, function(ret)
 		if not ret then
 			game:registerDialog(require("mod.dialogs.Donation").new("custom-tiles"))
 		end
diff --git a/game/modules/tome/dialogs/Donation.lua b/game/modules/tome/dialogs/Donation.lua
index 97936fbac5..4c543082d4 100644
--- a/game/modules/tome/dialogs/Donation.lua
+++ b/game/modules/tome/dialogs/Donation.lua
@@ -44,7 +44,8 @@ It is my dearest hope that you find my game enjoyable, and that you will continu
 
 ToME is free and open-source and will stay that way, but that does not mean I can live without money, so I have come to disturb you here and now to ask for your kindness.
 If you feel that the (many) hours you have spent having fun were worth it, please consider making a donation for the future of the game.
-]]}
+
+Donators are also granted a few special features: #GOLD#Custom character tiles#WHITE# and #GOLD#Exploration mode (infinite lives)#WHITE#.]]}
 	else
 		-- Recurring donation
 		recur = true
-- 
GitLab