Skip to Content
The Alchemy Project

src/window/screens_link_timer.c

The link battle timer and the no-flee check. More…

Included by screens.c.

Structures

NameDescription
structLINK_SIGNATUREThe partner console's link signature (LinkPeerSignatures) as the timer reads it: halfwords 4 to 7 read "EDVS" once the partner has chosen its commands (mnBattleCollectPartyCommands), which starts this side's countdown.

Macros

NameDescription
#defineCOUNTDOWN_START_TICKS (15 * TICKS_PER_SECOND)

Functions

NameDescription
voidmnBattleMenuUpdateEachTick (void)An event while the party's commands are chosen (mnBattleCollectPartyCommands): eases the battle view a third of the way to BATTLE_MENU_STATE.targetViewOffset each tick (a pixel at least), draws the sprites of BATTLE_MENU_STATE.icons that are shown (the chosen command's and ability's icons, the party member's portrait) and slides the page arrows.
Sint32mnBattleRefuseFlee (void)Tests whether the party may not run from this battle: a link battle, battle type 3, which no battle sets, or a party once challenged (BATTLE_STATE.challengeFlag).

Description

The link battle timer and the no-flee check. Part of screens.c.

Macros in detail

COUNTDOWN_START_TICKS

#define COUNTDOWN_START_TICKS (15 * TICKS_PER_SECOND)

Referenced by mnBattleMenuUpdateEachTick().

Definition at line 3 of file screens_link_timer.c.

Functions in detail

mnBattleMenuUpdateEachTick

void mnBattleMenuUpdateEachTick(void)

An event while the party's commands are chosen (mnBattleCollectPartyCommands): eases the battle view a third of the way to BATTLE_MENU_STATE.targetViewOffset each tick (a pixel at least), draws the sprites of BATTLE_MENU_STATE.icons that are shown (the chosen command's and ability's icons, the party member's portrait) and slides the page arrows. In a link battle it also runs the timer: once the partner has chosen its commands, this side has 15 seconds, counted down in the "TIME" window, with a tone at each second.

References btCameraSetCommandViewStub(), LinkPeerSignatures, mnLinkCreateCountdownLabelWindow(), mnPageArrowsDraw(), mnTextDrawNumberInWindow(), Sint32, syOAMAddSpriteAtDepth() and sySoundPlayStub().

Referenced by mnBattleCollectPartyCommands().

Definition at line 26 of file screens_link_timer.c.

mnBattleRefuseFlee

Sint32 mnBattleRefuseFlee(void)

Tests whether the party may not run from this battle: a link battle, battle type 3, which no battle sets, or a party once challenged (BATTLE_STATE.challengeFlag). When it may not, shows "This is no time to be running away!" until A or B is pressed or the link battle's time runs out, and returns 1; else returns 0. The Flee command asks it (mnBattleCollectPartyCommands); in a BATTLE_TYPE_NO_ESCAPE battle the command row offers no Flee.

References MainRoutineStateWork, mnTextDrawWideStringAtOffset(), mnTextFillCanvasBackground(), mnWindowClose(), mnWindowCreate(), PerWork, result, Sint32 and sySynch().

Referenced by mnBattleCollectPartyCommands().

Definition at line 137 of file screens_link_timer.c.