Alchemy
Loading...
Searching...
No Matches

lalivero.c

Go to the documentation of this file.
1/// @file
2/// Lalivero, the desert town below Babi Lighthouse.
3///
4/// Two visits share this scene. On the first, the party and Iodem find Tolbi's
5/// soldiers beaten by Saturos's group, who took Sheba to the ruins under the
6/// lighthouse. After Venus Lighthouse, the party comes back through the aerie's
7/// exit and Iodem gives them the Black Orb that sails Babi's ship.
8
9#include "game_state.h"
10#include "unit/scene/lalivero.h"
11#include "unit/object/object.h"
13#include "battle.h"
14#include "debug.h"
15#include "field.h"
16#include "game.h"
17#include "graphics.h"
18#include "menu.h"
19#include "minigame.h"
20#include "sound.h"
21#include "system.h"
22#include "types.h"
23#include "field_event.h"
24#include "field_scene.h"
25#include "field_service.h"
26#include "field_effect.h"
27#include "item_ids.h"
28#include "text/msg_ids.h"
29#include "ability_ids.h"
30#include "objcmd.h"
31#include "songs.h"
32#include "flags.h"
33
34static void TalkToIodemAboutTheShip(void);
35
36enum {
39 /// Arriving from Venus Lighthouse's aerie: 90 also plays the talk about the
40 /// ship the party saw from the lighthouse.
43};
44
45/// The actors this scene's code moves, by their place in the placement tables.
46enum {
47 SOLDIER_WEST = 8, ///< Tolbi's soldiers, wounded on the first visit
49 MOURNER = 10, ///< sobs for Sheba (gLaliveroMournerSobs)
52 WHARF_GUARD = 18, ///< keeps the door to Babi's ship
53 IODEM = 22,
54 TORCH = 23, ///< the Mars Djinni
55 NORTH_EXIT_SPRITE = 24, ///< placed after Venus Lighthouse
57};
58
59/// The door at trigger 6 is a gate two cells wide.
60enum { GATE_TRIGGER = 6 };
61
62enum {
67};
68
69/// Torch, Mars Djinni 6, joins the party.
70static void TalkToTorch(void) { Djinn_JoinParty(TORCH, 2, 6); }
71
73 return gLaliveroEntrances;
74}
75
76const struct SceneRegion *Lalivero_GetRegions(void) { return NULL; }
77
78const u32 *Lalivero_GetExits(void) { return gLaliveroExits; }
79
80/// The townsfolk, who stand differently once the party is back from Venus
81/// Lighthouse.
85 }
87}
88
89/// The villager mourning Sheba stops sobbing to answer, faces north again and
90/// goes back to sobbing.
91static void TalkToMourner(s32 actor) {
93
94 struct FieldActor *object;
95
96 object = Actor_Get(actor);
97 object->scaleX = 0x10000;
98 object = Actor_Get(actor);
99 object->scaleY = 0x10000;
100 Engine_EventSetMessage(MsgLaliveroOhhTheyTookShebaHeaded);
101 Event_ShowMessage(actor, 0);
105}
106
107/// After Venus Lighthouse: a villager asks whether the party is leaving
108/// Lalivero, and answers yes or no.
110 s32 message = MsgLaliveroLeavingLalivero;
111 Engine_EventSetMessage(message);
112 Engine_EventOpenMessage(actor, 0);
115 Engine_EventSetMessage(message + 1);
116 } else {
117 Engine_EventSetMessage(message + 2);
118 }
119 Engine_EventShowMessage(actor, 0);
120}
121
122/// Once Iodem has given the Black Orb, the guard at the wharf door lets the
123/// party through and steps aside.
124static void TalkToWharfGuard(void) {
125
127 Engine_EventSetMessage(MsgLaliveroWasToldLetInIf);
129 Actor_SetSpeed(WHARF_GUARD, 0x10000, 0x8000);
133}
134
135/// The leader walks into a doorway: the door (or the gate) swings open, the
136/// leader steps in and the exit of the touched trigger is taken.
137static void EnterDoor(void) {
139 s32 x = gLaliveroDoorCells[door][0];
140 s32 y = gLaliveroDoorCells[door][1];
141
144 if (door == GATE_TRIGGER) {
147 } else {
150 }
154}
155
156/// An exit with no door: leave by the touched trigger's exit.
157static void TakeTouchedExit(void) {
158 struct EventWork *work = gEventWork;
159 s16 *trigger = (s16 *)&work->touchedTrigger;
160 s32 exit = *trigger;
161
162 work->transitionFrames = 16;
164}
165
166/// The first visit, arriving from the world map: the party and Iodem find
167/// Tolbi's soldiers beaten in the street. Seven attackers took Sheba to the
168/// ruins under Babi Lighthouse, and Faran followed them.
169static void WatchWoundedSoldiers(void) {
170 struct FieldActor *leader;
171
173 Engine_EventSetMessage(MsgLaliveroMoreTolbisSoldiersLayDefeated);
174 // The party walks in from the south; the two soldiers lie on the ground.
182 // Iodem steps out from the party and looks them over.
187 Actor_SetSpeed(IODEM, 0x10000, 0x8000);
188 Actor_WalkByAndWait(IODEM, 0, -16);
203 // The soldiers know Iodem's voice: seven attackers took Sheba.
261 // Iodem paces while they tell where the attackers went.
263 Actor_SetSpeed(IODEM, 0x1cccc, 0xe666);
264 Actor_WalkToAndWait(IODEM, 256, 360);
289 Actor_SetSpeed(IODEM, 0x19999, 0xcccc);
290 Actor_WalkToAndWait(IODEM, 256, 384);
305 Actor_SetSpeed(IODEM, 0x13333, 0x9999);
306 // Iodem resolves to follow; the soldiers send the party on.
346 // Iodem walks back into the leader.
347 Actor_SetSpeed(IODEM, 0x13333, 0x9999);
350 if (leader != 0) {
351 Actor_SetDestination(IODEM, leader->x.part.pixel, leader->z.part.pixel);
352 }
357}
358
359/// Trigger 50 after Venus Lighthouse, until Iodem has spoken: Garet stops
360/// the leader, Iodem comes out of his house and tells the party that the
361/// misty island they saw may be Lemuria, which could save Babi, and gives them
362/// the Black Orb that sails Babi's ship.
363static void ReceiveBlackOrb(void) {
364 struct FieldActor *leader;
365
368 Engine_EventSetMessage(MsgLaliveroWhereGoingIsaacIodemAsked);
369 // Garet reminds the leader that Iodem asked them to wait; the answer
370 // picks Mia's reply.
382 if (Engine_EventChooseYesNo(0, 0) == 0) {
387 gEventWork->message += 1;
388 } else {
392 gEventWork->message += 1;
394 }
405 // The party lines up facing Iodem's door.
407 Actor_WalkBy(IVAN, 0, -16);
408 Actor_WalkBy(MIA, 0, -8);
418 // Iodem comes out: the door opens (cells 34, 0 drawn at 4, 18) and closes
419 // behind him (cells 32, 0).
420 Actor_SetSpeed(IODEM, 0xcccc, 0x6666);
423 Map_CopyCellsLayered(34, 0, 1, 2, 4, 18);
427#if TBS_PATCH_2
430#endif
432#if TBS_PATCH_2
433 Actor_WalkToAndWait(IODEM, 72, 328);
434#else
436#endif
437 // The door shuts.
438 Engine_MapCopyCellsLayered(32, 0, 1, 2, 4, 18);
501 if (Engine_EventChooseYesNo(0, 0) == 0) {
506 gEventWork->message += 1;
507 } else {
511 gEventWork->message += 1;
513 }
522 // Iodem takes out the Black Orb.
524 Event_ShowMessage(-1, 0);
527 Engine_ActorJump(MIA, 4, 13);
528 Engine_ActorJump(MIA, 4, 30);
534 // Arriving through the aerie, the party also talks about the ship they saw
535 // from the lighthouse.
538 }
539 Engine_EventSetMessage(MsgLaliveroBabiToldMeShipAncients);
562 // He holds the orb out, the leader takes it, and he steps back.
563 Actor_SetSpeed(ACTOR_BLACK_ORB, 0xcccc, 0x6666);
568 gEventWork->message += 1;
571 Actor_Get(IODEM)->steeringFlags &= ~ACTOR_FACES_MOTION;
572 Actor_WalkByAndWait(IODEM, 0, -16);
573 Actor_Get(IODEM)->steeringFlags |= ACTOR_FACES_MOTION;
574 Actor_FaceDirection(IODEM, 0x4100, 0);
592 // Iodem goes back inside.
593 Actor_WalkByAndWait(IODEM, -16, 0);
596 Map_CopyCellsLayered(34, 0, 1, 2, 4, 18);
599 Actor_WalkByAndWait(IODEM, 0, -16);
602 // The door shuts.
603 Engine_MapCopyCellsLayered(32, 0, 1, 2, 4, 18);
606 // The others are eager to sail, then walk back into the leader.
627 Actor_SetSpeed(GARET, 0x13333, 0x9999);
628 Actor_SetSpeed(MIA, 0x13333, 0x9999);
629 Actor_SetSpeed(IVAN, 0x13333, 0x9999);
631 leader = Object_GetById(0);
632 if (leader != 0) {
633 Actor_SetDestination(GARET, leader->x.part.pixel, leader->z.part.pixel);
634 }
638 leader = Object_GetById(0);
639 if (leader != 0) {
640 Actor_SetDestination(MIA, leader->x.part.pixel, leader->z.part.pixel);
641 }
643 Actor_SetPosition(MIA, 0, 0);
645 leader = Object_GetById(0);
646 if (leader != 0) {
647 Actor_SetDestination(IVAN, leader->x.part.pixel, leader->z.part.pixel);
648 }
650 Actor_SetPosition(IVAN, 0, 0);
653}
654
655/// The ship the party saw from the lighthouse was not Babi's but, Garet
656/// guesses, Saturos's.
657static void TalkToIodemAboutTheShip(void) {
658 Engine_EventSetMessage(MsgLaliveroThoughtShipWeSawAt);
695}
696
697/// Trigger 51 at the town exit: Garet turns the leader back toward Babi's
698/// ship and the wharf the guard was keeping.
699static void TurnBackFromTheGate(void) {
701 Engine_EventSetMessage(MsgLaliveroWhereGoingArentWeTaking);
705}
706
707/// What the party can talk to, touch and search, which changes once they are
708/// back from Venus Lighthouse.
709const struct SceneEvent *Lalivero_GetEvents(void) {
712 }
713 return gLaliveroEvents;
714}
715
716/// Sets Lalivero up as the party enters: the Black Orb prop, the wounded
717/// soldiers of the first visit (and its cutscene), or the north exit closed
718/// after Venus Lighthouse.
720 union FieldObject *object;
721 struct AnimationObject *sprite;
722 u8 *icon;
723
724 // Coming back from the lighthouse switches the town to its later state.
728 }
731 }
734
735 // Three sprite 0xee props stand in animation 3 and block nothing.
737 Actor_Get(19)->collisionFlags = 0;
740 Actor_Get(20)->collisionFlags = 0;
743 Actor_Get(21)->collisionFlags = 0;
746
747 // The Black Orb Iodem hands over is drawn from its item icon, floating
748 // 10 pixels up.
749 object = (union FieldObject *)Actor_Get(ACTOR_BLACK_ORB);
750 object->actor.retainSpriteCache = 1;
751 object->actor.motionFlags = 0;
752 sprite = object->actor.sprite;
753 object->actor.y.fixed = PIXELS(10);
754 sprite->count = 0;
755 sprite->image.fullColor = 0;
756 sprite->image.palette = 0;
761
763 // Something now stands at the north exit, and its three cells take the
764 // attributes of cell (20, 23).
766 Actor_Get(NORTH_EXIT_SPRITE)->collisionFlags = 0;
767 Map_CopyCellAttributes(20, 23, 1, 1, 14, 4);
768 Map_CopyCellAttributes(20, 23, 1, 1, 15, 4);
769 Map_CopyCellAttributes(20, 23, 1, 1, 16, 4);
772 }
773 } else {
774 // The first visit: the two soldiers lie on the ground, drawn under the
775 // party, and cells beside them take the attributes of cell (20, 23). The
776 // third cell, at x 78, is far from both soldiers.
777 object = (union FieldObject *)Actor_Get(SOLDIER_WEST);
778 object->actor.collisionFlags = 0;
779 object->actor.priorityFlags |= ACTOR_PRIORITY_UNDERFOOT;
780 object->actor.sprite->flags = 0;
781 object->actor.sprite->rotation = FACING_NORTH;
782 object = (union FieldObject *)Actor_Get(SOLDIER_EAST);
783 object->actor.collisionFlags = 0;
784 object->actor.priorityFlags |= ACTOR_PRIORITY_UNDERFOOT;
785 object->actor.sprite->flags = 0;
786 object->actor.sprite->rotation = FACING_SOUTH;
787 Map_CopyCellAttributes(20, 23, 1, 1, 13, 23);
788 Map_CopyCellAttributes(20, 23, 1, 1, 14, 23);
789 Map_CopyCellAttributes(20, 23, 1, 1, 78, 23);
790 Map_CopyCellAttributes(20, 23, 1, 1, 17, 23);
791 Map_CopyCellAttributes(20, 23, 1, 1, 18, 23);
796 // The two villagers who wander stay put during the cutscene.
797 object = (union FieldObject *)Actor_Get(WANDERER_EAST);
798 object->actor.paused = 1;
799 object = (union FieldObject *)Actor_Get(WANDERER_WEST);
800 object->actor.paused = 1;
802 object = (union FieldObject *)Actor_Get(WANDERER_EAST);
803 object->actor.paused = 0;
804 object = (union FieldObject *)Actor_Get(WANDERER_WEST);
805 object->actor.paused = 0;
806 }
807 }
808 return 0;
809}
810
811/// The mourner's sobbing: the sprite squashes and stretches twice, then
812/// rests 80 frames.
814 SC_SET(SW_SCALE_X, 0x10000),
815 SC_SET(SW_SCALE_Y, 0x10000),
816 SC_ADD(SW_SCALE_X, -0x4000),
817 SC_ADD(SW_SCALE_Y, 0x2000),
818 SC_WAIT(2),
819 SC_ADD(SW_SCALE_X, 0x2000),
820 SC_ADD(SW_SCALE_Y, -0x1000),
821 SC_WAIT(2),
822 SC_ADD(SW_SCALE_X, 0x1000),
823 SC_ADD(SW_SCALE_Y, -2048),
824 SC_WAIT(2),
825 SC_ADD(SW_SCALE_X, 0x1000),
826 SC_ADD(SW_SCALE_Y, -2048),
827 SC_WAIT(4),
828 SC_ADD(SW_SCALE_X, -0x4000),
829 SC_ADD(SW_SCALE_Y, 0x2000),
830 SC_WAIT(2),
831 SC_ADD(SW_SCALE_X, 0x2000),
832 SC_ADD(SW_SCALE_Y, -0x1000),
833 SC_WAIT(2),
834 SC_ADD(SW_SCALE_X, 0x1000),
835 SC_ADD(SW_SCALE_Y, -2048),
836 SC_WAIT(2),
837 SC_ADD(SW_SCALE_X, 0x1000),
838 SC_ADD(SW_SCALE_Y, -2048),
839 SC_WAIT(80),
841};
842
844 {0, CONDITION_ALWAYS, 172, 0, 149, FACING_SOUTH, 0, -1, -1, -1, -1, 0},
845 {1, CONDITION_ALWAYS, 72, 0, 184, FACING_SOUTH, 0, -1, -1, -1, -1, 0},
846 {2, CONDITION_ALWAYS, 152, 0, 216, FACING_SOUTH, 0, -1, -1, -1, -1, 0},
847 {3, CONDITION_ALWAYS, 200, 0, 168, FACING_SOUTH, 0, -1, -1, -1, -1, 0},
848 {4, CONDITION_ALWAYS, 296, 0, 168, FACING_SOUTH, 0, -1, -1, -1, -1, 0},
849 {5, CONDITION_ALWAYS, 360, 0, 168, FACING_SOUTH, 0, -1, -1, -1, -1, 0},
850 {6, CONDITION_ALWAYS, 432, 0, 152, FACING_SOUTH, 0, -1, -1, -1, -1, 0},
851 {7, CONDITION_ALWAYS, 72, 0, 328, FACING_SOUTH, 0, -1, -1, -1, -1, 0},
852 {8, CONDITION_ALWAYS, 104, 0, 312, FACING_SOUTH, 0, -1, -1, -1, -1, 0},
853 {9, CONDITION_ALWAYS, 360, 0, 280, FACING_SOUTH, 0, -1, -1, -1, -1, 0},
854 {10, CONDITION_ALWAYS, 440, 0, 328, FACING_SOUTH, 0, -1, -1, -1, -1, 0},
855 {11, CONDITION_ALWAYS, 424, 0, 264, FACING_SOUTH, 0, -1, -1, -1, -1, 0},
856 {20, CONDITION_ALWAYS, 248, 0, 416, FACING_NORTH, 0, -1, -1, -1, -1, 0},
857 {21, CONDITION_ALWAYS, 248, 0, 64, FACING_SOUTH, 0, -1, -1, -1, -1, 0},
859};
860
862 SCENE_EXITS(178), SCENE_EXIT(1, 180, 30), SCENE_EXIT(2, 179, 1),
863 SCENE_EXIT(3, 180, 23), SCENE_EXIT(4, 179, 6), SCENE_EXIT(5, 179, 4),
864 SCENE_EXIT(6, 179, 11), SCENE_EXIT(7, 180, 21), SCENE_EXIT(8, 180, 22),
865 SCENE_EXIT(9, 179, 9), SCENE_EXIT(10, 179, 2), SCENE_EXIT(11, 179, 10),
866 SCENE_EXIT(20, 2, 30), SCENE_EXIT(21, 2, 59), SCENE_EXITS_END,
867};
868
869// clang-format off
872 PIXELS(224), 0, PIXELS(392), FACING_SOUTH, TALK_KEEP_FACING, 0 },
874 PIXELS(288), 0, PIXELS(392), FACING_SOUTH, TALK_KEEP_FACING, 0 },
876 PIXELS(248), 0, PIXELS(96), FACING_NORTH, TALK_FACE_PARTY, 0 },
878 PIXELS(312), 0, PIXELS(280), FACING_EAST, TALK_FACE_PARTY, 0 },
882 PIXELS(136), 0, PIXELS(296), FACING_EAST, TALK_FACE_PARTY, 0 },
884 PIXELS(440), 0, PIXELS(296), FACING_SOUTH, TALK_FACE_PARTY, 0 },
886 PIXELS(408), 0, PIXELS(168), FACING_WEST, TALK_FACE_PARTY, 0 },
888 PIXELS(200), 0, PIXELS(184), FACING_EAST, TALK_FACE_PARTY, 0 },
890 PIXELS(248), 0, PIXELS(280), FACING_SOUTH, TALK_FACE_PARTY, 0 },
892 PIXELS(72), 0, PIXELS(184), FACING_SOUTH, TALK_FACE_PARTY, 0 },
894 PIXELS(152), 0, PIXELS(160), FACING_SOUTH, TALK_FACE_PARTY, 0 },
896 PIXELS(344), 0, PIXELS(128), FACING_SOUTH, TALK_FACE_PARTY, 0 },
898 PIXELS(440), 0, PIXELS(400), FACING_SOUTH, TALK_FACE_PARTY, 0 },
900 PIXELS(-64), 0, PIXELS(-64), FACING_EAST, TALK_KEEP_FACING, 0 },
901 { 0x5c, 0x5e, ACTOR_STAND,
902 PIXELS(200), 0, PIXELS(136), FACING_EAST, TALK_FACE_PARTY, 0 },
903 { SCENE_TABLE_END },
904};
905
908 PIXELS(216), 0, PIXELS(376), FACING_SOUTH, TALK_FACE_PARTY, 0 },
912 PIXELS(248), 0, PIXELS(112), FACING_SOUTH, TALK_FACE_PARTY, 0 },
914 PIXELS(312), 0, PIXELS(296), FACING_EAST, TALK_FACE_PARTY, 0 },
916 PIXELS(304), 0, PIXELS(200), FACING_SOUTH, TALK_FACE_PARTY, 0 },
918 PIXELS(136), 0, PIXELS(296), FACING_EAST, TALK_FACE_PARTY, 0 },
920 PIXELS(440), 0, PIXELS(296), FACING_SOUTH, TALK_FACE_PARTY, 0 },
922 PIXELS(408), 0, PIXELS(168), FACING_WEST, TALK_FACE_PARTY, 0 },
924 PIXELS(200), 0, PIXELS(184), FACING_EAST, TALK_FACE_PARTY, 0 },
926 PIXELS(248), 0, PIXELS(232), FACING_WEST, TALK_FACE_PARTY, 0 },
928 PIXELS(72), 0, PIXELS(184), FACING_SOUTH, TALK_FACE_PARTY, 0 },
930 PIXELS(152), 0, PIXELS(160), FACING_SOUTH, TALK_FACE_PARTY, 0 },
932 PIXELS(344), 0, PIXELS(128), FACING_SOUTH, TALK_FACE_PARTY, 0 },
934 PIXELS(440), 0, PIXELS(400), FACING_SOUTH, TALK_FACE_PARTY, 0 },
936 PIXELS(-64), 0, PIXELS(-64), FACING_EAST, TALK_KEEP_FACING, 0 },
937 { 0x5c, 0x5e, ACTOR_STAND,
938 PIXELS(200), 0, PIXELS(136), FACING_EAST, TALK_FACE_PARTY, 0 },
940 PIXELS(248), 0, PIXELS(80), FACING_SOUTH, TALK_KEEP_FACING, 0 },
942 PIXELS(-64), 0, PIXELS(-64), FACING_SOUTH, TALK_KEEP_FACING, 0 },
944 0, 0, 0, FACING_EAST, TALK_FACE_PARTY, 0 },
946 0, 0, 0, FACING_EAST, TALK_FACE_PARTY, 0 },
948 0, 0, 0, FACING_EAST, TALK_FACE_PARTY, 0 },
949 { SCENE_TABLE_END },
950};
951
953 { 0, 0 }, { 4, 9 }, { 9, 11 }, { 12, 8 }, { 18, 8 }, { 22, 8 }, { 26, 7 }, { 4, 18 },
954 { 0, 0 }, { 22, 15 }, { 27, 18 }, { 0, 0 },
955};
956
958 MAP_CELL_STEP(33, 0, 1, 2, 8), MAP_CELL_STEP(34, 0, 1, 2, 1), MAP_CELL_STEPS_END,
959};
960
962 MAP_CELL_STEP(34, 2, 2, 2, 8), MAP_CELL_STEP(36, 2, 2, 2, 1), MAP_CELL_STEPS_END,
963};
964
966 { EVENT_EXIT, 20, CONDITION_ALWAYS, 20 },
967 { EVENT_EXIT, 21, CONDITION_ALWAYS, 21 },
979 { EVENT_TALK, 8, CONDITION_ALWAYS, MSGNO(MsgLaliveroUhhnnWeWereTakenBySurprise) },
980 { EVENT_TALK, 9, CONDITION_ALWAYS, MSGNO(MsgLaliveroTheyWereTerribleWeWereNo) },
982 { EVENT_TALK, 11, CONDITION_ALWAYS, MSGNO(MsgLaliveroActorIsOurOnlyHopeIf) },
983 { EVENT_TALK, 12, CONDITION_ALWAYS, MSGNO(MsgLaliveroThisAllHappenedBecauseTolbiTook) },
984 { EVENT_TALK, 13, CONDITION_ALWAYS, MSGNO(MsgLaliveroFaranFollowedActorImSureHell) },
985 { EVENT_TALK, 14, CONDITION_ALWAYS, MSGNO(MsgLaliveroTheRumblingAtTheRuinsMust) },
986 { EVENT_TALK, 15, CONDITION_ALWAYS, MSGNO(MsgLaliveroThereWasAnEarthquakeAtThe) },
987 { EVENT_TALK, 16, CONDITION_ALWAYS, MSGNO(MsgLaliveroIfIWereBiggerIWould) },
988 { EVENT_TALK, 17, CONDITION_ALWAYS, MSGNO(MsgLaliveroIBetActorCanUseHer) },
989 { EVENT_TALK, 18, CONDITION_ALWAYS, MSGNO(MsgLaliveroBabisMostPreciousBelongingIsKept) },
990 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 8, CONDITION_ALWAYS, MSGNO(MsgLaliveroIfOnlyTheyDidntHaveActor) },
991 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 9, CONDITION_ALWAYS, MSGNO(MsgLaliveroTheyUsedFireOnUsThats) },
992 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 10, CONDITION_ALWAYS, MSGNO(MsgLaliveroCursesWeCouldntStopActorAnd) },
993 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 11, CONDITION_ALWAYS, MSGNO(MsgLaliveroWhatDoTheyPlanToDo) },
994 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 12, CONDITION_ALWAYS, MSGNO(MsgLaliveroWeNeverShouldHaveLetTolbi) },
995 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 13, CONDITION_ALWAYS, MSGNO(MsgLaliveroFaranStillDoesNotReturnWhat) },
996 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 14, CONDITION_ALWAYS, MSGNO(MsgLaliveroWeHaveSeenManyOmensOf) },
997 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 15, CONDITION_ALWAYS, MSGNO(MsgLaliveroTheStonesWeStackedForThe) },
998 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 16, CONDITION_ALWAYS, MSGNO(MsgLaliveroITriedToStepInFront) },
999 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 17, CONDITION_ALWAYS, MSGNO(MsgLaliveroTheyAllHaveALessonComing) },
1000 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 18, CONDITION_ALWAYS, MSGNO(MsgLaliveroIWonderWhatBabisMostPrecious) },
1002 { SEARCH(SEARCH_JAR), 100, 0xfb6, FIND_ITEM(ITEM_WATER_OF_LIFE) },
1004 { 0x8413, 102, 0xfb8, FIND_ITEM(ITEM_WARRIORS_HELM) },
1005 { SCENE_EVENTS_END },
1006};
1007
1024 { EVENT_TALK, 8, CONDITION_ALWAYS, MSGNO(MsgLaliveroHaHaIThoughtTheyHad) },
1025 { EVENT_TALK, 9, CONDITION_ALWAYS, MSGNO(MsgLaliveroIWillNeverLetMyGuard) },
1026 { EVENT_TALK, 10, CONDITION_ALWAYS, MSGNO(MsgLaliveroWhereCouldActorBeNowIm) },
1028 { EVENT_TALK, 12, CONDITION_ALWAYS, MSGNO(MsgLaliveroISawTheBeaconOfVenus) },
1029 { EVENT_TALK, 13, CONDITION_ALWAYS, MSGNO(MsgLaliveroTheExplosionInTheVenusRuins) },
1030 { EVENT_TALK, 14, CONDITION_ALWAYS, MSGNO(MsgLaliveroThePeninsulaBehindVenusLighthouseIs) },
1031 { EVENT_TALK, 15, CONDITION_ALWAYS, MSGNO(MsgLaliveroICantBelieveYouEscapedVenus) },
1032 { EVENT_TALK, 16, CONDITION_ALWAYS, MSGNO(MsgLaliveroIfYouDefeatedThatEvilBunch) },
1033 { EVENT_TALK, 17, CONDITION_ALWAYS, MSGNO(MsgLaliveroActorJumpedIntoTheOceanFrom) },
1034 { EVENT_TALK, 24, CONDITION_ALWAYS, MSGNO(MsgLaliveroNoTrespassingDangerBeyondThisPoint) },
1035 { EVENT_TALK, 18, CONDITION_ALWAYS, MSGNO(MsgLaliveroApparentlyAShipHasBeenDocked) },
1036 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 8, CONDITION_ALWAYS, MSGNO(MsgLaliveroIAmAllHealedNowBut) },
1037 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 9, CONDITION_ALWAYS, MSGNO(MsgLaliveroIWantedToBeAPart) },
1038 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 10, CONDITION_ALWAYS, MSGNO(MsgLaliveroIfActorUsedHerGreatPowers) },
1039 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 11, CONDITION_ALWAYS, MSGNO(MsgLaliveroAfterEverythingThatsHappenedLaliveroNo) },
1040 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 12, CONDITION_ALWAYS, MSGNO(MsgLaliveroVenusLighthouseHasBeenTheSymbol) },
1041 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 13, CONDITION_ALWAYS, MSGNO(MsgLaliveroIodemOfTolbiDoesntSeemToo) },
1042 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 14, CONDITION_ALWAYS, MSGNO(MsgLaliveroTheOceanIsSoRoughSince) },
1043 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 15, CONDITION_ALWAYS, MSGNO(MsgLaliveroVenusLighthouseIsStillStandingStrong) },
1044 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 16, CONDITION_ALWAYS, MSGNO(MsgLaliveroYouMustBeGreatWarriorsTo) },
1045 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 17, CONDITION_ALWAYS, MSGNO(MsgLaliveroActorWouldBeFineEvenAfter) },
1046 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 18, CONDITION_ALWAYS, MSGNO(MsgLaliveroThisSureSeemsLikeAStrange) },
1048 { SEARCH(SEARCH_JAR), 100, 0xfb6, FIND_ITEM(ITEM_WATER_OF_LIFE) },
1051 { SCENE_EVENTS_END },
1052};
1053// clang-format on
Ability numbers, named from the English release.
@ ABILITY_MIND_READ
Definition ability_ids.h:16
void Motion_LaunchFromFocusedObject(u32 objectId, s32 xOffset, s32 zOffset, s32 action)
Places an actor on the leader and sends it walking (xOffset, zOffset) pixels away at speed 0....
struct FieldActor * Object_GetById(s32 actor)
Returns an actor, or NULL if it does not exist.
#define GARET
Jerald.
#define MIA
Mary.
#define IVAN
Ivan.
void Engine_ActorSetSpriteFlags(struct FieldActor *, s32)
The engine calls the debug menus import, and their palette swatch tiles.
void Djinn_JoinParty(s32 slot, s32 element, s32 djinn)
A Djinni joins the party: djinn (0 to 19) of element goes to the member with the fewest Djinn,...
Definition djinni.c:124
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_WALK
Definition field_event.h:44
@ ANIM_STAND
Definition field_event.h:43
@ ANIM_NOD
Definition field_event.h:45
@ ANIM_SHAKE_HEAD
Definition field_event.h:46
static s32 Event_OpenMessage(s32 speaker, s32 flags)
static void Actor_SetDestination(s32 actor, s32 x, s32 z)
static void Actor_FaceDirection(s32 actor, s32 facing, s32 frames)
void Engine_ActorSetAnimationAndWait(s32 actor, s32 animation)
static void Map_AnimateCells(const u16 *steps, s32 destX, s32 destY)
void Engine_ActorSetSpritePriority(s32 actor, s32 priority)
s32 Engine_EventChooseYesNo(s32 actor, s32 flags)
s32 Engine_PartyGiveItem(s32 item, s32 flags)
#define GameFlag_IsSet
static void Actor_WalkToAndWait(s32 actor, s32 x, s32 z)
void Engine_ActorJump(s32 actor, s32 height, s32 frames)
void Engine_ItemLoadIcon(s32 item)
#define EMOTE_IN_FRONT
Definition field_event.h:49
#define MAP_CELL_STEP(srcX, srcY, width, height, frames)
Definition field_event.h:59
static void Actor_SetDestinationOffset(s32 actor, s32 dx, s32 dz)
void Engine_ActorFaceDirection(s32 actor, s32 facing, s32 frames)
static void Actor_FaceActor(s32 actor, s32 target, s32 frames)
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)
static void Actor_WalkByAndWait(s32 actor, s32 dx, s32 dz)
void Engine_MapCopyCellsLayered(s32 srcX, s32 srcY, s32 destX, s32 destY, s32 width, s32 height)
void Engine_EventOpenScreen(void)
s32 Engine_EventOpenMessage(s32 speaker, s32 flags)
void Engine_GameFlagSet(s32 flag)
static void Actor_SetActionScript(s32 actor, const s32 *script)
The engine encodes either a built-in action or an action-script address.
void Engine_ActorWaitForMove(s32 actor)
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)
static void Event_ShowMessage(s32 speaker, s32 flags)
static void Event_PlayCue(s32 cue)
#define MAP_CELL_STEPS_END
Definition field_event.h:61
s32 Engine_GameFlagIsSet(s32 flag)
static void Actor_WalkBy(s32 actor, s32 dx, s32 dz)
static void Actor_CenterAndWalk(s32 actor, s32 priority, s32 dz)
static void Actor_SetSpeed(s32 actor, s32 speed, s32 acceleration)
static void Actor_SetPosition(s32 actor, s32 fixed_x, s32 fixed_z)
static void Map_CopyCellsLayered(s32 srcX, s32 srcY, s32 destX, s32 destY, s32 width, s32 height)
void Engine_ActorFaceEachOther(s32 actor, s32 other, s32 frames)
void Engine_EventWait(s32 frames)
static struct FieldActor * Actor_Get(s32 actor)
@ TRANSITION_BACKDROP_FADE
Definition field_obj.h:16
@ ACTOR_PRIORITY_UNDERFOOT
The depth sort treats it as 320 pixels higher on the screen.
Definition field_obj.h:155
@ ACTOR_FALLS
falls by its gravity and bounces
Definition field_obj.h:161
#define ACTOR_NO_TARGET
A target coordinate that is not set: the object has no target.
Definition field_obj.h:145
#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
#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_KEEP_FACING
@ TALK_FACE_PARTY
@ TALK_FACE_PARTY_AND_BACK
#define PSYNERGY_ON_ACTOR(ability)
#define EVENT_SCRIPT(script)
@ ACTOR_WANDER
@ ACTOR_STAND
#define SEARCH(target)
#define SCENE_EXITS_END
Definition field_scene.h:77
#define TOUCH_WALKING_INTO(facing)
@ FACING_NORTHEAST
Definition field_scene.h:33
@ FACING_EAST
Definition field_scene.h:26
@ FACING_SOUTHEAST
Definition field_scene.h:27
@ FACING_NORTH
Definition field_scene.h:32
@ FACING_SOUTH
Definition field_scene.h:28
@ FACING_WEST
Definition field_scene.h:30
#define PIXELS(value)
@ SEARCH_JAR
@ SEARCH_STONE_PILLAR
@ SEARCH_CHEST
The scene service layer: one typed inline for each engine service a scene calls by its own name,...
static void FieldMotion_LaunchFromFocusedObject(s32 actor, s32 dx, s32 dz, s32 facing)
Game flags, named where their meaning is shown.
#define FLAG_RETURNED_FROM_VENUS_LIGHTHOUSE
The party is back from Venus Lighthouse, by the aerie's exit.
Definition flags.h:272
#define FLAG_SAW_SHIP_FROM_VENUS_LIGHTHOUSE
The party saw the ship from Venus Lighthouse before coming back.
Definition flags.h:274
#define FLAG_LALIVERO_WOUNDED_SOLDIERS_SEEN
Definition flags.h:275
#define FLAG_IODEM_FAREWELL_SEEN
Iodem gave the Black Orb.
Definition flags.h:276
#define FLAG_LALIVERO_WHARF_OPEN
the guard lets the party to the ship
Definition flags.h:277
GameState, the game's state: play time, coins, the scene and the leader's position,...
struct GameState gGameState
#define IODEM
The screen blend's globals and the graphics routines.
Item numbers, named from the English release.
@ ITEM_BLACK_ORB
Definition item_ids.h:80
@ ITEM_WARRIORS_HELM
Definition item_ids.h:35
@ ITEM_WATER_OF_LIFE
Definition item_ids.h:49
@ ITEM_PSY_CRYSTAL
Definition item_ids.h:46
s16 gLaliveroDoorCells[][2]
Definition lalivero.c:952
u16 gLaliveroDoorOpenSteps[]
Definition lalivero.c:957
static void TalkToVillagerAskingIfLeaving(s32 actor)
After Venus Lighthouse: a villager asks whether the party is leaving Lalivero, and answers yes or no.
Definition lalivero.c:109
@ ENTRANCE_FROM_AERIE_QUIETLY
Definition lalivero.c:42
@ ENTRANCE_FROM_AERIE
Arriving from Venus Lighthouse's aerie: 90 also plays the talk about the ship the party saw from the ...
Definition lalivero.c:41
@ ENTRANCE_WORLD_MAP_NORTH
Definition lalivero.c:38
@ ENTRANCE_WORLD_MAP_SOUTH
Definition lalivero.c:37
const struct ScenePlacement * Lalivero_GetPlacements(void)
The townsfolk, who stand differently once the party is back from Venus Lighthouse.
Definition lalivero.c:82
static void WatchWoundedSoldiers(void)
The first visit, arriving from the world map: the party and Iodem find Tolbi's soldiers beaten in the...
Definition lalivero.c:169
const struct SceneRegion * Lalivero_GetRegions(void)
Definition lalivero.c:76
static void TalkToIodemAboutTheShip(void)
The ship the party saw from the lighthouse was not Babi's but, Garet guesses, Saturos's.
Definition lalivero.c:657
struct ScenePlacement gLaliveroPlacements[]
Definition lalivero.c:870
struct SceneEvent gLaliveroEvents[]
Definition lalivero.c:965
const u32 * Lalivero_GetExits(void)
Definition lalivero.c:78
const struct SceneEntrance * Lalivero_GetEntrances(void)
Definition lalivero.c:72
s32 Lalivero_Initialize(void)
Sets Lalivero up as the party enters: the Black Orb prop, the wounded soldiers of the first visit (an...
Definition lalivero.c:719
s32 gLaliveroMournerSobs[]
The mourner's sobbing: the sprite squashes and stretches twice, then rests 80 frames.
Definition lalivero.c:813
u16 gLaliveroGateOpenSteps[]
Definition lalivero.c:961
static void TalkToWharfGuard(void)
Once Iodem has given the Black Orb, the guard at the wharf door lets the party through and steps asid...
Definition lalivero.c:124
static void EnterDoor(void)
The leader walks into a doorway: the door (or the gate) swings open, the leader steps in and the exit...
Definition lalivero.c:137
static void TakeTouchedExit(void)
An exit with no door: leave by the touched trigger's exit.
Definition lalivero.c:157
const struct SceneEvent * Lalivero_GetEvents(void)
What the party can talk to, touch and search, which changes once they are back from Venus Lighthouse.
Definition lalivero.c:709
u32 gLaliveroExits[]
Definition lalivero.c:861
static void ReceiveBlackOrb(void)
Trigger 50 after Venus Lighthouse, until Iodem has spoken: Garet stops the leader,...
Definition lalivero.c:363
struct ScenePlacement gLaliveroPlacementsAfterLighthouse[]
Definition lalivero.c:906
@ WHARF_GUARD
keeps the door to Babi's ship
Definition lalivero.c:52
@ ACTOR_BLACK_ORB
Definition lalivero.c:56
@ SOLDIER_EAST
Definition lalivero.c:48
@ NORTH_EXIT_SPRITE
placed after Venus Lighthouse
Definition lalivero.c:55
@ SOLDIER_WEST
Tolbi's soldiers, wounded on the first visit.
Definition lalivero.c:47
@ MOURNER
sobs for Sheba (gLaliveroMournerSobs)
Definition lalivero.c:49
@ WANDERER_WEST
Definition lalivero.c:51
@ TORCH
the Mars Djinni
Definition lalivero.c:54
@ WANDERER_EAST
Definition lalivero.c:50
static void TalkToMourner(s32 actor)
The villager mourning Sheba stops sobbing to answer, faces north again and goes back to sobbing.
Definition lalivero.c:91
struct SceneEvent gLaliveroEventsAfterLighthouse[]
Definition lalivero.c:1008
static void TalkToTorch(void)
Torch, Mars Djinni 6, joins the party.
Definition lalivero.c:70
@ ITEM_ICON_TILE_BYTES
Definition lalivero.c:66
@ ITEM_ICON_BUFFER_SIZE
Definition lalivero.c:64
@ HEAP_ITEM_ICON
Definition lalivero.c:63
@ ITEM_ICON_TILES
Definition lalivero.c:65
@ GATE_TRIGGER
Definition lalivero.c:60
struct SceneEntrance gLaliveroEntrances[]
Definition lalivero.c:843
static void TurnBackFromTheGate(void)
Trigger 51 at the town exit: Garet turns the leader back toward Babi's ship and the wharf the guard w...
Definition lalivero.c:699
The reel game's title lettering.
Field object scripts: one s32 command word, then its operands, as gScriptObject_CommandTable runs the...
#define SC_SET(w, v)
Write a work value.
Definition objcmd.h:37
#define SC_LOOP(n, to)
Repeat up to n times.
Definition objcmd.h:28
#define SC_FOREVER
Definition objcmd.h:14
#define SC_ADD(w, v)
Definition objcmd.h:38
#define SC_WAIT(n)
Wait n frames.
Definition objcmd.h:16
#define SC_TOP
Script start.
Definition objcmd.h:13
@ SW_SCALE_Y
Definition objcmd.h:63
@ SW_SCALE_X
Definition objcmd.h:62
Song and sound effect ids, indices into gSound_SongTable.
#define SE_159
Definition songs.h:154
#define SE_DOOR_OPEN
Definition songs.h:153
void Engine_ActorSetAnimation()
struct EventWork * gEventWork
void Engine_EventRequestExit()
void Engine_EventEnd(void)
void Engine_AudioPlayCue()
void Engine_EventBegin(void)
void Engine_EventSetMessage()
void Engine_EventShowMessage()
#define NULL
Definition bilibin.h:6
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
u8 slot
VRAM cache entry holding its tiles.
Definition animspr.h:112
u8 count
layers in use, up to the last one present
Definition animspr.h:129
u16 fullColor
256 colours; set for both parts when created
Definition animspr.h:94
The running scene's event work: its placement and event tables, its actors, the triggers and exit it ...
Definition event_work.h:20
s32 startTransition
SCENE_TRANSITION(style, variant).
Definition event_work.h:43
s16 touchedTrigger
the step event a touch or exit event answers
Definition event_work.h:26
s32 transitionFrames
frames
Definition event_work.h:45
u16 message
the next message, advanced as each window opens
Definition event_work.h:47
A field actor: a person or thing on the field with a position, motion toward a target,...
Definition field_obj.h:30
u8 motionFlags
ActorMotionFlag bits; zero is free flight in 3D, and 3 is set on creation.
Definition field_obj.h:83
union FieldCoordinate x
16.16 fixed-point pixels
Definition field_obj.h:35
s32 targetZ
16.16 fixed-point pixels; ACTOR_NO_TARGET when unset
Definition field_obj.h:61
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
signed short s16
Definition types.h:12
unsigned short u16
Definition types.h:13
unsigned char u8
Definition types.h:11
struct FieldCoordinate::@024321007066302143002254325121164243234242211074 part
An object on the field, read as an actor or as an effect.