rex_buff
Introduction
A variable which supports buffs. Get sum from base value and buffs.
A variable which supports buffs. Get sum from base value and buffs.
Concept
The result is the sum of base value and buffs. i.e.
The result is the sum of base value and buffs. i.e.
sum = base + buff0 + buff1 + ....
Base value
Base value could be set by "Base" in properties table, or set by "Action:Set value", or "Action:Add to", "Action:Subtract from" in category of "Base".
Base value could be set by "Base" in properties table, or set by "Action:Set value", or "Action:Add to", "Action:Subtract from" in category of "Base".
Buff
Add buff by "Action:Add" in category of "Buff". There are 4 parameters -
Add buff by "Action:Add" in category of "Buff". There are 4 parameters -
Name
Buff name, which is an index of this buff.
Buff name, which is an index of this buff.
Priority
Buffs will be sorted by priority in increasing-order, which is the order of getting result of sum. It will affect the definition of "base value" , see "Value" in the next section.
Buffs will be sorted by priority in increasing-order, which is the order of getting result of sum. It will affect the definition of "base value" , see "Value" in the next section.
Value
It is the increasing value to add to the result of sum, which could be a number like
It is the increasing value to add to the result of sum, which could be a number like
10
, or a string like
"10"
or
"10%"
A string with a "%" at the end is a percentage , which means that this increasing value is calculated by
base value * percentage
The "base value" in the formula might be
- The base value of this behavior, if priority is less then 0
- The previous result of sum, if priority equal or larger then 0
The increasing value could be positive or negative.
Clamp
If set to "Clamped in boundaries", current result of sum will be clamped at maximum and minimum boundaries.
The maximum and minimum boundaries is set by "Max", "Min" in properties table, or set by "Action:Set maximum bound", "Action:Set minimum bound".
If set to "Clamped in boundaries", current result of sum will be clamped at maximum and minimum boundaries.
The maximum and minimum boundaries is set by "Max", "Min" in properties table, or set by "Action:Set maximum bound", "Action:Set minimum bound".
Remove buff
Call "Action:Remove" to remove buff by name. Or call "Action:Remove all" to remove all buffs.
Call "Action:Remove" to remove buff by name. Or call "Action:Remove all" to remove all buffs.
Result of sum
Get result of sum by "Expression:Sum".
The total amount of increasing value of buffs could be got by "Expression:Buff" with no parameter. Add
"Condition:On sum changing" will be triggered when sum changing.
Get result of sum by "Expression:Sum".
The total amount of increasing value of buffs could be got by "Expression:Buff" with no parameter. Add
- buff name (string), or
- buff index in queue (number)
"Condition:On sum changing" will be triggered when sum changing.
Retrieve buffs
Retrieve each buff in queue by "Condition:For each buff", get buff name and buff value by "Expression:CurBuffName", "Expression:CurBuffValue".
Get buff name and buff value by "Expression:Index2BuffName( index )", "Expression:Index2BuffValue( index )"
Retrieve each buff in queue by "Condition:For each buff", get buff name and buff value by "Expression:CurBuffName", "Expression:CurBuffValue".
Get buff name and buff value by "Expression:Index2BuffName( index )", "Expression:Index2BuffValue( index )"
Debug panel
The base value and the increasing value of each buff, and the result of sum are listed in debugger panel. Edit them could affect the result of sum at run-time.
The base value and the increasing value of each buff, and the result of sum are listed in debugger panel. Edit them could affect the result of sum at run-time.