Status Effects
BE CAREFUL WITH THAT...! ... Never mind, I'll be poisoned for the next 3 minutes...
Last updated
Was this helpful?
BE CAREFUL WITH THAT...! ... Never mind, I'll be poisoned for the next 3 minutes...
Last updated
Was this helpful?
Status Effects are temporary effects that happen to a character or game object with a Stats component. These effects can either be positive to the affected (buff) or have negative effects (debuff).
Status Effects have some common properties, such as a localizable name, a description, an icon and a color. These properties can be used in the .
The most important part are the Actions they invoke. There are three of them:
These Actions are executed as soon as the Status Effect starts and is intended to be used to initialize the effects of the status.
For example, if a Status Effect increases the strength
of the bearer, the Action executed On Start should be adding a Stat Modifier to the Invoker object.
These Actions have a very special behavior. Once they are finished they are called again until the Status Effect is worn off.
For example, the Status Effect Poison, which drains health from the invoker should have two Actions:
Decrease 5 points from the invoker's health attribute
Wait 0.25 seconds
In order to maximize performance you should add a Wait Action at the beginning or the end of these Actions, so they are not invoked every frame.
These Actions are executed as soon as the Status Effect is worn off and should be used to restore the previous state of the affected object.
For example, following the example of the On Start, where the character's strength is increased by 10 points, On End should remove the Stat Modifier that increases 10 points.
It is worth noting that when a game is saved through the Save/Load system, the current Status Effects applied to the different objects are also saved.
When restoring a previously saved game, the On Start actions will be called for each Status Effect that was in effect when the game was saved. The remaining time of each Status Effect will also be the same as the one when the game was saved.