Module ...

Handles actors stats

Functions

_M:automaticTalents () Try to auto use listed talents This should be called in your actors "act()" method
_M:callTalent (tid, name, ...) Trigger a talent method
_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:forceUseTalent (t, def) Force a talent to activate without using energy or such "def" can have a field "ignore_energy" to not consume energy; other parameters can be passed and handled by an overload of this method.
_M:getTalentCooldown (t) Gets a talent cooldown
_M:getTalentDisplayName (t) Returns display name
_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:getTalentMastery (t) Return talent type mastery for this talent
_M:getTalentProjectileSpeed (t) Returns the projectile speed of a talent
_M:getTalentRadius (t) Returns the radius of a talent
_M:getTalentRange (t) Returns the range of a talent
_M:getTalentReqDesc (t_id, levmod) Formats the requirements as a (multiline) string
_M:getTalentTarget (t) Returns the target type of a talent
_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 type mastery
_M:init (t) Initialises stats with default values if needed
_M:isTalentActive (t_id) Is the sustained talent activated ?
_M:isTalentAuto (tid) Setup the talent as autocast
_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, exclude_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, silent, fake, ab) Called before an talent is used Redefine as needed
_M:resolveLevelTalents () Resolve leveling talents
_M:setTalentAuto (tid, v) Setup the talent as autocast
_M:setTalentTypeMastery (tt, v) Sets talent type mastery
_M:startTalentCooldown (t) Starts a talent cooldown
_M:talentTemporaryValue (p, k, v) Helper function to add temporary values and not have to remove them manualy
_M:triggerTalent (tid, name, ...) Trigger a talent method
_M:unlearnTalent (t_id, nb) Actor forgets a talent
_M:unlearnTalentType (tt, t_id) Actor forgets a talent type
_M:updateTalentTypeMastery (tt) Recompute things that need recomputing
_M:useTalent (id, who, force_level, ignore_cd, force_target, silent) Make the actor use the talent
_M:useTalentMessage (ab) Replace some markers in a string with info on the talent
_M:useTalents (add_cols) Show usage dialog


Functions

_M:automaticTalents ()
Try to auto use listed talents This should be called in your actors "act()" method
_M:callTalent (tid, name, ...)
Trigger a talent method

Parameters

  • tid:
  • name:
  • ...:
_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:forceUseTalent (t, def)
Force a talent to activate without using energy or such "def" can have a field "ignore_energy" to not consume energy; other parameters can be passed and handled by an overload of this method. Object activation interface calls this method with an "ignore_ressources" parameter

Parameters

  • t:
  • def:
_M:getTalentCooldown (t)
Gets a talent cooldown

Parameters

  • t: the talent to get cooldown
_M:getTalentDisplayName (t)
Returns display name

Parameters

  • t:
_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:getTalentMastery (t)
Return talent type mastery for this talent

Parameters

  • t:
_M:getTalentProjectileSpeed (t)
Returns the projectile speed of a talent

Parameters

  • t:
_M:getTalentRadius (t)
Returns the radius of a talent

Parameters

  • t:
_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:getTalentTarget (t)
Returns the target type of a talent

Parameters

  • t:
_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 type mastery

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:isTalentAuto (tid)
Setup the talent as autocast

Parameters

  • tid:
_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: if true do not check canLearnTalent
  • nb: the amount to increase the raw talent level by, default 1

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, exclude_id)
Returns how many talents of this type the actor knows

Parameters

  • type: the talent type to count
  • exclude_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, silent, fake, ab)
Called before an talent is used Redefine as needed

Parameters

  • talent:
  • silent: no messages will be outputted
  • fake: no actions are taken, only checks
  • ab: the talent (not the id, the table)

Return value:

true to continue, false to stop
_M:resolveLevelTalents ()
Resolve leveling talents
_M:setTalentAuto (tid, v)
Setup the talent as autocast

Parameters

  • tid:
  • v:
_M:setTalentTypeMastery (tt, v)
Sets talent type mastery

Parameters

  • tt:
  • v:
_M:startTalentCooldown (t)
Starts a talent cooldown

Parameters

  • t: the talent to cooldown
_M:talentTemporaryValue (p, k, v)
Helper function to add temporary values and not have to remove them manualy

Parameters

  • p:
  • k:
  • v:
_M:triggerTalent (tid, name, ...)
Trigger a talent method

Parameters

  • tid:
  • name:
  • ...:
_M:unlearnTalent (t_id, nb)
Actor forgets a talent

Parameters

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

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:updateTalentTypeMastery (tt)
Recompute things that need recomputing

Parameters

  • tt:
_M:useTalent (id, who, force_level, ignore_cd, force_target, silent)
Make the actor use the talent

Parameters

  • id:
  • who:
  • force_level:
  • ignore_cd:
  • force_target:
  • silent:
_M:useTalentMessage (ab)
Replace some markers in a string with info on the talent

Parameters

  • ab:
_M:useTalents (add_cols)
Show usage dialog

Parameters

  • add_cols:

Valid XHTML 1.0!