src/scene/kolima_forest_entrance.c
Kolima Forest (SceneIdKolimaForestEntrance), the first of the forest's five scenes, entered from the World Map (KOLIMA_FOREST_ENTRANCE_WORLD_MAP). More…
#include "flags.h"#include "battle/battle.h"#include "debug/debug.h"#include "field/actor_script.h"#include "field/script.h"#include "graphics/graphics.h"#include "scene/kolima.h"#include "scene/kolima_curse_dust.h"#include "text/msg_ids.h"#include "shared/pushed_actor.c"#include "shared/kolima_jump.c"#include "shared/kolima_grow.c"#include "shared/kolima_blink.c"#include "shared/kolima_curse_dust.c"#include "shared/pushed_actor_tables.c"#include "shared/kolima_squash.c"#include "shared/kolima_sparkle_burst_script.c"
Macros
| Name | Description | |
|---|---|---|
#define | FLAG_KOLIMA_FOREST_ENTRANCE_LOG_IN_RIVER FLAG_SCENE_TEMP(0x00) | The river log has tipped into the river and floats there as ground the party can cross. |
#define | RIVER_EDGE_COLUMN 20 | The column at the water's edge, where the river log pushed west tips in. |
Enumerations
| Name | Description | |
|---|---|---|
enum | anonymous enum { ACTOR_FIRST_LOG, ACTOR_RIVER_LOG, ACTOR_TRET, ACTOR_LAUREL, … } | The scene's actors after Garet's, Ivan's and Mia's party slots, numbering the rows of KolimaForestEntranceActorPlacements from ACTOR_FIRST_PLACED. |
Functions
| Name | Description | |
|---|---|---|
static void | scKolimaForestEntranceWitnessForestCurse (void) | In Kolima Forest, on the first entry from the World Map before the curse has been seen in Kolima (FLAG_KOLIMA_CURSE_WITNESSED clear), the party sees the curse fall. |
static void | scKolimaForestEntranceShowMessageAndWait (Sint32 speaker, Sint32 ticks) | Shows the script's next message at speaker, then waits ticks. |
static void | scKolimaForestEntranceFaceActorAndWait (Sint32 actorId, Sint32 facing, Sint32 waitTicks) | Turns an actor at once, then leaves time for the next beat. |
static void | scKolimaForestEntranceSpawnCurseSparkle (void) | Every eighth tick a sparkle of Tret's glamour (SPRITE_GOLDEN_RINGS) falls toward the party, with its tinkle while the rain is at its height. |
static void | scKolimaForestEntranceFlickerPsynergyFields (void) | Each tick the Psynergy fields flicker: two show on even ticks and two on odd, the hidden ones lifted 500 pixels out of sight. |
static Sint32 | scKolimaForestEntranceFlashHitPsynergyFields (ACTOR *actor) | The end of a field's growing: if a sparkle has burst on a field, the field takes its next pose. |
static Sint32 | scKolimaForestEntranceTwinkleGroundSparkle (ACTOR *actor) | Each tick, a ground sparkle's timer runs on at random. |
const SCENE_ENTRANCE * | scGetEntrances (void) | Where the party enters, from the next scene of the forest (SceneIdKolimaForestGlade) and from the World Map. |
const SCENE_EXIT_REGION * | scGetExitRegions (void) | The scene has no exit regions: its regions entry returns none. |
const Uint32 * | scGetExits (void) | The ways on into the forest (SceneIdKolimaForestGlade) and back to the World Map. |
const ACTOR_PLACE * | scGetActorPlacements (void) | The party's companions, the logs, Tret, Laurel, the Psynergy fields and the ground sparkles. |
static void | scKolimaForestEntrancePushLog (void) | In Kolima Forest (SceneIdKolimaForestEntrance), walking into a log rolls it ahead until something stops it. |
const CUE * | scGetCues (void) | The logs, the hop east from the bank and the two ways out. |
Sint32 | scInit (void) | On entry a log already in the river floats there again and the logs mark the metatiles they cover. |
static Sint32 | scKolimaForestEntranceBurstOnPsynergyField (ACTOR *sparkle) | The end of a sparkle's fall: one that lands on a field (the Psynergy fields' area, which differs with Mia) bursts with a sound, and the Psynergy fields are told. |
Variables
| Name | Description | |
|---|---|---|
extern Sint32 | KolimaForestEntranceGaretAction [] | Garet, Ivan and Mia walk to their places beside the leader. |
extern Sint32 | KolimaForestEntranceIvanAction [] | |
extern Sint32 | KolimaForestEntranceMiaAction [] | |
extern Sint32 | KolimaForestEntrancePsynergyFieldGrowAction [] | A field grows from a tenth of its size over 70 ticks. |
extern Sint32 | KolimaForestEntrancePsynergyFieldShrinkAction [] | A field sinks and shrinks away over 90 ticks. |
extern Sint32 | KolimaForestEntranceGroundSparkleAction [] | |
extern SCENE_ENTRANCE | KolimaForestEntranceEntrances [] | |
extern Uint32 | KolimaForestEntranceExits [] | On into the forest (SceneIdKolimaForestGlade) and out to the World Map (SceneIdWorldMap), with two exits no cue uses back into this scene. |
extern ACTOR_PLACE | KolimaForestEntranceActorPlacements [] | Garet, Ivan and Mia for the curse; the three logs; Tret and Laurel; the four Psynergy fields; and the five ground sparkles. |
extern CUE | KolimaForestEntranceCues [] | |
extern Sint32 | KolimaForestEntranceSparkleScript [] | |
Sint32 | KolimaForestEntrancePsynergyFieldHit | The same state in Kolima Forest's entrance (kolima_forest_entrance.c). |
Sint32 | KolimaForestEntranceMiaInParty | Whether Mia was in the party as the curse struck. |
Sint32 | KolimaForestEntranceSparkleSoundOn | Nonzero while the curse's sparkles fall with their sound. |
Sint32 | KolimaCurseDustScript [] | A speck of the curse dust falls, flickering, two pixels a tick and then one, and bursts if it lands on a Psynergy field (scKolimaBurstOnPsynergyField). |
Description
Kolima Forest (SceneIdKolimaForestEntrance), the first of the forest's five
scenes, entered from the World Map (KOLIMA_FOREST_ENTRANCE_WORLD_MAP).
If the party comes here before it has been to Kolima, the curse's script
plays here instead of in the village
(scKolimaForestEntranceWitnessForestCurse, until
FLAG_KOLIMA_CURSE_WITNESSED). Sparkles of Tret's glamour rain down, fields of
the party's own Psynergy shield it, and Tret and Laurel, unseen, speak of the
dying forest. Five sparkles lie on the ground until Tret lifts the curse
(FLAG_KOLIMA_CURSE_LIFTED).
The fields flicker. The leader's and Mia's show on even ticks and Ivan's and
Garet's on odd ones, each lifted out of sight on the others
(scKolimaForestEntranceFlickerPsynergyFields). A sparkle bursts where it
lands only inside the boxes scKolimaForestEntranceBurstOnPsynergyField tests,
two with Mia in the party and three without her.
Three logs lie here, rolled by walking into them. The one pushed west to the
water's edge tips into the river and floats there, metatiles the party can
cross. From the bank the leader can hop east (step cue 11,
scKolimaForestHopEast).
KOLIMA_FOREST_ENTRANCE_TO_KOLIMA_FOREST_GLADE leads on into the forest
(SceneIdKolimaForestGlade), and KOLIMA_FOREST_ENTRANCE_WORLD_MAP back to
the World Map.
FLAG_KOLIMA_FOREST_ENTRANCE_LOG_IN_RIVER: the log is in the river. Like every
scene temp flag it is cleared when the party next comes in, so the log is
back on the bank, but a battle keeps it.
Macros in detail
FLAG_KOLIMA_FOREST_ENTRANCE_LOG_IN_RIVER
#define FLAG_KOLIMA_FOREST_ENTRANCE_LOG_IN_RIVER FLAG_SCENE_TEMP(0x00)
The river log has tipped into the river and floats there as ground the party can cross.
Referenced by scInit() and scKolimaForestEntrancePushLog().
Definition at line 86 of file kolima_forest_entrance.c.
RIVER_EDGE_COLUMN
#define RIVER_EDGE_COLUMN 20
The column at the water's edge, where the river log pushed west tips in.
Referenced by scKolimaForestEntrancePushLog().
Definition at line 89 of file kolima_forest_entrance.c.
Enumerations in detail
anonymous enum
enum { ACTOR_FIRST_LOG, ACTOR_RIVER_LOG, ACTOR_TRET, ACTOR_LAUREL, … }
The scene's actors after Garet's, Ivan's and Mia's party slots, numbering the
rows of KolimaForestEntranceActorPlacements from ACTOR_FIRST_PLACED.
| Enumerator | Value | Description |
|---|---|---|
ACTOR_FIRST_LOG | ACTOR_FIRST_PLACED | The three logs. The last is the one |
ACTOR_RIVER_LOG | ACTOR_FIRST_LOG + 2 | that can reach the river. |
ACTOR_TRET | Tret's wrathful side, unseen while the curse falls. | |
ACTOR_LAUREL | Unseen while the curse falls. | |
ACTOR_LEADER_PSYNERGY_FIELD | The fields of Psynergy, one over each party member. Mia's only with Mia. | |
ACTOR_IVAN_PSYNERGY_FIELD | ||
ACTOR_MIA_PSYNERGY_FIELD | ||
ACTOR_GARET_PSYNERGY_FIELD | ||
ACTOR_FIRST_GROUND_SPARKLE | The sparkles of Tret's glamour on the ground, | |
ACTOR_LAST_GROUND_SPARKLE | ACTOR_FIRST_GROUND_SPARKLE + 4 | gone once the curse is lifted. |
Definition at line 55 of file kolima_forest_entrance.c.
Functions in detail
scKolimaForestEntranceWitnessForestCurse
static void scKolimaForestEntranceWitnessForestCurse(void)
In Kolima Forest, on the first entry from the World Map before the curse has
been seen in Kolima (FLAG_KOLIMA_CURSE_WITNESSED clear), the party sees the
curse fall. It is the same script as scKolimaWitnessForestCurse without the
trees that were people.
References fdActorFaceDirection(), fdActorGet(), fdActorJump(), fdActorRunRepeatedMotion(), fdActorRunScriptAndWait(), fdActorSetAnimation(), fdActorSetAnimationAndWait(), fdActorSetAttachedEffect(), fdActorSetDestination(), fdActorSetDestinationOffset(), fdActorSetPosFX(), fdActorSetScript(), fdActorSetSpriteFlags(), fdActorSetSpritePriority(), fdActorShowEmote(), fdActorStartRepeatedMotion(), fdActorStop(), fdActorWaitForMoveById(), fdActorWaitForScriptEndById(), fdActorWalkToAndWait(), fdMapGridCenterOnFollowedPoint(), fdPaletteFadeApplyTarget(), fdPaletteFadeStartInterpolation(), fdScriptAskYesNoWithActorAnimation(), fdScriptEnd(), fdScriptOpenMessage(), fdScriptSetMessageId(), fdScriptShowMessage(), fdScriptStart(), fdScriptStartScreenTransition(), fdScriptWait(), fdScriptWaitTransitionTicks(), gmFlagGet(), gmFlagSet(), gmPlayMusic(), KolimaCurseDustOffset, KolimaCurseDustState, KolimaCurseDustWidth, KolimaForestEntranceGaretAction, KolimaForestEntranceGroundSparkleAction, KolimaForestEntranceIvanAction, KolimaForestEntranceMiaAction, KolimaForestEntranceMiaInParty, KolimaForestEntrancePsynergyFieldGrowAction, KolimaForestEntrancePsynergyFieldHit, KolimaForestEntrancePsynergyFieldShrinkAction, KolimaForestEntranceSparkleSoundOn, KolimaPartyRestoreScaleScript, KolimaPartySquashScript, scKolimaForestEntranceFaceActorAndWait() and 9 more.
Referenced by scInit().
Definition at lines 73 and 223 of file kolima_forest_entrance.c.
scKolimaForestEntranceShowMessageAndWait
static void scKolimaForestEntranceShowMessageAndWait(Sint32 speaker, Sint32 ticks)
Shows the script's next message at speaker, then waits ticks.
References fdScriptShowMessage(), fdScriptWait() and Sint32.
Referenced by scKolimaForestEntranceWitnessForestCurse().
Definition at lines 74 and 1193 of file kolima_forest_entrance.c.
scKolimaForestEntranceFaceActorAndWait
static void scKolimaForestEntranceFaceActorAndWait(Sint32 actorId, Sint32 facing, Sint32 waitTicks)
Turns an actor at once, then leaves time for the next beat.
References fdActorFaceDirection(), fdScriptWait() and Sint32.
Referenced by scKolimaForestEntranceWitnessForestCurse().
Definition at lines 76 and 1201 of file kolima_forest_entrance.c.
scKolimaForestEntranceSpawnCurseSparkle
static void scKolimaForestEntranceSpawnCurseSparkle(void)
Every eighth tick a sparkle of Tret's glamour (SPRITE_GOLDEN_RINGS) falls
toward the party, with its tinkle while the rain is at its height.
References fdActorSelectAnimation(), fdActorStartScript(), KolimaForestEntranceSparkleScript, KolimaForestEntranceSparkleSoundOn, scFieldActorCreate(), scFieldActorSetMoveTargetFX(), Sint32, sySoundPlay() and TickCount.
Referenced by scKolimaForestEntranceWitnessForestCurse().
Definition at lines 79 and 1213 of file kolima_forest_entrance.c.
scKolimaForestEntranceFlickerPsynergyFields
static void scKolimaForestEntranceFlickerPsynergyFields(void)
Each tick the Psynergy fields flicker: two show on even ticks and two on odd, the hidden ones lifted 500 pixels out of sight.
References fdActorGet() and TickCount.
Referenced by scKolimaForestEntranceWitnessForestCurse().
Definition at lines 80 and 1290 of file kolima_forest_entrance.c.
scKolimaForestEntranceFlashHitPsynergyFields
static Sint32 scKolimaForestEntranceFlashHitPsynergyFields(ACTOR *actor)
The end of a field's growing: if a sparkle has burst on a field, the field takes its next pose.
References fdActorSelectAnimation(), KolimaForestEntrancePsynergyFieldHit and Sint32.
Referenced by KolimaForestEntrancePsynergyFieldGrowAction.
Definition at line 93 of file kolima_forest_entrance.c.
scKolimaForestEntranceTwinkleGroundSparkle
static Sint32 scKolimaForestEntranceTwinkleGroundSparkle(ACTOR *actor)
Each tick, a ground sparkle's timer runs on at random.
References fdActorSetSpriteColor() and Sint32.
Referenced by KolimaForestEntranceGroundSparkleAction.
Definition at line 105 of file kolima_forest_entrance.c.
scGetEntrances
const SCENE_ENTRANCE *scGetEntrances(void)
Where the party enters, from the next scene of the forest
(SceneIdKolimaForestGlade) and from the World Map.
References KolimaForestEntranceEntrances.
Definition at line 121 of file kolima_forest_entrance.c.
scGetExitRegions
const SCENE_EXIT_REGION *scGetExitRegions(void)
Definition at line 126 of file kolima_forest_entrance.c.
scGetExits
const Uint32 *scGetExits(void)
The ways on into the forest (SceneIdKolimaForestGlade) and back to the World
Map.
References KolimaForestEntranceExits.
Definition at line 133 of file kolima_forest_entrance.c.
scGetActorPlacements
const ACTOR_PLACE *scGetActorPlacements(void)
The party's companions, the logs, Tret, Laurel, the Psynergy fields and the ground sparkles.
References KolimaForestEntranceActorPlacements.
Definition at line 140 of file kolima_forest_entrance.c.
scKolimaForestEntrancePushLog
static void scKolimaForestEntrancePushLog(void)
In Kolima Forest (SceneIdKolimaForestEntrance), walking into a log rolls it
ahead until something stops it.
References fdActorGet(), fdActorSetAnimation(), fdActorSetDestinationOffset(), fdActorSetSpriteFlags(), fdMapGridCopyMetatileAttributes(), fdScriptEnd(), fdScriptStart(), fdScriptWait(), gmFlagSet(), scMapGridFillCollisionRectangle(), scPushedActorFindClearPos(), scPushedActorRoll() and sySoundPlay().
Referenced by KolimaForestEntranceCues.
Definition at line 147 of file kolima_forest_entrance.c.
scGetCues
const CUE *scGetCues(void)
The logs, the hop east from the bank and the two ways out.
References KolimaForestEntranceCues.
Definition at line 181 of file kolima_forest_entrance.c.
scInit
Sint32 scInit(void)
On entry a log already in the river floats there again and the logs mark the metatiles they cover.
References fdActorGet(), fdActorSetSpriteFlags(), fdMapGridCopyMetatileAttributes(), gmFlagGet(), MainRoutineStateWork, scKolimaForestEntranceWitnessForestCurse(), scMapGridFillCollisionRectangle(), scPushedActorBlockFootprint() and Sint32.
Definition at line 188 of file kolima_forest_entrance.c.
scKolimaForestEntranceBurstOnPsynergyField
static Sint32 scKolimaForestEntranceBurstOnPsynergyField(ACTOR *sparkle)
The end of a sparkle's fall: one that lands on a field (the Psynergy fields' area, which differs with Mia) bursts with a sound, and the Psynergy fields are told.
References fdActorStartScript(), KolimaForestEntranceMiaInParty, KolimaForestEntrancePsynergyFieldHit, KolimaSparkleBurstScript, Sint32 and sySoundPlay().
Referenced by KolimaCurseDustScript.
Definition at line 1246 of file kolima_forest_entrance.c.
Variables in detail
KolimaForestEntranceGaretAction
extern Sint32 KolimaForestEntranceGaretAction[]
Sint32 KolimaForestEntranceGaretAction[]
Garet, Ivan and Mia walk to their places beside the leader.
References Sint32.
Referenced by scKolimaForestEntranceWitnessForestCurse().
Definition at lines 41 and 1351 of file kolima_forest_entrance.c.
KolimaForestEntranceIvanAction
extern Sint32 KolimaForestEntranceIvanAction[]
Sint32 KolimaForestEntranceIvanAction[]
References Sint32.
Referenced by scKolimaForestEntranceWitnessForestCurse().
Definition at lines 42 and 1360 of file kolima_forest_entrance.c.
KolimaForestEntranceMiaAction
extern Sint32 KolimaForestEntranceMiaAction[]
Sint32 KolimaForestEntranceMiaAction[]
References Sint32.
Referenced by scKolimaForestEntranceWitnessForestCurse().
Definition at lines 43 and 1369 of file kolima_forest_entrance.c.
KolimaForestEntrancePsynergyFieldGrowAction
extern Sint32 KolimaForestEntrancePsynergyFieldGrowAction[]
Sint32 KolimaForestEntrancePsynergyFieldGrowAction[]
A field grows from a tenth of its size over 70 ticks.
References scKolimaForestEntranceFlashHitPsynergyFields() and Sint32.
Referenced by scKolimaForestEntranceWitnessForestCurse().
Definition at lines 44 and 1381 of file kolima_forest_entrance.c.
KolimaForestEntrancePsynergyFieldShrinkAction
extern Sint32 KolimaForestEntrancePsynergyFieldShrinkAction[]
Sint32 KolimaForestEntrancePsynergyFieldShrinkAction[]
A field sinks and shrinks away over 90 ticks.
References Sint32.
Referenced by scKolimaForestEntranceWitnessForestCurse().
Definition at lines 45 and 1395 of file kolima_forest_entrance.c.
KolimaForestEntranceGroundSparkleAction
extern Sint32 KolimaForestEntranceGroundSparkleAction[]
Sint32 KolimaForestEntranceGroundSparkleAction[]
References scKolimaForestEntranceTwinkleGroundSparkle() and Sint32.
Referenced by scKolimaForestEntranceWitnessForestCurse().
Definition at lines 46 and 1407 of file kolima_forest_entrance.c.
KolimaForestEntranceEntrances
extern SCENE_ENTRANCE KolimaForestEntranceEntrances[]
SCENE_ENTRANCE KolimaForestEntranceEntrances[]
Referenced by scGetEntrances().
Definition at lines 47 and 1417 of file kolima_forest_entrance.c.
KolimaForestEntranceExits
extern Uint32 KolimaForestEntranceExits[]
Uint32 KolimaForestEntranceExits[]
On into the forest (SceneIdKolimaForestGlade) and out to the World Map
(SceneIdWorldMap), with two exits no cue uses back into this scene.
Referenced by scGetExits().
Definition at lines 48 and 1450 of file kolima_forest_entrance.c.
KolimaForestEntranceActorPlacements
extern ACTOR_PLACE KolimaForestEntranceActorPlacements[]
ACTOR_PLACE KolimaForestEntranceActorPlacements[]
Garet, Ivan and Mia for the curse; the three logs; Tret and Laurel; the four Psynergy fields; and the five ground sparkles.
Referenced by scGetActorPlacements().
Definition at lines 49 and 1470 of file kolima_forest_entrance.c.
KolimaForestEntranceCues
extern CUE KolimaForestEntranceCues[]
CUE KolimaForestEntranceCues[]
References scKolimaForestEntrancePushLog() and scKolimaForestHopEast().
Referenced by scGetCues().
Definition at lines 50 and 1513 of file kolima_forest_entrance.c.
KolimaForestEntranceSparkleScript
extern Sint32 KolimaForestEntranceSparkleScript[]
Sint32 KolimaForestEntranceSparkleScript[]
References scFieldEffectStretchUntilArrived() and Sint32.
Referenced by scKolimaForestEntranceSpawnCurseSparkle().
Definition at lines 51 and 1527 of file kolima_forest_entrance.c.
KolimaForestEntrancePsynergyFieldHit
Sint32 KolimaForestEntrancePsynergyFieldHit
The same state in Kolima Forest's entrance (kolima_forest_entrance.c). Set by
a Psynergy field's hit, cleared once answered.
References Sint32.
Referenced by scKolimaForestEntranceBurstOnPsynergyField(), scKolimaForestEntranceFlashHitPsynergyFields() and scKolimaForestEntranceWitnessForestCurse().
Definition at line 1284 of file kolima_forest_entrance.c.
KolimaForestEntranceMiaInParty
Sint32 KolimaForestEntranceMiaInParty
Whether Mia was in the party as the curse struck.
References Sint32.
Referenced by scKolimaForestEntranceBurstOnPsynergyField() and scKolimaForestEntranceWitnessForestCurse().
Definition at line 1285 of file kolima_forest_entrance.c.
KolimaForestEntranceSparkleSoundOn
Sint32 KolimaForestEntranceSparkleSoundOn
Nonzero while the curse's sparkles fall with their sound.
References Sint32.
Referenced by scKolimaForestEntranceSpawnCurseSparkle() and scKolimaForestEntranceWitnessForestCurse().
Definition at line 1286 of file kolima_forest_entrance.c.
KolimaCurseDustScript
Sint32 KolimaCurseDustScript[]
References scKolimaFlickerCurseDust(), scKolimaForestEntranceBurstOnPsynergyField() and Sint32.
Referenced by scKolimaUpdateCurseDust().
Definition at line 1534 of file kolima_forest_entrance.c.