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

start tutorial mode

git-svn-id: http://svn.net-core.org/repos/t-engine4@880 51575b47-30f0-44d4-a5cc-537603b46e54
parent a3727703
No related branches found
No related tags found
No related merge requests found
Showing
with 95 additions and 43 deletions
......@@ -130,14 +130,19 @@ function _M:selectType(type)
print("[BIRTHER] selecting type", type)
for i, d in ipairs(self.birth_descriptor_def[type]) do
local allowed = true
print("[BIRTHER] checking allowance for ", d.name)
for j, od in ipairs(self.descriptors) do
if od.descriptor_choices[type] then
local what = util.getval(od.descriptor_choices[type][d.name]) or util.getval(od.descriptor_choices[type].__ALL__)
if what and what == "allow" then
allowed = true
elseif what and what == "never" then
elseif what and (what == "never" or what == "disallow") then
allowed = false
elseif what and what == "forbid" then
allowed = nil
end
print("[BIRTHER] test against ", od.name, "=>", what, allowed)
if allowed == nil then break end
end
end
......
......@@ -27,7 +27,7 @@ newBirthDescriptor{
{
subclass =
{
__ALL__ = "never",
__ALL__ = "disallow",
Archer = "allow",
Slinger = "allow",
},
......
......@@ -28,9 +28,9 @@ newBirthDescriptor{
{
subclass =
{
__ALL__ = "never",
['Sun Paladin'] = function() return profile.mod.allow_build.divine_sun_paladin and "allow" or "never" end,
Anorithil = function() return profile.mod.allow_build.divine_anorithil and "allow" or "never" end,
__ALL__ = "disallow",
['Sun Paladin'] = function() return profile.mod.allow_build.divine_sun_paladin and "allow" or "disallow" end,
Anorithil = function() return profile.mod.allow_build.divine_anorithil and "allow" or "disallow" end,
},
},
copy = {
......
......@@ -28,7 +28,7 @@ newBirthDescriptor{
{
subclass =
{
__ALL__ = "never",
__ALL__ = "disallow",
Archmage = "allow",
-- Necromancer = "allow",
},
......
......@@ -27,7 +27,7 @@ newBirthDescriptor{
{
subclass =
{
__ALL__ = "never",
__ALL__ = "disallow",
Rogue = "allow",
Shadowblade = "allow",
},
......
......@@ -27,7 +27,7 @@ newBirthDescriptor{
{
subclass =
{
__ALL__ = "never",
__ALL__ = "disallow",
Fighter = "allow",
Berserker = "allow",
["Arcane Blade"] = "allow",
......
......@@ -28,9 +28,9 @@ newBirthDescriptor{
{
subclass =
{
__ALL__ = "never",
Summoner = function() return profile.mod.allow_build.wilder_summoner and "allow" or "never" end,
Wyrmic = function() return profile.mod.allow_build.wilder_wyrmic and "allow" or "never" end,
__ALL__ = "disallow",
Summoner = function() return profile.mod.allow_build.wilder_summoner and "allow" or "disallow" end,
Wyrmic = function() return profile.mod.allow_build.wilder_wyrmic and "allow" or "disallow" end,
},
},
copy = {
......
......@@ -29,13 +29,14 @@ newBirthDescriptor{
{
world =
{
Tutorial = "disallow",
Arda = "allow",
["Spydrë"] = function() return profile.mod.allow_build.world_spydre and "allow" or "never" end,
["Spydrë"] = function() return profile.mod.allow_build.world_spydre and "allow" or "disallow" end,
},
subclass =
{
-- Nobdoy can be a sun paladin but humans & elves
['Sun Paladin'] = "never",
['Sun Paladin'] = "disallow",
},
},
talents = {},
......@@ -68,14 +69,22 @@ newBirthDescriptor{
--------------- Difficulties
newBirthDescriptor{
type = "difficulty",
name = "Easy",
name = "Tutorial",
desc =
{
"Easy game setting",
"Tutorial mode, start with a simplified character and discover the game in a simple quest.",
"All damage done to the player reduced by 20%",
"All healing for the player increased by 10%",
"No achievements possible.",
},
descriptor_choices =
{
world =
{
__ALL__ = "disallow",
Tutorial = "allow",
}
},
copy = { resolvers.generic(function() game.difficulty = game.DIFFICULTY_EASY end) },
}
newBirthDescriptor{
......
......@@ -32,12 +32,12 @@ newBirthDescriptor{
{
subrace =
{
__ALL__ = "never",
__ALL__ = "disallow",
Dwarf = "allow",
},
sex =
{
__ALL__ = "never",
__ALL__ = "disallow",
Male = "allow",
},
},
......
......@@ -34,7 +34,7 @@ newBirthDescriptor{
{
Nandor = "allow",
Avari = "allow",
__ALL__ = "never",
__ALL__ = "disallow",
},
subclass =
{
......
......@@ -32,7 +32,7 @@ newBirthDescriptor{
{
subrace =
{
__ALL__ = "never",
__ALL__ = "disallow",
Hobbit = "allow",
},
},
......
......@@ -34,7 +34,7 @@ newBirthDescriptor{
["Dúnadan"] = "allow",
Rohirrim = "allow",
Beorning = "allow",
__ALL__ = "never",
__ALL__ = "disallow",
},
subclass =
{
......
......@@ -32,17 +32,17 @@ newBirthDescriptor{
{
subrace =
{
__ALL__ = "never",
__ALL__ = "disallow",
Orc = "allow",
},
sex =
{
__ALL__ = "never",
__ALL__ = "disallow",
Male = "allow",
},
class =
{
Mage = "never",
Mage = "disallow",
},
},
stats = { str=4, con=1, wil=2, mag=-2, dex=-2 },
......
......@@ -30,12 +30,12 @@ newBirthDescriptor{
{
subrace =
{
__ALL__ = "never",
__ALL__ = "disallow",
Troll = "allow",
},
sex =
{
__ALL__ = "never",
__ALL__ = "disallow",
Male = "allow",
},
},
......
......@@ -31,15 +31,15 @@ newBirthDescriptor{
{
subrace =
{
__ALL__ = "never",
Ghoul = function() return profile.mod.allow_build.undead_ghoul and "allow" or "never" end,
Skeleton = function() return profile.mod.allow_build.undead_skeleton and "allow" or "never" end,
Vampire = function() return profile.mod.allow_build.undead_vampire and "allow" or "never" end,
Wight = function() return profile.mod.allow_build.undead_wight and "allow" or "never" end,
__ALL__ = "disallow",
Ghoul = function() return profile.mod.allow_build.undead_ghoul and "allow" or "disallow" end,
Skeleton = function() return profile.mod.allow_build.undead_skeleton and "allow" or "disallow" end,
Vampire = function() return profile.mod.allow_build.undead_vampire and "allow" or "disallow" end,
Wight = function() return profile.mod.allow_build.undead_wight and "allow" or "disallow" end,
},
class =
{
Divine = "never",
Divine = "disallow",
},
},
copy = {
......@@ -66,7 +66,7 @@ newBirthDescriptor
{
sex =
{
__ALL__ = "never",
__ALL__ = "disallow",
Male = "allow",
},
},
......@@ -111,7 +111,7 @@ newBirthDescriptor
{
sex =
{
__ALL__ = "never",
__ALL__ = "disallow",
Male = "allow",
},
},
......
......@@ -33,30 +33,66 @@ newBirthDescriptor{
{
race =
{
__ALL__ = "never",
__ALL__ = "disallow",
Human = "allow",
Elf = "allow",
Dwarf = "allow",
Hobbit = "allow",
Orc = function() return profile.mod.allow_build.orc and "allow" or "never" end,
Troll = function() return profile.mod.allow_build.troll and "allow" or "never" end,
Undead = function() return profile.mod.allow_build.undead and "allow" or "never" end,
Orc = function() return profile.mod.allow_build.orc and "allow" or "disallow" end,
Troll = function() return profile.mod.allow_build.troll and "allow" or "disallow" end,
Undead = function() return profile.mod.allow_build.undead and "allow" or "disallow" end,
},
class =
{
__ALL__ = "allow",
Mage = function() return profile.mod.allow_build.mage and "allow" or "never" end,
Divine = function() return profile.mod.allow_build.divine and "allow" or "never" end,
Mage = function() return profile.mod.allow_build.mage and "allow" or "disallow" end,
Divine = function() return profile.mod.allow_build.divine and "allow" or "disallow" end,
Wilder = function() return (
profile.mod.allow_build.wilder_summoner or
profile.mod.allow_build.wilder_wyrmic
) and "allow" or "never"
) and "allow" or "disallow"
end,
},
},
}
newBirthDescriptor{
type = "world",
name = "Tutorial",
desc =
{
"The tutorial will explain the basics of the game to get you started.",
},
on_select = function()
setAuto("subclass", false)
setAuto("subrace", false)
end,
descriptor_choices =
{
race =
{
__ALL__ = "forbid",
Human = "allow",
},
subrace =
{
__ALL__ = "forbid",
["Dúnadan"] = "allow",
},
class =
{
__ALL__ = "forbid",
Warrior = "allow",
},
subclass =
{
__ALL__ = "forbid",
Fighter = "allow",
},
},
}
newBirthDescriptor{
type = "world",
name = "Spydrë",
......@@ -70,9 +106,9 @@ newBirthDescriptor{
{
race =
{
__ALL__ = "never",
__ALL__ = "disallow",
Human = "allow",
-- Spider = function() return profile.mod.allow_build.spider and "allow" or "never" end,
-- Spider = function() return profile.mod.allow_build.spider and "allow" or "disallow" end,
},
},
}
......@@ -31,9 +31,11 @@ newEntity{
use_simple = { name="consume the heart", use = function(self, who)
game.logPlayer(who, "#00FFFF#You consume the heart and feel the knowledge of this very old creature fills you!")
who.unused_stats = who.unused_stats + 3
who.unused_talents = who.unused_talents + 2
who.unused_talents = who.unused_talents + 1
who.unused_skills = who.unused_skills + 1
game.logPlayer(who, "You have %d stat point(s) to spend. Press G to use them.", who.unused_stats)
game.logPlayer(who, "You have %d talent point(s) to spend. Press G to use them.", who.unused_talents)
game.logPlayer(who, "You have %d skill point(s) to spend. Press G to use them.", who.unused_skills)
who:learnTalentType("wild-gift/sand-drake", false)
game.logPlayer(who, "You are transformed by the heart of the Queen!.")
......
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