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

fix

git-svn-id: http://svn.net-core.org/repos/t-engine4@499 51575b47-30f0-44d4-a5cc-537603b46e54
parent d1bc5692
No related branches found
No related tags found
No related merge requests found
......@@ -69,7 +69,7 @@ function _M:gainAchievement(id, src, ...)
local a = self.achiev_defs[id]
if not a then error("Unknown achievement "..id) return end
if self.achieved[id] then return end
print("CHECK ACHIEV", id, src.name)
if a.can_gain then
local data = nil
if a.mode == "world" then
......
......@@ -365,6 +365,7 @@ function _M:die(src)
-- Achievements
if src and src:resolveSource().player then
if src:resolveSource().life == 1 then world:gainAchievement("THAT_WAS_CLOSE", src:resolveSource()) end
world:gainAchievement("EXTERMINATOR", src:resolveSource(), self)
world:gainAchievement("PEST_CONTROL", src:resolveSource(), self)
end
......
......@@ -31,6 +31,7 @@ newAchievement{
mode = "player",
can_gain = function(self, who)
self.nb = (self.nb or 0) + 1
print(self.nb, "***")
if self.nb >= 1000 then return true end
end
}
......@@ -39,7 +40,7 @@ newAchievement{
desc = [[Killed 1000 reproducing vermins]],
mode = "player",
can_gain = function(self, who, target)
if target:hasTalent(target.T_MULTIPLY) then
if target:knowTalent(target.T_MULTIPLY) then
self.nb = (self.nb or 0) + 1
if self.nb >= 1000 then return true 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