Profectus / game/modifiers / Modifier
Interface: Modifier ​
An object that can be used to apply or unapply some modification to a number. Being reversible requires the operation being invertible, but some features may rely on that. Descriptions can be optionally included for displaying them to the player. The built-in modifier creators are designed to display the modifiers using createModifierSection.
Properties ​
apply() ​
apply: (
gain
) =>DecimalSource
Applies some operation on the input and returns the result.
Parameters ​
gain ​
Returns ​
Defined in ​
profectus/src/game/modifiers.tsx:21
description? ​
optional
description:MaybeGetter
<Renderable
>
A description of this modifier.
See ​
Defined in ​
profectus/src/game/modifiers.tsx:35
enabled? ​
optional
enabled:MaybeRef
<boolean
>
Whether or not this modifier should be considered enabled. Typically for use with modifiers passed into createSequentialModifier.
Defined in ​
profectus/src/game/modifiers.tsx:30
getFormula()? ​
optional
getFormula: (gain
) =>GenericFormula
Get a formula for this modifier. Required by some features.
Parameters ​
gain ​
any
Returns ​
Defined in ​
profectus/src/game/modifiers.tsx:25
invert()? ​
optional
invert: (gain
) =>DecimalSource
Reverses the operation applied by the apply property. Required by some features.