Class Service

Methods

service:init (data) Initiate a service from its definition.
service:activate (user) Activate a service, if the player meets its requires() code.
service:get_cost_text () Gets the cost text of the service.


Methods

service:init (data)
Initiate a service from its definition. You shouldn't use this function, the game uses it at loadtime to instantiate the services.

Parameters:

  • data Table. The table of service information.

Returns:

    Service. The service itself.
service:activate (user)
Activate a service, if the player meets its requires() code. Calls the use() code of the service.

Parameters:

  • user Creature. The creature trying to use the service (defauls to player)

Returns:

  1. Boolean. Whether or not the use of the service was successful.
  2. String. A string explaining why it wasn't successful.
service:get_cost_text ()
Gets the cost text of the service.

Returns:

    String. The service's cost text.
generated by LDoc 1.5.0 Last updated 2025-05-24 09:49:55