include/battle/battle.h
The battle module's functions and globals, as the other modules see them: its tables, types and constants, then its functions, grouped by the part of battle.c that holds them.
#include "fixed_math.h"#include "types.h"#include "edition.h"#include "system.h"#include "field/speaker.h"
Included by action_weights.c, battle_tables.c, element_glow_tables.c, highlight_tables.c, knockback_tables.c, battle_effect_internal.h, level.c, test.c, test_scenes.c, actor_scripts.c, battle_background_rules.c, field_engine_internal.h, field_internal.h, lucky_dice.c, lucky_wheels.c, script_commands_internal.h, game_internal.h, main_routine.c, menu_internal.h, title_intro.c, alpine_crossing_lama_temple.c, altin.c, altin_peak.c, altmiller_cave.c, babi_lighthouse.c, battle_arena.c, bilibin.c, bilibin_cave.c, colosseum_entrance.c, colosseum_navampa_match.c, cottage_rooms_b.c, crossbone_isle.c, crossbone_isle_keys.c, fuchin_temple.c, goma_cave_entrance.c, goma_cave_pillar.c, goma_cave_stream.c, gondowan_cave.c, hammet_palace.c, imil.c, imil_fuchin_falls.c, kolima.c, kolima_forest_entrance.c, lalivero.c, lamakan_desert.c, mccoy_palace.c, mccoy_palace_grounds.c, mercury_lighthouse.c, mercury_lighthouse_aerie.c, mercury_lighthouse_entrance.c and 33 more.
Structures
| Name | Description | |
|---|---|---|
struct | RING | One of the star field's three rings, moving outward on the effect canvas. |
Macros
| Name | Description | |
|---|---|---|
#define | ADVANCE_ARROW_PICTURE_BYTES 128 | One picture of the advance arrow: 8 by 16 pixels, a byte a pixel. |
#define | MindReadStateWork | The HEAP_SLOT_MIND_READ heap slot: Mind Read's wave state while its effect runs. |
#define | BattleEffectStateWork | The heap slots from HEAP_SLOT_BATTLE_EFFECT, then the canvas and sprite sheet: the running battle effect's BATTLE_EFFECT_STATE first. |
#define | EnemyUnits (*(Uint8 **)&HeapSlots[HEAP_SLOT_ENEMY_UNITS]) | The HEAP_SLOT_ENEMY_UNITS heap slot: the six enemy battle units, BATTLE_UNIT_SIZE bytes each, that gmUnitGet returns for unit ids 128 to 133 during a battle. |
#define | BattleBackgroundStateWork | The HEAP_SLOT_BATTLE_BACKGROUND heap slot: the camera's turn, which battle_staging.c, battle_auto_battle.c and battle_turn.c set for each action, and the background's display mode. |
#define | BATTLE_OUTCOME_LOST -1 | btRun's results besides the number of enemies defeated. |
#define | BATTLE_OUTCOME_FLED 999 | |
#define | BATTLE_BG1_SCREEN_BLOCK 31 | BG1's map during a battle, a screen block: the battle background's, where the command row also places its icons' tiles. |
#define | BATTLE_BACKGROUND_SCROLL_Y 32 | BG1's vertical scroll that sets the battle background in the battle view. |
#define | BATTLE_ZOOM_NORMAL 100 | btCameraSetView's zoom, in percent, for the battle's usual view. |
#define | PUSH_MESSAGE (message) btPlaybackPush(PLAYBACK_MESSAGE, (message)) | Pushes a message to show, waiting for the player to read it. |
#define | DEFINE_ADJUST_CAMERA (name) | Defines a function that turns the battle camera a 128th of a turn each tick L or R is held, and centres the background's zoom unless a view holds it. |
Enumerations
| Name | Description | |
|---|---|---|
enum | BATTLE_KNOCKBACK { KNOCKBACK_NUDGE, KNOCKBACK_HOP, KNOCKBACK_LEAP, KNOCKBACK_LA … } | btMotionApplyKnockback's knockbacks, the columns of the BattleKnockback* tables in knockback_tables.c. |
enum | BATTLE_POSE { POSE_STILL, POSE_STANDING, POSE_LEAP, POSE_CAST, POSE_PARTY_ … } | The battle sprites' animations (fdSpriteStartAnimation numbers) that the battle code picks by name. |
enum | BATTLE_SPR_MODE { SPRITE_OPAQUE, SPRITE_SEMI_TRANSPARENT } | A battle unit's sprites' OBJ mode, as btHighlightSetSpriteMode sets it: faded units are semi-transparent, and the battle's blends act on them. |
enum | BATTLE_HIGHLIGHT { HIGHLIGHT_OFF, HIGHLIGHT_SELECTED } | btHighlightSetModes' mode, kept in BATTLE_STATE.highlightMode: whether the selected units are highlighted, every other unit faded. |
enum | BATTLE_ELEMENT_GLOW { GLOW_STAR_FIELD, GLOW_STREAKS, GLOW_PILLAR, GLOW_BURST } | The glows btElementGlowPlay plays about a unit in its element. |
Functions
| Name | Description | |
|---|---|---|
Sint32 | btRun (Sint32 enemyGroup) | A whole battle and the lists of the units in it (battle_run.c). |
Sint32 | btUnitListIds (Sint32 sideMask, Uint16 *unitIds) | Lists the units in the battle on the sides in sideMask, standing or not, and returns how many. |
Sint32 | btUnitListLiving (Sint32 sideMask, Uint16 *unitIds) | Lists the units still standing on the sides in sideMask, party first, into unitIds when it is not null, and returns how many. |
Sint32 | btPartyPrepareMembers (Uint16 *unitIds) | Lists the party members who fight, three in a link battle, into unitIds when it is not null, and returns how many. |
Sint32 | btEnemyList (Sint16 *unitIds) | Lists the enemy units present and returns how many, 0 when unitIds is null. |
void | btCameraUpdate (void) | The battle's opening and the party's state and Djinn as a battle starts and ends (battle_setup.c). |
void | btIntroAnnounceEncounter (Sint32 enemyCount) | Announces the enemies at the start of a battle, "<enemy> appeared!" for each, then whether the party strikes first or is caught by surprise. |
void | btUnitCollect (void) | Fills the battle's two unit lists: the party in its order, and the enemies left to right, or for a fixed formation out from the centre. |
Sint32 | btShiftVRAMTiles (void) | Unused: moves 16 bytes of VRAM down by 16 and clears the 20 from 12 bytes past where they land. |
void | btClearBg0Vofs (void) | Unused: clears BG0's vertical scroll. |
void | btPartyBattleSetupNoOperation (Sint32 unused) | Does nothing; btRun calls it with 1 as the battle is set up. |
UNREAD_RESULT | btPartyClearBattleStatuses (void) | Clears the party's battle-only states, and works their stats out again, as a battle ends. |
UNREAD_RESULT | btDjinnRecoveryReconcile (void) | Brings the Djinn recovery list up to date as a battle starts, and outside a link battle sets again each Djinni waiting for a battle's end. |
struct DJINN_RECOVERY_TABLE * | btSummonUpdateAvailability (void) | Works out which summons the party can call, by the Djinn it holds of each element, set or not; whether enough are on standby is checked when one is chosen. |
void | btSummonReservedNoOperation (void) | Unused: does nothing. |
Sint32 | btGatherActions (struct BATTLE_ACTION *actions) | A turn's actions, chosen and put in action order (battle_turn.c). |
Sint32 | btBuildPartyActions (struct BATTLE_ACTION *entries) | The party's actions for the turn, from the command menu; one who is asleep, confused, charmed or stunned loses theirs. |
Sint32 | btBuildEnemyActions (struct BATTLE_ACTION *entries) | The enemies' actions for the turn, in a shuffled order. |
Sint32 | btAppendLinkedActions (struct BATTLE_ACTION *actions, Sint32 count) | Link battle: exchanges the turn's actions with the other console and appends the opponent's, their units and targets seen from this side. |
void | btActionOrderSort (struct BATTLE_ACTION *entries, Sint32 count) | Sorts the turn's actions into action order, fastest first, after moving the guarding and grounding Djinn to the front. |
Sint32 | btFleeCheckSuccess (void) | Rolls whether the party gets away: 50 percent, 20 more for each failed attempt, and 5 for each level the party's average is above the enemies'. |
Sint32 | btGetUnitAtPlace (Sint32 taggedPlace) | Returns the unit id at a list place, PLACE_ENEMY_SIDE set for the enemies' list. |
Sint32 | btFindUnitPlace (Uint32 unitId) | Returns the list place of a unit, PLACE_PARTY or PLACE_ENEMY with its place, or -1 when it is in neither list. |
void | btUnitResetGuardLevels (void) | Ends every unit's guard (Defend and the like) and recalculates its stats. |
void | btCameraSetCommandView (Sint32 verticalOffset) | Sets the camera up for the fixed view the battle shows while commands are chosen, raised by verticalOffset pixels. |
void | btCameraAdjustByShoulderKeysAlternate (void) | |
void | btPaletteUpdatePulseBrightness (void) | Unused: fills HIGHLIGHT_PALETTE with WINDOW_PALETTE's colours, brightened by a pulse that rises and falls with the tick count. |
void | btPaletteCopyWithBrightnessOffset (Sint32 offset) | Copies WINDOW_PALETTE into HIGHLIGHT_PALETTE and BASIC_COLORS_PALETTE into the palette before it, each channel moved by offset levels. |
void | btTurnStartNoOperation (void) | Unused: a second copy of the camera turn while L or R is held. |
UNREAD_RESULT | btAIChooseAction (struct BATTLE_ACTION *request, Sint32 acting) | The enemies' choices (battle_enemy_ai.c, battle_targeting.c). |
Sint32 | btAIChooseTarget (Sint32 userId, struct ABILITY_DEFINITION *action) | Picks the target of an enemy's ability, or a confused unit's, at random among those it would affect; a single-target attack by an enemy with a strategy favours the strongest. |
Sint32 | btAIChooseRandomTarget (Sint32 requireLivingUnit) | Picks a random place: a party member still standing with requireLivingUnit, otherwise any enemy place in use. |
Sint32 | btActionRunBuild (struct BATTLE_ACTION *request, struct BATTLE_ACTION_RUN *plan) | An action built for its targets (battle_action.c), staged (battle_staging.c) and applied to each target (battle_ability.c). |
Uint32 | btUnitIsListed (Uint32 unitId) | Returns 1 when the unit is in its side's list of units in the battle (btUnitListIds), 0 otherwise. |
Sint32 | btDjinnCountStandby (Uint32 unitId, Uint8 *counts) | Counts the standby Djinn on unitId's side, and each element's count into counts when it is not null. |
Sint32 | btStagingDispatchAction (struct 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 (struct BATTLE_ACTION_RUN *plan, struct 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 (struct 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 (struct 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 (struct 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 (struct BATTLE_ACTION_RUN *plan, Sint32 mode) | Plays an attack: the attacker runs up to its first target and the blow lands. |
Sint32 | btStagingRunPlainAttack (struct BATTLE_ACTION_RUN *input, Sint32 flags) | Unused: a plainer attack run, with no hop, no critical zoom and no dodge message. |
Sint32 | btStagingRunItem (struct BATTLE_ACTION_RUN *plan, Sint32 unused, struct 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. |
Sint32 | btStagingRunPsynergyCast (struct 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. |
UNREAD_RESULT | btObjectSetColorMode (struct ACTOR *actor, Sint32 palette) | Draws every sprite of an actor in a colour mode, its first layer in colorMode and the others plain. |
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. |
UNREAD_RESULT | btAbilityApplyToTarget (struct BATTLE_ACTION_RUN *plan, Sint32 slot) | Applies the action's ability to one of its targets, slot, in the seven steps README.md lists under "Weapon unleashes and 7-step ability resolution", queueing what playback will show. |
Bool | btAbilityEffectAppliesToDowned (Sint32 effect) | Returns 1 for an effect that still applies when the damage has just knocked the target out: the drains. |
Uint32 | btAbilityIsPsynergy (Sint32 abilityId) | Returns 1 for an ability that costs PP, and for Psy Drain, which costs none. |
void | btPlaybackStart (Sint32 sound) | Playback: what an action shows over the ticks after it is applied, and the messages the player waits on (battle_playback.c, battle_playback_queue.c). |
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. |
Sint32 | btPlaybackSchedulePhase (Sint32 ticks) | Empties the playback queue and plays the commands queued next, after ticks ticks, with no targets to resolve. |
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. |
void | btDMAStopDMA3 (void) | Unused: stops DMA3, then calls a function that is not one. |
Uint32 | btPlaybackPush (Uint32 opcode, Uint32 operand) | Queues one playback command with its operand, and returns the opcode. |
void | btPlaybackRunAll (void) | |
void | btPlaybackMarkMessage (void) | Marks the next message, as PLAYBACK_MARK does. |
void | btPlaybackGrantDjinnBonus (struct BATTLE_PLAYBACK_STATE *runtime, Uint32 unused) | Grants the Djinn bonus for the rest of the action. |
UNREAD_RESULT | btMessageWaitForAdvance (void) | Shows the bobbing arrow at the message window and waits for the player to go on. |
UNREAD_RESULT | btMessageWaitForAdvanceAt (Sint32 x, Sint32 y) | Shows the cursor bobbing at (x, y) and waits for the player to go on. |
UNREAD_RESULT | btUnitClearStatuses (Sint32 unitId) | Clears every status and stat change of a unit that goes down and works out its stats again. |
UNREAD_RESULT | btUnitRemoveEnemy (Sint32 unitId) | Takes an enemy out of the battle at once, one that leaves rather than falls. |
UNREAD_RESULT | btUnitProcessActionEnd (struct BATTLE_ACTION_RUN *plan) | The end of an action and of a turn: statuses counting down and Djinn recovering (battle_turn_end.c). |
UNREAD_RESULT | btProcessTurnEnd (void) | Ends a turn: sets recovered Djinn, then gives each unit its regeneration and counts down its stat changes and statuses, showing each that ends. |
Bool | btUnitRollCounterEarlyEnd (Sint32 unitId, Sint32 turns, Sint32 bias) | Rolls whether a stat change or status with five turns or fewer left ends early, at luck * 3 - turns * 5 + bias percent, and returns 1 when it does. |
Bool | btUnitCountDownAttackStage (Sint32 unitId) | Counts down an Attack change and returns 1 when it ends; a lowered Attack may recover early. |
Sint32 | btUnitCountDownDefenseStage (Sint32 unitId) | Counts down a Defense change; btProcessTurnEnd shows MsgDefNormal when it returns 1. |
Sint32 | btUnitCountDownResistanceStage (Sint32 unitId) | Counts down a Resistance change; btProcessTurnEnd shows MsgResNormal when it returns 1. |
Bool | btUnitCountDownAgilityStage (Sint32 unitId) | Counts down an Agility change and returns 1 when it runs out; it never ends early. |
Sint32 | btUnitCountDownDelusion (Sint32 unitId) | Counts down delusion, which may end early; btProcessTurnEnd shows MsgCureDelusion when it returns 1. |
Sint32 | btUnitCountDownConfusion (Sint32 unitId) | Counts down confusion, which may end early; btProcessTurnEnd shows MsgConfusionConscious when it returns 1. |
Sint32 | btUnitCountDownCharm (Sint32 unitId) | Counts down charm, which may end early; btProcessTurnEnd shows MsgCharmConscious when it returns 1. |
Sint32 | btUnitCountDownStun (Sint32 unitId) | Counts down stun, which may end early; btProcessTurnEnd shows MsgCureStun when it returns 1. |
Sint32 | btUnitCountDownSleep (Sint32 unitId) | Counts down sleep, which may end early; btProcessTurnEnd shows MsgWakes when it returns 1. |
Bool | btUnitCountDownPsynergySeal (Sint32 unitId) | Counts down both seals in UNIT.psySeal and returns 1 when the last ends; only Bind's, once Luff's is gone, may end early. |
Bool | btUnitCountDownRegenerate (Sint32 unitId) | Counts down UNIT.regenerate and returns 1 when it runs out; it never ends early. |
Bool | btUnitCountDownReflect (Sint32 unitId) | Counts down Reflect and returns 1 when it runs out; it never ends early. |
Sint32 | btDjinnRecoveryCountDown (void) | Brings the party's recovering Djinn one turn nearer, setting each that is ready, and returns 1 when any was set. |
Sint32 | btDjinnRecoverAll (void) | Runs btDjinnRecoveryCountDown twenty times, which sets every recovering Djinni of a party member with HP; those on standby stay so. |
void | btTurnEndNoOperation (void) | Does nothing; btRun calls it at the end of each turn and of the battle. |
Sint32 | btAutoBattleBuildActions (struct BATTLE_ACTION *entries) | Auto battle, the battle test menu's mode (battle_auto_battle.c). |
Sint32 | btAutoBattleRunAction (struct BATTLE_ACTION *action) | Unused: turns the camera while L or R is held. |
Sint32 | btAutoBattleShowDefend (const struct BATTLE_ACTION *action) | Shows "<unit> is defending!" for a standing unit. |
Sint32 | btAutoBattleRunPsynergy (struct BATTLE_ACTION *action) | Casts Psynergy: the caster's side fades out while the effect, run as a summon is (btEffectRunSummon), plays over the target's side. |
Sint32 | btAutoBattleRunApproachAttack (struct BATTLE_ACTION *input) | Unused auto battle attack: "<unit> attacks!", the attacker runs up to its target, the blow, and both return. |
Sint32 | btAutoBattleRunAttackOrItem (struct BATTLE_ACTION *action) | An attack or an item, played on the first living unit of the target's side. |
void | btAutoBattleApplyDamage (Uint32 unitId, Sint32 damage, Sint32 showMsg, Uint8 *context) | Unused auto battle damage: takes damage HP from a unit and shows it, with "A bitter blow!" or "A critical hit!" first when showMsg is set. |
Sint32 | btAbilityReplaceDefeated (const struct BATTLE_ACTION *action) | Returns the action's target, or a random living unit of its side when the target is down; TARGET_SIDE_DEFEATED when none is left. |
Sint32 | btObjectIsValidId (Uint32 unitId) | Returns 0 for a party member's or an enemy's unit id, -1 for any other. |
Bool | btFleePlayRun (struct BATTLE_ACTION *action) | The party tries to run, and gets away 15 times in 16. |
void | btMotionPlayFall (Sint32 unitId) | For a unit whose HP has run out: plays its falling effect to the last tick and marks its battle object for release (btObjectMarkForRelease). |
void | btCameraAdjustByShoulderKeys (void) | Unused: turns the camera while L or R is held. |
struct BATTLE_OBJECT * | btObjectGet (Sint32 unitId) | The battle objects: each unit's place, sprites, pose and status icons (battle_objects.c, battle_placement.c, battle_sprite_slots.c). |
void | btObjectSpawnObjectsForList (Sint16 *unitIds, Sint32 refreshPoses) | Readies the sprites of the units in the list and releases everyone else's; with refreshPoses, sets every listed unit's pose again. |
UNREAD_RESULT | btObjectUpdatePose (Sint32 unitId) | Sets a unit's pose to match its state, held, down or standing, and sets its sway a little out of step with its neighbours'. |
void | btObjectUpdateSpritePriorities (void) | Runs each tick of a battle: advances the status icons, hides an airborne unit's shadow, and draws whichever side is nearer the camera in front. |
UNREAD_RESULT | btUnitBuildStatusFlags (Sint32 unitId, struct BATTLE_OBJECT *battleObject) | Builds the status icon bits of unit id's statuses into its battle object's activeStatuses, which btStatusIconCycle shows. |
UNREAD_RESULT | btStatusIconCycle (struct BATTLE_OBJECT *battleObject) | Shows a unit's status icons one after another, and removes the icon when no status is left. |
void | btObjectDestroySprites (Sint32 unitId) | Releases every sprite unitId's actor holds and leaves it with none, clearing the battle object's animationEntry and shadowEntry. |
void | btObjectDestroyAll (void) | |
Sint32 | btObjectMarkForRelease (Sint32 unitId) | Frees the enemy sprite slots a unit holds and marks its actor for release at the end of the action. |
Sint32 | btObjectGetAnchor (Sint32 place, POS *pos) | Unused: writes the battlefield spot of place (its anchor, on the ground) to pos, and returns 0. |
void * | btActorGetSprite (struct ACTOR *actor, Sint32 spriteIndex) | Returns sprite spriteIndex of an actor (0 only, for a single sprite), or null when it has no such sprite. |
void | btSpriteDetachScripts (void *sprite) | Detaches the scripts from the four layers (SPR.entries) of one sprite. |
void | btActorDetachSpriteScripts (struct ACTOR *actor) | Unused: detaches the scripts from every sprite of a unit's actor. |
UNREAD_RESULT | btCameraApplyTransform (void) | Sets up the camera's view for projecting points, tilted further while commands are chosen. |
void | btCameraSetDefaultView (void) | Puts the battle camera at its default view of the battlefield's centre. |
Sint32 | btMotionProjectPos (Sint32 unitId, Sint32 *projected) | Projects unit id's position onto the screen, into projected (its pixel x and y, then its depth; syConvert3Dto2D). |
void | btObjectMake (struct BATTLE_OBJECT *battleObject, Sint32 unitId, Sint32 x, Sint32 y) | Creates the battle object of a unit at (x, y) on the battlefield: its sprite, palette, size and weapon, turned to face the centre. |
void | btPlacementGetStepPair (Sint32 partyPlace, Sint32 *x, Sint32 *y) | Unused: reads the battlefield position of a party place. |
void | btPlacementLayoutEnemies (Uint16 *unitIds, Sint32 count, Sint32 *xPositions, Sint32 *zPositions) | Lays out count enemies in a column left of the centre, spaced by their size, from a rough estimate of the column's length. |
UNREAD_RESULT | btPlacementRelayoutEnemies (void) | Lays the enemies out again and moves each one's battle object anchor to its new place. |
Bool | btPlacementContainsId (Sint16 *list, Sint32 place) | Returns 1 if the unit at place is in list. |
void | btUnitRefreshPlacement (void) | Places every unit at the start of a battle and creates its battle object at its spot. |
Sint32 | btEnemyGetFreeUnitId (void) | Returns the id of the first free enemy unit, or -1 when all six are taken. |
void | btObjectPut (void) | Readies the sprite of every unit in the battle (releasing those of units that left) and sets each one's display mode and motion afresh. |
void | btObjectPutKeepingPoses (void) | Readies the sprite of every unit in the battle (releasing those of units that left), keeping their modes and motions. |
Sint32 | btObjectGetPalette (Sint32 id) | Returns the palette of unit id's battle object. |
UNREAD_RESULT | btObjectReleaseSpriteSlots (Sint32 unitId) | Frees every enemy sprite slot unit unitId holds, unloading its sprite. |
Sint32 | btEnemyHasSpriteRoom (Sint32 enemyId) | Returns 1 if the enemy would find room among the enemy sprite slots, two side by side for a large one. |
Sint32 | btEnemySpriteLoadIntoSlots (Sint32 unitId) | Loads an enemy's battle sprite into the first free enemy sprite slots, the Kraken's and the Fusion Dragon's second part too. |
Sint32 | btUnitGetWeaponKind (Sint32 itemId) | Returns the kind (BATTLE_WEAPON_KIND) of the weapon whose item id is itemId, which picks a party member's weapon sprite. |
Sint32 | btUnitGetWeaponSprite (Sint32 unitId) | Returns the weapon sprite a party member's attack shows for the weapon they have equipped, or 0. |
Sint32 | btSpriteGetEffectHeight (Sint32 index) | A battle sprite's own figures: its effect height, hop, sounds and palette (battle_sprite.c). |
Sint32 | btSpriteHasHeavyImpact (Sint32 index) | Returns 1 for an enemy whose blow lands with SE_HEAVY_IMPACT, the Venus Lighthouse aerie's bosses. |
Uint32 | btSpriteGetAttackHop (Uint32 index) | Returns how high an enemy hops as it runs up to attack, in pixels; 0 out of range. |
Sint32 | btSpriteIsSmall (Sint32 index) | Returns 1 for a small enemy, which takes one enemy sprite slot instead of two and stands closer to its neighbours; 0 out of range. |
Uint32 | btSpriteGetDefeatSound (Sint32 index) | Returns the enemy's defeat-sound kind, 0 to 4, or -1 for none; a fallen enemy's sound is SE_ENEMY_CRY plus it. |
Sint32 | btSpriteGetSprite (Sint32 index) | Returns the enemy's battle sprite, row 0's for an index out of range. |
Sint32 | btSpriteGetPalette (Sint32 index) | Open question (no evidence in reach): whether returning the sprite for a bad index is a slip copied from btSpriteGetSprite. |
Uint32 | btSpriteGetAttackEffect (Uint32 index) | Returns the beam an enemy's plain attack shows, 1 for none or out of range. |
void | btMotionApproachTarget (Sint32 unitId, Sint32 targetId, Sint32 ticks, Sint32 initVelocityY) | The units' movements: running up, leaping, knocked back and returning (battle_motion.c). |
void | btMotionLeapBack (Sint32 unitId) | Unused: sends a unit leaping back from the centre in its damage pose. |
void | btMotionLeapToward (struct BATTLE_OBJECT *startSlot, struct BATTLE_OBJECT *endSlot, Sint32 progress) | Unused: sends one unit leaping progress percent of the way toward another. |
void | btMotionRestartLeap (Sint32 unitId) | Unused: restarts unit id's motion in POSE_LEAP. |
void | btMotionHopBack (Sint32 unitId) | Sends unitId hopping out to one and a half times its spot's distance from the centre. |
void | btMotionApplyKnockback (Sint32 unitId, Sint32 variant) | Knocks a unit back as the knockback variant says, in its damage pose; the Fusion Dragon only takes the pose. |
void | btMotionReturnToSpot (Sint32 unitId) | Sends unitId back to its spot, landing exactly there (snapToTarget), and turns it to face the centre at once. |
void | btMotionReturnObjectToSpot (struct BATTLE_OBJECT *battleObject) | Unused: sends a unit's actor back to its spot. |
void | btMotionSetupEscapeObject (Sint32 unitId) | Sends unitId running off its side of the battlefield, three times as far out as its spot, with a hop, in POSE_STANDING. |
void | btMotionApplyPairMidpoint (Sint32 firstId, Sint32 secondId) | Unused: works out the point halfway between two units and hands it to a function that does nothing. |
void | btMotionMidpointNoOperation () | Does nothing; btMotionApplyPairMidpoint, its only caller, passes it a position and a distance. |
void | btMotionPlayHitFlash (Sint32 unitId) | Unused: plays the hit flash on unit id's sprite and waits ten ticks. |
Sint32 | btMotionProjectScaledPos (Sint32 unitId, Sint32 *projected) | Projects the point above a unit where its battle effects play onto the screen, scaled as its sprite is. |
Sint32 | btMotionProjectCursorPoint (Sint32 unitId, Sint32 *projected) | Projects the point above a unit onto the screen: the target cursor's place, EFFECT_HEIGHT_SMALL up for a small enemy and EFFECT_HEIGHT_LARGE for others, scaled as the sprite is. |
Sint32 | btUnitGetEffectHeight (Sint32 unitId) | Returns the height above a unit where its battle effects play, in 16.16 pixels: its battle sprite row's own, else EFFECT_HEIGHT_SMALL for a small enemy and EFFECT_HEIGHT_LARGE for others. |
void | btTransitionRun (Sint32 enemyCount, Sint32 encounterId) | The opening transition (battle_transition.c). |
Sint32 | btTransitionRunMosaicFadeOut (void) | Fades the screen to black over sixteen ticks as every background's mosaic blocks grow wider, then shows no layer. |
void | btTransitionBuildAffineTilemap (void *tilemap) | Builds the zoomed background's 32 by 32 affine map, in which the background picture's two halves come from character blocks 2 and 3. |
void | btTransitionBuildFlatTilemap (void *tilemap) | Builds BG1's flat map of the same picture: its tiles in rows 6 to 20, from screen line 16 at BATTLE_BACKGROUND_SCROLL_Y, and the last tile in the rows around them. |
void | btTransitionUploadTileVariant (void) | Unused: steps the curtain's solid tile through eight variants, a new one every four ticks. |
void | btTransitionAdvanceOpening (void) | Advances the curtain opening by a tick: BG0 slides into place as the camera turns round to the party and zooms out. |
void | btTransitionDrawRows (void) | Draws the curtain opening from the middle of the screen, one row up and one down every eight ticks. |
void | btTransitionClearBg0Vofs (void) | Clears BG0's scroll from the line the interrupt fires on. |
void | btBackgroundShowZoomedPage (void) | Shows the zoomed background's finished page each VBlank. |
void | btBackgroundInit (void) | The battle background, the camera's view and the units' highlights (battle_background.c). |
void | btBackgroundFree (void) | Frees the zoomed background's scanline state. |
void | btBackgroundLoad (Sint32 mode, Sint32 resourceId, Sint32 level) | Loads a battle background, its picture, its palette darkened by level (none when negative) and both its maps. |
void | btBitDecoderDecodeImage (void) | The ARM decoder for a battle background's image, which btBackgroundLoad copies to RAM and runs as a BIT_DECODER. |
void | btBackgroundSetMode (Sint32 mode, Sint32 unusedResource, Sint32 fade) | Switches the background's display mode, optionally fades its palette by fade, and rebuilds both its maps. |
void | btBackgroundSetPaletteLevel (Sint32 unused, Sint32 level) | Darkens the background by level, 0 for its own colours. |
void | btBackgroundFadeAlphaOut (void) | Fades BG2 out over the backdrop in eight ticks. |
void | btBackgroundFadeAlphaIn (void) | Fades BG2 in over the backdrop in eight ticks. |
void | btBackgroundSetBlendControl (void) | Unused: lightens every layer by REG_BLDY. |
void | btBackgroundStepHighlightBlend (void) | Lightens the highlighted units by the next step of the blend ramp: the first sixteen steps once, then the second sixteen over and over. |
Sint32 | btBackgroundDivideBy16 (Sint32 value) | Unused: returns value divided by 16. |
void | btCameraSetView (Sint32 x, Sint32 depth, Sint32 y, Sint32 zoom) | Points the battle camera at (x, depth, y) with a zoom in percent, and lines the zoomed background up with it. |
void | btCameraSetViewAtPairMidpoint (Sint32 firstUnitId, Sint32 secondUnitId, Sint32 zoom) | Points the battle camera at the ground between two units, with a zoom in percent. |
void | btCameraSetViewAtDepth (Sint32 x, Sint32 depth, Sint32 y, Sint32 zoom) | |
void | btCameraSetRange ( FIXED centerX, FIXED centerY, Sint32 offsetX, Sint32 offsetY, FIXED scale) | Builds the zoomed background's next page for a zoom of scale about centerX and centerY, shifted by offsetX and offsetY, and shows it: below a zoom of 1 the plane lies flat, from 1 it wraps and turns with the camera. |
void | btHighlightSetModes (Uint16 *selectedUnits, Sint32 mode) | Highlights the units in selectedUnits, the others turning semi-transparent, or with HIGHLIGHT_OFF stops the highlight. |
void | btHighlightSetSpriteMode (Sint32 unitId, Sint32 mode) | Sets the sprite mode of a unit's picture and its shadow. |
void | btHighlightSetOtherSpriteModes (Sint32 selectedUnitId) | Unused: makes every unit's sprites semi-transparent but selectedUnitId's. |
void | btHighlightClearAllSpriteModes (void) | Returns every unit's sprites to SPRITE_OPAQUE. |
void | btMatrixSetUnit (MATRIX matrix) | Unused: sets matrix to the unit matrix, then puts its old first element plus toFIXED(1) in its second, where the unit matrix has 0. |
Sint32 | btAdjustDebugValue (Sint32 selectedValue) | Unused debug aid: while Start is held, edits a value with the d-pad until A takes it; with Select held, returns DEBUG_VALUE_SELECT. |
void | btElementGlowPlay (Sint32 unitId, Sint32 element, Sint32 mode, Sint32 variant) | Plays a glow of the element about a unit, and returns when it is over: the star field, the streaks, the pillar or the burst. |
Sint32 | btElementGlowInitStarField (Sint32 element) | Starts a star field of the element: sixteen sparks on random rings and three rings 120 degrees apart. |
UNREAD_RESULT | btElementGlowUpdateStarField (void) | Draws the star field's next tick: each spark falls towards the centre and shrinks as its life runs out, and the three rings move outward. |
void | btElementGlowUploadStarField (void) | |
Sint32 | btElementGlowEnd (Sint32 unused) | Ends a star field and turns BG2 off. |
Sint32 | btGraphicsScaleRGB555Clamped (Uint16 *src, Uint16 *dest, FIXED scale, Sint32 count) | Copies count colours from source to destination, each channel scaled by scale (16.16, at most 1), and returns 0. |
void | btBackgroundRestorePalette (void) | Copies the background's saved palette back undarkened, as the star field of btElementGlowPlay leaves it dark. |
void | btIRQRemoveVCountHandler (void) | Removes the VCount interrupt's handler, as btTransitionRun installs one; nothing calls it. |
Sint32 | btFormationBuildEnemyList (Sint32 formationId) | Formations and the enemies' levels and name letters (battle_formation.c). |
Sint32 | btFormationGetRandomMember (Sint32 formationId) | Returns the enemy id of a random member of the formation that may appear. |
Sint32 | btFormationAverageLevel (Sint32 formationId) | Returns a formation's average enemy level for the monster battles, or a negative reason it may not be chosen. |
Sint32 | btFormationSelectLevelMatchedCandidate (Sint32 *outMargin) | Chooses a monster battle's formation for the party's level plus its winning streak, at random among those at most 3 above it, and returns it with the levels its enemies must gain in outMargin. |
void | btEnemyAdjustLevel (Sint32 unitId, Sint32 levels) | Raises an enemy by levels, or lowers it for a negative count, each stat by a fixed amount a level and no lower than 70 percent of what it was. |
Sint32 | btEnemyClaimNameLetter (Sint32 enemyId, Sint32 unused) | Gives an enemy its name letter, which tells it from others of its kind: digits abroad and the alphabet in Japanese. |
UNREAD_RESULT | btEnemyReleaseNameLetter (Sint32 unitId) | Frees a departing enemy's name letter for the next of its kind. |
UNREAD_RESULT | btEnemyLetterFirstOfKind (Sint32 enemyId) | Gives the first enemy of the kind on the field the first letter (0), appended to its name, once a second of its kind arrives. |
UNREAD_RESULT | btLinkBattleSendParty (void) | Link battles (battle_link.c). |
Sint32 | btLinkBattleReceiveParty (void) | Unused: receives the opponent's party into the enemy units, "Enemy" before each name, then its Djinn recovery list. |
Sint32 | btLinkBattleWaitSync (void) | In a link battle, shows the "EXEC" signature and waits up to 30 ticks for the other console to show it too. |
Sint32 | btLinkBattleSyncTurn (void) | In a link battle, after each action and each turn, steps both consoles through the same handshake of signatures. |
UNREAD_RESULT | btPartyAssignOpponentSlots (void) | Records the unit id the link opponent knows each party member by. |
Sint32 | btClearSerialTransferPayload (void) | Clears the first 16 bytes of the link transfer's payload, the eight signature halfwords btLinkBattleWaitSync and btLinkBattleSyncTurn write. |
Uint8 * | btTextCopyFourCharsUnderscored (Uint32 unusedA, Uint32 unusedB, Uint16 *src) | Copies a name's first four characters, an underscore for each zero, and returns a pointer to the end. |
Sint32 | btEnemyRecordDefeat (Sint32 unitId, Sint32 djinnBonus) | Spoils (battle_spoils.c). |
void | btAwardSpoils (void) | Hands out the spoils after a victory: experience to each party member still standing, with every level gained, then the coins, then the items best first. |
void | btSpoilsClear (void) | Empties the battle's spoils (BATTLE_STATE.spoils) and MainRoutineStateWork.pendingItem. |
Uint32 | btSpoilsRankItem (Uint32 inventoryEntry) | Returns an item's rank among the spoils: an indispensable item first, then a rare one, then the higher item id; 0 for none. |
void | btDebugBattleRunMenu (void) | Debug: the battle test menu, its parameter sets and message viewer (battle_debug.c), and Select in its chooser, which does nothing (battle_spoils.c). |
Sint32 | btDebugParamSetLoad (Sint32 set) | Debug: replaces the party with parameter set number set, each member at its level with its Djinn, abilities and equipped items. |
void | btDebugBattleViewMessages (void) | Debug: a message viewer that never returns, showing one message at a time with sample arguments. |
void | btDebugSelectNoOperation (void) | Does nothing; the debug battle menu (btDebugBattleRunMenu) calls it. |
Variables
| Name | Description | |
|---|---|---|
extern const Sint8 | BattlePlacementSpots [] | Battlefield (x, y) pixel pairs by place: 0 to 3 the party's column at x 80, 32 pixels apart, and 5 to 10 a column at x -80, 20 apart (battle_tables.c). |
extern const Uint16 | BattleUnitWeaponKinds [] | Each weapon's kind: bits 15..9 the kind, which indexes each member's weapon animation table (BattleUnitWeaponAnimationsIsaac and the rest), and 8..0 the item id; ended by 0xffff (btUnitGetWeaponKind). |
extern const Uint8 | BattleAIActionWeights [3][8] | The weights an enemy picks among its eight actions by, one table for each weighted action strategy (ENEMY_ACTION_STRATEGY, battle_internal.h): even, falling by 6, or falling steeply from 113 to 5. |
extern FIXED | BattleKnockbackAcceleration [] | The knockback's speed gained each tick by variant (BATTLE_KNOCKBACK), 16.16 pixels a tick: 1, but 8 for KNOCKBACK_HURL. |
extern Sint32 | BattleKnockbackDistancePercent [] | The knockback's reach by variant, in percent of the unit's distance from the centre: 140 to 200, 100 for KNOCKBACK_BOUNCE and KNOCKBACK_JOLT. |
extern FIXED | BattleKnockbackSpeedLimit [] | The knockback's top speed by variant, 16.16 pixels a tick: 4, but 20 for KNOCKBACK_HURL. |
extern FIXED | BattleKnockbackVelocityY [] | The knockback's hop by variant, 16.16 pixels a tick upward: 2 to 10. |
extern const Sint8 | BattleFormationCenteredOffsets [] | A fixed formation's places by order, as offsets from the middle place: 0, -1, 1, -2, 2 and so on out to 4. |
extern const struct BATTLE_SIDE_ORDER | BattleTurnEndSideOrder | Turn-end effects go to the party (BATTLE_SIDE_MASK_PARTY), then the enemies (BATTLE_SIDE_MASK_ENEMIES). |
extern const Sint32 | BattleObjectEmptyScript [] | A lone SC_END: a battle unit's actor script, which btObjectMake starts. |
extern Uint8 | BattleMessageAdvanceArrowTiles [] | The advance arrow beside a battle message: eight 128-byte pictures of a 256-colour sprite, one every four ticks. |
extern const Uint8 | BattleTransitionCurtainTiles [] | The battle transition's curtain tiles, 32 bytes (one 4-bit tile) each. |
extern const Uint8 | BattleTransitionCurtainVariants [] | Eight curtain tiles, 32 bytes each, of which the transition copies one at a time into the curtain's first tile. |
extern const Uint16 | BattleUnitWeaponAnimationsGaret [] | Garet's weapon sprite by weapon kind (btUnitGetWeaponSprite). |
extern const Uint16 | BattleUnitWeaponAnimationsIvan [] | Ivan's weapon sprite by weapon kind. |
extern const Uint16 | BattleUnitWeaponAnimationsMia [] | Mia's weapon sprite by weapon kind. |
extern const Uint16 | BattleUnitWeaponAnimationsJenna [] | Jenna's weapon sprite by weapon kind; Felix draws none. |
extern Uint8 | BitDecoderSize [] | The size of btBitDecoderDecodeImage, which btBackgroundLoad copies to HEAP_SLOT_RAM_CODE_TEMP; ld_script.ld defines it as an address equal to the size. |
extern const FIXED | BattleCameraCommandMatrix [] | The extra matrix the battle camera's projection applies first while commands are chosen (FLAG_CHOOSING_COMMANDS), in 16.16 words. |
extern Sint32 | ElementGlowSparkPictures [] | Where SPARK_STATE.sheet holds the spark's square picture for each tick of life left, 0 to 6: byte offsets, a byte a pixel. |
extern Uint8 | ElementGlowSparkSizes [] | The spark's width and height in pixels by ticks of life left: 2 to 4, 4 from three; a spark with no life left is not drawn. |
extern Sint32 | ElementGlowRingPictures [] | Where SPARK_STATE.sheet holds the ring's four 32 by 32 ticks: byte offsets, 1,024 apart. |
extern Sint8 | BattleHighlightBlendRamp [] | The highlighted units' BLDY lightening: 15 down to 0 once, then the second sixteen (a pulse up to 8 and back) over and over. |
extern Uint16 | EncounterZones [] | The 104 encounter zones (encounter_zones.c), read as ENCOUNTER_ZONE rows. |
extern const Uint16 | BattleUnitWeaponAnimationsIsaac [] | Isaac's weapon sprite by weapon kind (btUnitGetWeaponSprite). |
Description
The battle module's functions and globals, as the other modules see them: its
tables, types and constants, then its functions, grouped by the part of
battle.c that holds them.
Macros in detail
ADVANCE_ARROW_PICTURE_BYTES
#define ADVANCE_ARROW_PICTURE_BYTES 128
One picture of the advance arrow: 8 by 16 pixels, a byte a pixel.
Referenced by btMessageWaitForAdvance(), btPlaybackRun() and btRun().
Definition at line 64 of file battle.h.
MindReadStateWork
#define MindReadStateWork
The HEAP_SLOT_MIND_READ heap slot: Mind Read's wave state while its effect
runs.
Referenced by fdMindReadAdvanceTint(), fdMindReadStartRipple(), fdPsynergyStopMindReadWave() and fdPsynergyUpdateMindReadWave().
Definition at line 101 of file battle.h.
BattleEffectStateWork
#define BattleEffectStateWork
The heap slots from HEAP_SLOT_BATTLE_EFFECT, then the canvas and sprite
sheet: the running battle effect's BATTLE_EFFECT_STATE first.
Referenced by fdLuckyWheelsDrawCanvasLine(), fdLuckyWheelsSetUpBetting(), fdLuckyWheelsTransferCanvas() and fdLuckyWheelsUpdate().
Definition at line 105 of file battle.h.
EnemyUnits
#define EnemyUnits (*(Uint8 **)&HeapSlots[HEAP_SLOT_ENEMY_UNITS])
The HEAP_SLOT_ENEMY_UNITS heap slot: the six enemy battle units,
BATTLE_UNIT_SIZE bytes each, that gmUnitGet returns for unit ids 128 to 133
during a battle.
Referenced by btRun() and gmUnitGet().
Definition at line 110 of file battle.h.
BattleBackgroundStateWork
#define BattleBackgroundStateWork
The HEAP_SLOT_BATTLE_BACKGROUND heap slot: the camera's turn, which
battle_staging.c, battle_auto_battle.c and battle_turn.c set for each action,
and the background's display mode.
Referenced by btAutoBattleRunAction(), btAutoBattleRunApproachAttack(), btAutoBattleRunAttackOrItem(), btAutoBattleRunPsynergy(), btBackgroundInit(), btBackgroundSetMode(), btElementGlowInitStarField(), btGatherActions(), btStagingRunAttack(), btStagingRunItem(), btStagingRunPlainAttack() and btStagingRunPsynergyCast().
Definition at line 114 of file battle.h.
BATTLE_OUTCOME_LOST
#define BATTLE_OUTCOME_LOST -1
btRun's results besides the number of enemies defeated.
Referenced by btRun().
Definition at line 190 of file battle.h.
BATTLE_OUTCOME_FLED
#define BATTLE_OUTCOME_FLED 999
Referenced by btRun() and fdDjinnResolvePending().
Definition at line 191 of file battle.h.
BATTLE_BG1_SCREEN_BLOCK
#define BATTLE_BG1_SCREEN_BLOCK 31
BG1's map during a battle, a screen block: the battle background's, where the command row also places its icons' tiles.
Referenced by mnBattleCommandRowRun().
Definition at line 195 of file battle.h.
BATTLE_BACKGROUND_SCROLL_Y
#define BATTLE_BACKGROUND_SCROLL_Y 32
BG1's vertical scroll that sets the battle background in the battle view.
Referenced by btCameraShake(), btEffectEndCanvasLayer(), btEffectOpenCanvasLayer(), btEffectRunAttackSlash(), btEffectRunBoreas(), btEffectRunCriticalHit(), btEffectRunKirin(), btEffectRunShatteringOpening(), btEffectRunStarfieldFall(), btEffectSetupBlendedDisplay(), btEffectSetupCanvasTileMap(), btEffectStartCanvasLayer() and btTransitionRun().
Definition at line 197 of file battle.h.
BATTLE_ZOOM_NORMAL
#define BATTLE_ZOOM_NORMAL 100
btCameraSetView's zoom, in percent, for the battle's usual view.
Referenced by btAutoBattleRunPsynergy(), btEffectOpenCanvasLayer(), btEffectRunDragonCloud(), btEffectRunFire(), btEffectRunShatteringOpening(), btEffectStartCanvasLayer(), btStagingRunAttack(), btStagingRunFullScreen(), btTransitionAdvanceOpening() and btTransitionRun().
Definition at line 199 of file battle.h.
PUSH_MESSAGE
#define PUSH_MESSAGE(message) btPlaybackPush(PLAYBACK_MESSAGE, (message))
Pushes a message to show, waiting for the player to read it.
Referenced by btAbilityApplyToTarget(), btProcessTurnEnd() and btUnitProcessActionEnd().
Definition at line 202 of file battle.h.
DEFINE_ADJUST_CAMERA
#define DEFINE_ADJUST_CAMERA(name)
Defines a function that turns the battle camera a 128th of a turn each tick L
or R is held, and centres the background's zoom unless a view holds it. Two
such functions exist, one each in battle_auto_battle.c and battle_turn.c.
Referenced by btAutoBattleRunAction() and btTurnStartNoOperation().
Definition at line 207 of file battle.h.
Enumerations in detail
BATTLE_KNOCKBACK
enum BATTLE_KNOCKBACK
btMotionApplyKnockback's knockbacks, the columns of the BattleKnockback*
tables in knockback_tables.c. Each is named by how far and how high it sends
the unit, as percent of its spot's distance from the centre and its hop in
pixels a tick; all but KNOCKBACK_HURL accelerate by 1 pixel a tick to at most
4.
| Enumerator | Value | Description |
|---|---|---|
KNOCKBACK_NUDGE | 140 percent, a hop of 3 | |
KNOCKBACK_HOP | 140 percent, a hop of 6 | |
KNOCKBACK_LEAP | 150 percent, a hop of 7 | |
KNOCKBACK_LAUNCH | 200 percent, a hop of 10 | |
KNOCKBACK_HURL | 200 percent, a hop of 5; hardest (+8 pixels/tick, max 20) | |
KNOCKBACK_SKID | 150 percent, a hop of 2 (airborne units from here on take the new hop) | |
KNOCKBACK_BOUNCE | the spot itself, a hop of 3 | |
KNOCKBACK_JOLT | the spot itself, a hop of 5.5 |
Definition at line 135 of file battle.h.
BATTLE_POSE
enum BATTLE_POSE
The battle sprites' animations (fdSpriteStartAnimation numbers) that the
battle code picks by name.
| Enumerator | Value | Description |
|---|---|---|
POSE_STILL | 0 | first standing picture held, no breathing: |
POSE_STANDING | 1 | asleep/stunned/held enemy |
POSE_LEAP | 2 | running up to a target and leaping |
POSE_CAST | 3 | a hand raised to cast or use an item |
POSE_PARTY_HELD | 4 | asleep, stunned or held; also a downed party member |
POSE_DAMAGE | 5 | taking damage |
POSE_ENEMY_DOWN | 5 | a downed enemy stays in its damage pose |
Definition at line 151 of file battle.h.
BATTLE_SPR_MODE
enum BATTLE_SPR_MODE
A battle unit's sprites' OBJ mode, as btHighlightSetSpriteMode sets it: faded
units are semi-transparent, and the battle's blends act on them.
| Enumerator | Value | Description |
|---|---|---|
SPRITE_OPAQUE | ||
SPRITE_SEMI_TRANSPARENT |
Definition at line 165 of file battle.h.
BATTLE_HIGHLIGHT
enum BATTLE_HIGHLIGHT
btHighlightSetModes' mode, kept in BATTLE_STATE.highlightMode: whether the
selected units are highlighted, every other unit faded.
| Enumerator | Value | Description |
|---|---|---|
HIGHLIGHT_OFF | ||
HIGHLIGHT_SELECTED |
Definition at line 173 of file battle.h.
BATTLE_ELEMENT_GLOW
enum BATTLE_ELEMENT_GLOW
The glows btElementGlowPlay plays about a unit in its element.
| Enumerator | Value | Description |
|---|---|---|
GLOW_STAR_FIELD | The star field gathering on the unit while the background darkens: a cast | |
GLOW_STREAKS | the element's streaks: an enemy's cast | |
GLOW_PILLAR | the element's pillar, at a strength: a summon's boost | |
GLOW_BURST | the element's burst: a Djinni set |
Definition at line 180 of file battle.h.
Functions in detail
btCameraAdjustByShoulderKeysAlternate
void btCameraAdjustByShoulderKeysAlternate(void)
Referenced by btTurnStartNoOperation().
Definition at line 258 of file battle.h.
btBitDecoderDecodeImage
void btBitDecoderDecodeImage(void)
The ARM decoder for a battle background's image, which btBackgroundLoad
copies to RAM and runs as a BIT_DECODER.
Referenced by btBackgroundLoad().
Definition at line 453 of file battle.h.
Variables in detail
BattleMessageAdvanceArrowTiles
extern Uint8 BattleMessageAdvanceArrowTiles[]
The advance arrow beside a battle message: eight 128-byte pictures of a 256-colour sprite, one every four ticks.
Referenced by btMessageWaitForAdvance() and btPlaybackRun().
Definition at line 62 of file battle.h.
BattleTransitionCurtainTiles
extern const Uint8 BattleTransitionCurtainTiles[]
The battle transition's curtain tiles, 32 bytes (one 4-bit tile) each.
Referenced by btTransitionRun().
Definition at line 66 of file battle.h.
BattleTransitionCurtainVariants
extern const Uint8 BattleTransitionCurtainVariants[]
Eight curtain tiles, 32 bytes each, of which the transition copies one at a time into the curtain's first tile.
Referenced by btTransitionUploadTileVariant().
Definition at line 69 of file battle.h.
BitDecoderSize
extern Uint8 BitDecoderSize[]
The size of btBitDecoderDecodeImage, which btBackgroundLoad copies to
HEAP_SLOT_RAM_CODE_TEMP; ld_script.ld defines it as an address equal to the
size.
Referenced by btBackgroundLoad().
Definition at line 81 of file battle.h.