Commit 14ce2042b3dcbdad26d849fc053ec6eed9eb4986

Authored by dg
1 parent d746ccb6

Talents resolver can resolve subresolvers


git-svn-id: http://svn.net-core.org/repos/t-engine4@2640 51575b47-30f0-44d4-a5cc-537603b46e54
... ... @@ -59,7 +59,13 @@ function resolvers.talents(list)
59 59 return {__resolver="talents", list}
60 60 end
61 61 function resolvers.calc.talents(t, e)
62   - for tid, level in pairs(t[1]) do e:learnTalent(tid, true, level) end
  62 + for tid, level in pairs(t[1]) do
  63 + if type(level) == "table" and level.__resolver then
  64 + level = resolvers.calc[level.__resolver](level, e)
  65 + end
  66 + print("Talent resolver for", e.name, ":", tid, "=>", level)
  67 + e:learnTalent(tid, true, level)
  68 + end
63 69 return nil
64 70 end
65 71
... ...