Alchemy
Loading...
Searching...
No Matches

effect_radial.h

Go to the documentation of this file.
1#include "types.h"
2#include "field_obj.h"
3#include "field_effect.h"
4
5// The Tunnel Ruins and Venus Lighthouse.
6
7/// Burst nine particles out from the actor in a ring (the ninth on the first),
8/// flung a third further east and west, slowing as they go
9/// (Effect_AdvanceMotion).
11 struct FieldActor *object;
12 struct Vec vec;
13 struct EffectOptions params;
14 u32 i;
15 s32 v;
16 s32 x;
17 s32 z;
18
19 object = Object_GetById(actor);
20 params.priority = 1;
21 params.palette = 7;
22 params.update = Effect_AdvanceMotion;
23 for (i = 0; i <= 16; i += 2) {
24 v = i << 12;
25 vec.x = Engine_MathCos(v);
26 vec.y = 0;
27 z = Engine_MathSin(v);
28 x = vec.x;
29 vec.z = z;
30 x += Math_Divide(x, 3);
31 vec.x = x;
32 Effect_Spawn(object->x.fixed, object->y.fixed, object->z.fixed, x, vec.y, z,
34 1,
35 &params);
36 }
37}
struct FieldActor * Object_GetById(s32 actor)
Returns an actor, or NULL if it does not exist.
static void SceneEffect_SpawnNineRadialEffects(s32 actor)
Burst nine particles out from the actor in a ring (the ninth on the first), flung a third further eas...
Field effects, their scripts and the flags that spawn them.
@ EFFECT_USE_PALETTE
options.palette, as its group child value
@ EFFECT_USE_UPDATE
options.update
@ EFFECT_USE_PRIORITY
options.priority, as the sprite's priority
s32 Engine_MathSin(s32 angle)
static s32 Math_Divide(s32 dividend, s32 divisor)
s32 Engine_MathCos(s32 angle)
Field objects and actors, and the scene transition styles.
The options of a spawned field effect, each used when its EFFECT_USE_ flag (or EFFECT_SCALE_TO_TARGET...
s32 palette
passed to ObjectGroup_SetChildValue
s32 priority
the sprite's priority
void(*) update(union FieldObject *object)
replaces the update hook
A field actor: a person or thing on the field with a position, motion toward a target,...
Definition field_obj.h:30
union FieldCoordinate x
16.16 fixed-point pixels
Definition field_obj.h:35
union FieldCoordinate y
16.16 fixed-point pixels
Definition field_obj.h:36
union FieldCoordinate z
16.16 fixed-point pixels
Definition field_obj.h:37
Position record used by the shared radial-effect source below.
s32 y
s32 z
s32 x
The integer types, TRUE, UNUSED and the fixed-address macros.
signed int s32
Definition types.h:14
unsigned int u32
Definition types.h:15
s32 fixed
16.16 fixed-point pixels