Introduction

Effects are database items that can be applied accross the village to change statistics, give or take items, or consume time.

Effects

Base impacts

Adding new impacts

To add a new impact, you have to extend a manager, or create a new manager, and override the function ApplyEffect() or ApplyChoiceEffect(). Here you can add the behavior.

Applying effects

When are effects applied

Effects are automatically applied when a choice is made. When a choice is selected, the opportunity manager creates an instance of ChoiceEffect, and passes it to the VillageManager with ApplyChoiceEffect(choiceEffect)

The village manager will first apply all the effects to itself (consuming time) then, for each of its components, call the function VillageComponent.ApplyChoiceEffect(choiceEffect).

Each component registered is responsible to apply effects onto itself. Currently, the ones impacted are the CommodityManager and InventoryManager.

CommodityManager will apply the trust delta to the trust of all villagers in its list.

InventoryManager will remove or add items if they are present. It will how many items are removed or added in the choice effect.

Manually applying effects

You can also manually apply effects, either to all the village, by calling VillageManager.ApplyEffect(), which will propagate to all components, or per components, as they all inherit the function ApplyEffect().