Alchemy
Loading...
Searching...
No Matches

classes.c File Reference

The enemy classes' battle sprite table, gSummon_EntryTable. More...

Go to the source code of this file.

Macros

#define ENEMY_CLASS_LAST   171
 The last class with a row in gSummon_EntryTable (sprites.tsv).

Functions

u32 BattleClass_GetDefeatSoundKind (s32 index)
 Returns the class's defeat-sound kind, 0 to 4, or -1 for none; a fallen enemy's sound is SE_146 plus it.
s32 BattleClass_GetSprite (s32 index)
 Returns the class's battle sprite, row 0's for a class out of range.
s32 BattleClass_GetPalette (s32 index)
 Returns the class's sprite palette.
s32 BattleClass_IsSmall (s32 index)
 Returns 1 for a small class, which takes one enemy sprite slot instead of two and stands closer to its neighbours; 0 out of range.
u32 BattleClass_GetAttackEffect (u32 index)
 Returns the effect a class's plain attack shows, 1 for none or out of range.
u32 BattleClass_GetAttackHop (u32 index)
 Returns how high a class hops as it runs up to attack, in pixels; 0 out of range.
s32 Summon_IsEntrySecondaryFlagged (s32 index)
 Returns 1 for a class whose blow lands with SE_HEAVY_IMPACT instead of SE_133; 0 out of range.
s32 BattleClass_GetEffectHeight (s32 index)
 Returns the height an effect is drawn at over a class, in pixels, or 0 for its size's default; 0 out of range.

Detailed Description

The enemy classes' battle sprite table, gSummon_EntryTable.

Part of battle.c, the battle object, compiled only through it.

Definition in file classes.c.

Macro Definition Documentation

◆ ENEMY_CLASS_LAST

#define ENEMY_CLASS_LAST   171

Function Documentation

◆ BattleClass_GetDefeatSoundKind()

u32 BattleClass_GetDefeatSoundKind ( s32 index)

Returns the class's defeat-sound kind, 0 to 4, or -1 for none; a fallen enemy's sound is SE_146 plus it.

Called by BattleEvent_Playback as an enemy falls. Reads any index unchecked.

Definition at line 11 of file classes.c.

Referenced by BattleClass_GetDefeatSoundKind(), and BattleEvent_Playback().

◆ BattleClass_GetSprite()

s32 BattleClass_GetSprite ( s32 index)

Returns the class's battle sprite, row 0's for a class out of range.

Called by BattleObjMake and SummonSlot_RegisterActorSprites.

Definition at line 24 of file classes.c.

Referenced by BattleClass_GetSprite(), BattleObjMake(), and SummonSlot_RegisterActorSprites().

◆ BattleClass_GetPalette()

s32 BattleClass_GetPalette ( s32 index)

Returns the class's sprite palette.

For a class out of range it returns row 0's sprite, not a palette. XXX: likely a slip copied from BattleClass_GetSprite, because no other getter here returns another column for a bad index. Called by BattleObjMake and SummonSlot_RegisterActorSprites.

Definition at line 35 of file classes.c.

Referenced by BattleClass_GetPalette(), BattleObjMake(), and SummonSlot_RegisterActorSprites().

◆ BattleClass_IsSmall()

s32 BattleClass_IsSmall ( s32 index)

Returns 1 for a small class, which takes one enemy sprite slot instead of two and stands closer to its neighbours; 0 out of range.

Called by the formation and placement code (BattleFormation_BuildEnemyList, Summon_LayoutPositions) and by motion.c.

Definition at line 45 of file classes.c.

Referenced by BattleClass_IsSmall(), BattleFormation_BuildEnemyList(), BattleMotion_ProjectConditionalPosition(), BattleUnit_GetEffectHeight(), EnemyCheck(), Summon_LayoutPositions(), and SummonSlot_RegisterActorSprites().

◆ BattleClass_GetAttackEffect()

u32 BattleClass_GetAttackEffect ( u32 index)

Returns the effect a class's plain attack shows, 1 for none or out of range.

Called by BattleCommand_BuildPlan, which stages it by id range (STAGING_BY_ID_RANGE).

Definition at line 60 of file classes.c.

Referenced by BattleClass_GetAttackEffect(), and BattleCommand_BuildPlan().

◆ BattleClass_GetAttackHop()

u32 BattleClass_GetAttackHop ( u32 index)

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

Called by BattlePres_RunAttack, which passes it to BattleMotion_ApproachTarget, and reached through FarCall_BattleTable.

Definition at line 73 of file classes.c.

Referenced by BattleClass_GetAttackHop(), and BattlePres_RunAttack().

◆ Summon_IsEntrySecondaryFlagged()

s32 Summon_IsEntrySecondaryFlagged ( s32 index)

Returns 1 for a class whose blow lands with SE_HEAVY_IMPACT instead of SE_133; 0 out of range.

Called by the beam effects (beams.c) through its far stub.

Definition at line 85 of file classes.c.

Referenced by Summon_IsEntrySecondaryFlagged().

◆ BattleClass_GetEffectHeight()

s32 BattleClass_GetEffectHeight ( s32 index)

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

Called by BattleUnit_GetEffectHeight, and reached through FarCall_BattleTable.

Definition at line 95 of file classes.c.

Referenced by BattleClass_GetEffectHeight(), and BattleUnit_GetEffectHeight().