An action played: its targets, and how an attack, a cast, an item, a summon or an escape is staged. More...
Go to the source code of this file.
Macros | |
| #define | ITEM_REMOVED_SLOT_GONE 2 |
| Inventory_RemoveFar's result when the last one left its slot, and the slots after it moved up. | |
Functions | |
| s32 | BattlePresentation_DispatchAction (struct BattleActionRecord *request, s32 delay) |
| Plays one action of the round, after delay frames facing the party: an enemy picks its ability now; the action is planned (its targets, hits and damage) and shown the way its staging asks, then the turn's end effects run and every unit returns to its spot. | |
| s32 | BattlePres_BuildTargetList (struct BattlePlan *plan, struct BattleEffectArgument *effect) |
| Fills an effect command from a plan: its kind and strength, the actor and the targets still standing (or every target, for an effect that revives), at least the first. | |
| s32 | BattlePres_RunEscape (struct BattlePlan *plan) |
| Plays a unit's attempt to run. | |
| s32 | BattlePresentation_RunUnitTransition (struct BattlePlan *plan, s32 mode) |
| Plays a summon or a full-screen Psynergy. | |
| s32 | BattlePres_RunActorEntries (struct BattlePlan *plan, s32 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. | |
| s32 | BattlePres_RunAttack (struct BattlePlan *plan, s32 mode) |
| Plays an attack: the camera turns halfway to the attacker's view, the attacker runs up to its first target over its swing's frames, and the blow lands: a miss makes the target hop back; a hit plays its effect and the events, and a critical hit zooms in on the pair with only those two shown. | |
| UNUSED s32 | BattlePres_RunPlainAttack (struct BattlePlan *input, s32 flags) |
| Unused. | |
| s32 | BattlePres_RunItem (struct BattlePlan *plan, s32 unused, struct BattleActionRecord *selection) |
| Plays an item's use: the camera turns to the user's side, the user raises the item and, for an item with an effect, the screen dims while it plays with the events. | |
| s32 | BattleMotion_SetRecordChildValues (struct MotionObject *object, s32 colorMode) |
| Draws every sprite of an object in a colour mode (enum SpriteColorMode): colorMode on each sprite's first layer, SPRITE_COLOR_NORMAL on the others, and every layer's frame set to 255 (none) so that it is drawn again. | |
| s32 | BattlePres_RunPsynergyCast (struct BattlePlan *plan, s32 mode) |
| Plays Psynergy, a Djinni or an enemy's cast. | |
| void | BattleMotion_FlashHit (s32 unitId, s32 unused0, s32 unused1) |
| Flashes unit id as it is hit: puts it in its damage pose and switches its sprites between white and their own colours twice, two frames each, its status panel highlighted. | |
| void | BattleActor_RemoveFromLists (s32 unitId) |
| Takes unit id out of the party's or the enemies' list and out of this round's actions, and frees its name letter. | |
| void | BattleMotion_ShowDowned (s32 unitId) |
| Shows a downed unit: a party member lies down, an enemy keeps its damage pose, turns grey, leaves the lists after four frames and dissolves a dot at a time. | |
An action played: its targets, and how an attack, a cast, an item, a summon or an escape is staged.
Part of battle.c, the battle object, compiled only through it.
Definition in file staging.c.
| #define ITEM_REMOVED_SLOT_GONE 2 |
Inventory_RemoveFar's result when the last one left its slot, and the slots after it moved up.
Definition at line 688 of file staging.c.
Referenced by BattlePres_RunItem().
| s32 BattlePresentation_DispatchAction | ( | struct BattleActionRecord * | request, |
| s32 | delay ) |
Plays one action of the round, after delay frames facing the party: an enemy picks its ability now; the action is planned (its targets, hits and damage) and shown the way its staging asks, then the turn's end effects run and every unit returns to its spot.
Returns 1 when the party got away, 0 otherwise, and -1 when the actor is already down. Called by Battle_RunEncounter for each action of the round, with a delay of 10 for the first. Resets the camera's view (gTransitionWork's frames, flag and yaw, gBattleWork->brightness, the transform and projection), builds gBattleWork->plan, and marks the action done (request->unitId to BATTLE_UNIT_LIST_END) unless the party fled.
Definition at line 18 of file staging.c.
Referenced by Battle_RunEncounter(), and BattlePresentation_DispatchAction().
| s32 BattlePres_BuildTargetList | ( | struct BattlePlan * | plan, |
| struct BattleEffectArgument * | effect ) |
Fills an effect command from a plan: its kind and strength, the actor and the targets still standing (or every target, for an effect that revives), at least the first.
Called by each staging runner before its effect plays: RunUnitTransition, RunAttack, RunPlainAttack, RunItem and RunPsynergyCast. Writes effect's prelude (0), kind, variant, actor, actors, firstTarget, count and range (1); the caller sets its side.
Definition at line 129 of file staging.c.
Referenced by BattlePres_BuildTargetList(), BattlePres_RunAttack(), BattlePres_RunItem(), BattlePres_RunPlainAttack(), BattlePres_RunPsynergyCast(), and BattlePresentation_RunUnitTransition().
| s32 BattlePres_RunEscape | ( | struct BattlePlan * | plan | ) |
Plays a unit's attempt to run.
The party gets away unless the enemies struck first ("But there's no escape!"), each member able to move running off in turn; an enemy gets away 7 times in 10 and leaves the battle. Returns 1 when the party got away. Called by BattlePresentation_DispatchAction for PLAN_SHOW_FLEE. Turns the camera to the party's view and holds gTransitionWork->active while it runs; an enemy that gets away is taken out of the lists and its object released.
Definition at line 175 of file staging.c.
Referenced by BattlePres_RunEscape(), and BattlePresentation_DispatchAction().
| s32 BattlePresentation_RunUnitTransition | ( | struct BattlePlan * | plan, |
| s32 | mode ) |
Plays a summon or a full-screen Psynergy.
The camera turns to the target side (or to the actor's, for a staged scene), the actor glows in its element and the other side fades out; then, unless the cast failed ("blocked" or too little PP), the target side's units are readied alone and the effect plays while the events run. Everyone fades back in. Called by BattlePresentation_DispatchAction for PLAN_SHOW_SUMMON (mode 1) and PLAN_SHOW_FULL_SCREEN (mode 0). Sets gTransitionWork's yaw (and its frames, for a scene), REG_BLDCNT and REG_BLDALPHA for the fades, and the units' record modes; schedules BattleEvent_Playback around the effect. mode : bit 0 hides the actor too (the summons)
Definition at line 252 of file staging.c.
Referenced by BattlePresentation_DispatchAction(), and BattlePresentation_RunUnitTransition().
| s32 BattlePres_RunActorEntries | ( | struct BattlePlan * | plan, |
| s32 | 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.
Called by BattlePresentation_DispatchAction for PLAN_SHOW_MESSAGES, an action with no animation: each target's BattleTargetExec is played at once by BattleEv_DispatchQueued. plan : the action and its targets
Definition at line 428 of file staging.c.
Referenced by BattlePres_RunActorEntries(), and BattlePresentation_DispatchAction().
| s32 BattlePres_RunAttack | ( | struct BattlePlan * | plan, |
| s32 | mode ) |
Plays an attack: the camera turns halfway to the attacker's view, the attacker runs up to its first target over its swing's frames, and the blow lands: a miss makes the target hop back; a hit plays its effect and the events, and a critical hit zooms in on the pair with only those two shown.
Both then return. A miss "nimbly dodges the blow". Called by BattlePresentation_DispatchAction for PLAN_SHOW_ATTACK; mode is unused. Sets gTransitionWork's yaw (and its flag for a critical hit's zoom), the window registers (WIN0 and WIN1 to the battlefield, rows 16 to 136, both turned on), and schedules BattleEvent_Playback around the effect.
Definition at line 454 of file staging.c.
Referenced by BattlePres_RunAttack(), and BattlePresentation_DispatchAction().
| UNUSED s32 BattlePres_RunPlainAttack | ( | struct BattlePlan * | input, |
| s32 | flags ) |
Unused.
Plays a plain attack run: the attacker runs up to its first target and the blow's effect and events play, or, with bit 1 of flags (a miss), the target hops back; both then return. Nothing calls it. BattlePres_RunAttack without the hop height, the windows, the critical zoom, the dodge message or playback; its events are played at once after the effect, and the camera's slower turn waits 20 frames.
Definition at line 617 of file staging.c.
Referenced by BattlePres_RunPlainAttack().
| s32 BattlePres_RunItem | ( | struct BattlePlan * | plan, |
| s32 | unused, | ||
| struct BattleActionRecord * | selection ) |
Plays an item's use: the camera turns to the user's side, the user raises the item and, for an item with an effect, the screen dims while it plays with the events.
Then the item is spent as its use type says; when its slot empties, later item commands of the same member this round follow their items to their new slots (or lose theirs, -1). Called by BattlePresentation_DispatchAction for PLAN_SHOW_ITEM, with the action's record as selection. Sets gTransitionWork's yaw and, while an effect plays, dims gBattleWork->brightness and BG palettes 6 to 13; changes the user's inventory (Inventory_RemoveFar, Inventory_BreakFar, or the Empty Bottle) and the parameters of gBattleWork->actions.
Definition at line 700 of file staging.c.
Referenced by BattlePres_RunItem(), and BattlePresentation_DispatchAction().
| s32 BattleMotion_SetRecordChildValues | ( | struct MotionObject * | object, |
| s32 | colorMode ) |
Draws every sprite of an object in a colour mode (enum SpriteColorMode): colorMode on each sprite's first layer, SPRITE_COLOR_NORMAL on the others, and every layer's frame set to 255 (none) so that it is drawn again.
Called by BattleMotion_FlashHit and BattleEvent_Playback (a hit's flashes and a unit's redraw), with the flash's colour or the unit's own (BattleMotion_GetSlotPalette).
Definition at line 830 of file staging.c.
Referenced by BattleEvent_Playback(), BattleMotion_FlashHit(), and BattleMotion_SetRecordChildValues().
| s32 BattlePres_RunPsynergyCast | ( | struct BattlePlan * | plan, |
| s32 | mode ) |
Plays Psynergy, a Djinni or an enemy's cast.
The camera turns toward the targets from the caster's side, the caster raises its hand and glows in its element (no glow for a Djinni); then the cast fails ("blocked" or too little PP) or its effect plays with the events, and the targets return to their spots. Called by BattlePresentation_DispatchAction for PLAN_SHOW_CAST (mode 0), PLAN_SHOW_DJINNI (1) and PLAN_SHOW_ENEMY_CAST (2). Sets gTransitionWork's yaw (and its frames for a fixed view), redraws the party's status without bit 0, and schedules BattleEvent_Playback around the effect. mode : 1 a Djinni, 2 an enemy's cast, 0 any other
Definition at line 871 of file staging.c.
Referenced by BattlePres_RunPsynergyCast(), and BattlePresentation_DispatchAction().
Flashes unit id as it is hit: puts it in its damage pose and switches its sprites between white and their own colours twice, two frames each, its status panel highlighted.
Called for BATTLE_EVENT_HIT by BattleEv_DispatchQueued (BattleEvent_Playback flashes over frames itself). Waits 8 frames and redraws the party's status at the end.
Definition at line 978 of file staging.c.
Referenced by BattleEv_DispatchQueued(), and BattleMotion_FlashHit().
| void BattleActor_RemoveFromLists | ( | s32 | unitId | ) |
Takes unit id out of the party's or the enemies' list and out of this round's actions, and frees its name letter.
Called when a unit leaves the battle: by BattlePres_RunEscape (an enemy that gets away), BattleMotion_ShowDowned and PLAY_FELLED in BattleEvent_Playback (a fallen enemy), and BattleActor_DestroyTemporaryObject. Sets the unit's side to BATTLE_UNIT_ABSENT and its list entry to BATTLE_UNIT_REMOVED, releases its name letter (BattleEnemy_ReleaseNameLetter), and ends its actions this round (unitId BATTLE_UNIT_LIST_END). A unit in neither list only has its side changed.
Definition at line 1019 of file staging.c.
Referenced by BattleActor_DestroyTemporaryObject(), BattleActor_RemoveFromLists(), BattleEvent_Playback(), BattleMotion_ShowDowned(), and BattlePres_RunEscape().
| void BattleMotion_ShowDowned | ( | s32 | unitId | ) |
Shows a downed unit: a party member lies down, an enemy keeps its damage pose, turns grey, leaves the lists after four frames and dissolves a dot at a time.
Called for BATTLE_EVENT_DEFEAT by BattleEv_DispatchQueued; PLAY_FELLED in BattleEvent_Playback is its counterpart over frames. An enemy's object is marked for release.
Definition at line 1072 of file staging.c.
Referenced by BattleEv_DispatchQueued(), and BattleMotion_ShowDowned().