Alchemy
Loading...
Searching...
No Matches

kolima_forest_bridge.c File Reference

Kolima Forest's bridge, where the road from the world map enters the forest. More...

Go to the source code of this file.

Macros

#define DIRECTION_STEP(dx, dz)
 Pixel step by direction: X in the upper halfword, Z in the lower.

Enumerations

enum  { ENTRANCE_FROM_WORLD_MAP = 4 }
enum  {
  RIVER_LOG = 10 , TRET = 11 , LAUREL = 12 , LEADER_BARRIER = 13 ,
  IVAN_BARRIER = 14 , MIA_BARRIER = 15 , GARET_BARRIER = 16 , FIRST_GROUND_SPARKLE = 17 ,
  LAST_GROUND_SPARKLE = 21
}

Functions

static void KolimaForestBridge_WitnessForestCurse (void)
 The party, on the bridge, sees the curse fall.
static void KolimaForestBridge_ShowMessageAndWait (s32 speaker, s32 frames)
static void KolimaForestBridge_FaceActorAndWait (s32 actorId, s32 facing, s32 waitFrames)
 Turns an actor at once, then leaves time for the next beat.
static void KolimaForestBridge_SpawnCurseSparkle (void)
 Every eighth frame a sparkle of Tret's glamour (object 26) falls toward the party, with its tinkle while the rain is at its height.
static void KolimaForestBridge_FlickerBarriers (void)
 Each frame the domes flicker: two show on even frames and two on odd, the hidden ones lifted 500 pixels out of sight.
static s32 KolimaForestBridge_FlashHitBarriers (struct ScriptInterpreter *interpreter)
 The end of a dome's growing: if a sparkle has burst on a dome, the dome takes its next pose.
static s32 KolimaForestBridge_TwinkleGroundSparkle (struct ScriptInterpreter *interpreter)
 Each frame: a ground sparkle's timer runs on at random, and the sparkle shows its bright frame (7) while the timer is past 1000, its dim one (10) before; at 1200 the timer starts over.
const struct SceneEntrance * KolimaForestBridge_GetEntrances (void)
 Where the party enters from the clearing and the world map.
const struct SceneRegion * KolimaForestBridge_GetRegions (void)
const u32 * KolimaForestBridge_GetExits (void)
 The paths to the clearing and the world map.
const struct ScenePlacement * KolimaForestBridge_GetPlacements (void)
 The party's companions, the logs, Tret, Laurel, the domes and the ground sparkles.
static void KolimaForestBridge_PushLog (void)
 Walking into a log: it rolls ahead until something stops it.
const struct SceneEvent * KolimaForestBridge_GetEvents (void)
 The logs, the jump east from the bank and the two paths.
s32 KolimaForestBridge_Initialize (void)
 On entry a log already in the river floats there again and the logs mark the cells they cover.
static s32 KolimaForestBridge_BurstOnBarrier (struct ScriptInterpreter *interpreter)
 The end of a sparkle's fall: one that lands on a dome (the domes' area, which differs with Mia) bursts with a sound, and the domes are told.

Variables

s32 gKolimaForestBridge_BarrierHit
s32 gKolimaForestBridge_MiaInParty
s32 gKolimaForestBridge_SparkleSoundOn
s32 gStagedActor_DirectionSteps []
 Pixel step by direction: X in the upper halfword, Z in the lower.
u32 gStagedActor_FootprintKinds []
s32 gStagedActor_FootprintBounds []
s32 gKolimaForestBridge_GaretAction []
 Garet, Ivan and Mia walk to their places beside the leader.
s32 gKolimaForestBridge_IvanAction []
s32 gKolimaForestBridge_MiaAction []
s32 gKolimaForestBridge_SquashAction []
 The glamour presses the party down: each squashes and wobbles until released.
s32 gKolimaForestBridge_RestoreScaleAction []
s32 gKolimaForestBridge_BarrierGrowAction []
 A dome grows from a tenth of its size over 70 frames.
s32 gKolimaForestBridge_BarrierShrinkAction []
 A dome sinks and shrinks away over 90 frames.
s32 gKolimaForestBridge_GroundSparkleAction []
struct SceneEntrance gKolimaForestBridge_Entrances []
u32 gKolimaForestBridge_Exits []
 Exit 1 to the clearing (scene 41) and exit 4 to the world map (scene 2).
struct ScenePlacement gKolimaForestBridge_Placements []
 Garet, Ivan and Mia for the curse; the three logs; Tret and Laurel; the four domes; and the five ground sparkles.
struct SceneEvent gKolimaForestBridge_Events []
s32 gKolimaForestBridge_SparkleScript []
s32 gKolimaForestBridge_SparkleBurstScript []
 A sparkle bursts on a dome: it doubles in size and is gone.
s32 gFallingEffectScript []

Detailed Description

Kolima Forest's bridge, where the road from the world map enters the forest.

Of its three logs, the one pushed west to the bank tips into the river and bridges it. Arriving from the world map before the party has seen the curse in Kolima, they see it fall here: sparkles of Tret's glamour rain down, domes of their own Psynergy shield them, and Tret and Laurel, unseen, speak of the dying forest.

FLAG_SCENE_TEMP_00: the log is in the river.

Definition in file kolima_forest_bridge.c.

Macro Definition Documentation

◆ DIRECTION_STEP

#define DIRECTION_STEP ( dx,
dz )
Value:
(((dx) << 16) | ((dz) & 0xffff))

Pixel step by direction: X in the upper halfword, Z in the lower.

Definition at line 1149 of file kolima_forest_bridge.c.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
ENTRANCE_FROM_WORLD_MAP 

Definition at line 44 of file kolima_forest_bridge.c.

◆ anonymous enum

anonymous enum
Enumerator
RIVER_LOG 

actors 8 to 10 are the logs

TRET 

roars. "Hroom!"

LAUREL 
LEADER_BARRIER 

The domes of Psynergy, one over each member; Mia's only with Mia.

IVAN_BARRIER 
MIA_BARRIER 
GARET_BARRIER 
FIRST_GROUND_SPARKLE 

The sparkles of Tret's glamour on the ground, gone once the curse is lifted.

LAST_GROUND_SPARKLE 

Definition at line 46 of file kolima_forest_bridge.c.

Function Documentation

◆ KolimaForestBridge_WitnessForestCurse()

void KolimaForestBridge_WitnessForestCurse ( void )
static

The party, on the bridge, sees the curse fall.

Ivan notices sparkly stuff on the ground; sparkles rain from the sky, the party sinks under them, and domes of Psynergy rise around each member before the sparkles reach them. They argue over whose Psynergy it was, the sparkles fall again and the domes rise again, and Tret and Laurel speak: Tret turned Kolima's people into trees for cutting him, and only his gentle side, deep in the forest, can save them. Lines and choices for Mia are skipped when she is not in the party.

Definition at line 197 of file kolima_forest_bridge.c.

Referenced by KolimaForestBridge_Initialize(), and KolimaForestBridge_WitnessForestCurse().

◆ KolimaForestBridge_ShowMessageAndWait()

void KolimaForestBridge_ShowMessageAndWait ( s32 speaker,
s32 frames )
static

◆ KolimaForestBridge_FaceActorAndWait()

void KolimaForestBridge_FaceActorAndWait ( s32 actorId,
s32 facing,
s32 waitFrames )
static

Turns an actor at once, then leaves time for the next beat.

Definition at line 1019 of file kolima_forest_bridge.c.

Referenced by KolimaForestBridge_FaceActorAndWait(), and KolimaForestBridge_WitnessForestCurse().

◆ KolimaForestBridge_SpawnCurseSparkle()

void KolimaForestBridge_SpawnCurseSparkle ( void )
static

Every eighth frame a sparkle of Tret's glamour (object 26) falls toward the party, with its tinkle while the rain is at its height.

Definition at line 1029 of file kolima_forest_bridge.c.

Referenced by KolimaForestBridge_SpawnCurseSparkle(), and KolimaForestBridge_WitnessForestCurse().

◆ KolimaForestBridge_FlickerBarriers()

void KolimaForestBridge_FlickerBarriers ( void )
static

Each frame the domes flicker: two show on even frames and two on odd, the hidden ones lifted 500 pixels out of sight.

Definition at line 1107 of file kolima_forest_bridge.c.

Referenced by KolimaForestBridge_FlickerBarriers(), and KolimaForestBridge_WitnessForestCurse().

◆ KolimaForestBridge_FlashHitBarriers()

s32 KolimaForestBridge_FlashHitBarriers ( struct ScriptInterpreter * interpreter)
static

The end of a dome's growing: if a sparkle has burst on a dome, the dome takes its next pose.

Definition at line 77 of file kolima_forest_bridge.c.

Referenced by KolimaForestBridge_FlashHitBarriers().

◆ KolimaForestBridge_TwinkleGroundSparkle()

s32 KolimaForestBridge_TwinkleGroundSparkle ( struct ScriptInterpreter * interpreter)
static

Each frame: a ground sparkle's timer runs on at random, and the sparkle shows its bright frame (7) while the timer is past 1000, its dim one (10) before; at 1200 the timer starts over.

Definition at line 91 of file kolima_forest_bridge.c.

Referenced by KolimaForestBridge_TwinkleGroundSparkle().

◆ KolimaForestBridge_GetEntrances()

const struct SceneEntrance * KolimaForestBridge_GetEntrances ( void )

Where the party enters from the clearing and the world map.

Definition at line 107 of file kolima_forest_bridge.c.

Referenced by KolimaForestBridge_GetEntrances().

◆ KolimaForestBridge_GetRegions()

const struct SceneRegion * KolimaForestBridge_GetRegions ( void )

Definition at line 111 of file kolima_forest_bridge.c.

Referenced by KolimaForestBridge_GetRegions().

◆ KolimaForestBridge_GetExits()

const u32 * KolimaForestBridge_GetExits ( void )

The paths to the clearing and the world map.

Definition at line 114 of file kolima_forest_bridge.c.

Referenced by KolimaForestBridge_GetExits().

◆ KolimaForestBridge_GetPlacements()

const struct ScenePlacement * KolimaForestBridge_GetPlacements ( void )

The party's companions, the logs, Tret, Laurel, the domes and the ground sparkles.

Definition at line 120 of file kolima_forest_bridge.c.

Referenced by KolimaForestBridge_GetPlacements().

◆ KolimaForestBridge_PushLog()

void KolimaForestBridge_PushLog ( void )
static

Walking into a log: it rolls ahead until something stops it.

The river log, stopped at the bank (cell column 20), tips over with a splash and floats in the water; its cells become ground the party can cross.

Definition at line 127 of file kolima_forest_bridge.c.

Referenced by KolimaForestBridge_PushLog().

◆ KolimaForestBridge_GetEvents()

const struct SceneEvent * KolimaForestBridge_GetEvents ( void )

The logs, the jump east from the bank and the two paths.

Definition at line 156 of file kolima_forest_bridge.c.

Referenced by KolimaForestBridge_GetEvents().

◆ KolimaForestBridge_Initialize()

s32 KolimaForestBridge_Initialize ( void )

On entry a log already in the river floats there again and the logs mark the cells they cover.

From the world map, before the curse has been seen, the party sees it fall; once the curse is lifted the ground sparkles are gone.

Definition at line 164 of file kolima_forest_bridge.c.

Referenced by KolimaForestBridge_Initialize().

◆ KolimaForestBridge_BurstOnBarrier()

s32 KolimaForestBridge_BurstOnBarrier ( struct ScriptInterpreter * interpreter)
static

The end of a sparkle's fall: one that lands on a dome (the domes' area, which differs with Mia) bursts with a sound, and the domes are told.

Definition at line 1067 of file kolima_forest_bridge.c.

Referenced by KolimaForestBridge_BurstOnBarrier().

Variable Documentation

◆ gKolimaForestBridge_BarrierHit

◆ gKolimaForestBridge_MiaInParty

s32 gKolimaForestBridge_MiaInParty

◆ gKolimaForestBridge_SparkleSoundOn

s32 gKolimaForestBridge_SparkleSoundOn

◆ gStagedActor_DirectionSteps

s32 gStagedActor_DirectionSteps[]
Initial value:
= {
DIRECTION_STEP(0, 16), DIRECTION_STEP(-16, 0), DIRECTION_STEP(-16, 0),
DIRECTION_STEP(-16, 0), DIRECTION_STEP(-16, 0), DIRECTION_STEP(0, -16),
DIRECTION_STEP(0, -16), DIRECTION_STEP(0, -16), DIRECTION_STEP(0, -16),
}
#define DIRECTION_STEP(dx, dz)
Pixel step by direction: X in the upper halfword, Z in the lower.

Pixel step by direction: X in the upper halfword, Z in the lower.

Definition at line 1151 of file kolima_forest_bridge.c.

◆ gStagedActor_FootprintKinds

u32 gStagedActor_FootprintKinds[]
Initial value:
= {
207, 205, 228, 229, 298, 297,
}

Definition at line 1161 of file kolima_forest_bridge.c.

◆ gStagedActor_FootprintBounds

s32 gStagedActor_FootprintBounds[]
Initial value:
= {
-32, -8, 32, 8,
-8, -32, 8, 32,
-32, -16, 32, 0,
-8, -32, 8, 32,
-32, -8, 32, 8,
-8, -32, 8, 32,
}

Definition at line 1165 of file kolima_forest_bridge.c.

◆ gKolimaForestBridge_GaretAction

s32 gKolimaForestBridge_GaretAction[]
Initial value:
= {
SC_ARG(2), SC_MOVE(PIXELS(234), 0, PIXELS(576)),
}
@ FACING_NORTHEAST
Definition field_scene.h:33
#define PIXELS(value)
#define SC_SET(w, v)
Write a work value.
Definition objcmd.h:37
#define SC_SYNC
Wait for arrival.
Definition objcmd.h:17
#define SC_ARG(v)
Definition objcmd.h:44
#define SC_MOVE(x, y, z)
Move toward the target.
Definition objcmd.h:19
#define SC_END
Return to the main script.
Definition objcmd.h:32
@ SW_FACING
Definition objcmd.h:57

Garet, Ivan and Mia walk to their places beside the leader.

Definition at line 1176 of file kolima_forest_bridge.c.

Referenced by KolimaForestBridge_WitnessForestCurse().

◆ gKolimaForestBridge_IvanAction

s32 gKolimaForestBridge_IvanAction[]
Initial value:
= {
SC_ARG(2), SC_MOVE(PIXELS(234), 0, PIXELS(623)),
}
@ FACING_EAST
Definition field_scene.h:26

Definition at line 1182 of file kolima_forest_bridge.c.

Referenced by KolimaForestBridge_WitnessForestCurse().

◆ gKolimaForestBridge_MiaAction

s32 gKolimaForestBridge_MiaAction[]
Initial value:
= {
SC_ARG(2), SC_MOVE(PIXELS(211), 0, PIXELS(602)),
}
@ FACING_NORTH
Definition field_scene.h:32

Definition at line 1188 of file kolima_forest_bridge.c.

Referenced by KolimaForestBridge_WitnessForestCurse().

◆ gKolimaForestBridge_SquashAction

s32 gKolimaForestBridge_SquashAction[]
Initial value:
= {
SC_ADD(SW_SCALE_X, -0x4000), SC_ADD(SW_SCALE_Y, 0x2000), SC_WAIT(2),
SC_ADD(SW_SCALE_X, 0x2000), SC_ADD(SW_SCALE_Y, -0x1000), SC_WAIT(2),
SC_ADD(SW_SCALE_X, 0x1000), SC_ADD(SW_SCALE_Y, -2048), SC_WAIT(2),
SC_ADD(SW_SCALE_X, 0x1000), SC_ADD(SW_SCALE_Y, -2048), SC_WAIT(2),
}
#define SC_LOOP(n, to)
Repeat up to n times.
Definition objcmd.h:28
#define SC_FOREVER
Definition objcmd.h:14
#define SC_ADD(w, v)
Definition objcmd.h:38
#define SC_WAIT(n)
Wait n frames.
Definition objcmd.h:16
#define SC_TOP
Script start.
Definition objcmd.h:13
@ SW_SCALE_Y
Definition objcmd.h:63
@ SW_SCALE_X
Definition objcmd.h:62

The glamour presses the party down: each squashes and wobbles until released.

Definition at line 1196 of file kolima_forest_bridge.c.

Referenced by KolimaForestBridge_WitnessForestCurse().

◆ gKolimaForestBridge_RestoreScaleAction

s32 gKolimaForestBridge_RestoreScaleAction[]
Initial value:
= {
SC_SET(SW_SCALE_X, 0x10000),
SC_SET(SW_SCALE_Y, 0x10000),
SC_WAIT(1),
}

Definition at line 1204 of file kolima_forest_bridge.c.

Referenced by KolimaForestBridge_WitnessForestCurse().

◆ gKolimaForestBridge_BarrierGrowAction

s32 gKolimaForestBridge_BarrierGrowAction[]
Initial value:
= {
SC_SET(SW_SCALE_X, 0x1999),
SC_SET(SW_SCALE_Y, 0x1999),
SC_WAIT(1),
SC_WAIT(1),
SC_LOOP(70, SC_TO(1)),
}
static s32 KolimaForestBridge_FlashHitBarriers(struct ScriptInterpreter *interpreter)
The end of a dome's growing: if a sparkle has burst on a dome, the dome takes its next pose.
#define SC_LABEL(n)
Branch destination.
Definition objcmd.h:11
#define SC_TO(n)
Definition objcmd.h:12
#define SC_CALL(fn)
Definition objcmd.h:50

A dome grows from a tenth of its size over 70 frames.

Definition at line 1212 of file kolima_forest_bridge.c.

Referenced by KolimaForestBridge_WitnessForestCurse().

◆ gKolimaForestBridge_BarrierShrinkAction

s32 gKolimaForestBridge_BarrierShrinkAction[]
Initial value:
= {
SC_ARG(1),
SC_ADD(SW_Z, -0x1999),
SC_WAIT(1),
SC_POS(0, 0, 0),
SC_WAIT(1),
}
#define SC_POS(x, y, z)
Set position.
Definition objcmd.h:18
@ SW_Z
Definition objcmd.h:60

A dome sinks and shrinks away over 90 frames.

Definition at line 1226 of file kolima_forest_bridge.c.

Referenced by KolimaForestBridge_WitnessForestCurse().

◆ gKolimaForestBridge_GroundSparkleAction

s32 gKolimaForestBridge_GroundSparkleAction[]
Initial value:
= {
SC_SET(SW_SCALE_X, 0xc000),
SC_SET(SW_SCALE_Y, 0xc000),
SC_SET(0x23, 0),
}
static s32 KolimaForestBridge_TwinkleGroundSparkle(struct ScriptInterpreter *interpreter)
Each frame: a ground sparkle's timer runs on at random, and the sparkle shows its bright frame (7) wh...
@ SW_COLLISION
Definition objcmd.h:79

Definition at line 1238 of file kolima_forest_bridge.c.

Referenced by KolimaForestBridge_WitnessForestCurse().

◆ gKolimaForestBridge_Entrances

struct SceneEntrance gKolimaForestBridge_Entrances[]
Initial value:
= {
{0, CONDITION_ALWAYS, 384, 0, 312, FACING_NORTH, 0, -1, -1, -1, -1, 0},
{2, CONDITION_ALWAYS, 24, 0, 128, FACING_EAST, 0, -1, -1, -1, -1, 0},
{4, CONDITION_ALWAYS, 172, 0, 602, FACING_EAST, 0, -1, -1, -1, -1, 0},
}
@ SCENE_TABLE_END
Definition field_scene.h:43
@ CONDITION_ALWAYS
Definition field_scene.h:44

Definition at line 1248 of file kolima_forest_bridge.c.

Referenced by KolimaForestBridge_GetEntrances().

◆ gKolimaForestBridge_Exits

u32 gKolimaForestBridge_Exits[]
Initial value:
= {
SCENE_EXITS(40), SCENE_EXIT(1, 41, 1), SCENE_EXIT(2, 40, 1),
SCENE_EXIT(3, 40, 1), SCENE_EXIT(4, 2, 8), SCENE_EXITS_END,
}
#define SCENE_EXITS(scene)
Definition field_scene.h:72
#define SCENE_EXIT(exit, scene, entrance)
Definition field_scene.h:73
#define SCENE_EXITS_END
Definition field_scene.h:77

Exit 1 to the clearing (scene 41) and exit 4 to the world map (scene 2).

Exits 2 and 3, which no event uses, lead into this map (scene 40).

Definition at line 1257 of file kolima_forest_bridge.c.

Referenced by KolimaForestBridge_GetExits().

◆ gKolimaForestBridge_Placements

struct ScenePlacement gKolimaForestBridge_Placements[]

Garet, Ivan and Mia for the curse; the three logs; Tret and Laurel; the four domes; and the five ground sparkles.

Definition at line 1265 of file kolima_forest_bridge.c.

Referenced by KolimaForestBridge_GetPlacements().

◆ gKolimaForestBridge_Events

struct SceneEvent gKolimaForestBridge_Events[]
Initial value:
= {
}
#define SCENE_EVENTS_END
@ EVENT_TOUCH
@ EVENT_EXIT
#define EVENT_SCRIPT(script)
#define EVENT_TOUCH_WALKING
#define TOUCH_WALKING_INTO(facing)
static void KolimaForestBridge_PushLog(void)
Walking into a log: it rolls ahead until something stops it.
static void KolimaForest_HopEast(void)
Touch trigger 11, walking east: hop 30 pixels east of the leader.
Definition kolima_jump.h:60

Definition at line 1302 of file kolima_forest_bridge.c.

Referenced by KolimaForestBridge_GetEvents().

◆ gKolimaForestBridge_SparkleScript

s32 gKolimaForestBridge_SparkleScript[]
Initial value:
= {
SC_CALL(SceneEffect_AdvanceAngleUntilIdle),
}

Definition at line 1312 of file kolima_forest_bridge.c.

Referenced by KolimaForestBridge_SpawnCurseSparkle().

◆ gKolimaForestBridge_SparkleBurstScript

s32 gKolimaForestBridge_SparkleBurstScript[]
Initial value:
= {
SC_SET(SW_SCALE_X, 0x20000),
SC_SET(SW_SCALE_Y, 0x20000),
SC_WAIT(10),
}
#define SC_FREE
Release.
Definition objcmd.h:43

A sparkle bursts on a dome: it doubles in size and is gone.

Definition at line 1318 of file kolima_forest_bridge.c.

Referenced by KolimaForestBridge_BurstOnBarrier().

◆ gFallingEffectScript

s32 gFallingEffectScript[]
Initial value:
= {
SC_CALL(Kolima_FlickerCurseDust),
SC_WAIT(1),
SC_CALL(Kolima_FlickerCurseDust),
SC_WAIT(1),
SC_CALL(Kolima_FlickerCurseDust),
SC_WAIT(1),
SC_LOOP(40, SC_TO(1)),
}
static s32 KolimaForestBridge_BurstOnBarrier(struct ScriptInterpreter *interpreter)
The end of a sparkle's fall: one that lands on a dome (the domes' area, which differs with Mia) burst...
@ SW_Y
Definition objcmd.h:59

Definition at line 1325 of file kolima_forest_bridge.c.