135 s32 destinationCellX = 32;
136 s32 destinationCellZ = 24;
151 s32 destinationCellX = 32;
152 s32 destinationCellZ = 25;
213 s32 destinationCellX;
218 if ((firstActor->
x.
fixed >> 20) == 35 && (firstActor->
z.
fixed >> 20) == 23) {
223 if ((secondActor->
x.
fixed >> 20) == 35 &&
224 (secondActor->
z.
fixed >> 20) == 23) {
234 destinationCellX = 36;
246 destinationCellX = 36;
324 s32 destinationCellX;
385 destinationCellX = 36;
390 destinationCellX = 36;
417 heading = leader->
facing >> 12;
423 target = SceneActor_FindActorAtCell(nextCellX, nextCellZ);
431 blocker = SceneActor_FindActorAtCell(nextCellX, nextCellZ);
440 destination.
y = target->
y.
fixed;
462 target->
x.
fixed = destination.
x;
463 target->
z.
fixed = destination.
z;
481 {0,
CONDITION_ALWAYS, 72, 0, 488,
FACING_NORTH, 0, -1, -1, -1, -1, 0},
486 {0,
CONDITION_ALWAYS, 372, 0, 272,
FACING_NORTH, 0, -1, -1, -1, -1, 0},
487 {1,
CONDITION_ALWAYS, 99, 0, 447,
FACING_NORTH, 0, -1, -1, -1, -1, 0},
488 {2,
CONDITION_ALWAYS, 342, 0, 254,
FACING_SOUTH, 0, -1, -1, -1, -1, 0},
489 {3,
CONDITION_ALWAYS, 440, 0, 136,
FACING_SOUTH, 0, -1, -1, -1, -1, 0},
494 {0,
CONDITION_ALWAYS, 864, 0, 168,
FACING_SOUTH, 0, -1, -1, -1, -1, 0},
495 {1,
CONDITION_ALWAYS, 312, 0, 756,
FACING_NORTH, 0, 40, 60, 630, 840, 0},
496 {2,
CONDITION_ALWAYS, 472, 0, 680,
FACING_NORTH, 0, 40, 60, 630, 840, 0},
497 {3,
CONDITION_ALWAYS, 392, 0, 200,
FACING_SOUTH, 0, 40, 60, 630, 840, 0},
498 {4,
CONDITION_ALWAYS, 536, 0, 426,
FACING_SOUTH, 0, 40, 60, 630, 840, 0},
499 {5,
CONDITION_ALWAYS, 856, 0, 124,
FACING_SOUTH, 0, 760, 65, 925, 330, 0},
500 {6,
CONDITION_ALWAYS, 808, 0, 248,
FACING_NORTH, 0, 760, 65, 925, 330, 0},
505 {0,
CONDITION_ALWAYS, 172, 0, 300,
FACING_SOUTH, 0, -1, -1, -1, -1, 0},
506 {1,
CONDITION_ALWAYS, 120, 0, 472,
FACING_NORTH, 0, 60, 60, 790, 600, 0},
507 {2,
CONDITION_ALWAYS, 312, 0, 524,
FACING_NORTH, 0, 60, 60, 790, 600, 0},
508 {3,
CONDITION_ALWAYS, 538, 0, 548,
FACING_NORTH, 0, 60, 60, 790, 600, 0},
509 {4,
CONDITION_ALWAYS, 344, 0, 176,
FACING_SOUTH, 0, 60, 60, 790, 600, 0},
510 {5,
CONDITION_ALWAYS, 856, 0, 632,
FACING_NORTH, 0, 740, 510, 980, 690, 0},
638#define DIRECTION_STEP(dx, dz) (((u32)(dx) << 16) | ((dz) & 0xffff))
Ability numbers, named from the English release.
struct FieldActor * Object_GetById(s32 actor)
Returns an actor, or NULL if it does not exist.
#define DIRECTION_STEP(dx, dz)
Pixel step by direction: X in the upper halfword, Z in the lower.
struct SceneEntrance gBilibinCaveEntrances2[]
static void Event_ClearMapTriggerFlag(void)
Clears the same map-work byte at the opposing trigger.
struct SceneEvent gBilibinCaveEvents2[]
struct SceneEntrance gBilibinCaveEntrancesOther[]
static void BilibinCave_UpdateFrostTargetFromMovableActors(void)
After a push or Move: while either pushed actor stands on cell (35, 23) (0x303 and 0x304),...
static void Event_RestoreCrossingCell(void)
Restores the crossing cell from source cell (0, 0).
struct ScenePlacement gBilibinCavePlacements3[]
s32 gBilibinCave_ClearSpriteScript[]
const struct SceneEvent * BilibinCave_GetEvents(void)
static void BilibinCave_ClearActorSpriteFlags(s32 actorId)
Clears the drawing flags of an actor used by the cave's animations.
static void Event_SetMapTriggerFlag(void)
Enables the map-work byte while crossing this touch trigger.
static void Event_RevealHiddenPath(void)
Replaces the narrow tile strip and its two-row collision rectangle.
static void Event_GrowPlant(void)
Growth on the entrance section's target: the plant grows and its cell's collision changes; 0x305 keep...
struct SceneEvent gBilibinCaveEvents3[]
static void Event_FreezeThirdTarget(void)
Frost on the third target, while 0x302 is set.
static void BilibinCave_RestoreDouseSection(void)
Opens section 2 and restores its Douse target.
const u32 * BilibinCave_GetExits(void)
static void Event_DouseMiddleSectionTarget(void)
Douse on the middle section's target: it disappears, for good.
static void Event_AlterCrossingCell(void)
Replaces the crossing cell with the attributes at source cell (1, 0).
struct SceneEvent gBilibinCaveEvents1[]
static void BilibinCave_RestoreGrowthSection(void)
Restores the collision change already made by Growth.
s32 BilibinCave_Initialize(void)
Restores the current section's saved puzzle state.
static void Event_PushActorAhead(void)
Pushes the actor ahead only when its next cell and movement probe are clear.
static void BilibinCave_RestoreIcePuzzleSection(void)
Initializes section 1's animated actors and persistent puzzle states.
static void Event_FreezeSecondTarget(void)
Frost on the second target.
struct SceneEntrance gBilibinCaveEntrances3[]
static void BilibinCave_FreezeTarget(s32 actor)
Clears a Frost target's child effect, then plays its freezing animation.
static s32 BilibinCave_ClearScriptedActorSpriteFlags(struct ScriptInterpreter *interpreter)
Clears the scripted actor's sprite flags and completes this script command.
const struct SceneRegion * BilibinCave_GetRegions(void)
struct SceneEntrance gBilibinCaveEntrances1[]
static void Event_HideRevealedPath(void)
Restores the strip's tiles and its one-row collision rectangle.
const struct SceneEntrance * BilibinCave_GetEntrances(void)
struct ScenePlacement gBilibinCavePlacementsOther[]
const struct ScenePlacement * BilibinCave_GetPlacements(void)
s32 gBilibinCave_PushSteps[]
struct ScenePlacement gBilibinCavePlacements1[]
static void Event_DouseExitSectionTarget(void)
Douse on the exit section's target: it disappears, and the first Frost target settles into a surface ...
struct SceneEvent gBilibinCaveEventsOther[]
static void BilibinCave_EmptyActorSetupHook(s32 actorId)
The original setup invokes this empty hook for every animated actor.
@ FROST_TARGET_C
changes as a pushed actor reaches cell (35, 23)
@ FROST_TARGET_A
walkable once the Douse target is gone
@ PUSHED_ACTOR_A
moved by Move or pushed
static void Event_FreezeFirstTarget(void)
Frost on the first target, before the Douse target is gone.
struct ScenePlacement gBilibinCavePlacements2[]
The engine calls the debug menus import, and their palette swatch tiles.
The engine call layer: one typed inline for each of the thirteen main-image routines below that the s...
static s32 FieldObject_CheckMovementCollision(struct FieldActor *actor, struct FieldPosition *position)
The scene script layer: the engine services a scene's events call, declared once (Engine_EventBegin,...
void Engine_ObjectSetPosition(struct FieldActor *object, s32 fixed_x, s32 fixed_y, s32 fixed_z)
void Engine_ActorSetAnimationAndWait(s32 actor, s32 animation)
void Object_SetMode(struct FieldActor *object, s32 animation)
void Engine_ActorSetSpritePriority(s32 actor, s32 priority)
static void Map_CopyCellsTo(s32 srcX, s32 srcY, s32 destX, s32 destY, s32 width, s32 height)
void Engine_GameFlagSet(s32 flag)
static void Map_CopyCellAttributes(s32 srcX, s32 srcY, s32 width, s32 height, s32 destX, s32 destY)
static void Event_PlayCue(s32 cue)
void Engine_ActorSetChildValue(s32 actor, s32 value)
s32 Engine_GameFlagIsSet(s32 flag)
static void Actor_SetPosition(s32 actor, s32 fixed_x, s32 fixed_z)
void Engine_EventWait(s32 frames)
static struct FieldActor * Actor_Get(s32 actor)
Field objects and actors, and the scene transition styles.
@ ACTOR_PRIORITY_UNDERFOOT
The depth sort treats it as 320 pixels higher on the screen.
#define SCENE_TRANSITION(style, variant)
The scene table formats: entrances, exits, placements and events, and the macros that write them.
#define SCENE_EXITS(scene)
#define PSYNERGY_IN_AREA(ability, phase)
#define IF_FLAG_SET(flag)
#define SCENE_EXIT(exit, scene, entrance)
#define PSYNERGY_ON_ACTOR(ability)
#define EVENT_SCRIPT(script)
#define TOUCH_WALKING_INTO(facing)
#define PLACEMENT_SHARE_PREVIOUS_SPRITE
Game flags, named where their meaning is shown.
#define FLAG_BILIBIN_CAVE_SECOND_DOUSE_TARGET_CLEARED
#define FLAG_BILIBIN_CAVE_FIRST_DOUSE_TARGET_CLEARED
GameState, the game's state: play time, coins, the scene and the leader's position,...
struct GameState gGameState
The work slots of gWorkSlot, read through their own names.
The screen blend's globals and the graphics routines.
The main-image routines scene overlays import.
Item numbers, named from the English release.
Maps: their cells, layers, animations and blend scripts, and the map state.
The reel game's title lettering.
Field object scripts: one s32 command word, then its operands, as gScriptObject_CommandTable runs the...
#define SC_END
Return to the main script.
void FieldObject_WaitForMove(void *fieldObject)
Waits a frame at a time until a field object has arrived at its target, at most 600 frames.
Scene numbers, named after their places.
char SceneId_BilibinCave2
char SceneId_BilibinCave3
char SceneId_BilibinCave1
The field object script interpreter and the operands its commands read.
Song and sound effect ids, indices into gSound_SongTable.
#define SE_HIDDEN_PASSAGE_OPEN
void Engine_ActorSetAnimation()
struct EventWork * gEventWork
void Engine_ActorSetPosition(u32 actor, s32 x, s32 z)
void Engine_EventEnd(void)
void Engine_AudioPlayCue()
void Engine_EventBegin(void)
s32 startTransition
SCENE_TRANSITION(style, variant).
A field actor: a person or thing on the field with a position, motion toward a target,...
s32 speed
speed limit, 16.16 fixed-point pixels per frame
union FieldCoordinate x
16.16 fixed-point pixels
s32 velocityX
16.16 fixed-point pixels per frame
union FieldCoordinate y
16.16 fixed-point pixels
union FieldCoordinate z
16.16 fixed-point pixels
s32 acceleration
Added toward the target each frame, or taken off the speed when there is none, in 16....
s32 velocityZ
16.16 fixed-point pixels per frame
u8 terrainId
The map layer (0 to 3) its ground height is read from, which the scrolling camera updates from the ce...
s32 z
16.16 fixed-point pixels
The map work in heap slot 8 (struct MapScrollWork), seen as its tile animation channels,...
u8 unk17
MapScrollWork's footprints; Bilibin Cave sets it.
A scene entrance: where and facing which way the party arrives, and the camera's bounds there (-1 for...
A scene event: its kind and detail, the trigger it answers, its condition and its value (a message or...
An actor a scene places: its sprite, the condition for placing it, how it behaves,...
A scene's exit region: the box that, while its condition holds, takes the party leader out through it...
The prefix that command handlers read from a field object's 0x70-byte slot.
The system's routines and globals: interrupts, BIOS sound bias, random numbers and sleep.
The integer types, TRUE, UNUSED and the fixed-address macros.
struct FieldCoordinate::@024321007066302143002254325121164243234242211074 part
s32 fixed
16.16 fixed-point pixels