Class Condition

Methods

condition:init (data) Initiate a condition from its definition.
condition:get_description (noBoosts, possessor) Gets the full description of the condition
condition:advance (possessor) Placeholder for the advance() callback, code called by the condition every turn
condition:moves (possessor) Placeholder for the moves() callback, code called by the condition when the possessor the condition moves
condition:attacks (possessor) Placeholder for the attacks() callback, code called by the condition when the possessor the condition attacks someone
condition:apply (possessor, applier, turns, args) Wrapper for the applied() callback
condition:can_apply (possessor, applier, turns) Checks immune_creature_types of the condition, and the condition's can_apply() callback, if it exists
condition:cure (possessor) Wrapper for the cured() callback
condition:is_type (tag) Checks if an condition is of a type


Methods

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

Parameters:

  • data Table. The table of condition information.

Returns:

    Condition. The condition itself.
condition:get_description (noBoosts, possessor)
Gets the full description of the condition

Parameters:

  • noBoosts Boolean. If true, don't display the boosts
  • possessor Creature. The creature who has the condition. Used for displaying customized boosts

Returns:

    String. The description
condition:advance (possessor)
Placeholder for the advance() callback, code called by the condition every turn

Parameters:

  • possessor Creature. The creature who's afflicted with the condition

Returns:

    true
condition:moves (possessor)
Placeholder for the moves() callback, code called by the condition when the possessor the condition moves

Parameters:

  • possessor Creature. The creature who's afflicted with the condition

Returns:

    true
condition:attacks (possessor)
Placeholder for the attacks() callback, code called by the condition when the possessor the condition attacks someone

Parameters:

  • possessor Creature. The creature who's afflicted with the condition

Returns:

    true
condition:apply (possessor, applier, turns, args)
Wrapper for the applied() callback

Parameters:

  • possessor Creature. The creature who's afflicted with the condition
  • applier Creature. The creature who inflicts the condition
  • turns Number. The number of turns to apply the condition.
  • args Anything. Arguments to pass to the condition.

Returns:

    Boolean. Whether the application was successful or not.
condition:can_apply (possessor, applier, turns)
Checks immune_creature_types of the condition, and the condition's can_apply() callback, if it exists

Parameters:

  • possessor Creature. The creature who's afflicted with the condition
  • applier Creature. The creature who inflicts the condition
  • turns Number. The number of turns to apply the condition.

Returns:

    Boolean. Whether the application was successful or not.
condition:cure (possessor)
Wrapper for the cured() callback

Parameters:

  • possessor Creature. The creature who's afflicted with the condition

Returns:

    Boolean. Whether the cure was successful or not.
condition:is_type (tag)
Checks if an condition is of a type

Parameters:

  • tag String. The tag to check for

Returns:

    Boolean. Whether or not it has the tag.
generated by LDoc 1.5.0 Last updated 2025-05-24 09:49:55