Alchemy
Loading...
Searching...
No Matches

mercury_lighthouse_arrive.h

Go to the documentation of this file.
1/// @file
2/// Mercury Lighthouse and its entrance: arriving on a floor through one of its
3/// sparkling passages.
4#include "types.h"
5#include "field_obj.h"
6#include "field_event.h"
7#include "flags.h"
8#include "songs.h"
9
10/// Unless the party returns to where it was, the leader appears 16 pixels north
11/// of the entrance, hidden, as the screen opens, then comes south with the
12/// trail of sparks and is drawn again on the way.
14 struct FieldActor *actor;
15 s32 flag;
16 struct FieldActor *record;
17 struct AnimationObject *sprite;
18
21 if (flag == 0) {
23 Camera_MoveTo(-1, -1, -1, 0);
24 actor->motionFlags = 0;
25 Engine_ActorSetPosition(0, actor->x.part.pixel << 16,
26 (actor->z.part.pixel << 16) + -0x100000);
33#ifdef UBFIX
34 actor->update = MercuryLighthouse_TrailSparks;
35#else
36 actor->update =
37 (void (*)(union FieldObject *))MercuryLighthouse_TrailSparks;
38#endif
39 Actor_SetSpeed(ACTOR_PARTY_LEADER, 0x6666, 0x3333);
44 sprite = actor->sprite;
45 sprite->image.priority = 1;
47 actor->motionFlags = 3;
48 actor->update = NULL;
51 }
52}
struct FieldActor * Object_GetById(s32 actor)
Returns an actor, or NULL if it does not exist.
void Engine_ActorSetSpriteFlags(struct FieldActor *, s32)
The scene script layer: the engine services a scene's events call, declared once (Engine_EventBegin,...
#define GameFlag_IsSet
void Engine_EventWaitForScreen(void)
static void Actor_WalkByAndWait(s32 actor, s32 dx, s32 dz)
void Engine_EventOpenScreen(void)
static void Actor_SetChildValue(s32 actor, s32 value)
static void Actor_SetSpeed(s32 actor, s32 speed, s32 acceleration)
static void Camera_MoveTo(s32 fixed_x, s32 fixed_y, s32 fixed_z, s32 pan)
static struct FieldActor * Actor_Get(s32 actor)
Field objects and actors, and the scene transition styles.
@ ACTOR_PARTY_LEADER
Game flags, named where their meaning is shown.
#define FLAG_KEEP_PARTY_POSITION
Definition flags.h:93
static void MercuryLighthouse_ArriveWithSparks(void)
Unless the party returns to where it was, the leader appears 16 pixels north of the entrance,...
void BattleFx_PlayQueuedSound(void)
Plays the sound BattleFx_SetQueuedSoundAndPlay remembered, if any.
Definition requests.c:102
Song and sound effect ids, indices into gSound_SongTable.
#define SE_228
Definition songs.h:223
void Engine_ActorSetPosition(u32 actor, s32 x, s32 z)
void Engine_EventEnd(void)
void Engine_AudioPlayCue()
void Engine_EventBegin(void)
#define NULL
Definition bilibin.h:6
An animated sprite: its image and shadow, scale, rotation, size and up to four animation layers.
Definition animspr.h:108
struct AnimationSpritePart image
Definition animspr.h:109
u16 priority
2 when created
Definition animspr.h:100
A field actor: a person or thing on the field with a position, motion toward a target,...
Definition field_obj.h:30
u8 motionFlags
ActorMotionFlag bits; zero is free flight in 3D, and 3 is set on creation.
Definition field_obj.h:83
union FieldCoordinate x
16.16 fixed-point pixels
Definition field_obj.h:35
union FieldCoordinate z
16.16 fixed-point pixels
Definition field_obj.h:37
void(*) update(union FieldObject *object)
Called each frame before the object's script, while the object is live.
Definition field_obj.h:116
The integer types, TRUE, UNUSED and the fixed-address macros.
signed int s32
Definition types.h:14
struct FieldCoordinate::@024321007066302143002254325121164243234242211074 part
An object on the field, read as an actor or as an effect.
struct FieldActor actor