Module ...

Interface to add leveling capabilities to actors Defines the exp property, which is the current experience, level which is the current level and exp_worth which is a multiplicator to the monster level default exp

Functions

_M:defineExperienceChart (chart) Defines the experience chart used Static!
_M:defineMaxLevel (max) Defines the max level attainable
_M:forceLevelup (lev) Forces an actor to levelup to "lev"
_M:gainExp (value) Gains some experience If a levelup happens it calls self:levelup(), modules are encourraged to rewrite it to do whatever is needed.
_M:getExpChart (level) Get the exp needed for the given level
_M:levelup () Method called when leveing up, module author rewrite it to do as you please
_M:resolveLevel () Resolves the correct level called by self:resolve()
_M:worthExp (target) How much experience is this actor worth


Functions

_M:defineExperienceChart (chart)
Defines the experience chart used Static!

Parameters

  • chart: either a table of format "[level] = exp_needed" or a function that takes one parameter, a level, and returns the experience needed to reach it.
_M:defineMaxLevel (max)
Defines the max level attainable

Parameters

  • max: the maximun level. Can be nil to not have a limit Static!
_M:forceLevelup (lev)
Forces an actor to levelup to "lev"

Parameters

  • lev:
_M:gainExp (value)
Gains some experience If a levelup happens it calls self:levelup(), modules are encourraged to rewrite it to do whatever is needed.

Parameters

  • value:
_M:getExpChart (level)
Get the exp needed for the given level

Parameters

  • level: the level to check exp for

Return value:

the exp needed, or nil if this level is not achievable
_M:levelup ()
Method called when leveing up, module author rewrite it to do as you please
_M:resolveLevel ()
Resolves the correct level called by self:resolve()
_M:worthExp (target)
How much experience is this actor worth

Parameters

  • target: to whom is the exp rewarded

Return value:

the experience rewarded

Valid XHTML 1.0!