Effects are database items that can be applied accross the village to change statistics, give or take items, or consume time.
Trust :
Will apply “Eff_TrustDelta” to the trust of all villagers in “Eff_Villagers”
Item :
Will add or remove “Eff_ItemType” from your inventory, in a random range between “Eff_ItemMinDelta” and “Eff_ItemMaxDelta”. This randomization is linked to the seed.
Time:
Will add to the current date “Eff_TimeDelta” in hours. If the amount is negative, it will be flattened to positive. (You cannot remove time).
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.
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.
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().