Alchemy
Loading...
Searching...
No Matches

kalay_tolbi_docks.c

Go to the documentation of this file.
1/// @file
2/// The Kalay and Tolbi docks: tickets, boarding, the crossing's aftermath,
3/// and the passengers waiting for the ship to leave again.
4
5#include "game_state.h"
6#include "version.h"
10#include "unit/game/game.h"
11#include "unit/window/window.h"
13#include "battle.h"
14#include "debug.h"
15#include "field.h"
16#include "game.h"
17#include "graphics.h"
18#include "menu.h"
19#include "minigame.h"
20#include "sound.h"
21#include "system.h"
22#include "edition.h"
23#include "tbs_edition.h"
24#include "kalay_tolbi_docks.h"
25#include "text/msg_ids.h"
26#include "scene_ids.h"
27#include "types.h"
28#include "field_event.h"
29#include "call.h"
30#include "field_service.h"
31#include "ability_ids.h"
32#include "field_scene.h"
33#include "objcmd.h"
34#include "flags.h"
35#include "songs.h"
36#include "item_ids.h"
37
38/// The three maps share actor numbers; each is named on the map it is proved.
40 // Kalay docks
41 ACTOR_WORRIED_FATHER = 11, ///< his daughter waits on the Tolbi docks
42 ACTOR_GATEKEEPER = 12, ///< takes the tickets at the gangway
45 // Tolbi docks, after the crossing
46 ACTOR_ARRIVALS_GREETER = 8, ///< hears of the party's scary trip
48 ACTOR_FIRST_BLOCK = 14, ///< the two blocks Move pushes
50 /// Tolbi docks, once the tour's passengers are stranded there
53 ACTOR_TOUR_GUIDE = 13, ///< refunded the angry passenger's ticket
54 ACTOR_BODYGUARD = 16, ///< hired by the tour guides
55 /// Ticket office
57};
58
59static void KalayTolbiDocks_PrepareKalayDocks(void);
60static void KalayTolbiDocks_PrepareTolbiDocks(void);
62static void KalayTolbiDocks_UpdateBlockCells(void);
63static void KalayTolbiDocks_SettleBlock(s32 actorId);
65
66/// Adds the Venus Djinni waiting at the Kalay docks.
69}
70
71/// Selects the entrance positions for the departure, arrival or ticket office.
73 s16 scene = gGameState.scene;
74
75 if (scene == (s32)&SceneId_KalayTolbiDocks1) {
77 }
78 if (scene == (s32)&SceneId_KalayTolbiDocks3) {
80 }
81 if (scene == (s32)&SceneId_KalayTolbiDocks2) {
83 }
85}
86
87const struct SceneRegion *KalayTolbiDocks_GetRegions(void) { return NULL; }
88
89/// The docks list no numbered exits.
91
92/// Each map has its people before the ship sails, once it has gone and not
93/// come back (flag 0x93e), and once the passengers are stranded (flag 0x950).
95 s16 scene = gGameState.scene;
96
97 if (scene == (s32)&SceneId_KalayTolbiDocks1) {
100 }
102 }
103
104 if (scene == (s32)&SceneId_KalayTolbiDocks3) {
107 }
109 }
110
111 if (scene == (s32)&SceneId_KalayTolbiDocks2) {
114 }
117 }
119 }
120
122}
123
124/// Stepping off the ship at Tolbi, the leader walks a few steps and a passenger
125/// hurries over to stand beside the party.
130 Actor_SetSpeed(ACTOR_ARRIVALS_GREETER, 0x13333, 0x9999);
135}
136
137/// Selects dialogue and interactions for the current port and voyage state.
139 s16 scene = gGameState.scene;
140
141 if (scene == (s32)&SceneId_KalayTolbiDocks1) {
144 }
146 }
147
148 if (scene == (s32)&SceneId_KalayTolbiDocks3) {
151 }
153 }
154
155 if (scene == (s32)&SceneId_KalayTolbiDocks2) {
158 }
161 }
163 }
164
166}
167
168/// A man on the Kalay docks asks whether the party wants to go to Tolbi.
171 Engine_EventSetMessage(MsgKalayWantGoToTolbi);
174}
175
176/// The father asks whether the party is taking the ship. If it is, he asks it
177/// to tell his daughter in Tolbi that the tickets were too expensive for her
178/// mother to come; afterwards he repeats the message.
182 Engine_EventSetMessage(MsgKalayGoingTakeShip);
184 if (Engine_EventChooseYesNo(0, 0) == 0) {
187 } else {
190 }
191 } else {
192 Engine_EventSetMessage(MsgKalayPassMessageDaughter);
194 }
196}
197
198/// Spoken to on the shore after boarding, the gatekeeper asks the party to
199/// board the ship when it is finished.
201#if !TBS_PATCH_3
202 ((void)Object_GetById(0));
204#endif
207#if TBS_PATCH_3
209#endif
210 Engine_EventSetMessage(MsgKalayFinishedOutHereBoardShip);
213#if TBS_PATCH_3
215#endif
216 }
217 }
218}
219
220/// The gatekeeper at the gangway. Facing him from the east, the party is asked
221/// for its tickets: with one bought he steps aside, takes it and lets the
222/// party aboard. Once aboard, he offers to let the party go ashore again.
224 s32 ticketOwner;
225 s32 ticketSlot;
226 struct FieldActor *leader;
227 s16 cardinalFacing;
228
230 cardinalFacing = ((leader->facing + 0x2000) & ~0x3fff);
234 Engine_EventSetMessage(MsgKalayFinishedOutHereBoardShip);
236 } else {
237 Engine_EventSetMessage(MsgKalayWantGoAshore);
239 if (Engine_EventChooseYesNo(0, 0) == 0) {
241 Engine_EventSetMessage(MsgKalayWantGoAshore + 1);
247 } else {
248 Engine_EventSetMessage(MsgKalayWantGoAshore + 2);
250 }
251 }
252 } else {
253 if ((u16)cardinalFacing != FACING_WEST) {
254 return;
255 }
256 Engine_EventSetMessage(MsgKalayTicketsPlease);
258 // Hand over the actual inventory ticket before walking past the gate.
261 ticketSlot = Inventory_Find(ticketOwner, ITEM_BOAT_TICKET);
267 Inventory_Discard(ticketOwner, ticketSlot);
270 Actor_WalkToAndWait(ACTOR_PARTY_LEADER, leader->x.part.pixel, 1304);
274 } else {
276 }
277 }
279}
280
281/// The dock worker explains the tickets: hand one over to board, give it to
282/// the gatekeeper, or wait on board for the ship to sail.
285
287 Engine_EventSetMessage(MsgKalayBoardWaitSetSail);
290 Engine_EventSetMessage(MsgKalayHaveTicketsGiveHim);
292 } else {
293 Engine_EventSetMessage(MsgKalayAfterHandingOverTicket);
295 }
296
298}
299
300/// The ticket seller offers tickets for the four of them at 600 coins, with
301/// the party's coins shown beside the question. Declining, the leader shakes
302/// his head; without enough coins the seller refuses; otherwise the party gets
303/// its ticket and pays.
305 struct UiWindow *coinsWindow;
306 struct GameState *state;
307 s32 ticketPrice;
308
309#if !TBS_PATCH_1
310 /* FAKEMATCH: needed to match: one coin-label selector preserves its saved
311 * register; separate arguments shorten the Japanese callback by twelve bytes.
312 * Measured again: differ 72 in tbs-ja. */
313 s32 coinLabel;
314#endif
315
316 ticketPrice = 600;
319 Engine_EventSetMessage(MsgKalayHandInTicketPlank);
321 } else {
322 Engine_EventSetMessage(MsgKalayLookingForTickets);
324 if (Engine_EventChooseYesNo(0, 0) == 1) {
326 } else {
328 UiWork_PushValueSlot(ticketPrice, 5);
330 // Keep the balance visible while the player confirms the purchase.
333#if TBS_PATCH_1
334 UiText_DrawCharacterAtOffset(MSGNO(MsgYourCoins), coinsWindow, 0, 0);
335#else
336 coinLabel = MSGNO(MsgYourCoins);
337 UiText_DrawCharacterAtOffset(coinLabel, coinsWindow, 0, 0);
338#endif
339 state = &gGameState;
340#if LANGUAGE == LANGUAGE_JAPANESE
341 coinLabel += MSGNO(MsgCoins) - MSGNO(MsgYourCoins);
342#endif
343 UiText_DrawNumberInWindow(state->coins, 6, coinsWindow, TICKET_COUNTER_X,
344 8);
345#if LANGUAGE == LANGUAGE_JAPANESE
346 UiText_DrawCharacterAtOffset(coinLabel, coinsWindow, 48, 8);
347#endif
348 if (Engine_EventChooseYesNo(-1, 0) == 1) {
349 UiWork_Finalize(coinsWindow, 2);
353 } else if ((u32)ticketPrice > (u32)state->coins) {
354 UiWork_Finalize(coinsWindow, 2);
360 } else {
361 UiWork_Finalize(coinsWindow, 2);
364 gEventWork->message += 3;
366 // Complete both inventory and coin changes only after confirmation.
369 Party_AdjustCoins(-ticketPrice);
370 }
371 }
373 }
374}
375
376/// A passenger at Tolbi has heard the party was attacked by a monster on the
377/// crossing, and asks whether that is true.
380 Engine_EventSetMessage(MsgKalayHearScaryTrip);
383}
384
385/// A man at Tolbi asks whether the upset tourists got seasick.
388 Engine_EventSetMessage(MsgKalayTouristsLookUpset);
391}
392
393/// The daughter at Tolbi looks for her parents among the passengers. If the
394/// party carries her father's message she asks for it and thanks them once it
395/// is given; otherwise she turns back to the sea.
401 Engine_EventSetMessage(MsgKalayThanksMessageParents);
404 } else {
409 Engine_EventSetMessage(MsgKalaySilkRoadBlocked);
415 if (Engine_EventChooseYesNo(0, 0) == 0) {
419 } else {
426 }
427 } else {
431 }
433 }
434}
435
436/// Walking north into the docks' door, the door opens and the leader walks
437/// through it to the town.
441 Actor_SetSpeed(ACTOR_PARTY_LEADER, 0x8000, 0x4000);
446 } else {
450 }
451 }
455}
456
457/// Prepares whichever of the three maps is entered. Entrance 90 sets flag
458/// 0x950, which leaves the tour's passengers stranded on the Tolbi docks.
460 if (gGameState.entrance == 90) {
462 }
469 }
470 return 0;
471}
472
473/// On the first arrival at the Kalay docks, Garet runs to see the Karagol.
474/// Coming back from the ship clears the shore leave, and once the tour has left
475/// the gatekeeper stands at the gangway until the party goes ashore.
477 if (gGameState.entrance == 1) {
481 }
482 }
483 if (gGameState.entrance == 2) {
486 }
487 }
492 }
493 }
494}
495
496/// On the Tolbi docks the two blocks settle into the pier's cells. The
497/// passenger who met the party stays beside the ship, and after the
498/// confrontation the guide, the bodyguard and the two passengers keep where it
499/// left them, the angry one still lying on the ground.
501 struct FieldActor *actor;
502 u8 zero;
503
507 }
508 if (gGameState.entrance == 3) {
510 }
511 if (gGameState.entrance == 1) {
513 }
517 }
528 actor->collisionFlags = 0;
530 ((u8 *)actor->sprite)[9] |= 12;
531 ((u8 *)actor->sprite)[38] = 0;
532 zero = 0;
533 actor->sprite->rotation = 0xc000;
535 actor->priorityFlags = zero;
536 ((u8 *)actor->sprite)[9] |= 12;
537 ((u8 *)actor->sprite)[21] |= 12;
538 }
540 Map_CopyCellAttributes(18, 18, 1, 1, 14, 18);
541 Map_CopyCellAttributes(18, 18, 1, 1, 15, 18);
542 }
543}
544
545/// The ticket office opens with a window transition and no location name.
549}
550
551/// After either block is moved, the pier's cells under both are rebuilt.
553 s32 blockColumn;
554 s32 otherBlockColumn;
555
556 blockColumn = Object_GetById(ACTOR_FIRST_BLOCK)->x.fixed >> 20;
557 otherBlockColumn = Object_GetById(ACTOR_SECOND_BLOCK)->x.fixed >> 20;
558
559 Map_CopyCellAttributes(5, 12, 5, 1, 5, 11);
560 Map_CopyCellAttributes(1, 0, 1, 1, otherBlockColumn, 11);
561 Map_CopyCellAttributes(1, 0, 1, 1, blockColumn, 11);
562
565}
566
567/// Stops a dock block's idle motion and sets its sprite priority.
568static void KalayTolbiDocks_SettleBlock(s32 actorId) {
569 struct FieldActor *actor = Object_GetById(actorId);
570
573 actor->motionFlags = 0;
575}
576
577/// Garet runs to the edge of the Kalay docks and marvels at the sea.
578/// "Incredible! So this is the ocean Kraden was talking about!" The man who
579/// asks travellers about Tolbi (actor 8) walks over, shaking his head: the
580/// Karagol is surrounded by land, so it is not a real ocean. Garet means to see
581/// a real one someday, nods with the leader and rejoins the party.
583 struct FieldActor *actor;
584
587 Actor_SetPosition(8, PIXELS(328), PIXELS(1424));
588 Object_GetById(8)->paused = 1;
592 FieldMotion_LaunchFromFocusedObject(1, -16, 0, 0x8000);
596 // Follow Garet to the water before the man joins him.
597 Engine_EventSetMessage(MsgKalayIncredibleOcean);
599 Actor_SetSpeed(GARET, 0x19999, 0xcccc);
600 Actor_WalkToAndWait(GARET, 232, 1424);
602 Camera_MoveTo(PIXELS(184), -1, PIXELS(1440), 1);
605 Engine_ActorJump(GARET, 6, 15);
606 Engine_ActorJump(GARET, 6, 40);
609 Camera_MoveTo(PIXELS(264), -1, PIXELS(1448), 1);
613 Actor_SetSpeed(8, 0x13333, 0x9999);
614 Actor_WalkToAndWait(8, 264, 1424);
622 Event_ShowMessage(8, 0);
632 Actor_SetSpeed(GARET, 0x10000, 0x8000);
633 Actor_WalkToAndWait(GARET, 264, 1464);
644 Actor_SetSpeed(GARET, 0x13333, 0x9999);
646 // Garet rejoins the leader and the man wanders again from where he stands.
647 actor = Object_GetById(0);
648 if (actor != 0) {
649 Actor_SetDestination(GARET, actor->x.part.pixel, actor->z.part.pixel);
650 }
654 Object_GetById(8)->paused = 0;
656 actor = Object_GetById(8);
657 {
658 s32 pixelX = actor->x.fixed / 0x10000;
659
660 actor->timer = pixelX;
661 }
662 {
663 s32 pixelZ = actor->z.fixed / 0x10000;
664
665 actor->work = pixelZ;
666 }
668}
669
670/// Stepping onto the stranded Tolbi docks, the party watches the tour guide
671/// tell an angry passenger his ticket was refunded. The passengers demand to
672/// be taken home; when the angry one charges, the guides' hired bodyguard
673/// steps in, and after a second try the passenger is knocked flat and the
674/// bodyguard spins on the spot.
676 struct FieldActor *actor;
677
681 Engine_EventSetMessage(MsgKalayReturnedTicketCost);
683 actor->priorityFlags = 0;
684 ((u8 *)actor->sprite)[9] |= 12;
685 ((u8 *)actor->sprite)[21] |= 12;
686 Camera_MoveTo(PIXELS(232), -1, PIXELS(304), 1);
687 Actor_SetSpeed(ACTOR_PARTY_LEADER, 0x10000, 0x8000);
710 Actor_SetSpeed(ACTOR_ANGRY_PASSENGER, 0x20000, 0x10000);
717 Actor_SetSpeed(ACTOR_TOUR_GUIDE, 0x26666, 0x13333);
731 Actor_SetSpeed(ACTOR_TOUR_GUIDE, 0x6666, 0x3333);
739 Actor_SetSpeed(ACTOR_BODYGUARD, 0x10000, 0x8000);
780 Actor_SetSpeed(ACTOR_ANGRY_PASSENGER, 0x13333, 0x9999);
782 Actor_SetSpeed(ACTOR_BODYGUARD, 0x20000, 0x10000);
789 Actor_SetSpeed(ACTOR_ANGRY_PASSENGER, 0xcccc, 0x6666);
802 Actor_SetSpeed(ACTOR_ANGRY_PASSENGER, 0xcccc, 0x6666);
809 Actor_SetSpeed(ACTOR_ANGRY_PASSENGER, 0x1cccc, 0xe666);
815 // The passenger bounces off the spinning bodyguard and lands on his back.
821 actor->collisionFlags = 0;
823 ((u8 *)actor->sprite)[9] |= 12;
824 ((u8 *)actor->sprite)[38] = 0;
825 actor->sprite->rotation = 0xc000;
842 Actor_SetSpeed(ACTOR_BODYGUARD, 0xcccc, 0x6666);
857 Actor_SetSpeed(ACTOR_BODYGUARD, 0x10000, 0x8000);
862 Actor_SetSpeed(ACTOR_TOUR_GUIDE, 0x10000, 0x8000);
866}
867
869 MAP_CELL_STEP(98, 84, 2, 2, 5),
870 MAP_CELL_STEP(98, 82, 2, 2, 5),
872};
873
875 MAP_CELL_STEP(92, 9, 2, 2, 5),
876 MAP_CELL_STEP(92, 7, 2, 2, 5),
878};
879
881 SC_ADD(SW_FACING, -0x2000),
882 SC_WAIT(2),
883 SC_LOOP(8, SC_TOP),
884 SC_END,
885};
886
888 {0, CONDITION_ALWAYS, 128, 0, 128, FACING_SOUTH, 0, -1, -1, -1, -1, 0},
890};
891
893 {0, CONDITION_ALWAYS, 248, 0, 1368, FACING_SOUTH, 0, -1, -1, -1, -1, 0},
894 {1, CONDITION_ALWAYS, 288, 0, 1464, FACING_NORTH, 0, -1, -1, -1, -1, 0},
895 {2, CONDITION_ALWAYS, 72, 0, 1304, FACING_EAST, 0, -1, -1, -1, -1, 0},
896 {3, CONDITION_ALWAYS, 304, 0, 1416, FACING_SOUTH, 0, -1, -1, -1, -1, 0},
897 {4, CONDITION_ALWAYS, 296, 0, 1048, FACING_SOUTH, 0, -1, -1, -1, -1, 0},
899};
900
902 {0, CONDITION_ALWAYS, 392, 0, 296, FACING_WEST, 0, -1, -1, -1, -1, 0},
903 {1, CONDITION_ALWAYS, 408, 0, 296, FACING_WEST, 0, 0, 0, 448, 432, 0},
904 {2, CONDITION_ALWAYS, 24, 0, 232, FACING_EAST, 0, 0, 0, 448, 432, 0},
905 {3, CONDITION_ALWAYS, 240, 0, 216, FACING_SOUTH, 0, 0, 0, 448, 432, 0},
907};
908
910 {0, CONDITION_ALWAYS, 96, 0, 248, FACING_NORTH, 0, -1, -1, -1, -1, 0},
911 {1, CONDITION_ALWAYS, 96, 0, 248, FACING_NORTH, 0, 32, 32, 272, 272, 0},
912 {2, CONDITION_ALWAYS, 384, 0, 248, FACING_NORTH, 0, 320, 32, 560, 272, 0},
914};
915
917 SCENE_EXITS(107), SCENE_EXIT(1, 2, 21), SCENE_EXIT(2, 109, 5),
918 SCENE_EXIT(3, 108, 1), SCENE_EXIT(4, 2, 58), SCENE_EXIT(0, 112, 0),
919 SCENE_EXIT(1, 2, 22), SCENE_EXIT(2, 109, 6), SCENE_EXIT(3, 108, 2),
920 SCENE_EXIT(0, 108, 0), SCENE_EXIT(1, 107, 3), SCENE_EXIT(2, 112, 3),
922};
923
926};
927
928// clang-format off
933 PIXELS(392), 0, PIXELS(344), FACING_SOUTH, TALK_FACE_PARTY, 0 },
935 PIXELS(216), 0, PIXELS(264), FACING_SOUTH, TALK_FACE_PARTY, 0 },
937 PIXELS(296), 0, PIXELS(344), FACING_EAST, TALK_KEEP_FACING, 0 },
939 PIXELS(296), 0, PIXELS(216), FACING_SOUTHEAST, TALK_FACE_PARTY, 0 },
941 PIXELS(280), 0, PIXELS(248), FACING_SOUTHEAST, TALK_FACE_PARTY, 0 },
943 PIXELS(136), 0, PIXELS(190), FACING_SOUTH, TALK_KEEP_FACING, 0 },
945 PIXELS(152), 0, PIXELS(190), FACING_SOUTH, TALK_KEEP_FACING, 0 },
946 { SCENE_TABLE_END },
947};
948
955 PIXELS(224), 0, PIXELS(304), FACING_EAST, TALK_KEEP_FACING, 0 },
957 PIXELS(216), 0, PIXELS(320), FACING_EAST, TALK_FACE_PARTY, 0 },
959 PIXELS(256), 0, PIXELS(264), FACING_SOUTH, TALK_KEEP_FACING, 0 },
961 PIXELS(272), 0, PIXELS(304), FACING_WEST, TALK_KEEP_FACING, 0 },
963 PIXELS(136), 0, PIXELS(190), FACING_SOUTH, TALK_KEEP_FACING, 0 },
965 PIXELS(152), 0, PIXELS(190), FACING_SOUTH, TALK_KEEP_FACING, 0 },
967 PIXELS(280), 0, PIXELS(288), FACING_WEST, TALK_KEEP_FACING, 0 },
970 { SCENE_TABLE_END },
971};
972
975 PIXELS(-64), 0, PIXELS(-64), FACING_EAST, TALK_FACE_PARTY, 0 },
977 PIXELS(248), 0, PIXELS(1408), FACING_SOUTH, TALK_FACE_PARTY, 0 },
981 PIXELS(248), 0, PIXELS(1304), FACING_SOUTH, TALK_FACE_PARTY, 0 },
985 PIXELS(88), 0, PIXELS(1288), FACING_SOUTH, TALK_FACE_PARTY, 0 },
987 PIXELS(120), 0, PIXELS(1368), FACING_SOUTH, TALK_FACE_PARTY, 0 },
988 { 0x5a, 0x35, ACTOR_STAND,
989 PIXELS(272), 0, PIXELS(1144), FACING_SOUTH, TALK_FACE_PARTY, 0 },
990 { SCENE_TABLE_END },
991};
992
995 PIXELS(-64), 0, PIXELS(-64), FACING_EAST, TALK_FACE_PARTY, 0 },
1005 PIXELS(200), 0, PIXELS(1352), FACING_EAST + FACING_STEP, TALK_FACE_PARTY, 0 },
1008 { 0x5a, 0x35, ACTOR_STAND,
1009 PIXELS(272), 0, PIXELS(1144), FACING_SOUTH, TALK_FACE_PARTY, 0 },
1010 { SCENE_TABLE_END },
1011};
1012
1019 PIXELS(192), 0, PIXELS(216), FACING_SOUTH, TALK_FACE_PARTY, 0 },
1026 { SCENE_TABLE_END },
1027};
1028
1033 PIXELS(-64), 0, PIXELS(-64), FACING_SOUTH, TALK_KEEP_FACING, 0 },
1035 PIXELS(-64), 0, PIXELS(-64), FACING_SOUTH, TALK_KEEP_FACING, 0 },
1042 { SCENE_TABLE_END },
1043};
1044
1049 PIXELS(-64), 0, PIXELS(-64), FACING_SOUTH, TALK_KEEP_FACING, 0 },
1051 PIXELS(-64), 0, PIXELS(-64), FACING_SOUTH, TALK_KEEP_FACING, 0 },
1055 PIXELS(456), 0, PIXELS(200), FACING_EAST, TALK_FACE_PARTY, 0 },
1057 PIXELS(408), 0, PIXELS(184), FACING_SOUTH, TALK_FACE_PARTY, 0 },
1058 { SCENE_TABLE_END },
1059};
1060
1062 { SCENE_EVENTS_END },
1063};
1064
1066 { EVENT_EXIT, 1, CONDITION_ALWAYS, 1 },
1067 { EVENT_EXIT, 2, CONDITION_ALWAYS, 2 },
1069 { EVENT_EXIT, 4, CONDITION_ALWAYS, 4 },
1071 { EVENT_TALK, 9, CONDITION_ALWAYS, MSGNO(MsgKalayTolbiDocksWeCantTakeSilkRoadSo) },
1072 { EVENT_TALK, 10, CONDITION_ALWAYS, MSGNO(MsgKalayTolbiDocksYouCantTakeSilkRoadMuch) },
1074 { EVENT_TALK, 12, FLAG_KALAY_COLOSSO_TOUR_LEFT, MSGNO(MsgKalayTolbiDocksTodayThereAreSupposedToBe) },
1075 { EVENT_TALK, 13, FLAG_KALAY_COLOSSO_TOUR_LEFT, MSGNO(MsgKalayTolbiDocksTheShipWillBeOpenUntil) },
1078#if !TBS_PATCH_3
1080#else
1082#endif
1084 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 8, CONDITION_ALWAYS, MSGNO(MsgKalayTolbiDocksWithSilkRoadClosedEveryoneWill) },
1085 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 9, CONDITION_ALWAYS, MSGNO(MsgKalayTolbiDocksICantBelieveHowExpensiveTickets) },
1086 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 10, CONDITION_ALWAYS, MSGNO(MsgKalayTolbiDocksWellIsntThisGreatWeCant) },
1087 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 11, CONDITION_ALWAYS, MSGNO(MsgKalayTolbiDocksWeveSpentAYearPlanningThis) },
1088 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 12, FLAG_KALAY_COLOSSO_TOUR_LEFT, MSGNO(MsgKalayTolbiDocksTheCaptainsInAGoodMood) },
1089 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 13, FLAG_KALAY_COLOSSO_TOUR_LEFT, MSGNO(MsgKalayTolbiDocksTheCaptainsInAGoodMoodThats) },
1090 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 12, CONDITION_ALWAYS, MSGNO(MsgKalayTolbiDocksSilkRoadIsBlockedSoThe) },
1091 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 13, CONDITION_ALWAYS, MSGNO(MsgKalayTolbiDocksTheReplacementShipHasntArrivedSo) },
1093 { SCENE_EVENTS_END },
1094};
1095
1097 { EVENT_EXIT, 1, CONDITION_ALWAYS, 1 },
1098 { EVENT_EXIT, 2, CONDITION_ALWAYS, 2 },
1100 { EVENT_EXIT, 4, CONDITION_ALWAYS, 4 },
1101 { EVENT_TALK, 12, CONDITION_ALWAYS, MSGNO(MsgKalayTolbiDocksTheShipHasntReturnedSoWe) },
1102 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 12, CONDITION_ALWAYS, MSGNO(MsgKalayTolbiDocksOhHoHoWithoutAShip) },
1103 { EVENT_TALK, 13, CONDITION_ALWAYS, MSGNO(MsgKalayTolbiDocksImGladIOnlyWorkOn) },
1104 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 13, CONDITION_ALWAYS, MSGNO(MsgKalayTolbiDocksIWonderIfMonstersGotEveryone) },
1106 { SCENE_EVENTS_END },
1107};
1108
1110 { EVENT_EXIT, 1, CONDITION_ALWAYS, 1 },
1111 { EVENT_EXIT, 2, CONDITION_ALWAYS, 2 },
1115 { EVENT_TALK, 9, CONDITION_ALWAYS, MSGNO(MsgKalayTolbiDocksSighIThinkWereDoneSailing) },
1118 { EVENT_TALK, 12, CONDITION_ALWAYS, MSGNO(MsgKalayTolbiDocksIfYoureGoingToTolbiKeep) },
1119 { EVENT_TALK, 13, CONDITION_ALWAYS, MSGNO(MsgKalayTolbiDocksItsBeenQuiteSomeTimeSince) },
1120 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 11, IF_FLAG_SET(FLAG_TOLBI_DOCKS_MESSAGE_DELIVERED), MSGNO(MsgKalayTolbiDocksItWasAHardCrossingVery) },
1122 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 10, CONDITION_ALWAYS, MSGNO(MsgKalayTolbiDocksAfterSeeingTheLooksOnThe) },
1123 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 12, CONDITION_ALWAYS, MSGNO(MsgKalayTolbiDocksIGetTheFeelingThatIt) },
1124 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 13, CONDITION_ALWAYS, MSGNO(MsgKalayTolbiDocksYouCrossedTheSeaJustFor) },
1125 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 8, CONDITION_ALWAYS, MSGNO(MsgKalayTolbiDocksIGuessWeWontBeSeeing) },
1126 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 9, CONDITION_ALWAYS, MSGNO(MsgKalayTolbiDocksIThinkThatMissingShipMust) },
1129 { SEARCH(SEARCH_CHEST), 100, 0xf96, FIND_ITEM(ITEM_POTION) },
1130 { SEARCH(SEARCH_WOODEN_BOX), 101, 0xf95, FIND_COINS(35) },
1131 { SCENE_EVENTS_END },
1132};
1133
1135 { EVENT_EXIT, 1, CONDITION_ALWAYS, 1 },
1136 { EVENT_EXIT, 2, CONDITION_ALWAYS, 2 },
1139 { EVENT_TALK, 8, CONDITION_ALWAYS, MSGNO(MsgKalayTolbiDocksThereAreManyHereWhoWant) },
1140 { EVENT_TALK, 9, CONDITION_ALWAYS, MSGNO(MsgKalayTolbiDocksHangingAroundHereLikeThisAnd) },
1141 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 8, CONDITION_ALWAYS, MSGNO(MsgKalayTolbiDocksIfBothTheCaptainAndKaja) },
1142 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 9, CONDITION_ALWAYS, MSGNO(MsgKalayTolbiDocksIfKajaAndTheOthersSay) },
1143 { EVENT_TALK, 12, CONDITION_ALWAYS, MSGNO(MsgKalayTolbiDocksTourGroupsShouldTakeCareOf) },
1144 { EVENT_TALK, 10, CONDITION_ALWAYS, MSGNO(MsgKalayTolbiDocksToHeckWithYouImStaying) },
1145 { EVENT_TALK, 11, CONDITION_ALWAYS, MSGNO(MsgKalayTolbiDocksSighIWonderWhenWellBe) },
1146 { EVENT_TALK, 13, CONDITION_ALWAYS, MSGNO(MsgKalayTolbiDocksWellBeCountingOnYouIf) },
1147 { EVENT_TALK, 16, CONDITION_ALWAYS, MSGNO(MsgKalayTolbiDocksAsLongAsWereStuckHere) },
1148 { EVENT_TALK, 17, CONDITION_ALWAYS, MSGNO(MsgKalayTolbiDocksSighIfIKnewItWould) },
1149 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 12, CONDITION_ALWAYS, MSGNO(MsgKalayTolbiDocksIfTheydJustLetTheShip) },
1150 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 10, CONDITION_ALWAYS, MSGNO(MsgKalayTolbiDocksIfImGoingToBeStuck) },
1151 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 11, CONDITION_ALWAYS, MSGNO(MsgKalayTolbiDocksGrrrWhyDontYouGetUp) },
1152 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 13, CONDITION_ALWAYS, MSGNO(MsgKalayTolbiDocksAsLongAsYoureHereWe) },
1153 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 16, CONDITION_ALWAYS, MSGNO(MsgKalayTolbiDocksThisTourWasntWellOrganizedThats) },
1154 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 17, CONDITION_ALWAYS, MSGNO(MsgKalayTolbiDocksIWonderIfGrandmaIsDoing) },
1157 { SEARCH(SEARCH_CHEST), 100, 0xf96, FIND_ITEM(ITEM_POTION) },
1158 { SEARCH(SEARCH_WOODEN_BOX), 101, 0xf95, FIND_COINS(35) },
1159 { SCENE_EVENTS_END },
1160};
1161
1163 { EVENT_EXIT, 1, CONDITION_ALWAYS, 1 },
1164 { EVENT_EXIT, 2, CONDITION_ALWAYS, 2 },
1166 { EVENT_TALK, 9, CONDITION_ALWAYS, MSGNO(MsgKalayTolbiDocksHmmmThatsStrangeIsntTheReplacement) },
1167 { EVENT_TALK, 10, CONDITION_ALWAYS, MSGNO(MsgKalayTolbiDocksOnceWeveCrossedTheKaragolWell) },
1168 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 8, FLAG_KALAY_DOCKS_TICKET_BOUGHT, MSGNO(MsgKalayTolbiDocksIFeelSortOfBadThat) },
1169 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 8, CONDITION_ALWAYS, MSGNO(MsgKalayTolbiDocksIfYouveAlreadyBoughtYourTicket) },
1170 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 9, CONDITION_ALWAYS, MSGNO(MsgKalayTolbiDocksTheShipWontLeaveHereTill) },
1171 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 10, CONDITION_ALWAYS, MSGNO(MsgKalayTolbiDocksLetsGetGoingImNotGetting) },
1172 { EVENT_TALK, 11, CONDITION_ALWAYS, MSGNO(MsgKalayTolbiDocksImSorryButWeJustCant) },
1173 { EVENT_TALK, 12, CONDITION_ALWAYS, MSGNO(MsgKalayTolbiDocksWeRentedOutOurHouseFor) },
1174 { EVENT_TALK, 13, CONDITION_ALWAYS, MSGNO(MsgKalayTolbiDocksWeRentedOutOurHouseIf) },
1175 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 11, CONDITION_ALWAYS, MSGNO(MsgKalayTolbiDocksSighWeCouldHaveMadeLots) },
1176 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 12, CONDITION_ALWAYS, MSGNO(MsgKalayTolbiDocksMaybeWellStayHereUntilThe) },
1177 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 13, CONDITION_ALWAYS, MSGNO(MsgKalayTolbiDocksAreWeSupposedToSleepOn) },
1178 { SCENE_EVENTS_END },
1179};
1180
1182 { EVENT_EXIT, 1, CONDITION_ALWAYS, 1 },
1183 { EVENT_EXIT, 2, CONDITION_ALWAYS, 2 },
1184 { EVENT_TALK, 8, CONDITION_ALWAYS, MSGNO(MsgKalayTolbiDocksTheShipWontBeLeavingHere) },
1185 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 8, CONDITION_ALWAYS, MSGNO(MsgKalayTolbiDocksAhhhImBoredWhenAreWe) },
1186 { EVENT_TALK, 11, CONDITION_ALWAYS, MSGNO(MsgKalayTolbiDocksImSorryButWeJustCant) },
1187 { EVENT_TALK, 12, CONDITION_ALWAYS, MSGNO(MsgKalayTolbiDocksWeRentedOutOurHouseFor) },
1188 { EVENT_TALK, 13, CONDITION_ALWAYS, MSGNO(MsgKalayTolbiDocksWeRentedOutOurHouseIf) },
1189 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 11, CONDITION_ALWAYS, MSGNO(MsgKalayTolbiDocksSighWeCouldHaveMadeLots) },
1190 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 12, CONDITION_ALWAYS, MSGNO(MsgKalayTolbiDocksMaybeWellStayHereUntilThe) },
1191 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 13, CONDITION_ALWAYS, MSGNO(MsgKalayTolbiDocksAreWeSupposedToSleepOn) },
1192 { SCENE_EVENTS_END },
1193};
1194
1196 { EVENT_EXIT, 1, CONDITION_ALWAYS, 1 },
1197 { EVENT_EXIT, 2, CONDITION_ALWAYS, 2 },
1198 { EVENT_TALK, 8, CONDITION_ALWAYS, MSGNO(MsgKalayTolbiDocksTheShipWontBeLeavingHere) },
1199 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 8, CONDITION_ALWAYS, MSGNO(MsgKalayTolbiDocksAhhhImBoredWhenAreWe) },
1200 { EVENT_TALK, 11, CONDITION_ALWAYS, MSGNO(MsgKalayTolbiDocksImStuckIWantToCross) },
1201 { EVENT_TALK, 12, CONDITION_ALWAYS, MSGNO(MsgKalayTolbiDocksYeahTheShipsNotGoingAnywhere) },
1202 { EVENT_TALK, 13, CONDITION_ALWAYS, MSGNO(MsgKalayTolbiDocksTheKaragolSeaLooksSoCalm) },
1203 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 11, CONDITION_ALWAYS, MSGNO(MsgKalayTolbiDocksWeveGotPassengersButNobodysSailing) },
1204 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 12, CONDITION_ALWAYS, MSGNO(MsgKalayTolbiDocksTheCaptainMustBeAStubborn) },
1205 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 13, CONDITION_ALWAYS, MSGNO(MsgKalayTolbiDocksTheMarineBlueKaragolSeaIs) },
1206 { SCENE_EVENTS_END },
1207};
1208// clang-format on
Ability numbers, named from the English release.
@ ABILITY_MIND_READ
Definition ability_ids.h:16
@ ABILITY_MOVE
Definition ability_ids.h:15
struct FieldActor * Object_GetById(s32 actor)
Returns an actor, or NULL if it does not exist.
@ ELEMENT_VENUS
Definition battle_unit.h:36
Calls through a function pointer, by argument count.
#define GARET
Jerald.
void Engine_ActorSetSpriteFlags(struct FieldActor *, s32)
The engine calls the debug menus import, and their palette swatch tiles.
void Djinn_JoinParty(s32 slot, s32 element, s32 djinn)
A Djinni joins the party: djinn (0 to 19) of element goes to the member with the fewest Djinn,...
Definition djinni.c:124
The edition's language, for C to compare (LANGUAGE == LANGUAGE_GERMAN).
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)
static void Map_AnimateCells(const u16 *steps, s32 destX, s32 destY)
void Engine_ActorSetSpritePriority(s32 actor, s32 priority)
static void Event_ShowMessageAndWait(s32 speaker, s32 flags, s32 frames)
static void Actor_SetBuiltinAction(s32 actor, s32 action)
s32 Engine_EventChooseYesNo(s32 actor, s32 flags)
s32 Engine_PartyGiveItem(s32 item, s32 flags)
#define GameFlag_IsSet
static void Actor_WalkToAndWait(s32 actor, s32 x, s32 z)
void Engine_ActorJump(s32 actor, s32 height, s32 frames)
#define EMOTE_IN_FRONT
Definition field_event.h:49
#define MAP_CELL_STEP(srcX, srcY, width, height, frames)
Definition field_event.h:59
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)
static void Actor_WalkByAndWait(s32 actor, s32 dx, s32 dz)
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)
void Engine_CameraWaitForMove(void)
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_ActorRunRepeatedMotion(s32 actor, s32 repeats)
static void Event_ShowMessage(s32 speaker, s32 flags)
static void Event_PlayCue(s32 cue)
void Engine_ActorSetChildValue(s32 actor, s32 value)
#define MAP_CELL_STEPS_END
Definition field_event.h:61
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)
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_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_UNDERFOOT
The depth sort treats it as 320 pixels higher on the screen.
Definition field_obj.h:155
#define SCENE_TRANSITION(style, variant)
Definition field_obj.h:20
@ ACTOR_FACES_MOTION
turns toward its velocity, 1/16 turn a frame
Definition field_obj.h:166
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 IF_FLAG_SET(flag)
Definition field_scene.h:48
#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 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_WOODEN_BOX
@ SEARCH_CHEST
#define FIND_COINS(coins)
The scene service layer: one typed inline for each engine service a scene calls by its own name,...
static void FieldMotion_LaunchFromFocusedObject(s32 actor, s32 dx, s32 dz, s32 facing)
Game flags, named where their meaning is shown.
#define FLAG_SHOW_LOCATION_NAME
Definition flags.h:94
#define FLAG_COLOSSO_OVER
the Colosso finals have been fought
Definition flags.h:191
#define FLAG_TOLBI_SHIP_REACHED_TOLBI
The ship reached Tolbi. "The ship has arrived safely".
Definition flags.h:425
#define FLAG_KALAY_DOCKS_GARET_SAW_KARAGOL
Definition flags.h:257
#define FLAG_TOLBI_DOCKS_CONFRONTATION_SEEN
The passengers confronted the tour guides and their bodyguard.
Definition flags.h:256
#define FLAG_KALAY_DOCKS_TICKET_BOUGHT
Definition flags.h:246
#define FLAG_KALAY_DOCKS_CARRYING_MESSAGE
The father on the Kalay docks asked the party to take a message to his daughter in Tolbi,...
Definition flags.h:249
#define FLAG_KEEP_PARTY_POSITION
Definition flags.h:93
#define FLAG_TOLBI_DOCKS_PASSENGER_MET_PARTY
A passenger on the Tolbi docks walked up to the party as it arrived.
Definition flags.h:254
#define FLAG_KALAY_DOCKS_WENT_ASHORE
off the ship after boarding
Definition flags.h:252
#define FLAG_KALAY_DOCKS_TICKET_HANDED_OVER
the party may board
Definition flags.h:250
#define FLAG_TOLBI_DOCKS_MESSAGE_DELIVERED
Definition flags.h:251
#define FLAG_KALAY_COLOSSO_TOUR_LEFT
the tour group has left town
Definition flags.h:229
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.
s32 Inventory_Discard(s32 owner, s32 slot)
Removes one item as Inventory_Remove does, and puts a rare item back into circulation (its counter go...
Definition inventory.c:375
s32 Inventory_Find(s32 owner, s32 itemId)
Returns the first slot holding itemId (any quantity, equipped or not), or -1.
Definition inventory.c:212
s32 PartyInventory_FindOwner(s32 itemId)
Returns who carries itemId, asking the selected character first, or -1.
Definition inventory.c:229
Item numbers, named from the English release.
@ ITEM_BOAT_TICKET
Definition item_ids.h:76
@ ITEM_POTION
Definition item_ids.h:43
@ ACTOR_SECOND_BLOCK
Definition kalay.c:76
@ ACTOR_FIRST_BLOCK
the blocks that open the two passages
Definition kalay.c:75
@ ACTOR_TOUR_GUIDE
in the inn's dining room
struct SceneEvent gKalayTolbiDocks_TolbiEvents[]
struct ScenePlacement gKalayTolbiDocks_TicketOfficePlacementsStranded[]
static void KalayTolbiDocks_TalkToDockWorker(void)
The dock worker explains the tickets: hand one over to board, give it to the gatekeeper,...
struct ScenePlacement gKalayTolbiDocks_TicketOfficePlacements[]
static void KalayTolbiDocks_AskAboutRoughCrossing(void)
A passenger at Tolbi has heard the party was attacked by a monster on the crossing,...
struct SceneEvent gKalayTolbiDocks_KalayEvents[]
const struct SceneRegion * KalayTolbiDocks_GetRegions(void)
struct SceneEvent gKalayTolbiDocks_TicketOfficeEventsStranded[]
const struct SceneEvent * KalayTolbiDocks_GetEvents(void)
Selects dialogue and interactions for the current port and voyage state.
static void KalayTolbiDocks_TalkToGatekeeper(void)
The gatekeeper at the gangway.
struct SceneEvent gKalayTolbiDocks_TicketOfficeEvents[]
static void KalayTolbiDocks_AskAboutSeasickTourists(void)
A man at Tolbi asks whether the upset tourists got seasick.
u32 gKalayTolbiDocks_Exits[]
static void KalayTolbiDocks_UpdateBlockCells(void)
After either block is moved, the pier's cells under both are rebuilt.
static void KalayTolbiDocks_PassengersConfrontTourGuide(void)
Stepping onto the stranded Tolbi docks, the party watches the tour guide tell an angry passenger his ...
struct SceneEvent gKalayTolbiDocks_TicketOfficeEventsShipGone[]
static void KalayTolbiDocks_PrepareTolbiDocks(void)
On the Tolbi docks the two blocks settle into the pier's cells.
const u32 * KalayTolbiDocks_GetExits(void)
The docks list no numbered exits.
static void KalayTolbiDocks_TalkToTicketSeller(void)
The ticket seller offers tickets for the four of them at 600 coins, with the party's coins shown besi...
struct SceneEvent gKalayTolbiDocks_TolbiEventsStranded[]
static void KalayTolbiDocks_PrepareTicketOffice(void)
The ticket office opens with a window transition and no location name.
static void KalayTolbiDocks_OpenDoorAndLeave(void)
Walking north into the docks' door, the door opens and the leader walks through it to the town.
struct ScenePlacement gKalayTolbiDocks_NoPlacements[]
KalayTolbiDocksActor
The three maps share actor numbers; each is named on the map it is proved.
@ ACTOR_ANGRY_PASSENGER
Tolbi docks, once the tour's passengers are stranded there.
@ ACTOR_DOCK_WORKER
@ ACTOR_ARRIVALS_GREETER
hears of the party's scary trip
@ ACTOR_WORRIED_FATHER
his daughter waits on the Tolbi docks
@ ACTOR_TICKET_SELLER
Ticket office.
@ ACTOR_BODYGUARD
hired by the tour guides
@ ACTOR_STRANDED_PASSENGER
@ ACTOR_GATEKEEPER
takes the tickets at the gangway
@ ACTOR_VENUS_DJINNI
@ ACTOR_WAITING_DAUGHTER
u16 gKalayTolbiDocks_KalayDoorCells[]
static void KalayTolbiDocks_TalkToWorriedFather(void)
The father asks whether the party is taking the ship.
struct SceneEntrance gKalayTolbiDocks_NoEntrances[]
struct SceneEvent gKalayTolbiDocks_NoEvents[]
static void KalayTolbiDocks_PassengerGreetsArrivals(void)
Stepping off the ship at Tolbi, the leader walks a few steps and a passenger hurries over to stand be...
struct ScenePlacement gKalayTolbiDocks_TicketOfficePlacementsShipGone[]
struct ScenePlacement gKalayTolbiDocks_KalayPlacements[]
struct ScenePlacement gKalayTolbiDocks_TolbiPlacementsStranded[]
s32 KalayTolbiDocks_Initialize(void)
Prepares whichever of the three maps is entered.
struct ScenePlacement gKalayTolbiDocks_TolbiPlacements[]
u16 gKalayTolbiDocks_TolbiDoorCells[]
const struct ScenePlacement * KalayTolbiDocks_GetPlacements(void)
Each map has its people before the ship sails, once it has gone and not come back (flag 0x93e),...
static void KalayTolbiDocks_GaretSeesTheKaragol(void)
Garet runs to the edge of the Kalay docks and marvels at the sea.
static void KalayTolbiDocks_PrepareKalayDocks(void)
On the first arrival at the Kalay docks, Garet runs to see the Karagol.
static void KalayTolbiDocks_AskAboutTolbiCrossing(void)
A man on the Kalay docks asks whether the party wants to go to Tolbi.
s32 gKalayTolbiDocks_BodyguardSpinScript[]
const struct SceneEntrance * KalayTolbiDocks_GetEntrances(void)
Selects the entrance positions for the departure, arrival or ticket office.
static void KalayTolbiDocks_SettleBlock(s32 actorId)
Stops a dock block's idle motion and sets its sprite priority.
static void KalayTolbiDocks_RecruitVenusDjinni(void)
Adds the Venus Djinni waiting at the Kalay docks.
static void KalayTolbiDocks_RemindBoardShip(void)
Spoken to on the shore after boarding, the gatekeeper asks the party to board the ship when it is fin...
struct ScenePlacement gKalayTolbiDocks_KalayPlacementsShipGone[]
struct SceneEntrance gKalayTolbiDocks_KalayEntrances[]
struct SceneEntrance gKalayTolbiDocks_TicketOfficeEntrances[]
static void KalayTolbiDocks_TalkToWaitingDaughter(void)
The daughter at Tolbi looks for her parents among the passengers.
struct SceneEvent gKalayTolbiDocks_KalayEventsShipGone[]
struct SceneEntrance gKalayTolbiDocks_TolbiEntrances[]
The reel game's title lettering.
Field object scripts: one s32 command word, then its operands, as gScriptObject_CommandTable runs the...
#define SC_LOOP(n, to)
Repeat up to n times.
Definition objcmd.h:28
#define SC_ADD(w, v)
Definition objcmd.h:38
#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
void Battle_ResetEffectCounter(void)
Clears the field's busy flag and, while Reveal is active, ends it: Reveal used with ACT_PACKED runs i...
Definition targets.c:261
s32 Party_AdjustCoins(s32 amount)
Adds amount to the party's coins, kept between 0 and 999999, and returns the new total.
Definition party.c:195
Scene numbers, named after their places.
char SceneId_KalayTolbiDocks2
char SceneId_KalayTolbiDocks3
char SceneId_KalayTolbiDocks1
Song and sound effect ids, indices into gSound_SongTable.
#define SE_159
Definition songs.h:154
#define SE_133
Definition songs.h:126
#define SE_MENU_CANCEL
Definition songs.h:106
#define SE_DOOR_OPEN
Definition songs.h:153
#define SE_155
Definition songs.h:150
#define SE_HIGH_JUMP
Definition songs.h:148
void Engine_ActorSetAnimation()
struct EventWork * gEventWork
void Engine_EventRequestExit()
void Engine_EventEnd(void)
void Engine_EventBegin(void)
void Engine_EventSetMessage()
void Engine_EventShowMessage()
#define NULL
Definition bilibin.h:6
s32 startTransition
SCENE_TRANSITION(style, variant).
Definition event_work.h:43
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
s16 timer
The parameter its action script reads (a follow distance or an angle to face), the player's frames to...
Definition field_obj.h:109
u8 steeringFlags
ActorSteeringFlag bits.
Definition field_obj.h:92
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 paused
nonzero skips its script and motion, not its update
Definition field_obj.h:93
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
u16 facing
1/65536 turns
Definition field_obj.h:34
u16 work
The side of the player's next footprint (2 after a stop), or scene scratch.
Definition field_obj.h:112
u8 collisionFlags
bits: 7 refuses to move into a solid object | 4 nearer for Psynergy targets | 3 never a talk or Psyne...
Definition field_obj.h:91
The game's state: play time, coins, the scene and the leader's position, the active party and the opt...
Definition game_state.h:14
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...
A window: a framed rectangle of the tilemap with its sprite outputs, its opening or closing animation...
Definition uiwindow.h:11
The system's routines and globals: interrupts, BIOS sound bias, random numbers and sleep.
Values that differ by patch level or language, chosen once for their code.
#define TICKET_COUNTER_X
#define TICKET_COUNTER_WIDTH
#define TICKET_COUNTER_WINDOW_X
void UiText_DrawNumberInWindow(s32 value, s32 width, struct UiWindow *window, s32 x, s32 y)
Draws a number (width as UiText_FormatNumber) into a window's tilemap at pixel (x,...
Definition text_tiles.c:678
void UiText_DrawCharacterAtOffset(s32 message, const struct UiWindow *window, u32 offsetX, u32 offsetY)
Decodes a message and draws it as tiles in a window at pixel (offsetX, offsetY) of its interior.
Definition text_tiles.c:552
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
unsigned short u16
Definition types.h:13
unsigned char u8
Definition types.h:11
struct FieldCoordinate::@024321007066302143002254325121164243234242211074 part
s32 fixed
16.16 fixed-point pixels
The patch levels: our groups of the measured changes from the Japanese release.
void UiWork_PushValueSlot(u32 value, u32 kind)
Adds a message argument of kind (MSG_ARG_) with value to the first free place of the argument table; ...
Definition messages.c:216
void UiWork_Finalize(struct UiWindow *window, s32 instant)
Closes a window: clears its contents and remembers its last rectangle.
Definition windows.c:349
struct UiWindow * UiWindow_Create(s32 x, s32 y, s32 width, s32 height, s32 attrs)
Opens a window at tile (x, y) of width by height tiles in the first free window slot,...
Definition windows.c:279