Alchemy
Loading...
Searching...
No Matches

djinn.c File Reference

Djinn: definitions, setting and standby, and their counts. More...

Go to the source code of this file.

Functions

const struct DjinnDefinition * Djinn_GetDefinition (u32 group, u32 index)
 Returns the definition of Djinn index (0 to 19) of element group (0 to 3); anything out of range gives the first.
s32 Djinn_AddToLeastLoadedOwner (s32 element, s32 djinn)
 Gives a newly found Djinni to the party member holding the fewest Djinn who has room in that element, puts it on standby and sets its found flag.
s32 Djinn_AddToOwner (s32 owner, s32 element, s32 djinnIndex)
 Gives Djinni djinnIndex of element to a unit: sets its bit in djinnAvailable and counts it.
s32 Djinn_IsReady (s32 owner, s32 element, s32 djinnIndex)
 Returns 1 when the unit holds the Djinni and it can be set: it is not set already, not recovering and not held by a summon.
u32 Djinn_IsActive (s32 owner, s32 element, s32 djinnIndex)
 Returns 1 when the Djinni is set on the unit.
s32 Djinn_Activate (s32 owner, s32 element, s32 djinnIndex)
 Sets a ready Djinni on the unit, counts it and works out the unit's class again.
u32 Djinn_Deactivate (s32 owner, s32 element, s32 djinnIndex)
 Takes a set Djinni off the unit and works out its class again.
s32 DjinnRecovery_Remove (s32 owner, s32 element, s32 djinnIndex)
 Takes the Djinni off its side's standby and recovery list, closing the gap.
u32 * DjinnRecovery_AddStandby (u32 owner, u32 element, u32 djinnIndex)
 Puts the owner's Djinni at the end of its side's list on standby (turns -1), moving it there if it was already listed.
s32 Djinn_Transfer (s32 source, s32 element, s32 djinnIndex, s32 target)
 Moves a Djinni from one unit to another, keeping it set or on standby.
s32 DjinnRecovery_CountStandby (u8 *counts)
 Counts the party's Djinn on standby, by element into counts when it is given.
s32 Djinn_GetAbilityId (u32 group, u32 index)
 Returns the ability ID used when the Djinni is unleashed.
s32 Party_SumDjinnCounts (s32 element)
 Returns how many Djinn of element the party holds, or of all elements for -1.

Detailed Description

Djinn: definitions, setting and standby, and their counts.

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

Definition in file djinn.c.

Function Documentation

◆ Djinn_GetDefinition()

const struct DjinnDefinition * Djinn_GetDefinition ( u32 group,
u32 index )

Returns the definition of Djinn index (0 to 19) of element group (0 to 3); anything out of range gives the first.

Called by UnitCalc for a set Djinni's stat bonuses and by Djinn_GetAbilityId.

Definition at line 10 of file djinn.c.

Referenced by Djinn_GetAbilityId(), Djinn_GetDefinition(), and UnitCalc().

◆ Djinn_AddToLeastLoadedOwner()

s32 Djinn_AddToLeastLoadedOwner ( s32 element,
s32 djinn )

Gives a newly found Djinni to the party member holding the fewest Djinn who has room in that element, puts it on standby and sets its found flag.

Returns who got it, -1 if it was found before or -2 when nobody has room. Called by Djinn_JoinParty when a Djinni joins in the field.

Definition at line 24 of file djinn.c.

Referenced by Djinn_AddToLeastLoadedOwner().

◆ Djinn_AddToOwner()

s32 Djinn_AddToOwner ( s32 owner,
s32 element,
s32 djinnIndex )

Gives Djinni djinnIndex of element to a unit: sets its bit in djinnAvailable and counts it.

Returns -1 when the unit holds ten of the element or has it already. Called by Djinn_AddToLeastLoadedOwner and Djinn_Transfer, by the scenes where a member joins with Djinn, and by the debug menus.

Definition at line 65 of file djinn.c.

Referenced by DebugMenu_GivePartyDjinn(), Djinn_AddToLeastLoadedOwner(), Djinn_AddToOwner(), Djinn_Transfer(), Event_MeetFlint(), and MercuryLighthouse_MiaJoinsAfterRescue().

◆ Djinn_IsReady()

s32 Djinn_IsReady ( s32 owner,
s32 element,
s32 djinnIndex )

Returns 1 when the unit holds the Djinni and it can be set: it is not set already, not recovering and not held by a summon.

A count of set Djinn above 9 is clamped to 10 on the way. Called by the Djinn menu to list what can be set, and by battle to tell which Djinn can be unleashed.

Definition at line 81 of file djinn.c.

Referenced by Djinn_Activate(), and Djinn_IsReady().

◆ Djinn_IsActive()

u32 Djinn_IsActive ( s32 owner,
s32 element,
s32 djinnIndex )

Returns 1 when the Djinni is set on the unit.

Definition at line 116 of file djinn.c.

Referenced by Djinn_Deactivate(), Djinn_IsActive(), and Djinn_Transfer().

◆ Djinn_Activate()

s32 Djinn_Activate ( s32 owner,
s32 element,
s32 djinnIndex )

Sets a ready Djinni on the unit, counts it and works out the unit's class again.

Returns 1 when it was set. Called by the Djinn menu, by battle when a Djinni recovers, and by Djinn_Transfer.

Definition at line 125 of file djinn.c.

Referenced by DebugMenu_GivePartyDjinn(), Djinn_Activate(), Djinn_Transfer(), and MercuryLighthouse_MiaJoinsAfterRescue().

◆ Djinn_Deactivate()

u32 Djinn_Deactivate ( s32 owner,
s32 element,
s32 djinnIndex )

Takes a set Djinni off the unit and works out its class again.

Returns 1 when it was set. Called by the Djinn menu, by battle when a Djinni is unleashed, and by Djinn_Transfer.

Definition at line 144 of file djinn.c.

Referenced by Djinn_Deactivate(), and Djinn_Transfer().

◆ DjinnRecovery_Remove()

s32 DjinnRecovery_Remove ( s32 owner,
s32 element,
s32 djinnIndex )

Takes the Djinni off its side's standby and recovery list, closing the gap.

Returns 1 when it was there. Called when a Djinni is set again, by the Djinn menu and by battle's recovery.

Definition at line 159 of file djinn.c.

Referenced by Djinn_Transfer(), DjinnRecovery_AddStandby(), and DjinnRecovery_Remove().

◆ DjinnRecovery_AddStandby()

u32 * DjinnRecovery_AddStandby ( u32 owner,
u32 element,
u32 djinnIndex )

Puts the owner's Djinni at the end of its side's list on standby (turns -1), moving it there if it was already listed.

Returns the list's count. Called when a Djinni joins, by the Djinn menu's standby command, by battle and by the scene where Flint joins.

Definition at line 185 of file djinn.c.

Referenced by Djinn_AddToLeastLoadedOwner(), Djinn_Transfer(), DjinnRecovery_AddStandby(), and Event_MeetFlint().

◆ Djinn_Transfer()

s32 Djinn_Transfer ( s32 source,
s32 element,
s32 djinnIndex,
s32 target )

Moves a Djinni from one unit to another, keeping it set or on standby.

Returns -1 when the source lacks it or the target has no room. Called by the Djinn menu's Give and Trade.

Definition at line 204 of file djinn.c.

Referenced by Djinn_Transfer(), and Vault_ReturnIsaacsDjinni().

◆ DjinnRecovery_CountStandby()

s32 DjinnRecovery_CountStandby ( u8 * counts)

Counts the party's Djinn on standby, by element into counts when it is given.

Returns the total. Only GAME.S's bare veneer reaches it; nothing calls it by name.

Definition at line 230 of file djinn.c.

Referenced by DjinnRecovery_CountStandby().

◆ Djinn_GetAbilityId()

s32 Djinn_GetAbilityId ( u32 group,
u32 index )

Returns the ability ID used when the Djinni is unleashed.

Called by the battle plan, the battle queue's ordering and the battle menu.

Definition at line 264 of file djinn.c.

Referenced by Djinn_GetAbilityId().

◆ Party_SumDjinnCounts()

s32 Party_SumDjinnCounts ( s32 element)

Returns how many Djinn of element the party holds, or of all elements for -1.

Called by the save summary, the field Status screen, the battle status screen and the battle command menu.

Definition at line 271 of file djinn.c.

Referenced by Party_SumDjinnCounts().