src/battle/battle_playback.c
Playback over ticks, btPlaybackRun. More…
Included by battle.c.
Macros
| Name | Description | |
|---|---|---|
#define | PLAY_MESSAGE 3 | btPlaybackRun's waits, in BATTLE_PLAYBACK_STATE.phase beside the phases playback_queue.h names. |
#define | PLAY_ADVANCE 5 | shows the arrow and waits for the player |
#define | PLAY_HIT 10 | flashes the unit that was hit |
#define | PLAY_FELLED 11 | greys a fallen enemy and dissolves it |
#define | PLAY_MESSAGE_ADD 13 | waits for the message, then goes straight on |
#define | HIT_FLASH_TICKS 8 | PLAY_HIT's ticks: the unit white on ticks 1 and 5, its own colours again on 3 and 7. |
#define | FELLED_FLASH 1024 | PLAY_FELLED's timer from here counts the Djinn bonus's colour cycle, kept apart from the counts of the fall itself (0 to 36). |
#define | FELLED_FLASH_TICKS 30 | The Djinn bonus's colour cycle lasts 30 ticks. |
#define | FELLED_DISSOLVE_FIRST_TICK 5 | PLAY_FELLED's timer at which the dissolve starts, a tick after the enemy leaves the lists; it takes fdSpriteDissolveStep's 128 steps, four a tick. |
#define | FELLED_DISSOLVE_STEPS 128 |
Functions
| Name | Description | |
|---|---|---|
void | _call_via_r0 (Uint32 routine) | |
void | btDMAStopDMA3 (void) | Unused: stops DMA3, then calls a function that is not one. |
void | btPlaybackStart (Sint32 sound) | Starts playback of the action's targets when the effect's blow lands, with sound as the hit's sound (0 keeps the one set); later calls change nothing. |
Sint32 | btPlaybackSchedulePhase (Sint32 ticks) | Empties the playback queue and plays the commands queued next, after ticks ticks, with no targets to resolve. |
void | btPlaybackRun (void) | Plays the action's targets one at a time: resolves each with btAbilityApplyToTarget, then plays what it queued over the ticks that follow, without waiting. |
void | btPlaybackReset (void) | Stops playback and empties the playback queue. |
UNREAD_RESULT | btPlaybackWaitForReady (void) | Waits until playback has played every target, starting it if the effect never showed the damage. |
Description
Playback over ticks, btPlaybackRun. Part of battle.c.
Macros in detail
PLAY_MESSAGE
#define PLAY_MESSAGE 3
btPlaybackRun's waits, in BATTLE_PLAYBACK_STATE.phase beside the phases
playback_queue.h names.
waits for the message, then for the player
Referenced by btPlaybackRun().
Definition at line 53 of file battle_playback.c.
PLAY_ADVANCE
#define PLAY_ADVANCE 5
shows the arrow and waits for the player
Referenced by btPlaybackRun().
Definition at line 54 of file battle_playback.c.
PLAY_HIT
#define PLAY_HIT 10
flashes the unit that was hit
Referenced by btPlaybackRun().
Definition at line 55 of file battle_playback.c.
PLAY_FELLED
#define PLAY_FELLED 11
greys a fallen enemy and dissolves it
Referenced by btPlaybackRun().
Definition at line 56 of file battle_playback.c.
PLAY_MESSAGE_ADD
#define PLAY_MESSAGE_ADD 13
waits for the message, then goes straight on
Referenced by btPlaybackRun().
Definition at line 57 of file battle_playback.c.
HIT_FLASH_TICKS
#define HIT_FLASH_TICKS 8
PLAY_HIT's ticks: the unit white on ticks 1 and 5, its own colours again on 3
and 7.
Referenced by btPlaybackRun().
Definition at line 61 of file battle_playback.c.
FELLED_FLASH
#define FELLED_FLASH 1024
PLAY_FELLED's timer from here counts the Djinn bonus's colour cycle, kept
apart from the counts of the fall itself (0 to 36).
Referenced by btPlaybackRun().
Definition at line 65 of file battle_playback.c.
FELLED_FLASH_TICKS
#define FELLED_FLASH_TICKS 30
The Djinn bonus's colour cycle lasts 30 ticks.
Referenced by btPlaybackRun().
Definition at line 67 of file battle_playback.c.
FELLED_DISSOLVE_FIRST_TICK
#define FELLED_DISSOLVE_FIRST_TICK 5
PLAY_FELLED's timer at which the dissolve starts, a tick after the enemy
leaves the lists; it takes fdSpriteDissolveStep's 128 steps, four a tick.
Referenced by btPlaybackRun().
Definition at line 70 of file battle_playback.c.
FELLED_DISSOLVE_STEPS
#define FELLED_DISSOLVE_STEPS 128
Referenced by btPlaybackRun().
Definition at line 71 of file battle_playback.c.
Functions in detail
_call_via_r0
void _call_via_r0(Uint32 routine)
Referenced by btDMAStopDMA3().
Definition at line 5 of file battle_playback.c.
btDMAStopDMA3
void btDMAStopDMA3(void)
Unused: stops DMA3, then calls a function that is not one.
References _call_via_r0(), IwramIrqModeWord and syDMAXCopy().
Definition at line 8 of file battle_playback.c.
btPlaybackStart
void btPlaybackStart(Sint32 sound)
Starts playback of the action's targets when the effect's blow lands, with sound as the hit's sound (0 keeps the one set); later calls change nothing.
References Sint32.
Definition at line 21 of file battle_playback.c.
btPlaybackSchedulePhase
Sint32 btPlaybackSchedulePhase(Sint32 ticks)
Empties the playback queue and plays the commands queued next, after ticks ticks, with no targets to resolve.
References btPlaybackRun(), Sint32 and sySetEvent().
Referenced by btActionRunBuild(), btProcessTurnEnd() and btUnitProcessActionEnd().
Definition at line 38 of file battle_playback.c.
btPlaybackRun
void btPlaybackRun(void)
Plays the action's targets one at a time: resolves each with
btAbilityApplyToTarget, then plays what it queued over the ticks that follow,
without waiting.
References BattleMessageAdvanceArrowTiles, btAbilityApplyToTarget(), btActorGetSprite(), btEnemyRecordDefeat(), btObjectGet(), btObjectGetPalette(), btObjectMarkForRelease(), btObjectRemoveFromLists(), btObjectSetColorMode(), btObjectUpdatePose(), btPlaybackGrantDjinnBonus(), btSpriteGetDefeatSound(), btUnitBuildStatusFlags(), btUnitClearStatuses(), btUnitRemoveEnemy(), fdActorSelectAnimationStub(), fdSpriteDissolveStepStub(), fdSpriteStartAnimationStub(), FrameCount, gmUnitGetStub(), mnBattleMessageOpenStub(), mnMessageAllTypedStub(), mnMessageArgumentClearAllStub(), mnMessageArgumentPushStub(), mnPartyStatusDrawStub(), mnPartyStatusHighlightMembersStub(), PerData, PerPushLatch, Sint32, syIOWriteQueueClearBits16(), syIOWriteQueueSetBits16(), syOAMAddSpriteAtDepth(), sySoundPlayStub(), syVRAMCacheReload(), syWordsClear(), TickCount and VramCacheEntries.
Referenced by btPlaybackSchedulePhase(), btPlaybackWaitForReady(), btStagingRunAttack(), btStagingRunFullScreen(), btStagingRunItem() and btStagingRunPsynergyCast().
Definition at line 76 of file battle_playback.c.
btPlaybackReset
void btPlaybackReset(void)
Stops playback and empties the playback queue.
Referenced by btActionRunBuild(), btPlaybackRunAll(), btPlaybackWaitForReady(), btProcessTurnEnd() and btUnitProcessActionEnd().
Definition at line 483 of file battle_playback.c.
btPlaybackWaitForReady
UNREAD_RESULT btPlaybackWaitForReady(void)
Waits until playback has played every target, starting it if the effect never showed the damage.
References btPlaybackReset(), btPlaybackRun(), Sint32, state, syCloseEvent() and sySynch().
Referenced by btActionRunBuild(), btProcessTurnEnd(), btStagingRunAttack(), btStagingRunFullScreen(), btStagingRunItem(), btStagingRunPsynergyCast() and btUnitProcessActionEnd().
Definition at line 499 of file battle_playback.c.