Requires:
std.zh
Compile, adding this to your buffer, or import directives.
FFC Usage
There are three ffcs supplied wit the package:
SplitOnDeath: Makes any enemy split on death.
SplitOnHit: Makes any enemy split on hit.
BasicTribble: This allows you to make a tribbling enemy.
FFC Set-Up
Place the ffc on the screen, and configure its arguments:
SplitOnDeath Args
D0: Source Enemy ID.
D1: ID of enemy to split into.
D2: Number of splits. i.e. On death, enemy D0 will split into D2 quantity of D1.
D3: A randomising factor for spawning the splits (x/y coordinates). Suggested value range: 2 to 5.
D4: Sound to play when enemy splits, from Quest->Audio->SFX/Misc
D5: If splitting a gleeok enemy, set this to '1' to ensure that it always spawns at the system default coordinates.
SplitOnHit Args
D0: Source Enemy ID.
D1: ID of enemy to split into.
D2: Number of splits. i.e. When hit, enemy D0 will split into D2 quantity of D1.
D3: A randomising factor for spawning the splits. Suggested value range: 2 to 5.
D4: The sound to play when the enemy splits.
D5: Set to '1' if you wish to prevent the enemy from splitting if it is dying.
D6: If splitting a gleeok enemy, set this to '1' to ensure that it always spawns at the system default coordinates.
BasicTribble Args
D0: The enemy ID of the base enemy that will split when killed. ///
D1: The enemy that the main enemy becomes, when killed. ///
D2: The number of enemies the main enemy splits into. ///
D4: The ID of the enemy that D1 becomes when it 'tribbles up'. Set to '0' to use the main enemy (e.g. zols). ///
D5: The ransomised distance to spawn the split-offs into. Suggested value range: 2 to 5. ///
D6: The timer, for the split-offs, in frames. Thus, '240' would be 5 seconds. ///
When enemy D0 dies, it splits into D2 quantity of enemy D1 at a distance of D0->X and D0->Y +/- D5 pixels. Then, when the duration defined in D6 expires (it is set as a separate timer, on a per-enemy basis), D1 will transform into D4, unless D4 is not set to a positive value, in which case, it transforms into D0.
D7: The sound to play when an enemy splits, or tribbles. Decimal value is for splitting, integer for tribbling.
Format:
#####.xxxx Tribble Sound
xxxxx.#### Split Sound
Example: 103.0024 : Enemy will play sound 103 when it tribbles, and sound 24 when it splits.
Global Version
If you wish to handle these effects globally, you will want to use the global functions:
void TribbleEnemies(int waver, int trib_timer_dur)
* Tribbles enemies based on an internal array '
list[]'
* param '
waver' is the variation in distance (x/y) when enemies spawn.
* Param '
trib_timer_dur' is the time it takes (in frames) for a split enemy to 'grow up'.
* Fill in the array '
list[]' with enemy definitions in the following format:
base_enemy, replace with, number of tribbles, tribbles_become
Example: int list[]={1,10,2,16, 2,102,3,103, 40, 12, 2, 70};
Enemy 1 will become enemy 10 when it splits, and will split into 2 of enemy 10. When it grows up, each enemy 10 becomes enemy 16.
Enemy 2 will become enemy 102 when it splits, and will split into 3 of enemy 102. When it grows up, each enemy 102 becomes enemy 103.
Enemy 40 will become enemy 12 when it splits, and will split into 2 of enemy 12. When it grows up, each enemy 12 becomes enemy 70.
* You may expand on this list, or reduce it, or otherwise change it as desired.
* Each entry to the list is a set of four values.
void SplitOnDeath(int dist_flux)
* Splits enemies (when they die) based on an internal array '
list[]'
* param '
dist_flux' is the variation in distance (x/y) when enemies spawn.
* Fill in the array '
list[]' with enemy definitions in the following format:
base_enemy, replace with, number of replacements
Example: int list[]={1,10,2, 2,102,3, 40, 12, 5};
Enemy 1 will become enemy 10 when it dies, and will split into 2 of enemy 10.
Enemy 2 will become enemy 102 when it dies, and will split into 3 of enemy 102.
Enemy 40 will become enemy 12 when it dies, and will split into 5 of enemy 12.
* You may expand on this list, or reduce it, or otherwise change it as desired.
* Each entry to the list is a set of three values.
void SplitOnHit(int dist_flux)
* Splits enemies (when they are damaged by any lweapon) based on an internal array '
list[]'
* param '
dist_flux' is the variation in distance (x/y) when enemies spawn.
* Fill in the array '
list[]' with enemy definitions in the following format:
base_enemy, replace with, number of replacements
Example: int list[]={1,10,2, 2,102,3, 40, 12, 5};
Enemy 1 will become enemy 10 when it is damaged, and will split into 2 of enemy 10.
Enemy 2 will become enemy 102 when it is damaged, and will split into 3 of enemy 102.
Enemy 40 will become enemy 12 when it is damaged, and will split into 5 of enemy 12.
* You may expand on this list, or reduce it, or otherwise change it as desired.
* Each entry to the list is a set of three values.