src/battle/battle_staging.c
An action played: its targets, and how an attack, a cast, an item, a summon or a flight is staged. More…
Included by battle.c.
Macros
| Name | Description | |
|---|---|---|
#define | CRITICAL_ZOOM_START 100 | A critical hit's zoom on the attacker and its target, in percent: from CRITICAL_ZOOM_START, CRITICAL_ZOOM_GAIN more by the end of the run up. |
#define | CRITICAL_ZOOM_GAIN 30 | |
#define | PLAIN_ATTACK_MISSED 2 | btStagingRunPlainAttack's flag for a miss: the target hops back and no effect plays. |
Functions
| Name | Description | |
|---|---|---|
Sint32 | btStagingDispatchAction (BATTLE_ACTION *request, Sint32 delay) | Plays one action of the turn, after delay ticks facing the party: the action is built and staged, its end effects run and every unit returns to its spot. |
UNREAD_RESULT | btStagingBuildTargetList (BATTLE_ACTION_RUN *plan, BATTLE_EFFECT_PARM *args) | Fills a battle effect command from an action run: its kind and strength, the user and the targets still standing, or all of them for an effect that revives. |
Sint32 | btStagingRunFlee (BATTLE_ACTION_RUN *plan) | Plays a unit's attempt to run: the party runs off one by one unless the roll failed ("But there's no escape!"); an enemy gets away 7 times in 10. |
Sint32 | btStagingRunFullScreen (BATTLE_ACTION_RUN *plan, Sint32 mode) | Plays a summon or a full-screen Psynergy: the unit glows in its element and the other side fades out while the effect plays, then everyone fades back in. |
UNREAD_RESULT | btStagingRunMessages (BATTLE_ACTION_RUN *plan, Sint32 unused) | Clears the highlights, then applies the action to each target in turn and plays its events; with no target, only waits for the player. |
Sint32 | btStagingRunAttack (BATTLE_ACTION_RUN *plan, Sint32 mode) | Plays an attack: the attacker runs up to its first target and the blow lands. |
Sint32 | btStagingRunPlainAttack (BATTLE_ACTION_RUN *input, Sint32 flags) | Unused: a plainer attack run, with no hop, no critical zoom and no dodge message. |
Sint32 | btStagingRunItem (BATTLE_ACTION_RUN *plan, Sint32 unused, BATTLE_ACTION *selection) | Plays an item's use: the user raises the item and, for one with a battle effect, the screen dims while it plays. |
UNREAD_RESULT | btObjectSetColorMode (ACTOR *actor, Sint32 colorMode) | Draws every sprite of an actor in a colour mode, its first layer in colorMode and the others plain. |
Sint32 | btStagingRunPsynergyCast (BATTLE_ACTION_RUN *plan, Sint32 mode) | Plays Psynergy, a Djinni or an enemy's cast: the caster raises its hand and glows in its element, then the cast fails or its battle effect plays, and the targets return to their spots. |
void | btMotionFlashHit (Sint32 unitId, Sint32 unusedA, Sint32 unusedB) | Flashes a unit as it is hit, white and back twice in its damage pose. |
void | btObjectRemoveFromLists (Sint32 unitId) | Takes a unit out of its side's list and this turn's actions, and frees its name letter. |
void | btMotionShowDowned (Sint32 unitId) | Shows a downed unit: a party member lies down; an enemy turns grey and dissolves a dot at a time. |
Description
An action played: its targets, and how an attack, a cast, an item, a summon
or a flight is staged. Part of battle.c.
Macros in detail
CRITICAL_ZOOM_START
#define CRITICAL_ZOOM_START 100
A critical hit's zoom on the attacker and its target, in percent: from
CRITICAL_ZOOM_START, CRITICAL_ZOOM_GAIN more by the end of the run up.
Referenced by btStagingRunAttack().
Definition at line 8 of file battle_staging.c.
CRITICAL_ZOOM_GAIN
#define CRITICAL_ZOOM_GAIN 30
Referenced by btStagingRunAttack().
Definition at line 9 of file battle_staging.c.
PLAIN_ATTACK_MISSED
#define PLAIN_ATTACK_MISSED 2
btStagingRunPlainAttack's flag for a miss: the target hops back and no effect
plays. Nothing calls the function, so its other flags are unknown.
Referenced by btStagingRunPlainAttack().
Definition at line 13 of file battle_staging.c.
Functions in detail
btStagingDispatchAction
Sint32 btStagingDispatchAction(BATTLE_ACTION *request, Sint32 delay)
Plays one action of the turn, after delay ticks facing the party: the action is built and staged, its end effects run and every unit returns to its spot. Returns 1 when the party got away, -1 when the unit is already down, else 0.
References btActionRunBuild(), btAIChooseAction(), btBackgroundSetMode(), btHighlightSetModes(), btMessageWaitForAdvance(), btMotionReturnToSpot(), btObjectDestroyAll(), btObjectPut(), btStagingRunAttack(), btStagingRunFlee(), btStagingRunFullScreen(), btStagingRunItem(), btStagingRunMessages(), btStagingRunPsynergyCast(), btUnitListIds(), btUnitProcessActionEnd(), gmUnitGetStub(), Sint32, syDivFX(), syInitMatrix(), syLookAtLoad(), sySetScreenDist() and sySynch().
Referenced by btRun().
Definition at line 18 of file battle_staging.c.
btStagingBuildTargetList
UNREAD_RESULT btStagingBuildTargetList(BATTLE_ACTION_RUN *plan, BATTLE_EFFECT_PARM *args)
Fills a battle effect command from an action run: its kind and strength, the user and the targets still standing, or all of them for an effect that revives.
References gmUnitGetStub() and Sint32.
Referenced by btStagingRunAttack(), btStagingRunFullScreen(), btStagingRunItem(), btStagingRunPlainAttack() and btStagingRunPsynergyCast().
Definition at line 127 of file battle_staging.c.
btStagingRunFlee
Sint32 btStagingRunFlee(BATTLE_ACTION_RUN *plan)
Plays a unit's attempt to run: the party runs off one by one unless the roll failed ("But there's no escape!"); an enemy gets away 7 times in 10. Returns 1 when the party got away.
References btHighlightSetModes(), btMessageWaitForAdvance(), btMotionSetupEscapeObject(), btObjectMarkForRelease(), btObjectRemoveFromLists(), btUnitListLiving(), gmUnitGetStub(), mnBattleMessageShowAndWaitStub(), Sint32 and sySynch().
Referenced by btStagingDispatchAction().
Definition at line 157 of file battle_staging.c.
btStagingRunFullScreen
Sint32 btStagingRunFullScreen(BATTLE_ACTION_RUN *plan, Sint32 mode)
Plays a summon or a full-screen Psynergy: the unit glows in its element and
the other side fades out while the effect plays, then everyone fades back in.
STAGING_HIDE_ACTOR hides the unit too, as the summons do.
References btActorGetSprite(), btBackgroundRestorePalette(), btCameraSetView(), btEffectRunSummonStub(), btElementGlowPlay(), btHighlightSetModes(), btHighlightSetSpriteMode(), btObjectGet(), btObjectPut(), btObjectSpawnObjectsForList(), btPlaybackPush(), btPlaybackRun(), btPlaybackRunAll(), btPlaybackWaitForReady(), btStagingBuildTargetList(), btUnitListIds(), fdActorSelectAnimationStub(), mnPartyStatusDrawStub(), Sint32, state, sySetEvent(), sySoundPlayStub() and sySynch().
Referenced by btStagingDispatchAction().
Definition at line 232 of file battle_staging.c.
btStagingRunMessages
UNREAD_RESULT btStagingRunMessages(BATTLE_ACTION_RUN *plan, Sint32 unused)
Clears the highlights, then applies the action to each target in turn and plays its events; with no target, only waits for the player.
References btAbilityApplyToTarget(), btHighlightSetModes(), btMessageWaitForAdvance(), btPlaybackRunAll(), Sint32 and sySynch().
Referenced by btStagingDispatchAction().
Definition at line 417 of file battle_staging.c.
btStagingRunAttack
Sint32 btStagingRunAttack(BATTLE_ACTION_RUN *plan, Sint32 mode)
Plays an attack: the attacker runs up to its first target and the blow lands. A miss makes the target hop back ("nimbly dodges the blow"); a critical hit zooms in on the pair with only the two of them shown.
References btActorGetSprite(), btCameraSetView(), btCameraSetViewAtPairMidpoint(), btHighlightSetModes(), btMotionApproachTarget(), btMotionHopBack(), btMotionReturnToSpot(), btObjectGet(), btObjectPutKeepingPoses(), btObjectSpawnObjectsForList(), btPlaybackPush(), btPlaybackRun(), btPlaybackRunAll(), btPlaybackWaitForReady(), btSpriteGetAttackHop(), btStagingBuildTargetList(), fdActorSetAnimationSpeedStub(), fdSpriteAnimationSumCommandLengthsStub(), gmUnitGetStub(), mnPartyStatusDrawStub(), Sint32, state, syAtan(), sySetEvent() and sySynch().
Referenced by btStagingDispatchAction().
Definition at line 440 of file battle_staging.c.
btStagingRunPlainAttack
Sint32 btStagingRunPlainAttack(BATTLE_ACTION_RUN *input, Sint32 flags)
Unused: a plainer attack run, with no hop, no critical zoom and no dodge message.
References btActorGetSprite(), btEffectRunByIdRangeStub(), btHighlightSetModes(), btMotionApproachTarget(), btMotionHopBack(), btMotionReturnToSpot(), btObjectGet(), btPlaybackRunAll(), btStagingBuildTargetList(), fdActorSetAnimationSpeedStub(), fdSpriteAnimationSumCommandLengthsStub(), gmUnitGetStub(), Sint32, state, syAtan() and sySynch().
Definition at line 613 of file battle_staging.c.
btStagingRunItem
Sint32 btStagingRunItem(BATTLE_ACTION_RUN *plan, Sint32 unused, BATTLE_ACTION *selection)
Plays an item's use: the user raises the item and, for one with a battle effect, the screen dims while it plays. Then the item is spent as its use type says, and later item commands of the same party member this turn follow their items to their new slots.
References btActorGetSprite(), btGraphicsScaleRGB555Clamped(), btHighlightSetModes(), btMotionReturnToSpot(), btObjectGet(), btPlaybackPush(), btPlaybackRun(), btPlaybackRunAll(), btPlaybackWaitForReady(), btStagingBuildTargetList(), fdActorSelectAnimationStub(), fdActorSetAnimationSpeedStub(), gmBattleRandomStub(), gmInventoryBreakStub(), gmInventoryRemoveStub(), gmItemGetDefinitionStub(), gmUnitGetStub(), Sint32, state, sySetEvent() and sySynch().
Referenced by btStagingDispatchAction().
Definition at line 693 of file battle_staging.c.
btObjectSetColorMode
UNREAD_RESULT btObjectSetColorMode(ACTOR *actor, Sint32 colorMode)
Draws every sprite of an actor in a colour mode, its first layer in colorMode and the others plain.
References btActorGetSprite() and Sint32.
Referenced by btMotionFlashHit() and btPlaybackRun().
Definition at line 828 of file battle_staging.c.
btStagingRunPsynergyCast
Sint32 btStagingRunPsynergyCast(BATTLE_ACTION_RUN *plan, Sint32 mode)
Plays Psynergy, a Djinni or an enemy's cast: the caster raises its hand and glows in its element, then the cast fails or its battle effect plays, and the targets return to their spots.
References btActorGetSprite(), btBackgroundRestorePalette(), btElementGlowPlay(), btHighlightSetModes(), btMotionReturnToSpot(), btObjectGet(), btPlaybackPush(), btPlaybackRun(), btPlaybackRunAll(), btPlaybackWaitForReady(), btStagingBuildTargetList(), fdActorSelectAnimationStub(), fdActorSetAnimationSpeedStub(), mnPartyStatusDrawStub(), Sint32, state, syAtan(), sySetEvent() and sySoundPlayStub().
Referenced by btStagingDispatchAction().
Definition at line 860 of file battle_staging.c.
btMotionFlashHit
void btMotionFlashHit(Sint32 unitId, Sint32 unusedA, Sint32 unusedB)
Flashes a unit as it is hit, white and back twice in its damage pose.
References btObjectGet(), btObjectGetPalette(), btObjectSetColorMode(), fdActorSelectAnimationStub(), gmUnitGetStub(), mnPartyStatusDrawStub(), mnPartyStatusHighlightMembersStub(), Sint32 and sySynch().
Referenced by btPlaybackRunAll().
Definition at line 973 of file battle_staging.c.
btObjectRemoveFromLists
void btObjectRemoveFromLists(Sint32 unitId)
Takes a unit out of its side's list and this turn's actions, and frees its name letter.
References btEnemyReleaseNameLetter(), gmUnitGetStub() and Sint32.
Referenced by btMotionShowDowned(), btPlaybackRun(), btStagingRunFlee() and btUnitRemoveEnemy().
Definition at line 1000 of file battle_staging.c.
btMotionShowDowned
void btMotionShowDowned(Sint32 unitId)
Shows a downed unit: a party member lies down; an enemy turns grey and dissolves a dot at a time.
References btActorGetSprite(), btObjectGet(), btObjectMarkForRelease(), btObjectRemoveFromLists(), fdSpriteDissolveRunManyStub(), fdSpriteStartAnimationStub(), gmUnitGetStub(), Sint32 and sySynch().
Referenced by btPlaybackRunAll().
Definition at line 1047 of file battle_staging.c.