Alchemy
Loading...
Searching...
No Matches

vale_interiors.c

Go to the documentation of this file.
1/// @file
2/// The houses and shops of Vale. Garet's family lives in the house at entrance
3/// 6: his grandfather, his grandmother, and his parents ("Mom, Dad... I'm
4/// home...").
5
6#include "script.h"
7#include "game_state.h"
8#include "unit/import.h"
10#include "unit/object/object.h"
12#include "unit/field/field.h"
14#include "facing_object.h"
15#include "field_event.h"
16#include "field_scene.h"
17#include "call.h"
18#include "fxblend.h"
19#include "field_event.h"
20#include "field_service.h"
21#include "text/msg_ids.h"
22#include "types.h"
23#include "ability_ids.h"
24#include "field_scene.h"
25#include "item_ids.h"
26#include "objcmd.h"
27#include "facing_object.h"
28#include "fixed_math.h"
29#include "ram_buffer.h"
30#include "flags.h"
31#include "songs.h"
32
34 /// Garet's grandfather. "Isaac, please take care of my grandson, Garet."
36 /// Garet's grandmother. "Grandma! What's the matter? Are you choking?"
38 /// Garet's father.
39 /// "I'm proud of you, Garet. My own son...on such an important quest!"
41 /// Garet's mother. "As mothers, Dora and I will always worry about you."
43 /// Jenna's grandmother. "Please return my precious granddaughter, Jenna,
44 /// to me." Once Jenna is taken, actor 14 says she "grew sick with despair",
45 /// and she lies in bed.
50 /// Three sprites drifting up from Garet's sleeping grandfather.
52};
53
54// Forward declarations.
55static void Event_GaretComesHome(void);
56static void ValeInteriors_SpawnDriftingSprite(void);
57
59
60/// Moves and grows a sprite drifting up from Garet's sleeping grandfather.
61///
62/// Called each frame by gValeInteriors_DriftingSpriteScript; the actor's
63/// timer and work are its x and y steps in signed 8.8 pixels, set by
64/// ValeInteriors_SpawnDriftingSprite.
65static s32
67 struct FieldActor *actor = (struct FieldActor *)interpreter;
68
69 actor->x.fixed += (s16)actor->timer * 256;
70 actor->y.fixed += (s16)actor->work * 256;
71 actor->scaleX += Q16_ONE / 40;
72 actor->scaleY += Q16_ONE / 40;
73 actor->timer += 5;
74 actor->work = (s16)actor->work - 1;
75 return 0;
76}
77
80}
81
82const struct SceneRegion *ValeInteriors_GetRegions(void) { return NULL; }
83
84/// On the stormy night, the doors lead out into the storm.
89}
90
91/// Selects the placements for the day the story begins, after the party has
92/// left Vale (FLAG_PARTY_LEFT_VALE), or after Kalay (FLAG_REACHED_KALAY), and
93/// marks which of their actors are in view.
95 struct ScenePlacement *table;
96
101 } else {
103 }
105 return table;
106}
107
108/// Selects the events for the current visit to Vale: the stormy night's
109/// (FLAG_VALE_STORM), after Kalay, after the party has left, or the day the
110/// story begins.
119}
120
121/// A villager asks whether Isaac knew why Kraden came to Vale. He came to
122/// study Mt. Aleph.
123///
124/// Reached by talking to actor 15 on the day the story begins.
127 Engine_EventSetMessage(MsgValeKradenCameToStudyMt);
131}
132
133/// A villager asks Isaac to help scare Kraden's visitors.
134///
135/// Reached by talking to actor 19 on the day the story begins.
136static void Event_AskToScareVisitors(void) {
138 Engine_EventSetMessage(MsgValeLetsScareKradensVisitors);
142}
143
144/// After the party has left Vale, the item shopkeeper gives Isaac a Herb as a
145/// farewell gift, and afterwards urges him to save Jenna.
146///
147/// Called by Event_TalkToItemShopkeeper away from the counter, after the party
148/// has left and before Kalay. Gives the Herb and sets
149/// FLAG_VALE_FAREWELL_HERB_RECEIVED once; afterwards the shopkeeper turns to
150/// watch the leader.
152 s32 gift;
153
156 Engine_EventSetMessage(MsgValeYouMustSaveJenna);
161 } else {
162 gift = MsgValeThisIsMyFarewellGift;
165 Engine_MessageShowCentered((gift + 1), 1);
168 }
170}
171
172/// A villager tells of the culprits' strange powers and asks about them.
173///
174/// Reached by talking to actor 16 after the party has left Vale.
177 Engine_EventSetMessage(MsgValeTheCulpritsHadStrangePowers);
180}
181
182/// Back from Kalay, Garet's father asks whether Isaac heard them talking about
183/// Dora.
184///
185/// Reached by talking to Garet's father (actor 10) after Kalay.
186static void Event_AskAboutDora(void) {
188 Engine_EventSetMessage(MsgValeDidYouHearAboutDora);
191}
192
193/// Garet's mother hopes the travelers did not get sick on the way.
194///
195/// Reached by talking to Garet's mother (actor 11) after Kalay.
198 Engine_EventSetMessage(MsgValeHopeDidntGet);
201}
202
203/// Leaves a house through its door: the exit sound plays and the screen
204/// closes, stopping the lightning first on the stormy night.
214}
215
216// The doors: stepping on cell code n, in every table, takes exit n.
218
220
222
224
226
228
230
232
233/// Arriving in a house: on the stormy night the residents are gone and
234/// lightning flashes outside; back from Kalay, entering Garet's house the first
235/// time plays his homecoming.
236///
237/// The scene's initialize entry. Runs Event_GaretComesHome from entrance 6
238/// after Kalay until FLAG_GARET_CAME_HOME is set. From entrance 2, once the
239/// party has left Vale, Jenna's grandmother lies sick in bed.
241 struct FieldActor *actor;
242 struct EventWork **eventSlot = &gEventWork;
243
245 // The late visit hides residents while lightning plays outside the house.
249 Engine_ActorSetPosition(10, 0, 0);
250 Engine_ActorSetPosition(11, 0, 0);
251 Engine_ActorSetPosition(12, 0, 0);
252 Engine_ActorSetPosition(13, 0, 0);
253 Engine_ActorSetPosition(14, 0, 0);
254 Engine_ActorSetPosition(15, 0, 0);
255 Engine_ActorSetPosition(16, 0, 0);
256 Engine_ActorSetPosition(17, 0, 0);
257 Engine_ActorSetPosition(18, 0, 0);
258 Engine_ActorSetPosition(19, 0, 0);
259 Engine_ActorSetPosition(20, 0, 0);
260 Engine_ActorSetPosition(21, 0, 0);
261 Engine_ActorSetPosition(22, 0, 0);
263 (*(struct FieldBlendWork **)((u8 *)eventSlot + Ram_SceneMapStateOffset))
264 ->loud = 1;
266 Engine_TaskWait(30);
270 }
271 // The returning party gets the household reunion only on its first visit.
273 if (gGameState.entrance == 6) {
276 }
277 }
279 }
280 // Once Jenna is taken, her grandmother lies sick in bed.
281 if (gGameState.entrance == 2) {
284 PIXELS(150));
289 }
290 }
291 return 0;
292}
293
294/// Opens the weapon shop across the counter, or the shopkeeper speaks.
295///
296/// Reached by talking to the weapon shopkeeper (actor 21) in every table but
297/// the stormy night's. Facing north, across the counter, opens shop 1; else
298/// the shopkeeper's line follows the story.
300 struct FieldActor *leader;
301
303
304 if (FACING_IS_NORTH(leader->facing)) {
306 return;
307 }
308
311 Engine_EventSetMessage(MsgValeYouCameBack);
313 } else {
315 Engine_EventSetMessage(MsgValeValeFeelsEmpty);
316 } else {
317 Engine_EventSetMessage(MsgValeGoodWeaponsDrawOutStrength);
318 }
320 }
322}
323
324/// Opens the armor shop across the counter, or the shopkeeper speaks.
325///
326/// Reached by talking to the armor shopkeeper (actor 22) in every table but
327/// the stormy night's; opens shop 2 when facing north.
329 struct FieldActor *actor;
330
332 if (FACING_IS_NORTH(actor->facing)) {
334 } else {
337 Engine_EventSetMessage(MsgValeTheRumorWasTrue);
338 } else {
340 Engine_EventSetMessage(MsgValeImNotSadJustGo);
341 } else {
342 Engine_EventSetMessage(MsgValeGoodArmorDrawsOutStrength);
343 }
344 }
347 }
348}
349
350/// Opens the item shop across the counter, or the shopkeeper speaks.
351///
352/// Reached by talking to the item shopkeeper (actor 20) in every table but
353/// the stormy night's; opens shop 3 when facing north. After the party has
354/// left and before Kalay, ValeInteriors_GiveFarewellHerb speaks instead.
355static void Event_TalkToItemShopkeeper(void) {
356 struct FieldActor *actor;
357
359 if (FACING_IS_NORTH(actor->facing)) {
361 } else {
364 Engine_EventSetMessage(MsgValeWhenDidYouComeBack);
367 } else {
370 } else {
372 Engine_EventSetMessage(MsgValeAWiseManFleesWhen);
375 }
376 }
377 }
378}
379
380/// Garet's grandparents and father nod.
381static inline void ValeInteriors_FamilyNods(void) {
386}
387
388/// Starts the repeated motion before waiting for the requested animation.
390 s32 animation) {
392 Engine_ActorSetAnimationAndWait(actorId, animation);
393}
394
395/// Back from Kalay, Garet comes home: his grandfather dozes, his parents argue
396/// over whether to look for him, and his grandmother spots him first. Garet
397/// introduces Ivan and Mia, the family sees them off, and his father paces.
398///
399/// Called by ValeInteriors_Initialize from entrance 6 after Kalay, until
400/// FLAG_GARET_CAME_HOME is set; sets it. Adds and removes the callback
401/// ValeInteriors_SpawnDriftingSprite, and leaves the father pacing.
402static void Event_GaretComesHome(void) {
403 struct FieldActor *driftingSprite;
404 struct FieldActor *actor;
406 SchedulerCallback timedUpdate;
407 const s32 *partyScript;
408
409 // The party walks in while Garet's grandfather dozes, sleep drifting up
410 // from him.
412 Camera_MoveTo(-1, -1, -1, 0);
416 Actor_SetSpeed(GARET, PIXELS(2) / 5, PIXELS(1) / 5);
417 Actor_SetSpeed(IVAN, PIXELS(2) / 5, PIXELS(1) / 5);
418 Actor_SetSpeed(MIA, PIXELS(2) / 5, PIXELS(1) / 5);
421 driftingSprite = Actor_Get(ACTOR_FIRST_DRIFTING_SPRITE);
422 Engine_ActorSetSpriteFlags(driftingSprite, 0);
423 driftingSprite = Actor_Get(ACTOR_FIRST_DRIFTING_SPRITE + 1);
424 Engine_ActorSetSpriteFlags(driftingSprite, 0);
425 driftingSprite = Actor_Get(ACTOR_FIRST_DRIFTING_SPRITE + 2);
426 Engine_ActorSetSpriteFlags(driftingSprite, 0);
427 motionFlags = 0;
432 FieldScheduler_AddCallback(timedUpdate, 0xc80);
440 if (actor != NULL) {
441 Actor_SetPosition(GARET, actor->x.fixed, actor->z.fixed);
442 }
444 if (actor != NULL) {
445 Actor_SetPosition(IVAN, actor->x.fixed, actor->z.fixed);
446 }
448 if (actor != NULL) {
449 Actor_SetPosition(MIA, actor->x.fixed, actor->z.fixed);
450 }
451 Actor_WalkTo(GARET, 792, 512);
452 Actor_WalkTo(IVAN, 824, 504);
453 Actor_WalkToAndWait(MIA, 818, 524);
469 Engine_EventWait(300);
471 // The camera pans slowly up to Garet's parents. His father, pacing, asks
472 // whether they should look for Garet; Isaac still does not know about
473 // Dora. His mother teases that he misses Garet.
474 Camera_SetSpeed(PIXELS(1) / 10, PIXELS(1) / 80);
475 Camera_MoveTo(PIXELS(786), 0, PIXELS(430), 1);
476 Engine_EventWait(240);
484 Engine_EventSetMessage(MsgValeHey2);
487 0, 20);
498 0, 10);
505 0, 20);
514 0, 10);
522 // Garet's grandmother sees him and chokes on her words; his mother asks if
523 // she is choking, his father thinks she misses Garet too.
533 40);
540 10);
545 // No, it really is Garet: both parents turn and call his name together.
551 10);
559 ACTOR_GARETS_MOTHER, 12, 1, 7, 1, 0);
561 Camera_SetSpeed(PIXELS(8) / 5, PIXELS(1) / 5);
562 Camera_MoveTo(PIXELS(777), 0, PIXELS(468), 1);
568 // His grandfather wakes, and the sleep stops drifting.
569 Engine_TaskRemoveCallback(timedUpdate);
574 20);
575 // The grandfather looks about, then jumps up with Garet's name.
576 Camera_MoveTo(PIXELS(750), 0, PIXELS(451), 1);
583 20);
586 40);
591 20);
592 // Garet goes to him; the grandfather asks whether the Wise One's mission
593 // is done, and a no skips one line of Garet's father.
594 Actor_SetSpeed(GARET, PIXELS(8) / 5, PIXELS(4) / 5);
595 Actor_WalkToAndWait(GARET, 789, 473);
607 if (Engine_EventChooseYesNo(0, 0) == 1) {
609 }
610 Camera_MoveTo(PIXELS(777), 0, PIXELS(428), 1);
616 // His mother knows he is leaving again soon; his grandparents are glad to
617 // see him well.
618 Engine_EventSetMessage(MsgValeYoureLeavingAgainSoon);
620 Camera_MoveTo(PIXELS(777), 0, PIXELS(468), 1);
638 // Garet introduces his new friends.
653 // Ivan, then Mia, step forward and introduce themselves; the family nods.
654 Actor_SetSpeed(IVAN, PIXELS(1), PIXELS(1) / 2);
655 Actor_WalkToAndWait(IVAN, 819, 489);
663 Actor_SetSpeed(MIA, PIXELS(1), PIXELS(1) / 2);
664 Actor_WalkToAndWait(MIA, 794, 520);
667 Actor_WalkToAndWait(MIA, 784, 496);
673 Camera_MoveTo(PIXELS(777), 0, PIXELS(428), 1);
675 // Garet's mother comes forward and asks them to look after young Garet.
681 Camera_MoveTo(PIXELS(777), 0, PIXELS(468), 1);
690 // His father: enough chit-chat, relax and enjoy your stay.
704 Actor_SetSpeed(IVAN, PIXELS(1), PIXELS(1) / 2);
706 Actor_SetActionScript(GARET, partyScript);
707 Actor_SetActionScript(IVAN, partyScript);
708 Actor_RunActionScriptAndWait(MIA, partyScript);
714}
715
716/// Sends a sprite drifting up from Garet's sleeping grandfather, one of the
717/// three at frames 10, 20 and 30 of every 180.
718///
719/// A callback Event_GaretComesHome adds while the grandfather dozes.
721 s32 actorId;
722 u32 cycleFrame;
723 struct FieldActor *actor;
724 struct FieldActor *origin;
725
726 cycleFrame = gFrameCount % 180;
728 switch (cycleFrame) {
729 case 10:
730 break;
731 case 20:
732 actorId = ACTOR_FIRST_DRIFTING_SPRITE + 1;
733 break;
734 case 30:
735 actorId = ACTOR_FIRST_DRIFTING_SPRITE + 2;
736 break;
737 default:
738 return;
739 }
740 actor = Object_GetById(actorId);
741 if (actor == NULL) {
742 return;
743 }
745 if (origin != NULL) {
746 Engine_ActorSetPosition(actorId, origin->x.fixed, origin->z.fixed);
747 }
748 // Restart this sprite above the origin with a small scale and 8.8 motion.
749 actor->scaleX = 2 * Q16_ONE / 5;
750 actor->scaleY = 2 * Q16_ONE / 5;
751 {
752 s32 height = actor->y.fixed + PIXELS(24);
753
754 actor->y.fixed = height;
755 actor->targetY = height;
756 // The drifting script consumes these two work fields as signed 8.8 steps.
757 actor->timer = 25; // 25/256 pixel per frame.
758 actor->work = 128; // 1/2 pixel per frame.
759 }
761}
762
764 SC_CALL(Scene_TurnTowardTarget),
766};
767
769 SC_SET(SW_SPEED, PIXELS(3) / 5),
770 SC_SET(SW_ACCEL, PIXELS(3) / 10),
771 SC_ARG(2),
772 SC_MOVE(PIXELS(784), 0, PIXELS(405)),
773 SC_SYNC,
774 SC_ARG(1),
775 SC_WAIT(40),
776 SC_LABEL(1),
777 SC_ADD(SW_FACING, -1024),
778 SC_WAIT(1),
779 SC_LOOP(16, SC_TO(1)),
780 SC_WAIT(40),
781 SC_LABEL(3),
782 SC_ADD(SW_FACING, -1024),
783 SC_WAIT(1),
784 SC_LOOP(16, SC_TO(3)),
785 SC_ARG(2),
786 SC_MOVE(PIXELS(819), 0, PIXELS(405)),
787 SC_SYNC,
788 SC_ARG(1),
789 SC_LABEL(2),
790 SC_ADD(SW_FACING, -2048),
791 SC_WAIT(1),
792 SC_LOOP(16, SC_TO(2)),
793 SC_WAIT(40),
795};
796
798 SC_ARG(2), SC_MOVE(PIXELS(808), 0, PIXELS(508)),
799 SC_SYNC, SC_ARG(1),
800 SC_POS(0, 0, 0), SC_WAIT(1),
801 SC_END,
802};
803
806 SC_WAIT(1),
807 SC_LOOP(60, SC_TOP),
808 SC_POS(0, 0, 0),
809 SC_WAIT(1),
810 SC_END,
811};
812
814 {0, CONDITION_ALWAYS, 120, 0, 100, FACING_SOUTH, 0, -1, -1, -1, -1, 0},
815 {1, CONDITION_ALWAYS, 96, 0, 222, FACING_NORTH, 0, 4, 4, 244, 292, 0},
816 {2, CONDITION_ALWAYS, 337, 0, 199, FACING_NORTH, 0, 252, 4, 548, 236, 0},
817 {3, CONDITION_ALWAYS, 656, 0, 244, FACING_NORTH, 0, 556, 4, 900, 276, 0},
818 {4, CONDITION_ALWAYS, 159, 0, 525, FACING_NORTH, 0, 4, 324, 332, 564, 0},
819 {5, CONDITION_ALWAYS, 528, 0, 486, FACING_NORTH, 0, 348, 284, 612, 516, 0},
820 {6, CONDITION_ALWAYS, 816, 0, 522, FACING_NORTH, 0, 628, 284, 884, 548, 0},
821 {7, CONDITION_ALWAYS, 463, 0, 851, FACING_NORTH, 0, 324, 604, 588, 884, 0},
822 {8, CONDITION_ALWAYS, 769, 0, 857, FACING_NORTH, 0, 580, 628, 852, 884, 0},
824};
825
827 SCENE_EXITS(7), SCENE_EXIT(1, 4, 10), SCENE_EXIT(2, 4, 9),
828 SCENE_EXIT(3, 5, 3), SCENE_EXIT(4, 5, 5), SCENE_EXIT(5, 4, 7),
829 SCENE_EXIT(6, 4, 6), SCENE_EXIT(7, 5, 4), SCENE_EXIT(8, 5, 1),
831};
832
834 SCENE_EXITS(7), SCENE_EXIT(1, 3, 10), SCENE_EXIT(2, 3, 9),
835 SCENE_EXIT(3, 5, 3), SCENE_EXIT(4, 5, 5), SCENE_EXIT(5, 3, 7),
836 SCENE_EXIT(6, 3, 6), SCENE_EXIT(7, 5, 4), SCENE_EXIT(8, 5, 1),
838};
839
840// clang-format off
842 { 0x75, 0x0, ACTOR_STAND,
844 { 0x6f, 0x0, ACTOR_STAND,
846 { 0x36, 0x0, ACTOR_WANDER,
847 PIXELS(815), 0, PIXELS(386), FACING_EAST, TALK_FACE_PARTY, 0 },
848 { 0x26, 0x0, ACTOR_STAND,
849 PIXELS(841), 0, PIXELS(455), FACING_NORTH, TALK_FACE_PARTY, 0 },
850 { 0x67, 0x0, ACTOR_STAND,
851 PIXELS(403), 0, PIXELS(144), FACING_WEST, TALK_FACE_PARTY, 0 },
852 { 0x6f, 0x0, ACTOR_STAND,
853 PIXELS(331), 0, PIXELS(144), FACING_EAST, TALK_KEEP_FACING, 0 },
854 { 0x73, 0x0, ACTOR_STAND,
855 PIXELS(486), 0, PIXELS(136), FACING_SOUTH, TALK_FACE_PARTY, 0 },
856 { 0x65, 0x0, ACTOR_STAND,
858 { 0x73, 0x0, ACTOR_STAND,
860 { 0x6c, 0x0, ACTOR_WANDER,
861 PIXELS(99), 0, PIXELS(125), FACING_NORTH, TALK_FACE_PARTY, 0 },
862 { 0x6a, 0x0, ACTOR_STAND,
863 PIXELS(768), 0, PIXELS(768), FACING_WEST, TALK_FACE_PARTY, 0 },
864 { 0x74, 0x0, ACTOR_STAND,
866 { 0x76, 0x0, ACTOR_STAND,
868 { 0x7c, 0x0, ACTOR_STAND,
869 PIXELS(232), 0, PIXELS(440), FACING_SOUTH, TALK_FACE_PARTY, 0 },
870 { 0x7d, 0x0, ACTOR_STAND,
871 PIXELS(264), 0, PIXELS(440), FACING_SOUTH, TALK_FACE_PARTY, 0 },
872 { SCENE_TABLE_END },
873};
874
876 { 0x75, 0x0, ACTOR_STAND,
877 PIXELS(697), 0, PIXELS(468), FACING_SOUTHEAST + FACING_STEP, 3, 0 },
878 { 0x6f, 0x0, ACTOR_STAND,
880 { 0x36, 0x0, ACTOR_WANDER,
881 PIXELS(815), 0, PIXELS(386), FACING_EAST, TALK_FACE_PARTY, 0 },
882 { 0x26, 0x0, ACTOR_STAND,
883 PIXELS(841), 0, PIXELS(455), FACING_NORTH, TALK_FACE_PARTY, 0 },
884 { 0x67, 0x0, ACTOR_STAND,
885 PIXELS(403), 0, PIXELS(144), FACING_WEST, TALK_FACE_PARTY, 0 },
886 { 0x6f, 0x0, ACTOR_STAND,
887 PIXELS(456), 0, PIXELS(156), FACING_EAST, TALK_KEEP_FACING, 0 },
888 { 0x73, 0x0, ACTOR_STAND,
889 PIXELS(486), 0, PIXELS(118), FACING_NORTH, TALK_FACE_PARTY, 0 },
890 { 0x65, 0x0, ACTOR_STAND,
892 { 0x73, 0x0, ACTOR_STAND,
894 { 0x6c, 0x0, ACTOR_WANDER,
895 PIXELS(99), 0, PIXELS(125), FACING_NORTH, TALK_FACE_PARTY, 0 },
896 { 0x6a, 0x0, ACTOR_STAND,
897 PIXELS(768), 0, PIXELS(768), FACING_WEST, TALK_FACE_PARTY, 0 },
898 { 0x74, 0x0, ACTOR_STAND,
900 { 0x76, 0x0, ACTOR_STAND,
901 PIXELS(72), 0, PIXELS(424), FACING_SOUTH, 3, 0 },
902 { 0x7c, 0x0, ACTOR_STAND,
903 PIXELS(232), 0, PIXELS(440), FACING_SOUTH, TALK_FACE_PARTY, 0 },
904 { 0x7d, 0x0, ACTOR_STAND,
905 PIXELS(264), 0, PIXELS(440), FACING_SOUTH, TALK_FACE_PARTY, 0 },
906 { SCENE_TABLE_END },
907};
908
911 0, 0, 0, FACING_NORTH, TALK_FACE_PARTY, 0 },
913 0, 0, 0, FACING_NORTH, TALK_FACE_PARTY, 0 },
915 0, 0, 0, FACING_NORTH, TALK_FACE_PARTY, 0 },
916 { 0x75, 0x0, ACTOR_STAND,
918 { 0x6f, 0x0, ACTOR_STAND,
921 PIXELS(819), 0, PIXELS(405), FACING_WEST + FACING_STEP, TALK_FACE_PARTY, 0 },
922 { 0x26, 0x0, ACTOR_STAND,
924 { 0x67, 0x0, ACTOR_STAND,
925 PIXELS(403), 0, PIXELS(144), FACING_WEST, TALK_FACE_PARTY, 0 },
926 { 0x6f, 0x0, ACTOR_STAND,
927 PIXELS(456), 0, PIXELS(156), FACING_EAST, TALK_FACE_PARTY, 0 },
928 { 0x73, 0x0, ACTOR_STAND,
929 PIXELS(494), 0, PIXELS(112), FACING_NORTH, TALK_FACE_PARTY, 0 },
930 { 0x65, 0x0, ACTOR_STAND,
932 { 0x73, 0x0, ACTOR_STAND,
934 { 0x6c, 0x0, ACTOR_WANDER,
935 PIXELS(99), 0, PIXELS(125), FACING_NORTH, TALK_FACE_PARTY, 0 },
936 { 0x6a, 0x0, ACTOR_STAND,
937 PIXELS(768), 0, PIXELS(768), FACING_WEST, TALK_FACE_PARTY, 0 },
938 { 0x74, 0x0, ACTOR_STAND,
940 { 0x76, 0x0, ACTOR_STAND,
941 PIXELS(72), 0, PIXELS(424), FACING_SOUTH, TALK_FACE_PARTY, 0 },
942 { 0x7c, 0x0, ACTOR_STAND,
943 PIXELS(232), 0, PIXELS(440), FACING_SOUTH, TALK_FACE_PARTY, 0 },
944 { 0x7d, 0x0, ACTOR_STAND,
945 PIXELS(264), 0, PIXELS(440), FACING_SOUTH, TALK_FACE_PARTY, 0 },
947 0, 0, 0, FACING_EAST, TALK_FACE_PARTY, 0 },
952 { SCENE_TABLE_END },
953};
954
964 { SEARCH(SEARCH_BOOKCASE), 200, CONDITION_ALWAYS, FIND_MESSAGE(MSGNO(MsgValeBooksAboutContinents)) },
965 { SEARCH(SEARCH_BOOKCASE), 201, CONDITION_ALWAYS, FIND_MESSAGE(MSGNO(MsgValeBookLawsOfVale)) },
966 { 0xc4f3, 202, CONDITION_ALWAYS, FIND_MESSAGE(MSGNO(MsgValeBookPowerOfNature)) },
967 { 0xc4f3, 203, CONDITION_ALWAYS, FIND_MESSAGE(MSGNO(MsgValeBookPsynergyStone)) },
968 { 0xc4f3, 204, CONDITION_ALWAYS, FIND_MESSAGE(MSGNO(MsgValeAuntNotebook)) },
969 { 0xc4f3, 205, CONDITION_ALWAYS, FIND_MESSAGE(MSGNO(MsgValeBookMakingGreatVillage)) },
970 { SEARCH(SEARCH_BOOKCASE), 206, CONDITION_ALWAYS, FIND_MESSAGE(MSGNO(MsgValeNotebookStudyOfAlchemy)) },
971 { SEARCH(SEARCH_BOOKCASE), 207, CONDITION_ALWAYS, FIND_MESSAGE(MSGNO(MsgValeBookAncientLemurians)) },
972 { SEARCH(SEARCH_BOOKCASE), 208, CONDITION_ALWAYS, FIND_MESSAGE(MSGNO(MsgValeBookFountainOfTolbi)) },
973 { SEARCH(SEARCH_BOOKCASE), 209, CONDITION_ALWAYS, FIND_MESSAGE(MSGNO(MsgValeEncyclopediaOfAlchemy)) },
974 { SEARCH(SEARCH_BOOKCASE), 210, CONDITION_ALWAYS, FIND_MESSAGE(MSGNO(MsgValeBookLegendOfAleph)) },
975 { SEARCH(SEARCH_BOOKCASE), 211, CONDITION_ALWAYS, FIND_MESSAGE(MSGNO(MsgValeBookBeingAdept)) },
976 { SEARCH(SEARCH_BARREL), 100, CONDITION_ALWAYS, FIND_MESSAGE(MSGNO(MsgVaultButDidntFindAnything)) },
977 { SEARCH(SEARCH_JAR), 101, CONDITION_ALWAYS, FIND_MESSAGE(MSGNO(MsgValeJarEmpty)) },
978 { SEARCH(SEARCH_JAR), 102, CONDITION_ALWAYS, FIND_MESSAGE(MSGNO(MsgValeJarEmpty)) },
979 { SEARCH(SEARCH_JAR), 103, CONDITION_ALWAYS, FIND_MESSAGE(MSGNO(MsgValeJarEmpty)) },
980 { SEARCH(SEARCH_JAR), 104, CONDITION_ALWAYS, FIND_MESSAGE(MSGNO(MsgValeJarEmpty)) },
982};
983
985 { EVENT_TALK, ACTOR_GARETS_GRANDFATHER, CONDITION_ALWAYS, MSGNO(MsgValeAtTheVeryLeastVisitorsShould) },
986 { EVENT_TALK, ACTOR_GARETS_GRANDMOTHER, CONDITION_ALWAYS, MSGNO(MsgValeIHearKradenHasGuestsAgain) },
987 { EVENT_TALK, ACTOR_GARETS_FATHER, CONDITION_ALWAYS, MSGNO(MsgValeGaretHasGrownQuiteStrongIn) },
988 { EVENT_TALK, ACTOR_GARETS_MOTHER, CONDITION_ALWAYS, MSGNO(MsgValeYouAndGaretAreOlderNow) },
989 { EVENT_TALK, 12, CONDITION_ALWAYS, MSGNO(MsgValeMyGranddaughterJennaIsFinallyHappy) },
990 { EVENT_TALK, ACTOR_JENNAS_GRANDMOTHER, CONDITION_ALWAYS, MSGNO(MsgValeIHopeYouTwoWontBe) },
991 { EVENT_TALK, 14, CONDITION_ALWAYS, MSGNO(MsgValeJennaIsTheSpittingImageOf) },
993 { EVENT_TALK, 16, CONDITION_ALWAYS, MSGNO(MsgValeIfThereAreVisitorsInTown) },
994 { EVENT_TALK, 17, CONDITION_ALWAYS, MSGNO(MsgValeDoYouEverDreamOfSeeing) },
995 { EVENT_TALK, 18, CONDITION_ALWAYS, MSGNO(MsgValeFewPeopleOutsideOfValePossess) },
1008 { SEARCH(SEARCH_BOOKCASE), 200, CONDITION_ALWAYS, FIND_MESSAGE(MSGNO(MsgValeBooksAboutContinents)) },
1009 { SEARCH(SEARCH_BOOKCASE), 201, CONDITION_ALWAYS, FIND_MESSAGE(MSGNO(MsgValeBookLawsOfVale)) },
1010 { 0xc4f3, 202, CONDITION_ALWAYS, FIND_MESSAGE(MSGNO(MsgValeBookPowerOfNature)) },
1011 { 0xc4f3, 203, CONDITION_ALWAYS, FIND_MESSAGE(MSGNO(MsgValeBookPsynergyStone)) },
1012 { 0xc4f3, 204, CONDITION_ALWAYS, FIND_MESSAGE(MSGNO(MsgValeAuntNotebook)) },
1013 { 0xc4f3, 205, CONDITION_ALWAYS, FIND_MESSAGE(MSGNO(MsgValeBookMakingGreatVillage)) },
1019 { SCENE_EVENTS_END },
1020};
1021
1023 { EVENT_TALK, ACTOR_GARETS_GRANDFATHER, CONDITION_ALWAYS, MSGNO(MsgValeIsaacPleaseTakeCareOfMy) },
1024 { EVENT_TALK, ACTOR_GARETS_GRANDMOTHER, CONDITION_ALWAYS, MSGNO(MsgValeReceivingAQuestDirectlyFromThe) },
1025 { EVENT_TALK, ACTOR_GARETS_FATHER, CONDITION_ALWAYS, MSGNO(MsgValeImProudOfYouGaretMy) },
1026 { EVENT_TALK, ACTOR_GARETS_MOTHER, CONDITION_ALWAYS, MSGNO(MsgValeAsMothersDoraAndIWill) },
1027 { EVENT_TALK, 12, CONDITION_ALWAYS, MSGNO(MsgValeIHeardThatJennaBrotherFelix) },
1028 { EVENT_TALK, ACTOR_JENNAS_GRANDMOTHER, CONDITION_ALWAYS, MSGNO(MsgValePleaseReturnMyPreciousGranddaughterJenna) },
1029 { EVENT_TALK, 14, CONDITION_ALWAYS, MSGNO(MsgValeAfterJennaWasTakenGrandmotherGrew) },
1030 { EVENT_TALK, 15, CONDITION_ALWAYS, MSGNO(MsgValeItsBecauseKradenWasStudyingAlchemy) },
1032 { EVENT_TALK, 17, CONDITION_ALWAYS, MSGNO(MsgValeImSoJealousOfYouBeing) },
1033 { EVENT_TALK, 18, CONDITION_ALWAYS, MSGNO(MsgValeOnceYouLeaveTownTakeCare) },
1034 { EVENT_TALK, 19, CONDITION_ALWAYS, MSGNO(MsgValeIHadNoIdeaThatSuch) },
1038 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), ACTOR_WEAPON_SHOPKEEPER, CONDITION_ALWAYS, MSGNO(MsgValeIsaacYoureGoingOnADifficult) },
1039 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), ACTOR_ARMOR_SHOPKEEPER, CONDITION_ALWAYS, MSGNO(MsgValeIfYouFaceAnyHardshipIn) },
1040 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), ACTOR_ITEM_SHOPKEEPER, CONDITION_ALWAYS, MSGNO(MsgValeSoIfThatWasFelixWho) },
1041 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), ACTOR_GARETS_GRANDFATHER, CONDITION_ALWAYS, MSGNO(MsgValeItsHardLettingMyPreciousGaret) },
1042 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), ACTOR_GARETS_GRANDMOTHER, CONDITION_ALWAYS, MSGNO(MsgValeTheWiseOneChoseGaretHimself) },
1043 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), ACTOR_GARETS_FATHER, CONDITION_ALWAYS, MSGNO(MsgValeOnceGaretLeavesIWontBe) },
1044 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), ACTOR_GARETS_MOTHER, CONDITION_ALWAYS, MSGNO(MsgValeIAmConcernedForGaretBut) },
1045 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 12, CONDITION_ALWAYS, MSGNO(MsgValeFelixInheritedHisFathersSkillWith) },
1046 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), ACTOR_JENNAS_GRANDMOTHER, CONDITION_ALWAYS, MSGNO(MsgValeJennaAnytimeYouFaceDangerJust) },
1047 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 14, CONDITION_ALWAYS, MSGNO(MsgValeWhyWouldFelixTakeHisSister) },
1048 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 15, CONDITION_ALWAYS, MSGNO(MsgValeWeAlmostLostTheTownOver) },
1049 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 16, CONDITION_ALWAYS, MSGNO(MsgValeIdLikeToBelieveThatOnly) },
1050 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 17, CONDITION_ALWAYS, MSGNO(MsgValeIfOnlyIdGoneToSol) },
1051 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 18, CONDITION_ALWAYS, MSGNO(MsgValeValesLawsStateThatYouCannot) },
1052 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 19, CONDITION_ALWAYS, MSGNO(MsgValeIWishIWereTheOne) },
1066 { SEARCH(SEARCH_BOOKCASE), 200, CONDITION_ALWAYS, FIND_MESSAGE(MSGNO(MsgValeBooksAboutContinents)) },
1067 { SEARCH(SEARCH_BOOKCASE), 201, CONDITION_ALWAYS, FIND_MESSAGE(MSGNO(MsgValeBookLawsOfVale)) },
1068 { 0xc4f3, 202, CONDITION_ALWAYS, FIND_MESSAGE(MSGNO(MsgValeBookPowerOfNature)) },
1069 { 0xc4f3, 203, CONDITION_ALWAYS, FIND_MESSAGE(MSGNO(MsgValeBookPsynergyStone)) },
1070 { 0xc4f3, 204, CONDITION_ALWAYS, FIND_MESSAGE(MSGNO(MsgValeAuntNotebook)) },
1071 { 0xc4f3, 205, CONDITION_ALWAYS, FIND_MESSAGE(MSGNO(MsgValeBookMakingGreatVillage)) },
1072 { SCENE_EVENTS_END },
1073};
1074
1076 { EVENT_TALK, ACTOR_GARETS_GRANDFATHER, CONDITION_ALWAYS, MSGNO(MsgValeMiaIsSuchANiceGirl) },
1077 { EVENT_TALK, ACTOR_GARETS_GRANDMOTHER, CONDITION_ALWAYS, MSGNO(MsgValeThatIvanSeemsToBeA) },
1080 { EVENT_TALK, 12, CONDITION_ALWAYS, MSGNO(MsgValeOhSoYouStillHaventRescued) },
1081 { EVENT_TALK, ACTOR_JENNAS_GRANDMOTHER, CONDITION_ALWAYS, MSGNO(MsgValeIGetOverColdsQuicklyBut) },
1082 { EVENT_TALK, 14, CONDITION_ALWAYS, MSGNO(MsgValeAColdIsGoingAroundI) },
1083 { EVENT_TALK, 15, CONDITION_ALWAYS, MSGNO(MsgValeWhatWasThatAlchemyThatKraden) },
1084 { EVENT_TALK, 16, CONDITION_ALWAYS, MSGNO(MsgValeEarthquakesStillStrikeOnceInA) },
1085 { EVENT_TALK, 17, CONDITION_ALWAYS, MSGNO(MsgValeTheMountainIsApparentlyStillCasting) },
1086 { EVENT_TALK, 18, CONDITION_ALWAYS, MSGNO(MsgValeTheNorthwestFaceOfMtAleph) },
1087 { EVENT_TALK, 19, CONDITION_ALWAYS, MSGNO(MsgValeTheGreatHealersAreTooAfraid) },
1092 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), ACTOR_GARETS_GRANDMOTHER, CONDITION_ALWAYS, MSGNO(MsgValeHisNewFriendsAreAllSo) },
1093 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), ACTOR_GARETS_FATHER, CONDITION_ALWAYS, MSGNO(MsgValeItWasntTooSmartToTalk) },
1094 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), ACTOR_GARETS_MOTHER, CONDITION_ALWAYS, MSGNO(MsgValeGaretSeemsToHaveGrownUp) },
1095 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), ACTOR_WEAPON_SHOPKEEPER, CONDITION_ALWAYS, MSGNO(MsgValeWeveSeenManyMonstersLatelyAnd) },
1096 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), ACTOR_ARMOR_SHOPKEEPER, CONDITION_ALWAYS, MSGNO(MsgValeIWishICouldLearnThe) },
1097 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), ACTOR_ITEM_SHOPKEEPER, FLAG_VALE_FAREWELL_HERB_RECEIVED, MSGNO(MsgValeWhatHappenedToJennaHaventYou) },
1098 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), ACTOR_ITEM_SHOPKEEPER, CONDITION_ALWAYS, MSGNO(MsgValeIGaveHimAFarewellGift) },
1099 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 12, CONDITION_ALWAYS, MSGNO(MsgValeWillIEverSeeJennaAnd) },
1100 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), ACTOR_JENNAS_GRANDMOTHER, CONDITION_ALWAYS, MSGNO(MsgValeDoraSaysItsJustACold) },
1101 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 14, CONDITION_ALWAYS, MSGNO(MsgValeIKnowThatThereAreAlways) },
1102 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 15, CONDITION_ALWAYS, MSGNO(MsgValeEvenIfTheEruptionHadNo) },
1103 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 16, CONDITION_ALWAYS, MSGNO(MsgValeEveryTimeTheGroundShakesI) },
1104 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 17, CONDITION_ALWAYS, MSGNO(MsgValeIfThePsynergyStonesInThe) },
1105 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 18, CONDITION_ALWAYS, MSGNO(MsgValeTheySayTheLavaLookedLike) },
1106 { PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), 19, CONDITION_ALWAYS, MSGNO(MsgValeTheHealersAreSupposedToGuard) },
1120 { SEARCH(SEARCH_BOOKCASE), 200, CONDITION_ALWAYS, FIND_MESSAGE(MSGNO(MsgValeBooksAboutContinents)) },
1121 { SEARCH(SEARCH_BOOKCASE), 201, CONDITION_ALWAYS, FIND_MESSAGE(MSGNO(MsgValeBookLawsOfVale)) },
1122 { 0xc4f3, 202, CONDITION_ALWAYS, FIND_MESSAGE(MSGNO(MsgValeBookPowerOfNature)) },
1123 { 0xc4f3, 203, CONDITION_ALWAYS, FIND_MESSAGE(MSGNO(MsgValeBookPsynergyStone)) },
1124 { 0xc4f3, 204, CONDITION_ALWAYS, FIND_MESSAGE(MSGNO(MsgValeAuntNotebook)) },
1125 { 0xc4f3, 205, CONDITION_ALWAYS, FIND_MESSAGE(MSGNO(MsgValeBookMakingGreatVillage)) },
1126 { SCENE_EVENTS_END },
1127};
1128// clang-format on
Ability numbers, named from the English release.
@ ABILITY_MIND_READ
Definition ability_ids.h:16
struct FieldActor * Object_GetById(s32 actor)
Returns an actor, or NULL if it does not exist.
static void Event_TalkToItemShopkeeper(void)
Opens the item shop from across the counter, or talks about the curse.
static void Event_TalkToWeaponShopkeeper(void)
Opens the weapon shop from across the counter; otherwise discusses Kolima.
static void Event_TalkToArmorShopkeeper(void)
Opens the armor shop across the counter, or asks about seeing the ocean.
Calls through a function pointer, by argument count.
void(*) SchedulerCallback(void)
struct FieldActor * Camera_GetEventObject(void)
The event command "get view centre": returns the camera object.
Definition camera.c:133
#define GARET
Jerald.
#define MIA
Mary.
#define IVAN
Ivan.
void Engine_ActorSetSpriteFlags(struct FieldActor *, s32)
static s32 FieldScheduler_AddCallback(SchedulerCallback callback, s32 priority)
Registers a main-image scheduler callback.
Definition engine_call.h:36
FacingObject, the view of an object that turns to face a target.
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)
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
void Engine_ActorSetSpritePriority(s32 actor, s32 priority)
static void Event_ShowMessageAndWait(s32 speaker, s32 flags, s32 frames)
s32 Engine_EventChooseYesNo(s32 actor, s32 flags)
void Engine_MessageShowCentered(s32 message, s32 flags)
s32 Engine_PartyGiveItem(s32 item, s32 flags)
#define GameFlag_IsSet
#define SPEAKER_PORTRAIT_RIGHT
Definition field_event.h:55
static void Actor_WalkToAndWait(s32 actor, s32 x, s32 z)
static void Camera_SetSpeed(s32 speed, s32 acceleration)
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_EventCloseScreen(void)
static void Actor_RunActionScriptAndWait(s32 actor, const s32 *script)
Runs a script, waiting at most 300 frames for its final command.
#define SPEAKER_WINDOW_BELOW
Definition field_event.h:57
static void Actor_WalkTo(s32 actor, s32 x, s32 z)
void Engine_EventWaitForScreen(void)
#define GameFlag_Set
static void Actor_ShowEmote(s32 actor, s32 emote, s32 frames)
s32 Engine_EventAskYesNo(s32 speaker, s32 flags)
static void Event_ShowTwoMessagesAndWait(s32 speaker, s32 x, s32 y, s32 arg, s32 extra, s32 otherSpeaker, s32 otherX, s32 otherY, s32 otherArg, s32 otherExtra, s32 flags)
void Engine_EventOpenScreen(void)
void Engine_CameraWaitForMove(void)
static void Actor_SetActionScript(s32 actor, const s32 *script)
The engine encodes either a built-in action or an action-script address.
void Engine_ActorWaitForMove(s32 actor)
void Engine_ActorStop(s32 actor)
void Engine_ActorRunRepeatedMotion(s32 actor, s32 repeats)
static void Event_ShowMessage(s32 speaker, s32 flags)
s32 Engine_GameFlagIsSet(s32 flag)
void Engine_ActorStartRepeatedMotion(s32 actor, s32 repeats)
static void Actor_SetSpeed(s32 actor, s32 speed, s32 acceleration)
void Engine_ShopOpen(s32 shop, s32 keeper)
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 struct FieldActor * Actor_Get(s32 actor)
@ ACTOR_LINK_KEEP_MOTION
Definition field_obj.h:148
@ TRANSITION_WINDOW
Definition field_obj.h:17
@ 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
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 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
#define FACING_IS_NORTH(facing)
Definition field_scene.h:38
#define PLACEMENT_SHARE_PREVIOUS_SPRITE
@ FACING_NORTHEAST
Definition field_scene.h:33
@ FACING_EAST
Definition field_scene.h:26
@ FACING_SOUTHEAST
Definition field_scene.h:27
@ FACING_NORTH
Definition field_scene.h:32
@ FACING_SOUTHWEST
Definition field_scene.h:29
@ FACING_NORTHWEST
Definition field_scene.h:31
@ FACING_SOUTH
Definition field_scene.h:28
@ FACING_WEST
Definition field_scene.h:30
#define PIXELS(value)
@ SEARCH_BOOKCASE
@ SEARCH_JAR
@ SEARCH_BARREL
#define FIND_COINS(coins)
The scene service layer: one typed inline for each engine service a scene calls by its own name,...
static void FieldObject_SetTargetAndCallback(s32 object, s32 target, const s32 *actions)
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_GARET_CAME_HOME
Back from Kalay, Garet surprised his family at home.
Definition flags.h:524
#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_VALE_FAREWELL_HERB_RECEIVED
The item shopkeeper gave Isaac a Herb as a farewell gift.
Definition flags.h:522
#define FLAG_VALE_INTERIORS_JAR_2_COINS
Definition flags.h:528
#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_VALE_INTERIORS_JAR_SMOKE_BOMB
Definition flags.h:529
#define FLAG_VALE_INTERIORS_JAR_6_COINS
Definition flags.h:527
#define FLAG_VALE_INTERIORS_JAR_3_COINS
Definition flags.h:530
#define FLAG_VALE_INTERIORS_BARREL_ANTIDOTE
Definition flags.h:526
volatile u32 gFrameCount
Frames WaitFrames has finished.
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
The main-image routines scene overlays import.
void SceneEvents_UpdateInView(struct ScenePlacement *entry)
Item numbers, named from the English release.
@ ITEM_ANTIDOTE
Definition item_ids.h:47
@ ITEM_SMOKE_BOMB
Definition item_ids.h:67
@ ITEM_HERB
Definition item_ids.h:40
void Map_ClearLayerEntryFlag(u32 channelIndex)
Resumes tile animation channel channelIndex by clearing its paused byte.
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_ACCEL
Definition objcmd.h:68
@ SW_SPEED
Definition objcmd.h:67
@ SW_FACING
Definition objcmd.h:57
#define SC_CALL(fn)
Definition objcmd.h:50
The work pointers in the gWorkSlot table, by name.
#define Ram_SceneMapStateOffset
Definition ram_buffer.h:56
The field object script interpreter and the operands its commands read.
Song and sound effect ids, indices into gSound_SongTable.
#define SE_MAP_EXIT
Definition songs.h:116
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
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
s16 timer
The parameter its action script reads (a follow distance or an angle to face), the player's frames to...
Definition field_obj.h:109
u8 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
union FieldCoordinate z
16.16 fixed-point pixels
Definition field_obj.h:37
u16 facing
1/65536 turns
Definition field_obj.h:34
s32 targetY
16.16 fixed-point pixels; ACTOR_NO_TARGET when unset
Definition field_obj.h:60
s32 scaleX
16.16 fixed point, 0x10000 full size
Definition field_obj.h:39
s32 scaleY
16.16 fixed point, 0x10000 full size
Definition field_obj.h:40
u16 work
The side of the player's next footprint (2 after a stop), or scene scratch.
Definition field_obj.h:112
u8 collisionFlags
bits: 7 refuses to move into a solid object | 4 nearer for Psynergy targets | 3 never a talk or Psyne...
Definition field_obj.h:91
The storm's lightning work: the colours it flashes between and their difference, the countdown to the...
Definition fxblend.h:13
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 prefix that command handlers read from a field object's 0x70-byte slot.
Definition script.h:16
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 char u8
Definition types.h:11
s32 fixed
16.16 fixed-point pixels
@ ACTOR_GARETS_GRANDFATHER
Garet's grandfather, the mayor (sprite 0x75, whom the Great Healer calls Mayor in sanctum....
static void ValeInteriors_GiveFarewellHerb(void)
After the party has left Vale, the item shopkeeper gives Isaac a Herb as a farewell gift,...
static void Event_AskToScareVisitors(void)
A villager asks Isaac to help scare Kraden's visitors.
s32 gValeInteriors_PartyLeavesScript[]
const struct SceneEntrance * ValeInteriors_GetEntrances(void)
struct ScenePlacement gValeInteriors_Placements[]
u32 gValeInteriors_Exits[]
static void Event_LeaveByDoor7(void)
static void Event_GaretComesHome(void)
Back from Kalay, Garet comes home: his grandfather dozes, his parents argue over whether to look for ...
struct ScenePlacement gValeInteriors_PlacementsAfterKalay[]
s32 gValeInteriors_DriftingSpriteScript[]
s32 gValeInteriors_FatherPacingScript[]
static void ValeInteriors_SpawnDriftingSprite(void)
Sends a sprite drifting up from Garet's sleeping grandfather, one of the three at frames 10,...
static void Event_AskAboutKradensStudies(void)
A villager asks whether Isaac knew why Kraden came to Vale.
const struct SceneRegion * ValeInteriors_GetRegions(void)
static void ValeInteriors_PlayRepeatedAnimationAndWait(s32 actorId, s32 animation)
Starts the repeated motion before waiting for the requested animation.
static void Event_LeaveByDoor5(void)
static void Event_AskAboutCulpritsPowers(void)
A villager tells of the culprits' strange powers and asks about them.
const struct SceneEvent * ValeInteriors_GetEvents(void)
Selects the events for the current visit to Vale: the stormy night's (FLAG_VALE_STORM),...
u32 gValeInteriors_StormExits[]
s32 gValeInteriors_FaceTargetScript[]
static void Event_LeaveByDoor6(void)
const struct ScenePlacement * ValeInteriors_GetPlacements(void)
Selects the placements for the day the story begins, after the party has left Vale (FLAG_PARTY_LEFT_V...
static void Event_LeaveByDoor2(void)
const u32 * ValeInteriors_GetExits(void)
On the stormy night, the doors lead out into the storm.
static void Event_WorryAboutTravelersHealth(void)
Garet's mother hopes the travelers did not get sick on the way.
static void ValeInteriors_FamilyNods(void)
Garet's grandparents and father nod.
s32 ValeInteriors_Initialize(void)
Arriving in a house: on the stormy night the residents are gone and lightning flashes outside; back f...
static void Event_AskAboutDora(void)
Back from Kalay, Garet's father asks whether Isaac heard them talking about Dora.
static void Event_LeaveByDoor8(void)
struct SceneEntrance gValeInteriors_Entrances[]
struct ScenePlacement gValeInteriors_PlacementsAfterLeaving[]
static void Event_LeaveByDoor4(void)
struct SceneEvent gValeInteriors_EventsAfterLeaving[]
static void Event_LeaveByDoor1(void)
struct SceneEvent gValeInteriors_Events[]
static void Event_LeaveByDoor3(void)
static s32 ValeInteriors_AdvanceDriftingSprite(struct ScriptInterpreter *interpreter)
Moves and grows a sprite drifting up from Garet's sleeping grandfather.
static void ValeInteriors_RequestWindowExit(s32 exitId)
Leaves a house through its door: the exit sound plays and the screen closes, stopping the lightning f...
struct SceneEvent gValeInteriors_StormEvents[]
struct SceneEvent gValeInteriors_EventsAfterKalay[]
ValeInteriorsActor
@ ACTOR_ARMOR_SHOPKEEPER
@ ACTOR_ITEM_SHOPKEEPER
@ ACTOR_JENNAS_GRANDMOTHER
Jenna's grandmother.
@ ACTOR_GARETS_MOTHER
Garet's mother. "As mothers, Dora and I will always worry about you.".
@ ACTOR_WEAPON_SHOPKEEPER
@ ACTOR_FIRST_DRIFTING_SPRITE
Three sprites drifting up from Garet's sleeping grandfather.
@ ACTOR_GARETS_FATHER
Garet's father.
@ ACTOR_GARETS_GRANDMOTHER
Garet's grandmother. "Grandma! What's the matter? Are you choking?".
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