SetStat
This effect allows you to set the value of a particular stat. If manually
adding to the stat value, consider using addToStat instead (you will find
an extensive example in its documentation). setStat will utilize value
overrides as opposed to modifier overrides (which addToStat would use
instead).
JSON Format
{
"type": "setStat",
"stat": ...,
"meta_stat": ...,
"new_value": ...,
"aggregation_type": ...,
"calculated_aggregation_type": ...
}
Fields
| Field | Type | Required | Description |
|---|---|---|---|
stat | String | Stat to affect. Either stat or meta_stat need to be present. If both are present, stat will take priority. | |
meta_stat | StatFormulaComponent | Stat to affect. Either stat or meta_stat need to be present. If both are present, stat will take priority. meta_stat should only be used if the stat to affect needs to be calculated in runtime, as it impacts app performance. This stat formula must return a string. | |
new_value | StatFormulaComponent | ✓ | The formula for the value that the stat should be set to. The value this stat formula returns must have the same type as the one declared in the value_type (and sub_value_type, if appropriate) for the stat specified in stat or meta_stat. |
aggregation_type | AggregationType | The aggregation type for the override resulting from the execution of this effect. See AggregationType for more details. If both aggregation_type and calculated_aggregation_type are omitted, the override will use none as the default aggregation type. | |
calculated_aggregation_type | StatFormulaComponent | To be used when the aggregation type should be calculated in runtime. Otherwise, use aggregation_type. If aggregation_type is also defined, this property will be ignored. This stat formula must return a string value matching one of the AggregationType values. |