Skip to Content
The Alchemy Project

src/battle/battle_sprite.c

Each enemy's battle sprite, palette, size, attack effect, hop, impact, defeat sound and effect height getters. More…

Included by battle.c.

Macros

NameDescription
#defineENEMY_CLASS_LAST 386The last enemy with a row in BattleSprites (battle_sprites.c).

Functions

NameDescription
Uint32btSpriteGetDefeatSound (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.
Sint32btSpriteGetSprite (Sint32 index)Returns the enemy's battle sprite, row 0's for an id out of range.
Sint32btSpriteGetPalette (Sint32 index)Returns the enemy's sprite palette.
Sint32btSpriteIsSmall (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.
Uint32btSpriteGetAttackEffect (Uint32 index)Returns the battle effect an enemy's plain attack shows, 1 for none or out of range.
Uint32btSpriteGetAttackHop (Uint32 index)Returns how high an enemy hops as it runs up to attack, in pixels; 0 out of range.
Sint32btSpriteHasHeavyImpact (Sint32 index)Returns 1 for an enemy whose blow lands with a heavier impact; 0 out of range.
Uint32btSpriteGetEffectHeight (Uint32 index)Returns the height a battle effect is drawn at over an enemy, in pixels, or 0 for its size's default; 0 out of range.

Description

Each enemy's battle sprite, palette, size, attack effect, hop, impact, defeat sound and effect height getters. Part of battle.c.

Macros in detail

ENEMY_CLASS_LAST

#define ENEMY_CLASS_LAST 386

The last enemy with a row in BattleSprites (battle_sprites.c).

Referenced by btSpriteGetAttackEffect(), btSpriteGetAttackHop(), btSpriteGetEffectHeight(), btSpriteGetPalette(), btSpriteGetSprite(), btSpriteHasHeavyImpact() and btSpriteIsSmall().

Definition at line 16 of file battle_sprite.c.

Functions in detail

btSpriteGetDefeatSound

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. Reads any index unchecked.

References BattleSprites and Sint32.

Referenced by btPlaybackRun().

Definition at line 6 of file battle_sprite.c.

btSpriteGetSprite

Sint32 btSpriteGetSprite(Sint32 index)

Returns the enemy's battle sprite, row 0's for an id out of range.

References BattleSprites and Sint32.

Referenced by btEnemySpriteLoadIntoSlots(), btMotionCallBeast() and btObjectMake().

Definition at line 19 of file battle_sprite.c.

btSpriteGetPalette

Sint32 btSpriteGetPalette(Sint32 index)

Returns the enemy's sprite palette. For an id out of range it returns row 0's sprite, not a palette.

References BattleSprites and Sint32.

Referenced by btEnemySpriteLoadIntoSlots(), btMotionCallBeast() and btObjectMake().

Definition at line 28 of file battle_sprite.c.

btSpriteIsSmall

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.

References BattleSprites, result and Sint32.

Referenced by btEnemyHasSpriteRoom(), btEnemySpriteLoadIntoSlots(), btMotionProjectCursorPoint(), btPlacementLayoutEnemies() and btUnitGetEffectHeight().

Definition at line 37 of file battle_sprite.c.

btSpriteGetAttackEffect

Uint32 btSpriteGetAttackEffect(Uint32 index)

Returns the battle effect an enemy's plain attack shows, 1 for none or out of range.

References BattleSprites.

Referenced by btActionRunBuild().

Definition at line 53 of file battle_sprite.c.

btSpriteGetAttackHop

Uint32 btSpriteGetAttackHop(Uint32 index)

Returns how high an enemy hops as it runs up to attack, in pixels; 0 out of range.

References BattleSprites.

Referenced by btStagingRunAttack().

Definition at line 65 of file battle_sprite.c.

btSpriteHasHeavyImpact

Sint32 btSpriteHasHeavyImpact(Sint32 index)

Returns 1 for an enemy whose blow lands with a heavier impact; 0 out of range.

References BattleSprites and Sint32.

Definition at line 77 of file battle_sprite.c.

btSpriteGetEffectHeight

Uint32 btSpriteGetEffectHeight(Uint32 index)

Returns the height a battle effect is drawn at over an enemy, in pixels, or 0 for its size's default; 0 out of range.

References BattleSprites.

Referenced by btUnitGetEffectHeight().

Definition at line 86 of file battle_sprite.c.