Alchemy
Loading...
Searching...
No Matches

mccoy_palace.c

Go to the documentation of this file.
1/// @file
2/// Lord McCoy's palace in Bilibin. At the first audience McCoy asks the party
3/// to lift the curse on Kolima, then turns them away as too young; once the
4/// curse is lifted, his guards bring them back and he rewards them with one of
5/// four treasures.
6///
7/// Scene flags: FLAG_SCENE_TEMP_00, the escort has opened the front door;
8/// FLAG_SCENE_TEMP_02, the party is choosing its reward; FLAG_SCENE_TEMP_10 to
9/// _13, the chest it chose. The flags from 0x300 are reused from place to
10/// place: 0x302 and 0x303, the admirer has spoken or been read once; 0x321,
11/// McCoy has turned the party away; 0x322, the reward is still to choose;
12/// 0x333, the reward visit is over. McCoy speaks as SPEAKER_PORTRAIT_RIGHT |
13/// ACTOR_LORD_MCCOY, a speaker bit field_event.h does not name yet.
14
15#include "game_state.h"
16#include "scene_ids.h"
18#include "unit/object/object.h"
20#include "unit/field/field.h"
22#include "battle.h"
23#include "debug.h"
24#include "field.h"
25#include "game.h"
26#include "graphics.h"
27#include "menu.h"
28#include "minigame.h"
29#include "sound.h"
30#include "system.h"
31#include "flags.h"
32#include "character_ids.h"
33#include "types.h"
34#include "call.h"
35#include "field_event.h"
36#include "field_service.h"
37#include "text/msg_ids.h"
38#include "ability_ids.h"
39#include "field_scene.h"
40#include "item_ids.h"
41#include "objcmd.h"
42#include "facing_object.h"
43#include "fixed_math.h"
44#include "songs.h"
45
46/// The palace's people and the reward room's chests.
47enum {
60};
61
62static void McCoyPalace_ClaimReward(s32 chestActorId, s32 itemId,
63 s32 chestFlag);
64static void Event_AudienceWithMcCoy(void);
65static void Event_EscortHintsAtBarricade(void);
66static void Event_McCoyRewardsParty(void);
67static void Event_PresentRewardChests(void);
68
69/// The talkFacing bytes of placement rows 6 to 9: actors 14 to 17.
71 u8 unk000[166];
79};
80
81// The shared facing callback precedes the scene's entry points.
83
84const struct SceneEntrance *Scene_GetEntrances(void) {
86}
87
88const struct SceneRegion *Scene_GetRegions(void) { return NULL; }
89
90const u32 *Scene_GetExits(void) { return gMcCoyPalaceExits; }
91
92/// The palace's people. Once the reward is taken, the startled resident,
93/// the admirer, the Kolima watcher and the reward keeper turn differently
94/// when talked to.
96 struct ScenePlacement *placements;
97
99 placements = gMcCoyPalacePlacements;
100 FieldScene_PrepareActors(placements);
101
103 /* FAKEMATCH: a byte view of placement rows 6 to 9 keeps the native
104 * base+166 addressing; as direct talkFacing fields, it splits into
105 * base+144 and member+22. */
106 struct PalacePlacementTalkFacingView *facings =
107 (struct PalacePlacementTalkFacingView *)placements;
108
110 facings->admirer = TALK_FACE_PARTY;
111 facings->kolimaWatcher = 3;
113 }
114
115 return placements;
116 }
118}
119
120/// What the party can talk to and search in the palace.
121const struct SceneEvent *Scene_GetEvents(void) {
123 return gMcCoyPalaceEvents;
124 }
126}
127
128/// Asks about going to Kolima. "Oh, are you willing to go to Kolima Forest?"
131 Engine_EventSetMessage(MsgBilibinYouWillingGoKolimaForest);
134}
135
136/// The resident in a nightgown screams, then turns to the party. "AAAAH!!!"
142 Engine_EventSetMessage(MsgBilibinAaaah);
148 10);
150}
151
152/// The admirer praises the party the first time, then warns of the holy tree.
153/// "You are a fine warrior." After, "It's very reckless for such young
154/// warriors to face the holy tree..."
155static void Event_TalkToAdmirer(void) {
157 Engine_EventSetMessage(MsgBilibinFineWarrior);
158 if (GameFlag_IsSet(0x302) != 0) {
159 Engine_EventSetMessage(MsgBilibinItsVeryRecklessForSuch);
160 }
162 GameFlag_Set(0x302);
164}
165
166/// The watcher saw the party go to Kolima. "I was watching from here. After
167/// all that fuss, you still went to Kolima?"
168static void Event_TalkToKolimaWatcher(void) {
170 Engine_EventSetMessage(MsgBilibinWasWatchingFromHereAfter);
173}
174
175/// The keeper of McCoy's treasures: while the party chooses, only one item;
176/// after, the reward was the greatest; before, Bilibin's great treasures
177/// go to whoever ends the curse.
178static void Event_TalkToRewardKeeper(void) {
180
182 Engine_EventSetMessage(MsgBilibinMayChooseOnlyOneItem);
184 Engine_EventSetMessage(MsgBilibinRewardReceivedWasIndeedGreatest);
185 } else {
186 Engine_EventSetMessage(MsgBilibinDoThinkTheseBilibinsGreat);
187 if (Engine_GameFlagIsSet(0x84d) != 0) {
189 }
190 }
191
194}
195
196/// Mind Read on the admirer shows two thoughts. "Sometimes, we need children
197/// to remind us of our own responsibilities." Then "You looked very courageous
198/// walking toward Kolima."
199static void Event_ReadAdmirersThoughts(void) {
201 Engine_EventSetMessage(MsgBilibinSometimesWeNeedChildrenRemind);
202 if (GameFlag_IsSet(0x303) != 0) {
203 Engine_EventSetMessage(MsgBilibinLookedVeryCourageousWalkingToward);
204 }
206 GameFlag_Set(0x303);
208}
209
212
214 Engine_EventSetMessage(MsgBilibinNonethelessIfYourLuckSour);
216 Engine_EventSetMessage(MsgBilibinGoodTreasureIfGetTurned);
217 } else {
218 Engine_EventSetMessage(MsgBilibinWeReallyGivingOurTreasure);
220 Engine_EventSetMessage(MsgBilibinGotPrettyNiceRewardBut);
221 }
222 }
223
226}
227
228/// Walking through one of the palace's doors: it opens with a sound, the
229/// leader walks through and the next room loads. The front door makes no
230/// sound once the escort has opened it.
231static void Event_WalkThroughDoor(void) {
232 struct EventWork *work;
233 s32 hideDoorLayers;
234
235 work = gEventWork;
236 hideDoorLayers = 0;
237 if (work->touchedTrigger == 9) {
240 hideDoorLayers = 1;
241 }
242 } else {
244 hideDoorLayers = 1;
245 }
246 if (hideDoorLayers != 0) {
249 }
254 if (work->touchedTrigger == 9)
256 else
263}
264
265/// The chest is empty. "Isaac checked the chest... but it was empty."
266static void McCoyPalace_ShowChestEmpty(void) {
268 Engine_MessageShowCentered(MsgBilibinIsaacCheckedChestButWas, 1);
270}
271
272/// The chest is locked. "The treasure chest is locked."
275 Engine_MessageShowCentered(MsgBilibinTreasureChestLocked, 1);
277}
278
279/// Searching a reward chest after the reward: the chosen one is empty, the
280/// others locked.
281static void McCoyPalace_ShowUnavailableChest(s32 chestFlag) {
282 if (Engine_GameFlagIsSet(chestFlag) != 0) {
284 } else {
286 }
287}
288
289/// Searching the first reward chest: a Vial, while no reward is taken.
290static void Event_SearchVialChest(void) {
293 } else {
295 }
296}
297
298/// Searching the second reward chest: a Potion, while no reward is taken.
299static void Event_SearchPotionChest(void) {
302 } else {
305 }
306}
307
308/// Searching the third reward chest: a Psy Crystal, while no reward is
309/// taken.
313 } else {
316 }
317}
318
319/// Searching the fourth reward chest: a Water of Life, while no reward is
320/// taken.
324 } else {
327 }
328}
329
330/// The chest opens and gives its item; with no room for it, the chest
331/// closes again and the reward is still to choose.
332static void McCoyPalace_ClaimReward(s32 chestActorId, s32 itemId,
333 s32 chestFlag) {
334 s32 emitterHandle;
335
337
338 emitterHandle =
339 BattleFx_PlayCueAndStartEmitterOnTarget(0, chestActorId, itemId);
340
341 if (Engine_PartyGiveItem(itemId, 0) != -1) {
342 Engine_ActorSetAnimation(chestActorId, 2);
344 Engine_GameFlagSet(chestFlag);
347 } else {
349 Engine_ActorSetAnimation(chestActorId, 5);
350 }
351
352 Engine_ObjectDispatchRelease((struct FieldActor *)emitterHandle);
354}
355
356/// Leaving the reward room without a reward: the escort walks the leader back.
357/// "Please take your reward before your depart!"
360 if (Engine_GameFlagIsSet(0x322) != 0) {
366 Engine_EventSetMessage(MsgBilibinPleaseTakeYourRewardBefore);
372 }
373 }
374}
375
376/// Leaving the reward room with a reward: the escort leaves.
377/// "You are always welcome in the palace of Lord McCoy."
378static void Event_EscortSeesPartyOff(void) {
382 Actor_SetSpeed(ACTOR_ESCORT, PIXELS(3) / 5, PIXELS(3) / 10);
391 Engine_EventSetMessage(MsgBilibinAlwaysWelcomeInPalaceLord);
393 Actor_SetSpeed(ACTOR_ESCORT, PIXELS(4) / 5, PIXELS(2) / 5);
398 GameFlag_Set(0x333);
400 }
401}
402
403/// The four reward chests stand in a row.
404static __inline__ void McCoyPalace_PositionRewardChests(void) {
409}
410
411/// The cells before the chest row can be walked on.
412static __inline__ void McCoyPalace_OpenRewardChestRow(void) {
413 Map_CopyCellAttributes(38, 55, 4, 1, 38, 45);
414 Map_CopyCellAttributes(42, 55, 4, 1, 38, 46);
415}
416
417/// Sets the palace up: McCoy's first audience, the escort at the door after
418/// it, the reward audience once Kolima's curse is lifted, or the reward
419/// chests where the party left them.
421 s32 rewardTaken;
422 s32 curseLifted;
423 struct FieldActor *chest;
424
431 }
432 // A first audience and a return to the entrance have different greetings.
435 if (gGameState.entrance == 29) {
437 } else if (gGameState.entrance == 9 && Engine_GameFlagIsSet(0x321) != 0) {
439 }
440 } else {
442 if (rewardTaken != 0) {
443 } else {
444 if (gGameState.entrance == 29) {
447 if (curseLifted != 0) {
449 }
450 }
451 } else {
452 // Restore the displayed chest row after reloading the reward room.
453 if (gGameState.entrance == 28) {
454 if (Engine_GameFlagIsSet(0x322) != 0) {
469 rewardTaken;
471 rewardTaken;
473 chest->y.fixed = -PIXELS(4);
475 chest->y.fixed = -PIXELS(4);
477 chest->y.fixed = -PIXELS(4);
479 chest->y.fixed = -PIXELS(4);
480 } else {
482 }
483 }
484 }
485 }
486 }
487 }
488 return 0;
489}
490
491/// Garet, Ivan and Mia get ready to walk up to McCoy.
492static __inline__ void McCoyPalace_PrepareCompanionApproach(void) {
493 Actor_SetSpeed(GARET, PIXELS(3) / 5, PIXELS(3) / 10);
494 Actor_SetSpeed(IVAN, PIXELS(3) / 5, PIXELS(3) / 10);
495 Actor_SetSpeed(MIA, PIXELS(1), PIXELS(1) / 2);
499}
500
501/// The first audience: the escort announces the party and McCoy asks them to
502/// lift Kolima's curse. Refusing, he calls them too young and they leave;
503/// coming back, they may change their minds. Accepting, McCoy gives the key
504/// to the barricades, Garet bristles at being called children, and McCoy
505/// takes the key back.
506static void Event_AudienceWithMcCoy(void) {
507 struct FieldActor *actor;
508
509 // Stage the first audience, or place the leader for a return visit.
511 Camera_MoveTo(-1, -1, -1, 0);
514 Camera_MoveTo(PIXELS(894), -1, PIXELS(664), 0);
518 Camera_MoveTo(PIXELS(894), -1, PIXELS(698), 0);
522 }
532 Camera_SetSpeed(PIXELS(3) / 5, PIXELS(3) / 40);
533 Camera_MoveTo(PIXELS(894), -1, PIXELS(698), 1);
534 Actor_SetSpeed(ACTOR_ESCORT, PIXELS(4) / 5, PIXELS(2) / 5);
535 Actor_WalkTo(ACTOR_ESCORT, 894, 696);
537 Camera_MoveTo(PIXELS(894), -1, PIXELS(664), 1);
547 // The escort announces the warriors before they enter the audience.
548 Engine_EventSetMessage(MsgBilibinMatter);
564 Camera_MoveTo(PIXELS(894), -1, PIXELS(698), 1);
573 Camera_MoveTo(PIXELS(894), -1, PIXELS(664), 1);
576 if (actor != 0) {
577 Engine_ActorSetPosition(GARET, actor->x.fixed, actor->z.fixed);
578 }
580 if (actor != 0) {
581 Engine_ActorSetPosition(IVAN, actor->x.fixed, actor->z.fixed);
582 }
585 if (actor != 0) {
586 Engine_ActorSetPosition(MIA, actor->x.fixed, actor->z.fixed);
587 }
588 }
594 }
616 // Let the party accept the assignment or leave after McCoy refuses them.
620 if (Engine_EventChooseYesNo(0, 0) == 0) {
621 // The initial offer and reconsideration share their accept/refuse paths.
622 goto accepted;
623 }
624 declined:
625 Engine_EventSetMessage(MsgBilibinTooYoungForTheJob);
630 10);
636 if (actor != 0) {
638 actor->z.part.pixel);
639 }
642 if (actor != 0) {
644 actor->z.part.pixel);
645 }
649 if (actor != 0) {
650 Engine_ActorSetDestination(MIA, actor->x.part.pixel,
651 actor->z.part.pixel);
652 }
653 }
657 Actor_SetPosition(MIA, 0, 0);
664 goto leave;
665 }
669 Engine_CameraSetSpeed(PIXELS(3) / 5, PIXELS(3) / 40);
670 Engine_CameraMoveTo(PIXELS(894), -1, PIXELS(664), 1);
674 if (actor != 0) {
675 Engine_ActorSetPosition(GARET, actor->x.fixed, actor->z.fixed);
676 }
678 if (actor != 0) {
679 Engine_ActorSetPosition(IVAN, actor->x.fixed, actor->z.fixed);
680 }
683 if (actor != 0) {
684 Engine_ActorSetPosition(MIA, actor->x.fixed, actor->z.fixed);
685 }
686 }
692 }
702 // A returning party can reconsider the assignment without replaying the
703 // escort.
704 Engine_EventSetMessage(MsgBilibinYehveChangeHeart);
706 if (Engine_EventChooseYesNo(0, 0) == 1) {
707 // Reuse the initial refusal's dialogue and departure.
708 goto declined;
709 }
710accepted:
711 // Both ways of accepting join the same explanation and departure.
721 Engine_EventSetMessage(MsgBilibinHmmmWellGrant);
723 // Animate McCoy tossing the barricade key to the party.
727 actor->scaleX = Q16_ONE / 2;
728 actor->scaleY = Q16_ONE / 2;
730 if (actor != 0) {
732 actor->z.fixed);
733 }
752 if (Engine_EventChooseYesNo(0, 0) == 1) {
753 do {
756 Engine_EventSetMessage(MsgBilibinSeriousDoesntBother);
758 } while (Engine_EventChooseYesNo(0, 0) != 1);
759 }
761 // Resolve Garet\'s objections before McCoy dismisses the party.
762 Engine_EventSetMessage(MsgBilibinWellDontLet);
773 20);
796 while (Engine_EventChooseYesNo(0, 0) != 0) {
797 Engine_EventSetMessage(MsgBilibinComeSaidYoud);
799 }
808 Engine_EventSetMessage(MsgBilibinWellSGoing);
839 if (actor != 0) {
841 actor->z.part.pixel);
842 }
888 // Keep the party looking at its escort while he leaves the audience.
895 Actor_SetSpeed(ACTOR_ESCORT, PIXELS(3) / 5, PIXELS(3) / 10);
915 if (actor != 0) {
916 Engine_ActorSetDestination(GARET, actor->x.part.pixel, actor->z.part.pixel);
917 }
920 if (actor != 0) {
921 Engine_ActorSetDestination(IVAN, actor->x.part.pixel, actor->z.part.pixel);
922 }
926 if (actor != 0) {
927 Engine_ActorSetDestination(MIA, actor->x.part.pixel, actor->z.part.pixel);
928 }
929 }
939 Engine_GameFlagSet(0x321);
940leave:
943}
944
945/// At the front door after the audience: McCoy's escort is sorry the party
946/// was rejected, asks them not to go to Kolima and lets slip that the
947/// barricade may not need a key.
956 Camera_MoveTo(-1, -1, -1, 0);
963 Actor_SetSpeed(ACTOR_ESCORT, PIXELS(3) / 5, PIXELS(3) / 10);
969 Engine_EventSetMessage(MsgBilibinNameSorryRejected);
989 Actor_SetSpeed(ACTOR_ESCORT, PIXELS(4) / 5, PIXELS(2) / 5);
995}
996
997/// Garet, Ivan and Mia turn to talk among themselves.
1002}
1003
1004/// Garet, Ivan and Mia face McCoy again.
1009}
1010
1011/// Brought in after lifting Kolima's curse: McCoy thanks the party and sends
1012/// them to choose a reward.
1013static void Event_McCoyRewardsParty(void) {
1014 struct FieldActor *viewCenter;
1015 struct FieldActor *actor;
1016 s32 advanceAlternateReply;
1017
1019 // Reveal the approach, then walk the leader and escort into the audience.
1020 Camera_MoveTo(-1, -1, -1, 0);
1021 Engine_TaskWait(1);
1022 viewCenter = Engine_EventGetViewCenter();
1023 advanceAlternateReply = 0;
1024 viewCenter->motionFlags = advanceAlternateReply;
1025 Camera_MoveTo(PIXELS(894), -1, PIXELS(664), 0);
1026 Engine_TaskWait(1);
1029 Engine_TaskWait(1);
1030
1033
1036 Engine_EventWait(40);
1039 Camera_SetSpeed(PIXELS(3) / 5, PIXELS(3) / 40);
1040 Camera_MoveTo(PIXELS(894), -1, PIXELS(698), 1);
1041 Actor_SetSpeed(ACTOR_ESCORT, PIXELS(4) / 5, PIXELS(2) / 5);
1043 Actor_WalkTo(ACTOR_ESCORT, 888, 720);
1045 Engine_EventWait(60);
1050 Engine_EventWait(20);
1052 // Present the returning warriors, using the reply for their earlier
1053 // reception.
1054 Engine_EventSetMessage(MsgBilibinWeveBroughtWarriorsMilord);
1055 // Adjacent variants depend on whether McCoy's earlier request was declined.
1056
1057 advanceAlternateReply = 1;
1060 advanceAlternateReply = 0;
1061 }
1063 if (advanceAlternateReply != 0) {
1065 }
1066
1067 Camera_MoveTo(PIXELS(894), -1, PIXELS(664), 1);
1070
1072 if (actor != 0) {
1073 Actor_SetPosition(GARET, actor->x.fixed, actor->z.fixed);
1074 }
1076 if (actor != 0) {
1077 Actor_SetPosition(IVAN, actor->x.fixed, actor->z.fixed);
1078 }
1080 if (actor != 0) {
1081 Actor_SetPosition(MIA, actor->x.fixed, actor->z.fixed);
1082 }
1083
1092 Engine_EventWait(10);
1098 Engine_EventWait(20);
1099
1100 advanceAlternateReply = 1;
1103 advanceAlternateReply = 0;
1104 }
1107 if (advanceAlternateReply != 0) {
1109 }
1110
1111 advanceAlternateReply = 1;
1114 advanceAlternateReply = 0;
1115 }
1118 if (advanceAlternateReply != 0) {
1120 }
1121
1122 // Let the companions answer McCoy\'s thanks in turn.
1124 Engine_EventWait(20);
1128 } else {
1129 Engine_EventWait(40);
1130 }
1131
1141 Engine_EventWait(20);
1145
1151 advanceAlternateReply = 1;
1152 if (Engine_EventChooseYesNo(0, 0) != 0) {
1154 advanceAlternateReply = 0;
1155 }
1158 Engine_EventWait(10);
1160 if (advanceAlternateReply != 0) {
1162 }
1164 } else {
1165 gEventWork->message += 4;
1166 }
1167
1170 if (Engine_EventChooseYesNo(0, 0) == 0) {
1171 Engine_EventSetMessage(MsgBilibinHumblyThank);
1172 } else {
1173 Engine_EventSetMessage(MsgBilibinNaeYehDinnaeNeedTae);
1174 }
1175
1179 // McCoy explains his caution and offers a choice from the treasury.
1180 Engine_EventSetMessage(MsgBilibinWasButWorriedYehMight);
1190 Engine_EventWait(10);
1197 Engine_EventWait(20);
1206
1208 advanceAlternateReply = 1;
1209 if (Engine_EventChooseYesNo(0, 0) == 1) {
1211 advanceAlternateReply = 0;
1212 }
1215 if (advanceAlternateReply != 0) {
1217 }
1218
1223 Engine_EventWait(20);
1236 Engine_EventWait(20);
1237
1240 if (actor != 0) {
1241 Actor_SetDestination(GARET, actor->x.part.pixel, actor->z.part.pixel);
1242 }
1245 if (actor != 0) {
1246 Actor_SetDestination(IVAN, actor->x.part.pixel, actor->z.part.pixel);
1247 }
1250 if (actor != 0) {
1251 Actor_SetDestination(MIA, actor->x.part.pixel, actor->z.part.pixel);
1252 }
1253
1255 Actor_SetPosition(GARET, 0, 0);
1256 Actor_SetPosition(IVAN, 0, 0);
1258 Actor_SetPosition(MIA, 0, 0);
1259 Engine_EventWait(20);
1269 Engine_EventWait(10);
1272 Actor_WalkTo(ACTOR_ESCORT, 894, 764);
1276 GameFlag_Set(802);
1280 }
1283}
1284
1285/// In the reward room: the escort shows the four chests and the keeper
1286/// explains that only one may be chosen.
1287static void Event_PresentRewardChests(void) {
1288 struct FieldActor *actor;
1289
1291 // Restore the chest-row collision patches before presenting the reward.
1292 Camera_MoveTo(-1, -1, -1, 0);
1294 Engine_CameraMoveTo(0x2740000, -1, 0x2ec0000, 0);
1308 actor->motionFlags = 0;
1317 Engine_TaskWait(1);
1322 Actor_SetSpeed(ACTOR_ESCORT, PIXELS(3) / 5, PIXELS(3) / 10);
1324 Actor_WalkTo(ACTOR_ESCORT, 628, 764);
1327 Engine_EventWait(20);
1329 // The escort and keeper explain that only one chest may be chosen.
1330 Engine_EventSetMessage(MsgBilibinLordMccoyOrdered);
1340}
1341
1343 SC_CALL(Scene_TurnTowardTarget),
1345};
1346
1348 SC_ARG(2),
1349 SC_MOVE(PIXELS(842), 0, PIXELS(696)),
1350 SC_SYNC,
1351 SC_MOVE(PIXELS(842), 0, PIXELS(636)),
1352 SC_SYNC,
1353 SC_MOVE(PIXELS(876), 0, PIXELS(634)),
1354 SC_SYNC,
1355 SC_ARG(1),
1357 SC_WAIT(1),
1358 SC_END,
1359};
1360
1362 {0, CONDITION_ALWAYS, 256, 0, 808, FACING_NORTH, 0, -1, -1, -1, -1, 0},
1363 {1, CONDITION_ALWAYS, 256, 0, 808, FACING_NORTH, 0, 32, 496, 480, 856, 0},
1364 {2, CONDITION_ALWAYS, 120, 0, 792, FACING_EAST, 0, 32, 496, 480, 856, 0},
1365 {3, CONDITION_ALWAYS, 392, 0, 792, FACING_WEST, 0, 32, 496, 480, 856, 0},
1366 {4, CONDITION_ALWAYS, 232, 0, 712, FACING_EAST, 0, 32, 496, 480, 856, 0},
1367 {5, CONDITION_ALWAYS, 280, 0, 712, FACING_WEST, 0, 32, 496, 480, 856, 0},
1368 {6, CONDITION_ALWAYS, 152, 0, 632, FACING_WEST, 0, 32, 496, 480, 856, 0},
1369 {7, CONDITION_ALWAYS, 104, 0, 552, FACING_EAST, 0, 32, 496, 480, 856, 0},
1370 {8, CONDITION_ALWAYS, 408, 0, 552, FACING_WEST, 0, 32, 496, 480, 856, 0},
1371 {9, CONDITION_ALWAYS, 256, 0, 632, FACING_SOUTH, 0, 32, 496, 480, 856, 0},
1372 {10, CONDITION_ALWAYS, 152, 0, 376, FACING_WEST, 0, 56, 304, 360, 464, 0},
1373 {11, CONDITION_ALWAYS, 264, 0, 376, FACING_EAST, 0, 56, 304, 360, 464, 0},
1374 {12, CONDITION_ALWAYS, 104, 0, 376, FACING_SOUTH, 0, 56, 304, 360, 464, 0},
1375 {13, CONDITION_ALWAYS, 312, 0, 376, FACING_SOUTH, 0, 56, 304, 360, 464, 0},
1376 {14, CONDITION_ALWAYS, 696, 0, 96, FACING_WEST, 0, 592, 0, 832, 160, 0},
1377 {15, CONDITION_ALWAYS, 680, 0, 72, FACING_WEST, 0, 592, 0, 832, 160, 0},
1378 {16, CONDITION_ALWAYS, 952, 0, 72, FACING_EAST, 0, 800, 0, 1040, 160, 0},
1379 {17, CONDITION_ALWAYS, 936, 0, 96, FACING_EAST, 0, 800, 0, 1040, 160, 0},
1380 {18, CONDITION_ALWAYS, 88, 0, 200, FACING_NORTH, 0, 0, 16, 240, 240, 0},
1381 {19, CONDITION_ALWAYS, 360, 0, 200, FACING_NORTH, 0, 208, 16, 448, 240, 0},
1382 {20, CONDITION_ALWAYS, 536, 0, 112, FACING_EAST, 0, 400, 0, 640, 160, 0},
1383 {21, CONDITION_ALWAYS, 536, 0, 88, FACING_EAST, 0, 400, 0, 640, 160, 0},
1384 {22, CONDITION_ALWAYS, 520, 0, 312, FACING_WEST, 0, 400, 208, 640, 368, 0},
1385 {23, CONDITION_ALWAYS, 520, 0, 296, FACING_WEST, 0, 400, 208, 640, 368, 0},
1386 {24, CONDITION_ALWAYS, 728, 0, 264, FACING_EAST, 0, 592, 192, 832, 352, 0},
1387 {25, CONDITION_ALWAYS, 904, 0, 264, FACING_WEST, 0, 792, 192, 1032, 352, 0},
1388 {26, CONDITION_ALWAYS, 744, 0, 424, FACING_EAST, 0, 592, 352, 832, 512, 0},
1389 {27, CONDITION_ALWAYS, 888, 0, 424, FACING_WEST, 0, 792, 352, 1032, 512, 0},
1390 {28, CONDITION_ALWAYS, 600, 0, 760, FACING_EAST, 0, 512, 560, 752, 816, 0},
1391 {29, CONDITION_ALWAYS, 896, 0, 728, FACING_NORTH, 0, 776, 560, 1016, 768,
1392 0},
1394};
1395
1397 SCENE_EXITS(33), SCENE_EXIT(1, 34, 2), SCENE_EXIT(2, 33, 14),
1398 SCENE_EXIT(3, 33, 17), SCENE_EXIT(4, 33, 10), SCENE_EXIT(5, 33, 11),
1399 SCENE_EXIT(6, 33, 28), SCENE_EXIT(7, 33, 22), SCENE_EXIT(8, 33, 20),
1400 SCENE_EXIT(9, 33, 29), SCENE_EXIT(10, 33, 4), SCENE_EXIT(11, 33, 5),
1401 SCENE_EXIT(12, 33, 18), SCENE_EXIT(13, 33, 19), SCENE_EXIT(14, 33, 2),
1402 SCENE_EXIT(15, 33, 26), SCENE_EXIT(16, 33, 27), SCENE_EXIT(17, 33, 3),
1403 SCENE_EXIT(18, 33, 12), SCENE_EXIT(19, 33, 13), SCENE_EXIT(20, 33, 8),
1404 SCENE_EXIT(21, 33, 25), SCENE_EXIT(22, 33, 7), SCENE_EXIT(23, 33, 24),
1405 SCENE_EXIT(24, 33, 23), SCENE_EXIT(25, 33, 21), SCENE_EXIT(26, 33, 15),
1406 SCENE_EXIT(27, 33, 16), SCENE_EXIT(28, 33, 6), SCENE_EXIT(29, 33, 9),
1408};
1409
1412};
1413
1414// clang-format off
1416 { 0x65, 0x0, ACTOR_STAND,
1417 PIXELS(265), 0, PIXELS(702), FACING_SOUTH + FACING_STEP, TALK_FACE_PARTY, 0 },
1418 { 0x73, 0x0, ACTOR_STAND,
1420 { 0x6a, 0x0, ACTOR_STAND,
1422 { 0x6c, 0x0, ACTOR_WANDER,
1423 PIXELS(166), 0, PIXELS(728), FACING_EAST + FACING_STEP, TALK_FACE_PARTY, 0 },
1424 { 0x6a, 0x0, ACTOR_STAND,
1426 { 0x6a, 0x0, ACTOR_WANDER,
1427 PIXELS(362), 0, PIXELS(142), FACING_SOUTH + FACING_STEP, TALK_FACE_PARTY, 0 },
1428 { 0x6a, 0x0, ACTOR_STAND,
1430 { 0x67, 0x0, ACTOR_STAND,
1432 { 0x96, 0x0, ACTOR_STAND,
1433 PIXELS(951), 0, PIXELS(438), FACING_SOUTH + FACING_STEP, TALK_KEEP_FACING, 0 },
1436 { 0x3a, 0x0, ACTOR_STAND,
1441 0, 0, 0, FACING_SOUTH, TALK_KEEP_FACING, 0 },
1443 0, 0, 0, FACING_SOUTH, TALK_FACE_PARTY, 0 },
1445 0, 0, 0, FACING_SOUTH, TALK_FACE_PARTY, 0 },
1447 0, 0, 0, FACING_SOUTH, TALK_FACE_PARTY, 0 },
1449 0, 0, 0, FACING_SOUTH, TALK_FACE_PARTY, 0 },
1451 0, 0, 0, FACING_SOUTHWEST, TALK_KEEP_FACING, 0 },
1453 0, 0, 0, FACING_SOUTHEAST, TALK_KEEP_FACING, 0 },
1455 0, 0, 0, FACING_EAST, TALK_FACE_PARTY, 0 },
1456 { 0x14, 0x0, 7,
1457 PIXELS(616), 0, PIXELS(616), FACING_SOUTH, TALK_KEEP_FACING, 0 },
1458 { 0x14, 0x0, 7,
1460 { 0x14, 0x0, 7,
1462 { 0x14, 0x0, 7,
1464 { 0x14, 0x0, 7,
1465 PIXELS(616), 0, PIXELS(648), FACING_SOUTH, TALK_KEEP_FACING, 0 },
1466 { 0x14, 0x0, 7,
1468 { 0x14, 0x0, 7,
1470 { 0x14, 0x0, 7,
1471 PIXELS(616), 0, PIXELS(664), FACING_SOUTH, TALK_KEEP_FACING, 0 },
1472 { 0x14, 0x0, 7,
1474 { 0x14, 0x0, 7,
1476 { SCENE_TABLE_END },
1477};
1478
1480 { SCENE_EVENTS_END },
1481};
1482
1484 { EVENT_EXIT, 1, CONDITION_ALWAYS, 1 },
1485 { EVENT_EXIT, 2, CONDITION_ALWAYS, 2 },
1486 { EVENT_EXIT, 3, CONDITION_ALWAYS, 3 },
1487 { EVENT_EXIT, 4, CONDITION_ALWAYS, 4 },
1488 { EVENT_EXIT, 5, CONDITION_ALWAYS, 5 },
1489 { EVENT_EXIT, 6, CONDITION_ALWAYS, 6 },
1490 { EVENT_EXIT, 7, CONDITION_ALWAYS, 7 },
1491 { EVENT_EXIT, 8, CONDITION_ALWAYS, 8 },
1493 { EVENT_EXIT, 10, CONDITION_ALWAYS, 10 },
1494 { EVENT_EXIT, 11, CONDITION_ALWAYS, 11 },
1497 { EVENT_EXIT, 14, CONDITION_ALWAYS, 14 },
1498 { EVENT_EXIT, 15, CONDITION_ALWAYS, 15 },
1499 { EVENT_EXIT, 16, CONDITION_ALWAYS, 16 },
1500 { EVENT_EXIT, 17, CONDITION_ALWAYS, 17 },
1501 { EVENT_EXIT, 18, CONDITION_ALWAYS, 18 },
1502 { EVENT_EXIT, 19, CONDITION_ALWAYS, 19 },
1503 { EVENT_EXIT, 20, CONDITION_ALWAYS, 20 },
1504 { EVENT_EXIT, 21, CONDITION_ALWAYS, 21 },
1505 { EVENT_EXIT, 22, CONDITION_ALWAYS, 22 },
1506 { EVENT_EXIT, 23, CONDITION_ALWAYS, 23 },
1507 { EVENT_EXIT, 24, CONDITION_ALWAYS, 24 },
1508 { EVENT_EXIT, 25, CONDITION_ALWAYS, 25 },
1509 { EVENT_EXIT, 26, CONDITION_ALWAYS, 26 },
1510 { EVENT_EXIT, 27, CONDITION_ALWAYS, 27 },
1511 { EVENT_EXIT, 28, CONDITION_ALWAYS, 28 },
1512 { EVENT_EXIT, 29, CONDITION_ALWAYS, 29 },
1513 { EVENT_TALK, 8, FLAG_MCCOY_PALACE_REWARD_TAKEN, MSGNO(MsgBilibinIfYouWantToSeeLord) },
1514 { EVENT_TALK, 8, CONDITION_ALWAYS, MSGNO(MsgBilibinThePeopleOfBilibinWillNever) },
1515 { EVENT_TALK, 9, FLAG_MCCOY_PALACE_REWARD_TAKEN, MSGNO(MsgBilibinMakeSureYouDontOffendLord) },
1516 { EVENT_TALK, 9, CONDITION_ALWAYS, MSGNO(MsgBilibinIHeardYouReceivedASpectacular) },
1518 { EVENT_TALK, ACTOR_KOLIMA_ASKER, CONDITION_ALWAYS, MSGNO(MsgBilibinLadyMccoyIsQuiteUpsetThat) },
1519 { EVENT_TALK, 11, FLAG_MCCOY_PALACE_REWARD_TAKEN, MSGNO(MsgBilibinIAlwaysBelievedThatTheOld) },
1520 { EVENT_TALK, 11, CONDITION_ALWAYS, MSGNO(MsgBilibinThingsAreLookingGrimSouthOf) },
1521 { EVENT_TALK, 12, FLAG_MCCOY_PALACE_REWARD_TAKEN, MSGNO(MsgBilibinThisIsLadyMccoysRoomSo) },
1522 { EVENT_TALK, 12, CONDITION_ALWAYS, MSGNO(MsgBilibinMiladyWasVeryUpsetWhenShe) },
1523 { EVENT_TALK, 13, FLAG_MCCOY_PALACE_REWARD_TAKEN, MSGNO(MsgBilibinMiladyWasRenownedFarAndWide) },
1524 { EVENT_TALK, 13, CONDITION_ALWAYS, MSGNO(MsgBilibinForOnceMilordDidntLetLady) },
1525 { EVENT_TALK, ACTOR_STARTLED_RESIDENT, FLAG_MCCOY_PALACE_REWARD_TAKEN, MSGNO(MsgBilibinOhSomedayIWantToSleep) },
1527 { EVENT_TALK, ACTOR_PARTY_ADMIRER, FLAG_MCCOY_PALACE_BARRICADE_HINT, MSGNO(MsgBilibinYouCanSeeKolimaPrettyWell) },
1528 { EVENT_TALK, ACTOR_PARTY_ADMIRER, FLAG_MCCOY_PALACE_REWARD_TAKEN, MSGNO(MsgBilibinHeyIfYouCantDoThe) },
1530 { EVENT_TALK, ACTOR_KOLIMA_WATCHER, FLAG_MCCOY_PALACE_REWARD_TAKEN, MSGNO(MsgBilibinHmmItSeemsTheCurseOf) },
1532 { EVENT_TALK, ACTOR_ESCORT, CONDITION_ALWAYS, MSGNO(MsgBilibinYouMaySelectASingleItem) },
1534 { EVENT_TALK, ACTOR_LORD_MCCOY, FLAG_MCCOY_PALACE_REWARD_TAKEN, MSGNO(MsgBilibinSorryLadsButKolimasFutureIs) },
1535 { EVENT_TALK, ACTOR_LORD_MCCOY, CONDITION_ALWAYS, MSGNO(MsgBilibinYehveTaughtMeThatICannae) },
1536 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 8, FLAG_MCCOY_PALACE_REWARD_TAKEN, MSGNO(MsgBilibinHowManyTimesDoIHave) },
1537 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 8, CONDITION_ALWAYS, MSGNO(MsgBilibinIFeelSorryForTheWarriors) },
1538 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 9, FLAG_MCCOY_PALACE_REWARD_TAKEN, MSGNO(MsgBilibinTheyShouldNeverHaveLetSuch) },
1539 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 9, CONDITION_ALWAYS, MSGNO(MsgBilibinIWonderWhatKindOfTreasure) },
1540 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), ACTOR_KOLIMA_ASKER, FLAG_MCCOY_PALACE_REWARD_TAKEN, MSGNO(MsgBilibinSendingTheseChildrenToKolimaForest) },
1541 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), ACTOR_KOLIMA_ASKER, CONDITION_ALWAYS, MSGNO(MsgBilibinIWishShedJustStopWhining) },
1542 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 11, FLAG_MCCOY_PALACE_REWARD_TAKEN, MSGNO(MsgBilibinIShouldntHaveSaidAnythingWhen) },
1543 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 11, CONDITION_ALWAYS, MSGNO(MsgBilibinTheydBeGuaranteedAGoodLife) },
1544 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 12, FLAG_MCCOY_PALACE_REWARD_TAKEN, MSGNO(MsgBilibinOfAllTheNerveComingInto) },
1545 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 12, CONDITION_ALWAYS, MSGNO(MsgBilibinICanTellWhenShesUpset) },
1546 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 13, FLAG_MCCOY_PALACE_REWARD_TAKEN, MSGNO(MsgBilibinWillIEverFindSomeoneTo) },
1547 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 13, CONDITION_ALWAYS, MSGNO(MsgBilibinSometimesAMansJustGottaPut) },
1549 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), ACTOR_STARTLED_RESIDENT, CONDITION_ALWAYS, MSGNO(MsgBilibinTheHoleInThisNightgownIs) },
1550 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), ACTOR_PARTY_ADMIRER, FLAG_MCCOY_PALACE_BARRICADE_HINT, MSGNO(MsgBilibinLordMccoyHasntComeHereFor) },
1551 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), ACTOR_PARTY_ADMIRER, FLAG_MCCOY_PALACE_REWARD_TAKEN, MSGNO(MsgBilibinItsAToughThingBeingSo) },
1553 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), ACTOR_KOLIMA_WATCHER, FLAG_MCCOY_PALACE_REWARD_TAKEN, MSGNO(MsgBilibinKolimaForestUsedToBeSo) },
1554 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), ACTOR_KOLIMA_WATCHER, CONDITION_ALWAYS, MSGNO(MsgBilibinACourageousWarriorWouldntThinkTwice) },
1555 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), ACTOR_ESCORT, CONDITION_ALWAYS, MSGNO(MsgBilibinTheseCourageousWarriorsDeserveToReceive) },
1557 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), ACTOR_LORD_MCCOY, FLAG_MCCOY_PALACE_REWARD_TAKEN, MSGNO(MsgBilibinThereIsNothingMoreToTalk) },
1558 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), ACTOR_LORD_MCCOY, CONDITION_ALWAYS, MSGNO(MsgBilibinButICannaeFiggerOutHow) },
1567 { SEARCH(SEARCH_WARDROBE), 200, CONDITION_ALWAYS, FIND_MESSAGE(MSGNO(MsgBilibinTheresASilkNegligeeIsaacPut)) },
1568 { SEARCH(SEARCH_BOOKCASE), 201, CONDITION_ALWAYS, FIND_MESSAGE(MSGNO(MsgBilibinTheresASheetOfPaperTitled)) },
1569 { SCENE_EVENTS_END },
1570};
1571// clang-format on
Ability numbers, named from the English release.
@ ABILITY_MIND_READ
Definition ability_ids.h:16
void Object_RefreshSelectorById(u32 objectId)
Waits, at most 300 frames, for an actor's script to reach its end (command 0x10).
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.
Calls through a function pointer, by argument count.
Character numbers, with each character's Japanese name.
#define GARET
Jerald.
#define MIA
Mary.
#define IVAN
Ivan.
void Engine_ActorSetSpriteFlags(struct FieldActor *, s32)
The engine calls the debug menus import, and their palette swatch tiles.
FacingObject, the view of an object that turns to face a target.
void FieldScene_PrepareActors(struct ScenePlacement *entry)
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)
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
static void Event_ShowMessageAndWait(s32 speaker, s32 flags, s32 frames)
s32 Engine_EventChooseYesNo(s32 actor, s32 flags)
void Engine_MessageShowCentered(s32 message, s32 flags)
s32 Engine_PartyGiveItem(s32 item, s32 flags)
void Engine_EventShowMessageAndWait(s32 speaker, s32 flags, s32 frames)
#define GameFlag_IsSet
#define SPEAKER_PORTRAIT_RIGHT
Definition field_event.h:55
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_ActorJump(s32 actor, s32 height, s32 frames)
#define EMOTE_IN_FRONT
Definition field_event.h:49
static void Actor_MoveToAndWait(s32 actor, s32 x, s32 z)
static void Actor_SetDestinationOffset(s32 actor, s32 dx, s32 dz)
void Engine_ActorFaceDirection(s32 actor, s32 facing, s32 frames)
void Engine_EventCloseScreen(void)
void Engine_ObjectDispatchRelease(struct FieldActor *object)
void Engine_ActorSetDestination(s32 actor, s32 x, s32 z)
void Engine_ActorWalkToAndWait(s32 actor, s32 x, s32 z)
static void Actor_FaceActor(s32 actor, s32 target, s32 frames)
static void Actor_WalkTo(s32 actor, s32 x, s32 z)
void Engine_EventWaitForScreen(void)
#define GameFlag_Set
static void Actor_ShowEmote(s32 actor, s32 emote, s32 frames)
s32 Engine_EventAskYesNo(s32 speaker, s32 flags)
void Engine_EventOpenScreen(void)
s32 Engine_EventOpenMessage(s32 speaker, s32 flags)
void Engine_GameFlagSet(s32 flag)
void Engine_GameFlagClear(s32 flag)
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)
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_ActorWalkTo(s32 actor, s32 x, s32 z)
static void Event_ShowMessage(s32 speaker, s32 flags)
void Engine_ActorSetAttachedEffect(s32 actor, s32 effect)
static void Event_PlayCue(s32 cue)
s32 Engine_GameFlagIsSet(s32 flag)
void Engine_ActorStartRepeatedMotion(s32 actor, s32 repeats)
struct FieldActor * Engine_EventGetViewCenter(void)
static void Actor_CenterAndWalk(s32 actor, s32 priority, 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_ActorSetDestinationOffset(s32 actor, s32 dx, s32 dz)
void Engine_EventWait(s32 frames)
static void Actor_SetAttachedEffect(s32 actor, s32 effect)
@ ACTOR_LINK_KEEP_MOTION
Definition field_obj.h:148
@ TRANSITION_WINDOW
Definition field_obj.h:17
@ TRANSITION_BACKDROP_FADE
Definition field_obj.h:16
#define SCENE_TRANSITION(style, variant)
Definition field_obj.h:20
The scene table formats: entrances, exits, placements and events, and the macros that write them.
#define SCENE_EVENTS_END
#define FIND_ITEM(item)
@ EVENT_TOUCH
@ EVENT_EXIT
@ EVENT_TALK
@ FACING_STEP
Definition field_scene.h:36
#define SCENE_EXITS(scene)
Definition field_scene.h:72
#define FIND_MESSAGE(message)
#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
@ TALK_FACE_PARTY_AND_BACK
#define PSYNERGY_ON_ACTOR(ability)
#define EVENT_SCRIPT(script)
@ ACTOR_WANDER
@ ACTOR_STAND
#define SEARCH(target)
#define SCENE_EXITS_END
Definition field_scene.h:77
#define PLACEMENT_SHARE_PREVIOUS_SPRITE
#define TOUCH_FACING(facing)
@ FACING_NORTHEAST
Definition field_scene.h:33
@ FACING_EAST
Definition field_scene.h:26
@ FACING_SOUTHEAST
Definition field_scene.h:27
@ FACING_NORTH
Definition field_scene.h:32
@ FACING_SOUTHWEST
Definition field_scene.h:29
@ FACING_NORTHWEST
Definition field_scene.h:31
@ FACING_SOUTH
Definition field_scene.h:28
@ FACING_WEST
Definition field_scene.h:30
#define PIXELS(value)
@ SEARCH_BOOKCASE
@ SEARCH_WARDROBE
@ SEARCH_UNNAMED
@ SEARCH_BARREL
The scene service layer: one typed inline for each engine service a scene calls by its own name,...
static void FieldObject_SetTargetAndCallback(s32 object, s32 target, const s32 *actions)
16.16 fixed-point constants, sine and cosine, and the library division.
#define Q16_ONE
One in the engine's signed 16.16 fixed-point format.
Definition fixed_math.h:10
Game flags, named where their meaning is shown.
#define FLAG_MCCOY_PALACE_BARREL_SMOKE_BOMB
Definition flags.h:333
#define FLAG_SHOW_LOCATION_NAME
Definition flags.h:94
#define FLAG_SCENE_TEMP_12
Definition flags.h:731
#define FLAG_SCENE_TEMP_13
Definition flags.h:732
#define FLAG_MCCOY_PALACE_REWARD_TAKEN
Definition flags.h:105
#define FLAG_IN_PARTY(character)
Flags 0 to 7: the character with that id (character_ids.h) is in the party (Party_AddActiveOwner).
Definition flags.h:9
#define FLAG_MCCOY_PALACE_PARTY_REWARDED
The escort has seen the party off after McCoy's reward.
Definition flags.h:329
#define FLAG_MCCOY_PALACE_VISITED
set on every entry to the palace
Definition flags.h:324
#define FLAG_MCCOY_PALACE_BARREL_ELIXIR
Definition flags.h:332
#define FLAG_MCCOY_PALACE_ADMITTED
The gate guards have let the party into the palace.
Definition flags.h:323
#define FLAG_SCENE_TEMP_00
Definition flags.h:713
#define FLAG_SCENE_TEMP_02
Definition flags.h:715
#define FLAG_SCENE_TEMP_11
Definition flags.h:730
#define FLAG_MCCOY_PALACE_JOB_REFUSED
The party refused McCoy's job at the first audience.
Definition flags.h:331
#define FLAG_MCCOY_PALACE_BARRICADE_HINT
After McCoy turned the party away, his escort let slip that the barricade may not need a key.
Definition flags.h:327
#define FLAG_KEEP_PARTY_POSITION
Definition flags.h:93
#define FLAG_KOLIMA_CURSE_LIFTED
Definition flags.h:103
#define FLAG_SCENE_TEMP_10
Definition flags.h:729
GameState, the game's state: play time, coins, the scene and the leader's position,...
struct GameState gGameState
The screen blend's globals and the graphics routines.
Item numbers, named from the English release.
@ ITEM_ELIXIR
Definition item_ids.h:48
@ ITEM_SMOKE_BOMB
Definition item_ids.h:67
@ ITEM_WATER_OF_LIFE
Definition item_ids.h:49
@ ITEM_VIAL
Definition item_ids.h:42
@ ITEM_POTION
Definition item_ids.h:43
@ ITEM_PSY_CRYSTAL
Definition item_ids.h:46
static void Event_TalkToStartledResident(void)
A resident of the outer rooms, startled the first time, asks whether the party sneaked in in search o...
void Map_SetLayerEntryFlag(u32 channelIndex)
Pauses tile animation channel channelIndex by setting its paused byte.
void Map_ClearLayerEntryFlag(u32 channelIndex)
Resumes tile animation channel channelIndex by clearing its paused byte.
struct ScenePlacement gMcCoyPalacePlacements[]
static void Event_EscortAsksPartyToChoose(void)
Leaving the reward room without a reward: the escort walks the leader back.
static void Event_WalkThroughDoor(void)
Walking through one of the palace's doors: it opens with a sound, the leader walks through and the ne...
static void Event_McCoyRewardsParty(void)
Brought in after lifting Kolima's curse: McCoy thanks the party and sends them to choose a reward.
struct ScenePlacement gMcCoyPalacePlacementsOther[]
static void Event_SearchPotionChest(void)
Searching the second reward chest: a Potion, while no reward is taken.
struct SceneEntrance gMcCoyPalaceEntrances[]
static void Event_EscortHintsAtBarricade(void)
At the front door after the audience: McCoy's escort is sorry the party was rejected,...
struct SceneEvent gMcCoyPalaceEvents[]
static void Event_SearchPsyCrystalChest(void)
Searching the third reward chest: a Psy Crystal, while no reward is taken.
static void Event_TalkToRewardKeeper(void)
The keeper of McCoy's treasures: while the party chooses, only one item; after, the reward was the gr...
static void McCoyPalace_ShowUnavailableChest(s32 chestFlag)
Searching a reward chest after the reward: the chosen one is empty, the others locked.
@ ACTOR_POTION_CHEST
@ ACTOR_VIAL_CHEST
@ ACTOR_PSY_CRYSTAL_CHEST
@ ACTOR_WATER_OF_LIFE_CHEST
@ ACTOR_LORD_MCCOY
@ ACTOR_REWARD_KEEPER
@ ACTOR_PARTY_ADMIRER
@ ACTOR_BARRICADE_KEY
@ ACTOR_KOLIMA_WATCHER
@ ACTOR_STARTLED_RESIDENT
@ ACTOR_KOLIMA_ASKER
@ ACTOR_ESCORT
static void Event_TalkToAdmirer(void)
The admirer praises the party the first time, then warns of the holy tree.
static void McCoyPalace_ShowChestEmpty(void)
The chest is empty. "Isaac checked the chest... but it was empty.".
static void Event_EscortSeesPartyOff(void)
Leaving the reward room with a reward: the escort leaves.
s32 gPalace_PacingActions[]
static void Event_ReadAdmirersThoughts(void)
Mind Read on the admirer shows two thoughts.
static void Event_SearchVialChest(void)
Searching the first reward chest: a Vial, while no reward is taken.
static void Event_PresentRewardChests(void)
In the reward room: the escort shows the four chests and the keeper explains that only one may be cho...
static void McCoyPalace_FaceCompanionsForDiscussion(void)
Garet, Ivan and Mia turn to talk among themselves.
u32 gMcCoyPalaceExits[]
static __inline__ void McCoyPalace_OpenRewardChestRow(void)
The cells before the chest row can be walked on.
static __inline__ void McCoyPalace_PrepareCompanionApproach(void)
Garet, Ivan and Mia get ready to walk up to McCoy.
static __inline__ void McCoyPalace_PositionRewardChests(void)
The four reward chests stand in a row.
s32 gPalace_FacingActions[]
static void McCoyPalace_ClaimReward(s32 chestActorId, s32 itemId, s32 chestFlag)
The chest opens and gives its item; with no room for it, the chest closes again and the reward is sti...
static void Event_SearchWaterOfLifeChest(void)
Searching the fourth reward chest: a Water of Life, while no reward is taken.
struct SceneEvent gMcCoyPalaceEventsOther[]
static void Event_AskAboutGoingToKolima(void)
Asks about going to Kolima. "Oh, are you willing to go to Kolima Forest?".
static void McCoyPalace_ShowChestLocked(void)
The chest is locked. "The treasure chest is locked.".
static void Event_AudienceWithMcCoy(void)
The first audience: the escort announces the party and McCoy asks them to lift Kolima's curse.
static void Event_TalkToKolimaWatcher(void)
The watcher saw the party go to Kolima.
static void Event_ReadRewardKeepersThoughts(void)
static void McCoyPalace_FaceCompanionsForAudience(void)
Garet, Ivan and Mia face McCoy again.
The reel game's title lettering.
Field object scripts: one s32 command word, then its operands, as gScriptObject_CommandTable runs the...
#define SC_SET(w, v)
Write a work value.
Definition objcmd.h:37
#define SC_LOOP(n, to)
Repeat up to n times.
Definition objcmd.h:28
#define SC_SYNC
Wait for arrival.
Definition objcmd.h:17
#define SC_FOREVER
Definition objcmd.h:14
#define SC_ARG(v)
Definition objcmd.h:44
#define SC_MOVE(x, y, z)
Move toward the target.
Definition objcmd.h:19
#define SC_WAIT(n)
Wait n frames.
Definition objcmd.h:16
#define SC_TOP
Script start.
Definition objcmd.h:13
#define SC_END
Return to the main script.
Definition objcmd.h:32
@ SW_FACING
Definition objcmd.h:57
#define SC_CALL(fn)
Definition objcmd.h:50
s32 BattleFx_PlayCueAndStartEmitterOnTarget(s32 actor, s32 target, s32 itemId)
If actor target exists, plays SE_124, gives it animation 4 and, 12 frames later, shows itemId in fron...
Definition targets.c:207
Scene numbers, named after their places.
char SceneId_McCoyPalace
Song and sound effect ids, indices into gSound_SongTable.
#define SE_DOOR_OPEN
Definition songs.h:153
#define SE_125
Definition songs.h:118
#define SE_188
Definition songs.h:183
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()
#define NULL
Definition bilibin.h:6
The running scene's event work: its placement and event tables, its actors, the triggers and exit it ...
Definition event_work.h:20
s32 startTransition
SCENE_TRANSITION(style, variant).
Definition event_work.h:43
s16 touchedTrigger
the step event a touch or exit event answers
Definition event_work.h:26
s32 transitionFrames
frames
Definition event_work.h:45
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
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 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 scaleX
16.16 fixed point, 0x10000 full size
Definition field_obj.h:39
s32 scaleY
16.16 fixed point, 0x10000 full size
Definition field_obj.h:40
s16 entrance
Definition game_state.h:37
The talkFacing bytes of placement rows 6 to 9: actors 14 to 17.
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...
The system's routines and globals: interrupts, BIOS sound bias, random numbers and sleep.
The integer types, TRUE, UNUSED and the fixed-address macros.
signed int s32
Definition types.h:14
unsigned int u32
Definition types.h:15
unsigned char u8
Definition types.h:11
struct FieldCoordinate::@024321007066302143002254325121164243234242211074 part
s32 fixed
16.16 fixed-point pixels