Alchemy
Loading...
Searching...
No Matches

hammet_palace.c

Go to the documentation of this file.
1/// @file
2/// Hammet's palace in Kalay: Lady Layana hears that Hammet is still held in
3/// Lunpa, and later welcomes him home.
4#include "game_state.h"
5#include "scene_ids.h"
9#include "unit/field/field.h"
10#include "battle.h"
11#include "debug.h"
12#include "field.h"
13#include "game.h"
14#include "graphics.h"
15#include "menu.h"
16#include "minigame.h"
17#include "sound.h"
18#include "system.h"
19#include "types.h"
20#include "field_event.h"
21#include "field_scene.h"
22#include "text/msg_ids.h"
23#include "ability_ids.h"
24#include "item_ids.h"
25#include "objcmd.h"
26#include "flags.h"
27#include "songs.h"
28#include "event.h"
29
30// The palace's actors: the party keeps its slots, the rest follow the
31// placement table from 8.
32#define LAYANA 8
33#define HAMMET 9
34#define SOLDIER_1 10 ///< the soldiers of Kalay in the meeting
35#define SOLDIER_2 11
36
37// Entrance setup and the two long conversations use the helpers below.
38static void HammetPalace_SetUpEntrance(void);
39static void HammetPalace_IvanReportsToLayana(void);
40static void HammetPalace_FacePartyOutward(s32 waitFrames);
41static void HammetPalace_FacePartyNorth(s32 waitFrames);
42static void HammetPalace_HammetsHomecoming(void);
43
44/// Advances within the current conversation's consecutive message block.
45static __inline__ void HammetPalace_AdvanceMessage(s32 amount) {
46
47 gEventWork->message += amount;
48}
49
50/// Selects the palace's entrances, or the fallback table for this overlay.
51const struct SceneEntrance *Scene_GetEntrances(void) {
52 s16 scene = gGameState.scene;
53
54 if (scene == (s32)&SceneId_HammetPalace) {
56 }
58}
59
60const struct SceneRegion *Scene_GetRegions(void) { return NULL; }
61
62const u32 *Scene_GetExits(void) { return gHammetPalaceExits; }
63
64/// Applies placement clipping before returning the palace's actor rows.
69 }
71}
72
73/// Selects the palace's dialogue and doorway handlers.
74const struct SceneEvent *Scene_GetEvents(void) {
75 s16 scene = gGameState.scene;
76
77 if (scene == (s32)&SceneId_HammetPalace) {
79 }
81}
82
83/// Talking to a resident (actor 13) before Hammet is rescued: the resident
84/// hopes for his release. "Lord Hammet will be released soon. Right?"
86 EV_BEGIN();
87 MESSAGE_SET(MsgKalayLordHammetWillReleasedSoon);
89 EV_END();
90}
91
92/// Talking to a resident (actor 16) before Hammet is rescued: the resident
93/// worries for his silk trade. "Has the legacy of Lord Hammet's silk trading
94/// come to an end?"
96 EV_BEGIN();
97 MESSAGE_SET(MsgKalayHasLegacyLordHammetsSilk);
99 EV_END();
100}
101
102/// Talking to Layana once the party has been to Lunpa: she is glad Hammet is
103/// unhurt, but asks the party not to go back, and to fulfill their quest.
104/// "Isaac, you sneaked into Lunpa? That's far too dangerous!"
106
107 EV_BEGIN();
109 MESSAGE_SET(MsgKalayIsaacSneakedIntoLunpaThats);
118 EV_END();
119}
120
121/// Walking north into a door (triggers 2, 3, 4 and 14): it opens, and Isaac
122/// walks through it to the next room.
123static void Event_LeaveThroughDoor(void) {
124
125 struct EventWork *work;
126
127 work = gEventWork;
128 EV_BEGIN();
129 WAIT(10);
130 if (work->touchedTrigger == 4) {
131 SE(SE_188);
132 } else {
134 }
137 WAIT(10);
138 OBJ_SPEED(ACTOR_PARTY_LEADER, PIXELS(1) / 2, PIXELS(1) / 4);
140 if (work->touchedTrigger == 4) {
142 } else {
144 }
145 WAIT(16);
147 // Restore the layer entries before returning control to the field engine.
150 EV_END();
151}
152
153/// Opens the palace with its window transition and runs entrance-specific
154/// setup.
159 }
160 return 0;
161}
162
163/// Sets up the room the party enters by: Layana and Hammet in the audience
164/// hall (entrance 9), the opened door (10 and 11), or Ivan's report (20).
165static void HammetPalace_SetUpEntrance(void) {
166 struct FieldActor *actor;
167 s32 facing;
168 s32 waitingX = PIXELS(906);
169 s32 waitingZ = PIXELS(422);
170
173
174 switch (gGameState.entrance) {
175 case 9:
177 // Hammet is home.
178 actor = Object_GetById(LAYANA);
180 actor->facing = facing;
181
184 }
185 } else {
187 if (Engine_GameFlagIsSet(0x321) != 0) {
188 Engine_ActorSetPosition(LAYANA, waitingX, waitingZ);
189 actor = Object_GetById(LAYANA);
191 actor->facing = facing;
192 }
193 }
194 break;
195
196 case 10:
197 case 11:
198 if (Engine_GameFlagIsSet(0x915) != 0) {
199 Map_CopyCellsTo(58, 70, 54, 70, 4, 3);
200 {
201 Map_CopyCellAttributes(55, 9, 2, 1, 55, 8);
202 }
205 }
206 break;
207
208 case 20:
212 }
213 break;
214
215 default:
216 break;
217 }
218}
219
220/// Ivan brings the party to Layana: she had hoped Hammet came back with him.
221/// The ransom was paid long ago, yet Dodonpa holds Hammet still; Layana will
222/// not risk him by sending the soldiers, nor the party. She tells of the
223/// prophecy, the Jupiter Adept who gave Hammet the Shaman's Rod and Ivan, and
224/// what the rod is to find, then sends everyone back to their posts.
226
227 struct EventWork *work;
228 s32 advanceAfterReply;
229 const s32 *partyScript;
230
231 EV_BEGIN();
232 Camera_MoveTo(-1, -1, -1, 0);
234 ColorBuffer_ApplySource(0x10002, 0);
235 // Position the participants under the closed screen before revealing them.
236 ColorBuffer_ApplyTarget(0x10002, 0);
239 work = gEventWork;
240 work->transitionFrames = 24;
242 OBJ_POS_SET(LAYANA, 856, 440);
244 OBJ_POS_SET(GARET, 848, 502);
245 OBJ_POS_SET(IVAN, 872, 486);
246 OBJ_POS_SET(MIA, 880, 502);
247 OBJ_POS_SET(SOLDIER_1, 840, 518);
248 OBJ_POS_SET(SOLDIER_2, 888, 518);
249 Camera_MoveTo(PIXELS(864), -1, PIXELS(472), 0);
254 WAIT(40);
257 WAIT(10);
260 WAIT(20);
271 WAIT(20);
275 WAIT(60);
280 WAIT(60);
287 WAIT(10);
290 OBJ_EMOTE(LAYANA, 0x105, 60);
294 ColorBuffer_ApplyTarget(0x10000, 0);
296 Engine_TaskWait(60);
297 OBJ_EMOTE(LAYANA, 0x105, 60);
298 MESSAGE_SET(MsgKalayWhenHeardWereBackIvan);
299 // The following replies advance through this conversation's message block.
307 0, 10);
314 OBJ_EMOTE(LAYANA, 0x101, 60);
324 0, 10);
329 WAIT(60);
332 WAIT(10);
335 WAIT(20);
338 OBJ_EMOTE(LAYANA, 0x105, 60);
342 OBJ_SPEED(LAYANA, 2 * PIXELS(1) / 5, PIXELS(1) / 5);
343 Actor_WalkToAndWait(LAYANA, 892, 440);
344 WAIT(40);
346 OBJ_EMOTE(LAYANA, 0x105, 60);
349 Actor_WalkToAndWait(LAYANA, 856, 440);
350 WAIT(40);
352 OBJ_EMOTE(LAYANA, 0x105, 60);
373 WAIT(20);
386 WAIT(40);
389 WAIT(60);
392 WAIT(20);
399 advanceAfterReply = 1;
400 if (Engine_EventChooseYesNo(0, 0) == 1) {
402 advanceAfterReply = 0;
403 }
405 if (advanceAfterReply != 0) {
407 }
410 WAIT(60);
411 OBJ_EMOTE(LAYANA, 0x101, 0);
421 OBJ_EMOTE(LAYANA, 0x107, 60);
428 if (Engine_EventChooseYesNo(0, 0) == 0) {
429 WAIT(20);
433 } else {
434 WAIT(20);
438 }
445 OBJ_EMOTE(LAYANA, 0x105, 60);
450 WAIT(20);
451 OBJ_SPEED(IVAN, 4 * PIXELS(1) / 5, 2 * PIXELS(1) / 5);
452 Actor_WalkToAndWait(IVAN, 868, 472);
458 OBJ_EMOTE(LAYANA, 0x105, 60);
472 WAIT(40);
482 if (Engine_EventChooseYesNo(0, 0) == 0) {
483 WAIT(20);
485 WAIT(40);
487 gEventWork->message += 2;
488 } else {
489 WAIT(20);
494 WAIT(40);
496 }
497 OBJ_EMOTE(MIA, 0x101, 40);
508 WAIT(40);
527 WAIT(60);
537 OBJ_EMOTE(MIA, 0x101, 60);
539 OBJ_EMOTE(LAYANA, 0x108, 60);
545 OBJ_EMOTE(GARET, 0x101, 40);
553 OBJ_EMOTE(LAYANA, 0x105, 40);
582 WAIT(60);
587 WAIT(20);
592 OBJ_EMOTE(IVAN, 0x105, 60);
625 if (Engine_EventChooseYesNo(0, 0) == 0) {
626 WAIT(20);
631 WAIT(10);
633 gEventWork->message += 2;
634 } else {
635 WAIT(10);
643 WAIT(10);
645 }
650 WAIT(10);
652 WAIT(20);
655 WAIT(10);
657 WAIT(20);
662 OBJ_SPEED(SOLDIER_1, PIXELS(1), PIXELS(1) / 2);
663 OBJ_SPEED(SOLDIER_2, PIXELS(1), PIXELS(1) / 2);
664 OBJ_WALK(SOLDIER_1, 848, 540);
666 OBJ_POS_SET(SOLDIER_1, 0, 0);
667 OBJ_POS_SET(SOLDIER_2, 0, 0);
673 WAIT(20);
674 OBJ_SPEED(GARET, PIXELS(1), PIXELS(1) / 2);
675 OBJ_SPEED(IVAN, PIXELS(1), PIXELS(1) / 2);
676 OBJ_SPEED(MIA, PIXELS(1), PIXELS(1) / 2);
677 partyScript = gHammetPalace_PartyActions;
678 Actor_SetActionScript(GARET, partyScript);
679 Actor_SetActionScript(IVAN, partyScript);
680 Actor_RunActionScriptAndWait(MIA, partyScript);
681 work = gEventWork;
682 work->transitionFrames = 16;
686 EV_END();
687}
688
689/// Turns the party outward from the group, then optionally waits.
690static void HammetPalace_FacePartyOutward(s32 waitFrames) {
695 if (waitFrames != 0) {
696 WAIT(waitFrames);
697 }
698}
699
700/// Turns all four party members north toward Layana, then optionally waits.
701static void HammetPalace_FacePartyNorth(s32 waitFrames) {
706 if (waitFrames != 0) {
707 WAIT(waitFrames);
708 }
709}
710
711/// Back with Hammet, the party walks into the audience hall: Hammet welcomes
712/// them, Layana scolds Ivan for going to Lunpa against her word, and Ivan
713/// decides to leave at once on the quest. Hammet sends them to Hesperia with
714/// the Shaman's Rod, as the Jupiter Adept said.
716
717 struct FieldActor *leader;
718 struct EventWork *work;
719 s32 v5;
720 const s32 *partyScript;
721
722 EV_BEGIN();
723 Camera_MoveTo(-1, -1, -1, 0);
725 Camera_MoveTo(PIXELS(864), -1, PIXELS(536), 0);
726 // Pan from the entrance while the party walks into its speaking positions.
730 gEventWork->startTransition = v5 = 0x100;
733 Camera_SetSpeed(0x6666, 0xccc);
734 Camera_MoveTo(PIXELS(864), -1, PIXELS(472), 1);
735 OBJ_SPEED(ACTOR_PARTY_LEADER, 4 * PIXELS(1) / 5, 2 * PIXELS(1) / 5);
736 OBJ_SPEED(GARET, 4 * PIXELS(1) / 5, 2 * PIXELS(1) / 5);
737 OBJ_SPEED(IVAN, 4 * PIXELS(1) / 5, 2 * PIXELS(1) / 5);
738 OBJ_SPEED(MIA, 4 * PIXELS(1) / 5, 2 * PIXELS(1) / 5);
741 if (leader != 0) {
742 Actor_SetPosition(GARET, leader->x.fixed, leader->z.fixed);
743 }
745 if (leader != 0) {
746 Actor_SetPosition(IVAN, leader->x.fixed, leader->z.fixed);
747 }
749 if (leader != 0) {
750 Actor_SetPosition(MIA, leader->x.fixed, leader->z.fixed);
751 }
752 OBJ_WALK(ACTOR_PARTY_LEADER, 856, 486);
753 OBJ_WALK(GARET, 848, 502);
754 OBJ_WALK(IVAN, 872, 486);
755 Actor_WalkToAndWait(MIA, 880, 502);
759 WAIT(10);
761 OBJ_EMOTE(HAMMET, v5, 20);
763 MESSAGE_SET(MsgKalayItsIvanHisCompanionsPerfect);
765 OBJ_EMOTE(LAYANA, v5, 20);
768 OBJ_EMOTE(LAYANA, 0x107, 60);
774 WAIT(60);
775 OBJ_EMOTE(HAMMET, 0x102, 60);
779 OBJ_EMOTE(LAYANA, 0x108, 20);
785 v5 = 1;
786 if (Engine_EventChooseYesNo(0, 0) == 0) {
787 WAIT(10);
789 } else {
790 WAIT(10);
793 v5 = 0;
794 }
796 if (v5 != 0) {
798 }
801 WAIT(80);
804 OBJ_EMOTE(LAYANA, 0x107, 40);
807 OBJ_EMOTE(LAYANA, 0x105, 60);
816 0, 10);
824 0, 10);
826 OBJ_EMOTE(MIA, 0x105, 40);
829 WAIT(80);
831 WAIT(20);
835 if (Engine_EventChooseYesNo(0, 0) == 0) {
836 WAIT(20);
838 } else {
839 WAIT(20);
841 }
852 OBJ_EMOTE(IVAN, 0x101, 60);
864 WAIT(20);
870 WAIT(20);
871 partyScript = gHammetPalace_PartyActions;
872 Actor_SetActionScript(GARET, partyScript);
873 Actor_SetActionScript(IVAN, partyScript);
874 Actor_RunActionScriptAndWait(MIA, partyScript);
875 work = gEventWork;
876 work->transitionFrames = 16;
880 EV_END();
881}
882
884 SC_ARG(2), SC_MOVE(PIXELS(856), 0, PIXELS(486)),
885 SC_SYNC, SC_ARG(1),
886 SC_POS(0, 0, 0), SC_WAIT(1),
887 SC_END,
888};
889
891 {0, CONDITION_ALWAYS, 168, 0, 168, FACING_NORTH, 0, -1, -1, -1, -1, 0},
893};
894
896 {0, CONDITION_ALWAYS, 168, 0, 168, FACING_NORTH, 0, -1, -1, -1, -1, 0},
897 {1, CONDITION_ALWAYS, 240, 0, 648, FACING_NORTH, 0, 45, 360, 440, 680, 0},
898 {2, CONDITION_ALWAYS, 88, 0, 552, FACING_SOUTH, 0, 45, 360, 440, 680, 0},
899 {3, CONDITION_ALWAYS, 392, 0, 552, FACING_SOUTH, 0, 45, 360, 440, 680, 0},
900 {4, CONDITION_ALWAYS, 240, 0, 408, FACING_SOUTH, 0, 45, 360, 440, 680, 0},
901 {5, CONDITION_ALWAYS, 152, 0, 432, FACING_SOUTH, 0, 45, 360, 440, 680, 0},
902 {6, CONDITION_ALWAYS, 264, 0, 136, FACING_NORTH, 0, 40, 20, 305, 285, 0},
903 {7, CONDITION_ALWAYS, 504, 0, 152, FACING_NORTH, 0, 380, 20, 755, 290, 0},
904 {8, CONDITION_ALWAYS, 448, 0, 112, FACING_SOUTH, 0, 380, 20, 755, 290, 0},
905 {9, CONDITION_ALWAYS, 864, 0, 576, FACING_NORTH, 0, 750, 370, 985, 635, 0},
906 {10, CONDITION_ALWAYS, 928, 0, 224, FACING_WEST, 0, 800, 20, 1040, 250, 0},
907 {11, CONDITION_ALWAYS, 904, 0, 72, FACING_SOUTH, 0, 800, 20, 1040, 250, 0},
908 {12, CONDITION_ALWAYS, 616, 0, 824, FACING_NORTH, 0, 465, 640, 705, 875, 0},
909 {13, CONDITION_ALWAYS, 128, 0, 808, FACING_EAST, 0, 20, 730, 260, 890, 0},
910 {14, CONDITION_ALWAYS, 168, 0, 808, FACING_SOUTH, 0, 20, 730, 260, 890, 0},
911 {20, CONDITION_ALWAYS, 864, 0, 576, FACING_NORTH, 0, 750, 370, 985, 635, 0},
913};
914
916 SCENE_EXITS(103), SCENE_EXIT(1, 102, 2), SCENE_EXIT(2, 103, 6),
917 SCENE_EXIT(3, 103, 7), SCENE_EXIT(4, 103, 9), SCENE_EXIT(5, 103, 13),
918 SCENE_EXIT(6, 103, 2), SCENE_EXIT(7, 103, 3), SCENE_EXIT(8, 103, 10),
919 SCENE_EXIT(9, 103, 4), SCENE_EXIT(10, 103, 8), SCENE_EXIT(11, 156, 1),
920 SCENE_EXIT(12, 103, 14), SCENE_EXIT(13, 103, 5), SCENE_EXIT(14, 103, 12),
922};
923
926};
927
928// clang-format off
931 0, 0, 0, FACING_NORTH, TALK_KEEP_FACING, 0 },
933 0, 0, 0, FACING_NORTH, TALK_KEEP_FACING, 0 },
935 0, 0, 0, FACING_NORTH, TALK_KEEP_FACING, 0 },
936 { 0x2d, 0x0, ACTOR_STAND,
938 { 0x31, 0x0, ACTOR_STAND,
944 { 0x6c, 0x0, ACTOR_STAND,
945 PIXELS(616), 0, PIXELS(113), FACING_EAST, TALK_FACE_PARTY, 0 },
946 { 0x6a, 0x0, ACTOR_STAND,
948 { 0xa7, 0x0, ACTOR_STAND,
954 { SCENE_TABLE_END },
955};
956
959};
960
962 { EVENT_EXIT, 1, CONDITION_ALWAYS, 1 },
966 { EVENT_EXIT, 5, CONDITION_ALWAYS, 5 },
967 { EVENT_EXIT, 6, CONDITION_ALWAYS, 6 },
968 { EVENT_EXIT, 7, CONDITION_ALWAYS, 7 },
969 { EVENT_EXIT, 8, CONDITION_ALWAYS, 8 },
970 { EVENT_EXIT, 9, CONDITION_ALWAYS, 9 },
971 { EVENT_EXIT, 10, CONDITION_ALWAYS, 10 },
972 { 0x31, 11, CONDITION_ALWAYS, 11 },
973 { EVENT_EXIT, 12, CONDITION_ALWAYS, 12 },
974 { EVENT_EXIT, 13, CONDITION_ALWAYS, 13 },
976 { EVENT_TALK, LAYANA, 0x321, MSGNO(MsgHammetPalaceDodonpaIsAVeryShrewdMan) },
978 { EVENT_TALK, LAYANA, FLAG_LUNPA_TRADE_REOPENED, MSGNO(MsgHammetPalaceDodonpaPlansToUseHammetTo) },
979 { EVENT_TALK, LAYANA, CONDITION_ALWAYS, MSGNO(MsgHammetPalaceNoOneInKalayKnowsHammet) },
980 { EVENT_TALK, HAMMET, CONDITION_ALWAYS, MSGNO(MsgHammetPalaceTakeYourShamansRodAndSet) },
981 { EVENT_TALK, 12, FLAG_LUNPA_TRADE_REOPENED, MSGNO(MsgHammetPalaceTheTownsfolkDontKnowAboutLord) },
982 { EVENT_TALK, 12, CONDITION_ALWAYS, MSGNO(MsgHammetPalaceIHearHammetWasSavedBy) },
984 { EVENT_TALK, 13, CONDITION_ALWAYS, MSGNO(MsgHammetPalaceTheySayHammetsReturnIsSupposed) },
985 { EVENT_TALK, 14, FLAG_LUNPA_TRADE_REOPENED, MSGNO(MsgHammetPalaceLayanaIsPuttingUpAStrong) },
986 { EVENT_TALK, 14, CONDITION_ALWAYS, MSGNO(MsgHammetPalaceILeftTheDoorToThe) },
987 { EVENT_TALK, 15, FLAG_LUNPA_TRADE_REOPENED, MSGNO(MsgHammetPalaceMerchantsAreSupposedToBeProtected) },
988 { EVENT_TALK, 15, CONDITION_ALWAYS, MSGNO(MsgHammetPalaceIWonderIfAnyOfDodonpas) },
990 { EVENT_TALK, 16, CONDITION_ALWAYS, MSGNO(MsgHammetPalaceTheSecretPassageIsLockedBecause) },
991 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), LAYANA, FLAG_LAYANA_SCOLDED_LUNPA_VISIT, MSGNO(MsgHammetPalaceIsThisTheRightDecisionHammet) },
992 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), LAYANA, FLAG_LUNPA_TRADE_REOPENED, MSGNO(MsgHammetPalaceIDontCareAboutTheMoney) },
993 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), LAYANA, CONDITION_ALWAYS, MSGNO(MsgHammetPalaceImSoHappyHammetMadeIt) },
994 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), HAMMET, CONDITION_ALWAYS, MSGNO(MsgHammetPalaceLayanasWordsPainHerMoreThan) },
995 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 12, FLAG_LUNPA_TRADE_REOPENED, MSGNO(MsgHammetPalaceImSureTheVillagersWouldPanic) },
996 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 12, CONDITION_ALWAYS, MSGNO(MsgHammetPalaceImSoRelievedHammetMadeIt) },
997 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 13, FLAG_LUNPA_TRADE_REOPENED, MSGNO(MsgHammetPalaceEveryonesWorriedAboutLordHammetBut) },
998 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 13, CONDITION_ALWAYS, MSGNO(MsgHammetPalaceICantLetOnToThe) },
999 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 14, FLAG_LUNPA_TRADE_REOPENED, MSGNO(MsgHammetPalaceLadyLayanaWasCryingAgainLast) },
1000 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 14, CONDITION_ALWAYS, MSGNO(MsgHammetPalaceLayanaOrderedTheDoorToThe) },
1001 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 15, FLAG_LUNPA_TRADE_REOPENED, MSGNO(MsgHammetPalaceAndToThinkIAlmostWent) },
1002 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 15, CONDITION_ALWAYS, MSGNO(MsgHammetPalaceWeWillNeverLetDodonpasHenchmen) },
1003 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 16, FLAG_LUNPA_TRADE_REOPENED, MSGNO(MsgHammetPalaceLordHammetIsALegendAmong) },
1004 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 16, CONDITION_ALWAYS, MSGNO(MsgHammetPalaceTheKeyToTheSecretPassage) },
1006 { SEARCH(SEARCH_BARREL), 101, 0xf87, FIND_ITEM(ITEM_NUT) },
1007 { SEARCH(SEARCH_WARDROBE), 200, CONDITION_ALWAYS, FIND_MESSAGE(MSGNO(MsgHammetPalaceTheresATurbanItsTheSymbol)) },
1008 { SEARCH(SEARCH_BOOKCASE), 201, CONDITION_ALWAYS, FIND_MESSAGE(MSGNO(MsgHammetPalaceTheresABookEntitledBusinessAnd)) },
1009 { SEARCH(SEARCH_BOOKCASE), 202, CONDITION_ALWAYS, FIND_MESSAGE(MSGNO(MsgHammetPalaceTheresABookEntitledTheGood)) },
1010 { SCENE_EVENTS_END },
1011};
1012// clang-format on
Ability numbers, named from the English release.
@ ABILITY_MIND_READ
Definition ability_ids.h:16
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.
The engine calls the debug menus import, and their palette swatch tiles.
Scene commands: the all-caps macros the scene scripts are written in.
#define EV_BEGIN()
Definition event.h:30
#define OBJ_DIR(no, d, t)
Definition event.h:16
#define OBJ_POS_SET(no, x, z)
Definition event.h:13
#define EV_END()
Definition event.h:31
#define WAIT(n)
Definition event.h:7
#define OBJ_MODE(no, m)
Definition event.h:18
#define OBJ_WALK(no, x, z)
Definition event.h:14
#define MESSAGE_SET(m)
Definition event.h:9
#define SE(n)
Definition event.h:28
#define FLAG_SET(f)
Definition event.h:26
#define OBJ_EMOTE(no, e, t)
Definition event.h:19
#define OBJ_SPEED(no, s, a)
Definition event.h:15
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)
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_EventShowMessageAndWait(s32 speaker, s32 flags, s32 frames)
#define SPEAKER_PORTRAIT_RIGHT
Definition field_event.h:55
static void Actor_WalkToAndWait(s32 actor, s32 x, s32 z)
static void Camera_SetSpeed(s32 speed, s32 acceleration)
#define EMOTE_IN_FRONT
Definition field_event.h:49
static void Actor_SetDestinationOffset(s32 actor, s32 dx, s32 dz)
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)
static void ColorBuffer_ApplyTarget(s32 value, s32 mode)
#define GameFlag_Clear
void Engine_EventWaitForScreen(void)
s32 Engine_EventAskYesNo(s32 speaker, s32 flags)
void Engine_EventOpenScreen(void)
void Engine_GameFlagSet(s32 flag)
static void Actor_SetActionScript(s32 actor, const s32 *script)
The engine encodes either a built-in action or an action-script address.
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)
s32 Engine_GameFlagIsSet(s32 flag)
void Engine_ActorStartRepeatedMotion(s32 actor, s32 repeats)
static s32 Event_AskYesNo(s32 speaker, s32 flags)
static void Actor_CenterAndWalk(s32 actor, s32 priority, s32 dz)
void Engine_MapRedraw(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 Actor_SetAttachedEffect(s32 actor, s32 effect)
static void ColorBuffer_ApplySource(s32 value, s32 mode)
@ TRANSITION_WINDOW
Definition field_obj.h:17
#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_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_STAND
#define SEARCH(target)
#define SCENE_EXITS_END
Definition field_scene.h:77
#define TOUCH_WALKING_INTO(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_CHEST
@ SEARCH_BARREL
Game flags, named where their meaning is shown.
#define FLAG_SHOW_LOCATION_NAME
Definition flags.h:94
#define FLAG_LUNPA_TRADE_REOPENED
Definition flags.h:123
#define FLAG_IVAN_REPORTED_TO_LAYANA
that Hammet is still in Lunpa
Definition flags.h:604
#define FLAG_KEEP_PARTY_POSITION
Definition flags.h:93
#define FLAG_LAYANA_SCOLDED_LUNPA_VISIT
Definition flags.h:605
#define FLAG_HAMMET_HOMECOMING_SEEN
Definition flags.h:606
GameState, the game's state: play time, coins, the scene and the leader's position,...
struct GameState gGameState
#define SOLDIER_2
#define SOLDIER_1
The screen blend's globals and the graphics routines.
#define LAYANA
static void Event_LayanaScoldsLunpaVisit(void)
Talking to Layana once the party has been to Lunpa: she is glad Hammet is unhurt, but asks the party ...
struct ScenePlacement gHammetPalacePlacements[]
#define HAMMET
static void Event_LeaveThroughDoor(void)
Walking north into a door (triggers 2, 3, 4 and 14): it opens, and Isaac walks through it to the next...
static void HammetPalace_IvanReportsToLayana(void)
Ivan brings the party to Layana: she had hoped Hammet came back with him.
static void HammetPalace_HammetsHomecoming(void)
Back with Hammet, the party walks into the audience hall: Hammet welcomes them, Layana scolds Ivan fo...
s32 gHammetPalace_PartyActions[]
static void HammetPalace_FacePartyNorth(s32 waitFrames)
Turns all four party members north toward Layana, then optionally waits.
struct SceneEvent gHammetPalaceEventsOther[]
struct SceneEntrance gHammetPalaceEntrances[]
static void HammetPalace_FacePartyOutward(s32 waitFrames)
Turns the party outward from the group, then optionally waits.
static void Event_AskWhetherSilkTradeHasEnded(void)
Talking to a resident (actor 16) before Hammet is rescued: the resident worries for his silk trade.
u32 gHammetPalaceExits[]
struct ScenePlacement gHammetPalacePlacementsOther[]
static void HammetPalace_SetUpEntrance(void)
Sets up the room the party enters by: Layana and Hammet in the audience hall (entrance 9),...
static void Event_AskWhetherHammetWillBeReleased(void)
Talking to a resident (actor 13) before Hammet is rescued: the resident hopes for his release.
struct SceneEvent gHammetPalaceEvents[]
struct SceneEntrance gHammetPalaceEntrancesOther[]
static __inline__ void HammetPalace_AdvanceMessage(s32 amount)
Advances within the current conversation's consecutive message block.
Item numbers, named from the English release.
@ ITEM_NUT
Definition item_ids.h:41
@ ITEM_WATER_JACKET
Definition item_ids.h:27
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.
The reel game's title lettering.
Field object scripts: one s32 command word, then its operands, as gScriptObject_CommandTable runs the...
#define SC_POS(x, y, z)
Set position.
Definition objcmd.h:18
#define SC_SYNC
Wait for arrival.
Definition objcmd.h:17
#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_END
Return to the main script.
Definition objcmd.h:32
Scene numbers, named after their places.
char SceneId_HammetPalace
Song and sound effect ids, indices into gSound_SongTable.
#define SE_DOOR_OPEN
Definition songs.h:153
#define SE_188
Definition songs.h:183
struct EventWork * gEventWork
void Engine_EventRequestExit()
void Engine_ActorSetPosition(u32 actor, s32 x, s32 z)
void Engine_ActorShowEmote()
void Engine_TaskWait()
#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
union FieldCoordinate x
16.16 fixed-point pixels
Definition field_obj.h:35
union FieldCoordinate z
16.16 fixed-point pixels
Definition field_obj.h:37
u16 facing
1/65536 turns
Definition field_obj.h:34
s16 entrance
Definition game_state.h:37
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
signed short s16
Definition types.h:12
s32 fixed
16.16 fixed-point pixels