Alchemy
Loading...
Searching...
No Matches

vale_kraden.c File Reference

The north of Vale around Kraden's cottage: the fence above the village, the path down to the plaza, and the cottage's gate. More...

Go to the source code of this file.

Enumerations

enum  ValeKradenActor {
  ACTOR_WEST_ROCK = 9 , ACTOR_EAST_ROCK = 10 , ACTOR_ROCKSLIDE_SURVIVOR = 11 , ACTOR_FENCE_ONLOOKER = 12 ,
  ACTOR_KRADEN = 13 , ACTOR_SATUROS = 14 , ACTOR_MENARDI = 15 , ACTOR_COTTAGE_VISITOR = 16
}

Functions

const struct SceneEntrance * ValeKraden_GetEntrances (void)
const struct SceneRegion * ValeKraden_GetRegions (void)
const u32 * ValeKraden_GetExits (void)
const struct ScenePlacement * ValeKraden_GetPlacements (void)
 Returns the one placement table for every visit; ValeKraden_Initialize removes the actors a visit does not use.
const struct SceneEvent * ValeKraden_GetEvents (void)
 Selects the events for the current visit to Vale: after Kalay (FLAG_REACHED_KALAY), on the stormy night (FLAG_VALE_STORM), else the day the story begins.
static __inline__ void ValeKraden_NodTogether (void)
 Finishes the party's nod together before the next line of dialogue.
static __inline__ void ValeKraden_FacePartySouth (void)
 Turns all three party members toward the strangers.
static __inline__ void ValeKraden_WalkTowardLeader (s32 companionId)
 Starts a companion walking back to Isaac's current pixel position.
static void Event_TalkToFenceOnlooker (void)
 The child at the fence asks whether Isaac hears the growls beyond it; once the party has left Vale, he means to climb it someday.
static void Event_KradenPlansSanctumVisit (void)
 Talking to Kraden outside his cottage: he talks Isaac, Garet and Jenna into a secret look at Sol Sanctum, then goes inside to prepare.
static void Event_KradenSetsOff (void)
 Arriving by entrance 10, from the cottage: Kraden comes out ready, and everyone joins Isaac for the mountain.
static void Event_EnterCottage (void)
 Walking into the cottage: the gate opens unless Kraden left it open.
static void Event_MeetSaturosAndMenardi (void)
 Walking past the two strangers: Isaac, Garet and Jenna overhear Saturos and Menardi, confront them and are warned off.
static void Event_OverhearKraden (void)
 Walking up to the cottage: Kraden paces, wondering aloud who the strangers were and what they know of Sol Sanctum and the Elemental Stars.
s32 ValeKraden_Initialize (void)
 Places the actors for the storm or for the day, and plays the arrival from the cottage.
static void Event_TalkToRockslideSurvivor (void)
 The man hurt in the rockslide asks whether he will die: yes, and he gives up; no, and he finds he is unhurt and runs off to the plaza.
static void Event_FightFirstMonster (void)
 On the stormy night, a monster attacks by the broken fence.
static void Event_FightSecondMonster (void)
 On the stormy night, a second monster attacks by the broken fence.
static void Event_TalkToCottageVisitor (void)
 After the party has reached Kalay, a villager at the cottage asks Isaac about his memories of it.

Variables

s32 gValeKraden_RockslideSurvivorEscapeActions []
 Leads the party away from the broken fence, then leaves the map.
s32 gValeKraden_RockslideSurvivorSwayActions []
 Alternates the survivor's width and height while he lies by the fence.
s32 gValeKraden_FaceTargetActions []
 Keeps a linked actor facing its current target.
struct SceneEntrance gValeKraden_Entrances []
u32 gValeKraden_Exits []
struct ScenePlacement gValeKraden_Placements []
struct SceneEvent gValeKraden_Events []
struct SceneEvent gValeKraden_StormEvents []
struct SceneEvent gValeKraden_EventsAfterKalay []
u16 gValeKraden_GateCells []

Detailed Description

The north of Vale around Kraden's cottage: the fence above the village, the path down to the plaza, and the cottage's gate.

Definition in file vale_kraden.c.

Enumeration Type Documentation

◆ ValeKradenActor

Enumerator
ACTOR_WEST_ROCK 

The west rock. "It's a huge rock that Isaac's strength can't even budge.".

ACTOR_EAST_ROCK 
ACTOR_ROCKSLIDE_SURVIVOR 
ACTOR_FENCE_ONLOOKER 
ACTOR_KRADEN 
ACTOR_SATUROS 
ACTOR_MENARDI 
ACTOR_COTTAGE_VISITOR 

Definition at line 37 of file vale_kraden.c.

Function Documentation

◆ ValeKraden_GetEntrances()

const struct SceneEntrance * ValeKraden_GetEntrances ( void )

Definition at line 51 of file vale_kraden.c.

Referenced by ValeKraden_GetEntrances().

◆ ValeKraden_GetRegions()

const struct SceneRegion * ValeKraden_GetRegions ( void )

Definition at line 55 of file vale_kraden.c.

Referenced by ValeKraden_GetRegions().

◆ ValeKraden_GetExits()

const u32 * ValeKraden_GetExits ( void )

Definition at line 57 of file vale_kraden.c.

Referenced by ValeKraden_GetExits().

◆ ValeKraden_GetPlacements()

const struct ScenePlacement * ValeKraden_GetPlacements ( void )

Returns the one placement table for every visit; ValeKraden_Initialize removes the actors a visit does not use.

Definition at line 61 of file vale_kraden.c.

Referenced by ValeKraden_GetPlacements().

◆ ValeKraden_GetEvents()

const struct SceneEvent * ValeKraden_GetEvents ( void )

Selects the events for the current visit to Vale: after Kalay (FLAG_REACHED_KALAY), on the stormy night (FLAG_VALE_STORM), else the day the story begins.

Definition at line 68 of file vale_kraden.c.

Referenced by ValeKraden_GetEvents().

◆ ValeKraden_NodTogether()

__inline__ void ValeKraden_NodTogether ( void )
static

Finishes the party's nod together before the next line of dialogue.

Definition at line 79 of file vale_kraden.c.

Referenced by Event_KradenPlansSanctumVisit(), and ValeKraden_NodTogether().

◆ ValeKraden_FacePartySouth()

__inline__ void ValeKraden_FacePartySouth ( void )
static

Turns all three party members toward the strangers.

Definition at line 86 of file vale_kraden.c.

Referenced by Event_MeetSaturosAndMenardi(), and ValeKraden_FacePartySouth().

◆ ValeKraden_WalkTowardLeader()

__inline__ void ValeKraden_WalkTowardLeader ( s32 companionId)
static

Starts a companion walking back to Isaac's current pixel position.

Definition at line 93 of file vale_kraden.c.

Referenced by Event_KradenSetsOff(), Event_MeetSaturosAndMenardi(), and ValeKraden_WalkTowardLeader().

◆ Event_TalkToFenceOnlooker()

void Event_TalkToFenceOnlooker ( void )
static

The child at the fence asks whether Isaac hears the growls beyond it; once the party has left Vale, he means to climb it someday.

Reached by talking to the onlooker at the fence (actor 12) in the day's events.

Definition at line 109 of file vale_kraden.c.

Referenced by Event_TalkToFenceOnlooker().

◆ Event_KradenPlansSanctumVisit()

void Event_KradenPlansSanctumVisit ( void )
static

Talking to Kraden outside his cottage: he talks Isaac, Garet and Jenna into a secret look at Sol Sanctum, then goes inside to prepare.

Reached by talking to Kraden (actor 13) in the day's events, until FLAG_SANCTUM_VISIT_PLANNED is set. Ends by taking exit 13 into the cottage (scene 8, entrance 22); the party comes back by entrance 10, where Event_KradenSetsOff goes on.

Definition at line 142 of file vale_kraden.c.

Referenced by Event_KradenPlansSanctumVisit().

◆ Event_KradenSetsOff()

void Event_KradenSetsOff ( void )
static

Arriving by entrance 10, from the cottage: Kraden comes out ready, and everyone joins Isaac for the mountain.

"This is our best bet." The mountain is Mt. Aleph.

Called by ValeKraden_Initialize on entrance 10 unless the party keeps its position. Sets FLAG_SANCTUM_VISIT_PLANNED and FLAG_SCENE_TEMP_42 (the gate stays open), and removes Kraden, Garet, Jenna, Saturos and Menardi.

Definition at line 398 of file vale_kraden.c.

Referenced by Event_KradenSetsOff(), and ValeKraden_Initialize().

◆ Event_EnterCottage()

void Event_EnterCottage ( void )
static

Walking into the cottage: the gate opens unless Kraden left it open.

Reached by walking north into cell code 3, by day and after Kalay; takes exit 3 into the cottage.

Definition at line 468 of file vale_kraden.c.

Referenced by Event_EnterCottage().

◆ Event_MeetSaturosAndMenardi()

void Event_MeetSaturosAndMenardi ( void )
static

Walking past the two strangers: Isaac, Garet and Jenna overhear Saturos and Menardi, confront them and are warned off.

Reached by stepping on cell code 7 in the day's events; runs once, setting FLAG_MET_SATUROS_AND_MENARDI. Saturos and Menardi are left turning to watch the leader.

Definition at line 483 of file vale_kraden.c.

Referenced by Event_MeetSaturosAndMenardi().

◆ Event_OverhearKraden()

void Event_OverhearKraden ( void )
static

Walking up to the cottage: Kraden paces, wondering aloud who the strangers were and what they know of Sol Sanctum and the Elemental Stars.

Reached by stepping on cell code 5 in the day's events; runs once, setting FLAG_OVERHEARD_KRADEN.

Definition at line 708 of file vale_kraden.c.

Referenced by Event_OverhearKraden().

◆ ValeKraden_Initialize()

s32 ValeKraden_Initialize ( void )

Places the actors for the storm or for the day, and plays the arrival from the cottage.

The scene's initialize entry. On the stormy night (FLAG_VALE_STORM) it starts the lightning, removes the day's people, lays the survivor by the fence (unless FLAG_VALE_ROCKSLIDE_SURVIVOR_ESCAPED) and blocks the cells the rockslide covers. By day it removes the rocks and Garet, runs Event_KradenSetsOff from entrance 10, removes Kraden and the strangers once FLAG_SANCTUM_VISIT_PLANNED is set, and places the cottage visitor after Kalay. Clears FLAG_SCENE_TEMP_42 when the party keeps its position.

Definition at line 806 of file vale_kraden.c.

Referenced by ValeKraden_Initialize().

◆ Event_TalkToRockslideSurvivor()

void Event_TalkToRockslideSurvivor ( void )
static

The man hurt in the rockslide asks whether he will die: yes, and he gives up; no, and he finds he is unhurt and runs off to the plaza.

Reached on the stormy night by talking to him (actor 11), or by stepping on cell code 20 until he has given up. Sets FLAG_VALE_ROCKSLIDE_SURVIVOR_GAVE_UP on yes, or FLAG_VALE_ROCKSLIDE_SURVIVOR_ESCAPED on no; once he has escaped it does nothing.

Definition at line 897 of file vale_kraden.c.

Referenced by Event_TalkToRockslideSurvivor().

◆ Event_FightFirstMonster()

void Event_FightFirstMonster ( void )
static

On the stormy night, a monster attacks by the broken fence.

Reached by stepping on cell code 10 until FLAG_VALE_STORM_FIRST_MONSTER_FOUGHT is set. Sets it and FLAG_VALE_STORM_MONSTER_FOUGHT, and starts encounter 0 of table 12.

Definition at line 994 of file vale_kraden.c.

Referenced by Event_FightFirstMonster().

◆ Event_FightSecondMonster()

void Event_FightSecondMonster ( void )
static

On the stormy night, a second monster attacks by the broken fence.

Reached by stepping on cell code 11 until FLAG_VALE_STORM_SECOND_MONSTER_FOUGHT is set. Sets it and FLAG_VALE_STORM_MONSTER_FOUGHT, and starts encounter 1 of table 12.

Definition at line 1014 of file vale_kraden.c.

Referenced by Event_FightSecondMonster().

◆ Event_TalkToCottageVisitor()

void Event_TalkToCottageVisitor ( void )
static

After the party has reached Kalay, a villager at the cottage asks Isaac about his memories of it.

Reached by talking to the cottage visitor (actor 16) in the events after Kalay.

Definition at line 1034 of file vale_kraden.c.

Referenced by Event_TalkToCottageVisitor().

Variable Documentation

◆ gValeKraden_RockslideSurvivorEscapeActions

s32 gValeKraden_RockslideSurvivorEscapeActions[]
Initial value:
= {
SC_ARG(2), SC_MOVE(PIXELS(72), 0, PIXELS(294)),
SC_SYNC, SC_MOVE(PIXELS(77), 0, PIXELS(329)),
SC_SYNC, SC_MOVE(PIXELS(70), 0, PIXELS(415)),
SC_SYNC, SC_POS(0, 0, 0),
}
#define PIXELS(value)
#define SC_POS(x, y, z)
Set position.
Definition objcmd.h:18
#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

Leads the party away from the broken fence, then leaves the map.

Definition at line 1042 of file vale_kraden.c.

Referenced by Event_TalkToRockslideSurvivor().

◆ gValeKraden_RockslideSurvivorSwayActions

s32 gValeKraden_RockslideSurvivorSwayActions[]
Initial value:
= {
SC_WAIT(2),
SC_WAIT(2),
SC_WAIT(2),
SC_WAIT(2),
SC_WAIT(60),
}
#define Q16_ONE
One in the engine's signed 16.16 fixed-point format.
Definition fixed_math.h:10
#define SC_SET(w, v)
Write a work value.
Definition objcmd.h:37
#define SC_LOOP(n, to)
Repeat up to n times.
Definition objcmd.h:28
#define SC_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

Alternates the survivor's width and height while he lies by the fence.

Definition at line 1051 of file vale_kraden.c.

Referenced by ValeKraden_Initialize().

◆ gValeKraden_FaceTargetActions

s32 gValeKraden_FaceTargetActions[]
Initial value:
= {
SC_CALL(Scene_TurnTowardTarget),
}
#define SC_CALL(fn)
Definition objcmd.h:50

Keeps a linked actor facing its current target.

Definition at line 1071 of file vale_kraden.c.

Referenced by Event_MeetSaturosAndMenardi(), Event_TalkToRockslideSurvivor(), and ValeKraden_Initialize().

◆ gValeKraden_Entrances

struct SceneEntrance gValeKraden_Entrances[]
Initial value:
= {
{0, CONDITION_ALWAYS, 228, 0, 172, FACING_SOUTH, 0, -1, -1, -1, -1, 0},
{1, CONDITION_ALWAYS, 454, 0, 290, FACING_WEST, 0, -1, -1, -1, -1, 0},
{2, CONDITION_ALWAYS, 454, 0, 443, FACING_WEST, 0, -1, -1, -1, -1, 0},
{3, CONDITION_ALWAYS, 229, 0, 233, FACING_SOUTH, 0, -1, -1, -1, -1, 0},
{4, CONDITION_ALWAYS, 72, 0, 80, FACING_SOUTH, 0, -1, -1, -1, -1, 0},
{6, CONDITION_ALWAYS, 104, 0, 104, FACING_SOUTH, 0, -1, -1, -1, -1, 0},
{10, CONDITION_ALWAYS, 232, 0, 264, FACING_NORTH, 0, -1, -1, -1, -1, 0},
}
@ SCENE_TABLE_END
Definition field_scene.h:43
@ CONDITION_ALWAYS
Definition field_scene.h:44
@ FACING_NORTH
Definition field_scene.h:32
@ FACING_SOUTH
Definition field_scene.h:28
@ FACING_WEST
Definition field_scene.h:30

Definition at line 1076 of file vale_kraden.c.

Referenced by ValeKraden_GetEntrances().

◆ gValeKraden_Exits

u32 gValeKraden_Exits[]
Initial value:
= {
SCENE_EXITS(6), SCENE_EXIT(1, 4, 3), SCENE_EXIT(2, 4, 4),
SCENE_EXIT(3, 8, 2), SCENE_EXIT(4, 93, 1), SCENE_EXIT(6, 93, 3),
SCENE_EXIT(11, 3, 3), SCENE_EXIT(12, 3, 4), SCENE_EXIT(13, 8, 22),
}
#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 1087 of file vale_kraden.c.

Referenced by ValeKraden_GetExits().

◆ gValeKraden_Placements

struct ScenePlacement gValeKraden_Placements[]
Initial value:
= {
PIXELS(232), 0, PIXELS(232), FACING_SOUTH, TALK_FACE_PARTY, 0 },
PIXELS(1608), 0, PIXELS(1608), FACING_NORTH, TALK_FACE_PARTY, 0 },
PIXELS(1608), 0, PIXELS(1608), FACING_NORTH, TALK_FACE_PARTY, 0 },
PIXELS(232), 0, PIXELS(344), FACING_SOUTH + FACING_STEP, 3, 0 },
PIXELS(200), 0, PIXELS(344), FACING_SOUTHEAST + FACING_STEP, 3, 0 },
}
#define GARET
Jerald.
#define JENNA
Jasmine.
@ FACING_STEP
Definition field_scene.h:36
@ TALK_KEEP_FACING
@ TALK_FACE_PARTY
@ TALK_FACE_PARTY_AND_BACK
@ ACTOR_STAND
@ FACING_SOUTHEAST
Definition field_scene.h:27
signed int s32
Definition types.h:14
s32 gValeKraden_RockslideSurvivorSwayActions[]
Alternates the survivor's width and height while he lies by the fence.

Definition at line 1095 of file vale_kraden.c.

Referenced by ValeKraden_GetPlacements().

◆ gValeKraden_Events

struct SceneEvent gValeKraden_Events[]
Initial value:
= {
{ EVENT_TALK, ACTOR_SATUROS, CONDITION_ALWAYS, MSGNO(MsgValeDoNotKeepKradenWaiting) },
{ EVENT_TALK, ACTOR_MENARDI, CONDITION_ALWAYS, MSGNO(MsgValeLeaveBeforeWeChangeMinds) },
}
@ ABILITY_MIND_READ
Definition ability_ids.h:16
@ ABILITY_LIFT
Definition ability_ids.h:18
#define SCENE_EVENTS_END
#define FIND_ITEM(item)
@ EVENT_TOUCH
@ EVENT_EXIT
@ EVENT_TALK
#define PSYNERGY_ON_ACTOR(ability)
#define EVENT_SCRIPT(script)
#define SEARCH(target)
#define TOUCH_WALKING_INTO(facing)
@ SEARCH_JAR
#define FLAG_VALE_KRADEN_JAR_ELIXIR
The jar's Elixir by the cottage; after Kalay it is searchable only from the third patch.
Definition flags.h:456
@ ITEM_ELIXIR
Definition item_ids.h:48
static void Event_OverhearKraden(void)
Walking up to the cottage: Kraden paces, wondering aloud who the strangers were and what they know of...
static void Event_MeetSaturosAndMenardi(void)
Walking past the two strangers: Isaac, Garet and Jenna overhear Saturos and Menardi,...
static void Event_KradenPlansSanctumVisit(void)
Talking to Kraden outside his cottage: he talks Isaac, Garet and Jenna into a secret look at Sol Sanc...
static void Event_EnterCottage(void)
Walking into the cottage: the gate opens unless Kraden left it open.
static void Event_TalkToFenceOnlooker(void)
The child at the fence asks whether Isaac hears the growls beyond it; once the party has left Vale,...
@ ACTOR_FENCE_ONLOOKER
Definition vale_kraden.c:42

Definition at line 1121 of file vale_kraden.c.

Referenced by ValeKraden_GetEvents().

◆ gValeKraden_StormEvents

struct SceneEvent gValeKraden_StormEvents[]
Initial value:
= {
{ EVENT_TALK, ACTOR_WEST_ROCK, CONDITION_ALWAYS, MSGNO(MsgValeRockCannotBeMoved) },
{ EVENT_TALK, ACTOR_EAST_ROCK, CONDITION_ALWAYS, MSGNO(MsgValeRockCannotBeMoved) },
}
#define FLAG_VALE_ROCKSLIDE_SURVIVOR_GAVE_UP
The man hurt in the rockslide believes he will die.
Definition flags.h:447
#define FLAG_VALE_STORM_FIRST_MONSTER_FOUGHT
Definition flags.h:450
#define FLAG_VALE_STORM_SECOND_MONSTER_FOUGHT
Definition flags.h:451
static void Event_FightSecondMonster(void)
On the stormy night, a second monster attacks by the broken fence.
static void Event_TalkToRockslideSurvivor(void)
The man hurt in the rockslide asks whether he will die: yes, and he gives up; no, and he finds he is ...
static void Event_FightFirstMonster(void)
On the stormy night, a monster attacks by the broken fence.
@ ACTOR_ROCKSLIDE_SURVIVOR
Definition vale_kraden.c:41
@ ACTOR_WEST_ROCK
The west rock. "It's a huge rock that Isaac's strength can't even budge.".
Definition vale_kraden.c:39
@ ACTOR_EAST_ROCK
Definition vale_kraden.c:40

Definition at line 1139 of file vale_kraden.c.

Referenced by ValeKraden_GetEvents().

◆ gValeKraden_EventsAfterKalay

struct SceneEvent gValeKraden_EventsAfterKalay[]
Initial value:
= {
{ EVENT_TALK, ACTOR_FENCE_ONLOOKER, CONDITION_ALWAYS, MSGNO(MsgValeWonderBeyondFence) },
{ PSYNERGY_ON_ACTOR(ABILITY_MIND_READ), ACTOR_FENCE_ONLOOKER, CONDITION_ALWAYS, MSGNO(MsgValeAdventuresBeyondFence) },
}
static void Event_TalkToCottageVisitor(void)
After the party has reached Kalay, a villager at the cottage asks Isaac about his memories of it.
@ ACTOR_COTTAGE_VISITOR
Definition vale_kraden.c:46

Definition at line 1152 of file vale_kraden.c.

Referenced by ValeKraden_GetEvents().

◆ gValeKraden_GateCells

u16 gValeKraden_GateCells[]
Initial value:
= {
MAP_CELL_STEP(2, 36, 2, 2, 1),
MAP_CELL_STEP(4, 36, 2, 2, 1),
}
#define MAP_CELL_STEP(srcX, srcY, width, height, frames)
Definition field_event.h:59
#define MAP_CELL_STEPS_END
Definition field_event.h:61

Definition at line 1170 of file vale_kraden.c.

Referenced by Event_EnterCottage(), Event_KradenPlansSanctumVisit(), and Event_KradenSetsOff().