Alchemy
Loading...
Searching...
No Matches

vale_babi.c

Go to the documentation of this file.
1/// @file
2/// The south-west of Vale around Isaac's house, through the stormy night, the
3/// party's departure and its return; entrance 19 is instead a room of Babi's
4/// scholars, and entrance 22 shows the Mythril Bag.
5
6#include "game_state.h"
7#include "vram_tab.h"
10#include "unit/object/object.h"
12#include "unit/field/field.h"
13#include "unit/window/window.h"
16#include "types.h"
17#include "facing_object.h"
18#include "battle.h"
19#include "debug.h"
20#include "field.h"
21#include "game.h"
22#include "graphics.h"
23#include "menu.h"
24#include "minigame.h"
25#include "sound.h"
26#include "system.h"
27#include "fxblend.h"
28#include "map_scroll.h"
29#include "field_event.h"
30#include "field_scene.h"
31#include "ram_buffer.h"
32#include "text/msg_ids.h"
33#include "resource.h"
34#include "glyph.h"
35#include "animspr.h"
36#include "vram_block.h"
37#include "b5_context.h"
38#include "io_reg.h"
39#include "call.h"
40#include "field_effect.h"
41#include "heap_state.h"
42#include "ability_ids.h"
43#include "songs.h"
44#include "item_ids.h"
45#include "objcmd.h"
46#include "iowrite.h"
47#include "field_obj.h"
48#include "flags.h"
49#include "fixed_math.h"
50#include "fx_scene.h"
51
52// The arrival scenes are defined after the event handlers.
53static void Event_DoraWakesIsaac(void);
54static void Event_HurryToThePlaza(void);
55static void ValeBabi_RestoreRoomPatch(void);
56static void Event_ShowMythrilBag(void);
57static void ValeBabi_SpawnEffectPair(union FieldObject *object);
58static void ValeBabi_DemonstrateCatch(void);
59
60// Shared facing code retains its position before the overlay entry points.
62
63/// Vale's placed actors, numbered in the order of gValeBabi_Placements (the
64/// scholars of entrance 19 are numbered from 8 in their own table).
66 /// Isaac's mother. "Isaac, wake up!"
68 /// Isaac's father (sprite 0x35, Kyle in vale_storm.c). "Isaac, Dora, hurry!
69 /// The Boulder could fall at any second!"
72 /// A neighbour who tells Isaac to be off, and who knows of Dora's illness
73 /// once the party is back from Kalay. "Hey... Boy..."
75 /// Kraden's sprite (0x1e, as in Sol Sanctum's scenes), seen only from
76 /// entrance 22.
78};
79
80/// Vale's place flags this scene keeps while the party is in Vale.
82 /// Back from Kalay, the innkeeper welcomed Isaac home.
84 /// Back from Kalay, the neighbour remarked how much Isaac has grown.
86};
87
88// FLAG_SCENE_TEMP_03: Dora got out of her sickbed on this visit.
89
90/// Returns the entrances, among them the scenes played on arrival: 19 from
91/// Babi's palace (its exit 11), 20 where a new game begins (menu/clear.c, and
92/// ValeHome's exit 50), 21 from this scene's own exit 20, and 22 from Kraden's
93/// cottage (ValeKraden's exit 13).
96}
97
98const struct SceneRegion *ValeBabi_GetRegions(void) { return NULL; }
99
100/// On the stormy night the exits lead into the storm.
101const u32 *ValeBabi_GetExits(void) {
104 }
105 return gValeBabi_Exits;
106}
107
108/// Places Babi's scholars, or Vale's villagers as the story has left them.
110 struct ScenePlacement *table;
111
112 if (gGameState.entrance == 19)
118 else
119 table = gValeBabi_Placements;
121 return table;
122}
123
124/// A scholar asks whether the party knows Kraden.
125/// Reached by talking to scholar 9 in Babi's scholars' room (entrance 19) once
126/// FLAG_COLOSSO_OVER is set; speakerId is the actor spoken to.
127static void Event_ScholarAsksAboutKraden(s32 speakerId) {
128 s32 firstMessage = MsgValeFolksSeemKnow;
129
130 Engine_EventSetMessage(firstMessage);
131 Engine_EventOpenMessage(speakerId, 0);
132 if (Engine_EventChooseYesNo(0, 0) == 0) {
134 Engine_EventSetMessage(firstMessage + 1);
135 } else {
136 Engine_EventSetMessage(firstMessage + 2);
137 }
138 Engine_EventShowMessage(speakerId, 0);
139}
140
141/// Chooses the events: Babi's scholars talk differently once the Colosso
142/// finals are over; Vale's villagers follow the storm and the story.
143const struct SceneEvent *ValeBabi_GetEvents(void) {
144 if (gGameState.entrance == 19) {
147 }
149 }
150
153 }
156 }
159 }
160 return gValeBabi_Events;
161}
162
163/// The neighbour asks whether Isaac has business with him, and sends him off
164/// either way. "Hey... Boy..."
165/// Reached by talking to the neighbour (actor 16) before the party leaves
166/// Vale (gValeBabi_Events).
167static void Event_AskIsaacHisBusiness(void) {
171 Engine_EventSetMessage(MsgValeHeyBoy);
180 if (Engine_EventChooseYesNo(0, 0) == 1) {
182 }
187}
188
189/// A villager asks whether the masked man was Felix, and wonders whether
190/// Jenna can be trusted.
191/// Reached by talking to actor 14 once the party has left Vale and until it
192/// reaches Kalay (gValeBabi_EventsAfterLeaving).
194 struct EventWork *work;
195
198 Engine_EventSetMessage(MsgValeTheMaskedManWasFelix);
200 if (Engine_EventChooseYesNo(0, 0) == 0) {
202 } else {
203 work = gEventWork;
204 work->message = (work->message + 1);
205 Engine_EventAskYesNo(0xE, 0);
206 }
208}
209
210/// Stops storm lightning before fading through the requested exit.
211/// Called by the exit events below.
212static void ValeBabi_CloseScreenAndExit(s32 exitId) {
215 }
220}
221
222// The exit events: stepping on the cell code of the same number in any of the
223// Vale tables plays a step sound and takes that exit (gValeBabi_Exits, or
224// gValeBabi_StormExits on the stormy night).
225
226/// Reached by cell code 1; takes exit 1, to ValeHome's entrance 6.
227static void Event_ExitNorthwestArea(void) {
230}
231
232/// Reached by cell code 2; takes exit 2, to Kraden's cottage (ValeKraden's
233/// entrance 3).
234static void Event_ExitNorthArea(void) {
237}
238
239/// Reached by cell code 3; takes exit 3, to ValeHome's entrance 2.
240static void Event_ExitNortheastArea(void) {
243}
244
245/// Reached by cell code 4; takes exit 4, to ValeHome's entrance 7.
246static void Event_ExitWestAreaSouth(void) {
249}
250
251/// Reached by cell code 5; takes exit 5, to this scene's entrance 8.
252static void Event_ExitWestAreaNorth(void) {
255}
256
257/// Reached by cell code 6; takes exit 6, to Vale's entrance 8, or on the
258/// stormy night to ValeStorm's.
259static void Event_ExitCenterAreaSouth(void) {
262}
263
264/// Reached by cell code 7; takes exit 7, to this scene's entrance 9.
265static void Event_ExitCenterAreaNorth(void) {
268}
269
270/// Reached by cell code 8; takes exit 8, to this scene's entrance 5.
271static void Event_ExitSouthwestArea(void) {
274}
275
276/// Reached by cell code 9; takes exit 9, to this scene's entrance 7.
277static void Event_ExitSouthAreaWest(void) {
280}
281
282/// Reached by cell code 10; takes exit 10, to ValeStorm's entrance 12.
283static void Event_ExitSouthAreaSouth(void) {
286}
287
288/// Reached by cell code 11; takes exit 11, to ValeStorm's entrance 13.
289static void Event_ExitSoutheastArea(void) {
292}
293
294/// Sets up the stormy night or the villagers of the story, and plays the
295/// scenes of entrances 20 to 22.
296/// Called by Field_RunScene once the actors are placed. Entrance 20 sets
297/// FLAG_VALE_STORM before Event_DoraWakesIsaac; back from Kalay, Dora is put
298/// back in her sickbed unless FLAG_SCENE_TEMP_03 says she got up.
300 struct FieldActor *actor;
301
302 if (gGameState.entrance == 19) {
306 } else {
308 Engine_ActorSetPosition(11, 0, 0);
309 Engine_ActorSetPosition(12, 0, 0);
310 Engine_ActorSetPosition(13, 0, 0);
311 Engine_ActorSetPosition(14, 0, 0);
312 Engine_ActorSetPosition(15, 0, 0);
314 } else {
316 }
319 actor = Object_GetById(17);
321 if (gGameState.entrance == 6 || gGameState.entrance == 7) {
325 }
326 } else {
328 actor = Object_GetById(ACTOR_DORA);
331 }
332 }
333 } else {
334 if (gGameState.entrance == 21) {
336 } else {
337 if (gGameState.entrance == 20) {
340 } else {
341 if (gGameState.entrance == 22) {
343 } else {
348 ((struct FieldBlendWork *)WORK_SLOT(30))->loud = 1;
350 Engine_TaskWait(30);
354 } else {
357 }
358 }
359 }
360 }
361 }
362 }
363 return 0;
364}
365
366/// Dora wakes Isaac on the stormy night, makes him take his tunic, and leads
367/// him out into the storm. "The Mt. Aleph Boulder is going to fall!"
368/// Called by ValeBabi_Initialize on arrival by entrance 20, where a new game
369/// begins. Sets FLAG_ISAAC_WEARS_TUNIC and takes exit 20, back into this
370/// scene by entrance 21, where Event_HurryToThePlaza follows.
371static void Event_DoraWakesIsaac(void) {
372 s32 firstMessage;
373 struct AnimationObject *sprite;
374 struct MapScrollWork *mapWork;
375 struct FieldActor *viewCenter;
376 struct EventWork **eventSlot;
377
378 eventSlot = (struct EventWork **)Ram_EventWork;
379 /* FAKEMATCH(temporary): the event record read into a block-local before
380 the map work and view centre; as reads in place, 11 of 430 instructions
381 differ in tbs-en (13 with the view centre first). */
382 {
383 struct EventWork *event = *eventSlot;
384
385 mapWork = *(struct MapScrollWork **)Ram_MapWork;
386 viewCenter = event->viewCenter;
387 }
388 sprite = Object_GetById(17)->sprite;
389 // Present the bedside conversation before revealing the wider storm scene.
391 Engine_ActorSetPosition(11, 0, 0);
392 Engine_ActorSetPosition(12, 0, 0);
393 Engine_ActorSetPosition(13, 0, 0);
394 Engine_ActorSetPosition(14, 0, 0);
395 Engine_ActorSetPosition(15, 0, 0);
397 // Isaac lies asleep in bed (animation 18); actor 17 is set beside him.
400 sprite->rotation = 1365;
403 Engine_ActorSetPosition(17, PIXELS(576), PIXELS(650));
407 // On a dark screen, Dora's voice: "Isaac, wake up!" "Please, dear, wake up!"
409 firstMessage = MsgValeWake;
410 UiText_ShowCenteredMessage(firstMessage, 1, 0);
414 UiText_ShowCenteredMessage(firstMessage + 1, 1, 0);
417 // Widen the camera bounds and reveal the lightning outside.
418 mapWork->minX = PIXELS(328);
419 mapWork->minY = PIXELS(600);
420 mapWork->maxX = PIXELS(624);
421 mapWork->maxY = PIXELS(816);
422 viewCenter->x.fixed = PIXELS(564);
423 viewCenter->y.fixed = 0;
424 viewCenter->z.fixed = PIXELS(691);
427 (*eventSlot)->startTransition = SCENE_TRANSITION(TRANSITION_WINDOW, 9);
428 (*eventSlot)->transitionFrames = 64;
430 (*(struct FieldBlendWork **)((u8 *)eventSlot + Ram_SceneMapStateOffset))
431 ->loud = 1;
433 Engine_TaskWait(30);
437 // "The Mt. Aleph Boulder is going to fall!" "Come on, Isaac. We have to go
438 // now!"
440 Engine_EventSetMessage(firstMessage + 2);
450 // Isaac gets out of bed (animation 19) and jumps down beside Dora.
467 // "Isaac! You forgot something!" Catch's effect plays on Dora.
471 0);
473 // Resolve the Psynergy demonstration before the pair walks away together.
474 // "It's pouring outside! Don't go out without your tunic!" She steps up to
475 // him and he puts it on, with a flash and SE_RECOVERY.
498 Actor_SetSpeed(ACTOR_DORA, 0x18000, 0xc000);
499 Actor_SetSpeed(ACTOR_PARTY_LEADER, 0x18000, 0xc000);
511 // "Have you got everything you need?" Yes: "Good for you, Isaac."; no: "I'm
512 // sorry, but we don't have time..."
514 if (Engine_EventChooseYesNo(0, 0) == 0) {
515 (*eventSlot)->message++;
516 }
525 (*eventSlot)->startTransition = SCENE_TRANSITION(TRANSITION_WINDOW, 1);
526 (*eventSlot)->transitionFrames = 16;
530}
531
532/// Selects the hardware blend targets for the storm sequence.
533static __inline__ void SetBlendTarget(u32 value) { REG_BLDCNT = value; }
534
535static __inline__ void SetBlendAlpha(u32 value) { REG_BLDALPHA = value; }
536
537/// Kyle calls to Isaac and Dora to hurry; actor 10 shakes, falls and
538/// fades as they run to the plaza.
539/// Called by ValeBabi_Initialize on arrival by entrance 21, after
540/// Event_DoraWakesIsaac. Takes exit 21, to ValeStorm's entrance 15, where
541/// Event_DoraSendsIsaacToThePlaza follows.
542static void Event_HurryToThePlaza(void) {
543 struct FieldActor *actor;
544 struct AnimationObject *sprite;
545 u32 i;
546 volatile u16 *alpha;
547
548 actor = Object_GetById(10);
549 sprite = actor->sprite;
551 // The villagers stay out of sight; actor 10 starts shaking on the slope.
552 Engine_ActorSetPosition(11, 0, 0);
553 Engine_ActorSetPosition(12, 0, 0);
554 Engine_ActorSetPosition(13, 0, 0);
555 Engine_ActorSetPosition(14, 0, 0);
556 Engine_ActorSetPosition(15, 0, 0);
559 Engine_ActorSetPosition(10, PIXELS(463), PIXELS(404));
562 actor->motionFlags = 0;
563 sprite->image.priority = 1;
567 Map_CopyCellsTo(83, 15, 83, 19, 5, 4);
568 Map_CopyCellsTo(90, 16, 90, 20, 5, 4);
569 Map_CopyCellsTo(77, 23, 82, 23, 5, 7);
570 Map_CopyCellsTo(83, 33, 85, 33, 2, 2);
571 Map_CopyCellsTo(91, 28, 90, 28, 1, 1);
572 Map_CopyCellsTo(91, 28, 88, 30, 1, 1);
573 Map_CopyCellsTo(94, 27, 94, 23, 6, 4);
574 Map_CopyCellsTo(92, 28, 87, 23, 4, 4);
575 Map_CopyCellsTo(65, 53, 88, 24, 2, 2);
580 ((struct FieldBlendWork *)WORK_SLOT(30))->loud = 1;
582 Engine_TaskWait(30);
583 // Dora and Isaac run out of the house (SE_DOOR_OPEN).
585 Actor_SetSpeed(ACTOR_DORA, 0x18000, 0xc000);
586 Actor_SetSpeed(ACTOR_PARTY_LEADER, 0x18000, 0xc000);
587 Actor_SetSpeed(ACTOR_KYLE, 0x18000, 0xc000);
596 // The camera finds Kyle coming up the path: "Isaac, Dora, hurry! The
597 // Boulder could fall at any second!"
598 Camera_SetSpeed(PIXELS(4), 0x8000);
599 Camera_MoveTo(PIXELS(414), -1, PIXELS(530), 1);
603 Engine_EventSetMessage(MsgValeDoraHurryBoulder);
605 Engine_CameraSetSpeed(0x18000, 0x3000);
606 Engine_CameraMoveTo(PIXELS(480), -1, PIXELS(444), 1);
609 // They nod, Kyle runs back down, and the two turn back (SE_234).
620 // Actor 10 drops (gValeBabi_Actor10FallsScript) and lands with SE_202.
622 alpha = &REG_BLDALPHA;
623
624 // Bring the boulder fully into view before fading it away.
625 i = 0;
626ramp:
627 *alpha = 0x100e + i;
629 if (++i <= 3)
630 goto ramp;
632 Engine_TaskWait(10);
633 for (i = 0; i <= 15; i++) {
634 SetBlendAlpha(0x100f - i);
636 }
637 // Dora and Isaac look back, startled, then nod to each other.
653 Engine_CameraSetSpeed(0xcccc, 0x1999);
663}
664
665/// The innkeeper offers a room from behind the counter; elsewhere talks of the
666/// travelers, the eruption, or, back from Kalay, welcomes Isaac home.
667/// Reached by talking to the innkeeper (actor 13) in every Vale table but the
668/// storm's, and back from Kalay by Mind Read on him until he has welcomed
669/// Isaac. Sets FLAG_VALE_INNKEEPER_WELCOMED_ISAAC on that welcome.
670static void Event_TalkToInnkeeper(void) {
671 struct FieldActor *actor;
672
674 if ((u32)(actor->facing + -0x2000) > 0x9000) {
676 } else {
682 Engine_EventSetMessage(MsgValeCameBack2);
685 }
686 Engine_EventSetMessage(MsgValeHomeJustToStay);
689 } else {
691 Engine_EventSetMessage(MsgValeTheVisitorsCausedTheEruption);
692 } else {
693 Engine_EventSetMessage(MsgValeTheThreeTravelersSeemOdd);
694 }
696 }
698 }
699}
700
701/// Back from Kalay, the neighbour remarks how much Isaac has grown.
702/// Reached by talking to the neighbour (actor 16) while
703/// FLAG_VALE_INNKEEPER_WELCOMED_ISAAC is clear, or by Mind Read on him until
704/// FLAG_VALE_NEIGHBOR_SAW_ISAAC_GROWN is set, which this sets. XXX: the talk
705/// row tests the innkeeper's flag, not this one; likely a slip, because the
706/// Mind Read row tests this one, but both show the same line.
710 Engine_EventSetMessage(MsgValeYouveGrownSoMuch);
715}
716
717/// Mind Read on the innkeeper: Dora would not let Isaac stay in Vale.
718/// Reached back from Kalay once he has welcomed Isaac. Sets
719/// FLAG_READ_THOUGHTS_ABOUT_DORA.
722 Engine_EventSetMessage(MsgValeDoraWouldntLetHimStay);
726}
727
728/// Mind Read on the neighbour: Dora was struck with illness.
729/// Reached back from Kalay once he has remarked on Isaac. Sets
730/// FLAG_READ_THOUGHTS_ABOUT_DORA.
733 Engine_EventSetMessage(MsgValeDoraWasStruckWithIllness);
737}
738
739/// Back from Kalay, Isaac visits Dora in her sickbed; she asks who told him she
740/// was ill, then gets up to show she feels well.
741/// Reached by talking to Dora (actor 8), or by Mind Read on her, until
742/// FLAG_VISITED_SICK_DORA is set. Sets it and FLAG_SCENE_TEMP_03.
743static void Event_VisitSickDora(void) {
744 struct FieldActor *leader;
745 s32 firstMessage;
746
748 // Isaac steps up to the bed. "Cough, cough! Who is it? Is it the innkeeper?"
749 Actor_SetSpeed(ACTOR_PARTY_LEADER, 0x9999, 0x4ccc);
753 Engine_EventSetMessage(MsgValeCoughCoughWho);
760 Actor_SetSpeed(ACTOR_DORA, 0xcccc, 0x6666);
761 // Bring Dora out of bed before asking about her illness.
769 // "Isaac..." "Are you finally home? Have you completed your mission!?"
778 // "You haven't, have you?" "Have you forgotten your promise, Isaac?"
787 // "You promised you wouldn't come back until your quest was complete,
788 // right?" Either reply has its own answer; she is less surprised when Mind
789 // Read has told Isaac of her illness.
791 if (Engine_EventChooseYesNo(0, 0) == 1) {
792 gEventWork->message += 1;
793 }
796 }
800 // Branch on Isaac's replies and whether Mind Read revealed her illness.
801 firstMessage = MsgValeWhoToldIll;
802 Engine_EventSetMessage(firstMessage);
804 if (Engine_EventChooseYesNo(0, 0) == 1) {
805 gEventWork->message += 1;
806 }
809 }
813 // "You can't get out of your promises just because you're worried about
814 // me." "I just caught a cold." "But I'm fine now. Look!"
815 Engine_EventSetMessage(firstMessage + 3);
827 // Make room for Dora to walk and demonstrate that she feels well.
828 // Isaac steps back as Dora gets up, turns about and jumps three times.
830 leader->facing = 0;
834 Actor_SetSpeed(ACTOR_DORA, 0x13333, 0x9999);
848 // "See? I'm fine!" "Don't worry about me. Go on."
850 Actor_SetSpeed(ACTOR_DORA, 0x6666, 0x3333);
859}
860
861/// Talking to Dora: in her sickbed she murmurs Kyle's name; once up, she tells
862/// Isaac not to worry.
863/// Reached by talking to her back from Kalay once FLAG_VISITED_SICK_DORA is
864/// set; she is up while FLAG_SCENE_TEMP_03 is set.
865static void Event_TalkToDora(void) {
866 s32 message;
867
874 Engine_EventSetMessage(MsgValeDontWorryBest);
876 } else {
879 message = MsgValeUnnOhhKyle;
880 Engine_EventSetMessage(message);
882 Engine_MessageShowCentered((message + 1), 1);
883 }
885}
886
887/// Restores the room's tiles and collision patch outside the storm sequence.
888/// Called by ValeBabi_Initialize when FLAG_VALE_STORM is clear.
889static void ValeBabi_RestoreRoomPatch(void) {
890 Map_CopyCellsTo(22, 85, 25, 85, 2, 2);
891 Map_CopyCellAttributes(25, 15, 2, 2, 25, 25);
892}
893
894/// The Mythril Bag rises and wobbles before Kraden, with no text.
895/// Called by ValeBabi_Initialize on arrival by entrance 22, from Kraden's
896/// cottage, while he prepares for the first Sol Sanctum visit
897/// (Event_TalkToKraden). Takes exit 22 back outside (ValeKraden's entrance 10),
898/// where Event_KradenSetsOff gathers the party.
899static void Event_ShowMythrilBag(void) {
900 struct FieldActor *actor;
901 struct AnimationObject *sprite;
902 GlyphTransfer *glyph;
903 u8 clear;
904
906 Camera_MoveTo(-1, -1, -1, 0);
912 clear = 0;
913 actor = Engine_ObjectCreate(22, PIXELS(328), PIXELS(2), PIXELS(195));
914 actor->motionFlags = clear;
915 sprite = actor->sprite;
916 actor->y.fixed = PIXELS(5);
917 sprite->count = clear;
918 sprite->image.fullColor = 0;
919 sprite->image.palette = 0;
920 // Load the item icon into the temporary actor before animating the bag.
921 glyph = Engine_HeapAllocate(17, sizeof(*glyph));
923 Engine_VramLoad(sprite->slot, 128, glyph->tiles);
927 // Walk the presenter into view, then wait for both bag scripts to finish.
944}
945
946/// Flashes between two palettes and emits a paired effect every sixteen frames.
947UNUSED static void
949 if ((gFrameCount & 2) != 0) {
951 } else {
953 }
954 if ((gFrameCount & 15) == 0) {
956 }
957}
958
959/// Cycles six palettes on odd frames and periodically emit paired effects.
961 if ((gFrameCount & 1) != 0) {
962 Engine_ObjectSetPartPalettes(&object->actor, (gFrameCount >> 1) % 6);
963 }
964 if ((gFrameCount & 15) == 0) {
966 }
967}
968
969/// Advances deterministically through six palettes on odd frames.
971 if ((gFrameCount & 1) != 0) {
972 s32 slot = (gFrameCount >> 1) % 6;
973
975 }
976}
977
978// Shared vertical-effect callbacks precede their paired-effect creator.
980
981/// Copies the parent's terrain height into two oppositely moving vertical
982/// effects.
983static void ValeBabi_SpawnEffectPair(union FieldObject *object) {
984 struct FieldActor *parent = &object->actor;
985 struct FieldActor *pair[2];
986 struct FieldActor *child;
987 struct AnimationObject *part;
988 struct AnimationObject *sprite;
989 struct BattleFxScene *work = gEffectWork;
990 s32 effectIndex;
991
992 for (effectIndex = 0; effectIndex < 2; ++effectIndex) {
993 child = Engine_ObjectCreate(26, parent->x.fixed, parent->y.fixed,
994 parent->z.fixed);
995 pair[effectIndex] = child;
996 if (child != NULL) {
997 child->terrainHeight = parent->terrainHeight;
998 part = child->sprite;
999 child->motionFlags = 0;
1000 child->timer = 0;
1001 child->linkedObject = parent;
1002 if (part != NULL) {
1003 sprite = part;
1004 Object_InitializeMode(part, 0);
1005 sprite->flags = 0;
1006 Resource_ResetEntry(sprite->slot);
1007 sprite->slot = work->tileSlot;
1008 sprite->retainCacheEntry = 1;
1009 sprite->image.tile =
1010 (gVramBlockCache[sprite->slot].offset >> 5) & 0x3ff;
1011 sprite->image.fullColor = 0;
1012 sprite->image.shape = 1;
1013 part->image.size = 2;
1014 part->entries[0]->frame = 0;
1015 }
1016 }
1017 }
1018 {
1019 struct FieldActor *effectActor = pair[0];
1020 struct AnimationObject *effectSprite = effectActor->sprite;
1021
1022 effectActor->update = Effect_AnimateVerticalNegative;
1023 effectSprite->image.priority = 2;
1024 }
1025 {
1026 struct FieldActor *effectActor = pair[1];
1027 struct AnimationObject *effectSprite = effectActor->sprite;
1028
1029 effectSprite->image.priority = 2;
1030 effectActor->update = Effect_AnimateVerticalPositive;
1031 effectActor->priorityFlags = 2;
1032 }
1033}
1034
1035// Shared Psynergy setup precedes the scene's effect wrappers.
1036#include "common/effect_psynergy.h"
1037
1040}
1041
1044}
1045
1046/// Catch's effect plays on Dora, then its objects are released.
1047/// Called by Event_DoraWakesIsaac as Dora hands Isaac his tunic.
1048static void ValeBabi_DemonstrateCatch(void) {
1055}
1056
1058 SC_ARG(2), SC_MOVE(PIXELS(522), 0, PIXELS(748)),
1059 SC_SYNC, SC_MOVE(PIXELS(419), 0, PIXELS(748)),
1060 SC_SYNC, SC_MOVE(PIXELS(419), 0, PIXELS(691)),
1061 SC_SYNC, SC_ARG(1),
1062 SC_END,
1063};
1064
1066 SC_ARG(2), SC_MOVE(PIXELS(387), 0, PIXELS(661)), SC_SYNC, SC_POS(0, 0, 0),
1067 SC_END,
1068};
1069
1071 SC_ARG(2), SC_MOVE(PIXELS(408), 0, PIXELS(661)),
1072 SC_SYNC, SC_MOVE(PIXELS(387), 0, PIXELS(661)),
1073 SC_SYNC, SC_POS(0, 0, 0),
1074 SC_END,
1075};
1076
1078 SC_ARG(2), SC_MOVE(PIXELS(468), 0, PIXELS(390)),
1079 SC_SYNC, SC_MOVE(PIXELS(508), 0, PIXELS(402)),
1080 SC_SYNC, SC_ARG(1),
1081 SC_END,
1082};
1083
1085 SC_ARG(2), SC_MOVE(PIXELS(431), 0, PIXELS(391)),
1086 SC_SYNC, SC_MOVE(PIXELS(468), 0, PIXELS(390)),
1087 SC_SYNC, SC_MOVE(PIXELS(486), 0, PIXELS(393)),
1088 SC_SYNC, SC_ARG(1),
1089 SC_END,
1090};
1091
1093 SC_ARG(2), SC_MOVE(PIXELS(525), 0, PIXELS(414)),
1094 SC_SYNC, SC_MOVE(PIXELS(509), 0, PIXELS(442)),
1095 SC_SYNC, SC_MOVE(PIXELS(455), 0, PIXELS(450)),
1096 SC_SYNC, SC_ARG(1),
1097 SC_END,
1098};
1099
1101 SC_ARG(2), SC_MOVE(PIXELS(525), 0, PIXELS(414)),
1102 SC_SYNC, SC_MOVE(PIXELS(509), 0, PIXELS(442)),
1103 SC_SYNC, SC_MOVE(PIXELS(481), 0, PIXELS(443)),
1104 SC_SYNC, SC_ARG(1),
1105 SC_END,
1106};
1107
1109 SC_ARG(2), SC_MOVE(PIXELS(428), 0, PIXELS(460)),
1110 SC_SYNC, SC_MOVE(PIXELS(415), 0, PIXELS(513)),
1111 SC_SYNC, SC_MOVE(PIXELS(415), 0, PIXELS(589)),
1112 SC_SYNC, SC_END,
1113};
1114
1116 SC_SET(SW_SCALE_X, 0xe666), SC_SET(SW_SCALE_Y, 0x10000), SC_WAIT(4),
1117 SC_SET(SW_SCALE_X, 0xcccc), SC_SET(SW_SCALE_Y, 0xcccc), SC_WAIT(4),
1119};
1120
1122 SC_ARG(2),
1123 SC_SET(SW_SCALE_X, 0x10000),
1124 SC_SET(SW_SCALE_Y, 0x13333),
1125 SC_WAIT(3),
1126 SC_SET(SW_SCALE_X, 0xcccc),
1127 SC_SET(SW_SCALE_Y, 0xcccc),
1128 SC_LABEL(1),
1129 SC_ADD(SW_SCALE_X, 1310),
1130 SC_ADD(SW_SCALE_Y, 1310),
1131 SC_WAIT(1),
1132 SC_LOOP(8, SC_TO(1)),
1133 SC_LABEL(2),
1134 SC_ADD(SW_Y, -0x1999),
1135 SC_ADD(SW_TARGET_Y, -0x1999),
1136 SC_ADD(SW_SCALE_X, -655),
1137 SC_ADD(SW_SCALE_Y, 2621),
1138 SC_WAIT(1),
1139 SC_LOOP(14, SC_TO(2)),
1140 SC_SET(SW_Y, PIXELS(8)),
1142 SC_LABEL(3),
1143 SC_ADD(SW_Y, 0x7333),
1144 SC_ADD(SW_TARGET_Y, 0x7333),
1145 SC_ADD(SW_SCALE_X, 65),
1146 SC_ADD(SW_SCALE_Y, -1310),
1147 SC_WAIT(1),
1148 SC_LOOP(40, SC_TO(3)),
1149 SC_POS(0, 0, 0),
1150 SC_ARG(1),
1151 SC_END,
1152};
1153
1155 SC_CALL(Scene_TurnTowardTarget),
1157 SC_MOVE(PIXELS(567), 0, PIXELS(690)),
1158 SC_SYNC,
1159 SC_MOVE(PIXELS(543), 0, PIXELS(674)),
1160 SC_SYNC,
1161 SC_END,
1162};
1163
1165 SC_ADD(SW_Y, 0x8000),
1166 SC_WAIT(1),
1167 SC_LOOP(16, SC_TOP),
1168};
1169
1171 SC_ADD(SW_SCALE_X, -0x4000),
1172 SC_ADD(SW_SCALE_Y, 0x2000),
1173 SC_WAIT(2),
1174 SC_ADD(SW_SCALE_X, 0x2000),
1175 SC_ADD(SW_SCALE_Y, -0x1000),
1176 SC_WAIT(2),
1177 SC_ADD(SW_SCALE_X, 0x1000),
1178 SC_ADD(SW_SCALE_Y, -2048),
1179 SC_WAIT(2),
1180 SC_ADD(SW_SCALE_X, 0x1000),
1181 SC_ADD(SW_SCALE_Y, -2048),
1182 SC_WAIT(4),
1183 SC_ADD(SW_SCALE_X, -0x4000),
1184 SC_ADD(SW_SCALE_Y, 0x2000),
1185 SC_WAIT(2),
1186 SC_ADD(SW_SCALE_X, 0x2000),
1187 SC_ADD(SW_SCALE_Y, -0x1000),
1188 SC_WAIT(2),
1189 SC_ADD(SW_SCALE_X, 0x1000),
1190 SC_ADD(SW_SCALE_Y, -2048),
1191 SC_WAIT(2),
1192 SC_ADD(SW_SCALE_X, 0x1000),
1193 SC_ADD(SW_SCALE_Y, -2048),
1194 SC_WAIT(4),
1195 SC_END,
1196};
1197
1199 {0, CONDITION_ALWAYS, 120, 0, 100, FACING_SOUTH, 0, -1, -1, -1, -1, 0},
1200 {1, CONDITION_ALWAYS, 160, 0, 228, FACING_NORTH, 0, 24, 0, 248, 256, 0},
1201 {2, CONDITION_ALWAYS, 480, 0, 176, FACING_NORTH, 0, 264, 8, 560, 240, 0},
1202 {3, CONDITION_ALWAYS, 721, 0, 192, FACING_NORTH, 0, 584, 0, 848, 224, 0},
1203 {4, CONDITION_ALWAYS, 144, 0, 494, FACING_NORTH, 0, 8, 256, 320, 528, 0},
1204 {5, CONDITION_ALWAYS, 119, 0, 340, FACING_SOUTH, 0, 8, 256, 320, 528, 0},
1205 {6, CONDITION_ALWAYS, 416, 0, 528, FACING_NORTH, 0, 344, 272, 640, 560, 0},
1206 {7, CONDITION_ALWAYS, 408, 0, 371, FACING_SOUTH, 0, 344, 272, 640, 560, 0},
1207 {8, CONDITION_ALWAYS, 184, 0, 633, FACING_EAST, 0, 8, 576, 320, 736, 0},
1208 {9, CONDITION_ALWAYS, 408, 0, 665, FACING_EAST, 0, 328, 600, 624, 816, 0},
1209 {10, CONDITION_ALWAYS, 528, 0, 683, FACING_SOUTH, 0, 328, 600, 624, 816, 0},
1210 {11, CONDITION_ALWAYS, 705, 0, 817, FACING_NORTH, 0, 640, 552, 952, 864, 0},
1211 {12, CONDITION_ALWAYS, 879, 0, 765, FACING_NORTH, 0, 640, 552, 952, 864, 0},
1212 {16, CONDITION_ALWAYS, 538, 0, 683, FACING_SOUTH, 0, 328, 600, 624, 816, 0},
1213 {19, CONDITION_ALWAYS, 760, 0, 328, FACING_SOUTH, 0, 672, 272, 960, 488, 0},
1214 {20, CONDITION_ALWAYS, 567, 0, 676, FACING_EAST, 0, 1024, 576, 1024, 576,
1215 0},
1216 {21, CONDITION_ALWAYS, 408, 0, 371, FACING_SOUTH, 0, 344, 272, 640, 560, 0},
1217 {22, CONDITION_ALWAYS, 480, 0, 176, FACING_NORTH, 0, 264, 8, 560, 240, 0},
1219};
1220
1222 SCENE_EXITS(8), SCENE_EXIT(1, 5, 6), SCENE_EXIT(2, 6, 3),
1223 SCENE_EXIT(3, 5, 2), SCENE_EXIT(4, 5, 7), SCENE_EXIT(5, 8, 8),
1224 SCENE_EXIT(6, 4, 8), SCENE_EXIT(7, 8, 9), SCENE_EXIT(8, 8, 5),
1225 SCENE_EXIT(9, 8, 7), SCENE_EXIT(10, 3, 12), SCENE_EXIT(11, 3, 13),
1226 SCENE_EXIT(19, 138, 11), SCENE_EXIT(20, 8, 21), SCENE_EXIT(21, 3, 15),
1227 SCENE_EXIT(22, 6, 10), SCENE_EXITS_END,
1228};
1229
1231 SCENE_EXITS(8), SCENE_EXIT(1, 5, 6), SCENE_EXIT(2, 6, 3),
1232 SCENE_EXIT(3, 5, 2), SCENE_EXIT(4, 5, 7), SCENE_EXIT(5, 8, 8),
1233 SCENE_EXIT(6, 3, 8), SCENE_EXIT(7, 8, 9), SCENE_EXIT(8, 8, 5),
1234 SCENE_EXIT(9, 8, 7), SCENE_EXIT(10, 3, 12), SCENE_EXIT(11, 3, 13),
1235 SCENE_EXIT(20, 8, 21), SCENE_EXIT(21, 3, 15), SCENE_EXITS_END,
1236};
1237
1238// clang-format off
1241 0, 0, 0, FACING_EAST, TALK_FACE_PARTY, 0 },
1243 0, 0, 0, FACING_NORTH, TALK_FACE_PARTY, 0 },
1245 0, 0, 0, FACING_NORTH, TALK_FACE_PARTY, 0 },
1246 { 0x6c, 0x0, ACTOR_STAND,
1247 PIXELS(151), 0, PIXELS(152), FACING_SOUTH, TALK_FACE_PARTY, 0 },
1248 { 0x78, 0x0, ACTOR_WANDER,
1249 PIXELS(87), 0, PIXELS(67), FACING_WEST, TALK_FACE_PARTY, 0 },
1250 { 0x80, 0x0, ACTOR_STAND,
1252 { 0x6c, 0x0, ACTOR_WANDER,
1254 { 0x6a, 0x0, ACTOR_STAND,
1256 { 0x22, 0x0, ACTOR_STAND,
1259 0, 0, 0, FACING_NORTHEAST, TALK_KEEP_FACING, 0 },
1261 0, 0, 0, FACING_SOUTH, TALK_KEEP_FACING, 0 },
1262 { SCENE_TABLE_END },
1263};
1264
1267 0, 0, 0, FACING_EAST, TALK_FACE_PARTY, 0 },
1268 { 0x35, 0x0, ACTOR_STAND,
1269 0, 0, 0, FACING_NORTH, TALK_FACE_PARTY, 0 },
1270 { 0xd0, 0x0, ACTOR_STAND,
1271 0, 0, 0, FACING_NORTH, TALK_FACE_PARTY, 0 },
1272 { 0x6c, 0x0, ACTOR_STAND,
1273 PIXELS(151), 0, PIXELS(152), FACING_SOUTH, TALK_FACE_PARTY, 0 },
1274 { 0x78, 0x0, ACTOR_WANDER,
1275 PIXELS(87), 0, PIXELS(67), FACING_WEST, TALK_FACE_PARTY, 0 },
1276 { 0x80, 0x0, ACTOR_STAND,
1277 PIXELS(246), 0, PIXELS(391), FACING_WEST, TALK_FACE_PARTY, 0 },
1278 { 0x6c, 0x0, ACTOR_WANDER,
1280 { 0x6a, 0x0, ACTOR_STAND,
1282 { SCENE_TABLE_END },
1283};
1284
1287 PIXELS(586), 0, PIXELS(406), FACING_EAST, TALK_KEEP_FACING, 0 },
1288 { 0x35, 0x0, ACTOR_STAND,
1289 0, 0, 0, FACING_NORTH, TALK_FACE_PARTY, 0 },
1290 { 0xd0, 0x0, ACTOR_STAND,
1291 0, 0, 0, FACING_NORTH, TALK_FACE_PARTY, 0 },
1292 { 0x6c, 0x0, ACTOR_STAND,
1293 PIXELS(151), 0, PIXELS(152), FACING_SOUTH, TALK_FACE_PARTY, 0 },
1294 { 0x78, 0x0, ACTOR_WANDER,
1295 PIXELS(87), 0, PIXELS(67), FACING_WEST, TALK_FACE_PARTY, 0 },
1296 { 0x80, 0x0, ACTOR_STAND,
1297 PIXELS(246), 0, PIXELS(391), FACING_WEST, TALK_FACE_PARTY, 0 },
1298 { 0x6c, 0x0, ACTOR_WANDER,
1300 { 0x6a, 0x0, ACTOR_STAND,
1302 { 0x65, 0x0, ACTOR_STAND,
1304 { 0x16, 0x0, ACTOR_STAND,
1305 PIXELS(252), 0, PIXELS(378), FACING_SOUTH, TALK_FACE_PARTY, 0 },
1306 { SCENE_TABLE_END },
1307};
1308
1311 PIXELS(792), 0, PIXELS(336), FACING_NORTH, TALK_FACE_PARTY, 0 },
1317 PIXELS(728), 0, PIXELS(440), FACING_SOUTH, TALK_FACE_PARTY, 0 },
1319 PIXELS(832), 0, PIXELS(424), FACING_SOUTH, TALK_FACE_PARTY, 0 },
1320 { SCENE_TABLE_END },
1321};
1322
1335 { SEARCH(SEARCH_WOODEN_BOX), 100, CONDITION_ALWAYS, FIND_MESSAGE(MSGNO(MsgValeWoodenBoxEmpty)) },
1336 { SEARCH(SEARCH_JAR), 101, CONDITION_ALWAYS, FIND_MESSAGE(MSGNO(MsgValeJarEmpty)) },
1337 { SEARCH(SEARCH_BARREL), 102, CONDITION_ALWAYS, FIND_MESSAGE(MSGNO(MsgVaultButDidntFindAnything)) },
1338 { SEARCH(SEARCH_BOOKCASE), 206, CONDITION_ALWAYS, FIND_MESSAGE(MSGNO(MsgValeNotebookStudyOfAlchemy)) },
1339 { SEARCH(SEARCH_BOOKCASE), 207, CONDITION_ALWAYS, FIND_MESSAGE(MSGNO(MsgValeBookAncientLemurians)) },
1340 { SEARCH(SEARCH_BOOKCASE), 208, CONDITION_ALWAYS, FIND_MESSAGE(MSGNO(MsgValeBookFountainOfTolbi)) },
1341 { 0xc4f3, 209, CONDITION_ALWAYS, FIND_MESSAGE(MSGNO(MsgValeEncyclopediaOfAlchemy)) },
1342 { 0xc4f3, 210, CONDITION_ALWAYS, FIND_MESSAGE(MSGNO(MsgValeBookLegendOfAleph)) },
1343 { SEARCH(SEARCH_BOOKCASE), 211, CONDITION_ALWAYS, FIND_MESSAGE(MSGNO(MsgValeBookBeingAdept)) },
1344 { 0xc4f3, 212, CONDITION_ALWAYS, FIND_MESSAGE(MSGNO(MsgValeBookTravelersEtiquette)) },
1345 { SCENE_EVENTS_END },
1346};
1347
1349 { EVENT_TALK, 11, CONDITION_ALWAYS, MSGNO(MsgValeMyFatherAlsoDiedInThat) },
1350 { EVENT_TALK, 12, CONDITION_ALWAYS, MSGNO(MsgValeMySonIsStillYoungSo) },
1351 { EVENT_TALK, 14, CONDITION_ALWAYS, MSGNO(MsgValeOneOfTheMenFromThat) },
1352 { EVENT_TALK, 15, CONDITION_ALWAYS, MSGNO(MsgValeTwoOfThoseThreeGuestsStaying) },
1369 { SEARCH(SEARCH_BOOKCASE), 206, CONDITION_ALWAYS, FIND_MESSAGE(MSGNO(MsgValeNotebookStudyOfAlchemy)) },
1370 { SEARCH(SEARCH_BOOKCASE), 207, CONDITION_ALWAYS, FIND_MESSAGE(MSGNO(MsgValeBookAncientLemurians)) },
1371 { SEARCH(SEARCH_BOOKCASE), 208, CONDITION_ALWAYS, FIND_MESSAGE(MSGNO(MsgValeBookFountainOfTolbi)) },
1372 { 0xc4f3, 209, CONDITION_ALWAYS, FIND_MESSAGE(MSGNO(MsgValeEncyclopediaOfAlchemy)) },
1373 { 0xc4f3, 210, CONDITION_ALWAYS, FIND_MESSAGE(MSGNO(MsgValeBookLegendOfAleph)) },
1374 { SEARCH(SEARCH_BOOKCASE), 211, CONDITION_ALWAYS, FIND_MESSAGE(MSGNO(MsgValeBookBeingAdept)) },
1375 { 0xc4f3, 212, CONDITION_ALWAYS, FIND_MESSAGE(MSGNO(MsgValeBookTravelersEtiquette)) },
1376 { SCENE_EVENTS_END },
1377};
1378
1380 { EVENT_TALK, 11, CONDITION_ALWAYS, MSGNO(MsgValeComeBackAsAStrongWarrior) },
1381 { EVENT_TALK, 12, CONDITION_ALWAYS, MSGNO(MsgValeIWantedJennaToBeMy) },
1383 { EVENT_TALK, 15, CONDITION_ALWAYS, MSGNO(MsgValeWereASmallHotelAndWe) },
1385 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 11, CONDITION_ALWAYS, MSGNO(MsgValeIWillThinkOfJennaAs) },
1386 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 12, CONDITION_ALWAYS, MSGNO(MsgValeNowThatJennaIsGoneWe) },
1387 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 14, CONDITION_ALWAYS, MSGNO(MsgValeIWonderIfFelixChangedMuch) },
1388 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 15, CONDITION_ALWAYS, MSGNO(MsgValeFelixAndHisGangMustHave) },
1389 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), ACTOR_INNKEEPER, CONDITION_ALWAYS, MSGNO(MsgValeWhoCouldHaveKnownThatMasked) },
1404 { SEARCH(SEARCH_BOOKCASE), 206, CONDITION_ALWAYS, FIND_MESSAGE(MSGNO(MsgValeNotebookStudyOfAlchemy)) },
1405 { SEARCH(SEARCH_BOOKCASE), 207, CONDITION_ALWAYS, FIND_MESSAGE(MSGNO(MsgValeBookAncientLemurians)) },
1406 { SEARCH(SEARCH_BOOKCASE), 208, CONDITION_ALWAYS, FIND_MESSAGE(MSGNO(MsgValeBookFountainOfTolbi)) },
1407 { 0xc4f3, 209, CONDITION_ALWAYS, FIND_MESSAGE(MSGNO(MsgValeEncyclopediaOfAlchemy)) },
1408 { 0xc4f3, 210, CONDITION_ALWAYS, FIND_MESSAGE(MSGNO(MsgValeBookLegendOfAleph)) },
1409 { SEARCH(SEARCH_BOOKCASE), 211, CONDITION_ALWAYS, FIND_MESSAGE(MSGNO(MsgValeBookBeingAdept)) },
1410 { 0xc4f3, 212, CONDITION_ALWAYS, FIND_MESSAGE(MSGNO(MsgValeBookTravelersEtiquette)) },
1411 { SCENE_EVENTS_END },
1412};
1413
1415 { EVENT_TALK, 11, CONDITION_ALWAYS, MSGNO(MsgValeOwItsGonnaBeYearsBefore) },
1416 { EVENT_TALK, 12, CONDITION_ALWAYS, MSGNO(MsgValeWelcomeHomeIsaacOhWhatHappened) },
1417 { EVENT_TALK, 14, CONDITION_ALWAYS, MSGNO(MsgValeYouTraveledAroundTheEasternEdge) },
1418 { EVENT_TALK, 15, CONDITION_ALWAYS, MSGNO(MsgValeArentYouGladToSeeThe) },
1421 { EVENT_TALK, ACTOR_NEIGHBOR, CONDITION_ALWAYS, MSGNO(MsgValeYouveGrownSoMuch) },
1422 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 11, CONDITION_ALWAYS, MSGNO(MsgValeIPromisedIdBecomeAGreat) },
1423 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 12, CONDITION_ALWAYS, MSGNO(MsgValeThatShyGirlWithIsaacSure) },
1424 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 14, CONDITION_ALWAYS, MSGNO(MsgValeIWonderIfIsaacWillContinue) },
1425 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 15, CONDITION_ALWAYS, MSGNO(MsgValeValeWillNeverChangeSoYou) },
1433 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), ACTOR_DORA, FLAG_SCENE_TEMP_03, MSGNO(MsgValeKyleWatchOutTheBoulderThe) },
1434 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), ACTOR_DORA, CONDITION_ALWAYS, MSGNO(MsgValeImSorryISeemedSoHarsh) },
1449 { SEARCH(SEARCH_BOOKCASE), 206, CONDITION_ALWAYS, FIND_MESSAGE(MSGNO(MsgValeNotebookStudyOfAlchemy)) },
1450 { SEARCH(SEARCH_BOOKCASE), 207, CONDITION_ALWAYS, FIND_MESSAGE(MSGNO(MsgValeBookAncientLemurians)) },
1451 { SEARCH(SEARCH_BOOKCASE), 208, CONDITION_ALWAYS, FIND_MESSAGE(MSGNO(MsgValeBookFountainOfTolbi)) },
1452 { 0xc4f3, 209, CONDITION_ALWAYS, FIND_MESSAGE(MSGNO(MsgValeEncyclopediaOfAlchemy)) },
1453 { 0xc4f3, 210, CONDITION_ALWAYS, FIND_MESSAGE(MSGNO(MsgValeBookLegendOfAleph)) },
1454 { SEARCH(SEARCH_BOOKCASE), 211, CONDITION_ALWAYS, FIND_MESSAGE(MSGNO(MsgValeBookBeingAdept)) },
1455 { 0xc4f3, 212, CONDITION_ALWAYS, FIND_MESSAGE(MSGNO(MsgValeBookTravelersEtiquette)) },
1459 { SCENE_EVENTS_END },
1460};
1461
1463 { EVENT_TALK, 8, CONDITION_ALWAYS, MSGNO(MsgBabiOriginallyThereWereAncientRuinsAt) },
1464 { EVENT_TALK, 9, CONDITION_ALWAYS, MSGNO(MsgBabiNoMatterHowManyTimesI) },
1465 { EVENT_TALK, 10, CONDITION_ALWAYS, MSGNO(MsgBabiItIsSaidThatLongAgo) },
1466 { EVENT_TALK, 11, CONDITION_ALWAYS, MSGNO(MsgBabiOriginallyTheAncientVenusRuinsLay) },
1467 { EVENT_TALK, 12, CONDITION_ALWAYS, MSGNO(MsgBabiBabiMakesHisScholarsPerformAll) },
1468 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 8, CONDITION_ALWAYS, MSGNO(MsgBabiNoOneHasEverReachedThe) },
1469 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 9, CONDITION_ALWAYS, MSGNO(MsgBabiStillMyExperimentsInAlchemyAre) },
1470 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 10, CONDITION_ALWAYS, MSGNO(MsgBabiKradensJourneyWasMeantToRevive) },
1471 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 11, CONDITION_ALWAYS, MSGNO(MsgBabiTheVenusRuinsAreTheRemnants) },
1472 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 12, CONDITION_ALWAYS, MSGNO(MsgBabiLordBabiExpectedGreatResultsFrom) },
1473 { 0x21, 20, CONDITION_ALWAYS, 19 },
1475 { SEARCH(SEARCH_BOOKCASE), 207, CONDITION_ALWAYS, FIND_MESSAGE(MSGNO(MsgValeTheresABookEntitledEncyclopediaOf)) },
1476 { SEARCH(SEARCH_BOOKCASE), 208, CONDITION_ALWAYS, FIND_MESSAGE(MSGNO(MsgValeTheresANotebookEntitledExperimentsIn)) },
1477 { SEARCH(SEARCH_BOOKCASE), 209, CONDITION_ALWAYS, FIND_MESSAGE(MSGNO(MsgValeTheresANotebookEntitledStudyOf)) },
1478 { SCENE_EVENTS_END },
1479};
1480
1482 { EVENT_TALK, 8, CONDITION_ALWAYS, MSGNO(MsgBabiOnceBabiLighthouseIsCompleteId) },
1484 { EVENT_TALK, 10, CONDITION_ALWAYS, MSGNO(MsgBabiAlchemyTeachesThatTheFourElements) },
1485 { EVENT_TALK, 11, CONDITION_ALWAYS, MSGNO(MsgBabiIfTheRiddleOfTheVenus) },
1486 { EVENT_TALK, 12, CONDITION_ALWAYS, MSGNO(MsgBabiImSureKradenWouldStopBy) },
1487 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 8, CONDITION_ALWAYS, MSGNO(MsgBabiTheRelationshipBetweenAlchemyAndThe) },
1488 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 9, CONDITION_ALWAYS, MSGNO(MsgBabiIWantToSeeKradenAnd) },
1489 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 10, CONDITION_ALWAYS, MSGNO(MsgBabiTheresGotToBeAGood) },
1490 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 11, CONDITION_ALWAYS, MSGNO(MsgBabiWhatSortOfUnfathomableRiddlesAre) },
1491 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 12, CONDITION_ALWAYS, MSGNO(MsgBabiThereMustBeAReasonWhy) },
1492 { 0x21, 20, CONDITION_ALWAYS, 19 },
1494 { SEARCH(SEARCH_BOOKCASE), 207, CONDITION_ALWAYS, FIND_MESSAGE(MSGNO(MsgValeTheresABookEntitledEncyclopediaOf)) },
1495 { SEARCH(SEARCH_BOOKCASE), 208, CONDITION_ALWAYS, FIND_MESSAGE(MSGNO(MsgValeTheresANotebookEntitledExperimentsIn)) },
1496 { SEARCH(SEARCH_BOOKCASE), 209, CONDITION_ALWAYS, FIND_MESSAGE(MSGNO(MsgValeTheresANotebookEntitledStudyOf)) },
1497 { SCENE_EVENTS_END },
1498};
1499// clang-format on
Ability numbers, named from the English release.
@ ABILITY_MIND_READ
Definition ability_ids.h:16
@ ABILITY_CATCH
Definition ability_ids.h:23
void Object_RefreshSelectorById(u32 objectId)
Waits, at most 300 frames, for an actor's script to reach its end (command 0x10).
void Object_SetTargetAndCallback(u32 objectId, s32 targetId, const void *script)
Links an actor to the actor in the low 8 bits of targetId and starts script on it.
struct FieldActor * Object_GetById(s32 actor)
Returns an actor, or NULL if it does not exist.
@ ACTOR_INNKEEPER
Definition altin.c:82
Animated sprites: their layers, frames and colour modes, and the resource slots they draw from.
B5Context, the object context a battle routine reads; most of its fields are still unnamed.
s32 Object_InitializeMode(struct AnimationObject *state, s32 flags)
static void Event_TalkToInnkeeper(void)
Opens the inn across the counter, or discusses the curse in Kolima.
Calls through a function pointer, by argument count.
void Engine_ActorSetSpriteFlags(struct FieldActor *, s32)
struct FieldActor * Engine_ObjectCreate(s32, s32, s32, 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 ObjectDispatch_RegisterChildMetadata(struct DispatchObject *object, s32 animationId)
Adds a layer of animation id animationId to a one-sprite object's sprite.
Definition objects.c:426
void ObjectSystem_ResumeProjectionAndHideLayers(void)
Resumes the object camera updates and hides BG1-3 and the sprites.
Definition objects.c:566
void ObjectDispatch_WaitForValue16(void *rawObject)
Waits until the object's script reaches SC_END (0x10), at most 300 frames.
Definition objects.c:495
void ObjectSystem_SuspendProjectionAndShowSprites(void)
Suspends the object camera updates, starts the palette back to normal and, a frame later,...
Definition objects.c:552
void FieldScene_PrepareActors(struct ScenePlacement *entry)
Field effects, their scripts and the flags that spawn them.
The scene script layer: the engine services a scene's events call, declared once (Engine_EventBegin,...
@ ANIM_STAND
Definition field_event.h:43
@ ANIM_NOD
Definition field_event.h:45
@ ANIM_SHAKE_HEAD
Definition field_event.h:46
#define SPEAKER_PORTRAIT_LEFT
Definition field_event.h:54
static s32 Event_OpenMessage(s32 speaker, s32 flags)
void Engine_ActorFaceActor(s32 actor, s32 target, s32 frames)
static void Actor_SetDestination(s32 actor, s32 x, s32 z)
static void Actor_FaceDirection(s32 actor, s32 facing, s32 frames)
void Engine_ActorSetAnimationAndWait(s32 actor, s32 animation)
void Engine_ActorSetSpritePriority(s32 actor, s32 priority)
void Engine_PsynergyBegin(s32 ability, s32 flags)
static void Event_ShowMessageAndWait(s32 speaker, s32 flags, s32 frames)
s32 Engine_EventChooseYesNo(s32 actor, s32 flags)
void Engine_MessageShowCentered(s32 message, s32 flags)
void Engine_ObjectSetPartPalettes(struct FieldActor *object, s32 palette)
void Engine_EventShowMessageAndWait(s32 speaker, s32 flags, s32 frames)
#define GameFlag_IsSet
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_PsynergyRaiseHands(void)
void Engine_PsynergyLowerHands(void)
void Engine_ActorMoveToAndWait(s32 actor, s32 x, s32 z)
void Engine_ActorJump(s32 actor, s32 height, s32 frames)
void Engine_ItemLoadIcon(s32 item)
#define EMOTE_IN_FRONT
Definition field_event.h:49
static void Actor_MoveToAndWait(s32 actor, s32 x, s32 z)
void Engine_ActorFaceDirection(s32 actor, s32 facing, s32 frames)
void Engine_InnOpen(s32 inn, s32 keeper)
void Engine_EventCloseScreen(void)
void Engine_ObjectDispatchRelease(struct FieldActor *object)
void Engine_ActorSetDestination(s32 actor, s32 x, s32 z)
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)
void Engine_ActorWalkToAndWait(s32 actor, s32 x, s32 z)
static void Actor_FaceActor(s32 actor, s32 target, s32 frames)
#define SPEAKER_WINDOW_BELOW
Definition field_event.h:57
void Engine_HeapRelease(s32 slot)
s32 Engine_VramLoad(s32 block, s32 size, const void *data)
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_ObjectSetScript(struct FieldActor *object, const s32 *script)
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_CameraFollowActor(s32 actor, s32 keep_position)
void * Engine_HeapAllocate(s32 slot, s32 size)
static void Map_CopyCellAttributes(s32 srcX, s32 srcY, s32 width, s32 height, s32 destX, s32 destY)
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)
void Engine_ActorSetChildValue(s32 actor, s32 value)
static void Map_SetShake(s32 horizontal, s32 vertical, s32 decay)
Sets shake amplitudes in fixed-point pixels and the per-frame decay factor.
s32 Engine_GameFlagIsSet(s32 flag)
void Engine_PsynergyPlayEffect(s32 effect)
void Engine_ActorStartRepeatedMotion(s32 actor, s32 repeats)
static s32 Event_AskYesNo(s32 speaker, s32 flags)
static void Actor_SetSpeed(s32 actor, s32 speed, s32 acceleration)
void Engine_MapRedraw(void)
static void Camera_MoveTo(s32 fixed_x, s32 fixed_y, s32 fixed_z, s32 pan)
static void Actor_SetPosition(s32 actor, s32 fixed_x, s32 fixed_z)
void Engine_ActorFaceEachOther(s32 actor, s32 other, s32 frames)
void Engine_EventWait(s32 frames)
static void Actor_SetAttachedEffect(s32 actor, s32 effect)
void Engine_PsynergySetTarget(s32 caster, s32 target)
static void Object_SetScript(struct FieldActor *object, const s32 *script)
Field objects and actors, and the scene transition styles.
@ ACTOR_LINK_KEEP_MOTION
Definition field_obj.h:148
@ TRANSITION_WINDOW
Definition field_obj.h:17
@ TRANSITION_BACKDROP_FADE
Definition field_obj.h:16
@ ACTOR_PRIORITY_AUTOMATIC
The sprite takes its priority from the map cell under it.
Definition field_obj.h:153
#define SCENE_TRANSITION(style, variant)
Definition field_obj.h:20
@ 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_TALK
@ FACING_STEP
Definition field_scene.h:36
#define SCENE_EXITS(scene)
Definition field_scene.h:72
#define FIND_MESSAGE(message)
#define FIND_PSYNERGY_STONE
#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
@ FLAG_PARTY_LEFT_VALE
Definition field_scene.h:50
@ 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
@ FACING_NORTHEAST
Definition field_scene.h:33
@ FACING_EAST
Definition field_scene.h:26
@ 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_WOODEN_BOX
@ SEARCH_JAR
@ SEARCH_UNNAMED
@ SEARCH_BARREL
#define FIND_COINS(coins)
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_SHOW_LOCATION_NAME
Definition flags.h:94
#define FLAG_COLOSSO_OVER
the Colosso finals have been fought
Definition flags.h:191
#define FLAG_SCENE_TEMP_03
Definition flags.h:716
#define FLAG_VALE_BARREL_COIN
1 coin
Definition flags.h:515
#define FLAG_REACHED_KALAY
Set whenever Kalay is entered; Vale's villagers then talk of the party's journey.
Definition flags.h:441
#define FLAG_BABI_PALACE_HARD_NUT
A jar in the scholars' room, which is drawn on Vale's map (vale_babi.c).
Definition flags.h:213
#define FLAG_VALE_BARREL_COINS
123 coins
Definition flags.h:517
#define FLAG_VISITED_SICK_DORA
Isaac visited Dora in her sickbed and she got up.
Definition flags.h:510
#define FLAG_VALE_WOODEN_BOX_HERB
The containers, set once each is searched; the last three hold their finds only once the party is bac...
Definition flags.h:513
#define FLAG_VALE_STORM
The prologue's stormy night: lightning over Vale, the rockslide and the monsters loose in the village...
Definition flags.h:438
#define FLAG_KEEP_PARTY_POSITION
Definition flags.h:93
#define FLAG_VALE_JAR_COINS
5 coins
Definition flags.h:514
#define FLAG_ISAAC_WEARS_TUNIC
The young Isaac wears the tunic Dora made him take on the stormy night: placed child sprites get its ...
Definition flags.h:14
#define FLAG_VALE_PSYNERGY_STONE
Definition flags.h:518
#define FLAG_READ_THOUGHTS_ABOUT_DORA
Back from Kalay, Mind Read showed that Dora is ill.
Definition flags.h:508
#define FLAG_VALE_JAR_VIAL
Definition flags.h:516
volatile u32 gFrameCount
Frames WaitFrames has finished.
BattleFxScene, the work of a battle or field Psynergy effect scene, and its arc objects.
FieldBlendWork, the field's colour blend work.
GameState, the game's state: play time, coins, the scene and the leader's position,...
struct GameState gGameState
void * gEffectWork
Slot 56: points to a scene-specific structure.
Font glyphs and their palettes.
The screen blend's globals and the graphics routines.
The heap's work slots and HeapState.
@ HEAP_SLOT_EVENT
Definition heap_state.h:40
#define WORK_SLOT(n)
Reads slots through their own addresses; adjacent slots are reached by offsets.
Definition heap_state.h:14
The hardware's I/O registers and their bits, as pret names them.
#define BLDCNT_EFFECT_BLEND
weighted by REG_BLDALPHA
Definition io_reg.h:131
#define BLDCNT_TGT2_ALL
Definition io_reg.h:140
#define BLEND_ALPHA(top, bottom)
A REG_BLDALPHA value: top and bottom are the two targets' weights, out of 16.
Definition io_reg.h:145
#define BLDCNT_TGT1_BG1
Definition io_reg.h:124
#define REG_BLDALPHA
Definition io_reg.h:142
#define REG_BLDCNT
Definition io_reg.h:119
Io_Write16, a 16-bit write to a register or memory.
#define Io_Write16(v, reg)
Writes a value to a 16-bit register or memory location.
Definition iowrite.h:14
Item numbers, named from the English release.
@ ITEM_HARD_NUT
Definition item_ids.h:53
@ ITEM_VIAL
Definition item_ids.h:42
@ ITEM_HERB
Definition item_ids.h:40
@ ITEM_MYTHRIL_BAG
Definition item_ids.h:65
void DisplayBlend_SuspendScript(void)
Suspends the blend script.
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 map layers' scroll work and the background scroll values.
The reel game's title lettering.
Field object scripts: one s32 command word, then its operands, as gScriptObject_CommandTable runs the...
#define SC_LABEL(n)
Branch destination.
Definition objcmd.h:11
#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_POS(x, y, z)
Set position.
Definition objcmd.h:18
#define SC_SYNC
Wait for arrival.
Definition objcmd.h:17
#define SC_FOREVER
Definition objcmd.h:14
#define SC_TO(n)
Definition objcmd.h:12
#define SC_ADD(w, v)
Definition objcmd.h:38
#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_TARGET_Y
Definition objcmd.h:70
@ SW_SCALE_Y
Definition objcmd.h:63
@ SW_Y
Definition objcmd.h:59
@ SW_SCALE_X
Definition objcmd.h:62
#define SC_CALL(fn)
Definition objcmd.h:50
void Ui_SetMessageVoiceFromActor(s32 actor)
Sets the voice of the messages that follow to that of actor's sprite, at the rate the message speed o...
Definition messages.c:483
void BattleEffect_CleanupSceneObjects(void)
Ends a Psynergy effect: frees the effect slots still in use and, unless another effect is being resol...
Definition setup.c:110
The work pointers in the gWorkSlot table, by name.
#define Ram_SceneMapStateOffset
Definition ram_buffer.h:56
#define Ram_EventWork
Definition ram_buffer.h:50
#define Ram_MapWork
Definition ram_buffer.h:48
@ ACTOR_DORA
Definition sanctum.c:58
Song and sound effect ids, indices into gSound_SongTable.
#define SE_RECOVERY
Definition songs.h:119
#define SE_129
Definition songs.h:122
#define SE_DOOR_OPEN
Definition songs.h:153
#define SE_128
Definition songs.h:121
#define SE_MAP_EXIT
Definition songs.h:116
#define SE_234
Definition songs.h:229
#define SE_202
Definition songs.h:197
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
Vale, its home, storm and Babi scenes, Sol Sanctum's eruption and Venus Lighthouse's aerie: Psynergy ...
u8 frame
frame shown, frameBase plus the facing offset; 255 none
Definition animspr.h:53
An animated sprite: its image and shadow, scale, rotation, size and up to four animation layers.
Definition animspr.h:108
struct AnimationSpritePart image
Definition animspr.h:109
u16 rotation
1/65536 turns
Definition animspr.h:118
u8 flags
bits: 1 outlined in ObjectSystemWork's edge and fill colours | 0 shadow drawn (set when created)
Definition animspr.h:128
u8 slot
VRAM cache entry holding its tiles.
Definition animspr.h:112
struct AnimationEntry * entries[4]
its layers; empty ones null
Definition animspr.h:130
u8 count
layers in use, up to the last one present
Definition animspr.h:129
u8 retainCacheEntry
Keeps the VRAM cache entry when it is released or off screen.
Definition animspr.h:114
u16 fullColor
256 colours; set for both parts when created
Definition animspr.h:94
u16 tile
first sprite tile in VRAM
Definition animspr.h:99
u16 priority
2 when created
Definition animspr.h:100
The work of a Psynergy effect scene: its caster and target, where it takes place, the map state it re...
Definition fx_scene.h:31
u16 tileSlot
resource entry holding the spark tiles
Definition fx_scene.h:64
void * child
the target's object, or NULL
Definition fx_scene.h:37
A field object as the object dispatcher's far calls take it.
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
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 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
union FieldCoordinate y
16.16 fixed-point pixels
Definition field_obj.h:36
u8 priorityFlags
ActorPriorityFlag bits, read by the scrolling camera.
Definition field_obj.h:51
s32 terrainHeight
16.16 fixed-point pixels
Definition field_obj.h:38
union FieldCoordinate z
16.16 fixed-point pixels
Definition field_obj.h:37
u16 facing
1/65536 turns
Definition field_obj.h:34
void(*) update(union FieldObject *object)
Called each frame before the object's script, while the object is live.
Definition field_obj.h:116
The storm's lightning work: the colours it flashes between and their difference, the countdown to the...
Definition fxblend.h:13
s16 loud
nonzero plays the louder thunderclap, SE_172 for SE_171
Definition fxblend.h:25
s16 entrance
Definition game_state.h:37
u8 tiles[0x200]
Definition glyph.h:40
The field map's work: the followed position, screen shake, tile animations, blend script,...
Definition map_scroll.h:27
s32 maxY
16.16 fixed-point pixels
Definition map_scroll.h:41
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...
u16 offset
bytes from the start of OBJ VRAM
Definition vram_tab.h:25
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 short u16
Definition types.h:13
#define UNUSED
Definition types.h:22
unsigned char u8
Definition types.h:11
s32 fixed
16.16 fixed-point pixels
An object on the field, read as an actor or as an effect.
struct FieldActor actor
static void Event_ExitSoutheastArea(void)
Reached by cell code 11; takes exit 11, to ValeStorm's entrance 13.
Definition vale_babi.c:289
static void ValeBabi_SpawnEffectPair(union FieldObject *object)
Copies the parent's terrain height into two oppositely moving vertical effects.
Definition vale_babi.c:983
static void Event_ExitWestAreaNorth(void)
Reached by cell code 5; takes exit 5, to this scene's entrance 8.
Definition vale_babi.c:252
struct SceneEvent gValeBabi_StormEvents[]
Definition vale_babi.c:1323
struct SceneEvent gValeBabi_Events[]
Definition vale_babi.c:1348
s32 gValeBabi_Actor10FallsScript[]
Definition vale_babi.c:1121
static UNUSED void ValeBabi_CyclePaletteWithParticles(void)
Definition vale_babi.c:1038
s32 gValeBabi_DoraFacesIsaacScript[]
Definition vale_babi.c:1154
static void Event_ReadThoughtsAboutDorasIllness(void)
Mind Read on the neighbour: Dora was struck with illness.
Definition vale_babi.c:731
static void Event_ScholarAsksAboutKraden(s32 speakerId)
A scholar asks whether the party knows Kraden.
Definition vale_babi.c:127
s32 gValeBabi_MythrilBagRisesScript[]
Definition vale_babi.c:1164
struct SceneEvent gValeBabi_EventsAfterKalay[]
Definition vale_babi.c:1414
s32 ValeBabi_Initialize(void)
Sets up the stormy night or the villagers of the story, and plays the scenes of entrances 20 to 22.
Definition vale_babi.c:299
static void Event_HurryToThePlaza(void)
Kyle calls to Isaac and Dora to hurry; actor 10 shakes, falls and fades as they run to the plaza.
Definition vale_babi.c:542
s32 gValeBabi_DoraRunsAheadScript[]
Definition vale_babi.c:1077
s32 gValeBabi_IsaacRunsAheadScript[]
Definition vale_babi.c:1084
const struct SceneEntrance * ValeBabi_GetEntrances(void)
Returns the entrances, among them the scenes played on arrival: 19 from Babi's palace (its exit 11),...
Definition vale_babi.c:94
u32 gValeBabi_StormExits[]
Definition vale_babi.c:1230
static void Event_ExitNorthwestArea(void)
Reached by cell code 1; takes exit 1, to ValeHome's entrance 6.
Definition vale_babi.c:227
struct ScenePlacement gValeBabi_Placements[]
Definition vale_babi.c:1239
static void ValeBabi_RestoreRoomPatch(void)
Restores the room's tiles and collision patch outside the storm sequence.
Definition vale_babi.c:889
static void Event_ExitCenterAreaSouth(void)
Reached by cell code 6; takes exit 6, to Vale's entrance 8, or on the stormy night to ValeStorm's.
Definition vale_babi.c:259
static void Event_DoraWakesIsaac(void)
Dora wakes Isaac on the stormy night, makes him take his tunic, and leads him out into the storm.
Definition vale_babi.c:371
static void Event_ExitSouthAreaWest(void)
Reached by cell code 9; takes exit 9, to this scene's entrance 7.
Definition vale_babi.c:277
u32 gValeBabi_Exits[]
Definition vale_babi.c:1221
static void Event_TalkToDora(void)
Talking to Dora: in her sickbed she murmurs Kyle's name; once up, she tells Isaac not to worry.
Definition vale_babi.c:865
static void ValeBabi_DemonstrateCatch(void)
Catch's effect plays on Dora, then its objects are released.
Definition vale_babi.c:1048
s32 gValeBabi_IsaacLeavesScript[]
Definition vale_babi.c:1070
static void Event_AskIsaacHisBusiness(void)
The neighbour asks whether Isaac has business with him, and sends him off either way.
Definition vale_babi.c:167
static void Event_VisitSickDora(void)
Back from Kalay, Isaac visits Dora in her sickbed; she asks who told him she was ill,...
Definition vale_babi.c:743
static void Event_NeighborSeesIsaacHasGrown(void)
Back from Kalay, the neighbour remarks how much Isaac has grown.
Definition vale_babi.c:707
s32 gValeBabi_LeaveHouseScript[]
Definition vale_babi.c:1057
static void Event_ReadInnkeepersThoughts(void)
Mind Read on the innkeeper: Dora would not let Isaac stay in Vale.
Definition vale_babi.c:720
struct SceneEvent gValeBabi_EventsAfterLeaving[]
Definition vale_babi.c:1379
static void ValeBabi_CloseScreenAndExit(s32 exitId)
Stops storm lightning before fading through the requested exit.
Definition vale_babi.c:212
static void Event_AskWhetherMaskedManWasFelix(void)
A villager asks whether the masked man was Felix, and wonders whether Jenna can be trusted.
Definition vale_babi.c:193
static void Event_ExitNortheastArea(void)
Reached by cell code 3; takes exit 3, to ValeHome's entrance 2.
Definition vale_babi.c:240
const u32 * ValeBabi_GetExits(void)
On the stormy night the exits lead into the storm.
Definition vale_babi.c:101
static void Event_ShowMythrilBag(void)
The Mythril Bag rises and wobbles before Kraden, with no text.
Definition vale_babi.c:899
const struct ScenePlacement * ValeBabi_GetPlacements(void)
Places Babi's scholars, or Vale's villagers as the story has left them.
Definition vale_babi.c:109
struct SceneEvent gValeBabi_ScholarsLaterEvents[]
Definition vale_babi.c:1481
const struct SceneEvent * ValeBabi_GetEvents(void)
Chooses the events: Babi's scholars talk differently once the Colosso finals are over; Vale's village...
Definition vale_babi.c:143
static void Event_ExitSouthwestArea(void)
Reached by cell code 8; takes exit 8, to this scene's entrance 5.
Definition vale_babi.c:271
struct ScenePlacement gValeBabi_PlacementsAfterKalay[]
Definition vale_babi.c:1285
s32 gValeBabi_IsaacRunsBackScript[]
Definition vale_babi.c:1100
static UNUSED void ValeBabi_CyclePaletteWithoutParticles(void)
Definition vale_babi.c:1042
s32 gValeBabi_DoraLeavesScript[]
Definition vale_babi.c:1065
static void Event_ExitNorthArea(void)
Reached by cell code 2; takes exit 2, to Kraden's cottage (ValeKraden's entrance 3).
Definition vale_babi.c:234
static void ValeBabi_CyclePaletteAndSpawnPair(union FieldObject *object)
Cycles six palettes on odd frames and periodically emit paired effects.
Definition vale_babi.c:960
s32 gValeBabi_RunToPlazaScript[]
Definition vale_babi.c:1108
struct SceneEvent gValeBabi_ScholarsEvents[]
Definition vale_babi.c:1462
static void Event_ExitCenterAreaNorth(void)
Reached by cell code 7; takes exit 7, to this scene's entrance 9.
Definition vale_babi.c:265
static UNUSED void ValeBabi_FlashPaletteAndSpawnPair(union FieldObject *object)
Flashes between two palettes and emits a paired effect every sixteen frames.
Definition vale_babi.c:948
static __inline__ void SetBlendTarget(u32 value)
Selects the hardware blend targets for the storm sequence.
Definition vale_babi.c:533
static void ValeBabi_CyclePaletteOnOddFrames(union FieldObject *object)
Advances deterministically through six palettes on odd frames.
Definition vale_babi.c:970
ValeBabiActor
Vale's placed actors, numbered in the order of gValeBabi_Placements (the scholars of entrance 19 are ...
Definition vale_babi.c:65
@ ACTOR_NEIGHBOR
A neighbour who tells Isaac to be off, and who knows of Dora's illness once the party is back from Ka...
Definition vale_babi.c:74
@ ACTOR_KYLE
Isaac's father (sprite 0x35, Kyle in vale_storm.c).
Definition vale_babi.c:70
struct ScenePlacement gValeBabi_PlacementsAfterLeaving[]
Definition vale_babi.c:1265
ValeBabiPlaceFlag
Vale's place flags this scene keeps while the party is in Vale.
Definition vale_babi.c:81
@ FLAG_VALE_NEIGHBOR_SAW_ISAAC_GROWN
Back from Kalay, the neighbour remarked how much Isaac has grown.
Definition vale_babi.c:85
@ FLAG_VALE_INNKEEPER_WELCOMED_ISAAC
Back from Kalay, the innkeeper welcomed Isaac home.
Definition vale_babi.c:83
static __inline__ void SetBlendAlpha(u32 value)
Definition vale_babi.c:535
s32 gValeBabi_DoraRunsBackScript[]
Definition vale_babi.c:1092
s32 gValeBabi_Actor10ShakesScript[]
Definition vale_babi.c:1115
static void Event_ExitWestAreaSouth(void)
Reached by cell code 4; takes exit 4, to ValeHome's entrance 7.
Definition vale_babi.c:246
const struct SceneRegion * ValeBabi_GetRegions(void)
Definition vale_babi.c:98
s32 gValeBabi_MythrilBagWobblesScript[]
Definition vale_babi.c:1170
static void Event_ExitSouthAreaSouth(void)
Reached by cell code 10; takes exit 10, to ValeStorm's entrance 12.
Definition vale_babi.c:283
struct SceneEntrance gValeBabi_Entrances[]
Definition vale_babi.c:1198
struct ScenePlacement gValeBabi_ScholarsPlacements[]
Definition vale_babi.c:1309
Declares nothing of its own: it only includes the window, battle command, resource and VRAM table hea...
s32 Resource_ResetEntry(u32 no)
Frees cache entry no: its blocks go back and the entry is marked free (offset 0xffff).
Definition vram_cache.c:106
The sprite VRAM block cache and its owners.
struct VramBlockCacheEntry gVramBlockCache[]
void FieldFx_ResumeLightning(void)
Restarts the lightning: the next flash in 128 frames, repeating.
Definition weather.c:458
void FieldFx_StartLightning(void)
Starts the storm's lightning (FieldFx_UpdateLightning): builds the dark (0x10003) and lit (0x10005) p...
Definition weather.c:425
void FieldFx_StopLightning(void)
Stops the lightning: no flash for 0x7fff frames, and none after.
Definition weather.c:442
void FieldFx_LastLightning(void)
One last flash of lightning in 12 frames, then no more.
Definition weather.c:450
void UiText_ShowCenteredMessage(s32 message, s32 mode, s32 yOffset)
Shows a message centred on the screen (yOffset tiles lower) and waits until it is typed out,...
Definition messages.c:325