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

spell ideas

git-svn-id: http://svn.net-core.org/repos/t-engine4@117 51575b47-30f0-44d4-a5cc-537603b46e54
parent 0a85aa6f
No related branches found
No related tags found
No related merge requests found
...@@ -21,6 +21,15 @@ function _M:init(t) ...@@ -21,6 +21,15 @@ function _M:init(t)
self.compute_vals = {} self.compute_vals = {}
end end
--- Tells the actor it can act
function _M:act()
if self.changed then self:updateBonus() end
end
--- Recompute the bonus when something changed
function _M:updateBonus()
end
--- Moves an actor on the map --- Moves an actor on the map
-- *WARNING*: changing x and y properties manualy is *WRONG* and will blow up in your face. Use this method. Always. -- *WARNING*: changing x and y properties manualy is *WRONG* and will blow up in your face. Use this method. Always.
-- @param map the map to move onto -- @param map the map to move onto
......
...@@ -48,6 +48,8 @@ function _M:act() ...@@ -48,6 +48,8 @@ function _M:act()
self:regenResources() self:regenResources()
-- Compute timed effects -- Compute timed effects
self:timedEffects() self:timedEffects()
engine.Actor.act(self)
end end
function _M:move(x, y, force) function _M:move(x, y, force)
...@@ -102,6 +104,10 @@ function _M:levelup() ...@@ -102,6 +104,10 @@ function _M:levelup()
end end
end end
function _M:updateBonus()
engine.Actor.updateBonus(self)
end
--- Notifies a change of stat value --- Notifies a change of stat value
function _M:onStatChange(stat, v) function _M:onStatChange(stat, v)
if stat == self.STAT_CON then if stat == self.STAT_CON then
......
No preview for this file type
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