Alchemy
Loading...
Searching...
No Matches

west_lunpa_cave.c

Go to the documentation of this file.
1/// @file
2/// West Lunpa Cave: a gate puzzle of switches and puddles that Frost freezes
3/// into pillars, and Bunza, whose wagon carries the party out of Lunpa.
4
5#include "game_state.h"
6#include "scene_ids.h"
7#include "field_event.h"
11#include "west_lunpa_cave.h"
12#include "text/msg_ids.h"
13
14static void Reunion_Converse(void);
15static void WagonChoice_Run(void);
16static u8 Leader_AnswersYes(void);
17static u8 Garet_AsksIfNotRiding(void);
19static u8 Party_ConfirmsStaying(void);
22static u8 Mia_AsksIfRidingAfterAll(void);
23static u8 Bunza_CannotWait(void);
24static u8 Garet_AsksAboutThingsToDo(void);
25static void Party_StaysBehind(void);
26static void Party_RidesWagon(void);
27
28// The cave's scene flags, the state of its gate puzzle:
29// FLAG_SCENE_TEMP_00: the gate puddle is frozen, propping the gate open.
30// FLAG_SCENE_TEMP_01: the lowering switch has lowered the gate.
31// FLAG_SCENE_TEMP_02: the gate is raised.
32// FLAG_SCENE_TEMP_03: the north puddle is frozen into a pillar.
33// FLAG_SCENE_TEMP_04: the south puddle is frozen into a pillar.
34
35const struct SceneEntrance *Scene_GetEntrances(void) { return gCaveEntrances; }
36
37const struct SceneRegion *Scene_GetRegions(void) { return NULL; }
38
39/// Both passages and the wagon departure return through this exit table.
40const u32 *Scene_GetExits(void) { return gCaveExits; }
41
42/// Only the cave scene places puddles, Hammet, Bunza and the party members.
45 return gCavePlacements;
46 }
47 return gCaveNoPlacements;
48}
49
50/// Routes switches, Frost targets and the reunion trigger to their handlers.
51const struct SceneEvent *Scene_GetEvents(void) { return gCaveEvents; }
52
53/// Frost on the hidden puddle: it freezes, and no flag remembers it.
54static void Event_FreezeHiddenPuddle(void) {
55 struct FieldActor *puddle;
56
58 if (puddle != NULL) {
60 }
61}
62
63/// Frost on the south puddle: it rises as an ice pillar the party can climb.
64static void Event_FreezeSouthPuddle(void) {
65 struct FieldActor *puddle;
66
68 if (puddle != NULL) {
70 puddle->motionFlags = 0;
71 }
72 Map_CopyCellAttributes(7, 32, 1, 1, 8, 32);
74}
75
76/// Animates the raised gate resting on the frozen pillar, then opens collision.
77static void Gate_DrawPropped(void) {
78 struct FieldActor *pillar;
79
82 if (pillar != NULL) {
85 }
86 Map_CopyCells(41, 87, 2, 5, 21, 59);
88 Map_CopyCells(3, 93, 1, 1, 24, 62);
89 Map_CopyCells(1, 94, 1, 1, 21, 55);
90 Map_CopyCells(43, 87, 2, 5, 21, 58);
92 Map_CopyCells(41, 87, 2, 5, 21, 58);
95 Map_CopyCellAttributes(21, 11, 2, 2, 21, 13);
96 Map_CopyCellAttributes(21, 11, 1, 1, 22, 15);
97 Map_CopyCellAttributes(19, 17, 1, 1, 21, 14);
98}
99
100/// Frost on the puddle under the gate: its pillar props the gate open, and if
101/// the gate was down the player sees it rise and hears the puzzle solved.
102static void Event_FreezeGatePuddle(void) {
103 struct FieldActor *pillar;
104
107 if (pillar != NULL) {
110 }
116 }
117}
118
119/// Frost on the north puddle: its pillar stays frozen when the party returns.
120static void Event_FreezeNorthPuddle(void) {
122}
123
124/// Lowers the gate in four-frame steps and restores the blocked cell
125/// attributes.
126static void Gate_Lower(void) {
128 Map_CopyCells(41, 86, 2, 6, 21, 57);
130 Map_CopyCells(43, 86, 2, 6, 21, 57);
132 Map_CopyCells(41, 86, 2, 6, 21, 58);
134 Map_CopyCells(43, 86, 2, 6, 21, 58);
136 }
137 Map_CopyCells(2, 93, 1, 1, 24, 62);
138 Map_CopyCells(2, 94, 1, 1, 21, 55);
139 Map_CopyCells(41, 86, 2, 6, 21, 59);
141 Map_CopyCells(1, 93, 1, 1, 24, 62);
142 Map_CopyCells(3, 94, 1, 1, 21, 55);
143 Map_CopyCells(43, 86, 2, 6, 21, 59);
146 Map_CopyCellAttributes(19, 17, 1, 1, 22, 15);
147}
148
149/// Searching the lowering switch: the hero flips it and the gate comes down,
150/// unless it is down already or a frozen pillar props it open. "flipped the
151/// switch."
152static void Event_FlipLoweringSwitch(void) {
155 Engine_MessageShowCentered(MsgFieldFlippedSwitch, 1);
157 Gate_Lower();
160 }
161 }
162}
163
164/// Raises the unpropped gate and restores its passable cell attributes.
165static void Gate_Raise(void) {
166 Map_CopyCells(41, 87, 2, 5, 21, 59);
168 Map_CopyCells(2, 93, 1, 1, 24, 62);
169 Map_CopyCells(2, 94, 1, 1, 21, 55);
170 Map_CopyCells(43, 87, 2, 5, 21, 58);
172 Map_CopyCells(3, 93, 1, 1, 24, 62);
173 Map_CopyCells(1, 94, 1, 1, 21, 55);
174 Map_CopyCells(41, 87, 2, 5, 21, 58);
175 Map_CopyCellAttributes(21, 11, 2, 2, 21, 13);
176 Map_CopyCellAttributes(19, 17, 1, 1, 21, 14);
177}
178
179/// Searching the raising switch: the hero flips it and the gate goes up, unless
180/// it is up already or propped open. "flipped the switch."
181static void Event_FlipRaisingSwitch(void) {
184 Engine_MessageShowCentered(MsgFieldFlippedSwitch, 1);
186 Gate_Raise();
189 }
190 }
191}
192
193/// Walking past Bunza's hiding place once Lunpa's trade has reopened: Bunza
194/// steps out, Hammet knows his voice, and the reunion and the wagon talk
195/// follow.
196static void Event_HammetFindsBunza(void) {
197 struct FieldActor *leader;
198 s32 sighting;
199 s32 recognition;
200
202 // Bring Hammet and the party into view as Bunza leaves his hiding place.
206 Actor_SetSpeed(ACTOR_BUNZA, 0x18000, 0xc000);
207 Actor_WalkTo(ACTOR_BUNZA, 184, 400);
213 Camera_SetSpeed(0x8000, 0x1000);
214 Camera_MoveTo(PIXELS(192), -1, PIXELS(432), 1);
216 if (leader != NULL) {
217 Actor_SetPosition(ACTOR_HAMMET, leader->x.fixed, leader->z.fixed);
218 }
219 Actor_SetSpeed(ACTOR_HAMMET, 0x14ccc, 0xa666);
220 Actor_WalkTo(ACTOR_HAMMET, 168, 464);
224 if (leader != NULL) {
225 Actor_SetPosition(IVAN, leader->x.fixed, leader->z.fixed);
226 }
227 Actor_SetSpeed(IVAN, 0x14ccc, 0xa666);
228 Actor_WalkTo(IVAN, 152, 488);
232 if (leader != NULL) {
233 Actor_SetPosition(MIA, leader->x.fixed, leader->z.fixed);
234 }
235 Actor_SetSpeed(MIA, 0x14ccc, 0xa666);
236 Actor_WalkTo(MIA, 168, 488);
240 if (leader != NULL) {
241 Actor_SetPosition(GARET, leader->x.fixed, leader->z.fixed);
242 }
243 Actor_SetSpeed(GARET, 0x14ccc, 0xa666);
244 Actor_WalkTo(GARET, 184, 488);
248
249 // The party spots someone ahead, before Hammet recognizes Bunza's voice.
251 sighting = MsgLunpaThinkSawSomeone;
270 } else {
273 }
274
276 recognition = MsgLunpaMoment;
288 Actor_WalkBy(ACTOR_HAMMET, 0, -16);
298 Actor_SetSpeed(ACTOR_BUNZA, 0x6666, 0x3333);
299 Actor_WalkBy(ACTOR_BUNZA, -13, 0);
305 Actor_WalkTo(ACTOR_BUNZA, 168, 432);
312 }
313}
314
315/// Explains Bunza's arrival and offers his wagon as a way out of Lunpa.
316static void Reunion_Converse(void) {
317 s32 reunion;
318 s32 plan;
319
320 // Arrange the reunion while the screen is closed, then reveal the group.
324 Actor_SetPosition(MIA, PIXELS(168), PIXELS(544));
325 Actor_SetPosition(IVAN, PIXELS(212), PIXELS(528));
342
346 reunion = MsgLunpaDodonpaNeverIntention;
377 Engine_EventWait(120);
387
388 // Bunza explains how he reached the cave despite being refused entry.
501
502 // Bunza checks the passage, worries about pursuit and proposes his wagon.
505 Actor_SetSpeed(ACTOR_BUNZA, 0x18000, 0xc000);
506 Actor_WalkTo(ACTOR_BUNZA, 144, 528);
508 Actor_WalkTo(ACTOR_BUNZA, 168, 560);
517 Actor_WalkTo(ACTOR_BUNZA, 144, 528);
519 Actor_WalkTo(ACTOR_BUNZA, 168, 488);
550 } else {
553 }
554
562 plan = MsgLunpaBunza;
608}
609
610/// Reconciles the party's answers until they either ride or stay behind.
611static void WagonChoice_Run(void) {
612 s32 wagon;
613 s32 insisted;
614 s32 confusion;
615
616 wagon = MsgLunpaLetsTakeWagon;
626
627ask_to_ride:
628 if (Leader_AnswersYes()) {
629 ask_about_business:
631 goto ride;
632 }
633 insisted = FALSE;
635 insist_nothing_left:
636 insisted = TRUE;
637 check_nothing_left:
640 goto ride;
641 }
642 }
643 if (Bunza_CannotWait() || !insisted) {
644 goto stay;
645 }
646 goto check_nothing_left;
647 } else {
648 if (Garet_AsksIfNotRiding()) {
650 goto stay;
651 }
652 goto insist_nothing_left;
653 }
655 goto ask_about_business;
656 }
657 confusion = MsgLunpaTotallyConfusedChanged;
662 goto ask_to_ride;
663 ride:
665 return;
666 }
667stay:
670}
671
672/// The scene menu encodes Yes as zero; expose it as a Boolean to the dialogue.
673static u8 Leader_AnswersYes(void) {
675}
676
677/// Asks whether the party really intends to refuse the ride.
679 Engine_EventSetMessage(MsgLunpaGaretAsksIfNotRiding);
682}
683
684/// Asks whether unfinished business explains the refusal to ride.
686 Engine_EventSetMessage(MsgLunpaGaretAsksAboutUnfinishedBusiness);
689}
690
691/// Reserved confirmation step; it always succeeds and displays no message.
692static u8 Party_ConfirmsStaying(void) { return TRUE; }
693
694/// Lets Bunza check whether the party has unfinished business before leaving.
696 Engine_EventSetMessage(MsgLunpaBunzaAsksAboutUnfinishedBusiness);
699}
700
701/// Opens Garet's confirmation prompt; WagonChoice_Run collects the answer.
703 Engine_EventSetMessage(MsgLunpaGaretChecksNothingLeft);
705 return TRUE;
706}
707
708/// Asks whether the party has changed its mind about taking the wagon.
710 Engine_EventSetMessage(MsgLunpaMiaAsksIfRidingAfter);
713}
714
715/// Explains that Bunza cannot wait and asks again about the party's business.
716static u8 Bunza_CannotWait(void) {
717 s32 warning;
718
721 warning = MsgLunpaMeaningWontRide;
733}
734
735/// Asks the leader to confirm that something still needs doing here.
737 Engine_EventSetMessage(MsgLunpaGaretAsksAboutThingsTo);
740}
741
742/// Sends Hammet and Bunza ahead, then returns the companions to the leader.
743static void Party_StaysBehind(void) {
744 struct FieldActor *leader;
745 s32 farewell;
746
749 farewell = MsgLunpaInsistStick;
785 Actor_WalkTo(ACTOR_BUNZA, 156, 528);
787 Actor_WalkTo(ACTOR_HAMMET, 164, 528);
789 Actor_WalkTo(ACTOR_BUNZA, 168, 640);
791 Actor_WalkTo(ACTOR_HAMMET, 168, 640);
804 Engine_EventWait(110);
805
815 Engine_EventWait(140);
819
820 // Merge the companions back into the leader and restore player camera
821 // control.
824 if (leader != NULL) {
825 Actor_SetDestination(GARET, leader->x.part.pixel, leader->z.part.pixel);
826 }
831 if (leader != NULL) {
832 Actor_SetDestination(IVAN, leader->x.part.pixel, leader->z.part.pixel);
833 }
835 Actor_SetPosition(IVAN, 0, 0);
838 if (leader != NULL) {
839 Actor_SetDestination(MIA, leader->x.part.pixel, leader->z.part.pixel);
840 }
842 Actor_SetPosition(MIA, 0, 0);
848}
849
850/// Leads everyone down the passage and requests the wagon departure exit.
851static void Party_RidesWagon(void) {
852 struct FieldActor *leader;
853 s32 departure;
854
856 departure = MsgLunpaDontUnfinishedBusiness;
890 Actor_WalkTo(ACTOR_BUNZA, 152, 528);
892 Actor_WalkTo(ACTOR_HAMMET, 160, 528);
894 Actor_WalkTo(ACTOR_BUNZA, 168, 640);
896 Actor_WalkTo(ACTOR_HAMMET, 168, 640);
906 Engine_EventWait(200);
909
912 if (leader != NULL) {
913 Actor_SetDestination(GARET, leader->x.part.pixel, leader->z.part.pixel);
914 }
919 if (leader != NULL) {
920 Actor_SetDestination(IVAN, leader->x.part.pixel, leader->z.part.pixel);
921 }
923 Actor_SetPosition(IVAN, 0, 0);
926 if (leader != NULL) {
927 Actor_SetDestination(MIA, leader->x.part.pixel, leader->z.part.pixel);
928 }
930 Actor_SetPosition(MIA, 0, 0);
939}
940
941/// Restores the gate and frozen puddles from the persistent puzzle flags.
951 Gate_Lower();
952 }
954 Gate_Raise();
955 }
958 }
961 }
964 }
965 }
966 return 0;
967}
968
969// clang-format off
971 { 0, CONDITION_ALWAYS, 168, 0, 632, FACING_NORTH, 0, -1, -1, -1, -1, 0 },
972 { CAVE_ENTRANCE_FROM_WORLD_MAP, CONDITION_ALWAYS, 168, 0, 632, FACING_NORTH, 0, 88, 56, 648, 648, 0 },
973 { CAVE_ENTRANCE_FROM_LUNPA, CONDITION_ALWAYS, 552, 0, 328, FACING_NORTH, 0, 88, 56, 648, 648, 0 },
974 { CAVE_ENTRANCE_THIRD, CONDITION_ALWAYS, 552, 0, 328, FACING_NORTH, 0, 88, 56, 648, 488, 0 },
975 { SCENE_TABLE_END },
976};
977
978const u32 gCaveExits[] = {
984};
985
987 { SCENE_TABLE_END },
988};
989
993 PIXELS(136), 0, PIXELS(520), FACING_SOUTH, TALK_FACE_PARTY, 0 },
995 PIXELS(344), 0, PIXELS(248), FACING_SOUTH, TALK_FACE_PARTY, 0 },
997 PIXELS(424), 0, PIXELS(136), FACING_SOUTH, TALK_FACE_PARTY, 0 },
1003 { SCENE_TABLE_END },
1004};
1005
1006const struct SceneEvent gCaveNoEvents[] = {
1007 { SCENE_EVENTS_END },
1008};
1009
1010const struct SceneEvent gCaveEvents[] = {
1027 { SCENE_EVENTS_END },
1028};
1029// clang-format on
@ ABILITY_FROST
Definition ability_ids.h:11
struct FieldActor * Object_GetById(s32 actor)
Returns an actor, or NULL if it does not exist.
const struct ScenePlacement * Scene_GetPlacements(void)
const struct SceneEntrance * Scene_GetEntrances(void)
const struct SceneEvent * Scene_GetEvents(void)
const u32 * Scene_GetExits(void)
Both scenes share one exit table.
const struct SceneRegion * Scene_GetRegions(void)
s32 Scene_Initialize(void)
Sets up whichever scene is being entered and runs its arrival events.
#define GARET
Jerald.
#define MIA
Mary.
#define IVAN
Ivan.
void Engine_ActorSetSpriteFlags(struct FieldActor *, s32)
The scene script layer: the engine services a scene's events call, declared once (Engine_EventBegin,...
@ 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 s32 Event_OpenMessage(s32 speaker, s32 flags)
void Engine_ActorFaceActor(s32 actor, s32 target, s32 frames)
static void Actor_SetDestination(s32 actor, s32 x, s32 z)
static void Actor_FaceDirection(s32 actor, s32 facing, s32 frames)
void Engine_ActorSetAnimationAndWait(s32 actor, s32 animation)
#define SPEAKER_WINDOW_ABOVE
Definition field_event.h:56
void Engine_ActorSetSpritePriority(s32 actor, s32 priority)
s32 Engine_EventChooseYesNo(s32 actor, s32 flags)
void Engine_MessageShowCentered(s32 message, s32 flags)
#define GameFlag_IsSet
static void Camera_SetSpeed(s32 speed, s32 acceleration)
void Engine_CameraMoveToActor(s32 actor, s32 pan)
#define EMOTE_IN_FRONT
Definition field_event.h:49
static void Actor_SetDestinationOffset(s32 actor, s32 dx, s32 dz)
void Engine_EventCloseScreen(void)
static void Actor_FaceActor(s32 actor, s32 target, s32 frames)
static void Actor_WalkTo(s32 actor, s32 x, s32 z)
#define GameFlag_Clear
void Engine_EventWaitForScreen(void)
#define GameFlag_Set
static void Actor_ShowEmote(s32 actor, s32 emote, s32 frames)
void Engine_EventOpenScreen(void)
s32 Engine_EventOpenMessage(s32 speaker, s32 flags)
void Engine_GameFlagSet(s32 flag)
void Engine_CameraWaitForMove(void)
void Engine_ActorWaitForMove(s32 actor)
void Engine_CameraFollowActor(s32 actor, s32 keep_position)
static void Map_CopyCellAttributes(s32 srcX, s32 srcY, s32 width, s32 height, s32 destX, s32 destY)
void Engine_ActorRunRepeatedMotion(s32 actor, s32 repeats)
static void Event_ShowMessage(s32 speaker, s32 flags)
static void Event_PlayCue(s32 cue)
static void Map_CopyCells(s32 srcX, s32 srcY, s32 width, s32 height, s32 destX, s32 destY)
s32 Engine_GameFlagIsSet(s32 flag)
void Engine_ActorStartRepeatedMotion(s32 actor, s32 repeats)
static void Actor_WalkBy(s32 actor, s32 dx, s32 dz)
static void Actor_SetSpeed(s32 actor, s32 speed, s32 acceleration)
void Engine_MapRedraw(void)
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)
void Engine_ActorFaceEachOther(s32 actor, s32 other, s32 frames)
void Engine_EventWait(s32 frames)
static void Actor_SetAttachedEffect(s32 actor, s32 effect)
static struct FieldActor * Actor_Get(s32 actor)
@ TRANSITION_WINDOW
Definition field_obj.h:17
@ ACTOR_PRIORITY_AUTOMATIC
The sprite takes its priority from the map cell under it.
Definition field_obj.h:153
#define SCENE_TRANSITION(style, variant)
Definition field_obj.h:20
#define SCENE_EVENTS_END
@ EVENT_TOUCH
@ EVENT_EXIT
@ FACING_STEP
Definition field_scene.h:36
#define SCENE_EXITS(scene)
Definition field_scene.h:72
@ SCENE_WEST_LUNPA_CAVE
Definition field_scene.h:19
@ SCENE_LUNPA
Definition field_scene.h:17
@ SCENE_WORLD_MAP
Definition field_scene.h:13
#define SCENE_EXIT(exit, scene, entrance)
Definition field_scene.h:73
@ ACTOR_PARTY_LEADER
@ SCENE_TABLE_END
Definition field_scene.h:43
@ CONDITION_ALWAYS
Definition field_scene.h:44
@ TALK_KEEP_FACING
@ TALK_FACE_PARTY
#define PSYNERGY_ON_ACTOR(ability)
#define EVENT_SCRIPT(script)
@ ACTOR_STAND
#define SEARCH(target)
#define SCENE_EXITS_END
Definition field_scene.h:77
@ FACING_EAST
Definition field_scene.h:26
@ FACING_NORTH
Definition field_scene.h:32
@ FACING_SOUTH
Definition field_scene.h:28
@ FACING_WEST
Definition field_scene.h:30
#define PIXELS(value)
@ SEARCH_UNNAMED
#define FLAG_SCENE_TEMP_03
Definition flags.h:716
#define FLAG_BUNZAS_WAGON_LEFT
Bunza's wagon has left West Lunpa Cave, with the party aboard or without.
Definition flags.h:126
#define FLAG_LUNPA_TRADE_REOPENED
Definition flags.h:123
#define FLAG_SCENE_TEMP_00
Definition flags.h:713
#define FLAG_SCENE_TEMP_02
Definition flags.h:715
#define FLAG_LUNPA_CAVE_REUNION_SEEN
Definition flags.h:124
#define FLAG_SCENE_TEMP_01
Definition flags.h:714
#define FLAG_SCENE_TEMP_04
Definition flags.h:717
GameState, the game's state: play time, coins, the scene and the leader's position,...
struct GameState gGameState
@ ACTOR_BUNZA
Definition kalay.c:72
@ ACTOR_HAMMET
Definition kalay.c:71
static void Event_FreezeHiddenPuddle(void)
Frost on the puddle Reveal shows: it freezes into a pillar the party can stand on.
Definition lunpa.c:123
Scene numbers, named after their places.
char SceneId_WestLunpaCave
#define SE_GATE_MOVE
Definition songs.h:152
#define MUS_PUZZLE_SOLVED
Definition songs.h:79
void Engine_ActorSetAnimation()
struct EventWork * gEventWork
void Engine_EventRequestExit()
void Engine_EventEnd(void)
void Engine_EventBegin(void)
void Engine_TaskWait()
void Engine_EventSetMessage()
void Engine_EventShowMessage()
#define NULL
Definition bilibin.h:6
@ CAVE_ENTRANCE_FROM_LUNPA
Definition lunpa.h:59
@ SPRITE_PUDDLE
Definition lunpa.h:137
@ ACTOR_HIDDEN_PUDDLE
Definition lunpa.h:103
@ LUNPA_ENTRANCE_FROM_CAVE
Definition lunpa.h:17
@ CAVE_EXIT_BY_WAGON
@ CAVE_EXIT_TO_WORLD_MAP
@ CAVE_EXIT_TO_LUNPA
@ ACTOR_NORTH_PUDDLE
@ ACTOR_SOUTH_PUDDLE
@ ACTOR_GATE_PUDDLE
@ CAVE_ENTRANCE_FROM_WORLD_MAP
@ CAVE_ENTRANCE_THIRD
@ WARNING_MIA_ASKS_ABOUT_BUSINESS
@ WARNING_BUNZA_CANNOT_WAIT
@ WARNING_IVAN_ASKS_IF_STAYING
@ PUDDLE_ANIM_FROZEN
@ DEPARTURE_BUNZA_SETS_OFF
@ DEPARTURE_HAMMET_LONGS_FOR_LAYANA
@ DEPARTURE_GARET_HEADS_FOR_KALAY
@ DEPARTURE_IVAN_THINKS_OF_LAYANA
@ RECOGNITION_BUNZA_NAMES_HAMMET
@ RECOGNITION_BUNZA_KNOWS_VOICE
@ RECOGNITION_HAMMET_NAMES_BUNZA
@ RECOGNITION_HAMMET_CALLS_OUT
@ REUNION_HAMMET_THANKS_PARTY
@ REUNION_GARET_ASKS_ABOUT_CAVE
@ REUNION_BUNZA_RECALLS_ADVICE
@ REUNION_BUNZA_MEANS_WISDOM
@ REUNION_BUNZA_IS_GLAD
@ REUNION_IVAN_ASKS_ABOUT_SERVING
@ REUNION_BUNZA_DISCOURAGES_FIGHT
@ REUNION_HAMMET_ON_SELLING
@ REUNION_HAMMET_STARTLED_BUNZA
@ REUNION_GARET_QUESTIONS_IVAN
@ REUNION_BUNZA_AGREES_NOT_TO_FIGHT
@ REUNION_MIA_PRAISES_BUNZA
@ REUNION_BUNZA_KNEW_OF_PRISON
@ REUNION_BUNZA_AVOIDED_LUNPA
@ REUNION_HAMMET_ON_APPEARANCES
@ REUNION_HAMMET_CREDITS_IVAN
@ REUNION_HAMMET_PRAISES_BUNZA
@ REUNION_GARET_ASKS_ABOUT_ENTRY
@ REUNION_MIA_ASKS_WHY_BUNZA_STILL_CAME
@ REUNION_GARET_ASKS_TO_FIGHT
@ REUNION_IVAN_EXPLAINS_COMMOTION
@ REUNION_BUNZA_MENTIONS_COMMOTION
@ REUNION_IVAN_CREDITS_LEADER
@ REUNION_GARET_ASKS_WHY_BUNZA_CAME
@ REUNION_BUNZA_ASKS_ABOUT_RELEASE
@ REUNION_MIA_ASKS_ABOUT_TRADE
@ REUNION_BUNZA_FEARS_CAPTURE
@ REUNION_IVAN_ON_FATE
@ REUNION_MIA_ON_GATE
@ REUNION_MIA_URGES_ESCAPE
@ REUNION_BUNZA_WARNS_OF_SEARCH
@ REUNION_BUNZA_ON_UNPLEASANT_PLACES
@ REUNION_IVAN_ASKS_WHY
@ REUNION_BUNZA_CALLS_IT_CHANCE
@ REUNION_IVAN_CREDITS_EVERYONE
@ REUNION_BUNZA_LINKS_COMMOTION
@ REUNION_IVAN_WANTS_STEALTH
@ REUNION_BUNZA_WAS_REFUSED
@ REUNION_BUNZA_HAD_TO_KNOW
@ REUNION_BUNZA_HID
@ REUNION_HAMMET_THANKS_IVAN
@ FAREWELL_IVAN_REASSURES
@ FAREWELL_HAMMET_LETS_IVAN_GO
@ FAREWELL_BUNZA_SAYS_GOODBYE
@ FAREWELL_MIA_STAYS
@ FAREWELL_MIA_HOPES_FOR_SAFETY
@ FAREWELL_GARET_STAYS
@ FAREWELL_GARET_MOVES_ON
@ FAREWELL_IVAN_STAYS
@ FAREWELL_GARET_SIGHS
@ TRIGGER_LOWERING_SWITCH
@ TRIGGER_BUNZA_HIDING_PLACE
@ TRIGGER_LUNPA_PASSAGE
@ TRIGGER_RAISING_SWITCH
@ TRIGGER_WORLD_MAP_PASSAGE
@ SIGHTING_GARET_ASKS_WHAT_ELSE
@ SIGHTING_MIA_SAW_SOMETHING
@ SIGHTING_GARET_WILL_FIGHT
@ SIGHTING_IVAN_ASKS_IF_FOUND
@ SIGHTING_GARET_SAW_SOMEONE
@ WORLD_MAP_ENTRANCE_FROM_CAVE
@ SPRITE_BUNZA
@ SPRITE_HAMMET
@ GATE_PILLAR_PRIORITY
@ PLAN_BUNZA_HAS_WAGON
@ PLAN_BUNZA_OFFERS_RIDE
@ PLAN_IVAN_DOUBTS_WAGON
@ PLAN_BUNZA_REASSURES
@ PLAN_HAMMET_ASKS_PLAN
@ PLAN_BUNZA_IS_UNSUSPECTED
@ PLAN_MIA_ASKS_ABOUT_WAGON
@ PLAN_GARET_AGREES
@ CONFUSION_GARET_ASKS_AGAIN
@ CONFUSION_IVAN_IS_CONFUSED
@ WAGON_BUNZA_LEADS_THE_WAY
@ WAGON_GARET_ASKS_TO_RIDE
s32 startTransition
SCENE_TRANSITION(style, variant).
Definition event_work.h:43
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
u8 priorityFlags
ActorPriorityFlag bits, read by the scrolling camera.
Definition field_obj.h:51
union FieldCoordinate z
16.16 fixed-point pixels
Definition field_obj.h:37
s32 scaleY
16.16 fixed point, 0x10000 full size
Definition field_obj.h:40
A scene entrance: where and facing which way the party arrives, and the camera's bounds there (-1 for...
Definition field_scene.h:54
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,...
Definition field_scene.h:81
A scene's exit region: the box that, while its condition holds, takes the party leader out through it...
signed int s32
Definition types.h:14
unsigned int u32
Definition types.h:15
#define TRUE
Definition types.h:21
#define FALSE
Definition types.h:20
unsigned char u8
Definition types.h:11
struct FieldCoordinate::@024321007066302143002254325121164243234242211074 part
s32 fixed
16.16 fixed-point pixels
const struct ScenePlacement gCaveNoPlacements[]
const struct ScenePlacement gCavePlacements[]
static u8 Mia_AsksIfRidingAfterAll(void)
Asks whether the party has changed its mind about taking the wagon.
static void Event_FreezeSouthPuddle(void)
Frost on the south puddle: it rises as an ice pillar the party can climb.
static u8 Garet_ChecksNothingLeftToDo(void)
Opens Garet's confirmation prompt; WagonChoice_Run collects the answer.
static void Event_FlipLoweringSwitch(void)
Searching the lowering switch: the hero flips it and the gate comes down, unless it is down already o...
static void WagonChoice_Run(void)
Reconciles the party's answers until they either ride or stay behind.
static u8 Party_ConfirmsStaying(void)
Reserved confirmation step; it always succeeds and displays no message.
static u8 Leader_AnswersYes(void)
The scene menu encodes Yes as zero; expose it as a Boolean to the dialogue.
const struct SceneEvent gCaveNoEvents[]
static void Event_FlipRaisingSwitch(void)
Searching the raising switch: the hero flips it and the gate goes up, unless it is up already or prop...
static u8 Bunza_AsksAboutUnfinishedBusiness(void)
Lets Bunza check whether the party has unfinished business before leaving.
static void Reunion_Converse(void)
Explains Bunza's arrival and offers his wagon as a way out of Lunpa.
const struct SceneEntrance gCaveEntrances[]
static void Gate_Raise(void)
Raises the unpropped gate and restores its passable cell attributes.
static void Party_RidesWagon(void)
Leads everyone down the passage and requests the wagon departure exit.
static u8 Garet_AsksAboutThingsToDo(void)
Asks the leader to confirm that something still needs doing here.
const u32 gCaveExits[]
static u8 Garet_AsksAboutUnfinishedBusiness(void)
Asks whether unfinished business explains the refusal to ride.
static void Party_StaysBehind(void)
Sends Hammet and Bunza ahead, then returns the companions to the leader.
static u8 Bunza_CannotWait(void)
Explains that Bunza cannot wait and asks again about the party's business.
const struct SceneEvent gCaveEvents[]
static u8 Garet_AsksIfNotRiding(void)
Asks whether the party really intends to refuse the ride.
static void Event_FreezeGatePuddle(void)
Frost on the puddle under the gate: its pillar props the gate open, and if the gate was down the play...
static void Gate_DrawPropped(void)
Animates the raised gate resting on the frozen pillar, then opens collision.
static void Gate_Lower(void)
Lowers the gate in four-frame steps and restores the blocked cell attributes.
static void Event_HammetFindsBunza(void)
Walking past Bunza's hiding place once Lunpa's trade has reopened: Bunza steps out,...
static void Event_FreezeNorthPuddle(void)
Frost on the north puddle: its pillar stays frozen when the party returns.