Alchemy
Loading...
Searching...
No Matches

vale_cave.c

Go to the documentation of this file.
1/// @file
2/// The cave above Vale: three rooms of Psynergy puzzles, where the Jupiter
3/// Djinni Kite hides. Djinn_JoinParty(ACTOR_KITE, 3, 4) gives Jupiter Djinni 4,
4/// and the fifth Jupiter Djinni the text names is Kite.
5
6#include "game_state.h"
7#include "version.h"
8#include "engine_call.h"
9#include "global_cells.h"
10#include "unit/import.h"
13#include "unit/object/object.h"
16
17#include "field_obj.h"
18#include "mapcopy.h"
19#include "types.h"
20#include "field_event.h"
21#include "field_scene.h"
23#include "staged_actor.h"
25#include "battle.h"
26#include "debug.h"
27#include "field.h"
28#include "game.h"
29#include "graphics.h"
30#include "menu.h"
31#include "minigame.h"
32#include "sound.h"
33#include "system.h"
34#include "edition.h"
35#include "field_effect.h"
36#include "scene_ids.h"
37#include "ability_ids.h"
38#include "item_ids.h"
39#include "objcmd.h"
40#include "flags.h"
41
42#include "fixed_math.h"
43#include "songs.h"
44
45// Kite is placement 8 of the second room; the objects moved with Move or
46// pushed are placements 9 to 11 of the second and third rooms.
47#define ACTOR_KITE 8
48#define WESTERN_MOVABLE_OBJECT 9
49#define EASTERN_MOVABLE_OBJECT 10
50#define SLIDING_OBJECT 11
51#define OBJECT_SINK_FRAMES 68
52#define OBJECT_SINK_STEP 0x8000
53#define ACTOR_LANDING_TIMEOUT 60
54#define FIRST_DJINNI_ROUTE_TRIGGER 45
55
56/// The flag of Kite, set once it is caught.
57#define FLAG_KITE (FLAG_DJINNI_0 + 3 * 20 + 4)
58
59// The cave's scene flags:
60// - FLAG_SCENE_TEMP_00 and _01: in the second room, the western and eastern
61// objects sunk into their holes, or, in Kite's part of it, its first and
62// second escape.
63// - FLAG_SCENE_TEMP_02 to _05: in the third room, the object pushed off the
64// ledge, the object pushed over its edge, and the object slid north, ending
65// on the northern or the southern row (row 20).
66
67// The cave's place flags. The second and third rooms are one place group, so
68// these last while the party goes between them; the first room is another.
69/// The sliding objects of the second room are at their eastern end.
70#define FLAG_VALE_CAVE_SLIDERS_EAST 0x301
71/// Kite has run behind the ledge and keeps to its far side.
72#define FLAG_VALE_CAVE_KITE_BEHIND_LEDGE 0x302
73
74static void ValeCave_CenterActorOnCell(s32 actorId, s32 column, s32 row);
75static void ValeCave_ApplyEntryState(void);
76
78#include "common/effect_spawn.h"
80
81/// Talking to Kite after Halt: it joins the party.
82///
83/// Scene_TalkToActor selects this kind 7 event while Kite is the paused actor.
84/// Gives Jupiter Djinni 4, setting FLAG_KITE so neither room places Kite again.
85static void Event_TalkToKite(void) { Djinn_JoinParty(ACTOR_KITE, 3, 4); }
86
87/// Waits for an actor to land, bounded by a one-second timeout.
88static void ValeCave_WaitForActorLanding(struct FieldActor *actor) {
89 s32 framesRemaining = ACTOR_LANDING_TIMEOUT;
90
91 while (framesRemaining != 0) {
93 framesRemaining--;
94 if (actor->y.fixed <= actor->terrainHeight)
95 break;
96 }
97 actor->y.fixed = actor->terrainHeight;
98}
99
100/// Turns Kite to face the party leader each frame.
101///
102/// Kite's update hook once it has run behind the ledge, set by
103/// Event_KiteRunsBehindLedge and again by ValeCave_ApplyEntryState.
104// UB: calling this s32 function through a void update hook is incompatible.
105// Plain void changes 38 to 36 bytes in tbs-en.
106#ifdef UBFIX
107static void ValeCave_FaceActorTowardLeader(union FieldObject *fieldObject) {
108#else
110#endif
111 struct FieldActor *actor = (struct FieldActor *)fieldObject;
113 s32 distanceZ = leader->z.fixed - actor->z.fixed;
114 s32 distanceX = leader->x.fixed - actor->x.fixed;
115
116 actor->facing = ArcTan2(distanceZ, distanceX);
117#ifdef UBFIX
118 return;
119#else
120 return 0;
121#endif
122}
123
124#ifdef UBFIX
125#define VALE_CAVE_FACE_LEADER_CALLBACK ValeCave_FaceActorTowardLeader
126#else
127#define VALE_CAVE_FACE_LEADER_CALLBACK \
128 ((void (*)(union FieldObject *))ValeCave_FaceActorTowardLeader)
129#endif
130
131/// Selects entrance positions and camera bounds for the current cave room.
133 s16 scene = gGameState.scene;
134
135 if (scene == (s32)&SceneId_ValeCave1) {
137 }
138 if (scene == (s32)&SceneId_ValeCave2) {
140 }
141 if (scene == (s32)&SceneId_ValeCave3) {
143 }
145}
146
147const struct SceneRegion *ValeCave_GetRegions(void) { return NULL; }
148
149/// Returns the shared packed exits for all cave rooms.
150const u32 *ValeCave_GetExits(void) { return gValeCave_Exits; }
151
152/// Selects the current room's actors and movable objects.
154 s16 scene = gGameState.scene;
155
156 if (scene == (s32)&SceneId_ValeCave1) {
158 }
159 if (scene == (s32)&SceneId_ValeCave2) {
161 }
162 if (scene == (s32)&SceneId_ValeCave3) {
164 }
166}
167
168/// Reveal ends: the hidden tile is hidden again.
169///
170/// Reached by Reveal's phase 4 anywhere in the second room.
171static void Event_HideRevealedTile(void) {
172 Map_CopyCells(16, 15, 1, 1, 15, 15);
173}
174
175/// Reveal shows a hidden tile in the second room.
176///
177/// Reached by Reveal's phase 5 anywhere in the second room; copies cell
178/// (16, 17) over cell (15, 15) until Event_HideRevealedTile puts it back.
179static void Event_RevealHiddenTile(void) {
180 Map_CopyCells(16, 17, 1, 1, 15, 15);
181}
182
183/// Lowers one object while emitting a particle each frame around its opening.
184static inline void
186 struct EffectOptions *particleOptions) {
187 u32 frame;
188
189 for (frame = 0; frame < OBJECT_SINK_FRAMES; frame++) {
190 s32 particleX = (((u32)(Engine_RandomNext() * 17) >> 16) << 16) + baseX;
191 s32 particleZ = (((u32)(Engine_RandomNext() * 14) >> 16) << 16) + baseZ;
192
193 Effect_Spawn(particleX, 0, particleZ, 0, 0, 0,
194 EFFECT_USE_START_SCALE | EFFECT_USE_PALETTE, particleOptions);
197 }
198}
199
200/// Move on the western object: once over its hole, Isaac steps aside and the
201/// object sinks into the floor in a cloud of dust.
202///
203/// Reached by Move on the western object (actor 9) in the second room, until
204/// FLAG_SCENE_TEMP_00 is set. Over its hole (column 23) it sets
205/// FLAG_SCENE_TEMP_00 and makes the hole's cells walkable.
207 struct EffectOptions options;
208 struct EffectOptions *particleOptions;
209 struct FieldActor *leftEffect;
210 struct FieldActor *rightEffect;
211
213 if (Object_GetById(WESTERN_MOVABLE_OBJECT)->x.fixed >> 20 == 23) {
214 // Move the leader aside before the object starts descending.
218 leftEffect = OverlayObject_PrepareObject(
221 rightEffect = OverlayObject_PrepareObject(
225 // Surround the descending object with one particle per frame.
226 particleOptions = &options;
227 particleOptions->startScaleX = 0x9999;
228 particleOptions->startScaleY = 0x9999;
229 particleOptions->palette = 7;
232 PIXELS(624), particleOptions);
233 Map_CopyCellAttributes(23, 41, 1, 1, 23, 39);
240 Engine_ObjectDispatchRelease(rightEffect);
242 }
244}
245
246/// Move on the eastern object: once over its hole, it sinks into the floor.
247///
248/// Reached by Move on the eastern object (actor 10) in the second room, until
249/// FLAG_SCENE_TEMP_01 is set, and from Event_PushEastObjectIntoHole. Over its
250/// hole (column 27) it sets FLAG_SCENE_TEMP_01 and makes the hole's cells
251/// walkable.
253 struct EffectOptions options;
254 struct EffectOptions *particleOptions;
255 struct FieldActor *leftEffect;
256 struct FieldActor *rightEffect;
257
259 if (Object_GetById(EASTERN_MOVABLE_OBJECT)->x.fixed >> 20 == 27) {
260 leftEffect = OverlayObject_PrepareObject(
263 rightEffect = OverlayObject_PrepareObject(
267 // Surround the descending object with one particle per frame.
268 particleOptions = &options;
269 particleOptions->startScaleX = 0x9999;
270 particleOptions->startScaleY = 0x9999;
271 particleOptions->palette = 7;
274 PIXELS(656), particleOptions);
275 Map_CopyCellAttributes(31, 39, 2, 1, 27, 41);
282 Engine_ObjectDispatchRelease(rightEffect);
284 }
286}
287
288/// Pushing the eastern object: it moves a cell, and sinks if over its hole.
289///
290/// Reached by walking into cell code 24 in the second room, until
291/// FLAG_SCENE_TEMP_01 is set.
294 StagedActor_AdvancePair();
297}
298
299/// Walking south off the ledge: Isaac hops down if the cell below is free.
300///
301/// Reached by walking south into cell code 21 in the second room. Returns 1
302/// when the leader hopped, 0 when the landing cell is blocked.
303static s32 Event_HopDownLedge(s32 unusedArgument) {
304
305 union FieldCoordinate landingPosition[3];
306 struct FieldActor *leader;
308 s32 savedMotionFlags;
309
311 motionFlags = &leader->motionFlags;
312 savedMotionFlags = *motionFlags;
313#if TBS_PATCH_1
314 landingPosition[0].fixed = (leader->x.fixed & -0x100000) + 0x80000;
315 landingPosition[1].fixed = leader->y.fixed;
316 landingPosition[2].fixed = (leader->z.fixed & -0x100000) + 0x280000;
317#else
318 landingPosition[0].fixed = leader->x.fixed;
319 landingPosition[1].fixed = leader->y.fixed;
320 landingPosition[2].fixed = leader->z.fixed + 0x200000;
321#endif
322 // Keep the normal motion flags while staging the hop.
324 leader, (struct FieldPosition *)landingPosition) == 0) {
326 Object_SetMode(leader, 6);
329 Object_SetMode(leader, 7);
330 leader->speed = 0x30000;
331 leader->acceleration = 0x20000;
332 leader->velocityY = 0x40000;
333 *motionFlags &= 126;
335 Engine_ActorMoveToAndWait(0, landingPosition[0].part.pixel,
336 landingPosition[2].part.pixel);
337 Object_SetMode(leader, 6);
339 *motionFlags = savedMotionFlags;
341 return 1;
342 }
343 return 0;
344}
345
346/// Coming near Kite: the camera finds it; it notices the party and hops away
347/// up the ledge.
348///
349/// Reached by stepping on cell code 40 in the second room until Kite is
350/// caught (FLAG_KITE); runs once, setting FLAG_SCENE_TEMP_00.
351static void Event_KiteRunsOff(void) {
352
353 struct FieldActor *djinni;
354
358 Camera_SetSpeed(Q16_ONE, 0x2000);
369 djinni = Actor_Get(ACTOR_KITE);
370 djinni->velocityY = 0x80000;
376 }
377}
378
379/// Coming near again: Kite runs behind the ledge and turns to watch the party.
380///
381/// Reached by stepping on cell code 41 in the second room until Kite is
382/// caught, once Event_KiteRunsOff has run. Sets FLAG_SCENE_TEMP_01 and
383/// FLAG_VALE_CAVE_KITE_BEHIND_LEDGE, and gives Kite the update hook
384/// ValeCave_FaceActorTowardLeader.
385static void Event_KiteRunsBehindLedge(void) {
386
387 struct FieldActor *djinni;
388
403 djinni = Actor_Get(ACTOR_KITE);
406 }
407 }
408}
409
410/// Walking around the ledge: Kite keeps to the far side of it, unless Halt has
411/// stopped it.
412///
413/// Reached by stepping on cell codes 45 to 56 in the second room until Kite is
414/// caught, once FLAG_VALE_CAVE_KITE_BEHIND_LEDGE is set; each code sends Kite
415/// to its row of gValeCave_WalkTargets at the leader's speed.
416static void Event_KiteKeepsAway(void) {
417 struct FieldActor *djinni;
418 struct FieldActor *leader;
419 s32 routeIndex;
420 const u8 *walkTargetBytes;
421 s32 targetZOffset;
422 struct EventWork *event;
423
424 event = gEventWork;
427 // Preserve the speed reads before resolving this route point.
428 routeIndex = event->touchedTrigger;
429 djinni = Object_GetById(ACTOR_KITE);
431 djinni->speed = leader->speed;
432 djinni = Object_GetById(ACTOR_KITE);
434 djinni->acceleration = leader->acceleration;
435 routeIndex -= FIRST_DJINNI_ROUTE_TRIGGER;
436 // X/Z pairs occupy eight bytes. Plain pair indexing changes six
437 // instruction words in the English build, so keep separate offsets.
438 walkTargetBytes = (const u8 *)gValeCave_WalkTargets;
439 routeIndex <<= 3;
440 targetZOffset = routeIndex + sizeof(s32);
442 *(const s32 *)(walkTargetBytes + routeIndex),
443 *(const s32 *)(walkTargetBytes + targetZOffset));
444 }
445 }
446}
447
448/// Halt on Kite: it stops where it stands.
449///
450/// Reached by Halt on Kite (actor 8) in the second room.
451static void Event_HaltKite(void) {
455}
456
457/// Pushing an object along the ledge: at its edge the object falls off,
458/// opening the way.
459///
460/// Reached by walking into cell code 20 in the third room. When the object
461/// falls (column 17) it sets FLAG_SCENE_TEMP_03 and clears the cells it held.
462static void Event_PushObjectOverEdge(void) {
463 struct FieldActor *movedObject;
464 s32 stationaryMotion;
465 s32 clearedRows;
466 struct StagedActorProbe probe;
467
469 if (StagedActor_FindClearPosition(&probe) != 0) {
470 SceneActor_MoveAndRedraw(probe);
471 // At the ledge's edge (column 17) the object slides west and drops.
472 if ((probe.position.x >> 20) == 17) {
474 stationaryMotion = 0;
475 Object_GetById(probe.actorSlot)->motionFlags = stationaryMotion;
476 movedObject = Object_GetById(probe.actorSlot);
477 movedObject->bounce = stationaryMotion;
487 {
488 struct FieldActor *movedObject = Object_GetById(probe.actorSlot);
489
491 }
492 // The cells it held on the ledge, and its landing, become open floor.
493 clearedRows = 4;
495 ((probe.position.z >> 20) - 2), 1,
496 clearedRows, stationaryMotion);
498 ((probe.position.z >> 20) - 2), 1,
499 clearedRows, stationaryMotion);
500 StagedActor_FillGridAttributeRectangle(2, 16, 18, 1, 2, stationaryMotion);
501 StagedActor_FillGridAttributeRectangle(0, 16, 16, 1, clearedRows,
502 stationaryMotion);
505 }
506 }
508}
509
510/// Pushing the western object east: it falls off the ledge, opening the way.
511///
512/// Reached by walking east into cell code 21 in the third room. Sets
513/// FLAG_SCENE_TEMP_02 and clears the cells the object held.
514static void Event_PushObjectOffLedge(void) {
515
516 struct FieldActor *pushedObject;
517 s32 stationaryMotion;
518
521 Actor_SetSpeed(ACTOR_PARTY_LEADER, 0x8000, 0x1999);
528 Actor_SetSpeed(WESTERN_MOVABLE_OBJECT, 0x8000, 0x1999);
530 stationaryMotion = 0;
532 pushedObject = Actor_Get(WESTERN_MOVABLE_OBJECT);
533 pushedObject->bounce = stationaryMotion;
548 StagedActor_FillGridAttributeRectangle(0, 12, 16, 1, 4, 0);
549 StagedActor_FillGridAttributeRectangle(0, 13, 16, 1, 4, 0);
553}
554
555/// Pushing the object north: it slides a cell, opening the way.
556///
557/// Reached by walking into cell code 22 in the third room. Sets
558/// FLAG_SCENE_TEMP_05 when it stops on row 20, else FLAG_SCENE_TEMP_04, and
559/// then opens the cells above it.
560static void Event_PushObjectNorth(void) {
561 struct StagedActorProbe probe;
562
564 if (StagedActor_FindClearPosition(&probe) != 0) {
565 SceneActor_MoveAndRedraw(probe);
566 // Slide into the new cell before replacing the collision footprint.
568 Actor_SetSpeed(SLIDING_OBJECT, 0x4000, 0x8000);
573 {
574 struct FieldActor *slidingObject = Object_GetById(SLIDING_OBJECT);
575 s32 clearedRows = 2;
576 s32 emptyAttributes = 0;
577
580 0, 13, (probe.position.z >> 20) - 1, 4, clearedRows, emptyAttributes);
581 }
582 if ((probe.position.z >> 20) == 20) {
584 } else {
586 {
587
588 Map_CopyCellAttributes(14, 17, 2, 1, 14, 16);
589 Map_CopyCellAttributes(14, 13, 1, 1, 14, 15);
590 }
591 }
592 }
594}
595
596/// Selects the current room's touch, Psynergy and search bindings.
597const struct SceneEvent *ValeCave_GetEvents(void) {
598 s16 scene = gGameState.scene;
599
600 if (scene == (s32)&SceneId_ValeCave1) {
601 return gValeCave_Events1;
602 }
603 if (scene == (s32)&SceneId_ValeCave2) {
604 return gValeCave_Events2;
605 }
606 if (scene == (s32)&SceneId_ValeCave3) {
607 return gValeCave_Events3;
608 }
610}
611
612/// Chooses the entry transition and restores the room's puzzle state.
613///
614/// The scene's initialize entry. The first room fades in from the backdrop
615/// and clears FLAG_SHOW_LOCATION_NAME; the others open with the window
616/// transition.
618 s32 *request = &gEventWork->startTransition;
619
620 *request = SCENE_TRANSITION(TRANSITION_WINDOW, 4);
627 }
629 return 0;
630}
631
632/// The first room's exits play the exit sound before leaving.
633///
634/// Reached by stepping on cell codes 1 to 3 in the first room; takes the exit
635/// of the same number.
636static void Event_LeaveRoom(void) {
637 s32 exitId = gEventWork->touchedTrigger;
638
641}
642
643/// Rebuilds the passage cells around the sliding object's saved side.
645 Map_CopyCellAttributes(0, 34, 13, 3, 23, 34);
646
649 Map_CopyCellAttributes(24, 34, 1, 3, 23, 34);
650 } else {
652 Map_CopyCellAttributes(24, 34, 1, 3, 35, 34);
653 }
654}
655
657
658/// Walking east onto the sliding objects: they slide to the eastern end.
659///
660/// Reached by walking east into cell code 20 in the second room. Sets
661/// FLAG_VALE_CAVE_SLIDERS_EAST.
662static void Event_SlideObjectsEast(void) {
663
671}
672
673/// Walking west onto the sliding objects: they slide back to the western end.
674///
675/// Reached by walking west into cell code 21 in the second room. Clears
676/// FLAG_VALE_CAVE_SLIDERS_EAST.
677static void Event_SlideObjectsWest(void) {
678
686}
687
688/// Centers an actor on a map cell and gives it underfoot priority.
689static void ValeCave_CenterActorOnCell(s32 actorId, s32 column, s32 row) {
690 struct FieldActor *actor = Object_GetById(actorId);
691
692 if (actor != 0) {
694 actor->terrainId = 2;
696 actor->x.fixed = (column << 20) + 0x80000;
697 actor->z.fixed = (row << 20) + 0x80000;
698 }
699}
700
701/// Restores the Djinni route and completed movable-object puzzles on entry.
702///
703/// Called by ValeCave_Initialize. In Kite's part of the second room
704/// (entrances 5 to 7), while Kite is free and FLAG_VALE_CAVE_KITE_BEHIND_LEDGE
705/// is set, it sets FLAG_SCENE_TEMP_00 (and _01 from entrance 5) and puts Kite
706/// back behind the ledge.
707static void ValeCave_ApplyEntryState(void) {
708 s32 northernObjectMoved;
709
710 // Each room reuses the temporary flags for its own puzzle state.
712 switch (gGameState.entrance) {
713 case 1:
714 case 2:
715 case 3:
716 case 4:
720 break;
721 case 5:
722 case 6:
723 case 7:
725 break;
726 }
728 break;
729 }
731 if (gGameState.entrance == 5) {
733 }
736 break;
737 }
738 // Kite waits behind the ledge, watching the leader.
741 break;
742 case 8:
743 case 9:
744 case 10:
745 // The holes' part: the sliders' passage, and the holes already filled.
747 Map_CopyCellAttributes(23, 34, 13, 3, 0, 34);
750 Map_CopyCellAttributes(23, 41, 1, 1, 23, 39);
751 }
753 Map_CopyCellAttributes(31, 39, 2, 1, 27, 41);
754 }
755 break;
756 }
757 } else if (gGameState.scene == (s32)&SceneId_ValeCave3) {
758 switch (gGameState.entrance) {
759 case 1:
760 case 2:
761 case 3:
762 // Each object already pushed leaves open floor; else its footprint
763 // blocks its cells again.
765 StagedActor_FillGridAttributeRectangle(0, 12, 16, 1, 4, 0);
766 StagedActor_FillGridAttributeRectangle(0, 13, 16, 1, 4, 0);
767 } else {
768 FieldScene_RedrawActorFootprint(WESTERN_MOVABLE_OBJECT);
769 }
771 StagedActor_FillGridAttributeRectangle(2, 16, 16, 1, 4, 0);
772 StagedActor_FillGridAttributeRectangle(0, 16, 16, 1, 4, 0);
773 } else {
774 FieldScene_RedrawActorFootprint(EASTERN_MOVABLE_OBJECT);
775 }
776 northernObjectMoved = Engine_GameFlagIsSet(FLAG_SCENE_TEMP_05);
777 if (northernObjectMoved != 0) {
778 StagedActor_FillGridAttributeRectangle(0, 13, 19, 4, 2, 0);
779 } else if (Engine_GameFlagIsSet(FLAG_SCENE_TEMP_04) != 0) {
781 northernObjectMoved);
782 Map_CopyCellAttributes(14, 17, 2, 1, 14, 16);
783 Map_CopyCellAttributes(14, 13, 1, 1, 14, 15);
784 } else {
785 FieldScene_RedrawActorFootprint(SLIDING_OBJECT);
787 }
788 break;
789 }
790 }
791}
792
793/// Touching the sliding objects restarts their animation.
794///
795/// Reached by stepping on cell code 20 or 21 in the second room.
796static void Event_TouchSlidingObjects(void) {
799}
800
802 SC_WAIT(1), SC_LOOP(22, SC_TOP), SC_WAIT(1),
803 SC_POS(0, 0, 0), SC_WAIT(1), SC_FREE,
804};
805
807 SC_WAIT(1), SC_LOOP(44, SC_TOP), SC_WAIT(1),
808 SC_POS(0, 0, 0), SC_WAIT(1), SC_FREE,
809};
810
812 SC_WAIT(1), SC_LOOP(126, SC_TOP), SC_WAIT(1),
813 SC_POS(0, 0, 0), SC_WAIT(1), SC_FREE,
814};
815
816// Pixel step by direction: X in the upper halfword, Z in the lower.
817// UB: negative pixel steps cannot be shifted as signed values.
818#ifdef UBFIX
819#define DIRECTION_STEP(dx, dz) (((u32)(dx) << 16) | ((u32)(dz) & 0xffff))
820#else
821#define DIRECTION_STEP(dx, dz) (((dx) << 16) | ((dz) & 0xffff))
822#endif
823
825 DIRECTION_STEP(16, 0), DIRECTION_STEP(16, 0), DIRECTION_STEP(16, 0),
826 DIRECTION_STEP(0, 16), DIRECTION_STEP(0, 16), DIRECTION_STEP(0, 16),
827 DIRECTION_STEP(0, 16), DIRECTION_STEP(-16, 0), DIRECTION_STEP(-16, 0),
828 DIRECTION_STEP(-16, 0), DIRECTION_STEP(-16, 0), DIRECTION_STEP(0, -16),
829 DIRECTION_STEP(0, -16), DIRECTION_STEP(0, -16), DIRECTION_STEP(0, -16),
830 DIRECTION_STEP(16, 0),
831};
832
833// clang-format off
835 207, 205, 228, 229, 298, 297,
836};
837
839 -32, -8, 32, 8,
840 -8, -32, 8, 32,
841 -32, -16, 32, 0,
842 -8, -32, 8, 32,
843 -32, -8, 32, 8,
844 -8, -32, 8, 32,
845};
846
848 760, 296,
849 760, 280,
850 776, 280,
851 792, 280,
852 808, 280,
853 824, 280,
854 824, 296,
855 824, 312,
856 808, 312,
857 792, 312,
858 776, 312,
859 760, 312,
860};
861
862const s32 *gEffectScripts[] = {
866};
867
869 { 0, CONDITION_ALWAYS, 120, 0, 152, FACING_SOUTH, 0, -1, -1, -1, -1, 0 },
870 { SCENE_TABLE_END },
871};
872
874 { 0, CONDITION_ALWAYS, 120, 0, 152, FACING_SOUTH, 0, 16, 0, 336, 368, 0 },
875 { 1, CONDITION_ALWAYS, 104, 0, 344, FACING_NORTH, 0, 16, 0, 336, 368, 0 },
876 { 2, CONDITION_ALWAYS, 136, 0, 184, FACING_SOUTH, 0, 16, 0, 336, 368, 0 },
877 { 3, CONDITION_ALWAYS, 136, 0, 376, FACING_NORTH, 0, 16, 0, 336, 368, 0 },
878 { SCENE_TABLE_END },
879};
880
882 { 0, CONDITION_ALWAYS, 120, 0, 152, FACING_SOUTH, 0, -1, -1, -1, -1, 0 },
883 { 1, CONDITION_ALWAYS, 328, 0, 392, FACING_NORTH, 0, 48, 32, 544, 416, 0 },
884 { 2, CONDITION_ALWAYS, 312, 0, 160, FACING_SOUTH, 0, 48, 32, 544, 416, 0 },
885 { 3, CONDITION_ALWAYS, 120, 0, 120, FACING_SOUTH, 0, 48, 32, 544, 416, 0 },
886 { 4, CONDITION_ALWAYS, 504, 0, 136, FACING_SOUTH, 0, 48, 32, 544, 416, 0 },
887 { 5, CONDITION_ALWAYS, 792, 0, 360, FACING_NORTH, 0, 624, 16, 944, 384, 0 },
888 { 6, CONDITION_ALWAYS, 680, 0, 248, FACING_SOUTH, 0, 624, 16, 944, 384, 0 },
889 { 7, CONDITION_ALWAYS, 904, 0, 232, FACING_SOUTH, 0, 624, 16, 944, 384, 0 },
890 { 8, CONDITION_ALWAYS, 408, 0, 872, FACING_NORTH, 0, 312, 472, 704, 896, 0 },
891 { 9, CONDITION_ALWAYS, 488, 0, 744, FACING_NORTH, 0, 312, 472, 704, 896, 0 },
892 { 10, CONDITION_ALWAYS, 632, 0, 552, FACING_SOUTH, 0, 312, 472, 704, 896, 0 },
893 { SCENE_TABLE_END },
894};
895
897 { 0, CONDITION_ALWAYS, 200, 0, 432, FACING_SOUTH, 0, -1, -1, -1, -1, 0 },
898 { 1, CONDITION_ALWAYS, 200, 0, 432, FACING_NORTH, 0, 64, 24, 416, 464, 0 },
899 { 2, CONDITION_ALWAYS, 344, 0, 120, FACING_SOUTH, 0, 64, 24, 416, 464, 0 },
900 { 3, CONDITION_ALWAYS, 120, 0, 264, FACING_NORTH, 0, 64, 24, 416, 464, 0 },
901 { 4, CONDITION_ALWAYS, 536, 0, 776, FACING_NORTH, 0, 400, 440, 896, 800, 0 },
902 { 5, CONDITION_ALWAYS, 840, 0, 776, FACING_NORTH, 0, 400, 440, 896, 800, 0 },
903 { SCENE_TABLE_END },
904};
905
907 SCENE_EXITS(93),
908 SCENE_EXIT(1, 6, 4),
909 SCENE_EXIT(2, 94, 1),
910 SCENE_EXIT(3, 6, 6),
911 SCENE_EXIT(0, 94, 0),
912 SCENE_EXIT(1, 93, 2),
913 SCENE_EXIT(2, 94, 5),
914 SCENE_EXIT(3, 94, 8),
915 SCENE_EXIT(4, 95, 1),
916 SCENE_EXIT(5, 94, 2),
917 SCENE_EXIT(6, 94, 9),
918 SCENE_EXIT(7, 95, 3),
919 SCENE_EXIT(8, 94, 3),
920 SCENE_EXIT(9, 94, 6),
921 SCENE_EXIT(10, 95, 4),
922 SCENE_EXIT(0, 95, 0),
923 SCENE_EXIT(1, 94, 4),
924 SCENE_EXIT(2, 95, 5),
925 SCENE_EXIT(3, 94, 7),
926 SCENE_EXIT(4, 94, 10),
927 SCENE_EXIT(5, 95, 2),
929};
930
932 { 0xf1, CONDITION_ALWAYS, 7,
933 PIXELS(232), 0, PIXELS(168), FACING_SOUTH, TALK_KEEP_FACING, 0 },
934 { 0xf1, CONDITION_ALWAYS, 7,
935 PIXELS(232), 0, PIXELS(184), FACING_SOUTH, TALK_KEEP_FACING, 0 },
936 { 0xf1, CONDITION_ALWAYS, 7,
937 PIXELS(248), 0, PIXELS(184), FACING_SOUTH, TALK_KEEP_FACING, 0 },
938 { 0xcf, CONDITION_ALWAYS, 7,
939 PIXELS(192), 0, PIXELS(184), FACING_SOUTH, TALK_KEEP_FACING, 0 },
940 { 0xcf, CONDITION_ALWAYS, 7,
941 PIXELS(208), 0, PIXELS(200), FACING_SOUTH, TALK_KEEP_FACING, 0 },
942 { SCENE_TABLE_END },
943};
944
946 { 0x5d, FLAG_KITE, ACTOR_STAND,
947 PIXELS(792), 0, PIXELS(232), FACING_SOUTH, TALK_FACE_PARTY, 0 },
948 { 0xf1, CONDITION_ALWAYS, 7,
949 PIXELS(344), 0, PIXELS(632), FACING_SOUTH, TALK_KEEP_FACING, 0 },
950 { 0xf1, CONDITION_ALWAYS, 7,
951 PIXELS(456), 0, PIXELS(664), FACING_SOUTH, TALK_KEEP_FACING, 0 },
952 { 0xed, CONDITION_ALWAYS, 7,
953 PIXELS(376), 0, PIXELS(576), FACING_SOUTH, TALK_KEEP_FACING, 0 },
954 { 0xf1, CONDITION_ALWAYS, 7,
955 PIXELS(422), 0, PIXELS(206), FACING_SOUTH, TALK_KEEP_FACING, 0 },
956 { 0xf1, CONDITION_ALWAYS, 7,
958 { 0xcf, CONDITION_ALWAYS, 7,
959 PIXELS(384), 0, PIXELS(200), FACING_SOUTH, TALK_KEEP_FACING, 0 },
960 { 0xcf, CONDITION_ALWAYS, 7,
962 { SCENE_TABLE_END },
963};
964
966 { 0x5d, FLAG_KITE, ACTOR_STAND,
967 PIXELS(792), 0, PIXELS(232), FACING_SOUTH, TALK_FACE_PARTY, 0 },
968 { 0xcd, CONDITION_ALWAYS, 7,
969 PIXELS(200), 0, PIXELS(288), FACING_SOUTH, TALK_KEEP_FACING, 0 },
970 { 0xcd, CONDITION_ALWAYS, 7,
971 PIXELS(312), 0, PIXELS(288), FACING_SOUTH, TALK_KEEP_FACING, 0 },
972 { 0xcf, CONDITION_ALWAYS, 7,
973 PIXELS(240), 0, PIXELS(360), FACING_SOUTH, TALK_KEEP_FACING, 0 },
974 { SCENE_TABLE_END },
975};
976
979};
980
986};
987
989 { EVENT_EXIT, 1, CONDITION_ALWAYS, 1 },
990 { EVENT_EXIT, 2, CONDITION_ALWAYS, 2 },
991 { EVENT_EXIT, 3, CONDITION_ALWAYS, 3 },
992 { EVENT_EXIT, 4, CONDITION_ALWAYS, 4 },
993 { EVENT_EXIT, 5, CONDITION_ALWAYS, 5 },
994 { EVENT_EXIT, 6, CONDITION_ALWAYS, 6 },
995 { EVENT_EXIT, 7, CONDITION_ALWAYS, 7 },
996 { EVENT_EXIT, 8, CONDITION_ALWAYS, 8 },
997 { EVENT_EXIT, 9, CONDITION_ALWAYS, 9 },
998 { EVENT_EXIT, 10, CONDITION_ALWAYS, 10 },
1027 { SCENE_EVENTS_END },
1028};
1029// clang-format on
1030
1044};
Ability numbers, named from the English release.
@ ABILITY_HALT
Definition ability_ids.h:20
@ ABILITY_REVEAL
Definition ability_ids.h:19
@ ABILITY_MOVE
Definition ability_ids.h:15
struct FieldActor * Object_GetById(s32 actor)
Returns an actor, or NULL if it does not exist.
s32 gStagedActor_DirectionSteps[]
Pixel step by direction: X in the upper halfword, Z in the lower.
s32 gStagedActor_FootprintBounds[]
#define DIRECTION_STEP(dx, dz)
Pixel step by direction: X in the upper halfword, Z in the lower.
u32 gStagedActor_FootprintKinds[]
s32 gEffectScript0[]
const s32 * gEffectScripts[]
s32 gEffectScript1[]
s32 gEffectScript2[]
The engine calls a scene uses to create an overlay object and set its sprite flags.
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
The edition's language, for C to compare (LANGUAGE == LANGUAGE_GERMAN).
static UNUSED void * OverlayObject_CreateConfiguredObject(s32 x, s32 y, s32 z, s32 type)
A still effect in palette 15, at sprite priority 1, drawn under the actors.
The engine call layer: one typed inline for each of the thirteen main-image routines below that the s...
static s32 FieldObject_CheckMovementCollision(struct FieldActor *actor, struct FieldPosition *position)
Definition engine_call.h:66
Field effects, their scripts and the flags that spawn them.
@ EFFECT_USE_PALETTE
options.palette, as its group child value
@ EFFECT_USE_START_SCALE
options.startScaleX and startScaleY
The scene script layer: the engine services a scene's events call, declared once (Engine_EventBegin,...
static void Actor_FaceDirection(s32 actor, s32 facing, s32 frames)
void Object_SetMode(struct FieldActor *object, s32 animation)
void Engine_ActorSetSpritePriority(s32 actor, s32 priority)
#define GameFlag_IsSet
static void Actor_WalkToAndWait(s32 actor, s32 x, s32 z)
static void Camera_SetSpeed(s32 speed, s32 acceleration)
void Engine_ActorMoveToAndWait(s32 actor, s32 x, s32 z)
static void Actor_MoveToAndWait(s32 actor, s32 x, s32 z)
void Engine_ActorFaceDirection(s32 actor, s32 facing, s32 frames)
void Engine_ObjectDispatchRelease(struct FieldActor *object)
#define GameFlag_Set
void Engine_GameFlagSet(s32 flag)
void Engine_GameFlagClear(s32 flag)
void Engine_CameraWaitForMove(void)
void Engine_ActorWaitForMove(s32 actor)
void Engine_CameraFollowActor(s32 actor, s32 keep_position)
static void Map_CopyCellAttributes(s32 srcX, s32 srcY, s32 width, s32 height, s32 destX, s32 destY)
void Engine_ActorRunRepeatedMotion(s32 actor, s32 repeats)
void Engine_ActorWalkTo(s32 actor, s32 x, s32 z)
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)
s32 Engine_GameFlagIsSet(s32 flag)
static void Actor_SetSpeed(s32 actor, s32 speed, s32 acceleration)
static void Actor_SetPosition(s32 actor, s32 fixed_x, s32 fixed_z)
void Engine_ActorSetDestinationOffset(s32 actor, s32 dx, s32 dz)
void Engine_EventWait(s32 frames)
static void Actor_SetAttachedEffect(s32 actor, s32 effect)
static struct FieldActor * Actor_Get(s32 actor)
Field objects and actors, and the scene transition styles.
@ TRANSITION_WINDOW
Definition field_obj.h:17
@ 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_FOLLOWS_TERRAIN
moves with the ground height under it
Definition field_obj.h:160
@ ACTOR_FALLS
falls by its gravity and bounces
Definition field_obj.h:161
#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_EXIT
#define SCENE_EXITS(scene)
Definition field_scene.h:72
#define PSYNERGY_IN_AREA(ability, phase)
#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
#define PSYNERGY_ON_ACTOR(ability)
#define EVENT_SCRIPT(script)
#define EVENT_TOUCH_WALKING
@ ACTOR_STAND
#define SEARCH(target)
#define SCENE_EXITS_END
Definition field_scene.h:77
#define TOUCH_WALKING_INTO(facing)
#define PLACEMENT_SHARE_PREVIOUS_SPRITE
@ FACING_NORTHEAST
Definition field_scene.h:33
@ FACING_EAST
Definition field_scene.h:26
@ 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_CHEST
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_SCENE_TEMP_05
Definition flags.h:718
#define FLAG_SHOW_LOCATION_NAME
Definition flags.h:94
#define FLAG_SCENE_TEMP_03
Definition flags.h:716
#define FLAG_SCENE_TEMP_00
Definition flags.h:713
#define FLAG_SCENE_TEMP_02
Definition flags.h:715
#define FLAG_VALE_CAVE_HALT_GEM
the second room's chest
Definition flags.h:538
#define FLAG_KEEP_PARTY_POSITION
Definition flags.h:93
#define FLAG_SCENE_TEMP_01
Definition flags.h:714
#define FLAG_SCENE_TEMP_04
Definition flags.h:717
#define FLAG_VALE_CAVE_NUT
the second room's other chest
Definition flags.h:539
GameState, the game's state: play time, coins, the scene and the leader's position,...
struct GameState gGameState
The work slots of gWorkSlot, read through their own names.
The screen blend's globals and the graphics routines.
The main-image routines scene overlays import.
Item numbers, named from the English release.
@ ITEM_HALT_GEM
Definition item_ids.h:59
@ ITEM_NUT
Definition item_ids.h:41
Declares nothing of its own: it only includes edition.h and types.h.
s32 ArcTan2(s32 x, s32 y)
Returns the angle of the vector (x, y), in 1/65536 turns, measured from the y axis: 0 along +y,...
Definition math.c:36
The reel game's title lettering.
Field object scripts: one s32 command word, then its operands, as gScriptObject_CommandTable runs the...
#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_FREE
Release.
Definition objcmd.h:43
#define SC_WAIT(n)
Wait n frames.
Definition objcmd.h:16
#define SC_TOP
Script start.
Definition objcmd.h:13
static void SceneActor_PlacePairAtOffset(s32 id, s32 dx, s32 dz)
Moves the character the player controls (in mode 27) and actor id together by (dx,...
static s32 StagedActor_FillGridAttributeRectangle(u32 layer, s32 x, s32 z, u32 width, u32 height, s32 value)
Sets the collision code of a width by height rectangle of cells, from cell (x, z),...
Scene numbers, named after their places.
char SceneId_ValeCave2
char SceneId_ValeCave1
char SceneId_ValeCave3
Declares nothing of its own: it only includes types.h.
Song and sound effect ids, indices into gSound_SongTable.
#define SE_216
Definition songs.h:211
#define SE_213
Definition songs.h:208
#define SE_240
Definition songs.h:235
#define SE_239
Definition songs.h:234
#define SE_MAP_EXIT
Definition songs.h:116
#define SE_288
Definition songs.h:281
#define SE_241
Definition songs.h:236
#define SE_JUMP
An actor jumps: ObjectMotion_Launch plays the high jump above 5 pixels a frame.
Definition songs.h:147
#define SE_289
Definition songs.h:282
void Engine_ActorSetAnimation()
struct EventWork * gEventWork
void Engine_EventRequestExit()
void Engine_EventEnd(void)
void Engine_AudioPlayCue()
void Engine_EventBegin(void)
void Engine_TaskWait()
#define NULL
Definition bilibin.h:6
The pushable actors' movement probes and footprint bounds.
The options of a spawned field effect, each used when its EFFECT_USE_ flag (or EFFECT_SCALE_TO_TARGET...
s32 palette
passed to ObjectGroup_SetChildValue
s32 startScaleY
16.16 fixed point, 0x10000 full size
s32 startScaleX
16.16 fixed point, 0x10000 full size
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
A field actor: a person or thing on the field with a position, motion toward a target,...
Definition field_obj.h:30
s32 speed
speed limit, 16.16 fixed-point pixels per frame
Definition field_obj.h:55
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 bounce
The share of its falling speed kept as it bounces on landing, 16.16 fixed point (0x4000 when created)...
Definition field_obj.h:64
union FieldCoordinate y
16.16 fixed-point pixels
Definition field_obj.h:36
u8 priorityFlags
ActorPriorityFlag bits, read by the scrolling camera.
Definition field_obj.h:51
s32 terrainHeight
16.16 fixed-point pixels
Definition field_obj.h:38
s32 velocityY
16.16 fixed-point pixels per frame
Definition field_obj.h:53
union FieldCoordinate z
16.16 fixed-point pixels
Definition field_obj.h:37
u16 facing
1/65536 turns
Definition field_obj.h:34
s32 acceleration
Added toward the target each frame, or taken off the speed when there is none, in 16....
Definition field_obj.h:58
void(*) update(union FieldObject *object)
Called each frame before the object's script, while the object is live.
Definition field_obj.h:116
u8 terrainId
The map layer (0 to 3) its ground height is read from, which the scrolling camera updates from the ce...
Definition field_obj.h:47
A position on the field.
s32 z
16.16 fixed-point pixels
s16 pausedObject
Halt: the stopped object; -1 for none.
Definition game_state.h:113
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...
Where a large thing ahead of the leader would roll to: its footprint, its actor, that position,...
struct FieldPosition position
16.16 pixels while moving; converted to cells by footprint redraws.
s32 actorSlot
the large thing's actor number, 8 to 65
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 char u8
Definition types.h:11
A field coordinate, read whole or as its fraction and its whole pixels.
struct FieldCoordinate::@024321007066302143002254325121164243234242211074 part
s32 fixed
16.16 fixed-point pixels
An object on the field, read as an actor or as an effect.
struct SceneEvent gValeCave_Events3[]
Definition vale_cave.c:1031
static void ValeCave_CenterActorOnCell(s32 actorId, s32 column, s32 row)
Centers an actor on a map cell and gives it underfoot priority.
Definition vale_cave.c:689
s32 ValeCave_Initialize(void)
Chooses the entry transition and restores the room's puzzle state.
Definition vale_cave.c:617
u32 gValeCave_Exits[]
Definition vale_cave.c:906
#define FLAG_VALE_CAVE_SLIDERS_EAST
The sliding objects of the second room are at their eastern end.
Definition vale_cave.c:70
#define ACTOR_KITE
Definition vale_cave.c:47
static void Event_LeaveRoom(void)
The first room's exits play the exit sound before leaving.
Definition vale_cave.c:636
#define FIRST_DJINNI_ROUTE_TRIGGER
Definition vale_cave.c:54
static void Event_RevealHiddenTile(void)
Reveal shows a hidden tile in the second room.
Definition vale_cave.c:179
struct SceneEvent gValeCave_Events1[]
Definition vale_cave.c:981
#define FLAG_VALE_CAVE_KITE_BEHIND_LEDGE
Kite has run behind the ledge and keeps to its far side.
Definition vale_cave.c:72
static void Event_MoveWestObjectIntoHole(void)
Move on the western object: once over its hole, Isaac steps aside and the object sinks into the floor...
Definition vale_cave.c:206
static void Event_PushObjectNorth(void)
Pushing the object north: it slides a cell, opening the way.
Definition vale_cave.c:560
const struct SceneEvent * ValeCave_GetEvents(void)
Selects the current room's touch, Psynergy and search bindings.
Definition vale_cave.c:597
#define SLIDING_OBJECT
Definition vale_cave.c:50
struct SceneEvent gValeCave_EventsOther[]
Definition vale_cave.c:977
static void ValeCave_UpdateSlidingObjectPassage(void)
Rebuilds the passage cells around the sliding object's saved side.
Definition vale_cave.c:644
static void Event_SlideObjectsEast(void)
Walking east onto the sliding objects: they slide to the eastern end.
Definition vale_cave.c:662
#define OBJECT_SINK_FRAMES
Definition vale_cave.c:51
static void Event_PushObjectOffLedge(void)
Pushing the western object east: it falls off the ledge, opening the way.
Definition vale_cave.c:514
static void Event_KiteKeepsAway(void)
Walking around the ledge: Kite keeps to the far side of it, unless Halt has stopped it.
Definition vale_cave.c:416
static void Event_PushObjectOverEdge(void)
Pushing an object along the ledge: at its edge the object falls off, opening the way.
Definition vale_cave.c:462
static void Event_KiteRunsOff(void)
Coming near Kite: the camera finds it; it notices the party and hops away up the ledge.
Definition vale_cave.c:351
struct ScenePlacement gValeCave_Placements2[]
Definition vale_cave.c:945
static void Event_KiteRunsBehindLedge(void)
Coming near again: Kite runs behind the ledge and turns to watch the party.
Definition vale_cave.c:385
#define ACTOR_LANDING_TIMEOUT
Definition vale_cave.c:53
struct SceneEntrance gValeCave_Entrances1[]
Definition vale_cave.c:873
#define WESTERN_MOVABLE_OBJECT
Definition vale_cave.c:48
#define OBJECT_SINK_STEP
Definition vale_cave.c:52
static void ValeCave_ApplyEntryState(void)
Restores the Djinni route and completed movable-object puzzles on entry.
Definition vale_cave.c:707
static void ValeCave_WaitForActorLanding(struct FieldActor *actor)
Waits for an actor to land, bounded by a one-second timeout.
Definition vale_cave.c:88
const struct ScenePlacement * ValeCave_GetPlacements(void)
Selects the current room's actors and movable objects.
Definition vale_cave.c:153
static s32 Event_HopDownLedge(s32 unusedArgument)
Walking south off the ledge: Isaac hops down if the cell below is free.
Definition vale_cave.c:303
#define FLAG_KITE
The flag of Kite, set once it is caught.
Definition vale_cave.c:57
static void Event_TouchSlidingObjects(void)
Touching the sliding objects restarts their animation.
Definition vale_cave.c:796
static s32 ValeCave_FaceActorTowardLeader(union FieldObject *fieldObject)
Turns Kite to face the party leader each frame.
Definition vale_cave.c:109
static void Event_PushEastObjectIntoHole(void)
Pushing the eastern object: it moves a cell, and sinks if over its hole.
Definition vale_cave.c:292
struct SceneEntrance gValeCave_Entrances2[]
Definition vale_cave.c:881
struct SceneEvent gValeCave_Events2[]
Definition vale_cave.c:988
struct ScenePlacement gValeCave_Placements3[]
Definition vale_cave.c:965
s32 gValeCave_WalkTargets[]
Definition vale_cave.c:847
#define VALE_CAVE_FACE_LEADER_CALLBACK
Definition vale_cave.c:127
#define EASTERN_MOVABLE_OBJECT
Definition vale_cave.c:49
struct SceneEntrance gValeCave_EntrancesOther[]
Definition vale_cave.c:868
static void Event_MoveEastObjectIntoHole(void)
Move on the eastern object: once over its hole, it sinks into the floor.
Definition vale_cave.c:252
const struct SceneRegion * ValeCave_GetRegions(void)
Definition vale_cave.c:147
static void Event_TalkToKite(void)
Talking to Kite after Halt: it joins the party.
Definition vale_cave.c:85
const u32 * ValeCave_GetExits(void)
Returns the shared packed exits for all cave rooms.
Definition vale_cave.c:150
static void Event_HaltKite(void)
Halt on Kite: it stops where it stands.
Definition vale_cave.c:451
const struct SceneEntrance * ValeCave_GetEntrances(void)
Selects entrance positions and camera bounds for the current cave room.
Definition vale_cave.c:132
struct ScenePlacement gValeCave_Placements1[]
Definition vale_cave.c:931
static void ValeCave_SinkObjectWithParticles(s32 actorId, s32 baseX, s32 baseZ, struct EffectOptions *particleOptions)
Lowers one object while emitting a particle each frame around its opening.
Definition vale_cave.c:185
struct SceneEntrance gValeCave_Entrances3[]
Definition vale_cave.c:896
static void Event_SlideObjectsWest(void)
Walking west onto the sliding objects: they slide back to the western end.
Definition vale_cave.c:677
static void Event_HideRevealedTile(void)
Reveal ends: the hidden tile is hidden again.
Definition vale_cave.c:171
The patch levels: our groups of the measured changes from the Japanese release.