src/battle/battle_sprite_slots.c
Battle sprites: enemy sprite slots and the party's weapon sprites. More…
Included by battle.c.
Macros
| Name | Description | |
|---|---|---|
#define | ENEMY_SPRITE_SLOT_SIZE (16 * 1024) | Each enemy sprite slot owns 16 KB of RamEnemySpriteSlots. |
Functions
| Name | Description | |
|---|---|---|
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. |
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. |
UNREAD_RESULT | btObjectReleaseSpriteSlots (Sint32 unitId) | Frees every enemy sprite slot unit unitId holds, unloading its sprite. |
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. |
Description
Battle sprites: enemy sprite slots and the party's weapon sprites. Part of
battle.c.
Macros in detail
ENEMY_SPRITE_SLOT_SIZE
#define ENEMY_SPRITE_SLOT_SIZE (16 * 1024)
Each enemy sprite slot owns 16 KB of RamEnemySpriteSlots.
Referenced by btEnemySpriteLoadIntoSlots().
Definition at line 33 of file battle_sprite_slots.c.
Functions in detail
btObjectPut
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.
References btObjectSpawnObjectsForList() and btUnitListIds().
Referenced by btAbilityApplyToTarget(), btAutoBattleRunPsynergy(), btRun(), btStagingDispatchAction() and btStagingRunFullScreen().
Definition at line 8 of file battle_sprite_slots.c.
btObjectPutKeepingPoses
void btObjectPutKeepingPoses(void)
Readies the sprite of every unit in the battle (releasing those of units that left), keeping their modes and motions.
References btObjectSpawnObjectsForList() and btUnitListIds().
Referenced by btStagingRunAttack().
Definition at line 18 of file battle_sprite_slots.c.
btObjectGetPalette
Sint32 btObjectGetPalette(Sint32 id)
Returns the palette of unit id's battle object.
References btObjectGet() and Sint32.
Referenced by btMotionFlashHit() and btPlaybackRun().
Definition at line 27 of file battle_sprite_slots.c.
btEnemyHasSpriteRoom
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.
References btSpriteIsSmall() and Sint32.
Referenced by btAbilityApplyToTarget().
Definition at line 37 of file battle_sprite_slots.c.
btEnemySpriteLoadIntoSlots
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. Returns the sprite with its
first slot (SPRITE_PICTURE_TAG), or 0.
References btSpriteGetPalette(), btSpriteGetSprite(), btSpriteIsSmall(), fdSpritePictureCacheLoadStub(), gmUnitGetStub() and Sint32.
Referenced by btObjectMake().
Definition at line 61 of file battle_sprite_slots.c.
btObjectReleaseSpriteSlots
UNREAD_RESULT btObjectReleaseSpriteSlots(Sint32 unitId)
Frees every enemy sprite slot unit unitId holds, unloading its sprite. Clears
those BattleStateWork->spriteSlots.
References fdSpritePictureCacheLoadStub() and Sint32.
Referenced by btObjectMarkForRelease().
Definition at line 127 of file battle_sprite_slots.c.
btUnitGetWeaponKind
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.
References BattleUnitWeaponKinds and Sint32.
Referenced by btUnitGetWeaponSprite().
Definition at line 144 of file battle_sprite_slots.c.
btUnitGetWeaponSprite
Sint32 btUnitGetWeaponSprite(Sint32 unitId)
Returns the weapon sprite a party member's attack shows for the weapon they have equipped, or 0.
References BattleUnitWeaponAnimationsGaret, BattleUnitWeaponAnimationsIsaac, BattleUnitWeaponAnimationsIvan, BattleUnitWeaponAnimationsJenna, BattleUnitWeaponAnimationsMia, btUnitGetWeaponKind(), gmInventoryFindEquippedStub(), gmUnitGetStub() and Sint32.
Referenced by btObjectMake().
Definition at line 170 of file battle_sprite_slots.c.