Skip to content
Snippets Groups Projects
Commit 61cc92e3 authored by dg's avatar dg
Browse files

wilder classes need unlocking

git-svn-id: http://svn.net-core.org/repos/t-engine4@468 51575b47-30f0-44d4-a5cc-537603b46e54
parent cc293184
No related branches found
No related tags found
No related merge requests found
......@@ -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
......@@ -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 = {
......
......@@ -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 = {},
......
......@@ -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},
}
}
......
......@@ -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
......
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.
]]
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.
]]
......@@ -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}
}
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
......@@ -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")
......
No preview for this file type
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment