getEffects
getEffects
> Functions
Returns the list of effects of the entity with id entity. To get your own entity's list of effects directly, use getEffects with no parameter.
Parameters
- entity: The id of the entity whose list of effects will be returned.
Return
- effects: The list of effects currently on the entity entity. The list of effects is an array containing the effects. An effect is itself an array of 8 elements of the form:
- type is the type of the effect, among:
- EFFECT_DAMAGE, value is the amount of damage
- EFFECT_HEAL, value is the number of life points healed
- EFFECT_BUFF_STRENGTH, value is the strength gained
- EFFECT_BUFF_AGILITY, value is the agility gained
- EFFECT_BUFF_TP, value is the number of TP gained
- EFFECT_BUFF_MP, value is the number of MP gained
- EFFECT_ABSOLUTE_SHIELD, value is the absolute shield gained
- EFFECT_RELATIVE_SHIELD, value is the relative shield gained
- EFFECT_DEBUFF, indicates a debuff, value is the percentage of effects removed.
etc.
- value: The value of the effect.
- caster_id: The id of the entity that cast the effect.
- turns: The number of turns the effect has left, or -1 for an effect that lasts until the end of the fight.
- critical: Whether the effect is a critical hit.
- item_id: The id of the item that caused this effect.
- target_id: The id of the effect's target (entity).
- modifiers: The effect's modifiers (a bit mask of EFFECT_MODIFIER_* constants).
Examples
To find out if you are poisoned: