Alchemy
Loading...
Searching...
No Matches

field_event.h

Go to the documentation of this file.
1#ifndef ALCHEMY_FIELD_EVENT_H
2#define ALCHEMY_FIELD_EVENT_H
3
4/// @file
5/// The scene script layer: the engine services a scene's events call, declared
6/// once (Engine_EventBegin, Engine_ActorJump, Engine_EventSetMessage and the
7/// rest), with the constants and small inlines scenes share.
8///
9/// It is a habit of the whole game written once, as declarations and macros: a
10/// layer, not a compiler-steering device (AGENTS.md S2). The event.h commands
11/// and field_service.h are written over it. A scene's event reads `EV_BEGIN();
12/// Engine_ActorStop(9); OBJ_FACE(9, ACTOR_PARTY_LEADER, 0); EV_END();`.
13
14#include "unit/object/object.h"
16#include "mapcopy.h"
17
18#include "static_assert.h"
19
20#include "game_state.h"
21
22// A scene stores into its own const tables: an overlay's data is in RAM.
23// The games' compiler takes the store as written; a current GCC refuses it,
24// so the modern build names the place without its const.
25#ifdef MODERN
26/// The comma expression removes qualifiers without promoting narrow integers.
27#define STORE_CONST(place) (*(__typeof__(((void)0, (place))) *)&(place))
28#else
29#define STORE_CONST(place) (place)
30#endif
31
32extern u8 gSceneState[];
33
34extern u8 *gColossoWork;
35
36#include "frame.h"
37
38#include "field_obj.h"
39
40enum { TASK_PRIORITY_SCENE = 3200 };
41
47};
48
49#define EMOTE_IN_FRONT 0x100
50
51// Speaker bits above the actor id in a message command, as
52// UiText_OpenMessageAtObject reads them: the portrait left or right of the
53// speaker, and the message window above it or never above it.
54#define SPEAKER_PORTRAIT_LEFT 0x1000
55#define SPEAKER_PORTRAIT_RIGHT 0x2000
56#define SPEAKER_WINDOW_ABOVE 0x4000
57#define SPEAKER_WINDOW_BELOW 0x8000
58
59#define MAP_CELL_STEP(srcX, srcY, width, height, frames) \
60 (srcX), (srcY), (width), (height), (frames)
61#define MAP_CELL_STEPS_END 0xffff
62
63/// Cell replacement: procedure and destination cells
65 /// MAP_CELL_STEP records, ended by MAP_CELL_STEPS_END, for
66 /// Map_PlayMetatileCopySequence.
67 const u16 *steps;
68 u16 x; ///< destination cell column
69 u16 y; ///< destination cell row
70};
71
72// Imports of main-image routines. EventRequestExit, ActorSetPosition,
73// ActorSetAnimation and RandomNext have differing argument counts at their
74// call sites, as measured in the bytes, so retain old-style declarations.
76void Engine_EventEnd(void);
77void Engine_EventWait(s32 frames);
78void Engine_TaskWait(s32 frames);
80void Engine_EventShowMessage(s32 speaker, s32 flags);
84void Engine_MessageShowCentered(s32 message, s32 flags);
92void Engine_ActorSetSpeed(s32 actor, s32 speed, s32 acceleration);
95void Engine_ActorWalkTo(s32 actor, s32 x, s32 z);
96void Engine_ActorWalkBy(s32 actor, s32 dx, s32 dz);
98void Engine_ActorFaceDirection(s32 actor, s32 facing, s32 frames);
99void Engine_ActorFaceActor(s32 actor, s32 target, s32 frames);
100void Engine_ActorFaceEachOther(s32 actor, s32 other, s32 frames);
105void Engine_ActorShowEmote(s32 actor, s32 emote, s32 frames);
108void Engine_ActorSetSpriteFlags(struct FieldActor *actor, s32 flags);
109void Engine_CameraFollowActor(s32 actor, s32 keep_position);
110void Engine_CameraSetSpeed(s32 speed, s32 acceleration);
111void Engine_CameraMoveTo(s32 fixed_x, s32 fixed_y, s32 fixed_z, s32 pan);
114void Engine_MapCopyCells(s32 srcX, s32 srcY, s32 width, s32 height, s32 destX,
115 s32 destY);
116void Engine_MapCopyCellAttributes(s32 srcX, s32 srcY, s32 width, s32 height,
117 s32 destX, s32 destY);
119void Engine_WorkSetValuesIfNonNegative(s32 first, s32 second, s32 third);
124void Engine_ShopOpen(s32 shop, s32 keeper);
125void Engine_InnOpen(s32 inn, s32 keeper);
127s32 Engine_TaskRemoveCallback(void (*callback)(void));
132s32 __divsi3(s32 dividend, s32 divisor);
133void *Engine_HeapAllocate(s32 slot, s32 size);
135s32 Engine_VramLoad(s32 block, s32 size, const void *data);
136struct FieldActor *Engine_ObjectCreate(s32 type, s32 fixed_x, s32 fixed_y,
137 s32 fixed_z);
138void Object_SetMode(struct FieldActor *object, s32 animation);
139void Engine_ObjectSetScript(struct FieldActor *object, const s32 *script);
140void Engine_ObjectSetBlendMode(struct FieldActor *object, s32 mode);
141void Engine_ObjectSetPartPalettes(struct FieldActor *object, s32 palette);
142void Engine_ObjectSetPosition(struct FieldActor *object, s32 fixed_x,
143 s32 fixed_y, s32 fixed_z);
144void Engine_MapAnimateCells(const u16 *steps, s32 destX, s32 destY);
145void Engine_MapObjectSetPosition(s32 object, s32 fixed_x, s32 fixed_z);
147void Engine_ItemShowFound(s32 item, s32 height);
150void Engine_ActorCenterAndWalk(s32 actor, s32 priority, s32 dz);
153void Engine_PsynergyBegin(s32 ability, s32 flags);
154void Engine_PsynergySetTarget(s32 caster, s32 target);
159void Engine_EventShowMessageAndWait(s32 speaker, s32 flags, s32 frames);
165/// The engine encodes either a built-in action or an action-script address.
166static inline void Actor_SetActionScript(s32 actor, const s32 *script) {
168}
169
170/// Runs a script, waiting at most 300 frames for its final command.
171static inline void Actor_RunActionScriptAndWait(s32 actor, const s32 *script) {
173}
174
175static inline void Actor_SetBuiltinAction(s32 actor, s32 action) {
177}
178
181void Engine_MapCopyCellsTo(s32 srcX, s32 srcY, s32 destX, s32 destY, s32 width,
182 s32 height);
183void Engine_MapCopyCellsLayered(s32 srcX, s32 srcY, s32 destX, s32 destY,
184 s32 width, s32 height);
190void Engine_ActorJump(s32 actor, s32 height, s32 frames);
192 s32 extra, s32 other_speaker,
193 s32 otherX, s32 other_y, s32 other_arg,
194 s32 other_extra, s32 flags);
195void Engine_PartyAddMembers(s32 first, s32 second);
197
202
203#ifdef FIELD_STAGED_ACTOR_IMPORTS
204void Audio_PlayCue(s32 cue);
205#endif
206
207static inline void Event_SkipMessages(s32 count) {
208 u16 *message = &gEventWork->message;
209
210 *message = *message + count;
211}
212
213static inline void Event_ShowMessage(s32 speaker, s32 flags) {
214 Engine_EventShowMessage(speaker, flags);
215}
216
217static inline s32 Event_OpenMessage(s32 speaker, s32 flags) {
218 return Engine_EventOpenMessage(speaker, flags);
219}
220
221static inline s32 Event_AskYesNo(s32 speaker, s32 flags) {
222 return Engine_EventAskYesNo(speaker, flags);
223}
224
225static inline struct FieldActor *Actor_Get(s32 actor) {
226 return Object_GetById(actor);
227}
228
229static inline void Actor_SetPosition(s32 actor, s32 fixed_x, s32 fixed_z) {
230 Engine_ActorSetPosition(actor, fixed_x, fixed_z);
231}
232
233static inline void Actor_SetSpeed(s32 actor, s32 speed, s32 acceleration) {
235}
236
237static inline void Actor_SetDestination(s32 actor, s32 x, s32 z) {
239}
240
241#ifndef FIELD_STAGED_ACTOR_IMPORTS
242static inline void Actor_SetDestinationOffset(s32 actor, s32 dx, s32 dz) {
244}
245#endif
246
247static inline void Actor_WalkTo(s32 actor, s32 x, s32 z) {
248 Engine_ActorWalkTo(actor, x, z);
249}
250
251static inline void Actor_WalkBy(s32 actor, s32 dx, s32 dz) {
252 Engine_ActorWalkBy(actor, dx, dz);
253}
254
255static inline void Actor_FaceDirection(s32 actor, s32 facing, s32 frames) {
256 Engine_ActorFaceDirection(actor, facing, frames);
257}
258
259static inline void Actor_FaceActor(s32 actor, s32 target, s32 frames) {
260 Engine_ActorFaceActor(actor, target, frames);
261}
262
263static inline void Actor_ShowEmote(s32 actor, s32 emote, s32 frames) {
264 Engine_ActorShowEmote(actor, emote, frames);
265}
266
267static inline void Actor_SetAttachedEffect(s32 actor, s32 effect) {
268 Engine_ActorSetAttachedEffect(actor, effect);
269}
270
273}
274
275static inline void Camera_MoveTo(s32 fixed_x, s32 fixed_y, s32 fixed_z,
276 s32 pan) {
277 Engine_CameraMoveTo(fixed_x, fixed_y, fixed_z, pan);
278}
279
280static inline void Map_CopyCells(s32 srcX, s32 srcY, s32 width, s32 height,
281 s32 destX, s32 destY) {
282 Engine_MapCopyCells(srcX, srcY, width, height, destX, destY);
283}
284
285static inline void Map_CopyCellAttributes(s32 srcX, s32 srcY, s32 width,
286 s32 height, s32 destX, s32 destY) {
287 Engine_MapCopyCellAttributes(srcX, srcY, width, height, destX, destY);
288}
289
290/// Sets shake amplitudes in fixed-point pixels and the per-frame decay factor.
291/// A negative argument keeps that component unchanged; Q16_ONE keeps the shake.
292static inline void Map_SetShake(s32 horizontal, s32 vertical, s32 decay) {
293 Engine_WorkSetValuesIfNonNegative(horizontal, vertical, decay);
294}
295
296// Keep the scene wrappers separate from the main-image declarations.
297#define GameFlag_Set FieldEvent_GameFlagSet
298#define GameFlag_IsSet FieldEvent_GameFlagIsSet
299#define GameFlag_Clear FieldEvent_GameFlagClear
300static inline s32 FieldEvent_GameFlagIsSet(s32 flag) {
301 return Engine_GameFlagIsSet(flag);
302}
303
304static inline void FieldEvent_GameFlagSet(s32 flag) {
305 Engine_GameFlagSet(flag);
306}
307
308static inline void FieldEvent_GameFlagClear(s32 flag) {
310}
311
312#ifndef FIELD_STAGED_ACTOR_IMPORTS
313static inline void Event_PlayCue(s32 cue) { Engine_AudioPlayCue(cue); }
314#endif
315
316static inline s32 Random_Next(void) { return Engine_RandomNext(); }
317
318static inline s32 Math_Divide(s32 dividend, s32 divisor) {
319 return dividend / divisor;
320}
321
322static inline struct FieldActor *Object_Create(s32 type, s32 fixed_x,
323 s32 fixed_y, s32 fixed_z) {
324 return Engine_ObjectCreate(type, fixed_x, fixed_y, fixed_z);
325}
326
327static inline void Object_SetScript(struct FieldActor *object,
328 const s32 *script) {
329 Engine_ObjectSetScript(object, script);
330}
331
333
334static inline void Map_AnimateCells(const u16 *steps, s32 destX, s32 destY) {
335 Engine_MapAnimateCells(steps, destX, destY);
336}
337
338static inline void MapObject_SetPosition(s32 object, s32 fixed_x, s32 fixed_z) {
339 Engine_MapObjectSetPosition(object, fixed_x, fixed_z);
340}
341
342static inline void Actor_CenterAndWalk(s32 actor, s32 priority, s32 dz) {
343 Engine_ActorCenterAndWalk(actor, priority, dz);
344}
345
346static inline void Actor_WalkByAndWait(s32 actor, s32 dx, s32 dz) {
347 Engine_ActorWalkByAndWait(actor, dx, dz);
348}
349
350static inline void Event_ShowMessageAndWait(s32 speaker, s32 flags,
351 s32 frames) {
352 Engine_EventShowMessageAndWait(speaker, flags, frames);
353}
354
355static inline void Actor_SetChildValue(s32 actor, s32 value) {
356 Engine_ActorSetChildValue(actor, value);
357}
358
359#define ACTION_TABLE_STOP ((const u8 *)1)
360
361static inline void Map_CopyCellsTo(s32 srcX, s32 srcY, s32 destX, s32 destY,
362 s32 width, s32 height) {
363 Engine_MapCopyCellsTo(srcX, srcY, destX, destY, width, height);
364}
365
366static inline void Map_CopyCellsLayered(s32 srcX, s32 srcY, s32 destX,
367 s32 destY, s32 width, s32 height) {
368 Engine_MapCopyCellsLayered(srcX, srcY, destX, destY, width, height);
369}
370
371static inline void ColorBuffer_ApplySource(s32 value, s32 mode) {
373}
374
375static inline void ColorBuffer_ApplyTarget(s32 value, s32 mode) {
377}
378
379static inline void Actor_MoveToAndWait(s32 actor, s32 x, s32 z) {
381}
382
383static inline void Actor_WalkToAndWait(s32 actor, s32 x, s32 z) {
385}
386
387static inline void Event_ShowTwoMessagesAndWait(s32 speaker, s32 x, s32 y,
388 s32 arg, s32 extra,
389 s32 otherSpeaker, s32 otherX,
390 s32 otherY, s32 otherArg,
391 s32 otherExtra, s32 flags) {
392 Engine_EventShowTwoMessagesAndWait(speaker, x, y, arg, extra, otherSpeaker,
393 otherX, otherY, otherArg, otherExtra,
394 flags);
395}
396
397#endif
void Object_SetActionCallbackAndRefreshById(u32 objectId, s32 action)
Starts a built-in action or supplied script, then waits up to 300 frames for its script to end.
struct FieldActor * Object_GetById(s32 actor)
Returns an actor, or NULL if it does not exist.
s32 __divsi3(s32, s32)
void Engine_ActorSetSpriteFlags(struct FieldActor *, s32)
struct FieldActor * Engine_ObjectCreate(s32, s32, s32, s32)
void Engine_ObjectSetPosition(struct FieldActor *object, s32 fixed_x, s32 fixed_y, s32 fixed_z)
ActorAnimation
Definition field_event.h:42
@ ANIM_WALK
Definition field_event.h:44
@ ANIM_STAND
Definition field_event.h:43
@ ANIM_NOD
Definition field_event.h:45
@ ANIM_SHAKE_HEAD
Definition field_event.h:46
static void FieldEvent_GameFlagSet(s32 flag)
u32 Math_RemainderUnsigned(u32 dividend, u32 divisor)
static s32 Event_OpenMessage(s32 speaker, s32 flags)
void Engine_ActorFaceActor(s32 actor, s32 target, s32 frames)
s32 Engine_LeaderCheckAhead(void)
static void Actor_SetDestination(s32 actor, s32 x, s32 z)
static void Actor_FaceDirection(s32 actor, s32 facing, s32 frames)
void Engine_MapCopyCellAttributes(s32 srcX, s32 srcY, s32 width, s32 height, s32 destX, s32 destY)
void Engine_ActorSetAnimationAndWait(s32 actor, s32 animation)
void Engine_WorkSetValuesIfNonNegative(s32 first, s32 second, s32 third)
void Engine_SanctumOpen(s32 priest)
void Object_SetMode(struct FieldActor *object, s32 animation)
static void Map_AnimateCells(const u16 *steps, s32 destX, s32 destY)
void Engine_ActorWalkByAndWait(s32 actor, s32 dx, s32 dz)
void Engine_ActorsRefresh(void)
void Engine_ActorSetSpritePriority(s32 actor, s32 priority)
void Engine_PsynergyBegin(s32 ability, s32 flags)
u8 * Engine_ResourceGetTableEntry(s32 resource)
struct FieldActor * Engine_ActorLookup(s32 actor)
static void Event_ShowMessageAndWait(s32 speaker, s32 flags, s32 frames)
void Engine_ActorEnableActionCallback(s32 actor, s32 action)
void Engine_ActorWalkBy(s32 actor, s32 dx, s32 dz)
static void Actor_SetBuiltinAction(s32 actor, s32 action)
void Engine_PartyAddMembers(s32 first, s32 second)
s32 Engine_EventChooseYesNo(s32 actor, s32 flags)
void Engine_MessageShowCentered(s32 message, s32 flags)
void Engine_ObjectSetPartPalettes(struct FieldActor *object, s32 palette)
s32 Engine_PartyGiveItem(s32 item, s32 flags)
void Engine_EventShowMessageAndWait(s32 speaker, s32 flags, s32 frames)
void Engine_CameraSetSpeed(s32 speed, s32 acceleration)
static void Actor_WalkToAndWait(s32 actor, s32 x, s32 z)
static void Camera_SetSpeed(s32 speed, s32 acceleration)
void Engine_CameraMoveTo(s32 fixed_x, s32 fixed_y, s32 fixed_z, s32 pan)
void Engine_PsynergyRaiseHands(void)
s32 Engine_TaskRemoveCallback(void(*callback)(void))
void Engine_PsynergyLowerHands(void)
void Engine_CameraMoveToActor(s32 actor, s32 pan)
void Engine_ActorMoveToAndWait(s32 actor, s32 x, s32 z)
void Engine_ActorJump(s32 actor, s32 height, s32 frames)
void Engine_ItemLoadIcon(s32 item)
ObjectBlendMode
@ OBJECT_BLEND_NORMAL
@ OBJECT_BLEND_TRANSLUCENT
static void Actor_MoveToAndWait(s32 actor, s32 x, s32 z)
s32 Engine_MathSin(s32 angle)
void Engine_ItemShowFound(s32 item, s32 height)
static void Actor_SetDestinationOffset(s32 actor, s32 dx, s32 dz)
void Engine_ActorSetSpeed(s32 actor, s32 speed, s32 acceleration)
void Engine_ActorFaceDirection(s32 actor, s32 facing, s32 frames)
void Engine_InnOpen(s32 inn, s32 keeper)
void Engine_EventCloseScreen(void)
void Engine_ObjectDispatchRelease(struct FieldActor *object)
void Engine_ActorSetDestination(s32 actor, s32 x, s32 z)
static void Actor_RunActionScriptAndWait(s32 actor, const s32 *script)
Runs a script, waiting at most 300 frames for its final command.
static void Map_CopyCellsTo(s32 srcX, s32 srcY, s32 destX, s32 destY, s32 width, s32 height)
void Engine_ActorWalkToAndWait(s32 actor, s32 x, s32 z)
static void Event_SkipMessages(s32 count)
static void Actor_FaceActor(s32 actor, s32 target, s32 frames)
void Engine_HeapRelease(s32 slot)
static void ColorBuffer_ApplyTarget(s32 value, s32 mode)
s32 Engine_VramLoad(s32 block, s32 size, const void *data)
static void Actor_WalkTo(s32 actor, s32 x, s32 z)
void Engine_PsynergyCancel(void)
void Engine_EventWaitForScreen(void)
void Engine_ActorDestroy(s32 actor)
static void Actor_ShowEmote(s32 actor, s32 emote, s32 frames)
static void Actor_WalkByAndWait(s32 actor, s32 dx, s32 dz)
void Engine_MapCopyCells(s32 srcX, s32 srcY, s32 width, s32 height, s32 destX, s32 destY)
s32 Engine_EventAskYesNo(s32 speaker, s32 flags)
void Engine_MapCopyCellsLayered(s32 srcX, s32 srcY, s32 destX, s32 destY, s32 width, s32 height)
void Engine_ObjectSetScript(struct FieldActor *object, const s32 *script)
static s32 Math_Divide(s32 dividend, s32 divisor)
void Engine_ObjectSetBlendMode(struct FieldActor *object, s32 mode)
static s32 FieldEvent_GameFlagIsSet(s32 flag)
static void Event_ShowTwoMessagesAndWait(s32 speaker, s32 x, s32 y, s32 arg, s32 extra, s32 otherSpeaker, s32 otherX, s32 otherY, s32 otherArg, s32 otherExtra, s32 flags)
void Engine_EventOpenScreen(void)
void Engine_BlendSetDarkenTarget16(s32 target)
void Engine_ActorSetActionCallback(struct FieldActor *actor, s32 value)
s32 Engine_EventOpenMessage(s32 speaker, s32 flags)
void Engine_MapWaitWorkValuesBelow256(void)
void Engine_GameFlagSet(s32 flag)
void Engine_MapRenderWaitForValues(void)
void Engine_MapCopyCellsTo(s32 srcX, s32 srcY, s32 destX, s32 destY, s32 width, s32 height)
void Engine_GameFlagClear(s32 flag)
void Engine_CameraWaitForMove(void)
static void Actor_SetActionScript(s32 actor, const s32 *script)
The engine encodes either a built-in action or an action-script address.
void Engine_ActorWaitForMove(s32 actor)
void Engine_CameraFollowActor(s32 actor, s32 keep_position)
void * Engine_HeapAllocate(s32 slot, s32 size)
static void Map_CopyCellAttributes(s32 srcX, s32 srcY, s32 width, s32 height, s32 destX, s32 destY)
void Engine_ActorStop(s32 actor)
void Engine_ActorRunRepeatedMotion(s32 actor, s32 repeats)
void Engine_EventShowTwoMessagesAndWait(s32 speaker, s32 x, s32 y, s32 arg, s32 extra, s32 other_speaker, s32 otherX, s32 other_y, s32 other_arg, s32 other_extra, s32 flags)
void Engine_ActorWalkTo(s32 actor, s32 x, s32 z)
static void Event_ShowMessage(s32 speaker, s32 flags)
void Engine_ActorSetAttachedEffect(s32 actor, s32 effect)
s32 Engine_RandomNext()
static void Event_PlayCue(s32 cue)
static void Map_CopyCells(s32 srcX, s32 srcY, s32 width, s32 height, s32 destX, s32 destY)
void Engine_ActorSetChildValue(s32 actor, s32 value)
static void Map_SetShake(s32 horizontal, s32 vertical, s32 decay)
Sets shake amplitudes in fixed-point pixels and the per-frame decay factor.
void Engine_MapObjectSetPosition(s32 object, s32 fixed_x, s32 fixed_z)
static void Actor_SetChildValue(s32 actor, s32 value)
s32 Engine_GameFlagIsSet(s32 flag)
void Engine_MapAnimateCells(const u16 *steps, s32 destX, s32 destY)
void Engine_PsynergyPlayEffect(s32 effect)
u8 gSceneState[]
void Engine_ActorStartRepeatedMotion(s32 actor, s32 repeats)
void Engine_RunRisingObjectSequence(struct FieldActor *object, s32 mode)
static struct FieldActor * Object_Create(s32 type, s32 fixed_x, s32 fixed_y, s32 fixed_z)
struct FieldActor * Engine_EventGetViewCenter(void)
s32 Engine_MathCos(s32 angle)
static s32 Event_AskYesNo(s32 speaker, s32 flags)
static void Actor_WalkBy(s32 actor, s32 dx, s32 dz)
static void Actor_CenterAndWalk(s32 actor, s32 priority, s32 dz)
static void MapObject_SetPosition(s32 object, s32 fixed_x, s32 fixed_z)
static void Actor_SetSpeed(s32 actor, s32 speed, s32 acceleration)
void Engine_ObjectMotionSetPositionAndCommit(s32 actor, s32 x, s32 z)
u8 * gColossoWork
@ TASK_PRIORITY_SCENE
Definition field_event.h:40
void Engine_MapRedraw(void)
void Engine_ShopOpen(s32 shop, s32 keeper)
static s32 Random_Next(void)
void Engine_ColorBufferInterpolate(s32 frames)
static void Camera_MoveTo(s32 fixed_x, s32 fixed_y, s32 fixed_z, s32 pan)
static void Actor_SetPosition(s32 actor, s32 fixed_x, s32 fixed_z)
static void Map_CopyCellsLayered(s32 srcX, s32 srcY, s32 destX, s32 destY, s32 width, s32 height)
void Engine_ActorSetDestinationOffset(s32 actor, s32 dx, s32 dz)
void Engine_ActorFaceEachOther(s32 actor, s32 other, s32 frames)
void Engine_EventWait(s32 frames)
void Engine_ActorCenterAndWalk(s32 actor, s32 priority, s32 dz)
static void FieldEvent_GameFlagClear(s32 flag)
static void Actor_SetAttachedEffect(s32 actor, s32 effect)
void Engine_PsynergySetTarget(s32 caster, s32 target)
void Engine_ColorBufferApplyTarget(s32 value, s32 mode)
void Engine_ColorBufferApplySource(s32 value, s32 mode)
static void Object_SetScript(struct FieldActor *object, const s32 *script)
static struct FieldActor * Actor_Get(s32 actor)
static void ColorBuffer_ApplySource(s32 value, s32 mode)
Field objects and actors, and the scene transition styles.
The frame loop's globals: lag counts, the CPU load display and the VBlank flags.
GameState, the game's state: play time, coins, the scene and the leader's position,...
Declares nothing of its own: it only includes edition.h and types.h.
void Engine_ActorSetAnimation()
struct EventWork * gEventWork
void Engine_EventRequestExit()
void Engine_ActorSetPosition(u32 actor, s32 x, s32 z)
void Engine_EventEnd(void)
void Engine_AudioPlayCue()
void Engine_EventBegin(void)
void Engine_ActorShowEmote()
void Engine_TaskWait()
void Engine_EventSetMessage()
void Engine_EventShowMessage()
STATIC_ASSERT, a compile-time check that emits nothing.
u16 message
the next message, advanced as each window opens
Definition event_work.h:47
A field actor: a person or thing on the field with a position, motion toward a target,...
Definition field_obj.h:30
s32 speed
speed limit, 16.16 fixed-point pixels per frame
Definition field_obj.h:55
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
u16 facing
1/65536 turns
Definition field_obj.h:34
s32 acceleration
Added toward the target each frame, or taken off the speed when there is none, in 16....
Definition field_obj.h:58
Cell replacement: procedure and destination cells.
Definition field_event.h:64
u16 y
destination cell row
Definition field_event.h:69
const u16 * steps
MAP_CELL_STEP records, ended by MAP_CELL_STEPS_END, for Map_PlayMetatileCopySequence.
Definition field_event.h:67
u16 x
destination cell column
Definition field_event.h:68
signed int s32
Definition types.h:14
unsigned int u32
Definition types.h:15
unsigned short u16
Definition types.h:13
unsigned char u8
Definition types.h:11