Constructs a new boost manager.
The base effect value to which boosts are applied.
Optional
boosts: BoostsObjectInit | BoostsObjectInit[]An array of boost objects to initialize with.
Sets or updates a boost with the given parameters.
Sets or updates a boost with the given parameters.
The boost object containing the parameters.
Use setBoost instead.
Readonly
baseThe base effect value.
Readonly
boostAn array of boost objects.
Calculates the cumulative effect of all boosts on the base effect.
The base effect value to calculate with. Defaults to the base effect of the boost manager.
The calculated effect after applying boosts.
Gets a boost object by its ID.
The ID of the boost to retrieve.
The boost object if found, or null if not found.
Use getBoosts instead.
Gets all boosts with the given ID.
A string or regular expression to match the ID of the boosts.
An array of boost objects with the given ID, or a tuple of the array and the index of the boosts.
// Get all boosts with the ID "healthBoost"
const healthBoosts = boost.getBoosts("healthBoost");
// Get all boosts with the ID "healthBoost" and their index
const [healthBoosts, healthBoostIndexes] = boost.getBoosts("healthBoost", true);
// Get all boosts with the ID "healthBoost" or "manaBoost"
const healthAndManaBoosts = boost.getBoosts(/(health|mana)Boost/);
Sets or updates a boost with the given parameters.
Sets or updates a boost with the given parameters.
The boost object containing the parameters.
Represents a boost manager that applies various effects to a base value. Typically used in combination with Attribute or Currency classes.