Skip to Content
The Alchemy Project

src/scene/suhalla_gate.c

Suhalla Gate and Gateway Cave, the rocky pass Babi's soldiers guard on the way from the Suhalla Desert to Lalivero and Venus Lighthouse. More…

Macros

NameDescription
#defineFLAG_GATEWAY_CAVE_PSYNERGY_STONE FLAG_AREA_TEMP(0x50)Gateway Cave's Psynergy Stone has been found.
#defineSUHALLA_GATE_RETREAT_MAP (currentMap) (SCENE_SUHALLA_GATE_CHECKPOINT)

Enumerations

NameDescription
enumSUHALLA_GATE_METATILE_BEHAVIOR { METATILE_BEHAVIOR_SUHALLA_GATE_APPROACH, METATILE_BEHAVIOR_S … }The metatile behaviors the pass's cues answer besides its exits, whose metatiles carry the numbers of the exits they lead to: the approach to Suhalla Gate, (7, 26) to (9, 27), where the guards block the way or Iodem finds them wounded, the Mint's chest in the cliffs beyond, and Gateway Cave's Psynergy Stone.
enumanonymous enum { SOLDIER_ANIMATION_LIE_WOUNDED }SPRITE_SOLDIER's animation lying on his side, held (soldier.tsv).
enumSUHALLA_GATE_CHECKPOINT_ACTOR_ID { ACTOR_WEST_GUARD, ACTOR_EAST_GUARD, ACTOR_VANISHING_SOLDIER, … }The actors of the gate itself (SuhallaGateCheckpoint), numbered in the order of SuhallaGateCheckpointActorPlacements and, after Babi's audience, of SuhallaGateCheckpointActorPlacementsAfterColosso.
enumSUHALLA_GATE_DEW_ACTOR_ID { ACTOR_FIRST_SPROUT, ACTOR_DEW, ACTOR_EIGHTH_PLACED }The actors of the second scene (SuhallaGateDew), numbered in the order of SuhallaGateDewActorPlacements.
enumanonymous enum { SOLDIER_SLOW_BLINKS, SOLDIER_FAST_BLINKS }The vanishing soldier's blinks: slow ones, four ticks shown and four hidden, then fast ones, two and two.

Functions

NameDescription
static voidscSuhallaGateFightDew (void)Talking to Dew, the Mercury Djinni at the foot of the third slide in the cliffs' east part beyond Suhalla Gate (metatile (16, 55)), starts its battle.
const SCENE_ENTRANCE *scGetEntrances (void)The six rooms share one entrance table.
const SCENE_EXIT_REGION *scGetExitRegions (void)The scene has no exit regions: its regions entry returns none.
const Uint32 *scGetExits (void)Both scenes share one exit table.
const ACTOR_PLACE *scGetActorPlacements (void)Suhalla Gate's guards, standing or wounded, or Dew and the vines of the cliffs beyond.
const CUE *scGetCues (void)The scripts of the cliffs beyond the gate, of Gateway Cave, or of the gate itself for any other scene.
Sint32scInit (void)Sets up whichever of the pass's scenes is entered: after the attack a defeat leads back to the house past the gate, the gate remembers which way the party came in, and the cliffs' vines are drawn grown.
static voidscSuhallaGateEnterHouse (void)Walking north into the door in the cliff just past Suhalla Gate (metatile (8, 18)) opens it and takes the party into the house.
static voidscSuhallaGateLeaveForWorldMap (void)Walking off Suhalla Gate's map, south down the path to the desert or east toward Venus Lighthouse, leaves for the World Map, and the gate forgets which way the party came in.
static voidscSuhallaGateGuardsBlockPassage (void)Before Babi's audience, stepping up to Suhalla Gate (metatiles (7, 26) to (9, 27)) makes the two guards, who stand either side of its opening, step together in front of it and face the party, blocking the way north.
static voidscSuhallaGateIodemQuestionsGuards (void)After Babi's audience, stepping up to Suhalla Gate (metatiles (7, 26) to (9, 27)) finds the two guards lying wounded before it; Iodem steps out of the party and demands to know what happened.
static voidscSuhallaGateTalkToEastGuard (void)Talking to the east guard at Suhalla Gate: before Babi's audience he asks whether the party wants to go to Babi Lighthouse, and a yes gets a demand for travel papers, a no a scoff.
static voidscSuhallaGateSoldierVanishes (void)The wounded soldier on the path out toward Venus Lighthouse, talked to or read with Mind Read, gasps that Venus Lighthouse was attacked by strange wanderers, then blinks out and is gone (metatile (29, 19)).

Variables

Description

Suhalla Gate and Gateway Cave, the rocky pass Babi's soldiers guard on the way from the Suhalla Desert to Lalivero and Venus Lighthouse.

Three scenes share this overlay, in the order the pass is crossed:

  • SuhallaGateCheckpoint (area name Suhalla Gate): the gate itself, a palisade of logs across the path north from the desert, with a house in the cliff just past it (rock_rooms.c). The same map holds, in its own part to the east, the pass's way out toward Venus Lighthouse. Two soldiers keep the gate.
  • SuhallaGateDew (area name Suhalla Gate): the cliffs beyond the gate, a west part and an east part joined by a path. In the west part the first slide down leads to a chest with a Mint; in the east part the third slide from the west leads down to Dew, the Mercury Djinni, and green vines climb back up the cliffs.
  • Gateway Cave (area name Gateway Cave): a cave entered from the cliffs' east part, two rooms that lead out onto the World Map, with a Psynergy Stone.

Before Babi's audience after Colosso the guards turn the party away for want of travel papers: stepping up to the gate (metatiles (7, 26) to (9, 27)) brings them together in front of its opening (scSuhallaGateGuardsBlockPassage).

After the audience the party comes with Iodem and finds them lying wounded before the gate, and a third soldier lying on the path out toward Venus Lighthouse. Iodem's actor waits out of sight. Stepping up to the gate then plays scSuhallaGateIodemQuestionsGuards once (FLAG_SUHALLA_GATE_ATTACK_SEEN), after which a defeat returns the party to the house past the gate.

The third soldier, talked to or read, gasps that Venus Lighthouse was attacked and fades away for good (scSuhallaGateSoldierVanishes, FLAG_SUHALLA_GATE_SOLDIER_VANISHED).

scInit remembers which side of the gate the party came in by (FLAG_SUHALLA_GATE_ENTERED_FROM_SOUTH, FLAG_SUHALLA_GATE_ENTERED_FROM_EAST), so that Retreat from the house leads back out that way. Leaving for the World Map forgets it.

In the French, Spanish and Italian editions the wounded soldiers lie without collision, and the metatiles under them are taken off the path instead.

Gateway Cave's Psynergy Stone is kept in an area flag (FLAG_GATEWAY_CAVE_PSYNERGY_STONE), so it is back whenever the party returns from another area.

Macros in detail

FLAG_GATEWAY_CAVE_PSYNERGY_STONE

#define FLAG_GATEWAY_CAVE_PSYNERGY_STONE FLAG_AREA_TEMP(0x50)

Gateway Cave's Psynergy Stone has been found. It is an area flag, so the stone is back once the party returns from another area.

Referenced by GatewayCaveCues.

Definition at line 70 of file suhalla_gate.c.

SUHALLA_GATE_RETREAT_MAP

#define SUHALLA_GATE_RETREAT_MAP(currentMap) (SCENE_SUHALLA_GATE_CHECKPOINT)

#define SUHALLA_GATE_RETREAT_MAP(currentMap) (currentMap)

Referenced by scInit().

Definition at lines 94 and 96 of file suhalla_gate.c.

Enumerations in detail

SUHALLA_GATE_METATILE_BEHAVIOR

enum SUHALLA_GATE_METATILE_BEHAVIOR

The metatile behaviors the pass's cues answer besides its exits, whose metatiles carry the numbers of the exits they lead to: the approach to Suhalla Gate, (7, 26) to (9, 27), where the guards block the way or Iodem finds them wounded, the Mint's chest in the cliffs beyond, and Gateway Cave's Psynergy Stone.

EnumeratorValueDescription
METATILE_BEHAVIOR_SUHALLA_GATE_APPROACH10
METATILE_BEHAVIOR_SUHALLA_GATE_MINT_CHEST100
METATILE_BEHAVIOR_GATEWAY_CAVE_PSYNERGY_STONE100

Definition at line 77 of file suhalla_gate.c.

anonymous enum

enum { SOLDIER_ANIMATION_LIE_WOUNDED }

SPRITE_SOLDIER's animation lying on his side, held (soldier.tsv).

EnumeratorValueDescription
SOLDIER_ANIMATION_LIE_WOUNDED5

Definition at line 85 of file suhalla_gate.c.

SUHALLA_GATE_CHECKPOINT_ACTOR_ID

enum SUHALLA_GATE_CHECKPOINT_ACTOR_ID

The actors of the gate itself (SuhallaGateCheckpoint), numbered in the order of SuhallaGateCheckpointActorPlacements and, after Babi's audience, of SuhallaGateCheckpointActorPlacementsAfterColosso.

EnumeratorValueDescription
ACTOR_WEST_GUARDACTOR_FIRST_PLACEDThe two of Babi's soldiers who keep the gate, standing before Babi's audience and lying wounded after it. The west guard says only those with travel papers may pass, and later asks the party to send help from Babi Lighthouse.
ACTOR_EAST_GUARDAsks whether the party wants to go to Babi Lighthouse.
ACTOR_VANISHING_SOLDIERAfter Babi's audience, the soldier lying on the path out toward Venus Lighthouse, who tells of the attack on it and vanishes.
ACTOR_IODEMAfter Babi's audience, out of sight until scSuhallaGateIodemQuestionsGuards brings him out of the party.

Definition at line 102 of file suhalla_gate.c.

SUHALLA_GATE_DEW_ACTOR_ID

enum SUHALLA_GATE_DEW_ACTOR_ID

The actors of the second scene (SuhallaGateDew), numbered in the order of SuhallaGateDewActorPlacements.

EnumeratorValueDescription
ACTOR_FIRST_SPROUTACTOR_FIRST_PLACEDFive green vines up the cliffs, drawn with the sprout Growth grows (SPRITE_SPROUT), three fully grown and two half grown.
ACTOR_DEWACTOR_FIRST_SPROUT + 5A Mercury Djinni.
ACTOR_EIGHTH_PLACEDACTOR_FIRST_PLACED + 7The eighth placed actor, where the scene places six: scInit stretches it all the same.

Definition at line 125 of file suhalla_gate.c.

anonymous enum

enum { SOLDIER_SLOW_BLINKS, SOLDIER_FAST_BLINKS }

The vanishing soldier's blinks: slow ones, four ticks shown and four hidden, then fast ones, two and two.

EnumeratorValueDescription
SOLDIER_SLOW_BLINKS6
SOLDIER_FAST_BLINKS12

Definition at line 531 of file suhalla_gate.c.

Functions in detail

scSuhallaGateFightDew

static void scSuhallaGateFightDew(void)

Talking to Dew, the Mercury Djinni at the foot of the third slide in the cliffs' east part beyond Suhalla Gate (metatile (16, 55)), starts its battle.

References fdRequestDjinnBattle().

Referenced by SuhallaGateDewCues.

Definition at line 141 of file suhalla_gate.c.

scGetEntrances

const SCENE_ENTRANCE *scGetEntrances(void)

References GatewayCaveEntrances, MainRoutineStateWork, SuhallaGateCheckpointEntrances and SuhallaGateDewEntrances.

Definition at line 146 of file suhalla_gate.c.

scGetExitRegions

const SCENE_EXIT_REGION *scGetExitRegions(void)

Definition at line 161 of file suhalla_gate.c.

scGetExits

const Uint32 *scGetExits(void)

References SuhallaGateExits.

Definition at line 166 of file suhalla_gate.c.

scGetActorPlacements

const ACTOR_PLACE *scGetActorPlacements(void)

Suhalla Gate's guards, standing or wounded, or Dew and the vines of the cliffs beyond.

References gmFlagGet(), MainRoutineStateWork, SuhallaGateCheckpointActorPlacements, SuhallaGateCheckpointActorPlacementsAfterColosso, SuhallaGateDewActorPlacements and SuhallaGateNoActorPlacements.

Definition at line 173 of file suhalla_gate.c.

scGetCues

const CUE *scGetCues(void)

The scripts of the cliffs beyond the gate, of Gateway Cave, or of the gate itself for any other scene.

References GatewayCaveCues, MainRoutineStateWork, SuhallaGateCheckpointCues and SuhallaGateDewCues.

Definition at line 194 of file suhalla_gate.c.

scInit

Sint32 scInit(void)

Sets up whichever of the pass's scenes is entered: after the attack a defeat leads back to the house past the gate, the gate remembers which way the party came in, and the cliffs' vines are drawn grown.

References fdActorGet(), fdActorSetAnimation(), fdMapGridCopyMetatileAttributes(), gmFlagClear(), gmFlagGet(), gmFlagSet(), MainRoutineStateWork and Sint32.

Definition at line 212 of file suhalla_gate.c.

scSuhallaGateEnterHouse

static void scSuhallaGateEnterHouse(void)

Walking north into the door in the cliff just past Suhalla Gate (metatile (8, 18)) opens it and takes the party into the house.

References fdActorCenterAndWalk(), fdActorGet(), fdMapGridCopyMetatilesTo(), Sint32, syImportScriptSetExitRequest(), sySoundPlay() and sySynch().

Referenced by SuhallaGateCheckpointCues.

Definition at line 301 of file suhalla_gate.c.

scSuhallaGateLeaveForWorldMap

static void scSuhallaGateLeaveForWorldMap(void)

Walking off Suhalla Gate's map, south down the path to the desert or east toward Venus Lighthouse, leaves for the World Map, and the gate forgets which way the party came in.

References gmFlagClear(), syImportScriptSetExitRequest() and sySoundPlay().

Referenced by SuhallaGateCheckpointCues.

Definition at line 319 of file suhalla_gate.c.

scSuhallaGateGuardsBlockPassage

static void scSuhallaGateGuardsBlockPassage(void)

Before Babi's audience, stepping up to Suhalla Gate (metatiles (7, 26) to (9, 27)) makes the two guards, who stand either side of its opening, step together in front of it and face the party, blocking the way north.

References fdActorFaceDirection(), fdActorSetAnimation(), fdActorWalkTo(), fdActorWalkToAndWait(), fdMapGridCopyMetatileAttributes(), fdScriptEnd() and fdScriptStart().

Referenced by SuhallaGateCheckpointCues.

Definition at line 332 of file suhalla_gate.c.

scSuhallaGateIodemQuestionsGuards

static void scSuhallaGateIodemQuestionsGuards(void)

After Babi's audience, stepping up to Suhalla Gate (metatiles (7, 26) to (9, 27)) finds the two guards lying wounded before it; Iodem steps out of the party and demands to know what happened.

They tell of a strange group with no papers and strange powers, Iodem says it must have been Felix, and the guards send the party on after them.

References fdActorFaceDirection(), fdActorGet(), fdActorRunRepeatedMotion(), fdActorSetAttachedEffect(), fdActorSetPosFX(), fdActorShowEmote(), fdActorStartRepeatedMotion(), fdActorWalkToAndWait(), fdMapGridCopyMetatileAttributes(), fdScriptAskYesNo(), fdScriptEnd(), fdScriptSetMessageId(), fdScriptShowMessageThenWait(), fdScriptStart(), fdScriptWait(), gmFlagGet(), gmFlagSet(), scWalkIntoLeader() and sySynch().

Referenced by SuhallaGateCheckpointCues.

Definition at line 362 of file suhalla_gate.c.

scSuhallaGateTalkToEastGuard

static void scSuhallaGateTalkToEastGuard(void)

Talking to the east guard at Suhalla Gate: before Babi's audience he asks whether the party wants to go to Babi Lighthouse, and a yes gets a demand for travel papers, a no a scoff. After it, lying wounded, he says it is a pity a Colosso victor should end up like this and swears to settle the score.

References fdActorSetAnimationAndWait(), fdScriptAskYesNoWithActorAnimation(), fdScriptEnd(), fdScriptOpenMessage(), fdScriptSetMessageId(), fdScriptShowMessage(), fdScriptStart() and gmFlagGet().

Referenced by SuhallaGateCheckpointCues.

Definition at line 493 of file suhalla_gate.c.

scSuhallaGateSoldierVanishes

static void scSuhallaGateSoldierVanishes(void)

The wounded soldier on the path out toward Venus Lighthouse, talked to or read with Mind Read, gasps that Venus Lighthouse was attacked by strange wanderers, then blinks out and is gone (metatile (29, 19)).

References fdActorGet(), fdActorSetSpriteColorById(), fdActorSetSpriteFlags(), fdMapGridCopyMetatileAttributes(), fdScriptEnd(), fdScriptSetMessageId(), fdScriptShowMessageThenWait(), fdScriptStart(), gmFlagSet() and sySynch().

Referenced by SuhallaGateCheckpointCues.

Definition at line 540 of file suhalla_gate.c.

Variables in detail

SuhallaGateCheckpointEntrances

extern SCENE_ENTRANCE SuhallaGateCheckpointEntrances[]

SCENE_ENTRANCE SuhallaGateCheckpointEntrances[]

Referenced by scGetEntrances().

Definition at lines 56 and 612 of file suhalla_gate.c.

SuhallaGateDewEntrances

extern SCENE_ENTRANCE SuhallaGateDewEntrances[]

SCENE_ENTRANCE SuhallaGateDewEntrances[]

Referenced by scGetEntrances().

Definition at lines 57 and 658 of file suhalla_gate.c.

GatewayCaveEntrances

extern SCENE_ENTRANCE GatewayCaveEntrances[]

SCENE_ENTRANCE GatewayCaveEntrances[]

Referenced by scGetEntrances().

Definition at lines 58 and 697 of file suhalla_gate.c.

SuhallaGateExits

extern Uint32 SuhallaGateExits[]

Uint32 SuhallaGateExits[]

Referenced by scGetExits().

Definition at lines 59 and 729 of file suhalla_gate.c.

SuhallaGateNoActorPlacements

extern ACTOR_PLACE SuhallaGateNoActorPlacements[]

ACTOR_PLACE SuhallaGateNoActorPlacements[]

Referenced by scGetActorPlacements().

Definition at lines 60 and 770 of file suhalla_gate.c.

SuhallaGateDewActorPlacements

extern ACTOR_PLACE SuhallaGateDewActorPlacements[]

ACTOR_PLACE SuhallaGateDewActorPlacements[]

Referenced by scGetActorPlacements().

Definition at lines 61 and 775 of file suhalla_gate.c.

SuhallaGateCheckpointActorPlacements

extern ACTOR_PLACE SuhallaGateCheckpointActorPlacements[]

ACTOR_PLACE SuhallaGateCheckpointActorPlacements[]

Referenced by scGetActorPlacements().

Definition at lines 62 and 791 of file suhalla_gate.c.

SuhallaGateCheckpointActorPlacementsAfterColosso

extern ACTOR_PLACE SuhallaGateCheckpointActorPlacementsAfterColosso[]

ACTOR_PLACE SuhallaGateCheckpointActorPlacementsAfterColosso[]

References Sint32, SuhallaGateWounded and SuhallaGateWoundedFlipped.

Referenced by scGetActorPlacements().

Definition at lines 63 and 799 of file suhalla_gate.c.

SuhallaGateCheckpointCues

extern CUE SuhallaGateCheckpointCues[]

CUE SuhallaGateCheckpointCues[]

References scSuhallaGateEnterHouse(), scSuhallaGateGuardsBlockPassage(), scSuhallaGateIodemQuestionsGuards(), scSuhallaGateLeaveForWorldMap(), scSuhallaGateSoldierVanishes() and scSuhallaGateTalkToEastGuard().

Referenced by scGetCues().

Definition at lines 64 and 820 of file suhalla_gate.c.

SuhallaGateDewCues

extern CUE SuhallaGateDewCues[]

CUE SuhallaGateDewCues[]

References scSuhallaGateFightDew().

Referenced by scGetCues().

Definition at lines 65 and 855 of file suhalla_gate.c.

GatewayCaveCues

extern CUE GatewayCaveCues[]

CUE GatewayCaveCues[]

Referenced by scGetCues().

Definition at lines 66 and 884 of file suhalla_gate.c.

SuhallaGateWoundedNoCollision

Sint32 SuhallaGateWoundedNoCollision[]

References Sint32.

Definition at line 590 of file suhalla_gate.c.

SuhallaGateWounded

Sint32 SuhallaGateWounded[]

References Sint32.

Referenced by SuhallaGateCheckpointActorPlacementsAfterColosso.

Definition at line 595 of file suhalla_gate.c.

SuhallaGateWoundedFlippedNoCollision

Sint32 SuhallaGateWoundedFlippedNoCollision[]

References Sint32.

Definition at line 601 of file suhalla_gate.c.

SuhallaGateWoundedFlipped

Sint32 SuhallaGateWoundedFlipped[]

References Sint32.

Referenced by SuhallaGateCheckpointActorPlacementsAfterColosso.

Definition at line 606 of file suhalla_gate.c.