Module ...

Handles actors stats

Functions

_M:canLearnTalent (t, offset) Checks the talent if learnable
_M:cooldownTalents () Cooldown all talents by one This should be called in your actors "act()" method
_M:getTalentFromId (id) Return talent definition from id
_M:getTalentFullDescription (t) Return the full description of a talent You may overload it to add more data (like power usage, ...)
_M:getTalentLevel (id) Talent level, 0 if not known Includes mastery
_M:getTalentLevelRaw (id) Talent level, 0 if not known
_M:getTalentRange (t) Returns the range of a talent
_M:getTalentReqDesc (t_id, levmod) Formats the requirements as a (multiline) string
_M:getTalentTypeFrom (id) Return talent definition from id
_M:getTalentTypeLevelRaw (tt) Talent type level, sum of all raw levels of talents inside
_M:getTalentTypeMastery (tt) Return talent definition from id
_M:init (t) Initialises stats with default values if needed
_M:isTalentActive (t_id) Is the sustained talent activated ?
_M:isTalentCoolingDown (t) Is talent in cooldown?
_M:knowTalent (id) Do we know this talent
_M:knowTalentType (name) Do we know this talent type
_M:learnTalent (t_id, force, nb) Actor learns a talent
_M:learnTalentType (tt, v, t_id) Actor learns a talent type
_M:loadDefinition (file, env) Defines actor talents Static!
_M:newTalent (t) Defines one talent Static!
_M:newTalentType (t) Defines one talent type(group) Static!
_M:numberKnownTalent (type, exlude_id) Returns how many talents of this type the actor knows
_M:postUseTalent (talent, ret, ab) Called before an talent is used Redefine as needed
_M:preUseTalent (talent, ab) Called before an talent is used Redefine as needed
_M:startTalentCooldown (t) Starts a talent cooldown
_M:unlearnTalent (t_id) Actor forgets a talent
_M:unlearnTalentType (tt, t_id) Actor forgets a talent type
_M:useTalent (id) Make the actor use the talent
_M:useTalentMessage (ab) Replace some markers in a string with info on the talent
_M:useTalents () Show usage dialog


Functions

_M:canLearnTalent (t, offset)
Checks the talent if learnable

Parameters

  • t: the talent to check
  • offset: the level offset to check, defaults to 1
_M:cooldownTalents ()
Cooldown all talents by one This should be called in your actors "act()" method
_M:getTalentFromId (id)
Return talent definition from id

Parameters

  • id:
_M:getTalentFullDescription (t)
Return the full description of a talent You may overload it to add more data (like power usage, ...)

Parameters

  • t:
_M:getTalentLevel (id)
Talent level, 0 if not known Includes mastery

Parameters

  • id:
_M:getTalentLevelRaw (id)
Talent level, 0 if not known

Parameters

  • id:
_M:getTalentRange (t)
Returns the range of a talent

Parameters

  • t:
_M:getTalentReqDesc (t_id, levmod)
Formats the requirements as a (multiline) string

Parameters

  • t_id: the id of the talent to desc
  • levmod: a number (1 should be the smartest) to add to current talent level to display requirements, defaults to 0
_M:getTalentTypeFrom (id)
Return talent definition from id

Parameters

  • id:
_M:getTalentTypeLevelRaw (tt)
Talent type level, sum of all raw levels of talents inside

Parameters

  • tt:
_M:getTalentTypeMastery (tt)
Return talent definition from id

Parameters

  • tt:
_M:init (t)
Initialises stats with default values if needed

Parameters

  • t:
_M:isTalentActive (t_id)
Is the sustained talent activated ?

Parameters

  • t_id:
_M:isTalentCoolingDown (t)
Is talent in cooldown?

Parameters

  • t:
_M:knowTalent (id)
Do we know this talent

Parameters

  • id:
_M:knowTalentType (name)
Do we know this talent type

Parameters

  • name:
_M:learnTalent (t_id, force, nb)
Actor learns a talent

Parameters

  • t_id: the id of the talent to learn
  • force:
  • nb:

Return value:

true if the talent was learnt, nil and an error message otherwise
_M:learnTalentType (tt, v, t_id)
Actor learns a talent type

Parameters

  • tt:
  • v:
  • t_id: the id of the talent to learn

Return value:

true if the talent was learnt, nil and an error message otherwise
_M:loadDefinition (file, env)
Defines actor talents Static!

Parameters

  • file:
  • env:
_M:newTalent (t)
Defines one talent Static!

Parameters

  • t:
_M:newTalentType (t)
Defines one talent type(group) Static!

Parameters

  • t:
_M:numberKnownTalent (type, exlude_id)
Returns how many talents of this type the actor knows

Parameters

  • type: the talent type to count
  • exlude_id: if not nil the count will ignore this talent id
_M:postUseTalent (talent, ret, ab)
Called before an talent is used Redefine as needed

Parameters

  • talent:
  • ret: the return of the talent action
  • ab: the talent (not the id, the table)

Return value:

true to continue, false to stop
_M:preUseTalent (talent, ab)
Called before an talent is used Redefine as needed

Parameters

  • talent:
  • ab: the talent (not the id, the table)

Return value:

true to continue, false to stop
_M:startTalentCooldown (t)
Starts a talent cooldown

Parameters

  • t: the talent to cooldown
_M:unlearnTalent (t_id)
Actor forgets a talent

Parameters

  • t_id: the id of the talent to learn

Return value:

true if the talent was unlearnt, nil and an error message otherwise
_M:unlearnTalentType (tt, t_id)
Actor forgets a talent type

Parameters

  • tt:
  • t_id: the id of the talent to learn

Return value:

true if the talent was unlearnt, nil and an error message otherwise
_M:useTalent (id)
Make the actor use the talent

Parameters

  • id:
_M:useTalentMessage (ab)
Replace some markers in a string with info on the talent

Parameters

  • ab:
_M:useTalents ()
Show usage dialog

Valid XHTML 1.0!