Skip to content

Profectus / features/conversion / Conversion

Interface: Conversion ​

The properties that are added onto a processed ConversionOptions to create a Conversion.

Properties ​

actualGain ​

actualGain: MaybeRef<DecimalSource>

The absolute amount the output resource will be changed by. Typically this will be set for you in a conversion constructor. This will differ from currentGain in the cases where the conversion isn't just adding the converted amount to the output resource.

Defined in ​

profectus/src/features/conversion.ts:94


baseResource ​

baseResource: Resource

The input features/resources/resource.Resource for this conversion.

Defined in ​

profectus/src/features/conversion.ts:109


buyMax ​

buyMax: MaybeRef<boolean>

Whether or not to cap the amount of the output resource gained by converting at 1. Defaults to true.

Defined in ​

profectus/src/features/conversion.ts:118


convert ​

convert: VoidFunction

The function that performs the actual conversion from baseResource to gainResource. Typically this will be set for you in a conversion constructor.

Defined in ​

profectus/src/features/conversion.ts:123


currentAt ​

currentAt: MaybeRef<DecimalSource>

The amount of the input resource currently being required in order to produce the currentGain. That is, if it went below this value then currentGain would decrease. Typically this will be set for you in a conversion constructor.

Defined in ​

profectus/src/features/conversion.ts:100


currentGain ​

currentGain: MaybeRef<DecimalSource>

How much of the output resource the conversion can currently convert for. Typically this will be set for you in a conversion constructor.

Defined in ​

profectus/src/features/conversion.ts:88


formula ​

formula: InvertibleFormula

The formula used to determine how much gainResource should be earned by this converting.

Defined in ​

profectus/src/features/conversion.ts:83


gainResource ​

gainResource: Resource

The output features/resources/resource.Resource for this conversion. i.e. the resource being generated.

Defined in ​

profectus/src/features/conversion.ts:113


nextAt ​

nextAt: MaybeRef<DecimalSource>

The amount of the input resource required to make currentGain increase. Typically this will be set for you in a conversion constructor.

Defined in ​

profectus/src/features/conversion.ts:105


onConvert()? ​

optional onConvert: (amountGained) => void

A callback that happens after a conversion has been completed. Receives the amount gained via conversion. This will not be called whenever using currentGain without calling convert (e.g. passive generation)

Parameters ​

amountGained ​

DecimalSource

Returns ​

void

Defined in ​

profectus/src/features/conversion.ts:134


spend() ​

spend: (amountGained) => void

The function that spends the baseResource as part of the conversion. Defaults to setting the baseResource amount to 0.

Parameters ​

amountGained ​

DecimalSource

Returns ​

void

Defined in ​

profectus/src/features/conversion.ts:128