Class engine.generator.interface.ActorResource

Handles actors life and death

Methods

engine.generator.interface.ActorResource:defineResource (name, short_name, talent, regen_prop, desc, min, params)

Defines an Actor resource Static! This defines for all actors the methods :getResource(), :incResource(), :getMinResource(), :incMinResource(), :getMaxResource(), and :incMaxResource() (where "Resource" = shortname:lower():capitalize()) Actors can have self[shortname], self[minshortname], self[maxshortname], and self[regen_prop (if defined)] initialized on creation by calling ActorResource:init() It is advised to NOT access .resourcename directly and use the get/inc methods to properly handle talent dependencies

engine.generator.interface.ActorResource:regenResources ()

Regen resources, should be called in your actor's act() method



Methods

engine.generator.interface.ActorResource:defineResource (name, short_name, talent, regen_prop, desc, min, params)
Defines an Actor resource Static! This defines for all actors the methods :getResource(), :incResource(), :getMinResource(), :incMinResource(), :getMaxResource(), and :incMaxResource() (where "Resource" = shortname:lower():capitalize()) Actors can have self[shortname], self[minshortname], self[maxshortname], and self[regen_prop (if defined)] initialized on creation by calling ActorResource:init() It is advised to NOT access .resourcename directly and use the get/inc methods to properly handle talent dependencies

Parameters:

  • name -- name of the Resource
  • short_name -- internal name for the resource, self[short_name] holds the (numeric) resource value
  • talent -- talent associated with the resource (generally a resource pool)
  • regen_prop -- self[shortname] is incremented by self[regenprop] when self:regenResources is called
  • desc -- textual description of the resource
  • min , max -- minimum and maximum values for the resource <0, 100>, Assign false for no limit
  • params -- table of additional parameters to merge (last) into the definition table
engine.generator.interface.ActorResource:regenResources ()
Regen resources, should be called in your actor's act() method
generated by LDoc 1.4.3