1#ifndef ALCHEMY_FIELD_SCENE_H
2#define ALCHEMY_FIELD_SCENE_H
38#define FACING_IS_NORTH(facing) \
39 ((u32)((facing) - (FACING_NORTHWEST + 1)) <= \
40 FACING_NORTHEAST - FACING_NORTHWEST - 2)
48#define IF_FLAG_SET(flag) ((flag) | CONDITION_FLAG_SET)
72#define SCENE_EXITS(scene) ((u32)(scene))
73#define SCENE_EXIT(exit, scene, entrance) \
74 ((u32)(exit) << 20 | (u32)(entrance) << 12 | (u32)(scene))
75#define SCENE_EXIT_IF(exit, scene, entrance, flag) \
76 (SCENE_EXIT(exit, scene, entrance) | 0x10000000), (u32)(flag)
77#define SCENE_EXITS_END 0x1ff
110#define PLACEMENT_SHARE_PREVIOUS_SPRITE 0x01
114#define PIXELS(value) ((value) << 16)
148#define EVENT_TOUCH_WALKING 0x200
149#define EVENT_TOUCH_FACING 0x400
150#define TOUCH_WALKING (EVENT_TOUCH | EVENT_TOUCH_WALKING)
151#define TOUCH_FACING(facing) (EVENT_TOUCH | EVENT_TOUCH_FACING | (facing))
152#define TOUCH_WALKING_INTO(facing) \
153 (EVENT_TOUCH | EVENT_TOUCH_WALKING | EVENT_TOUCH_FACING | (facing))
155#define EVENT_PSYNERGY_ON_ACTOR 0x10
156#define PSYNERGY_ON_ACTOR(ability) \
157 (EVENT_PSYNERGY | EVENT_PSYNERGY_ON_ACTOR | (ability) << 8)
160#define PSYNERGY_PHASE_ON_ACTOR(ability, phase) \
161 ((u32)(phase) << 28 | PSYNERGY_ON_ACTOR(ability))
163#define EVENT_PSYNERGY_IN_AREA 0x80
164#define PSYNERGY_IN_AREA(ability, phase) \
165 ((u32)(phase) << 28 | (ability) << 8 | EVENT_PSYNERGY_IN_AREA | \
170#define EVENT_ITEM_ON_ACTOR 0x10
171#define USE_ITEM(item) (EVENT_ITEM | (item) << 8)
172#define USE_ITEM_ON_ACTOR(item) (EVENT_ITEM | EVENT_ITEM_ON_ACTOR | (item) << 8)
174#define SEARCH(target) (EVENT_SEARCH | (target) << 4)
211#define FIND_ITEM(item) (0x00100000 | (item))
212#define FIND_COINS(coins) (0x00200000 | (coins))
213#define FIND_PSYNERGY_STONE 0x00300000
214#define FIND_MESSAGE(message) (0x00400000 | (message))
216#define EVENT_SCRIPT(script) ((u32)(script))
217#define SCENE_EVENTS_END 0xffffffff
Character numbers, with each character's Japanese name.
@ SCENE_LUNPA_FORTRESS_GATE
@ TALK_FACE_PARTY_AND_BACK
Scene numbers, named after their places.
STATIC_ASSERT, a compile-time check that emits nothing.
#define STATIC_ASSERT(condition)
C89 permits repeated extern declarations of the same array.
#define offsetof(type, member)
A scene entrance: where and facing which way the party arrives, and the camera's bounds there (-1 for...
s16 requiredFlag
a flag that must be set, or -1 for none
s16 unused2
0 in every table; not read
s16 unused1
0 in every table; not read
s16 entrance
the entrance number the game state names; -1 ends
u16 facing
1/65536 turns (enum Facing)
A scene event: its kind and detail, the trigger it answers, its condition and its value (a message or...
s16 condition
-1 always, a flag | 0x1000 set, else the flag clear
s16 trigger
What the event answers: an actor id, a tile's collision code, a marker id or a raised value.
u32 value
A message below 0x10000, else an event function; for an exit, the exit kind its scene's exit table ma...
u32 control
The kind and its detail, read by Scene_FindEvent and the item, Psynergy and search lookups; -1 ends t...
An actor a scene places: its sprite, the condition for placing it, how it behaves,...
s32 x
16.16 fixed-point pixels
u8 flags
PLACEMENT_SHARE_PREVIOUS_SPRITE.
s16 condition
-1 always, a flag | 0x1000 set, else the flag clear; off the world map, 48 to 127 also need condition...
u16 facing
1/65536 turns (enum Facing)
u8 talkFacing
enum ActorTalkFacing; 3 follows the leader afterwards
s32 z
16.16 fixed-point pixels
s32 y
16.16 fixed-point pixels
s16 sprite
The actor's sprite; 0 to 7 are the party's characters, each in its own actor slot,...
s32 behavior
A built-in action (enum ActorBehavior, 1 to 7) or an action script, for ObjectMotion_SetActionCallbac...
A scene's exit region: the box that, while its condition holds, takes the party leader out through it...