Have you ever played RPG`s? Or metroidvanias? Well, one thing that can turn the tables when fighting certain enemies is status effects that affect character in various ways after certain events, being getting hit by certain enemies or using certain items. They can be negative, like poison or petrification, or positive, like invincibility or regeneration. All in all this library allows to bring status effects in ZC! By default, it features 8 negative status effects to use, but you can add more effects, insluding positive ones.
All status effects have 4 phases:
1. Has started. This phase indicates the moment the status effect has bee induced. The code here runs one time.
2. Active. Default state of effect. Runs every frame until timer expires, unless status effect is permanent.
3. Has expired. Occurs, when status effect timer has expired naturally. Code here runs once. Permanent status effects can`t have this state.
4. Has cleared. Occurs, when status effect has been cleared prematurely by any way. The best example is neutralizing poison with antidote.
Updated 20.11.2023 - Bugfixes, mostly FFC scripts fixed. Added option to prevent status effects from persisting in player`s save file. Ported documentation into plain text file.
Requires StdExtra.zh and all it`s dependencies. Or Classic.zh (comes with ZC 2.53).
1. Global script combining: put InitStatusEffects(); inside your Init global script. Put StatusEffectsUpdate1(); and UpdateStatusTimers(); BACK TO BACK inside the main loop of your Active global script, prior to Waitdraw(); If you have a function for handling custom status effect, you can put it between StatusEffectsUpdate1(); and UpdateStatusTimers(); commands.
2. If you don`t want for ststus effects to persist into player`s save file, put ClearStatusEffectsOnReload() before main loop of Active GLobal script.
3. Import and compile the library. It requires StdExtra.zh and all it`s dependencies. Also ZC 2.53.x versions has built-in Classic.zh librarry which contains functions originally existing in stdExtra.zh and used by status.zh
4. Assign item and FFC scripts that come with library to approriate slots, 3 FFC and 3 item scripts total.
P.S. Instructions on adding more status effects as well as handling status effects (i.e. inside enemy scripts) are inside tect file inside downloaded archive.