Better Trims provides a flexible system for defining values that scale based on the number of matching trims the player is wearing. These are known as "count-based values".
Types
Constant
A constant value is a fixed value that does not change based on the number of matching trims.
{"type": "bettertrims:constant","value": 5.0}
Note
Constant values can be in-lined directly where a count-based value is expected, without needing to wrap them in an object.
Inside a Value Ability:
{"type": "bettertrims:add","value": 5.0 // Where a <count-based-value> is expected a constant can be used directly}
Linear
A linear value scales linearly with the number of matching trims.
{"type": "bettertrims:linear","base": 2.0, // The base value when 1 matching trim is present"per_count_above_first": 1.5, // The amount to add for each additional matching trim above the first}
Clamped
A clamped value accepts another count-based value and clamps it between a minimum and maximum value.
{"type": "bettertrims:clamped","value": <count-based-value>,"min": 1.0,"max": 10.0}
Count Squared
A count squared value scales with the square of the number of matching trims, plus a constant.
{"type": "bettertrims:count_squared","constant": 3.0}
Fraction
A fraction value divides a count-based value by another count-based value.
{"type": "bettertrims:fraction","numerator": <count-based-value>,"denominator": <count-based-value>}
Warning
If the denominator evaluates to 0, the entire fraction will evaluate to 0 to avoid division by zero errors.
Lookup
A lookup value uses a predefined list of values, where the index corresponds to the count of matching trims. It also accepts a count-based value as a fallback, which is used if the count exceeds the length of the lookup list.
{"type": "bettertrims:lookup","values": [0.0, 1.5, 3.0, 5.0],"fallback": <count-based-value>}