Alchemy
Loading...
Searching...
No Matches

kolima_forest_tree.c File Reference

Kolima Forest's clearing before Tret, the great tree, and Laurel: once Tret's hostile heart is defeated, Hermes' Water heals him and lifts Kolima's curse. More...

Go to the source code of this file.

Enumerations

enum  {
  ACTOR_TRET = 8 , ACTOR_LAUREL = 9 , ACTOR_TRET_AUXILIARY = 10 , ACTOR_LAUREL_AUXILIARY = 11 ,
  ACTOR_TRETS_DARK_SIDE = 14
}

Functions

static void KolimaForestTree_RejectHermesWater (void)
 Shows Tret's hostile heart repelling the leader's attempt to help.
static void KolimaForestTree_RestoreTret (void)
 Heals Tret, lifts Kolima's curse and hears the trees' warning.
static void KolimaForestTree_SpawnRejectionSpark (void)
 Spawns the growing sparks that repel the party leader.
static void KolimaForestTree_UpdateHealingPalette (void)
 Alternates the saved healthy and withered palettes over thirty frames.
static void KolimaForestTree_PlayGesture (s32 auxiliaryActorId, s32 gesture)
 Chooses Tret or Laurel's facial sequence through their auxiliary actor.
static void KolimaForestTree_SpawnOrbitSparks (void)
 Emits six-spark rings at ten-frame intervals during each burst.
static void KolimaForestTree_ReplaceInventoryItem (s32 oldItemId, s32 newItemId)
 Replaces the used water with its empty bottle in the same inventory slot.
const struct SceneEntrance * KolimaForestTree_GetEntrances (void)
const struct SceneRegion * KolimaForestTree_GetRegions (void)
 Returns the region at the entrance to Tret's interior.
const u32 * KolimaForestTree_GetExits (void)
 Returns the connections to the bridge and Tret's interior.
const struct ScenePlacement * KolimaForestTree_GetPlacements (void)
 Returns Tret, Laurel and their auxiliary actors.
static UNUSED void KolimaForestTree_ExitTouchedRegion (void)
 Takes the touched exit after completing the leader's current movement.
const struct SceneEvent * KolimaForestTree_GetEvents (void)
 Returns the trees' dialogue, Mind Read and item-use events.
static void KolimaForestTree_TalkToLaurel (void)
 Introduces Laurel or hears her warning while Tret is still dying.
static void KolimaForestTree_TalkToTret (void)
 Talks to Tret and offers the item prompt when Hermes' Water is available.
static void KolimaForestTree_ReadLaurelThoughts (void)
 Reads Laurel's thoughts about the healing water or the danger beyond the river.
static void KolimaForestTree_ReadTretThoughts (void)
 Reads Tret's regret before healing, or his concern for the forest afterward.
static void KolimaForestTree_UseHermesWater (void)
 Heals Tret only after his hostile heart has been defeated.
static __inline__ void KolimaForestTree_NodTogether (void)
 Gives all four companions the same nod, waiting on Ivan's animation.
static __inline__ void KolimaForestTree_FaceParty (s32 facing, s32 waitFrames)
 Turns the companions together and pauses after the final facing change.
s32 KolimaForestTree_Initialize (void)
 Restores the trees' faces, collision and the dying forest's palette.
static __inline__ void KolimaForestTree_AlternateFaceFrames (s32 actorId, s32 firstFrame, s32 secondFrame)
 Alternates two facial frames twice, ending on the first frame.
static void KolimaForestTree_UpdateOrbitSpark (union FieldObject *fieldObject)
 Expands a spark along its spiral for 120 frames, then releases its cache slot.

Variables

s32 gKolimaForestTreeSparkOrigin [3]
s32 gKolimaForestTreeSparkFrame
s32 gKolimaForestTreePlaySparkSound
s32 gKolimaForestTreePaletteFrame
s32 gKolimaForestTree_GaretApproachActions []
s32 gKolimaForestTree_IvanApproachActions []
s32 gKolimaForestTree_MiaApproachActions []
s32 gKolimaForestTree_RejoinPartyActions []
struct SceneEntrance gKolimaForestTreeEntrances []
struct SceneRegion gKolimaForestTreeRegions []
u32 gKolimaForestTreeExits []
struct ScenePlacement gKolimaForestTreePlacements []
struct SceneEvent gKolimaForestTreeEvents []
s32 gKolimaForestTreeEffectScript []

Detailed Description

Kolima Forest's clearing before Tret, the great tree, and Laurel: once Tret's hostile heart is defeated, Hermes' Water heals him and lifts Kolima's curse.

Definition in file kolima_forest_tree.c.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
ACTOR_TRET 
ACTOR_LAUREL 
ACTOR_TRET_AUXILIARY 
ACTOR_LAUREL_AUXILIARY 
ACTOR_TRETS_DARK_SIDE 

Definition at line 46 of file kolima_forest_tree.c.

Function Documentation

◆ KolimaForestTree_RejectHermesWater()

void KolimaForestTree_RejectHermesWater ( void )
static

Shows Tret's hostile heart repelling the leader's attempt to help.

Definition at line 209 of file kolima_forest_tree.c.

Referenced by KolimaForestTree_RejectHermesWater(), and KolimaForestTree_UseHermesWater().

◆ KolimaForestTree_RestoreTret()

void KolimaForestTree_RestoreTret ( void )
static

Heals Tret, lifts Kolima's curse and hears the trees' warning.

Definition at line 292 of file kolima_forest_tree.c.

Referenced by KolimaForestTree_RestoreTret(), and KolimaForestTree_UseHermesWater().

◆ KolimaForestTree_SpawnRejectionSpark()

void KolimaForestTree_SpawnRejectionSpark ( void )
static

Spawns the growing sparks that repel the party leader.

Definition at line 697 of file kolima_forest_tree.c.

Referenced by KolimaForestTree_RejectHermesWater(), and KolimaForestTree_SpawnRejectionSpark().

◆ KolimaForestTree_UpdateHealingPalette()

void KolimaForestTree_UpdateHealingPalette ( void )
static

Alternates the saved healthy and withered palettes over thirty frames.

Definition at line 732 of file kolima_forest_tree.c.

Referenced by KolimaForestTree_RestoreTret(), and KolimaForestTree_UpdateHealingPalette().

◆ KolimaForestTree_PlayGesture()

void KolimaForestTree_PlayGesture ( s32 auxiliaryActorId,
s32 gesture )
static

Chooses Tret or Laurel's facial sequence through their auxiliary actor.

Definition at line 765 of file kolima_forest_tree.c.

Referenced by KolimaForestTree_PlayGesture(), KolimaForestTree_RestoreTret(), KolimaForestTree_TalkToLaurel(), and KolimaForestTree_TalkToTret().

◆ KolimaForestTree_SpawnOrbitSparks()

void KolimaForestTree_SpawnOrbitSparks ( void )
static

Emits six-spark rings at ten-frame intervals during each burst.

Definition at line 875 of file kolima_forest_tree.c.

Referenced by KolimaForestTree_RestoreTret(), and KolimaForestTree_SpawnOrbitSparks().

◆ KolimaForestTree_ReplaceInventoryItem()

void KolimaForestTree_ReplaceInventoryItem ( s32 oldItemId,
s32 newItemId )
static

Replaces the used water with its empty bottle in the same inventory slot.

Definition at line 915 of file kolima_forest_tree.c.

Referenced by KolimaForestTree_ReplaceInventoryItem(), and KolimaForestTree_RestoreTret().

◆ KolimaForestTree_GetEntrances()

const struct SceneEntrance * KolimaForestTree_GetEntrances ( void )

Definition at line 67 of file kolima_forest_tree.c.

Referenced by KolimaForestTree_GetEntrances().

◆ KolimaForestTree_GetRegions()

const struct SceneRegion * KolimaForestTree_GetRegions ( void )

Returns the region at the entrance to Tret's interior.

Definition at line 72 of file kolima_forest_tree.c.

Referenced by KolimaForestTree_GetRegions().

◆ KolimaForestTree_GetExits()

const u32 * KolimaForestTree_GetExits ( void )

Returns the connections to the bridge and Tret's interior.

Definition at line 77 of file kolima_forest_tree.c.

Referenced by KolimaForestTree_GetExits().

◆ KolimaForestTree_GetPlacements()

const struct ScenePlacement * KolimaForestTree_GetPlacements ( void )

Returns Tret, Laurel and their auxiliary actors.

Definition at line 80 of file kolima_forest_tree.c.

Referenced by KolimaForestTree_GetPlacements().

◆ KolimaForestTree_ExitTouchedRegion()

UNUSED void KolimaForestTree_ExitTouchedRegion ( void )
static

Takes the touched exit after completing the leader's current movement.

Definition at line 85 of file kolima_forest_tree.c.

Referenced by KolimaForestTree_ExitTouchedRegion().

◆ KolimaForestTree_GetEvents()

const struct SceneEvent * KolimaForestTree_GetEvents ( void )

Returns the trees' dialogue, Mind Read and item-use events.

Definition at line 96 of file kolima_forest_tree.c.

Referenced by KolimaForestTree_GetEvents().

◆ KolimaForestTree_TalkToLaurel()

void KolimaForestTree_TalkToLaurel ( void )
static

Introduces Laurel or hears her warning while Tret is still dying.

Definition at line 101 of file kolima_forest_tree.c.

Referenced by KolimaForestTree_TalkToLaurel().

◆ KolimaForestTree_TalkToTret()

void KolimaForestTree_TalkToTret ( void )
static

Talks to Tret and offers the item prompt when Hermes' Water is available.

Definition at line 132 of file kolima_forest_tree.c.

Referenced by KolimaForestTree_TalkToTret().

◆ KolimaForestTree_ReadLaurelThoughts()

void KolimaForestTree_ReadLaurelThoughts ( void )
static

Reads Laurel's thoughts about the healing water or the danger beyond the river.

Definition at line 173 of file kolima_forest_tree.c.

Referenced by KolimaForestTree_ReadLaurelThoughts().

◆ KolimaForestTree_ReadTretThoughts()

void KolimaForestTree_ReadTretThoughts ( void )
static

Reads Tret's regret before healing, or his concern for the forest afterward.

Definition at line 185 of file kolima_forest_tree.c.

Referenced by KolimaForestTree_ReadTretThoughts().

◆ KolimaForestTree_UseHermesWater()

void KolimaForestTree_UseHermesWater ( void )
static

Heals Tret only after his hostile heart has been defeated.

Definition at line 197 of file kolima_forest_tree.c.

Referenced by KolimaForestTree_UseHermesWater().

◆ KolimaForestTree_NodTogether()

__inline__ void KolimaForestTree_NodTogether ( void )
static

Gives all four companions the same nod, waiting on Ivan's animation.

Definition at line 276 of file kolima_forest_tree.c.

Referenced by KolimaForestTree_NodTogether(), and KolimaForestTree_RestoreTret().

◆ KolimaForestTree_FaceParty()

__inline__ void KolimaForestTree_FaceParty ( s32 facing,
s32 waitFrames )
static

Turns the companions together and pauses after the final facing change.

Definition at line 284 of file kolima_forest_tree.c.

Referenced by KolimaForestTree_FaceParty(), and KolimaForestTree_RestoreTret().

◆ KolimaForestTree_Initialize()

s32 KolimaForestTree_Initialize ( void )

Restores the trees' faces, collision and the dying forest's palette.

Definition at line 651 of file kolima_forest_tree.c.

Referenced by KolimaForestTree_Initialize().

◆ KolimaForestTree_AlternateFaceFrames()

__inline__ void KolimaForestTree_AlternateFaceFrames ( s32 actorId,
s32 firstFrame,
s32 secondFrame )
static

Alternates two facial frames twice, ending on the first frame.

Definition at line 750 of file kolima_forest_tree.c.

Referenced by KolimaForestTree_AlternateFaceFrames(), and KolimaForestTree_PlayGesture().

◆ KolimaForestTree_UpdateOrbitSpark()

void KolimaForestTree_UpdateOrbitSpark ( union FieldObject * fieldObject)
static

Expands a spark along its spiral for 120 frames, then releases its cache slot.

Definition at line 852 of file kolima_forest_tree.c.

Referenced by KolimaForestTree_SpawnOrbitSparks(), and KolimaForestTree_UpdateOrbitSpark().

Variable Documentation

◆ gKolimaForestTreeSparkOrigin

s32 gKolimaForestTreeSparkOrigin[3]

◆ gKolimaForestTreeSparkFrame

s32 gKolimaForestTreeSparkFrame

◆ gKolimaForestTreePlaySparkSound

s32 gKolimaForestTreePlaySparkSound

◆ gKolimaForestTreePaletteFrame

s32 gKolimaForestTreePaletteFrame

◆ gKolimaForestTree_GaretApproachActions

s32 gKolimaForestTree_GaretApproachActions[]
Initial value:
= {
SC_ARG(2), SC_MOVE(PIXELS(312), 0, PIXELS(230)), SC_SYNC,
}
@ FACING_NORTH
Definition field_scene.h:32
#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_WAIT(n)
Wait n frames.
Definition objcmd.h:16
#define SC_END
Return to the main script.
Definition objcmd.h:32
@ SW_FACING
Definition objcmd.h:57

Definition at line 930 of file kolima_forest_tree.c.

Referenced by KolimaForestTree_RestoreTret().

◆ gKolimaForestTree_IvanApproachActions

s32 gKolimaForestTree_IvanApproachActions[]
Initial value:

Definition at line 936 of file kolima_forest_tree.c.

Referenced by KolimaForestTree_RestoreTret().

◆ gKolimaForestTree_MiaApproachActions

s32 gKolimaForestTree_MiaApproachActions[]
Initial value:

Definition at line 942 of file kolima_forest_tree.c.

Referenced by KolimaForestTree_RestoreTret().

◆ gKolimaForestTree_RejoinPartyActions

s32 gKolimaForestTree_RejoinPartyActions[]
Initial value:
= {
SC_ARG(2), SC_MOVE(PIXELS(328), 0, PIXELS(212)),
SC_SYNC, SC_POS(0, 0, 0),
}
#define SC_POS(x, y, z)
Set position.
Definition objcmd.h:18

Definition at line 948 of file kolima_forest_tree.c.

Referenced by KolimaForestTree_RestoreTret().

◆ gKolimaForestTreeEntrances

struct SceneEntrance gKolimaForestTreeEntrances[]
Initial value:
= {
{0, CONDITION_ALWAYS, 209, 0, 279, FACING_SOUTH, 0, 0, 0, 512, 448, 0},
{1, CONDITION_ALWAYS, 136, 0, 424, FACING_NORTH, 0, 0, 0, 512, 448, 0},
{2, CONDITION_ALWAYS, 328, 16, 200, FACING_SOUTH, 0, 0, 0, 512, 448, 0},
}
@ SCENE_TABLE_END
Definition field_scene.h:43
@ CONDITION_ALWAYS
Definition field_scene.h:44
@ FACING_SOUTH
Definition field_scene.h:28

Definition at line 954 of file kolima_forest_tree.c.

Referenced by KolimaForestTree_GetEntrances().

◆ gKolimaForestTreeRegions

struct SceneRegion gKolimaForestTreeRegions[]
Initial value:
= {
{320, 88, 176, 336, 104, 192, -1, 2},
{-1, 0, 0, 0, 0, 0, 0, 0},
}

Definition at line 962 of file kolima_forest_tree.c.

Referenced by KolimaForestTree_GetRegions().

◆ gKolimaForestTreeExits

u32 gKolimaForestTreeExits[]
Initial value:
= {
SCENE_EXIT(1, 43, 2),
SCENE_EXIT(2, 45, 1),
}
#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

Definition at line 967 of file kolima_forest_tree.c.

Referenced by KolimaForestTree_GetExits().

◆ gKolimaForestTreePlacements

struct ScenePlacement gKolimaForestTreePlacements[]
Initial value:
= {
{ 0x16, CONDITION_ALWAYS, 7,
{ 0x16, CONDITION_ALWAYS, 7,
{ 0x16, CONDITION_ALWAYS, 7,
{ 0x16, CONDITION_ALWAYS, 7,
0, 0, 0, FACING_EAST, TALK_KEEP_FACING, 0 },
0, 0, 0, FACING_EAST, TALK_KEEP_FACING, 0 },
0, 0, 0, FACING_EAST, TALK_KEEP_FACING, 0 },
}
#define GARET
Jerald.
#define MIA
Mary.
#define IVAN
Ivan.
@ TALK_KEEP_FACING
@ ACTOR_STAND
@ FACING_EAST
Definition field_scene.h:26

Definition at line 974 of file kolima_forest_tree.c.

Referenced by KolimaForestTree_GetPlacements().

◆ gKolimaForestTreeEvents

struct SceneEvent gKolimaForestTreeEvents[]
Initial value:
= {
}
@ ABILITY_MIND_READ
Definition ability_ids.h:16
#define SCENE_EVENTS_END
@ EVENT_EXIT
@ EVENT_TALK
#define PSYNERGY_ON_ACTOR(ability)
#define EVENT_SCRIPT(script)
#define USE_ITEM_ON_ACTOR(item)
#define FLAG_KOLIMA_CURSE_LIFTED
Definition flags.h:103
#define FLAG_TRET_DEFEATED
Definition flags.h:102
@ ITEM_HERMES_WATER
Definition item_ids.h:44
static void KolimaForestTree_ReadLaurelThoughts(void)
Reads Laurel's thoughts about the healing water or the danger beyond the river.
static void KolimaForestTree_ReadTretThoughts(void)
Reads Tret's regret before healing, or his concern for the forest afterward.
static void KolimaForestTree_UseHermesWater(void)
Heals Tret only after his hostile heart has been defeated.
static void KolimaForestTree_TalkToLaurel(void)
Introduces Laurel or hears her warning while Tret is still dying.
static void KolimaForestTree_TalkToTret(void)
Talks to Tret and offers the item prompt when Hermes' Water is available.

Definition at line 998 of file kolima_forest_tree.c.

Referenced by KolimaForestTree_GetEvents().

◆ gKolimaForestTreeEffectScript

s32 gKolimaForestTreeEffectScript[]
Initial value:
= {
SC_CALL(SceneEffect_AdvanceAngleUntilIdle),
}
#define Q16_ONE
One in the engine's signed 16.16 fixed-point format.
Definition fixed_math.h:10
#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_TOP
Script start.
Definition objcmd.h:13
@ SW_SCALE_X
Definition objcmd.h:62
#define SC_CALL(fn)
Definition objcmd.h:50

Definition at line 1011 of file kolima_forest_tree.c.

Referenced by KolimaForestTree_SpawnRejectionSpark().