Alchemy
Loading...
Searching...
No Matches

lunpa.c

Go to the documentation of this file.
1/// @file
2/// Lunpa, the town under Dodonpa's fortress, on two maps: the town itself
3/// (Lunpa 1), with its well, its hidden passage to the jail and Reveal's
4/// secrets, and the gate below the fortress (Lunpa 2), where two guards turn
5/// the party away until Cloak gets them past.
6///
7/// Scene flags in the town: FLAG_SCENE_TEMP_00, the puddle is frozen into a
8/// pillar; FLAG_SCENE_TEMP_01, Reveal's secrets are hidden; FLAG_SCENE_TEMP_02,
9/// the hidden passage to the jail is open. At the gate, FLAG_SCENE_TEMP_40 to
10/// _44, as flags.h describes them.
11
12#include "game_state.h"
13#include "version.h"
14#include "scene_ids.h"
15#include "unit/scene/lunpa.h"
18#include "unit/object/object.h"
20#include "types.h"
21#include "field_effect.h"
22#include "field_event.h"
23#include "engine_call.h"
24#include "field_scene.h"
25#include "field_runtime.h"
26#include "edition.h"
27#include "lunpa.h"
28#include "text/msg_ids.h"
29#include "field_obj.h"
30#include "macros.h"
31
32static void Lunpa_WatchForUncloakedParty(void);
33
35
37#include "common/effect_spawn.h"
38
39/// How long an effect of common/effect_spawn.h lasts: 22, 44 or 126
40/// frames, then it moves away and is freed.
42 SCRIPT_WAIT(1), SCRIPT_REPEAT(22, 0),
45};
46
48 SCRIPT_WAIT(1), SCRIPT_REPEAT(44, 0),
51};
52
54 SCRIPT_WAIT(1), SCRIPT_REPEAT(126, 0),
57};
58
59const s32 *gEffectScripts[] = {
63};
64
65const struct SceneEntrance *Scene_GetEntrances(void) {
66 s32 scene = gGameState.scene;
67
68 if (scene == (s32)&SceneId_Lunpa1) {
69 return gLunpaEntrances;
70 }
71 if (scene == (s32)&SceneId_Lunpa2) {
72 return gGateEntrances;
73 }
74 return gLunpaEntrances;
75}
76
77const struct SceneRegion *Scene_GetRegions(void) { return NULL; }
78
79const u32 *Scene_GetExits(void) {
80 s32 scene = gGameState.scene;
81
82 if (scene == (s32)&SceneId_Lunpa1) {
83 return gLunpaExits;
84 }
85 if (scene == (s32)&SceneId_Lunpa2) {
86 return gGateExits;
87 }
88 return gLunpaExits;
89}
90
91/// The townsfolk, or the gate's guards.
93 s32 scene = gGameState.scene;
94
95 if (scene == (s32)&SceneId_Lunpa1) {
96 return gLunpaPlacements;
97 }
98 if (scene == (s32)&SceneId_Lunpa2) {
99 return gGatePlacements;
100 }
101 return gLunpaPlacements;
102}
103
104/// Catch on the nut floating over the town: the party gets it.
105static void Event_CatchFloatingNut(void) {
112}
113
114/// Restores the frozen pillar's three collision cells, including its sides.
115static inline void Lunpa_ApplyFrozenPuddleCollision(void) {
116 Map_CopyCellAttributes(17, 4, 1, 1, 14, 4);
117 Map_CopyCellAttributes(15, 3, 1, 1, 15, 4);
118 Map_CopyCellAttributes(15, 3, 1, 1, 13, 4);
119}
120
121/// Frost on the puddle Reveal shows: it freezes into a pillar the party can
122/// stand on.
123static void Event_FreezeHiddenPuddle(void) {
124 struct FieldActor *pillar;
125
129 if (pillar != NULL) {
131 pillar->motionFlags = ACTOR_FALLS;
133 }
135}
136
137/// Every frame while the pillar stands: draw it under the leader once the
138/// leader is on top.
143 } else {
146 }
147}
148
149/// Draws the three map regions that make one frame of the hidden passage.
150static inline void Lunpa_DrawHiddenPassageFrame(s32 sourceColumn,
151 s32 sourceRow) {
152 Map_CopyCells(sourceColumn, sourceRow, 3, 4, 1, 14);
153 Map_CopyCells(sourceColumn + 3, sourceRow, 3, 4, 33, 14);
154 Map_CopyCells(sourceColumn + 6, sourceRow, 3, 4, 1, 46);
155}
156
157/// Reveal: the Psynergy Stone's spot, the hidden switch's glint, the
158/// puddle and, once opened, the passage show.
159static void Event_RevealSecrets(void) {
160 struct FieldActor *actor;
161 s32 cellX;
162 s32 cellZ;
163
164 // Restore the hidden stone and pillar before exposing the switch or passage.
166 cellX = actor->x.fixed / CELL_SIZE;
167 cellZ = actor->z.fixed / CELL_SIZE;
169 if (cellX == 7 && cellZ == 16) {
171 }
173 Map_CopyCellAttributes(28, 31, 1, 1, 7, 16);
174 }
175 Map_CopyCells(47, 4, 1, 1, 46, 4);
176 Map_CopyCellAttributes(34, 37, 3, 3, 13, 3);
178 Actor_Get(ACTOR_HIDDEN_PUDDLE)->y.fixed = 0;
179#if TBS_PATCH_4
182 }
183#endif
184 // The opened passage replaces the glint; otherwise show the hidden switch.
187 } else {
191 if (actor != NULL) {
193 actor->y.fixed = PIXELS(16);
195 actor->scaleX = GLINT_SCALE_X;
196 actor->scaleY = GLINT_SCALE_Y;
197 }
198 }
202}
203
204/// Reveal's end, and every entry to the town: the secrets hide again.
205static void Event_HideSecrets(void) {
206 struct FieldActor *puddle;
207
211 Map_CopyCells(38, 38, 1, 1, 46, 4);
212 Map_CopyCellAttributes(37, 37, 3, 3, 13, 3);
213 Map_CopyCellAttributes(37, 37, 1, 1, 14, 2);
214 Map_CopyCellAttributes(8, 16, 1, 1, 7, 16);
216 Map_CopyCells(32, 42, 3, 2, 1, 15);
220 puddle->update = NULL;
224}
225
226static void Event_SearchWell(void) {
228 Engine_MessageShowCentered(MsgFieldPeeredWell, 1);
229 Engine_MessageShowCentered(MsgLunpaWellFrogs, 1);
231}
232
233/// The gate's events, or the town's before and after trade reopens.
234const struct SceneEvent *Scene_GetEvents(void) {
235 s32 scene = gGameState.scene;
236
237 if (scene == (s32)&SceneId_Lunpa2) {
239 return gGateEvents;
240 }
241 if (scene == (s32)&SceneId_Lunpa1 &&
244 }
245 return gLunpaSealedEvents;
246}
247
248/// The west guard of the town asks whether the party wants in.
249static void Event_TalkToWestGuard(void) {
252 Engine_EventSetMessage(MsgLunpaWestGuardAsksAboutEntering);
255}
256
257/// The east guard: wants authorization, or once the guards suspect Kalay,
258/// asks twice whether the party came from there.
259static void Event_TalkToEastGuard(void) {
262 Engine_EventSetMessage(MsgLunpaEastGuardDemandsAuthorization);
264 } else {
265 Engine_EventSetMessage(MsgLunpaEastGuardAsksIfFrom);
272 }
273 }
275 }
277}
278
280 s32 thoughts;
281
284 if (thoughts == 0) {
285 thoughts = MsgLunpaEastGuardFearsBlame;
286 } else {
287 thoughts = MsgLunpaEastGuardTrustsCaveGate;
288 }
289 Engine_EventSetMessage(thoughts);
291 } else {
292 Engine_EventSetMessage(MsgLunpaEastGuardThinksMerchantHarmless);
294 }
295}
296
297/// Asks how long the party has been in Lunpa.
298static void Event_AskAboutLengthOfStay(void) {
300 Engine_EventSetMessage(MsgLunpaVillagerAAsksHowLong);
303}
304
305/// Asks whether Dodonpa kidnapped Hammet for ransom.
308 Engine_EventSetMessage(MsgLunpaVillagerCAsksAboutKidnapping);
311}
312
313/// Asks whether the party wants to see Donpa.
314static void Event_AskAboutSeeingDonpa(void) {
316 Engine_EventSetMessage(MsgLunpaVillagerGAsksAboutDonpa);
319}
320
321/// Shivers and complains that the weather has become colder.
322static void Event_ComplainAboutCold(void) {
325 Engine_EventSetMessage(MsgLunpaVillagerBShivers);
328}
329
330/// Offers to explain the commotion at the fortress.
333 Engine_EventSetMessage(MsgLunpaVillagerDAsksAboutCommotion);
336}
337
338/// The gate's left guard: hears someone while the party is cloaked; after
339/// trade reopens, nearly recognizes Hammet with the party.
340static void Event_TalkToLeftGuard(void) {
341 s32 recognitionMessageBase;
342
343 if (gGameState.cloaked != 0) {
344 Engine_EventSetMessage(MsgLunpaLeftGuardHearsSomeone);
348 recognitionMessageBase = MsgLunpaLeftGuardRecognizesHammet;
349 Engine_EventSetMessage(recognitionMessageBase + RECOGNITION_SEEN_THAT_MAN);
352 Engine_EventSetMessage(recognitionMessageBase + RECOGNITION_IMPOSSIBLE);
354 } else {
355 Engine_EventSetMessage(MsgLunpaLeftGuardResentsDodonpa);
356 }
358}
359
360/// The gate's right guard.
361static void Event_TalkToRightGuard(void) {
362 if (gGameState.cloaked != 0) {
363 Engine_EventSetMessage(MsgLunpaRightGuardFeelsCreepy);
365 Engine_EventSetMessage(MsgLunpaRightGuardWondersHow);
366 } else {
367 Engine_EventSetMessage(MsgLunpaRightGuardBoasts);
368 }
370}
371
372/// Mind Read on the left guard: before the cave reunion he thinks the man
373/// with the party looks like that merchant, and Mind Read is cut short the
374/// first time as he turns to look.
376 s32 recognizedHammet;
377
378 if (gGameState.cloaked == 0 &&
382 if (recognizedHammet == 0) {
383 ((struct FieldWork *)gEventWork)->command = recognizedHammet;
387 Engine_EventSetMessage(MsgLunpaLeftGuardRecognizesHammet);
389 } else {
390 Engine_EventSetMessage(MsgLunpaLeftGuardGlimpsedMerchant);
391 }
394 Engine_EventSetMessage(MsgLunpaLeftGuardDismissesThought);
395 } else {
396 Engine_EventSetMessage(MsgLunpaLeftGuardThoughts);
397 }
399}
400
403 Engine_EventSetMessage(MsgLunpaRightGuardReopenedThoughts);
404 } else {
405 Engine_EventSetMessage(MsgLunpaYoudShadowSneak);
406 }
408}
409
410/// Every frame at the gate after trade reopens: stepping up to row 10
411/// raises Garet's warning (trigger TRIGGER_FORTRESS_APPROACH).
413 s32 leaderRow = Actor_Get(ACTOR_PARTY_LEADER)->z.fixed / CELL_SIZE;
414
415 if (GameFlag_IsSet(FLAG_SCENE_TEMP_43) == 0 && leaderRow == 10) {
418 }
419}
420
421/// Garet reminds the leader they cannot go into the fortress, and the
422/// leader steps back.
423static void Event_GaretTurnsLeaderBack(void) {
426 Engine_EventSetMessage(MsgLunpaGaretRefusesToReturn);
435}
436
437/// The leader walks into a doorway: the door opens and the leader goes in.
438static void Event_EnterDoor(void) {
439 struct FieldWork *fieldWork;
440 struct FieldActor *placedActor;
441 u32 actorId;
442 s32 doorIndex;
443
444 fieldWork = (struct FieldWork *)gEventWork;
446 // Freeze placed actors before opening the selected door and crossing it.
447 for (actorId = ACTOR_FIRST_PLACED; actorId <= ACTOR_LAST_PLACED; actorId++) {
448 placedActor = Actor_Get(actorId);
449 if (placedActor != NULL) {
450 placedActor->motionFlags = 0;
451 }
452 }
454 doorIndex = fieldWork->action - TRIGGER_FIRST_HOME_DOOR;
455 Map_AnimateCells(gLunpaDoors[doorIndex].steps, gLunpaDoors[doorIndex].x,
456 gLunpaDoors[doorIndex].y);
457 Actor_SetSpeed(ACTOR_PARTY_LEADER, 0x8000, 0x4000);
458 Actor_Get(ACTOR_PARTY_LEADER)->motionFlags = 0;
460 if (doorIndex != DOOR_TEMPLE) {
463 }
468}
469
470/// The hidden passage to the jail, once opened and while Reveal shows it.
471static void Event_EnterHiddenPassage(void) {
474 Actor_SetSpeed(ACTOR_PARTY_LEADER, 0x3333, 0x1999);
475 Actor_Get(ACTOR_PARTY_LEADER)->motionFlags = 0;
480 }
481 }
482}
483
484/// Through the fortress door, out of the gate's top.
485static void Event_EnterFortress(void) {
488 Actor_SetSpeed(ACTOR_PARTY_LEADER, 0x3333, 0x1999);
489 Actor_Get(ACTOR_PARTY_LEADER)->motionFlags = 0;
493 Map_CopyCells(53, 4, 2, 2, 41, 4);
495 Map_CopyCells(53, 6, 2, 2, 41, 4);
501}
502
504
505/// Reveal's sound when it uncovers something.
506UNUSED static void Lunpa_PlayRevealCue(void) {
509 }
510}
511
512/// Searching the switch Reveal shows: the passage opens in five steps.
513static void Event_PressHiddenSwitch(void) {
515 return;
516 }
518 return;
519 }
520 // Open the passage over five map frames, then remember its final state.
525 Engine_TaskWait(10);
527 Engine_TaskWait(10);
529 Engine_TaskWait(10);
531 Engine_TaskWait(10);
533 Engine_TaskWait(10);
535}
536
537/// Copies one open or blocked source cell across the three-cell gateway.
538static inline void Lunpa_CopyGatewayCollision(s32 sourceColumn, s32 sourceRow) {
539 Map_CopyCellAttributes(sourceColumn, sourceRow, 1, 1, 7, 11);
540 Map_CopyCellAttributes(sourceColumn, sourceRow, 1, 1, 8, 11);
541 Map_CopyCellAttributes(sourceColumn, sourceRow, 1, 1, 9, 11);
542}
543
544/// Coming close uncloaked, the guards step in front of the fortress door
545/// and the gateway closes.
546static void Event_GuardsBlockGate(void) {
547 if (gGameState.cloaked == 0) {
562 Engine_EventSetMessage(MsgLunpaGuardsWarnPartyAway);
567 }
568}
569
570static void UNUSED Lunpa_DoNothing(void) {}
571
572/// Cloak: the gateway closes behind the guards.
573static void Event_CastCloak(void) {
576}
577
578/// Raised when the guards spot the party: they recognize the man with them,
579/// and march the party back down to the gate's foot.
580static void Event_GuardsCatchParty(void) {
581 struct FieldActor *leader;
582 s32 warningMessageBase;
583
585 return;
586 }
596 // Warn the party before escorting everyone down the two sections of the gate.
597 warningMessageBase = MsgLunpaGuardsCatchParty;
600 Actor_SetSpeed(ACTOR_PARTY_LEADER, 0x20000, 0x10000);
601 Actor_SetSpeed(ACTOR_LEFT_GUARD, 0x20000, 0x10000);
602 Actor_SetSpeed(ACTOR_RIGHT_GUARD, 0x20000, 0x10000);
612 Engine_EventSetMessage(warningMessageBase +
615 Actor_WalkTo(ACTOR_LEFT_GUARD, leader->x.part.pixel - 1,
616 leader->z.part.pixel);
618 // Bring the party and both guards together at the first landing.
628 // Continue to the foot of the gate before enabling the watcher again.
637}
638
640
641/// Cloak fades: if the leader is still among the guards, they are caught.
642static void Event_CloakFades(void) {
643#if TBS_PATCH_1
644 struct FieldWork *fieldWork;
645#endif
646 struct FieldActor *leader;
647
648#if TBS_PATCH_1
649 fieldWork = (struct FieldWork *)gEventWork;
650#endif
654 if (leader->x.fixed > PIXELS(104) && leader->x.fixed < PIXELS(240) &&
655 leader->z.fixed > PIXELS(160) && leader->z.fixed < PIXELS(248)) {
657#if TBS_PATCH_1
658 fieldWork->event = TRIGGER_PARTY_SPOTTED;
659#else
661#endif
662 }
665}
666
667/// Every frame at the gate: an uncloaked leader in front of the guards is
668/// spotted.
670 struct FieldWork *fieldWork;
671 struct FieldActor *leader;
672
673 fieldWork = (struct FieldWork *)gEventWork;
675 if (gGameState.cloaked == 0 &&
676 (u32)(leader->x.fixed - PIXELS(144)) <= PIXELS(32) &&
677 leader->z.fixed >= PIXELS(168) && leader->z.fixed < PIXELS(176)) {
679 fieldWork->event = TRIGGER_PARTY_SPOTTED;
680 }
681}
682
683/// Every 16 frames while the leader is thrown: a puff of dust.
684static void Lunpa_KickUpLeaderDust(void) {
685 struct FieldActor *leader;
686 s32 dustAngle;
687 s32 dustVelocity[3];
688
690 if ((gFrameCount & 15) == 0) {
691 dustAngle = (((u32)Engine_RandomNext() * 52) >> 16) * 64 + 230;
692 SET_VECTOR(dustVelocity, Engine_MathCos(dustAngle) / 4, 0,
693 Engine_MathSin(dustAngle) / 2);
694 Effect_Spawn(leader->x.fixed, leader->y.fixed, leader->z.fixed,
695 dustVelocity[0], dustVelocity[1], dustVelocity[2], 0, NULL);
696 }
697}
698
699/// Entering the gate after being caught inside: the guards throw the
700/// leader out and down the steps.
701static void Event_GuardsThrowLeaderOut(void) {
712 Actor_SetSpeed(ACTOR_PARTY_LEADER, 0x1cccc, 0xe666);
713 Actor_SetSpeed(ACTOR_LEFT_GUARD, 0x1cccc, 0xe666);
714 Actor_SetSpeed(ACTOR_RIGHT_GUARD, 0x1cccc, 0xe666);
735 // Throw the leader down the steps, then wait for the first landing.
737 Actor_Get(ACTOR_PARTY_LEADER)->velocityY = PIXELS(6);
738 Actor_Get(ACTOR_PARTY_LEADER)->velocityZ = PIXELS(6);
740 while (Actor_Get(ACTOR_PARTY_LEADER)->y.fixed != 0) {
742 }
749 // A smaller second bounce ends with the guards' final warning.
750 Actor_Get(ACTOR_PARTY_LEADER)->velocityY = PIXELS(3);
752 while (Actor_Get(ACTOR_PARTY_LEADER)->y.fixed != 0) {
754 }
760 Engine_EventSetMessage(MsgLunpaGuardForbidsReturn);
764 Actor_SetSpeed(ACTOR_LEFT_GUARD, 0x10000, 0x8000);
765 Actor_SetSpeed(ACTOR_RIGHT_GUARD, 0x10000, 0x8000);
776}
777
778/// Entering the gate after sneaking out of the fortress: the leader casts
779/// Cloak and slips around the guards.
780static void Event_LeaderSneaksOut(void) {
786 // Cast Cloak before following the route around the guards.
805}
806
807/// Sets either map up: Reveal's secrets hidden and the floating nut in the
808/// town; at the gate, the thrown-out or sneaking-out scene, the watchers
809/// and the fortress visit flags cleared.
811 struct FieldActor *puddle;
812
814 ((struct FieldWork *)gEventWork)->transition =
819 }
821 if (puddle != NULL) {
823 }
825 }
826 // Restore the gate's arrival scene and active detection tasks separately.
828 ((struct FieldWork *)gEventWork)->transition =
834 }
838 }
843 }
844#if TBS_PATCH_4
845 if (gGameState.cloaked != 0)
847#endif
850 // The fortress's puzzles and beaten guards are reset.
861 }
862 return 0;
863}
864
865#include "common/object_orbit.h"
866
867#define LUNPA_ENTRANCE(entrance, x, z, facing) \
868 {(entrance), CONDITION_ALWAYS, (x), 0, (z), (facing), 0, -1, -1, -1, -1, 0}
869#define GATE_ENTRANCE(entrance, x, z, facing) \
870 {(entrance), CONDITION_ALWAYS, (x), 0, (z), (facing), 0, 32, 48, 272, 344, 0}
871
873 LUNPA_ENTRANCE(0, 172, 149, FACING_SOUTH),
887};
888
890 GATE_ENTRANCE(0, 152, 328, FACING_NORTH),
896};
897
898#define ROOM_EXIT(exit) \
899 SCENE_EXIT((exit), SCENE_LUNPA_SUHALLA, ROOM_ENTRANCE(exit))
900
919};
920
927};
928
929// clang-format off
932 PIXELS(520), 0, PIXELS(520), FACING_SOUTH, TALK_KEEP_FACING, 0 },
942 PIXELS(368), 0, PIXELS(256), FACING_WEST, TALK_FACE_PARTY, 0 },
948 PIXELS(152), 0, PIXELS(184), FACING_SOUTH, TALK_FACE_PARTY, 0 },
956 PIXELS(120), 0, PIXELS(472), FACING_SOUTH, TALK_KEEP_FACING, 0 },
958};
959
966 { SCENE_TABLE_END },
967};
968// clang-format on
969
970#define TALK(actor, value) {EVENT_TALK, (actor), CONDITION_ALWAYS, (value)}
971#define MIND_READ(actor, value) \
972 {PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), (actor), CONDITION_ALWAYS, (value)}
973
974#define DOOR(trigger) \
975 {TOUCH_WALKING_INTO(FACING_NORTH), (trigger), CONDITION_ALWAYS, \
976 EVENT_SCRIPT(Event_EnterDoor)}
977
978#define LUNPA_ROADS_AND_DOORS \
979 {EVENT_EXIT, TRIGGER_WORLD_MAP_ROAD, CONDITION_ALWAYS, \
980 LUNPA_EXIT_TO_WORLD_MAP}, \
981 {EVENT_EXIT, TRIGGER_GATE_ROAD, CONDITION_ALWAYS, LUNPA_EXIT_TO_GATE}, \
982 {EVENT_EXIT, TRIGGER_CAVE_ROAD, CONDITION_ALWAYS, LUNPA_EXIT_TO_CAVE}, \
983 DOOR(TRIGGER_FIRST_HOME_DOOR), DOOR(TRIGGER_SECOND_HOME_DOOR), \
984 DOOR(TRIGGER_THIRD_HOME_DOOR), DOOR(TRIGGER_ARMS_SHOP_DOOR), \
985 DOOR(TRIGGER_ITEM_SHOP_DOOR), DOOR(TRIGGER_INN_DOOR), \
986 DOOR(TRIGGER_TEMPLE_DOOR), DOOR(TRIGGER_EIGHTH_ROOM_DOOR), { \
987 TOUCH_WALKING_INTO(FACING_NORTH), TRIGGER_HIDDEN_PASSAGE, \
988 CONDITION_ALWAYS, EVENT_SCRIPT(Event_EnterHiddenPassage) \
989 }
990
991#define LUNPA_SECRETS \
992 {PSYNERGY_ON_ACTOR(ABILITY_FROST), ACTOR_HIDDEN_PUDDLE, FLAG_SCENE_TEMP_00, \
993 EVENT_SCRIPT(Event_FreezeHiddenPuddle)}, \
994 {PSYNERGY_IN_AREA(ABILITY_REVEAL, REVEAL_SHOWN), 0, CONDITION_ALWAYS, \
995 EVENT_SCRIPT(Event_RevealSecrets)}, \
996 {PSYNERGY_IN_AREA(ABILITY_REVEAL, REVEAL_FADED), 0, CONDITION_ALWAYS, \
997 EVENT_SCRIPT(Event_HideSecrets)}, \
998 {SEARCH(SEARCH_UNNAMED), TRIGGER_HIDDEN_SWITCH, FLAG_SCENE_TEMP_01, \
999 EVENT_SCRIPT(Event_PressHiddenSwitch)}, \
1000 {SEARCH(SEARCH_UNNAMED), TRIGGER_PSYNERGY_STONE, \
1001 FLAG_LUNPA_PSYNERGY_STONE, FIND_PSYNERGY_STONE}, \
1002 {SEARCH(SEARCH_GRAVE), TRIGGER_GRAVE_SLEEP_BOMB, \
1003 FLAG_LUNPA_GRAVE_SLEEP_BOMB, FIND_ITEM(ITEM_SLEEP_BOMB)}, \
1004 {SEARCH(SEARCH_BARREL), TRIGGER_BARREL_NUT, FLAG_LUNPA_BARREL_NUT, \
1005 FIND_ITEM(ITEM_NUT)}, \
1006 {PSYNERGY_ON_ACTOR(ABILITY_CATCH), ACTOR_FLOATING_NUT, \
1007 FLAG_LUNPA_NUT_CAUGHT, EVENT_SCRIPT(Event_CatchFloatingNut)}, \
1008 {SEARCH(SEARCH_UNNAMED), TRIGGER_WELL, CONDITION_ALWAYS, \
1009 EVENT_SCRIPT(Event_SearchWell)}, \
1010 { \
1011 SCENE_EVENTS_END \
1012 }
1013
1017 TALK(ACTOR_VILLAGER_B, MSGNO(MsgLunpaVillageVillagerBSealed)),
1019 TALK(ACTOR_VILLAGER_D, MSGNO(MsgLunpaVillageVillagerDSealed)),
1020 TALK(ACTOR_VILLAGER_E, MSGNO(MsgLunpaVillageVillagerESealed)),
1021 TALK(ACTOR_VILLAGER_F, MSGNO(MsgLunpaVillageVillagerFSealed)),
1023 TALK(ACTOR_VILLAGER_H, MSGNO(MsgLunpaVillageVillagerHSealed)),
1026 MIND_READ(ACTOR_VILLAGER_A, MSGNO(MsgLunpaVillageVillagerASealedThoughts)),
1027 MIND_READ(ACTOR_VILLAGER_B, MSGNO(MsgLunpaVillageVillagerBSealedThoughts)),
1028 MIND_READ(ACTOR_VILLAGER_C, MSGNO(MsgLunpaVillageVillagerCSealedThoughts)),
1029 MIND_READ(ACTOR_VILLAGER_D, MSGNO(MsgLunpaVillageVillagerDSealedThoughts)),
1030 MIND_READ(ACTOR_VILLAGER_E, MSGNO(MsgLunpaVillageVillagerESealedThoughts)),
1031 MIND_READ(ACTOR_VILLAGER_F, MSGNO(MsgLunpaVillageVillagerFSealedThoughts)),
1032 MIND_READ(ACTOR_VILLAGER_G, MSGNO(MsgLunpaVillageVillagerGSealedThoughts)),
1033 MIND_READ(ACTOR_VILLAGER_H, MSGNO(MsgLunpaVillageVillagerHSealedThoughts)),
1034 MIND_READ(ACTOR_WEST_GUARD, MSGNO(MsgLunpaVillageWestGuardSealedThoughts)),
1037};
1038
1041 TALK(ACTOR_VILLAGER_A, MSGNO(MsgLunpaVillageVillagerAReopened)),
1043 TALK(ACTOR_VILLAGER_C, MSGNO(MsgLunpaVillageVillagerCReopened)),
1045 TALK(ACTOR_VILLAGER_E, MSGNO(MsgLunpaVillageVillagerEReopened)),
1046 TALK(ACTOR_VILLAGER_F, MSGNO(MsgLunpaVillageVillagerFReopened)),
1047 TALK(ACTOR_VILLAGER_G, MSGNO(MsgLunpaVillageVillagerGReopened)),
1048 TALK(ACTOR_VILLAGER_H, MSGNO(MsgLunpaVillageVillagerHReopened)),
1049 TALK(ACTOR_WEST_GUARD, MSGNO(MsgLunpaVillageWestGuardReopened)),
1050 TALK(ACTOR_EAST_GUARD, MSGNO(MsgLunpaVillageEastGuardReopened)),
1052 MSGNO(MsgLunpaVillageVillagerAReopenedThoughts)),
1054 MSGNO(MsgLunpaVillageVillagerBReopenedThoughts)),
1056 MSGNO(MsgLunpaVillageVillagerCReopenedThoughts)),
1058 MSGNO(MsgLunpaVillageVillagerDReopenedThoughts)),
1060 MSGNO(MsgLunpaVillageVillagerEReopenedThoughts)),
1062 MSGNO(MsgLunpaVillageVillagerFReopenedThoughts)),
1064 MSGNO(MsgLunpaVillageVillagerGReopenedThoughts)),
1066 MSGNO(MsgLunpaVillageVillagerHReopenedThoughts)),
1068 MSGNO(MsgLunpaVillageWestGuardReopenedThoughts)),
1071};
1072
1073// clang-format off
1091 { SCENE_EVENTS_END },
1092};
1093// clang-format on
1094
1096 {MAP_CELL_STEP(38, 35, 2, 2, 5), MAP_CELL_STEP(40, 35, 2, 2, 5),
1098 {MAP_CELL_STEP(42, 35, 2, 2, 5), MAP_CELL_STEP(44, 35, 2, 2, 5),
1100 {MAP_CELL_STEP(46, 33, 2, 2, 5), MAP_CELL_STEP(48, 33, 2, 2, 5),
1102 {MAP_CELL_STEP(46, 35, 2, 2, 5), MAP_CELL_STEP(48, 35, 2, 2, 5),
1104 {MAP_CELL_STEP(50, 33, 2, 2, 5), MAP_CELL_STEP(52, 33, 2, 2, 5),
1106 {MAP_CELL_STEP(50, 35, 2, 2, 5), MAP_CELL_STEP(52, 35, 2, 2, 5),
1108 {MAP_CELL_STEP(42, 33, 4, 2, 5), MAP_CELL_STEP(38, 33, 4, 2, 5),
1110 {MAP_CELL_STEP(54, 33, 2, 2, 5), MAP_CELL_STEP(56, 33, 2, 2, 5),
1112};
1113
1115 {gLunpaDoorSteps[0], 46, 9}, {gLunpaDoorSteps[1], 52, 12},
1116 {gLunpaDoorSteps[2], 52, 18}, {gLunpaDoorSteps[3], 45, 20},
1117 {gLunpaDoorSteps[4], 51, 5}, {gLunpaDoorSteps[5], 37, 9},
1118 {gLunpaDoorSteps[6], 33, 6}, {gLunpaDoorSteps[7], 44, 17},
1119};
1120
@ ABILITY_CLOAK
Definition ability_ids.h:21
struct FieldActor * Object_GetById(s32 actor)
Returns an actor, or NULL if it does not exist.
const struct ScenePlacement * Scene_GetPlacements(void)
const struct SceneEntrance * Scene_GetEntrances(void)
const struct SceneEvent * Scene_GetEvents(void)
const u32 * Scene_GetExits(void)
Both scenes share one exit table.
const struct SceneRegion * Scene_GetRegions(void)
s32 Scene_Initialize(void)
Sets up whichever scene is being entered and runs its arrival events.
@ ACTOR_LAST_PLACED
Definition altin.c:137
const s32 * gEffectScripts[]
#define GARET
Jerald.
void Engine_ActorSetSpriteFlags(struct FieldActor *, s32)
The edition's language, for C to compare (LANGUAGE == LANGUAGE_GERMAN).
The engine call layer: one typed inline for each of the thirteen main-image routines below that the s...
static s32 FieldScheduler_AddCallback(SchedulerCallback callback, s32 priority)
Registers a main-image scheduler callback.
Definition engine_call.h:36
Field effects, their scripts and the flags that spawn them.
#define SCRIPT_DELETE
#define SCRIPT_REPEAT(count, label)
#define SCRIPT_SET_POSITION(x, y, z)
#define SCRIPT_WAIT(frames)
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
s32 Engine_LeaderCheckAhead(void)
static void Actor_SetDestination(s32 actor, s32 x, s32 z)
static void Actor_FaceDirection(s32 actor, s32 facing, s32 frames)
static void Map_AnimateCells(const u16 *steps, s32 destX, s32 destY)
void Engine_ActorSetSpritePriority(s32 actor, s32 priority)
void Engine_PsynergyBegin(s32 ability, s32 flags)
s32 Engine_EventChooseYesNo(s32 actor, s32 flags)
void Engine_MessageShowCentered(s32 message, s32 flags)
void Engine_ObjectSetPartPalettes(struct FieldActor *object, s32 palette)
s32 Engine_PartyGiveItem(s32 item, s32 flags)
#define GameFlag_IsSet
void Engine_PsynergyRaiseHands(void)
s32 Engine_TaskRemoveCallback(void(*callback)(void))
void Engine_PsynergyLowerHands(void)
#define EMOTE_IN_FRONT
Definition field_event.h:49
s32 Engine_MathSin(s32 angle)
#define MAP_CELL_STEP(srcX, srcY, width, height, frames)
Definition field_event.h:59
void Engine_ItemShowFound(s32 item, s32 height)
static void Actor_SetDestinationOffset(s32 actor, s32 dx, s32 dz)
void Engine_EventCloseScreen(void)
static void Actor_FaceActor(s32 actor, s32 target, s32 frames)
static void Actor_WalkTo(s32 actor, s32 x, s32 z)
void Engine_PsynergyCancel(void)
#define GameFlag_Clear
void Engine_EventWaitForScreen(void)
#define GameFlag_Set
static void Actor_ShowEmote(s32 actor, s32 emote, s32 frames)
static void Actor_WalkByAndWait(s32 actor, s32 dx, s32 dz)
s32 Engine_EventAskYesNo(s32 speaker, s32 flags)
void Engine_EventOpenScreen(void)
s32 Engine_EventOpenMessage(s32 speaker, s32 flags)
void Engine_GameFlagSet(s32 flag)
void Engine_GameFlagClear(s32 flag)
void Engine_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_ActorStop(s32 actor)
void Engine_ActorRunRepeatedMotion(s32 actor, s32 repeats)
static void Event_ShowMessage(s32 speaker, s32 flags)
s32 Engine_RandomNext()
static void Event_PlayCue(s32 cue)
static void Map_CopyCells(s32 srcX, s32 srcY, s32 width, s32 height, s32 destX, s32 destY)
#define MAP_CELL_STEPS_END
Definition field_event.h:61
s32 Engine_GameFlagIsSet(s32 flag)
void Engine_PsynergyPlayEffect(s32 effect)
void Engine_ActorStartRepeatedMotion(s32 actor, s32 repeats)
s32 Engine_MathCos(s32 angle)
static void Actor_WalkBy(s32 actor, s32 dx, s32 dz)
static void Actor_CenterAndWalk(s32 actor, s32 priority, s32 dz)
static void MapObject_SetPosition(s32 object, s32 fixed_x, s32 fixed_z)
static void Actor_SetSpeed(s32 actor, s32 speed, s32 acceleration)
@ TASK_PRIORITY_SCENE
Definition field_event.h:40
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_PsynergySetTarget(s32 caster, s32 target)
static struct FieldActor * Actor_Get(s32 actor)
Field objects and actors, and the scene transition styles.
@ 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_PRIORITY_AUTOMATIC
The sprite takes its priority from the map cell under it.
Definition field_obj.h:153
@ ACTOR_FALLS
falls by its gravity and bounces
Definition field_obj.h:161
#define SCENE_TRANSITION(style, variant)
Definition field_obj.h:20
The field's runtime work: map cells, scene records and regions, map markers and FieldWork.
The scene table formats: entrances, exits, placements and events, and the macros that write them.
#define SCENE_EVENTS_END
@ EVENT_TOUCH
@ EVENT_EXIT
@ EVENT_RAISED
@ FACING_STEP
Definition field_scene.h:36
#define SCENE_EXITS(scene)
Definition field_scene.h:72
#define PSYNERGY_IN_AREA(ability, phase)
@ SCENE_LUNPA_FORTRESS
Definition field_scene.h:21
@ SCENE_WEST_LUNPA_CAVE
Definition field_scene.h:19
@ SCENE_VAULT_JAIL
Definition field_scene.h:15
@ SCENE_LUNPA
Definition field_scene.h:17
@ SCENE_WORLD_MAP
Definition field_scene.h:13
@ SCENE_LUNPA_FORTRESS_GATE
Definition field_scene.h:20
#define SCENE_EXIT(exit, scene, entrance)
Definition field_scene.h:73
@ ACTOR_FIRST_PLACED
@ 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 EVENT_SCRIPT(script)
@ ACTOR_WANDER
@ ACTOR_STAND
#define SEARCH(target)
#define SCENE_EXITS_END
Definition field_scene.h:77
@ FACING_EAST
Definition field_scene.h:26
@ FACING_SOUTHEAST
Definition field_scene.h:27
@ FACING_NORTH
Definition field_scene.h:32
@ 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
#define FLAG_LUNPA_FORTRESS_THREE_GUARDS_BEATEN
Definition flags.h:308
#define FLAG_LUNPA_FORTRESS_HALL_GUARD_BEATEN
Definition flags.h:307
#define FLAG_SCENE_TEMP_43
Definition flags.h:780
#define FLAG_LUNPA_NUT_CAUGHT
the nut floating over the town
Definition flags.h:291
#define FLAG_LUNPA_PSYNERGY_STONE
Definition flags.h:286
#define FLAG_LUNPA_TRADE_REOPENED
Definition flags.h:123
#define FLAG_SCENE_TEMP_44
Definition flags.h:781
#define FLAG_SCENE_TEMP_40
Definition flags.h:777
#define FLAG_SCENE_TEMP_00
Definition flags.h:713
#define FLAG_LUNPA_FORTRESS_COLUMN_LOWERED
Definition flags.h:299
#define FLAG_SCENE_TEMP_02
Definition flags.h:715
#define FLAG_LUNPA_FORTRESS_FIRST_SWITCH_UNCOVERED
Whirlwind has blown away what hid the first switch, the passage and the second switch.
Definition flags.h:302
#define FLAG_LUNPA_CAVE_REUNION_SEEN
Definition flags.h:124
#define FLAG_KEEP_PARTY_POSITION
Definition flags.h:93
#define FLAG_LUNPA_GATE_GUARD_SAW_HAMMET
The gate's left guard has recognized Hammet with the party.
Definition flags.h:285
#define FLAG_GUARDS_SUSPECT_KALAY
Set on the world map; from then on the east guard asks whether the party came from Kalay.
Definition flags.h:283
#define FLAG_LUNPA_FORTRESS_SECOND_SWITCH_FLIPPED
Definition flags.h:306
#define FLAG_LUNPA_FORTRESS_WEST_GUARD_BEATEN
Definition flags.h:310
#define FLAG_SCENE_TEMP_01
Definition flags.h:714
#define FLAG_LUNPA_FORTRESS_FIRST_SWITCH_FLIPPED
Definition flags.h:305
#define FLAG_SCENE_TEMP_41
Definition flags.h:778
#define FLAG_LUNPA_FORTRESS_PASSAGE_UNCOVERED
Definition flags.h:303
#define FLAG_SCENE_TEMP_42
Definition flags.h:779
#define FLAG_LUNPA_FORTRESS_SECOND_SWITCH_UNCOVERED
Definition flags.h:304
#define FLAG_LUNPA_FORTRESS_EAST_GUARD_BEATEN
Definition flags.h:309
volatile u32 gFrameCount
Frames WaitFrames has finished.
GameState, the game's state: play time, coins, the scene and the leader's position,...
struct GameState gGameState
@ ITEM_NUT
Definition item_ids.h:41
static void Event_EnterDoor(void)
The leader walks into a doorway: the door opens and the leader goes in.
Definition lunpa.c:438
static void Event_ComplainAboutCold(void)
Shivers and complains that the weather has become colder.
Definition lunpa.c:322
static void Event_EnterHiddenPassage(void)
The hidden passage to the jail, once opened and while Reveal shows it.
Definition lunpa.c:471
struct SceneEvent gGateEvents[]
Definition lunpa.c:1074
static void Event_TalkToWestGuard(void)
The west guard of the town asks whether the party wants in.
Definition lunpa.c:249
static void Event_TalkToLeftGuard(void)
The gate's left guard: hears someone while the party is cloaked; after trade reopens,...
Definition lunpa.c:340
static void Event_GuardsBlockGate(void)
Coming close uncloaked, the guards step in front of the fortress door and the gateway closes.
Definition lunpa.c:546
static void Event_TalkToRightGuard(void)
The gate's right guard.
Definition lunpa.c:361
static void Event_EnterFortress(void)
Through the fortress door, out of the gate's top.
Definition lunpa.c:485
static void Event_AskAboutLengthOfStay(void)
Asks how long the party has been in Lunpa.
Definition lunpa.c:298
#define MIND_READ(actor, value)
Definition lunpa.c:971
static void Lunpa_KickUpLeaderDust(void)
Every 16 frames while the leader is thrown: a puff of dust.
Definition lunpa.c:684
struct SceneEvent gLunpaReopenedEvents[]
Definition lunpa.c:1039
#define LUNPA_ROADS_AND_DOORS
Definition lunpa.c:978
static UNUSED void Lunpa_PlayRevealCue(void)
Reveal's sound when it uncovers something.
Definition lunpa.c:506
static void Lunpa_ApplyFrozenPuddleCollision(void)
Restores the frozen pillar's three collision cells, including its sides.
Definition lunpa.c:115
static void Event_HideSecrets(void)
Reveal's end, and every entry to the town: the secrets hide again.
Definition lunpa.c:205
u16 gLunpaDoorSteps[DOOR_COUNT][11]
Definition lunpa.c:1095
static void Event_AskAboutHammetsKidnapping(void)
Asks whether Dodonpa kidnapped Hammet for ransom.
Definition lunpa.c:306
static void Event_GuardsThrowLeaderOut(void)
Entering the gate after being caught inside: the guards throw the leader out and down the steps.
Definition lunpa.c:701
static void Lunpa_CopyGatewayCollision(s32 sourceColumn, s32 sourceRow)
Copies one open or blocked source cell across the three-cell gateway.
Definition lunpa.c:538
u32 gLunpaUnusedWord
Definition lunpa.c:1121
static void Event_GuardsCatchParty(void)
Raised when the guards spot the party: they recognize the man with them, and march the party back dow...
Definition lunpa.c:580
struct SceneEntrance gGateEntrances[]
Definition lunpa.c:889
struct LunpaDoor gLunpaDoors[]
Definition lunpa.c:1114
static void Lunpa_DrawHiddenPassageFrame(s32 sourceColumn, s32 sourceRow)
Draws the three map regions that make one frame of the hidden passage.
Definition lunpa.c:150
static void Event_CastCloak(void)
Cloak: the gateway closes behind the guards.
Definition lunpa.c:573
static void Lunpa_WatchForFortressApproach(void)
Every frame at the gate after trade reopens: stepping up to row 10 raises Garet's warning (trigger TR...
Definition lunpa.c:412
static void Event_PressHiddenSwitch(void)
Searching the switch Reveal shows: the passage opens in five steps.
Definition lunpa.c:513
static void Event_ReadRightGuardsThoughts(void)
Definition lunpa.c:401
static void Event_ReadEastGuardsThoughts(void)
Definition lunpa.c:279
static void Event_FreezeHiddenPuddle(void)
Frost on the puddle Reveal shows: it freezes into a pillar the party can stand on.
Definition lunpa.c:123
s32 gMediumEffectScript[]
Definition lunpa.c:47
struct SceneEvent gLunpaSealedEvents[]
Definition lunpa.c:1014
static void Event_CloakFades(void)
Cloak fades: if the leader is still among the guards, they are caught.
Definition lunpa.c:642
static void Lunpa_ReopenGateway(void)
Definition lunpa.c:639
struct ScenePlacement gLunpaPlacements[]
Definition lunpa.c:930
static void Event_SearchWell(void)
Definition lunpa.c:226
#define ROOM_EXIT(exit)
Definition lunpa.c:898
u32 gLunpaExits[]
Definition lunpa.c:901
static void Lunpa_WatchForUncloakedParty(void)
Every frame at the gate: an uncloaked leader in front of the guards is spotted.
Definition lunpa.c:669
#define LUNPA_SECRETS
Definition lunpa.c:991
static void UNUSED Lunpa_CheckAhead(void)
Definition lunpa.c:503
static void Event_TalkToEastGuard(void)
The east guard: wants authorization, or once the guards suspect Kalay, asks twice whether the party c...
Definition lunpa.c:259
static void Event_CatchFloatingNut(void)
Catch on the nut floating over the town: the party gets it.
Definition lunpa.c:105
struct SceneEntrance gLunpaEntrances[]
Definition lunpa.c:872
static void Event_RevealSecrets(void)
Reveal: the Psynergy Stone's spot, the hidden switch's glint, the puddle and, once opened,...
Definition lunpa.c:159
static void Event_GaretTurnsLeaderBack(void)
Garet reminds the leader they cannot go into the fortress, and the leader steps back.
Definition lunpa.c:423
#define GATE_ENTRANCE(entrance, x, z, facing)
Definition lunpa.c:869
#define TALK(actor, value)
Definition lunpa.c:970
struct ScenePlacement gGatePlacements[]
Definition lunpa.c:960
static void UNUSED Lunpa_DoNothing(void)
Definition lunpa.c:570
s32 gShortEffectScript[]
How long an effect of common/effect_spawn.h lasts: 22, 44 or 126 frames, then it moves away and is fr...
Definition lunpa.c:41
static void Event_LeaderSneaksOut(void)
Entering the gate after sneaking out of the fortress: the leader casts Cloak and slips around the gua...
Definition lunpa.c:780
static void Lunpa_UpdateIcePillarDrawOrder(void)
Every frame while the pillar stands: draw it under the leader once the leader is on top.
Definition lunpa.c:139
static void Event_AskAboutSeeingDonpa(void)
Asks whether the party wants to see Donpa.
Definition lunpa.c:314
u32 gGateExits[]
Definition lunpa.c:921
#define LUNPA_ENTRANCE(entrance, x, z, facing)
Definition lunpa.c:867
static void Event_ReadLeftGuardsThoughts(void)
Mind Read on the left guard: before the cave reunion he thinks the man with the party looks like that...
Definition lunpa.c:375
static void Event_AskAboutFortressCommotion(void)
Offers to explain the commotion at the fortress.
Definition lunpa.c:331
s32 gLongEffectScript[]
Definition lunpa.c:53
@ PALETTE_TRANSLUCENT_EFFECT
Definition lunpa.c:34
@ PALETTE_EFFECT
Definition lunpa.c:34
Small statement macros both games use for positions, velocities and bounds.
#define SET_VECTOR(v, x, y, z)
Sets the x, y and z of a three-part vector: a position about to be projected, a per-frame step,...
Definition macros.h:12
Scene numbers, named after their places.
char SceneId_Lunpa1
char SceneId_Lunpa2
#define SE_DOOR_OPEN
Definition songs.h:153
#define SE_HIDDEN_PASSAGE_OPEN
Definition songs.h:205
#define MUS_TREASURE_FOUND
Definition songs.h:82
#define SE_SCUFFLE
Definition songs.h:114
#define SE_LANDING_THUD
Definition songs.h:120
void Engine_ActorSetAnimation()
struct EventWork * gEventWork
void Engine_EventRequestExit()
void Engine_ActorSetPosition(u32 actor, s32 x, s32 z)
void Engine_EventEnd(void)
void Engine_AudioPlayCue()
void Engine_EventBegin(void)
void Engine_ActorShowEmote()
void Engine_TaskWait()
void Engine_EventSetMessage()
void Engine_EventShowMessage()
#define NULL
Definition bilibin.h:6
void Scene_FloatNut(s32 id)
Draws actor id as the Nut's icon and starts it floating, 32 pixels up unless the party returns to whe...
@ GATE_RETREAT_ENTRANCE
Definition lunpa.h:151
@ LUNPA_EXIT_TO_ARMS_SHOP
Definition lunpa.h:36
@ LUNPA_EXIT_TO_FIRST_HOME
Definition lunpa.h:33
@ LUNPA_EXIT_TO_THIRD_HOME
Definition lunpa.h:35
@ LUNPA_EXIT_TO_JAIL
Definition lunpa.h:41
@ LUNPA_EXIT_TO_EIGHTH_ROOM
Definition lunpa.h:40
@ LUNPA_EXIT_TO_ITEM_SHOP
Definition lunpa.h:37
@ LUNPA_EXIT_TO_SECOND_HOME
Definition lunpa.h:34
@ LUNPA_EXIT_TO_GATE
Definition lunpa.h:31
@ LUNPA_EXIT_TO_TEMPLE
Definition lunpa.h:39
@ LUNPA_EXIT_TO_WORLD_MAP
Definition lunpa.h:30
@ LUNPA_EXIT_TO_INN
Definition lunpa.h:38
@ LUNPA_EXIT_TO_CAVE
Definition lunpa.h:32
@ JAIL_ENTRANCE_FROM_LUNPA
Definition lunpa.h:61
@ FORTRESS_ENTRANCE_FROM_GATE
Definition lunpa.h:62
@ WORLD_MAP_ENTRANCE_FROM_LUNPA
Definition lunpa.h:58
@ CAVE_ENTRANCE_FROM_LUNPA
Definition lunpa.h:59
@ SPRITE_TOWNSPERSON_B
Definition lunpa.h:129
@ SPRITE_TOWNSPERSON_C
Definition lunpa.h:130
@ SPRITE_TOWNSPERSON_D
Definition lunpa.h:132
@ SPRITE_GUARD
Definition lunpa.h:136
@ SPRITE_TOWNSPERSON_J
Definition lunpa.h:135
@ SPRITE_PUDDLE
Definition lunpa.h:137
@ SPRITE_TOWNSPERSON_G
Definition lunpa.h:128
@ SPRITE_TOWNSPERSON_H
Definition lunpa.h:131
@ SPRITE_GLINT
Definition lunpa.h:138
@ SPRITE_TOWNSPERSON_I
Definition lunpa.h:133
@ SPRITE_ITEM_ICON
Definition lunpa.h:127
@ SPRITE_TOWNSPERSON_E
Definition lunpa.h:134
@ CLOAK_FADED
Definition lunpa.h:143
@ CLOAK_CAST
Definition lunpa.h:143
@ GLINT_MOTION_FLAGS
Definition lunpa.h:146
@ GLINT_SCALE_X
Definition lunpa.h:147
@ GLINT_SCALE_Y
Definition lunpa.h:148
@ RECOGNITION_SEEN_THAT_MAN
Definition lunpa.h:160
@ RECOGNITION_IMPOSSIBLE
Definition lunpa.h:160
@ CATCH_LEFT_GUARD_REFUSES_ENTRY
Definition lunpa.h:156
@ CATCH_RIGHT_GUARD_SENDS_PARTY_OFF
Definition lunpa.h:157
@ CATCH_LEFT_GUARD_CHALLENGES
Definition lunpa.h:154
@ CATCH_RIGHT_GUARD_WONDERS
Definition lunpa.h:155
@ ACTOR_RIGHT_GUARD
Definition lunpa.h:122
@ ACTOR_LEFT_GUARD
Definition lunpa.h:121
@ TRIGGER_PARTY_SPOTTED
Definition lunpa.h:94
@ TRIGGER_FORTRESS_APPROACH
Definition lunpa.h:93
@ TRIGGER_THIRD_ROAD
Definition lunpa.h:91
@ TRIGGER_LUNPA_ROAD
Definition lunpa.h:90
@ TRIGGER_FORTRESS_DOOR
Definition lunpa.h:89
@ TRIGGER_GUARDED_GROUND
Definition lunpa.h:92
@ MAP_OBJECT_PSYNERGY_STONE
Definition lunpa.h:166
@ GATE_EXIT_THIRD
Definition lunpa.h:54
@ GATE_EXIT_TO_LUNPA
Definition lunpa.h:53
@ GATE_EXIT_TO_FORTRESS
Definition lunpa.h:52
@ DOOR_TEMPLE
Definition lunpa.h:99
@ DOOR_COUNT
Definition lunpa.h:98
@ ANIM_SPRAWLED
Definition lunpa.h:162
@ ACTOR_FLOAT
Definition lunpa.h:141
@ PILLAR_TOP_HEIGHT
Definition lunpa.h:164
@ CELL_SIZE
Definition lunpa.h:164
@ GATE_ENTRANCE_THROWN_OUT
Definition lunpa.h:48
@ GATE_ENTRANCE_FROM_LUNPA
Definition lunpa.h:46
@ GATE_ENTRANCE_SNEAKING_OUT
Definition lunpa.h:47
@ GATE_ENTRANCE_FROM_FORTRESS
Definition lunpa.h:45
@ ACTOR_FLOATING_NUT
Definition lunpa.h:115
@ ACTOR_VILLAGER_H
Definition lunpa.h:111
@ ACTOR_HIDDEN_PUDDLE
Definition lunpa.h:103
@ ACTOR_VILLAGER_G
Definition lunpa.h:110
@ ACTOR_VILLAGER_E
Definition lunpa.h:108
@ ACTOR_VILLAGER_F
Definition lunpa.h:109
@ ACTOR_EAST_GUARD
Definition lunpa.h:113
@ ACTOR_SWITCH_GLINT
Definition lunpa.h:114
@ ACTOR_WEST_GUARD
Definition lunpa.h:112
@ ACTOR_VILLAGER_D
Definition lunpa.h:107
@ ACTOR_VILLAGER_B
Definition lunpa.h:105
@ ACTOR_VILLAGER_C
Definition lunpa.h:106
@ ACTOR_VILLAGER_A
Definition lunpa.h:104
@ LUNPA_ENTRANCE_FROM_ITEM_SHOP
Definition lunpa.h:22
@ LUNPA_ENTRANCE_FROM_JAIL
Definition lunpa.h:26
@ LUNPA_ENTRANCE_FROM_THIRD_HOME
Definition lunpa.h:20
@ LUNPA_ENTRANCE_FROM_FIRST_HOME
Definition lunpa.h:18
@ LUNPA_ENTRANCE_FROM_GATE
Definition lunpa.h:16
@ LUNPA_ENTRANCE_FROM_CAVE
Definition lunpa.h:17
@ LUNPA_ENTRANCE_FROM_TEMPLE
Definition lunpa.h:24
@ LUNPA_ENTRANCE_FROM_INN
Definition lunpa.h:23
@ LUNPA_ENTRANCE_FROM_SECOND_HOME
Definition lunpa.h:19
@ LUNPA_ENTRANCE_FROM_WORLD_MAP
Definition lunpa.h:15
@ LUNPA_ENTRANCE_FROM_EIGHTH_ROOM
Definition lunpa.h:25
@ LUNPA_ENTRANCE_FROM_ARMS_SHOP
Definition lunpa.h:21
@ TRIGGER_WELL
Definition lunpa.h:82
@ TRIGGER_FIRST_HOME_DOOR
Definition lunpa.h:72
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
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
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
void(*) update(union FieldObject *object)
Called each frame before the object's script, while the object is live.
Definition field_obj.h:116
Full event work allocated by Field_RunScene (heap slot 27).
s16 event
A raised event for Scene_RunRaisedEvent, or -1 when characters fell to poison or hazard damage,...
s16 command
a field Psynergy to use, as owner << 10 | Psynergy
s32 transition
SCENE_TRANSITION(style, variant); 0x100 on entry.
s16 action
The twelve requests: each nonzero value asks the field loop for one thing; Field_ClearRequests clears...
s16 cloaked
1 under Cloak, which prevents battles
Definition game_state.h:114
s16 retreatEntrance
where Retreat goes; the group's first entrance
Definition game_state.h:109
s16 entrance
Definition game_state.h:37
One house door: the cell animation that opens it and where it plays.
Definition lunpa.h:176
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 integer types, TRUE, UNUSED and the fixed-address macros.
signed int s32
Definition types.h:14
unsigned int u32
Definition types.h:15
unsigned short u16
Definition types.h:13
#define UNUSED
Definition types.h:22
struct FieldCoordinate::@024321007066302143002254325121164243234242211074 part
s32 fixed
16.16 fixed-point pixels
The patch levels: our groups of the measured changes from the Japanese release.