Interface BoostsObjectInit

An object representing a boost.

interface BoostsObjectInit {
    desc?: Pointer<string>;
    description?: string | ((...args: any[]) => string);
    id: string;
    name?: string;
    order?: number;
    value: ((input: Decimal) => Decimal);
}

Implemented by

Properties

desc?: Pointer<string>

Use description instead. This will do nothing

description?: string | ((...args: any[]) => string)

An optional description of the boost. Can be a string or a function that returns a string. Made into a getter function to allow for dynamic descriptions.

// A dynamic description that returns a string
const description = (a, b) => `This is a ${a} that returns a ${b}`;
// ... create boost
const boost = boost.getBoost("boostID");

// Getter property
console.log(boost.description); // "This is a undefined that returns a undefined"

// Getter function
console.log(boost.descriptionFn("dynamic", "string")); // "This is a dynamic that returns a string"
id: string

The ID of the boost.

name?: string

The name of the boost.

order?: number

The order at which the boost is applied. Lower orders are applied first.

value: ((input: Decimal) => Decimal)

The function that calculates the value of the boost.

Type declaration

// A boost that adds 10 to the input value.
(input) => input.add(10)

// A boost that multiplies the input value by 2.
(input) => input.mul(2)