include/field/field_effect.h
Field effects, their scripts and the flags that spawn them.
#include "edition.h"#include "fixed_math.h"#include "field/actor_script.h"#include "field/script.h"#include "system.h"
Included by field_effect_tables.c, alpine_crossing_lama_temple.c, altin.c, altin_peak.c, cottage_rooms_b.c, crossbone_isle_keys.c, goma_cave_pillar.c, gondowan_cave.c, imil.c, imil_fuchin_falls.c, kolima_forest_tree.c, lacquer_rooms_b.c, lalivero.c, lunpa.c, mercury_lighthouse_entrance.c, mogall_forest.c, sanctum.c, field_effect_spawn.c, sol_sanctum_eruption.c, tolbi.c, vale.c, vale_cave.c, vale_plaza.c, vale_prologue.c and world_map.c.
Structures
| Name | Description | |
|---|---|---|
struct | FIELD_EFFECT | A field effect: a small actor on the field that moves at its velocity and grows and spins at its rates, run by its script and update function. |
union | ACTOR_OR_EFFECT | An actor read as an actor and as a field effect at once, as Babi Lighthouse's scInit writes one. |
struct | EFFECT_DURATION_SCRIPTS | The three scripts a scene's own effect spawner picks from by EFFECT_SCRIPT_MASK, wrapped so that the spawner can copy them into its tick whole. |
struct | EFFECT_OPTIONS | The options of a spawned field effect, each used when its EFFECT_USE_ flag (or EFFECT_SCALE_TO_TARGET) is set. |
Macros
| Name | Description | |
|---|---|---|
#define | EFFECT_OPTION_MASK 0xffff0000 | The spawn flags that pick one of EFFECT_OPTIONS' fields (EFFECT_USE_PALETTE and up), above the script number. |
#define | EFFECT_DEFAULT_TYPE SPRITE_DUST_PUFF | The sprite an effect takes unless EFFECT_USE_TYPE gives another (sprite_ids.h). |
#define | EFFECT_SCRIPT_REPEAT_COUNT 3 | The word of a duration script that holds its repeat count, the ticks EFFECT_SCALE_TO_TARGET grows over. |
Enumerations
| Name | Description | |
|---|---|---|
enum | EFFECT_SPAWN_FLAGS { EFFECT_SCRIPT_MASK, EFFECT_USE_PALETTE, EFFECT_USE_PRIORITY, … } | The flags of a scene's effect spawner (EFFECT_SPAWN in scene/shared/field_effect_spawn.c): a script number in the low bits and which of EFFECT_OPTIONS' fields to use. |
enum | EFFECT_DURATION { EFFECT_SCRIPT_SHORT, EFFECT_SCRIPT_MEDIUM, EFFECT_SCRIPT_LON … } | The scripts EFFECT_SCRIPT_MASK picks from FieldEffectDurationScripts, in a scene's spawner and the resident one alike: each holds the effect for a while, then releases it. |
Functions
| Name | Description | |
|---|---|---|
void | fdEffectSpawnResident (Sint32 x, Sint32 y, Sint32 z, Sint32 velocityX, Sint32 velocityY, Sint32 velocityZ, Uint32 flags, const EFFECT_OPTIONS *options) |
Variables
| Name | Description | |
|---|---|---|
extern const Sint32 | FieldEffectShortEffectScript [] | The resident scripts, by EFFECT_DURATION (field_engine_tables.c). |
extern const Sint32 | FieldEffectMediumEffectScript [] | |
extern const Sint32 | FieldEffectLongEffectScript [] |
Description
Field effects, their scripts and the flags that spawn them.
Macros in detail
EFFECT_OPTION_MASK
#define EFFECT_OPTION_MASK 0xffff0000
The spawn flags that pick one of EFFECT_OPTIONS' fields (EFFECT_USE_PALETTE
and up), above the script number.
Referenced by scImilFuchinFallsSpawnDust().
Definition at line 123 of file field_effect.h.
EFFECT_DEFAULT_TYPE
#define EFFECT_DEFAULT_TYPE SPRITE_DUST_PUFF
The sprite an effect takes unless EFFECT_USE_TYPE gives another
(sprite_ids.h).
Definition at line 126 of file field_effect.h.
EFFECT_SCRIPT_REPEAT_COUNT
#define EFFECT_SCRIPT_REPEAT_COUNT 3
The word of a duration script that holds its repeat count, the ticks
EFFECT_SCALE_TO_TARGET grows over.
Referenced by scImilFuchinFallsSpawnDust().
Definition at line 141 of file field_effect.h.
Enumerations in detail
EFFECT_SPAWN_FLAGS
enum EFFECT_SPAWN_FLAGS
The flags of a scene's effect spawner (EFFECT_SPAWN in
scene/shared/field_effect_spawn.c): a script number in the low bits and which
of EFFECT_OPTIONS' fields to use.
| Enumerator | Value | Description |
|---|---|---|
EFFECT_SCRIPT_MASK | 0x0f | An EFFECT_DURATION, picking one of FieldEffectDurationScripts; the actor's mode is this plus 1. |
EFFECT_USE_PALETTE | 0x10000 | options.palette, as its group child value. |
EFFECT_USE_PRIORITY | 0x20000 | options.priority, as the sprite's priority. |
EFFECT_SCALE_TO_TARGET | 0x40000 | Grows from the start scale, or full size, to the target scale over the script's repeat count. |
EFFECT_USE_START_SCALE | 0x80000 | options.startScaleX and startScaleY. |
EFFECT_USE_TYPE | 0x100000 | options.type, else EFFECT_DEFAULT_TYPE. |
EFFECT_USE_SCRIPT | 0x200000 | options.script, run in mode 1. |
EFFECT_USE_ROTATION | 0x400000 | options.rotation, as the sprite's. |
EFFECT_USE_SPIN | 0x800000 | options.spin. |
EFFECT_USE_UPDATE | 0x1000000 | options.update. |
Definition at line 99 of file field_effect.h.
EFFECT_DURATION
enum EFFECT_DURATION
The scripts EFFECT_SCRIPT_MASK picks from FieldEffectDurationScripts, in a
scene's spawner and the resident one alike: each holds the effect for a
while, then releases it.
| Enumerator | Value | Description |
|---|---|---|
EFFECT_SCRIPT_SHORT | 0 | 22 one-tick repeats in a scene, 24 ticks resident |
EFFECT_SCRIPT_MEDIUM | 1 | 44 repeats in a scene, 46 ticks resident |
EFFECT_SCRIPT_LONG | 2 | 126 repeats in a scene, 128 ticks resident |
Definition at line 131 of file field_effect.h.
Functions in detail
fdEffectSpawnResident
void fdEffectSpawnResident(Sint32 x, Sint32 y, Sint32 z, Sint32 velocityX, Sint32 velocityY, Sint32 velocityZ, Uint32 flags, const EFFECT_OPTIONS *options)
Referenced by fdEffectSpawnRadialParticleRing().
Definition at line 185 of file field_effect.h.