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

Fixed birth screen to indicate race/class combo that do not make much sense

git-svn-id: http://svn.net-core.org/repos/t-engine4@4199 51575b47-30f0-44d4-a5cc-537603b46e54
parent 66c31685
No related branches found
No related tags found
No related merge requests found
......@@ -31,8 +31,8 @@ newBirthDescriptor{
subclass =
{
__ALL__ = "disallow",
['Sun Paladin'] = "allow",
Anorithil = "allow",
['Sun Paladin'] = "allow-nochange",
Anorithil = "allow-nochange",
},
},
copy = {
......
......@@ -29,7 +29,7 @@ newBirthDescriptor{
{
__ALL__ = "disallow",
Alchemist = "allow",
Archmage = "allow",
Archmage = "allow-nochange",
Necromancer = "allow",
},
},
......
......@@ -49,13 +49,6 @@ newBirthDescriptor{
Undeads = "disallow",
Faeros = "disallow",
},
subclass =
{
-- Nobody can be a sun paladin but humans & elves
['Sun Paladin'] = "disallow",
-- Nobody can be a sun paladin but elves
['Anorithil'] = "disallow",
},
class =
{
-- Specific to some races
......
......@@ -39,7 +39,11 @@ newBirthDescriptor{
},
subclass =
{
['Anorithil'] = "allow",
-- Only human and elves make sense to play celestials
['Sun Paladin'] = "allow",
Anorithil = "allow",
-- Only human, elves, halflings and undeads are supposed to be archmages
Archmage = "allow",
},
},
copy = {
......
......@@ -36,6 +36,10 @@ newBirthDescriptor{
__ALL__ = "disallow",
Halfling = "allow",
},
subclass = {
-- Only human, elves, halflings and undeads are supposed to be archmages
Archmage = "allow",
},
},
copy = {
faction = "allied-kingdoms",
......
......@@ -39,8 +39,11 @@ newBirthDescriptor{
},
subclass =
{
-- Only human and elves make sense to play celestials
['Sun Paladin'] = "allow",
['Anorithil'] = "allow",
-- Only human, elves, halflings and undeads are supposed to be archmages
Archmage = "allow",
},
},
talents = {},
......
......@@ -46,7 +46,9 @@ newBirthDescriptor{
},
subclass =
{
Necromancer = "disallow",
Necromancer = "forbid",
-- Only human, elves, halflings and undeads are supposed to be archmages
Archmage = "allow",
},
},
talents = {
......
......@@ -48,6 +48,14 @@ local default_eyal_descriptors = function(add)
Chronomancer = "allow",
Psionic = "allow",
},
subclass =
{
-- Nobody should be a sun paladin & anorithil but humans & elves
['Sun Paladin'] = "nolore",
Anorithil = "nolore",
-- Nobody should be an archmage but human, elves, halflings and undeads
Archmage = "nolore",
},
}
if add then table.merge(base, add) end
return base
......
......@@ -452,6 +452,10 @@ function _M:isDescriptorAllowed(d)
local what = util.getval(od.descriptor_choices[type][d.name], self) or util.getval(od.descriptor_choices[type].__ALL__, self)
if what and what == "allow" then
allowed = true
elseif what and what == "nolore" then
allowed = "nolore"
elseif what and what == "allow-nochange" then
if not allowed then allowed = true end
elseif what and (what == "never" or what == "disallow") then
allowed = false
elseif what and what == "forbid" then
......@@ -623,15 +627,18 @@ function _M:generateClasses()
for i, d in ipairs(self.birth_descriptor_def.class) do
if self:isDescriptorAllowed(d) then
local nodes = {}
for si, sd in ipairs(self.birth_descriptor_def.subclass) do
if d.descriptor_choices.subclass[sd.name] == "allow" then
if (d.descriptor_choices.subclass[sd.name] == "allow" or d.descriptor_choices.subclass[sd.name] == "allow-nochange" or d.descriptor_choices.subclass[sd.name] == "nolore") and self:isDescriptorAllowed(sd) then
local locked = self:getLock(sd)
if locked == true then
nodes[#nodes+1] = { name = tstring{{"font", "italic"}, {"color", "GREY"}, "-- locked --", {"font", "normal"}}, id=sd.name, pid=d.name, locked=true, desc=sd.locked_desc..locktext }
elseif locked == false then
local how = self:isDescriptorAllowed(sd)
local desc = sd.desc
if type(desc) == "table" then desc = table.concat(sd.desc, "\n") end
if how == "nolore" and self.descriptors_by_type.subrace then
desc = "#CRIMSON#Playing this class with the race you selected does not make much sense lore-wise. You can still do it but might miss on some special quests/...#WHITE#\n" .. desc
end
nodes[#nodes+1] = { name = sd.display_name, basename=sd.display_name, id=sd.name, pid=d.name, desc=desc }
if self.sel_class and self.sel_class.id == sd.name then newsel = nodes[#nodes] end
end
......
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