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 (its payload in SerialPeerPayloads) 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 90015 seconds

Functions

NameDescription
voidmnBattleMenuUpdate (void)The battle menus' 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, and if so says "This is no time to be running away!": a battle a script starts (BATTLE_TYPE_SCRIPTED), a link battle, and 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 900

15 seconds

Referenced by mnBattleMenuUpdate().

Definition at line 3 of file screens_link_timer.c.

Functions in detail

mnBattleMenuUpdate

void mnBattleMenuUpdate(void)

The battle menus' 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, 15 seconds counted down in a window at the top left, SE_TRIPLE_TONE_LOW playing at each second.

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

Referenced by mnBattleCollectPartyCommands().

Definition at line 27 of file screens_link_timer.c.

mnBattleRefuseFlee

Sint32 mnBattleRefuseFlee(void)

Tests whether the party may not run from this battle, and if so says "This is no time to be running away!": a battle a script starts (BATTLE_TYPE_SCRIPTED), a link battle, and a party once challenged (BATTLE_STATE.challengeFlag). In a BATTLE_TYPE_NO_ESCAPE battle the party may try, and always fails (battle/battle_turn.c).

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

Referenced by mnBattleCollectPartyCommands().

Definition at line 135 of file screens_link_timer.c.