Alchemy
Loading...
Searching...
No Matches

sol_sanctum_luna_sol_rooms.c

Go to the documentation of this file.
1/// @file
2/// Sol Sanctum's hall of the Luna and Sol rooms: the rooms take on the tint of
3/// the seals' lights, and Kraden studies the symbols on the floor.
4
5#include "game_state.h"
9#include "unit/field/field.h"
10#include "battle.h"
11#include "debug.h"
12#include "field.h"
13#include "game.h"
14#include "graphics.h"
15#include "menu.h"
16#include "minigame.h"
17#include "sound.h"
18#include "system.h"
20#include "call.h"
21#include "field_event.h"
22#include "field_scene.h"
23#include "field_service.h"
24#include "types.h"
25#include "io_reg.h"
26#include "text/msg_ids.h"
27#include "iowrite.h"
28#include "fixed_math.h"
29#include "palbuf.h"
30#include "flags.h"
31#include "songs.h"
32#include "item_ids.h"
33
34// Place flags: Scene_ResetFlagsOnEnter clears 0x300 to 0x3ff when the party
35// enters another place group, and other places use the numbers for their own.
36#define FLAG_SOL_SANCTUM_FLOATING_EYE_SEEN 0x309
37
38// Scene flags, cleared on every ordinary entrance; one of the three is set at
39// a time, for the colours the rooms show:
40// - FLAG_SCENE_TEMP_00: the plain colours (PALETTE_TRANSFORM_PLAIN);
41// - FLAG_SCENE_TEMP_01: the first tint (colour target 0x2051cc), from cell
42// codes
43// 13 and 14;
44// - FLAG_SCENE_TEMP_02: the second tint (0x202db1), from cell code 12.
45
50 s32 waitFrames);
52
54
55/// The work slot pointers from the event work (slot 27) onward, reaching the
56/// palette buffer work in slot 32.
58 struct EventWork *event; ///< slot 27, gEventWork
59 void *slots28To31[4]; ///< not read here
60 u8 *paletteBufferWork; ///< slot 32, gPaletteBufferWork
61};
62
63STATIC_ASSERT(offsetof(struct EventGlobals, paletteBufferWork) == 0x14);
64
67}
68
69const struct SceneRegion *SolSanctumLunaSolRooms_GetRegions(void) { return 0; }
70
73}
74
75/// Returns the eight statues (actors 8 to 15), Kraden (actor 16), Jenna and
76/// Garet, all of them always placed.
79}
80
81/// Returns the floor's cell codes that tint the rooms, Kraden's talk and
82/// cutscenes, the floor symbol and the Herb's chest.
85}
86
87/// Crossing cell code 13: the room fades to the tint that matches the seals'
88/// lights. The first time, Kraden sees the Luna and Sol rooms; with all four
89/// seals open, he also sees the floor symbol change. Also called by
90/// Event_KradenFindsHall after the eruption. Sets one of FLAG_SCENE_TEMP_00
91/// and _01 and clears the other two tint flags; Kraden's cutscenes set
92/// FLAG_SOL_SANCTUM_LUNA_SOL_ROOMS_SEEN and FLAG_SOL_SANCTUM_FLOOR_SYMBOL_SEEN.
93static void Event_UpdateRoomTint(void) {
94 s32 paletteActive;
95
96 // Test all four statue-light flags without skipping any flag reads.
98 paletteActive = GameFlag_IsSet(FLAG_SCENE_TEMP_01);
99 if (paletteActive == 0) {
101 ColorBuffer_ApplyTarget(0x2051cc, 1);
108 }
112 }
113 }
115 }
116 } else {
125 }
126 }
127}
128
129/// Crossing cell code 15: the room fades back to its plain colours. Also
130/// called by Event_KradenStopsPartyLeaving after the eruption. Sets
131/// FLAG_SCENE_TEMP_00 and clears _01 and _02.
132static void Event_RestorePlainTint(void) {
141 }
142}
143
144/// Crossing cell code 14: as code 13, with the tints the other way round.
145/// Sets one of FLAG_SCENE_TEMP_00 and _01 and clears the other two; the first
146/// time, Kraden sees the Luna and Sol rooms.
148 s32 paletteActive;
149
151 paletteActive = GameFlag_IsSet(FLAG_SCENE_TEMP_00);
152 if (paletteActive == 0) {
160 }
161 } else {
164 ColorBuffer_ApplyTarget(0x2051cc, 1);
171 }
173 }
174 }
175}
176
177/// Crossing cell code 12: the room fades to its second tint. Sets
178/// FLAG_SCENE_TEMP_02 and clears _00 and _01.
179static void Event_ApplySecondRoomTint(void) {
181 ColorBuffer_ApplyTarget(0x202db1, 1);
186 }
187}
188
189/// Crossing cell code 19: the backdrop turns black.
190static void Event_ClearBackdropColor(void) {
191 s32 black = 0;
192 u16 *backdropColor = (u16 *)&PLTT_BACKDROP;
193 *backdropColor = black;
194}
195
196/// Draws the light of each open seal, from four consecutive flags, with the
197/// tiles of the given source row.
199 s32 sourceRow) {
200 if (Engine_GameFlagIsSet(firstFlag) != 0)
201 Map_CopyCellsTo(45, sourceRow, 34, 10, 2, 1);
202 if (Engine_GameFlagIsSet(firstFlag + 1) != 0)
203 Map_CopyCellsTo(47, sourceRow, 36, 10, 2, 1);
204 if (Engine_GameFlagIsSet(firstFlag + 2) != 0)
205 Map_CopyCellsTo(45, sourceRow + 1, 34, 11, 2, 1);
206 if (Engine_GameFlagIsSet(firstFlag + 3) != 0)
207 Map_CopyCellsTo(47, sourceRow + 1, 36, 11, 2, 1);
208}
209
210/// Draws the active lights from the current statue flags.
214}
215
216/// Draws the active lights from the saved statue flags.
220}
221
222/// Draws the current lights using their alternate tile rows.
226}
227
228/// Draws the saved lights using their alternate tile rows.
232}
233
234/// Flashes both tile sets of the current statue lights at this pace.
238 Engine_EventWait(frames);
241 Engine_EventWait(frames);
242}
243
244/// Flashes both tile sets of the saved statue lights at this pace.
248 Engine_EventWait(frames);
251 Engine_EventWait(frames);
252}
253
254/// Walking into the hall the first time: Kraden studies the symbols and asks
255/// the party to keep exploring. "This is it! We've found it!" Reached by
256/// stepping on cell code 11; plays until FLAG_SOL_SANCTUM_FOUND is set, and
257/// after the eruption tints the room as cell code 13 does. Sets
258/// FLAG_SOL_SANCTUM_FOUND and FLAG_RETREAT_BLOCKED.
259static void Event_KradenFindsHall(void) {
260 struct FieldActor *leader;
261
264 }
267 // The leader walks into the hall as the music changes.
268 Engine_EventSetMessage(MsgSolSanctumFound);
276 // Kraden hurries out of the leader to the symbol on the floor.
278 if (leader != 0) {
280 }
281 Actor_SetSpeed(ACTOR_KRADEN, PIXELS(7) / 5, PIXELS(7) / 10);
286 // Kraden: "This is it! We've found it!"
288 // Garet and Jenna step out behind the leader.
290 if (leader != 0) {
291 Engine_ActorSetPosition(GARET, leader->x.fixed, leader->z.fixed);
292 }
294 if (leader != 0) {
295 Engine_ActorSetPosition(JENNA, leader->x.fixed, leader->z.fixed);
296 }
297 Actor_SetSpeed(GARET, PIXELS(1) / 2, PIXELS(1) / 4);
298 Actor_SetSpeed(JENNA, PIXELS(1) / 2, PIXELS(1) / 4);
299 Actor_WalkTo(GARET, 280, 248);
300 Actor_WalkToAndWait(JENNA, 296, 248);
304 Engine_CameraSetSpeed(PIXELS(3) / 5, PIXELS(3) / 40);
305 Engine_CameraMoveTo(PIXELS(288), -1, PIXELS(213), 1);
306 Actor_SetSpeed(ACTOR_KRADEN, PIXELS(2) / 5, PIXELS(1) / 5);
310 // Kraden: the mark of the sun, the heart of Sol Sanctum; so those two told
311 // the truth.
323 // Jenna: then they must have been... Garet: "They were thieves!"
331 // Jenna: "Let's hurry back to the village and tell everybody!"
333 10);
344 // Garet: "Kraden? What's the matter?" Kraden: "We're so close..." The
345 // three wonder at turning back from the heart of the sanctum.
374 // Kraden: "Shall we go a little farther?" Yes: "Thank you!" No: then go
375 // back without him.
377 if (Engine_EventChooseYesNo(0, 0) == 0) {
378 Engine_EventSetMessage(MsgSolSanctumThank);
379 } else {
380 Engine_EventSetMessage(MsgSolSanctumGoBackVillage);
382 }
388 // Either way Jenna gives in and Garet sides with Kraden, who is
389 // delighted: "Good! It's decided. Let's move ahead!"
390 Engine_EventSetMessage(MsgSolSanctumPutWayDont);
394 6);
406 // End the discussion and return the followers to Isaac.
407 Actor_SetSpeed(GARET, PIXELS(1), PIXELS(1) / 2);
408 Actor_SetSpeed(JENNA, PIXELS(1), PIXELS(1) / 2);
412 if (leader != 0) {
414 leader->z.part.pixel);
415 }
420 if (leader != 0) {
421 Engine_ActorSetDestination(GARET, leader->x.part.pixel,
422 leader->z.part.pixel);
423 }
428 if (leader != 0) {
429 Engine_ActorSetDestination(JENNA, leader->x.part.pixel,
430 leader->z.part.pixel);
431 }
434 // Retreat does not work here (flag 0x144).
438 }
439}
440
441/// Kraden finds the room of Luna beside the room of Sol, and asks Isaac to look
442/// farther up the passage. Called by Event_UpdateRoomTint and
443/// Event_UpdateRoomTintInverse until FLAG_SOL_SANCTUM_LUNA_SOL_ROOMS_SEEN is
444/// set, which it sets; Isaac agreeing sets
445/// FLAG_SOL_SANCTUM_ISAAC_SEARCHING_FOR_KRADEN. Leaves Kraden standing by the
446/// northern wall.
448 struct FieldActor *leader;
449 s32 request;
450
451 // Kraden steps out beside Isaac: "What is this room?"
452 Engine_EventSetMessage(MsgSolSanctumWhRoom);
457 if (leader != 0) {
458 Actor_SetPosition(ACTOR_KRADEN, leader->x.fixed, leader->z.fixed);
459 }
466 Camera_SetSpeed(PIXELS(12) / 5, PIXELS(3) / 10);
467 Camera_MoveTo(PIXELS(575), -1, PIXELS(181), 1);
469 Engine_EventWait(120);
472 Camera_MoveTo(PIXELS(492), -1, PIXELS(168), 1);
477 6);
481 // Kraden: "These rooms must be connected somehow, don't you think?"
483 if (Engine_EventChooseYesNo(0, 0) == 0) {
484 Engine_EventSetMessage(MsgSolSanctumLunaSolRooms);
485 } else {
486 Engine_EventSetMessage(MsgSolSanctumRoomLunaOne);
487 }
490 10);
491 // Kraden: would Isaac look farther up the passage? Yes: "Let me know what
492 // you find." No: "Then just wait there."
493 request = MsgSolSanctumMeanLookFarther;
494 Engine_EventSetMessage(request);
501 if (Engine_EventChooseYesNo(0, 0) == 0) {
502 Engine_EventSetMessage((request + 1));
504 } else {
505 Engine_EventSetMessage((request + 2));
506 }
508 4);
513 // Leave Kraden by the northern wall for the search interactions.
514 Camera_SetSpeed(PIXELS(4), PIXELS(1) / 2);
516}
517
518/// Heading out of the hall before the passage is found: Kraden hurries over.
519/// "That way leads out of the sanctum." Reached by stepping on cell code 9
520/// once FLAG_SOL_SANCTUM_FOUND is set and until
521/// FLAG_SOL_SANCTUM_STAR_ROOM_PASSAGE_OPEN is; after the eruption the room
522/// only fades back to its plain colours (Event_RestorePlainTint).
524 struct FieldActor *kraden;
525 struct FieldActor *leader;
526 struct FieldActor *destinationActor;
527
530 return;
531 }
534 return;
535 }
537 return;
538 }
541 Engine_EventSetMessage(MsgSolSanctumWayLeadsOutSanctum);
545 if (leader != 0) {
546 Actor_SetPosition(ACTOR_KRADEN, leader->x.fixed, leader->z.fixed);
547 }
551 kraden->x.fixed > PIXELS(340)) {
555 }
557 kraden->x.fixed > PIXELS(340)) {
559 } else {
560 // The result is unused.
562 }
571 destinationActor = Object_GetById(ACTOR_PARTY_LEADER);
572 if (destinationActor != 0) {
573 Actor_SetDestination(ACTOR_KRADEN, destinationActor->x.part.pixel,
574 destinationActor->z.part.pixel);
575 }
579 } else {
581 }
583}
584
585/// Animates the first falling light and manages the shared shake pulse. Run
586/// each frame as a callback that SolSanctumLunaSolRooms_RunStatueLightSequence
587/// adds and removes.
589 if ((Random_Next() & 3) != 0) {
591 case 0:
593 Map_CopyCellsTo(46, 59, 30, 33, 1, 5);
594 break;
595 case 1:
596 Map_CopyCellsTo(46, 59, 30, 33, 1, 1);
597 Map_CopyCellsTo(46, 59, 30, 34, 1, 5);
598 break;
599 case 2:
600 Map_CopyCellsTo(46, 59, 30, 34, 1, 1);
601 Map_CopyCellsTo(46, 59, 30, 35, 1, 5);
602 break;
603 case 3:
604 Map_CopyCellsTo(46, 59, 30, 35, 1, 1);
605 Map_CopyCellsTo(46, 59, 30, 36, 1, 5);
606 break;
607 case 4:
609 Map_CopyCellsTo(46, 59, 30, 36, 1, 1);
610 Map_CopyCellsTo(46, 59, 30, 37, 1, 5);
611 break;
612 case 0x50:
613 Map_CopyCellsTo(46, 49, 30, 33, 1, 10);
614 break;
615 }
618 ((u32)(Random_Next() * 40) >> 16) + 90) {
620 }
621 }
625 } else if (gSolSanctumLunaSolRooms_FlashState == 1) {
626 Map_SetShake(-1, -1, 9 * Q16_ONE / 10);
627 }
629 }
630}
631
632/// Animates the second falling light with its own random restart delay, as
633/// the first.
635 if ((Engine_RandomNext() & 3) != 0) {
637 case 0:
639 Map_CopyCellsTo(47, 59, 42, 33, 1, 5);
640 break;
641 case 1:
642 Map_CopyCellsTo(47, 59, 42, 33, 1, 1);
643 Map_CopyCellsTo(47, 59, 42, 34, 1, 5);
644 break;
645 case 2:
646 Map_CopyCellsTo(47, 59, 42, 34, 1, 1);
647 Map_CopyCellsTo(47, 59, 42, 35, 1, 5);
648 break;
649 case 3:
650 Map_CopyCellsTo(47, 59, 42, 35, 1, 1);
651 Map_CopyCellsTo(47, 59, 42, 36, 1, 5);
652 break;
653 case 4:
655 Map_CopyCellsTo(47, 59, 42, 36, 1, 1);
656 Map_CopyCellsTo(47, 59, 42, 37, 1, 5);
657 break;
658 case 0x5a:
659 Map_CopyCellsTo(47, 49, 42, 33, 1, 10);
660 break;
661 }
664 ((u32)(Engine_RandomNext() * 40) >> 16) + 100) {
666 }
667 }
668}
669
670/// Animates the third falling light with its own random restart delay, as the
671/// first.
673 if ((Engine_RandomNext() & 3) != 0) {
675 case 0:
677 Map_CopyCellsTo(48, 59, 31, 36, 1, 5);
678 break;
679 case 1:
680 Map_CopyCellsTo(48, 59, 31, 36, 1, 1);
681 Map_CopyCellsTo(48, 59, 31, 37, 1, 5);
682 break;
683 case 2:
684 Map_CopyCellsTo(48, 59, 31, 37, 1, 1);
685 Map_CopyCellsTo(48, 59, 31, 38, 1, 5);
686 break;
687 case 3:
688 Map_CopyCellsTo(48, 59, 31, 38, 1, 1);
689 Map_CopyCellsTo(48, 59, 31, 39, 1, 5);
690 break;
691 case 4:
693 Map_CopyCellsTo(48, 59, 31, 39, 1, 1);
694 Map_CopyCellsTo(48, 59, 31, 40, 1, 5);
695 break;
696 case 0x5f:
697 Map_CopyCellsTo(48, 49, 31, 36, 1, 10);
698 break;
699 }
702 ((u32)(Engine_RandomNext() * 40) >> 16) + 105) {
704 }
705 }
706}
707
708/// Animates the fourth falling light with its own random restart delay, as
709/// the first.
711 if ((Engine_RandomNext() & 3) != 0) {
713 case 0:
715 Map_CopyCellsTo(46, 59, 41, 36, 1, 5);
716 break;
717 case 1:
718 Map_CopyCellsTo(46, 59, 41, 36, 1, 1);
719 Map_CopyCellsTo(46, 59, 41, 37, 1, 5);
720 break;
721 case 2:
722 Map_CopyCellsTo(46, 59, 41, 37, 1, 1);
723 Map_CopyCellsTo(46, 59, 41, 38, 1, 5);
724 break;
725 case 3:
726 Map_CopyCellsTo(46, 59, 41, 38, 1, 1);
727 Map_CopyCellsTo(46, 59, 41, 39, 1, 5);
728 break;
729 case 4:
731 Map_CopyCellsTo(46, 59, 41, 39, 1, 1);
732 Map_CopyCellsTo(46, 59, 41, 40, 1, 5);
733 break;
734 case 0x55:
735 Map_CopyCellsTo(46, 49, 41, 36, 1, 10);
736 break;
737 }
740 ((u32)(Engine_RandomNext() * 40) >> 16) + 95) {
742 }
743 }
744}
745
746/// Opens on Kraden in the room of Luna with its first tint, as a flash
747/// crosses it. Shared by the three cutscenes that play on arriving from the
748/// statue room. Sets FLAG_SCENE_TEMP_01 and clears _00 and _02.
750 Camera_MoveTo(-1, -1, -1, 0);
751 Map_CopyCellsTo(30, 43, 32, 40, 8, 3);
752 Map_CopyCellsTo(30, 43, 33, 39, 8, 1);
753 Map_CopyCellsTo(30, 43, 36, 38, 3, 3);
754 Map_CopyCellsTo(14, 41, 32, 41, 8, 4);
755 Camera_MoveTo(PIXELS(574), -1, PIXELS(158), 0);
760 ColorBuffer_ApplyTarget(0x2051cc, 1);
771 ColorBuffer_ApplyTarget(0x10005, 1);
776}
777
778/// The seals' lights flash ever faster around Kraden, who hurries back to
779/// Isaac. "What's happening?" Called by SolSanctumLunaSolRooms_Initialize at
780/// entrance 4 until FLAG_SOL_SANCTUM_STATUE_TRAP_SPRUNG is set. Sets
781/// FLAG_SOL_SANCTUM_STATUE_TRAP_SPRUNG and takes exit 3, back to the statue
782/// room (scene 12, entrance 3).
784 s32 twelveFrameFlashes;
785 s32 eightFrameFlashes;
786 s32 sixFrameFlashes;
787 s32 fourFrameFlashes;
788 s32 twoFrameFlashes;
789
792 // Kraden turns, startled: "What's happening?"
793 Engine_EventSetMessage(MsgSolSanctumWhatsHappeningAtTheTrap);
797 Camera_MoveTo(PIXELS(574), -1, PIXELS(174), 1);
801 20);
802 // Shorten each flash interval as the statue-light sequence accelerates.
803 for (twelveFrameFlashes = 0; twelveFrameFlashes != 4; twelveFrameFlashes++) {
805 }
806 for (eightFrameFlashes = 0; eightFrameFlashes != 6; eightFrameFlashes++) {
808 }
809 for (sixFrameFlashes = 0; sixFrameFlashes != 8; sixFrameFlashes++) {
811 }
812 for (fourFrameFlashes = 0; fourFrameFlashes != 10; fourFrameFlashes++) {
814 }
815 for (twoFrameFlashes = 0; twoFrameFlashes != 12; twoFrameFlashes++) {
817 }
820 // Kraden: "Isaac must have found something!" He runs off south.
822 6);
831}
832
833/// The seals' lights flash and lights fall through the room of Luna while
834/// Kraden calls on Isaac to stop. Called by SolSanctumLunaSolRooms_Initialize
835/// at entrance 5 until FLAG_SOL_SANCTUM_FALLING_LIGHTS_SEEN is set; the caller
836/// then sets it and closes all four seals. Takes exit 4, back to the statue
837/// room (scene 12, entrance 4).
839 s32 flash;
846 // Kraden turns, startled: "What's happening?" The lights flash four times.
847 Engine_EventSetMessage(MsgSolSanctumWhatsHappening);
851 Camera_MoveTo(PIXELS(574), -1, PIXELS(174), 1);
855 20);
856 for (flash = 0; flash != 4; flash++) {
858 }
859 // Kraden: "Isaac must have found something!"
861 6);
862 // Each light starts falling after 20 to 79 frames.
864 (((u32)Engine_RandomNext() * 60) >> 16) + 20;
866 (((u32)Engine_RandomNext() * 60) >> 16) + 20;
868 (((u32)Engine_RandomNext() * 60) >> 16) + 20;
870 (((u32)Engine_RandomNext() * 60) >> 16) + 20;
872 // Run the falling lights independently while the statues keep flashing.
877 3200);
878 for (flash = 0; flash != 6; flash++) {
880 }
881 for (flash = 0; flash != 8; flash++) {
883 }
884 for (flash = 0; flash != 10; flash++) {
886 }
887 for (flash = 0; flash != 12; flash++) {
889 }
890 Map_CopyCellsTo(45, 30, 34, 10, 4, 2);
892 // Kraden: "Stop!!! You're about to make a big mistake!" He runs south.
894 6);
897 // Stop all light callbacks before leaving this room.
907}
908
909/// The lights of the seals Isaac has opened since flash ever faster in the
910/// room of Luna. "You found it, Isaac." Called by
911/// SolSanctumLunaSolRooms_Initialize at entrance 6 once
912/// FLAG_SOL_SANCTUM_FALLING_LIGHTS_SEEN is set. Toggles each open seal's
913/// FLAG_SOL_SANCTUM_*_LIGHT_SHOWN; Kraden speaks until the caller sets
914/// FLAG_SOL_SANCTUM_KRADEN_SAID_YOU_FOUND_IT. Takes exit 5, back to the
915/// statue room (scene 12, entrance 5).
917 s32 speaker;
918 s32 twelveFrameFlashes;
919 s32 eightFrameFlashes;
920 s32 sixFrameFlashes;
921 s32 fourFrameFlashes;
922 s32 twoFrameFlashes;
923
925 // Toggle the saved lights only where the current statues are lit.
929 Map_CopyCellsTo(45, 28, 34, 10, 2, 1);
933 }
937 Map_CopyCellsTo(47, 28, 36, 10, 2, 1);
941 }
945 Map_CopyCellsTo(45, 29, 34, 11, 2, 1);
949 }
953 Map_CopyCellsTo(47, 29, 36, 11, 2, 1);
957 }
961 Camera_MoveTo(PIXELS(574), -1, PIXELS(174), 1);
964 for (twelveFrameFlashes = 0; twelveFrameFlashes != 4; twelveFrameFlashes++) {
966 }
967 for (eightFrameFlashes = 0; eightFrameFlashes != 6; eightFrameFlashes++) {
969 }
970 for (sixFrameFlashes = 0; sixFrameFlashes != 8; sixFrameFlashes++) {
972 }
973 for (fourFrameFlashes = 0; fourFrameFlashes != 10; fourFrameFlashes++) {
975 }
976 for (twoFrameFlashes = 0; twoFrameFlashes != 12; twoFrameFlashes++) {
978 }
982 // Kraden, once: "You found it, Isaac." and "Keep doing that until the light
983 // bathes all the remaining quarters."
986 Engine_EventSetMessage(MsgSolSanctumYouFoundIt);
990 }
996}
997
998/// Walking up to Kraden once all four seals are open: the picture of Luna has
999/// changed to Sol. "Look, Isaac! The picture of Luna..." Reached by stepping
1000/// on cell code 8, until FLAG_SOL_SANCTUM_LUNA_PICTURE_CHANGED is set, which
1001/// it sets.
1003 struct FieldActor *leader;
1004
1006 } else {
1008 } else {
1012 Camera_MoveTo(PIXELS(574), -1, PIXELS(184), 1);
1013 // Isaac walks up to Kraden, who hops: "The picture of Luna changed to
1014 // Sol!"
1015 Engine_EventSetMessage(MsgSolSanctumThePictureOfLunaChanged);
1019 Engine_EventWait(10);
1028 // Kraden: "But other than that, nothing looks different..."
1031 Engine_EventWait(40);
1033 Engine_EventWait(30);
1034 // Kraden: a trap here, and this is all that happens?
1040 Engine_EventWait(40);
1041 // Kraden: "Somewhere, something else must have changed." He walks back
1042 // into the leader.
1046 Engine_EventWait(40);
1049 Actor_SetSpeed(ACTOR_KRADEN, PIXELS(1) / 2, PIXELS(1) / 4);
1052 if (leader != 0) {
1053 Actor_SetDestination(ACTOR_KRADEN, leader->x.part.pixel,
1054 leader->z.part.pixel);
1055 }
1060 }
1061 }
1062}
1063
1064/// Kraden notices that the symbol on the floor has changed from Sol to Luna.
1065/// Called by Event_UpdateRoomTint once all four seals are open, until
1066/// FLAG_SOL_SANCTUM_FLOOR_SYMBOL_SEEN is set, which it sets. Leaves Kraden off
1067/// the map.
1077 Engine_EventSetMessage(MsgSolSanctumLookSymbolFloor);
1088}
1089
1090/// Searching the floor symbol after Kraden has seen it change: the floor opens,
1091/// and Isaac then Kraden rise into the Elemental Star room. Reached by
1092/// searching cell code 20; does nothing until
1093/// FLAG_SOL_SANCTUM_FLOOR_SYMBOL_SEEN is set. Sets
1094/// FLAG_SOL_SANCTUM_STAR_ROOM_PASSAGE_OPEN the first time and takes exit 7,
1095/// into the Elemental Star room (scene 17, entrance 10).
1097 struct FieldActor *actor;
1098 s32 frame;
1099 struct AnimationObject *sprite;
1100
1102 } else {
1104 // Isaac steps onto the symbol and Kraden comes out beside him.
1105 Camera_SetSpeed(PIXELS(1), PIXELS(1) / 8);
1106 Camera_MoveTo(PIXELS(287), -1, PIXELS(148), 1);
1113 Actor_WalkTo(ACTOR_KRADEN, 264, 136);
1121 }
1122 Engine_EventWait(40);
1123 // Reveal the passage only once; later visits reuse its open state.
1125 } else {
1126 Map_CopyCellsTo(36, 62, 17, 36, 2, 3);
1127 Map_CopyCellsTo(44, 59, 17, 38, 2, 1);
1128 Engine_EventWait(10);
1129 Map_CopyCellsTo(38, 62, 17, 36, 2, 3);
1130 Map_CopyCellsTo(44, 59, 17, 39, 2, 1);
1131 Engine_EventWait(10);
1132 Map_CopyCellsTo(40, 62, 17, 36, 2, 3);
1133 Map_CopyCellsTo(0, 32, 17, 39, 2, 1);
1134 Map_CopyCellsTo(44, 59, 17, 40, 2, 1);
1135 Engine_EventWait(10);
1138 Map_CopyCellsTo(42, 62, 17, 36, 2, 3);
1139 Map_CopyCellsTo(0, 32, 17, 40, 2, 1);
1140 Map_CopyCellsTo(44, 59, 17, 41, 2, 1);
1141 Engine_EventWait(10);
1142 Map_CopyCellsTo(0, 32, 17, 41, 2, 1);
1143 Map_CopyCellsTo(44, 59, 17, 42, 2, 1);
1144 Engine_EventWait(10);
1145 Map_CopyCellsTo(0, 32, 17, 42, 2, 3);
1146 Engine_EventWait(80);
1150 }
1151 Object_LinkPair(16, 0, 30);
1156 // Kraden: "Ah ha! This has to be it." and "Let's go, Isaac!"
1157 Engine_EventSetMessage(MsgSolSanctumHa);
1164 Engine_EventWait(60);
1165 // Raise Isaac first, then shrink his sprite into the passage.
1167 Engine_CameraSetSpeed(PIXELS(3) / 5, PIXELS(3) / 40);
1168 Engine_CameraMoveTo(PIXELS(287), -1, PIXELS(114), 1);
1170 Engine_EventWait(20);
1174 /* FAKEMATCH: the zero goes through the sprite variable, whose pseudo has
1175 r7; as motionFlags = 0, the zero is in r2 and 4 instructions differ in
1176 tbs-en. */
1177 sprite = 0;
1178 actor->motionFlags = (u32)sprite;
1181 sprite = actor->sprite;
1182 frame = 0;
1183 sprite->flags = 0;
1184 do {
1185 actor->y.fixed += PIXELS(1) / 5;
1186 Engine_TaskWait(1);
1187 frame++;
1188 } while (frame != 120);
1190 frame = 0;
1191 do {
1192 actor->y.fixed += PIXELS(1) / 10;
1193 sprite->scale += -Q16_ONE / 64;
1194 Engine_TaskWait(1);
1195 frame++;
1196 } while (frame != 60);
1199 // Kraden: "Wait for me, Isaac... I'm on my way!"
1203 Engine_EventWait(20);
1205 // Repeat the ascent for Kraden before closing the room transition.
1208 /* FAKEMATCH: the mask temporary puts the flags in r2 and the motion
1209 address in r3, so both byte stores wait past the zero; as &=
1210 ~ACTOR_FACES_MOTION, 10 instructions differ in tbs-en. */
1211 {
1212 s32 steeringFlags = 254;
1213
1214 steeringFlags &= actor->steeringFlags;
1215 frame = 0;
1216 actor->steeringFlags = steeringFlags;
1217 actor->motionFlags = frame;
1218 }
1221 sprite = actor->sprite;
1222 sprite->flags = 0;
1223 do {
1224 actor->y.fixed += PIXELS(1) / 5;
1225 Engine_TaskWait(1);
1226 frame++;
1227 } while (frame != 120);
1229 frame = 0;
1230 do {
1231 actor->y.fixed += PIXELS(1) / 10;
1232 sprite->scale += -Q16_ONE / 64;
1233 Engine_TaskWait(1);
1234 frame++;
1235 } while (frame != 60);
1237 Engine_EventWait(80);
1244 Engine_TaskWait(1);
1247 }
1248}
1249
1250/// Restores puzzle tiles and plays the cutscene this entrance calls for.
1251/// Called by Field_RunScene once the actors exist. Blocks Retreat
1252/// (FLAG_RETREAT_BLOCKED) between finding the hall and opening the passage
1253/// before the eruption; sets FLAG_SCENE_TEMP_00 on an ordinary entrance;
1254/// copies each open seal into its FLAG_SOL_SANCTUM_*_LIGHT_SHOWN; plays the
1255/// trap at entrance 4, the falling lights at entrance 5 (then closing the four
1256/// seals), the saved lights at entrance 6, and the floating eye at entrance 8
1257/// until FLAG_SOL_SANCTUM_FLOATING_EYE_SEEN is set.
1259 s32 playedEntrySequence;
1260 s32 anyLightLit;
1261
1262 Engine_TaskWait(1);
1264 playedEntrySequence = 0;
1268 // Retreat does not work here (flag 0x144).
1270 }
1274 Engine_ColorBufferApplyTarget(0x2051cc, 1);
1276 Engine_TaskWait(1);
1277 } else if (Engine_GameFlagIsSet(FLAG_SCENE_TEMP_02) != 0) {
1278 Engine_ColorBufferApplyTarget(0x202db1, 1);
1280 Engine_TaskWait(1);
1281 }
1282 } else {
1286 }
1287 }
1288 // Play the one-time trap or light sequence selected by this entrance.
1289 if (gGameState.entrance == 4) {
1293 playedEntrySequence = 1;
1294 }
1295 } else if (gGameState.entrance == 5) {
1303 playedEntrySequence = 1;
1304 }
1305 } else if (gGameState.entrance == 6) {
1309 }
1310 playedEntrySequence = 1;
1311 }
1314 }
1317 }
1320 }
1323 }
1324 Engine_TaskWait(4);
1325 // Restore completed puzzle tiles without replaying the entrance scene.
1326 if (playedEntrySequence == 0) {
1328 Map_CopyCellsTo(30, 44, 30, 38, 12, 5);
1329 Map_CopyCellsTo(30, 44, 34, 37, 4, 1);
1330 Map_CopyCellsTo(14, 41, 32, 41, 8, 4);
1331 Map_CopyCellsTo(45, 28, 34, 10, 4, 2);
1332 Map_CopyCellsTo(45, 30, 16, 10, 4, 2);
1333 Map_CopyCellsTo(14, 45, 14, 41, 8, 4);
1334 if (gGameState.entrance != 8) {
1337 0) {
1338 Map_CopyCellsTo(0, 32, 17, 39, 2, 1);
1339 Map_CopyCellsTo(42, 62, 17, 36, 2, 3);
1340 Map_CopyCellsTo(0, 32, 17, 40, 2, 1);
1341 Map_CopyCellsTo(0, 32, 17, 41, 2, 1);
1342 Map_CopyCellsTo(0, 32, 17, 42, 2, 3);
1343 } else {
1344 Map_CopyCellsTo(44, 59, 17, 37, 2, 6);
1345 }
1348 }
1349 }
1351 } else {
1352 anyLightLit = 0;
1354 Map_CopyCellsTo(45, 28, 34, 10, 2, 1);
1355 Map_CopyCellsTo(45, 30, 16, 10, 2, 1);
1356 anyLightLit = 1;
1357 }
1359 Map_CopyCellsTo(47, 28, 36, 10, 2, 1);
1360 Map_CopyCellsTo(47, 30, 18, 10, 2, 1);
1361 anyLightLit = 1;
1362 }
1364 Map_CopyCellsTo(45, 29, 34, 11, 2, 1);
1365 Map_CopyCellsTo(45, 31, 16, 11, 2, 1);
1366 anyLightLit = 1;
1367 }
1369 Map_CopyCellsTo(47, 29, 36, 11, 2, 1);
1370 Map_CopyCellsTo(47, 31, 18, 11, 2, 1);
1371 anyLightLit = 1;
1372 }
1374 anyLightLit != 0) {
1375 Map_CopyCellsTo(30, 43, 32, 40, 8, 3);
1376 Map_CopyCellsTo(30, 43, 33, 39, 8, 1);
1377 Map_CopyCellsTo(30, 43, 36, 38, 3, 3);
1378 Map_CopyCellsTo(36, 58, 32, 41, 8, 4);
1379 }
1380 Map_CopyCellAttributes(15, 6, 2, 1, 17, 6);
1381 }
1382 }
1383 // The eruption visit begins with the floating-eye scene only once.
1385 gGameState.entrance == 8) {
1388 Map_CopyCellAttributes(15, 6, 2, 1, 17, 6);
1389 } else {
1394 Map_CopyCellAttributes(15, 6, 2, 1, 17, 6);
1395 }
1396 }
1397 return 0;
1398}
1399
1400/// Returns 1 when all four seals are open.
1402 s32 allLit = 1;
1403
1405 allLit = 0;
1407 allLit = 0;
1409 allLit = 0;
1411 allLit = 0;
1412
1413 return allLit;
1414}
1415
1416/// Advances the active dialogue and pauses for the requested frames.
1418 s32 waitFrames) {
1419 Engine_EventShowMessage(speaker, 0);
1420 Engine_EventWait(waitFrames);
1421}
1422
1423/// Entering after the eruption the first time: in a white flash a floating eye
1424/// shows itself to Isaac and Garet, and the hall shakes. Called by
1425/// SolSanctumLunaSolRooms_Initialize at entrance 8 until
1426/// FLAG_SOL_SANCTUM_FLOATING_EYE_SEEN is set; the caller sets it. Sets
1427/// FLAG_SCENE_TEMP_01 and clears _00 and _02.
1429 struct FieldActor *leader;
1431
1433 // The screen opens all white on Isaac and Garet, then fades to the tint.
1434 Camera_MoveTo(PIXELS(286), -1, PIXELS(134), 0);
1436 Engine_TaskWait(1);
1437 ColorBuffer_ApplySource(0x7fff, 0);
1440 Engine_TaskWait(1);
1441 Actor_SetPosition(GARET, PIXELS(280), PIXELS(134));
1446 Engine_ColorBufferApplyTarget(0x2051cc, 1);
1448 Engine_TaskWait(120);
1454 Engine_TaskWait(100);
1455 // Both look around, bewildered, as the hall gives a jolt.
1458 Engine_EventWait(60);
1466 Engine_EventWait(20);
1469 Map_SetShake(-1, -1, 9 * Q16_ONE / 10);
1470 Engine_EventWait(20);
1472 // Garet: "Did that floating eye thing save us?" A stronger tremor throws
1473 // them both aside.
1474 Engine_EventSetMessage(MsgSolSanctumFloatingEyeThing);
1478 Engine_EventWait(40);
1481 Engine_EventWait(40);
1486 Engine_ActorJump(GARET, 4, 0);
1490 Engine_EventWait(40);
1493 // Recover from the tremor and bring Garet back into the party.
1496 Engine_EventWait(40);
1498 // Garet: "Yeah, right! Let's get out of here..."
1504 if (leader != NULL) {
1505 Engine_ActorSetDestination(GARET, leader->x.part.pixel,
1506 leader->z.part.pixel);
1507 }
1510 // UB: EventGlobals traverses beyond scalar gEventWork to slot 32. Its
1511 // named load keeps native EN size 0x310 but changes address setup.
1512#ifdef UBFIX
1514#else
1515 palette = (struct BattleEffectBuffers *)((struct EventGlobals *)&gEventWork)
1516 ->paletteBufferWork;
1517#endif
1518 palette->target[0] = 0;
1519 palette->target[1] = 0;
1520 palette->target[2] = 0;
1521 palette->page = 0;
1522 palette->duration = 1;
1523 palette->step = 1;
1524 palette->padding2a03 = 1;
1529}
1530
1531/// Talking to Kraden: his answer depends on whether Isaac agreed to search.
1532/// "Let me know what you find" once Isaac agreed, otherwise "Just wait over
1533/// there." Reached by talking to Kraden (actor 16).
1534static void Event_TalkToKraden(void) {
1537 Engine_EventSetMessage(MsgSolSanctumKradenLetMeKnowWhat);
1538 } else {
1539 Engine_EventSetMessage(MsgSolSanctumKradenJustWaitOverThere);
1540 }
1544}
1545
1547 {0, CONDITION_ALWAYS, 288, 0, 157, FACING_SOUTH, 0, 0, 0, 752, 496, 0},
1548 {1, CONDITION_ALWAYS, 55, 0, 477, FACING_NORTH, 0, 0, 0, 752, 496, 0},
1549 {2, CONDITION_ALWAYS, 647, 0, 327, FACING_SOUTH, 0, 0, 0, 752, 496, 0},
1550 {3, CONDITION_ALWAYS, 287, 0, 218, FACING_SOUTH, 0, 0, 0, 752, 496, 0},
1551 {4, CONDITION_ALWAYS, 576, 0, 8, FACING_SOUTH, 0, 0, 0, 752, 496, 0},
1552 {5, CONDITION_ALWAYS, 576, 0, 8, FACING_SOUTH, 0, 0, 0, 752, 496, 0},
1553 {6, CONDITION_ALWAYS, 576, 0, 8, FACING_SOUTH, 0, 0, 0, 752, 496, 0},
1554 {7, CONDITION_ALWAYS, 576, 0, 8, FACING_SOUTH, 0, 0, 0, 752, 496, 0},
1555 {8, CONDITION_ALWAYS, 297, 0, 119, FACING_NORTHWEST, 0, 0, 0, 752, 496, 0},
1557};
1558
1560 SCENE_EXITS(11), SCENE_EXIT(1, 16, 16), SCENE_EXIT(2, 12, 1),
1561 SCENE_EXIT(3, 12, 3), SCENE_EXIT(4, 12, 4), SCENE_EXIT(5, 12, 5),
1562 SCENE_EXIT(6, 12, 6), SCENE_EXIT(7, 17, 10), SCENE_EXIT(10, 510, 1),
1564};
1565
1566// clang-format off
1571 PIXELS(360), 0, PIXELS(200), FACING_NORTH + FACING_STEP, TALK_FACE_PARTY, 0 },
1575 PIXELS(216), 0, PIXELS(152), FACING_SOUTH + FACING_STEP, TALK_FACE_PARTY, 0 },
1579 PIXELS(648), 0, PIXELS(200), FACING_NORTH + FACING_STEP, TALK_FACE_PARTY, 0 },
1583 PIXELS(504), 0, PIXELS(152), FACING_SOUTH + FACING_STEP, TALK_FACE_PARTY, 0 },
1585 PIXELS(1608), 0, PIXELS(1608), FACING_NORTH, TALK_FACE_PARTY, 0 },
1587 PIXELS(1608), 0, PIXELS(1608), FACING_NORTH, TALK_FACE_PARTY, 0 },
1589 PIXELS(1608), 0, PIXELS(1608), FACING_NORTH, TALK_FACE_PARTY, 0 },
1590 { SCENE_TABLE_END },
1591};
1592// clang-format on
1593
1608 {0x21, 2, CONDITION_ALWAYS, 2},
1615};
void Object_LinkPair(s32 firstId, s32 secondId, s32 wait)
The event command "actors face each other": turns two actors toward each other, then waits wait frame...
struct FieldActor * Object_GetById(s32 actor)
Returns an actor, or NULL if it does not exist.
struct BattleEffectBuffers * gPaletteBufferWork
Calls through a function pointer, by argument count.
#define GARET
Jerald.
#define JENNA
Jasmine.
The engine calls the debug menus import, and their palette swatch tiles.
static s32 FieldScheduler_AddCallback(SchedulerCallback callback, s32 priority)
Registers a main-image scheduler callback.
Definition engine_call.h:36
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
#define SPEAKER_PORTRAIT_LEFT
Definition field_event.h:54
static s32 Event_OpenMessage(s32 speaker, s32 flags)
static void Actor_SetDestination(s32 actor, s32 x, s32 z)
static void Actor_FaceDirection(s32 actor, s32 facing, s32 frames)
void Engine_ActorSetAnimationAndWait(s32 actor, s32 animation)
#define SPEAKER_WINDOW_ABOVE
Definition field_event.h:56
static void Event_ShowMessageAndWait(s32 speaker, s32 flags, s32 frames)
s32 Engine_EventChooseYesNo(s32 actor, s32 flags)
#define GameFlag_IsSet
#define SPEAKER_PORTRAIT_RIGHT
Definition field_event.h:55
void Engine_CameraSetSpeed(s32 speed, s32 acceleration)
static void Actor_WalkToAndWait(s32 actor, s32 x, s32 z)
static void Camera_SetSpeed(s32 speed, s32 acceleration)
void Engine_CameraMoveTo(s32 fixed_x, s32 fixed_y, s32 fixed_z, s32 pan)
s32 Engine_TaskRemoveCallback(void(*callback)(void))
void Engine_ActorJump(s32 actor, s32 height, s32 frames)
#define EMOTE_IN_FRONT
Definition field_event.h:49
void Engine_ActorSetSpeed(s32 actor, s32 speed, s32 acceleration)
void Engine_ActorFaceDirection(s32 actor, s32 facing, s32 frames)
void Engine_EventCloseScreen(void)
void Engine_ActorSetDestination(s32 actor, s32 x, s32 z)
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)
#define SPEAKER_WINDOW_BELOW
Definition field_event.h:57
static void ColorBuffer_ApplyTarget(s32 value, s32 mode)
static void Actor_WalkTo(s32 actor, s32 x, s32 z)
#define GameFlag_Clear
void Engine_EventWaitForScreen(void)
#define GameFlag_Set
static void Actor_ShowEmote(s32 actor, s32 emote, s32 frames)
void Engine_EventOpenScreen(void)
s32 Engine_EventOpenMessage(s32 speaker, s32 flags)
void Engine_GameFlagSet(s32 flag)
void Engine_GameFlagClear(s32 flag)
void Engine_CameraWaitForMove(void)
void Engine_ActorWaitForMove(s32 actor)
void Engine_CameraFollowActor(s32 actor, s32 keep_position)
static void Map_CopyCellAttributes(s32 srcX, s32 srcY, s32 width, s32 height, s32 destX, s32 destY)
void Engine_ActorRunRepeatedMotion(s32 actor, s32 repeats)
void Engine_ActorSetAttachedEffect(s32 actor, s32 effect)
s32 Engine_RandomNext()
static void Event_PlayCue(s32 cue)
static void Map_SetShake(s32 horizontal, s32 vertical, s32 decay)
Sets shake amplitudes in fixed-point pixels and the per-frame decay factor.
static void Actor_SetChildValue(s32 actor, s32 value)
s32 Engine_GameFlagIsSet(s32 flag)
static void Actor_SetSpeed(s32 actor, s32 speed, s32 acceleration)
void Engine_MapRedraw(void)
static s32 Random_Next(void)
void Engine_ColorBufferInterpolate(s32 frames)
static void Camera_MoveTo(s32 fixed_x, s32 fixed_y, s32 fixed_z, s32 pan)
static void Actor_SetPosition(s32 actor, s32 fixed_x, s32 fixed_z)
void Engine_EventWait(s32 frames)
static void Actor_SetAttachedEffect(s32 actor, s32 effect)
void Engine_ColorBufferApplyTarget(s32 value, s32 mode)
void Engine_ColorBufferApplySource(s32 value, s32 mode)
static struct FieldActor * Actor_Get(s32 actor)
static void ColorBuffer_ApplySource(s32 value, s32 mode)
@ TRANSITION_WINDOW
Definition field_obj.h:17
@ TRANSITION_BACKDROP_FADE
Definition field_obj.h:16
#define SCENE_TRANSITION(style, variant)
Definition field_obj.h:20
@ 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 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_FACE_PARTY
#define EVENT_SCRIPT(script)
@ 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_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_UNNAMED
@ SEARCH_CHEST
The scene service layer: one typed inline for each engine service a scene calls by its own name,...
static s32 Task_AddCallback(void(*callback)(void), s32 priority)
Calls the main-image scheduler through engine_call.h.
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_SOL_SANCTUM_HERB_FOUND
Definition flags.h:688
#define FLAG_RETREAT_BLOCKED
Retreat is blocked, from Psynergy or an item.
Definition flags.h:55
#define FLAG_SCENE_TEMP_00
Definition flags.h:713
#define FLAG_SOL_SANCTUM_NORTHEAST_LIGHT_SHOWN
Definition flags.h:674
#define FLAG_SOL_SANCTUM_FALLING_LIGHTS_SEEN
The statues' lights have flashed and fallen through the Luna room.
Definition flags.h:655
#define FLAG_SOL_SANCTUM_ISAAC_SEARCHING_FOR_KRADEN
Isaac agreed to look farther on while Kraden studies the rooms.
Definition flags.h:684
#define FLAG_SOL_SANCTUM_ERUPTED
The volcano has erupted and the sanctum's rooms rumble and shake.
Definition flags.h:660
#define FLAG_SCENE_TEMP_02
Definition flags.h:715
#define FLAG_SOL_SANCTUM_SOUTHWEST_LIGHT_SHOWN
Definition flags.h:675
#define FLAG_SOL_SANCTUM_STAR_ROOM_PASSAGE_OPEN
The floor has opened over the way up to the Elemental Star room.
Definition flags.h:666
#define FLAG_SOL_SANCTUM_LUNA_PICTURE_CHANGED
Kraden has seen the picture of Luna change to Sol.
Definition flags.h:651
#define FLAG_SOL_SANCTUM_FLOOR_SYMBOL_SEEN
Kraden has seen the symbol on the floor change.
Definition flags.h:653
#define FLAG_SOL_SANCTUM_NORTHEAST_SEAL_OPEN
Definition flags.h:646
#define FLAG_KEEP_PARTY_POSITION
Definition flags.h:93
#define FLAG_SOL_SANCTUM_SOUTHEAST_SEAL_OPEN
Definition flags.h:648
#define FLAG_SOL_SANCTUM_FOUND
Crossbone Isle's pursuer room: a pursuer is after the leader.
Definition flags.h:641
#define FLAG_SOL_SANCTUM_STATUE_TRAP_SPRUNG
The statues' lights have flashed as Kraden stood among them.
Definition flags.h:657
#define FLAG_SOL_SANCTUM_NORTHWEST_LIGHT_SHOWN
The light each seal shows in the Luna and Sol rooms, lit or dark.
Definition flags.h:673
#define FLAG_SOL_SANCTUM_SOUTHWEST_SEAL_OPEN
Definition flags.h:647
#define FLAG_SCENE_TEMP_01
Definition flags.h:714
#define FLAG_SOL_SANCTUM_SOUTHEAST_LIGHT_SHOWN
Definition flags.h:676
#define FLAG_SOL_SANCTUM_NORTHWEST_SEAL_OPEN
A statue stands on its seal and the seal's light shines.
Definition flags.h:645
#define FLAG_SOL_SANCTUM_KRADEN_SAID_YOU_FOUND_IT
Kraden has praised Isaac after the seals' lights flashed.
Definition flags.h:669
#define FLAG_SOL_SANCTUM_LUNA_SOL_ROOMS_SEEN
Kraden has seen the Luna and Sol rooms and asked the party to search on.
Definition flags.h:643
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.
The hardware's I/O registers and their bits, as pret names them.
#define PLTT_BACKDROP
Definition io_reg.h:155
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_HERB
Definition item_ids.h:40
void Map_ClearLayerEntryFlag(u32 channelIndex)
Resumes tile animation channel channelIndex by clearing its paused byte.
The reel game's title lettering.
Palette fades, the battle effect palette buffers and the colour channel curves.
@ PALETTE_TRANSFORM_PLAIN
each colour unchanged
Definition palbuf.h:72
void BattleFx_SetQueuedSoundAndPlay(s32 soundId)
Plays SE_298, then soundId (SE_289 for -1), and remembers soundId for BattleFx_PlayQueuedSound in the...
Definition requests.c:90
static void Event_KradenStopsPartyLeaving(void)
Heading out before the stars are bagged: the party is called back.
static void Event_TalkToKraden(void)
Talking to Kraden: about the stars still to bag, or the hostages.
void InitializeSceneRecordBuffer()
static void SolSanctumLunaSolRooms_DiscussFloorSymbolChangingToLuna(void)
Kraden notices that the symbol on the floor has changed from Sol to Luna.
const struct ScenePlacement * SolSanctumLunaSolRooms_GetPlacements(void)
Returns the eight statues (actors 8 to 15), Kraden (actor 16), Jenna and Garet, all of them always pl...
static void SolSanctumLunaSolRooms_DrawAlternateSavedStatueLights(void)
Draws the saved lights using their alternate tile rows.
static void SolSanctumLunaSolRooms_SpringStatueTrap(void)
The seals' lights flash ever faster around Kraden, who hurries back to Isaac.
static void SolSanctumLunaSolRooms_UpdateFirstStatueLight(void)
Animates the first falling light and manages the shared shake pulse.
struct SceneEvent gSolSanctumLunaSolRoomsEvents[]
static void SolSanctumLunaSolRooms_AnimateSavedStatueLights(void)
The lights of the seals Isaac has opened since flash ever faster in the room of Luna.
static void Event_UpdateRoomTintInverse(void)
Crossing cell code 14: as code 13, with the tints the other way round.
static void SolSanctumLunaSolRooms_RunStatueLightSequence(void)
The seals' lights flash and lights fall through the room of Luna while Kraden calls on Isaac to stop.
const struct SceneEntrance * SolSanctumLunaSolRooms_GetEntrances(void)
static void SolSanctumLunaSolRooms_FlashCurrentStatueLights(s32 frames)
Flashes both tile sets of the current statue lights at this pace.
static void SolSanctumLunaSolRooms_UpdateSecondStatueLight(void)
Animates the second falling light with its own random restart delay, as the first.
const struct SceneEvent * SolSanctumLunaSolRooms_GetEvents(void)
Returns the floor's cell codes that tint the rooms, Kraden's talk and cutscenes, the floor symbol and...
static void SolSanctumLunaSolRooms_DrawStatueLightTiles(s32 firstFlag, s32 sourceRow)
Draws the light of each open seal, from four consecutive flags, with the tiles of the given source ro...
static void SolSanctumLunaSolRooms_DrawCurrentStatueLights(void)
Draws the active lights from the current statue flags.
static void SolSanctumLunaSolRooms_UpdateFourthStatueLight(void)
Animates the fourth falling light with its own random restart delay, as the first.
static void Event_RestorePlainTint(void)
Crossing cell code 15: the room fades back to its plain colours.
const struct SceneRegion * SolSanctumLunaSolRooms_GetRegions(void)
static void SolSanctumLunaSolRooms_ShowMessageAndWait(s32 speaker, s32 waitFrames)
Advances the active dialogue and pauses for the requested frames.
struct ScenePlacement gSolSanctumLunaSolRoomsPlacements[]
static void Event_KradenSeesLunaPictureChange(void)
Walking up to Kraden once all four seals are open: the picture of Luna has changed to Sol.
static void SolSanctumLunaSolRooms_DrawAlternateCurrentStatueLights(void)
Draws the current lights using their alternate tile rows.
static void SolSanctumLunaSolRooms_ShowFloatingEye(void)
Entering after the eruption the first time: in a white flash a floating eye shows itself to Isaac and...
u32 gSolSanctumLunaSolRoomsExits[]
static void SolSanctumLunaSolRooms_FlashSavedStatueLights(s32 frames)
Flashes both tile sets of the saved statue lights at this pace.
static s32 SolSanctumLunaSolRooms_AreAllStatueLightsLit(void)
Returns 1 when all four seals are open.
static void SolSanctumLunaSolRooms_PrepareStatueTransition(void)
Opens on Kraden in the room of Luna with its first tint, as a flash crosses it.
static void Event_RiseToElementalStarRoom(void)
Searching the floor symbol after Kraden has seen it change: the floor opens, and Isaac then Kraden ri...
s32 SolSanctumLunaSolRooms_Initialize(void)
Restores puzzle tiles and plays the cutscene this entrance calls for.
static void Event_KradenFindsHall(void)
Walking into the hall the first time: Kraden studies the symbols and asks the party to keep exploring...
static void SolSanctumLunaSolRooms_IntroduceSolAndLunaRooms(void)
Kraden finds the room of Luna beside the room of Sol, and asks Isaac to look farther up the passage.
struct SceneEntrance gSolSanctumLunaSolRoomsEntrances[]
static void SolSanctumLunaSolRooms_UpdateThirdStatueLight(void)
Animates the third falling light with its own random restart delay, as the first.
static void Event_ClearBackdropColor(void)
Crossing cell code 19: the backdrop turns black.
#define FLAG_SOL_SANCTUM_FLOATING_EYE_SEEN
static void SolSanctumLunaSolRooms_DrawSavedStatueLights(void)
Draws the active lights from the saved statue flags.
static void Event_ApplySecondRoomTint(void)
Crossing cell code 12: the room fades to its second tint.
static void Event_UpdateRoomTint(void)
Crossing cell code 13: the room fades to the tint that matches the seals' lights.
const u32 * SolSanctumLunaSolRooms_GetExits(void)
Song and sound effect ids, indices into gSound_SongTable.
#define SE_220
Definition songs.h:215
#define SE_201
Definition songs.h:196
#define SE_107
Definition songs.h:100
#define SE_187
Definition songs.h:182
#define SE_171
Definition songs.h:166
#define MUS_017
Definition songs.h:27
#define MUS_021
Definition songs.h:31
#define SE_190
Definition songs.h:185
#define SE_141
Definition songs.h:134
#define SE_246
Definition songs.h:241
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_TaskWait()
void Engine_EventSetMessage()
void Engine_EventShowMessage()
#define NULL
Definition bilibin.h:6
s32 gSolSanctumLunaSolRooms_FlashState
u16 gSolSanctumLunaSolRooms_Light3Timer
u16 gSolSanctumLunaSolRooms_Light1Timer
u16 gSolSanctumLunaSolRooms_Light2Timer
u16 gSolSanctumLunaSolRooms_Light4Timer
#define STATIC_ASSERT(condition)
C89 permits repeated extern declarations of the same array.
#define offsetof(type, member)
Definition stddef.h:19
An animated sprite: its image and shadow, scale, rotation, size and up to four animation layers.
Definition animspr.h:108
u8 flags
bits: 1 outlined in ObjectSystemWork's edge and fill colours | 0 shadow drawn (set when created)
Definition animspr.h:128
s32 scale
16.16 fixed point, 0x10000 full size
Definition animspr.h:111
The colour buffer (heap block 32) that fades the BG and OBJ palettes: the source palette,...
Definition palbuf.h:40
u16 target[0x540]
the colours current moves toward, as current
Definition palbuf.h:47
u16 palette[0x1c0]
The source palette, RGB555: 224 BG colours, then 224 OBJ colours; palette[0] is the backdrop.
Definition palbuf.h:43
The work slot pointers from the event work (slot 27) onward, reaching the palette buffer work in slot...
void * slots28To31[4]
not read here
u8 * paletteBufferWork
slot 32, gPaletteBufferWork
struct EventWork * event
slot 27, gEventWork
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
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
union FieldCoordinate z
16.16 fixed-point pixels
Definition field_obj.h:37
s16 entrance
Definition game_state.h:37
A scene entrance: where and facing which way the party arrives, and the camera's bounds there (-1 for...
Definition field_scene.h:54
A scene event: its kind and detail, the trigger it answers, its condition and its value (a message or...
An actor a scene places: its sprite, the condition for placing it, how it behaves,...
Definition field_scene.h:81
A scene's exit region: the box that, while its condition holds, takes the party leader out through it...
The system's routines and globals: interrupts, BIOS sound bias, random numbers and sleep.
The integer types, TRUE, UNUSED and the fixed-address macros.
signed int s32
Definition types.h:14
unsigned int u32
Definition types.h:15
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