Skip to content

Rewards

Rewards are the primary method used for giving Currencies to the user. A Reward is an Entity and comes with associated classes like RewardData and RewardDataAsset.

Reward Relationships

rewardrelationships rewarddatarelationships

Common Rewards

rewardinteractions

CurrencyReward

This reward can grant any currency in any state. It throws a warning if it rewards a currency that has not been obtained yet. It does not make rewarded currencies available.

[CurrencyAvailableReward] (~/docs/manual/components/entities/rewards/currencyavailablereward.md)

This reward can grant available and unavailable currencies, though if it grants a currency that is already obtained, it uses a fallback amount instead. This is done to allow for cases where the player has already obtained a currency and a small reward would be underwhelming.

RandomObtainedCurrencyReward

This reward randomly grants a currency that is both available and obtained. These currencies must also match the associated TagConsumerData. If none is available, it grants a fallback reward. If there is no fallback reward available, it throws a warning and no currency is granted.

RandomUnobtainedCurrencyReward

This reward randomly grants a currency that is available and not yet obtained. These currencies must also match the associated TagConsumerData. It uses the fallback if these conditions cannot be met. If there is no fallback reward available, it throws a warning and no currency is granted.

Other Reward Types

There are other reward types that are used for more specific situations. They generally wrap one or more other rewards and use logic to determine what actually to grant to the user.

AscensionReward

This reward is used when a user moves from one Stage to the next. It uses additional information to calculate appropriate rewards.

GachaReward

This reward can grant one or more other rewards based on a dice roll mechanic.

StoreTimedReward

This reward can only be claimed after a specific period of time has passed since it was last claimed.

Reward Actions

Below are the State Actions related to Rewards, all of which extends GrantRewardStateAction:

AscensionCompleteStateAction

This action is fired when the player moves from one Stage to the next. It uses an ascension score value combined with an AscensionReward to determine which reward to use.

ClaimEventRewardsStateAction

This action is fired when an EventContent has been completed and rewards are claimed. This event works with any Reward type and determines which ones to reward based on how many Milestones the player completed.

ClaimGoalStateAction

When a goal is claimed, this action is fired and the player is rewarded the associated Reward.

ClaimStoreTimedRewardStateAction

This action is used to reward StoreTimedRewards. It contains logic to manage the time-related SavedData for this reward.

GeneratorUnitTargetHitStateAction

If a Generator has its units incremented above its current GeneratorUnitTargetData target amount, this action fires and rewards the user the associated Reward.