Alchemy
Loading...
Searching...
No Matches

classes.c File Reference

Element levels and classes. More...

Go to the source code of this file.

Data Structures

struct  ElementLevelBonus
 The elemental power and resistance of one element level. More...

Functions

s32 Class_GetSeries (s32 primaryElement, s32 secondaryElement)
 Returns the class series of a character whose strongest element is primaryElement and second secondaryElement, from the 4 by 4 table.
s32 Unit_GetElementLevels (s32 record, const u8 *source, s32 output[4])
 Writes ten times each element level to output: an enemy's from its element preset, a character's from the Djinn set on it (source is its Djinn bits) plus its own element bonus.
s32 Unit_GetElementLevel (s32 owner, s32 element)
 Returns a unit's level in element (0 to 3).
s32 Enemy_GetAttackElement (struct BattleUnit *unit)
 Returns the element an enemy attacks with, from its element preset.
u32 Unit_CalcBaseElements (s32 owner, s16 destination[4][2])
s32 Class_Determine (s32 character, const u8 *djinn)
 Returns the class a character has with djinn set: the series is chosen by its two strongest elements, and the class is the last of the series whose element requirements it meets.
struct ClassDefinition * Class_GetDefinition (s32 classId)
 Returns class classId's definition: its series, element requirements, stat multipliers and the Psynergy it teaches by level.
void Unit_UpdateClass (s32 ownerId)
 Works out a character's class again after its Djinn change, then its Psynergy list and its base elements.

Variables

struct ElementLevelBonus gElement_PowerResistByLevel [16]

Detailed Description

Element levels and classes.

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

Definition in file classes.c.

Function Documentation

◆ Class_GetSeries()

s32 Class_GetSeries ( s32 primaryElement,
s32 secondaryElement )

Returns the class series of a character whose strongest element is primaryElement and second secondaryElement, from the 4 by 4 table.

Called by Class_Determine.

Definition at line 18 of file classes.c.

Referenced by Class_Determine(), and Class_GetSeries().

◆ Unit_GetElementLevels()

s32 Unit_GetElementLevels ( s32 record,
const u8 * source,
s32 output[4] )

Writes ten times each element level to output: an enemy's from its element preset, a character's from the Djinn set on it (source is its Djinn bits) plus its own element bonus.

Called by Class_Determine, Unit_GetElementLevel and Unit_CalcBaseElements.

Definition at line 26 of file classes.c.

Referenced by Class_Determine(), Unit_CalcBaseElements(), Unit_GetElementLevel(), and Unit_GetElementLevels().

◆ Unit_GetElementLevel()

s32 Unit_GetElementLevel ( s32 owner,
s32 element )

Returns a unit's level in element (0 to 3).

Called by the two status screens to show the element levels, and by Battle_IsReviveEffect.

Definition at line 67 of file classes.c.

Referenced by BattleFx_RollSuccess(), and Unit_GetElementLevel().

◆ Enemy_GetAttackElement()

s32 Enemy_GetAttackElement ( struct BattleUnit * unit)

Returns the element an enemy attacks with, from its element preset.

Called by Item_GetEquippedElement for an enemy, which has no weapon.

Definition at line 82 of file classes.c.

Referenced by Enemy_GetAttackElement(), and Item_GetEquippedElement().

◆ Unit_CalcBaseElements()

u32 Unit_CalcBaseElements ( s32 owner,
s16 destination[4][2] )

Definition at line 101 of file classes.c.

Referenced by BattleUnitSet(), Unit_CalcBaseElements(), and Unit_UpdateClass().

◆ Class_Determine()

s32 Class_Determine ( s32 character,
const u8 * djinn )

Returns the class a character has with djinn set: the series is chosen by its two strongest elements, and the class is the last of the series whose element requirements it meets.

Isaac and Garet as children and Jenna have fixed classes. Called by Unit_UpdateClass.

Definition at line 161 of file classes.c.

Referenced by Class_Determine(), and Unit_UpdateClass().

◆ Class_GetDefinition()

struct ClassDefinition * Class_GetDefinition ( s32 classId)

Returns class classId's definition: its series, element requirements, stat multipliers and the Psynergy it teaches by level.

Definition at line 223 of file classes.c.

Referenced by BattleTarget_IsWeakToEffect(), Class_GetDefinition(), Unit_RefreshPsynergy(), and UnitCalc().

◆ Unit_UpdateClass()

void Unit_UpdateClass ( s32 ownerId)

Works out a character's class again after its Djinn change, then its Psynergy list and its base elements.

Writes the unit's classIndex, actionSlots and baseElement. Called when a Djinni is set or put on standby, at the prologue's start and end, at a new game and around the Colosso's inventory snapshot.

Definition at line 232 of file classes.c.

Referenced by Djinn_Activate(), Djinn_Deactivate(), InventorySnapshot_Restore(), InventorySnapshot_Save(), Party_BeginChildhood(), Party_EndChildhood(), Party_InitCharacters(), and Unit_UpdateClass().

Variable Documentation

◆ gElement_PowerResistByLevel

struct ElementLevelBonus gElement_PowerResistByLevel[16]
extern

Referenced by Unit_CalcBaseElements().