diff options
Diffstat (limited to 'doc/lua/statuseffect.md')
-rw-r--r-- | doc/lua/statuseffect.md | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/doc/lua/statuseffect.md b/doc/lua/statuseffect.md new file mode 100644 index 0000000..930bed2 --- /dev/null +++ b/doc/lua/statuseffect.md @@ -0,0 +1,69 @@ +# effect + +The `effect` table relates to functions specifically for status effects. + +--- + +#### `float` effect.duration() + +Returns the remaining duration of the status effect. + +--- + +#### `void` effect.modifyDuration(`float` duration) + +Adds the specified duration to the current remaining duration. + +--- + +#### `void` effect.expire() + +Immediately expire the effect, setting the duration to 0. + +--- + +#### `EntityId` effect.sourceEntity() + +Returns the source entity id of the status effect, if any. + +--- + +#### `void` effect.setParentDirectives(`String` directives) + +Sets image processing directives for the entity the status effect is active on. + +--- + +#### `Json` effect.getParameter(`String` name, `Json` def) + +Returns the value associated with the parameter name in the effect configuration. If no value is set, returns the default specified. + +--- + +#### `StatModifierGroupId` effect.addStatModifierGroup(`List<StatModifier>` modifiers) + +Adds a new stat modifier group and returns the ID created for the group. Stat modifier groups will stay active until the effect expires. + +Stat modifiers are of the format: + +```lua +{ + stat = "health", + + amount = 50 + --OR baseMultiplier = 1.5 + --OR effectiveMultiplier = 1.5 +} +``` + +--- + +#### `void` effect.setStatModifierGroup(`StatModifierGroupId`, groupId, `List<StatModifier>` modifiers) + +Replaces the list of stat modifiers in a group with the specified modifiers. + +--- + +#### `void` effect.removeStatModifierGroup(`StatModifierGroupId` groupId) + +Removes the specified stat modifier group. |