Alchemy
Loading...
Searching...
No Matches

effect_advance.h

Go to the documentation of this file.
1#include "types.h"
2#include "field_effect.h"
3
4// Babi Lighthouse, Crossbone Isle, Tret's interiors, the Tunnel Ruins and Venus
5// Lighthouse.
6
7/// An effect's update hook: move by its velocity, which loses an eighteenth of
8/// its x and a sixteenth of its z each frame, and grow and spin at its rates.
9static void Effect_AdvanceMotion(union FieldObject *object) {
10 struct FieldEffect *effect = &object->effect;
11
12 effect->x += effect->velocity.x;
13 effect->y += effect->velocity.y;
14 effect->z += effect->velocity.z;
15 effect->velocity.x -= effect->velocity.x / 18;
16 effect->velocity.z -= effect->velocity.z / 16;
17 effect->scaleX += effect->scaleRateX;
18 effect->scaleY += effect->scaleRateY;
19 effect->sprite->rotation += effect->spin;
20}
static void Effect_AdvanceMotion(union FieldObject *object)
An effect's update hook: move by its velocity, which loses an eighteenth of its x and a sixteenth of ...
Field effects, their scripts and the flags that spawn them.
u16 rotation
1/65536 turns
Definition animspr.h:118
A field effect: a small object on the field that moves at its velocity and grows and spins at its rat...
struct Vector3 velocity
Added to x, y and z each frame by the update hooks, in 16.16 fixed-point pixels per frame; FieldActor...
s32 z
16.16 fixed-point pixels
struct AnimationObject * sprite
the sprite spin turns
s32 scaleRateX
Added to scaleX each frame by the update hooks, in 16.16 fixed point a frame; zeroed by the spawner.
s32 scaleY
16.16 fixed point, 0x10000 full size
s32 scaleX
16.16 fixed point, 0x10000 full size
s32 y
16.16 fixed-point pixels
s32 x
16.16 fixed-point pixels
s32 scaleRateY
as scaleRateX, for scaleY
u16 spin
Added to the sprite's rotation each frame by the update hooks, in 1/65536 turns per frame; Imil's ris...
s32 z
Definition vector3.h:24
s32 x
Definition vector3.h:22
s32 y
Definition vector3.h:23
The integer types, TRUE, UNUSED and the fixed-address macros.
An object on the field, read as an actor or as an effect.