Alchemy
Loading...
Searching...
No Matches

object_pulse.h

Go to the documentation of this file.
1#include "script.h"
2#include "types.h"
3#include "field_obj.h"
4
5// Tolbi's ship deck and Vale's storm.
6
7/// An object script call, each frame: every 60 to 149 frames the actor squashes
8/// and stretches back to its own shape over six frames.
9static s32 Scene_SquashAndStretch(struct ScriptInterpreter *interpreter) {
10 struct FieldActor *state = (struct FieldActor *)interpreter;
11 switch (state->timer) {
12 case 6:
13 state->scaleX -= 0x4000;
14 state->scaleY += 0x2000;
15 break;
16 case 4:
17 state->scaleX += 0x2000;
18 state->scaleY += -0x1000;
19 break;
20 case 2:
21 state->scaleX += 0x1000;
22 state->scaleY -= 0x800;
23 break;
24 case 0:
25 state->scaleX = 0x10000;
26 state->scaleY = 0x10000;
27 state->timer = (Math_RemainderUnsigned(Engine_RandomNext(), 90) + 60);
28 break;
29 }
30 state->timer--;
31 return 1;
32}
u32 Math_RemainderUnsigned(u32 dividend, u32 divisor)
s32 Engine_RandomNext()
Field objects and actors, and the scene transition styles.
static s32 Scene_SquashAndStretch(struct ScriptInterpreter *interpreter)
An object script call, each frame: every 60 to 149 frames the actor squashes and stretches back to it...
Definition object_pulse.h:9
The field object script interpreter and the operands its commands read.
A field actor: a person or thing on the field with a position, motion toward a target,...
Definition field_obj.h:30
s16 timer
The parameter its action script reads (a follow distance or an angle to face), the player's frames to...
Definition field_obj.h:109
s32 scaleX
16.16 fixed point, 0x10000 full size
Definition field_obj.h:39
s32 scaleY
16.16 fixed point, 0x10000 full size
Definition field_obj.h:40
The prefix that command handlers read from a field object's 0x70-byte slot.
Definition script.h:16
The integer types, TRUE, UNUSED and the fixed-address macros.
signed int s32
Definition types.h:14