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

Stats at birth as correctly applied

git-svn-id: http://svn.net-core.org/repos/t-engine4@1512 51575b47-30f0-44d4-a5cc-537603b46e54
parent 2a46d674
No related branches found
No related tags found
No related merge requests found
......@@ -259,6 +259,7 @@ end
--- Apply all birth options to the actor
function _M:apply()
self.actor.descriptor = {}
local stats = {}
for i, d in ipairs(self.descriptors) do
print("[BIRTH] Applying descriptor "..d.name)
self.actor.descriptor[d.type] = d.name
......@@ -276,7 +277,7 @@ function _M:apply()
-- Change stats
if d.stats then
for stat, inc in pairs(d.stats) do
self.actor:incStat(stat, inc)
stats[stat] = (stats[stat] or 0) + inc
end
end
if d.talents_types then
......@@ -289,7 +290,6 @@ function _M:apply()
end
self.actor:learnTalentType(t, v)
self.actor.talents_types_mastery[t] = (self.actor.talents_types_mastery[t] or 1) + mastery
print(t)
end
end
if d.talents then
......@@ -305,4 +305,9 @@ function _M:apply()
self.actor:initBody()
end
end
-- Apply stats now to not be overridden by other things
for stat, inc in pairs(stats) do
self.actor:incStat(stat, inc)
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