Class engine.generator.interface.ActorLevel

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 multiplier to the monster level default exp

Methods

engine.generator.interface.ActorLevel:resolveLevel ()

Resolves the correct level called by self:resolve()

engine.generator.interface.ActorLevel:defineExperienceChart (chart)

Defines the experience chart used Static!

engine.generator.interface.ActorLevel:defineMaxLevel (max)

Defines the max level attainable

engine.generator.interface.ActorLevel:getExpChart (level)

Get the exp needed for the given level

engine.generator.interface.ActorLevel:gainExp (value)

Gains some experience If a levelup happens it calls self:levelup(), modules are encouraged to rewrite it to do whatever is needed.

engine.generator.interface.ActorLevel:worthExp (target)

How much experience is this actor worth

engine.generator.interface.ActorLevel:levelup ()

Method called when leveling up, module author rewrite it to do as you please By default this will use infos left by resolvers.levelup() to increase properties

engine.generator.interface.ActorLevel:forceLevelup (lev)

Forces an actor to levelup to "lev"



Methods

engine.generator.interface.ActorLevel:resolveLevel ()
Resolves the correct level called by self:resolve()
engine.generator.interface.ActorLevel: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.
engine.generator.interface.ActorLevel:defineMaxLevel (max)
Defines the max level attainable

Parameters:

  • max the maximum level. Can be nil to not have a limit Static!
engine.generator.interface.ActorLevel:getExpChart (level)
Get the exp needed for the given level

Parameters:

  • level the level to check exp for

Returns:

    nil if this level is not achievable

Or

    the exp needed
engine.generator.interface.ActorLevel:gainExp (value)
Gains some experience If a levelup happens it calls self:levelup(), modules are encouraged to rewrite it to do whatever is needed.

Parameters:

  • value
engine.generator.interface.ActorLevel:worthExp (target)
How much experience is this actor worth

Parameters:

  • target to whom is the exp rewarded

Returns:

    the experience rewarded
engine.generator.interface.ActorLevel:levelup ()
Method called when leveling up, module author rewrite it to do as you please By default this will use infos left by resolvers.levelup() to increase properties
engine.generator.interface.ActorLevel:forceLevelup (lev)
Forces an actor to levelup to "lev"

Parameters:

  • lev
generated by LDoc 1.4.3