Alchemy
Loading...
Searching...
No Matches

field_effect.h File Reference

Field effects, their scripts and the flags that spawn them. More...

Go to the source code of this file.

Data Structures

struct  FieldEffect
 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. More...
union  FieldObject
 An object on the field, read as an actor or as an effect. More...
struct  EffectOptions
 The options of a spawned field effect, each used when its EFFECT_USE_ flag (or EFFECT_SCALE_TO_TARGET) is set. More...

Macros

#define SCRIPT_WAIT(frames)
#define SCRIPT_SET_POSITION(x, y, z)
#define SCRIPT_REPEAT(count, label)
#define SCRIPT_DELETE   27

Enumerations

enum  EffectSpawnFlags {
  EFFECT_SCRIPT_MASK = 0x0f , EFFECT_USE_PALETTE = 0x10000 , EFFECT_USE_PRIORITY = 0x20000 , EFFECT_SCALE_TO_TARGET = 0x40000 ,
  EFFECT_USE_START_SCALE = 0x80000 , EFFECT_USE_TYPE = 0x100000 , EFFECT_USE_SCRIPT = 0x200000 , EFFECT_USE_ROTATION = 0x400000 ,
  EFFECT_USE_SPIN = 0x800000 , EFFECT_USE_UPDATE = 0x1000000
}

Functions

 STATIC_ASSERT (offsetof(struct FieldEffect, scaleRateX)==0x30)
 STATIC_ASSERT (offsetof(struct FieldEffect, velocity)==0x44)
 STATIC_ASSERT (offsetof(struct FieldEffect, sprite)==0x50)
 STATIC_ASSERT (offsetof(struct FieldEffect, spin)==0x64)
 STATIC_ASSERT (offsetof(struct FieldEffect, countdown)==0x68)
 STATIC_ASSERT (offsetof(struct FieldEffect, update)==0x6c)
 STATIC_ASSERT (offsetof(struct EffectOptions, type)==0x18)
 STATIC_ASSERT (offsetof(struct EffectOptions, update)==0x24)
void Effect_SpawnResident (s32 x, s32 y, s32 z, s32 velocityX, s32 velocityY, s32 velocityZ, u32 flags, const struct EffectOptions *options)

Detailed Description

Field effects, their scripts and the flags that spawn them.

Definition in file field_effect.h.

Macro Definition Documentation

◆ SCRIPT_WAIT

#define SCRIPT_WAIT ( frames)
Value:
0, (frames)

Definition at line 68 of file field_effect.h.

◆ SCRIPT_SET_POSITION

#define SCRIPT_SET_POSITION ( x,
y,
z )
Value:
2, (x), (y), (z)

Definition at line 69 of file field_effect.h.

◆ SCRIPT_REPEAT

#define SCRIPT_REPEAT ( count,
label )
Value:
12, (count), (label)

Definition at line 70 of file field_effect.h.

◆ SCRIPT_DELETE

#define SCRIPT_DELETE   27

Definition at line 71 of file field_effect.h.

Enumeration Type Documentation

◆ EffectSpawnFlags

Enumerator
EFFECT_SCRIPT_MASK 

Picks one of gEffectScripts; the object's mode is this plus 1.

EFFECT_USE_PALETTE 

options.palette, as its group child value

EFFECT_USE_PRIORITY 

options.priority, as the sprite's priority

EFFECT_SCALE_TO_TARGET 

Grows from the start scale, or full size, to the target scale over the script's repeat count.

EFFECT_USE_START_SCALE 

options.startScaleX and startScaleY

EFFECT_USE_TYPE 

options.type, else object type 222

EFFECT_USE_SCRIPT 

options.script, run in mode 1

EFFECT_USE_ROTATION 

options.rotation, as the sprite's

EFFECT_USE_SPIN 

options.spin

EFFECT_USE_UPDATE 

options.update

Definition at line 73 of file field_effect.h.

Function Documentation

◆ STATIC_ASSERT() [1/8]

STATIC_ASSERT ( offsetof(struct FieldEffect, scaleRateX) = =0x30)

◆ STATIC_ASSERT() [2/8]

STATIC_ASSERT ( offsetof(struct FieldEffect, velocity) = =0x44)

◆ STATIC_ASSERT() [3/8]

STATIC_ASSERT ( offsetof(struct FieldEffect, sprite) = =0x50)

◆ STATIC_ASSERT() [4/8]

STATIC_ASSERT ( offsetof(struct FieldEffect, spin) = =0x64)

◆ STATIC_ASSERT() [5/8]

STATIC_ASSERT ( offsetof(struct FieldEffect, countdown) = =0x68)

◆ STATIC_ASSERT() [6/8]

STATIC_ASSERT ( offsetof(struct FieldEffect, update) = =0x6c)

◆ STATIC_ASSERT() [7/8]

STATIC_ASSERT ( offsetof(struct EffectOptions, type) = =0x18)

◆ STATIC_ASSERT() [8/8]

STATIC_ASSERT ( offsetof(struct EffectOptions, update) = =0x24)

◆ Effect_SpawnResident()

void Effect_SpawnResident ( s32 x,
s32 y,
s32 z,
s32 velocityX,
s32 velocityY,
s32 velocityZ,
u32 flags,
const struct EffectOptions * options )