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

flyer notification of cooldowns

git-svn-id: http://svn.net-core.org/repos/t-engine4@74 51575b47-30f0-44d4-a5cc-537603b46e54
parent 0b6b1c9b
No related branches found
No related tags found
No related merge requests found
......@@ -254,6 +254,9 @@ end
function _M:cooldownTalents()
for tid, c in pairs(self.talents_cd) do
self.talents_cd[tid] = self.talents_cd[tid] - 1
if self.talents_cd[tid] == 0 then self.talents_cd[tid] = nil end
if self.talents_cd[tid] == 0 then
self.talents_cd[tid] = nil
if self.onTalentCooledDown then self:onTalentCooledDown(tid) end
end
end
end
......@@ -36,6 +36,15 @@ function _M:setName(name)
game.save_name = name
end
--- Notify the player of available cooldowns
function _M:onTalentCooledDown(tid)
local t = self:getTalentFromId(tid)
local x, y = game.level.map:getTileToScreen(self.x, self.y)
game.flyers:add(x, y, 80, -0.3, -1.5, ("%s available"):format(t.name:capitalize()), {0,255,00})
game.log("#00ff00#Talent %s is ready to use.", t.name)
end
function _M:levelup()
mod.class.Actor.levelup(self)
......
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