diff --git a/game/modules/tome/class/Game.lua b/game/modules/tome/class/Game.lua index c016646f5978abf5dcc40161abdaecdccdfa887b..56e86c9e3056a363adbe1ae21ec2402eb058f27b 100644 --- a/game/modules/tome/class/Game.lua +++ b/game/modules/tome/class/Game.lua @@ -642,3 +642,21 @@ function _M:saveGame() save:close() self.log("Saved game.") end + +function _M:setAllowedBuild(what, notify) + config.settings.tome = config.settings.tome or {} + config.settings.tome.allow_build = config.settings.tome.allow_build or {} + if config.settings.tome.allow_build[what] then return false end + config.settings.tome.allow_build[what] = true + local t = {} + for k, e in pairs(config.settings.tome.allow_build) do + t[#t+1] = ("tome.allow_build.%s = %s\n"):format(k, tostring(e)) + end + game:saveSettings("tome.allow_build", table.concat(t, "\n")) + + if notify then + self:registerDialog(require("mod.dialogs.UnlockDialog").new(what)) + end + + return true +end diff --git a/game/modules/tome/data/birth/classes/wilder.lua b/game/modules/tome/data/birth/classes/wilder.lua index 33b1844b6baca1a49cf6ed9064ddec201615d1b0..4891a3722f99b73e0f22ff229f88de026216045a 100644 --- a/game/modules/tome/data/birth/classes/wilder.lua +++ b/game/modules/tome/data/birth/classes/wilder.lua @@ -10,8 +10,8 @@ newBirthDescriptor{ subclass = { __ALL__ = "never", - Summoner = "allow", - Wyrmic = "allow", + Summoner = config.settings.tome.allow_build.wilder_summoner and "allow" or "never", + Wyrmic = config.settings.tome.allow_build.wilder_wyrmic and "allow" or "never", }, }, copy = { diff --git a/game/modules/tome/data/birth/descriptors.lua b/game/modules/tome/data/birth/descriptors.lua index 88f0bc1207b114b2ffc9a6bc1ae7fc7efbd026aa..099f82eeec209e75171636948e771509d2dcdae4 100644 --- a/game/modules/tome/data/birth/descriptors.lua +++ b/game/modules/tome/data/birth/descriptors.lua @@ -12,9 +12,18 @@ newBirthDescriptor{ Elf = "allow", Dwarf = "allow", Hobbit = "allow", --- Orc = config.settings.tome.allow_evil and "allow" or "never", --- Troll = config.settings.tome.allow_evil and "allow" or "never", --- Spider = config.settings.tome.allow_evil and "allow" or "never", +-- Orc = config.settings.tome.allow_build.evil and "allow" or "never", +-- Troll = config.settings.tome.allow_build.evil and "allow" or "never", +-- Spider = config.settings.tome.allow_build.spider and "allow" or "never", + }, + + class = + { + __ALL__ = "allow", + Wilder = ( + config.settings.tome.allow_build.wilder_summoner or + config.settings.tome.allow_build.wilder_wyrmic + ) and "allow" or "never", }, }, talents = {}, diff --git a/game/modules/tome/data/chats/minas-tirith-elder.lua b/game/modules/tome/data/chats/minas-tirith-elder.lua index 807ebc8e2f53ca77a3f303e640934477e5b63c81..0630949469d9f6cc78faa073f4caeb9357637c69 100644 --- a/game/modules/tome/data/chats/minas-tirith-elder.lua +++ b/game/modules/tome/data/chats/minas-tirith-elder.lua @@ -21,9 +21,7 @@ This could be related to the rumours we hear from the far east...]], local D = require "engine.Dialog" D:simplePopup("Winner!", "#VIOLET#Congratulations you have won the game! At least for now... The quest has only started!") - config.settings.tome = config.settings.tome or {} - config.settings.tome.allow_evil = true - game:saveSettings("tome.allow_evil", ("tome.allow_evil = %s\n"):format(tostring(config.settings.tome.allow_evil))) +-- game:setAllowedBuild("evil_race", true) end}, } } diff --git a/game/modules/tome/data/talents/misc/npcs.lua b/game/modules/tome/data/talents/misc/npcs.lua index 36c737ecef6b6b9f37d92edfac463f3ceb02742c..d44c669a0c29c73ecb925dd714e5fe349b44d245 100644 --- a/game/modules/tome/data/talents/misc/npcs.lua +++ b/game/modules/tome/data/talents/misc/npcs.lua @@ -237,6 +237,11 @@ newTalent{ game.zone:addEntity(game.level, m, "actor", x, y) game.logSeen(self, "%s summons %s!", self.name:capitalize(), m.name) + + -- Learn about summoners + if game.level.map.seens(self.x, self.y) then + game:setAllowedBuild("wilder_summoner", true) + end end end return true diff --git a/game/modules/tome/data/texts/unlock-wilder_summoner.lua b/game/modules/tome/data/texts/unlock-wilder_summoner.lua new file mode 100644 index 0000000000000000000000000000000000000000..825670d165b8721b161567f0346eb6447a30165f --- /dev/null +++ b/game/modules/tome/data/texts/unlock-wilder_summoner.lua @@ -0,0 +1,14 @@ +return "New Class: #LIGHT_GREEN#Summoner (Wilder)", +[[ +In the wilds some people, or creatures, are able, by the sole force of their will, to call upon allies to help them in combat. +You have witnessed such an act and can now create new characters with the #LIGHT_GREEN#Summoner class#WHITE#. + +Summoners are Wilders, they are at home in the wilds and draw their power from their connection with Nature. +Class features:#YELLOW# +- Summon allies, ranging from war hound to the mighty fire drake +- Take direct control of your summons +- Augment your summons with various powers#WHITE# + +All wilder classes use Equilibrium for their powers. It represents their connection to nature. +The higher it gets the more off-balance they are with it. A high equilibrium makes for a chance to fail to use a power and lose a turn. +]] diff --git a/game/modules/tome/data/texts/unlock-wilder_wyrmic.lua b/game/modules/tome/data/texts/unlock-wilder_wyrmic.lua new file mode 100644 index 0000000000000000000000000000000000000000..fb337a97d3be0b9117a49865dac7bbf92031fb57 --- /dev/null +++ b/game/modules/tome/data/texts/unlock-wilder_wyrmic.lua @@ -0,0 +1,15 @@ +return "New Class: #LIGHT_GREEN#Wyrmic (Wilder)", +[[ +Some people, either through training or magic, can take on the defining aspects of the dragon-kin themselves. +You have consumed a magic that allows you to gain such a power. You can now also create new characters with the #LIGHT_GREEN#Wyrmic class#WHITE#. + +Wyrmics are Wilders, they are at home in the wilds and draw their power from their connection with the dragons. +Class features:#YELLOW# +- Take on the aspects of fire, cold and sand-drakes +- Breath weapons: fire, ice and sand +- Powerful two-handed melee combatant#WHITE# + +All wilder classes use Equilibrium for their powers. It represents their connection to nature. +The higher it gets the more off-balance they are with it. A high equilibrium makes for a chance to fail to use a power and lose a turn. +Wyrmics are also trained in the martial arts and use stamina for some techniques. +]] diff --git a/game/modules/tome/data/zones/sandworm-lair/objects.lua b/game/modules/tome/data/zones/sandworm-lair/objects.lua index a6be20a72548aa774f0d6fd9b6394d8012387483..2d6e2531a6ea6d124a088783d0b91da08c043275 100644 --- a/game/modules/tome/data/zones/sandworm-lair/objects.lua +++ b/game/modules/tome/data/zones/sandworm-lair/objects.lua @@ -20,6 +20,8 @@ newEntity{ game.logPlayer(who, "You are transformed by the heart of the Queen!.") game.logPlayer(who, "#00FF00#You gain an affinity for sand. You can now learn new sand talents (press G).") + game:setAllowedBuild("wilder_wyrmic", true) + return "destroy", true end} } diff --git a/game/modules/tome/dialogs/UnlockDialog.lua b/game/modules/tome/dialogs/UnlockDialog.lua new file mode 100644 index 0000000000000000000000000000000000000000..df31e3c98f76824fe12a7aaece8f6ba6bbbc553e --- /dev/null +++ b/game/modules/tome/dialogs/UnlockDialog.lua @@ -0,0 +1,33 @@ +require "engine.class" +require "engine.Dialog" + +module(..., package.seeall, class.inherit(engine.Dialog)) + +function _M:init(what) + self.what = what + + local f, err = loadfile("/data/texts/unlock-"..self.what..".lua") + if not f and err then error(err) end + setfenv(f, {}) + self.name, self.str = f() + + game.logPlayer(game.player, "#VIOLET#Option unlocked: "..self.name) + + engine.Dialog.init(self, "Option unlocked: "..self.name, 600, 400) + + self:keyCommands(nil, { + ACCEPT = "EXIT", + EXIT = function() + game:unregisterDialog(self) + end, + }) +end + +function _M:drawDialog(s) + local lines = self.str:splitLines(self.iw - 10, self.font) + local r, g, b + for i = 1, #lines do + r, g, b = s:drawColorString(self.font, lines[i], 5, 4 + i * self.font:lineSkip(), r, g, b) + end + self.changed = false +end diff --git a/game/modules/tome/load.lua b/game/modules/tome/load.lua index 9800e61dc34655ab2764709eb8e52d7a4463e05e..efdef8e639b0e897f7662cfd1888253a5b88db4a 100644 --- a/game/modules/tome/load.lua +++ b/game/modules/tome/load.lua @@ -11,6 +11,9 @@ local ActorLevel = require "engine.interface.ActorLevel" local Birther = require "engine.Birther" local Store = require "mod.class.Store" +config.settings.tome = config.settings.tome or {} +config.settings.tome.allow_build = config.settings.tome.allow_build or {} + -- Usefull keybinds KeyBind:load("move,hotkeys,inventory,actions,debug") diff --git a/ideas/gifts.ods b/ideas/gifts.ods index 2ea11020e4d33309b32718c4322c917170c2cc12..dd13fa284f6c5332f84b745cf285f5ad523d3a68 100644 Binary files a/ideas/gifts.ods and b/ideas/gifts.ods differ