Modifier
Modifier is one of the basic elements in the project, which needs to be placed on the unit to produce the corresponding effect.
Functions
remove
Remove a modifier.
modifier: remove()
set_name
Set the name of the modifier.
Parameter
Variable | Type | Description |
---|---|---|
name | str | Name. |
modifier:set_name(name)
set_description
Set the description of the modifier object.
Parameter
Variable | Type | Description |
---|---|---|
description | str | Description. |
modifier:set_description(description)
set_remaining_time
Set remaining duration.
Parameter
Variable | Type | Description |
---|---|---|
time | number | Duration. |
modifier:set_remaining_time(time)
add_remaining_time
Increase remaining duration.
Parameter
Variable | Type | Description |
---|---|---|
time | number | Duration. |
modifier:add_remaining_time(time)
set_stacks
Set the number of stacked layers.
Parameter
Variable | Type | Description |
---|---|---|
stack | number | Number of layers. |
modifier:set_stacks(stack)
add_stacks
Increase the number of stacked layers.
Parameter
Variable | Type | Description |
---|---|---|
stack | number | Number of layers. |
modifier:add_stacks(stack)
set_shield_value
set shield value
Parameter
Variable | Type | Description |
---|---|---|
value | number | Shield value. |
modifier:set_shield_value(value)
add_shield_value
Increase shield value.
Parameter
Variable | Type | Description |
---|---|---|
value | number | Shield value. |
modifier:add_shield_value(value)
has_tag
Whether the modifier has a label or not.
Parameter
Variable | Type | Description |
---|---|---|
description | str | Description. |
Return value
Type | Description |
---|---|
bool | Whether it has a label. |
modifier:has_tag(tag)
icon_is_visible
Whether the icon of the modifier is visible or not.
Return value
Type | Description |
---|---|
bool | Whether the icon is visible. |
modifier:icon_is_visible()
get_stacks
Get the stacked number of modifiers.
Return value
Type | Description |
---|---|
number | Number of stacked layers. |
modifier: get_stacks()
get_remaining_duration
Get the remaining duration of the modifier.
Return value
Type | Description |
---|---|
number | Remaining cooldown. |
modifier: get_remaining_duration()
get_modifier_type
Get the modifier type.
Return value
Type | Description |
---|---|
number | Modifier type ID. |
modifier: get_modifier_type()
get_modifier_effect_type
Get the modifier effect type.
Return value
Type | Description |
---|---|
number | Type of influence. |
modifier: get_modifier_effect_type()
get_max_stacks
Get the maximum number of stacks for modifiers.
Return value
Type | Description |
---|---|
number | Maximum number of stacked layers. |
modifier: get_max_stacks()
get_modifier_shield
Get a shield with magical effects.
Return value
Type | Description |
---|---|
number | Shield value. |
modifier: get_modifier_shield()
get_affiliated_aura
Get the halo.
Return value
Type | Description |
---|---|
modifier | Modifier. |
modifier: get_affiliated_aura()
get_cycle_time
Get modifier cycle.
Return value
Type | Description |
---|---|
number | Cycle time. |
modifier: get_cycle_time()
get_expended_modifier_duration
The duration of the modifier
Return value
Type | Description |
---|---|
number | Elapsed time. |
modifier: get_expended_modifier_duration()
get_modifier_aura_effect_type
Get the aura effect type for the modifier.
Return value
Type | Description |
---|---|
number | Modifier type ID. |
modifier: get_modifier_aura_effect_type()
get_modifier_aura_range
Get the aura range of the modifier.
Return value
Type | Description |
---|---|
number | Range. |
modifier: get_modifier_aura_range()
get_provider
Get the caster of the modifier.
Return value
Type | Description |
---|---|
unit | Applicator. |
modifier: get_provider()
get_receiver
Get the bearer of the modifier.
Return value
Type | Description |
---|---|
unit | Carrier. |
modifier: get_receiver()
get_name
Get the name of the modifier object.
Return value
Type | Description |
---|---|
bool | has label |
modifier: get_name()
get_description
Get the description of the modifier object.
Return value
Type | Description |
---|---|
bool | has label |
modifier: get_description()
get_level
Get grade.
Return value
Type | Description |
---|---|
bool | has label |
modifier: get_level()
modifier_type_icon_is_visible
Whether the icon of the modifier type is visible or not.
Parameter
Variable | Type | Description |
---|---|---|
description | str | Description. |
Return value
Type | Description |
---|---|
bool | has label |
modifier.modifier_type_icon_is_visible(modifier_type)
get_type_of_modifier_entity
The category that gets the modifier.
Parameter
Variable | Type | Description |
---|---|---|
description | str | Description. |
Return value
Type | Description |
---|---|
bool | has label |
modifier. get_type_of_modifier_entity(modifier)
get_modifier_type_description
Get the description of the modifier type.
Parameter
Variable | Type | Description |
---|---|---|
description | str | Description. |
Return value
Type | Description |
---|---|
bool | has label |
modifier. get_modifier_type_description(modifier_type)
get_image_of_modifier_type_icon
Get the picture of the icon of the modifier type.
Parameter
Variable | Type | Description |
---|---|---|
description | str | Description. |
Return value
Type | Description |
---|---|
bool | has label |
modifier.get_image_of_modifier_type_icon(modifier_type)
Events
Magic effect triggers need to be contained in a group to use group variables.
Gain modifier
Get magic effect.
local modifier_group = cli.modifier.create_modifier_trigger_group ( 100001 )
modifier_group . add_trigger ( "Gain modifier" , function ( data )
print ( "Get magic effect" )
end )
Lose modifier
Lost magic effect.
local modifier_group = cli.modifier.create_modifier_trigger_group ( 100001 )
modifier_group . add_trigger ( "Lose modifier)" , function ( data )
print ( "Lost magic effect" )
end )
Period ends
Cycle expires.
local modifier_group = cli.modifier.create_modifier_trigger_group ( 100001 )
modifier_group . add_trigger ( "Period ends" , function ( data )
print ( "Cycle Expired" )
end )
Modifier stacks change
Magic effect layer change event.
local modifier_group = cli.modifier.create_modifier_trigger_group ( 100001 )
modifier_group . add_trigger ( "Modifier stacks change)" , function ( data )
print ( "Magic effect layer change event" )
end )
About to gain modifier
The magic effect is about to be obtained.
local modifier_group = cli.modifier.create_modifier_trigger_group ( 100001 )
modifier_group . add_trigger ( "About to gain modifier" , function ( data )
print ( "The magic effect is about to be obtained" )
end )
Modifier overwritten
Magic effect override.
local modifier_group = cli.modifier.create_modifier_trigger_group ( 100001 )
modifier_group . add_trigger ( "Modifier overwritten" , function ( data )
print ( "Magic effect overwrites" )
end )