src/game/game_djinn.c
Djinn: definitions, setting and standby, and their counts. More…
Included by game.c.
Macros
| Name | Description | |
|---|---|---|
#define | DJINN_HELD_PER_ELEMENT_MAX 10 | The most Djinn of one element a party member holds or sets. |
#define | DJINN_COUNT_NONE 999 | Above any party member's count of Djinn: the fewest found so far before the search, and still when nobody has room. |
#define | DJINN_GIVE_FOUND_BEFORE -1 | What gmDjinnGiveToParty returns in place of a unit when nobody gets the Djinni; its one caller, fdDjinnJoinParty, plays the joining only for a unit. |
#define | DJINN_GIVE_NO_ROOM -2 |
Functions
| Name | Description | |
|---|---|---|
const DJINN_DEFINITION * | gmDjinnGetDefinition (Uint32 element, Uint32 djinni) | Returns the definition of Djinni djinni of element; anything out of range gives DJINNI_FLINT's. |
Sint32 | gmDjinnGiveToParty (Sint32 element, Sint32 djinn) | Gives a newly found Djinni to the party member holding the fewest Djinn who has room, on standby. |
Sint32 | gmDjinnGive (Sint32 unitId, Sint32 element, Sint32 djinnIndex) | Gives a Djinni to a unit. |
Bool | gmDjinnCanSet (Sint32 unitId, Sint32 element, Sint32 djinnIndex) | Returns 1 when the unit holds the Djinni and it can be set: not set, not recovering and not held by a summon. |
Uint32 | gmDjinnIsSet (Sint32 unitId, Sint32 element, Sint32 djinnIndex) | Returns 1 when the Djinni is set on the unit. |
Sint32 | gmDjinnSet (Sint32 unitId, Sint32 element, Sint32 djinnIndex) | Sets a ready Djinni on the unit, counts it and works out the unit's class again. |
Uint32 | gmDjinnPutOnStandby (Sint32 unitId, Sint32 element, Sint32 djinnIndex) | Takes a set Djinni off the unit and works out its class again. |
Sint32 | gmDjinnRecoveryRemove (Sint32 unitId, Sint32 element, Sint32 djinnIndex) | Takes the Djinni off its side's standby and recovery list, closing the gap. |
Uint32 * | gmDjinnRecoveryAddStandby (Uint32 unitId, Uint32 element, Uint32 djinnIndex) | Puts a unit's Djinni at the end of its side's list on standby. |
Sint32 | gmDjinnTransfer (Sint32 src, Sint32 element, Sint32 djinnIndex, Sint32 target) | Moves a Djinni from one unit to another, set or on standby as it was. |
Sint32 | gmDjinnRecoveryCountStandby (Uint8 *counts) | Counts the party's Djinn on standby, by element into counts when it is given. |
Sint32 | gmDjinnGetAbilityId (Uint32 element, Uint32 djinni) | Returns the ability the Djinni unleashes. |
Sint32 | gmPartySumDjinnCounts (Sint32 element) | Returns how many Djinn of element the party holds, or of every element for DJINN_ALL_ELEMENTS: the save files' Djinn counts, and whether the menus show the Djinn at all. |
Description
Djinn: definitions, setting and standby, and their counts. Part of game.c.
Macros in detail
DJINN_HELD_PER_ELEMENT_MAX
#define DJINN_HELD_PER_ELEMENT_MAX 10
The most Djinn of one element a party member holds or sets.
Referenced by gmDjinnCanSet(), gmDjinnGive() and gmDjinnGiveToParty().
Definition at line 4 of file game_djinn.c.
DJINN_COUNT_NONE
#define DJINN_COUNT_NONE 999
Above any party member's count of Djinn: the fewest found so far before the search, and still when nobody has room.
Referenced by gmDjinnGiveToParty().
Definition at line 7 of file game_djinn.c.
DJINN_GIVE_FOUND_BEFORE
#define DJINN_GIVE_FOUND_BEFORE -1
What gmDjinnGiveToParty returns in place of a unit when nobody gets the
Djinni; its one caller, fdDjinnJoinParty, plays the joining only for a unit.
Referenced by gmDjinnGiveToParty().
Definition at line 11 of file game_djinn.c.
DJINN_GIVE_NO_ROOM
#define DJINN_GIVE_NO_ROOM -2
Referenced by gmDjinnGiveToParty().
Definition at line 12 of file game_djinn.c.
Functions in detail
gmDjinnGetDefinition
const DJINN_DEFINITION *gmDjinnGetDefinition(Uint32 element, Uint32 djinni)
Returns the definition of Djinni djinni of element; anything out of range
gives DJINNI_FLINT's.
References DjinnDefinitionTable and Sint32.
Referenced by gmDjinnGetAbilityId() and gmUnitCalculate().
Definition at line 16 of file game_djinn.c.
gmDjinnGiveToParty
Sint32 gmDjinnGiveToParty(Sint32 element, Sint32 djinn)
Gives a newly found Djinni to the party member holding the fewest Djinn who
has room, on standby. Returns who got it, DJINN_GIVE_FOUND_BEFORE or
DJINN_GIVE_NO_ROOM.
References gmDjinnGive(), gmDjinnRecoveryAddStandby(), gmFlagGet(), gmFlagSet(), gmPartyCountMembers(), gmUnitGet(), MainRoutineStateWork and Sint32.
Definition at line 28 of file game_djinn.c.
gmDjinnGive
Sint32 gmDjinnGive(Sint32 unitId, Sint32 element, Sint32 djinnIndex)
Gives a Djinni to a unit. Returns -1 when the unit holds
DJINN_HELD_PER_ELEMENT_MAX of the element or has it already.
References gmUnitGet() and Sint32.
Referenced by dbMenuTestGivePartyDjinn(), gmDjinnGiveToParty(), gmDjinnTransfer(), scMercuryLighthouseMiaJoinsAfterRescue() and scWorldMapMeetFlint().
Definition at line 70 of file game_djinn.c.
gmDjinnCanSet
Bool gmDjinnCanSet(Sint32 unitId, Sint32 element, Sint32 djinnIndex)
Returns 1 when the unit holds the Djinni and it can be set: not set, not recovering and not held by a summon.
References gmDjinnGetRecoveryTable(), gmUnitGet() and Sint32.
Referenced by gmDjinnSet().
Definition at line 85 of file game_djinn.c.
gmDjinnIsSet
Uint32 gmDjinnIsSet(Sint32 unitId, Sint32 element, Sint32 djinnIndex)
Returns 1 when the Djinni is set on the unit.
References gmUnitGet() and Sint32.
Referenced by gmDjinnPutOnStandby() and gmDjinnTransfer().
Definition at line 120 of file game_djinn.c.
gmDjinnSet
Sint32 gmDjinnSet(Sint32 unitId, Sint32 element, Sint32 djinnIndex)
Sets a ready Djinni on the unit, counts it and works out the unit's class again. Returns 1 when it was set.
References gmDjinnCanSet(), gmUnitGet(), gmUnitUpdateClass() and Sint32.
Referenced by dbMenuTestGivePartyDjinn(), gmDjinnTransfer() and scMercuryLighthouseMiaJoinsAfterRescue().
Definition at line 129 of file game_djinn.c.
gmDjinnPutOnStandby
Uint32 gmDjinnPutOnStandby(Sint32 unitId, Sint32 element, Sint32 djinnIndex)
Takes a set Djinni off the unit and works out its class again. Returns 1 when it was set.
References gmDjinnIsSet(), gmUnitGet(), gmUnitUpdateClass() and Sint32.
Referenced by gmDjinnTransfer().
Definition at line 148 of file game_djinn.c.
gmDjinnRecoveryRemove
Sint32 gmDjinnRecoveryRemove(Sint32 unitId, Sint32 element, Sint32 djinnIndex)
Takes the Djinni off its side's standby and recovery list, closing the gap. Returns 1 when it was there.
References gmDjinnGetRecoveryTable() and Sint32.
Referenced by gmDjinnRecoveryAddStandby() and gmDjinnTransfer().
Definition at line 164 of file game_djinn.c.
gmDjinnRecoveryAddStandby
Uint32 * gmDjinnRecoveryAddStandby(Uint32 unitId, Uint32 element, Uint32 djinnIndex)
Puts a unit's Djinni at the end of its side's list on standby. Nothing checks the list's capacity.
References gmDjinnGetRecoveryTable(), gmDjinnRecoveryRemove() and Sint32.
Referenced by gmDjinnGiveToParty(), gmDjinnTransfer() and scWorldMapMeetFlint().
Definition at line 190 of file game_djinn.c.
gmDjinnTransfer
Sint32 gmDjinnTransfer(Sint32 src, Sint32 element, Sint32 djinnIndex, Sint32 target)
Moves a Djinni from one unit to another, set or on standby as it was. Returns -1 when it cannot.
References gmDjinnGive(), gmDjinnIsSet(), gmDjinnPutOnStandby(), gmDjinnRecoveryAddStandby(), gmDjinnRecoveryRemove(), gmDjinnSet(), gmUnitGet() and Sint32.
Referenced by scVaultReturnIsaacsDjinni().
Definition at line 209 of file game_djinn.c.
gmDjinnRecoveryCountStandby
Sint32 gmDjinnRecoveryCountStandby(Uint8 *counts)
Counts the party's Djinn on standby, by element into counts when it is given.
References gmDjinnGetRecoveryTable() and Sint32.
Definition at line 240 of file game_djinn.c.
gmDjinnGetAbilityId
Sint32 gmDjinnGetAbilityId(Uint32 element, Uint32 djinni)
Returns the ability the Djinni unleashes.
References gmDjinnGetDefinition() and Sint32.
Definition at line 269 of file game_djinn.c.
gmPartySumDjinnCounts
Sint32 gmPartySumDjinnCounts(Sint32 element)
Returns how many Djinn of element the party holds, or of every element for
DJINN_ALL_ELEMENTS: the save files' Djinn counts, and whether the menus show
the Djinn at all.
References gmPartyListMembers(), gmUnitGet() and Sint32.
Definition at line 277 of file game_djinn.c.