include/field/field_effect.h
Field effects, the small objects on the field that move, grow and spin by their scripts, the flags of a scene's effect spawner, and the tints a field Psynergy washes the screen in.
#include "edition.h"#include "field/field_script.h"#include "fixed_math.h"#include "system/definitions.h"#include "types.h"
Included by field_effect_advance_motion.c, field_effect_move.c, field_effect_spawn_resident.c, field_engine_actor_commands.c, field_psynergy_internal.h, script_commands_field_psynergy.c, jupiter_lighthouse_aerie.c, jupiter_lighthouse_aerie_beacon.c, jupiter_lighthouse_basement.c, jupiter_lighthouse_central_room.c, jupiter_lighthouse_cracked_floor.c, jupiter_lighthouse_entrance.c, jupiter_lighthouse_ground_floor.c, jupiter_lighthouse_left_tower_lower.c, jupiter_lighthouse_locked_doors.c, jupiter_lighthouse_right_tower_lower.c, jupiter_lighthouse_right_tower_upper.c, jupiter_lighthouse_side_halls.c, jupiter_lighthouse_terraces.c, jupiter_lighthouse_upper_hall.c, mars_lighthouse_entrance.c, mars_lighthouse_towers.c, sea_of_time.c, field_effect_advance_motion_priority.c, field_effect_advance_spin.c, field_effect_spawn.c, trial_road.c and tundaria_tower.h.
Structures
| Name | Description | |
|---|---|---|
struct | FIELD_EFFECT | A field effect: a small object on the field that moves at its velocity and grows and spins at its rates, run by its script and update hook. |
union | FIELD_OBJECT | An object on the field, read as an actor or as an effect. |
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 an option, above the script number. |
#define | EFFECT_DEFAULT_TYPE SPRITE_DUST_CLOUD | 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. |
#define | EFFECT_SPAWN scFieldEffectSpawn | The names scene/shared/field_effect_spawn.c compiles a scene's copy of the effect spawner under, the same in every scene that includes it: the spawner, the import that creates its actor, and the duration scripts EFFECT_SCRIPT_MASK picks from. |
#define | EFFECT_CREATE syImportActorCreate | |
#define | EFFECT_SCRIPTS FieldEffectDurationScripts | |
#define | FIELD_EFFECT_DRAG_X 18 | A drifting effect loses a FIELD_EFFECT_DRAG_X-th of its x speed and a FIELD_EFFECT_DRAG_Z-th of its z speed each tick. |
#define | FIELD_EFFECT_DRAG_Z 16 | |
#define | DUST_RING_PUFFS 16 | Sixteen puffs of dust in a ring round the leader as he lands from above, the first thrown twice. |
Enumerations
| Name | Description | |
|---|---|---|
enum | EFFECT_SPAWN_FLAGS { EFFECT_SCRIPT_MASK, EFFECT_USE_PALETTE, EFFECT_USE_PRIORITY, … } | The flags of a scene's effect spawner (scFieldEffectSpawn): a script number in the low bits and which of the spawn options' fields to use. |
enum | EFFECT_DURATION { EFFECT_SCRIPT_SHORT, EFFECT_SCRIPT_MEDIUM, EFFECT_SCRIPT_LON … } | The scripts EFFECT_SCRIPT_MASK picks from FieldEffectDurationScripts: each holds the effect for a while, then releases it. |
enum | PSYNERGY_TINT { PSYNERGY_TINT_BLUE, PSYNERGY_TINT_GREEN, PSYNERGY_TINT_RED, … } | The eight tints a field Psynergy washes the screen in, by their index in FieldPsynergyCastColors and FLAG_PSYNERGY_TINT. |
Functions
| Name | Description | |
|---|---|---|
void | fdEffectAdvanceMotion (union FIELD_OBJECT *object) | An effect's update function: move by its velocity, which loses an eighteenth of its x and a sixteenth of its z each tick, and grow and spin at its rates. |
void | scEffectAdvanceMotionAtLeaderPriority (union FIELD_OBJECT *object) | fdEffectAdvanceMotion, then gives the effect's sprite the leader's sprite priority, so the effect is drawn at the leader's depth. |
void | fdEffectUpdateMotionScaleAndSpin (FIELD_OBJECT *object) | An effect's update function: moves the effect by its velocity, which keeps its speed, grows it at its rates and turns its sprite by its spin. |
void | fdEffectSpawnResident (Sint32 x, Sint32 y, Sint32 z, Sint32 velocityX, Sint32 velocityY, Sint32 velocityZ, Uint32 flags, const EFFECT_OPTIONS *options) | Places a small effect at (x, y, z) moving at a velocity: a dust cloud, or options' type when EFFECT_USE_TYPE asks for it, its script one of FieldEffectDurationScripts and its options chosen by the EFFECT_USE_ flags. |
Variables
| Name | Description | |
|---|---|---|
extern const Uint32 | FieldPsynergyCastColors [PSYNERGY_TINT_COUNT] | Each tint's colour (field_effect_data.c). |
Description
Field effects, the small objects on the field that move, grow and spin by their scripts, the flags of a scene's effect spawner, and the tints a field Psynergy washes the screen in.
Macros in detail
EFFECT_OPTION_MASK
#define EFFECT_OPTION_MASK 0xffff0000
The spawn flags that pick an option, above the script number.
Referenced by EFFECT_SPAWN, fdEffectSpawnResident(), scFieldEffectSpawn() and scFieldEffectSpawnLocal().
Definition at line 114 of file field_effect.h.
EFFECT_DEFAULT_TYPE
#define EFFECT_DEFAULT_TYPE SPRITE_DUST_CLOUD
The sprite an effect takes unless EFFECT_USE_TYPE gives another
(sprite_ids.h).
Referenced by EFFECT_SPAWN and fdEffectSpawnResident().
Definition at line 118 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 EFFECT_SPAWN, fdEffectSpawnResident(), scFieldEffectSpawn() and scFieldEffectSpawnLocal().
Definition at line 131 of file field_effect.h.
EFFECT_SPAWN
#define EFFECT_SPAWN scFieldEffectSpawn
The names scene/shared/field_effect_spawn.c compiles a scene's copy of the
effect spawner under, the same in every scene that includes it: the spawner,
the import that creates its actor, and the duration scripts
EFFECT_SCRIPT_MASK picks from. The scene names EFFECT_SET_MODE and
EFFECT_SET_SCRIPT itself.
Definition at line 138 of file field_effect.h.
EFFECT_CREATE
#define EFFECT_CREATE syImportActorCreate
Definition at line 139 of file field_effect.h.
EFFECT_SCRIPTS
#define EFFECT_SCRIPTS FieldEffectDurationScripts
Referenced by EFFECT_SPAWN.
Definition at line 140 of file field_effect.h.
FIELD_EFFECT_DRAG_X
#define FIELD_EFFECT_DRAG_X 18
A drifting effect loses a FIELD_EFFECT_DRAG_X-th of its x speed and a
FIELD_EFFECT_DRAG_Z-th of its z speed each tick.
Referenced by fdEffectAdvanceMotion(), fdEffectUpdateDustPuff(), scEffectAdvanceMotionAndSpin(), scEffectAdvanceMotionAtLeaderPriority(), scEffectAdvanceMotionLocal(), scKandoreanTempleUpdateStreamSteam(), scKandoreanTempleUpdateVentSteam() and scTrialRoadDriftDust().
Definition at line 144 of file field_effect.h.
FIELD_EFFECT_DRAG_Z
#define FIELD_EFFECT_DRAG_Z 16
Referenced by fdEffectAdvanceMotion(), fdEffectUpdateDustPuff(), scEffectAdvanceMotionAndSpin(), scEffectAdvanceMotionAtLeaderPriority(), scEffectAdvanceMotionLocal(), scKandoreanTempleUpdateStreamSteam(), scKandoreanTempleUpdateVentSteam() and scTrialRoadDriftDust().
Definition at line 145 of file field_effect.h.
DUST_RING_PUFFS
#define DUST_RING_PUFFS 16
Sixteen puffs of dust in a ring round the leader as he lands from above, the first thrown twice.
Referenced by scAnkohlRuinsLandFromFall(), scCavernsFinishMovingAngaraBlock(), scContigoForceFreesDjinni(), scCrackedTileDropIn(), scDustBurst(), scGabombaStatueLandFromFall(), scGaiaRockInsideRaiseDust(), scGarohScatterDustRing(), scKandoreanTempleLandFromAbove(), scMagmaRockDropLeaderFromSummit(), scMagmaRockInsideSpawnDustRing(), scMagmaRockSpawnDustRing() and scTundariaTowerLandFromSlide().
Definition at line 149 of file field_effect.h.
Enumerations in detail
EFFECT_SPAWN_FLAGS
enum EFFECT_SPAWN_FLAGS
The flags of a scene's effect spawner (scFieldEffectSpawn): a script number
in the low bits and which of the spawn options' fields to use.
| Enumerator | Value | Description |
|---|---|---|
EFFECT_SCRIPT_MASK | 0x0f | picks spawner's effect script; object's mode is this + 1 |
EFFECT_USE_PALETTE | 0x10000 | options.palette |
EFFECT_USE_PRIORITY | 0x20000 | options.priority, as the sprite's priority |
EFFECT_SCALE_TO_TARGET | 0x40000 | grows start (or full) to target over script 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 96 of file field_effect.h.
EFFECT_DURATION
enum EFFECT_DURATION
The scripts EFFECT_SCRIPT_MASK picks from FieldEffectDurationScripts: each
holds the effect for a while, then releases it.
| Enumerator | Value | Description |
|---|---|---|
EFFECT_SCRIPT_SHORT | 0 | held 24 ticks |
EFFECT_SCRIPT_MEDIUM | 1 | held 46 ticks |
EFFECT_SCRIPT_LONG | 2 | held 128 ticks |
Definition at line 122 of file field_effect.h.
PSYNERGY_TINT
enum PSYNERGY_TINT
The eight tints a field Psynergy washes the screen in, by their index in
FieldPsynergyCastColors and FLAG_PSYNERGY_TINT.
| Enumerator | Value | Description |
|---|---|---|
PSYNERGY_TINT_BLUE | 0 | |
PSYNERGY_TINT_GREEN | 1 | |
PSYNERGY_TINT_RED | 2 | |
PSYNERGY_TINT_CYAN | 3 | |
PSYNERGY_TINT_MAGENTA | 4 | |
PSYNERGY_TINT_YELLOW | 5 | |
PSYNERGY_TINT_DARK_GREY | 6 | |
PSYNERGY_TINT_GREY | 7 | |
PSYNERGY_TINT_COUNT | 8 |
Definition at line 173 of file field_effect.h.