src/game/game_party.c
Enemy units, the active party, coins and counters, and summons. More…
Included by game.c.
Macros
| Name | Description | |
|---|---|---|
#define | NAME_SUFFIX_BASE JAPANESE_OR('A', '1') | A unit whose name suffix is below NAME_SUFFIX_COUNT gets one more character after its name, NAME_SUFFIX_BASE plus the suffix: the digits 1 to 9 outside Japan, and the letters A to Z in the Japanese release (btStringFindFirstDigit reads it back). |
#define | PARTY_DEFINE_ADJUST (name, field, max) | Each adds amount to a counter, kept between 0 and max, and returns the new value: the shop credit and the Game Tickets given. |
Functions
| Name | Description | |
|---|---|---|
Bool | gmBattleUnitSet (Sint32 unitId, Sint32 enemyId, Sint32 suffix) | Fills a battle unit with an enemy: its stats, its name with its suffix, its items, rewards and elements. |
Sint32 | gmPartyCountMembers (void) | Returns the number of party members, counted from its FLAG_IN_PARTY flags. |
Sint32 | gmPartyAddMember (Sint32 unitId) | Adds a character to the end of the party unless it is there already, and returns the party size. |
Sint32 | gmPartyRemoveMember (Sint32 unitId) | Takes character unitId out of the party: clears its game flag and closes the gap it leaves in MainRoutineStateWork.party. |
Sint32 | gmPartyListMembers (Sint16 *unitIds) | Writes the party members to unitIds, ended by BATTLE_UNIT_LIST_END, and returns how many there are. |
Sint32 | gmPartyAdjustCoins (Sint32 amount) | Adds amount to the party's coins, kept between 0 and COIN_MAX, and returns the new total. |
Sint32 | gmSummonListLearned (Uint8 *output) | Writes the summons the party can call to output, in menu order, ending with SUMMON_END, and returns how many. |
const SUMMON_DEFINITION * | gmSummonDefinitionGetNear (Uint32 summonId) | Returns summon summonId's definition, or NULL past the last. |
void | gmSummonLearn (Sint32 summonId) | Lets the party call summon summonId from now on, setting its bit in the party's summon mask. |
Description
Enemy units, the active party, coins and counters, and summons. Part of
game.c.
Macros in detail
NAME_SUFFIX_BASE
#define NAME_SUFFIX_BASE JAPANESE_OR('A', '1')
A unit whose name suffix is below NAME_SUFFIX_COUNT gets one more character
after its name, NAME_SUFFIX_BASE plus the suffix: the digits 1 to 9 outside
Japan, and the letters A to Z in the Japanese release (btStringFindFirstDigit
reads it back).
Referenced by gmBattleUnitSet().
Definition at line 8 of file game_party.c.
PARTY_DEFINE_ADJUST
#define PARTY_DEFINE_ADJUST(name, field, max)
Each adds amount to a counter, kept between 0 and max, and returns the
new value: the shop credit and the Game Tickets given.
Definition at line 188 of file game_party.c.
Functions in detail
gmBattleUnitSet
Bool gmBattleUnitSet(Sint32 unitId, Sint32 enemyId, Sint32 suffix)
Fills a battle unit with an enemy: its stats, its name with its suffix, its items, rewards and elements. A Djinni fought is put on the party's side (this folder's README.md, "The unit"). Returns 0 for an id out of range.
References EnemyDefinitions, gmUnitCalculate(), gmUnitCalculateBaseElements(), gmUnitGet(), mnMessageDecodeRawStub(), Sint32 and syWordsClear().
Definition at line 13 of file game_party.c.
gmPartyCountMembers
Sint32 gmPartyCountMembers(void)
Returns the number of party members, counted from its FLAG_IN_PARTY flags.
References Sint32 and syGameFlagGet().
Referenced by gmDataTransferGiveDefaultDjinn(), gmDjinnGiveToParty(), gmFlagRefreshLureCap(), gmPartyAddMember(), gmPartyBalanceDjinn(), gmPartyDrainPpFromFullest(), gmPartyGetAverageLevel(), gmPartyGetPpRatio(), gmPartyGivePiersDjinn(), gmPartyListMembers(), gmPartyRemoveMember(), gmPartyRestoreHpPp(), gmPartyRestorePpInLighthouse(), gmPartyTakeFallDamage(), scJupiterLighthouseKarstAndAgatioRetreat(), scLinkLobbyCopyPartyOwnerIds(), scLinkLobbyExplainPartyOrder(), scLinkLobbyPartyContains() and scWorldMapSetUpShip().
Definition at line 93 of file game_party.c.
gmPartyAddMember
Sint32 gmPartyAddMember(Sint32 unitId)
Adds a character to the end of the party unless it is there already, and returns the party size.
References gmPartyCountMembers(), MainRoutineStateWork, Sint32 and syGameFlagSet().
Referenced by gmDataTransferGiveDefaultDjinn(), gmMainRoutineStateInitDefaults(), gmPartyAddIsaacsParty(), gmPartySetLeaderFelix(), scClearEnterPassword(), scInit(), scJupiterLighthouseIsaacAndIvanAreHurt(), scJupiterLighthouseIsaacAndIvanFall(), scLemuriaPalaceMeetKingHydros() and scWorldMapMeetEcho().
Definition at line 109 of file game_party.c.
gmPartyRemoveMember
Sint32 gmPartyRemoveMember(Sint32 unitId)
Takes character unitId out of the party: clears its game flag and closes
the gap it leaves in MainRoutineStateWork.party. Returns the party size.
References gmPartyCountMembers(), MainRoutineStateWork, Sint32 and syGameFlagClear().
Referenced by dbShopTestGiveEquipmentTestStock(), gmDataTransferGiveDefaultDjinn(), gmPartySetLeaderFelix(), scClearEnterPassword(), scInit(), scJupiterLighthouseIsaacAndIvanAreHurt(), scJupiterLighthouseIsaacAndIvanFall(), scLemuriaRoomsPiersVisitsUncle(), scVenusLighthouseDoubtLeaving() and scWorldMapMeetEcho().
Definition at line 126 of file game_party.c.
gmPartyListMembers
Sint32 gmPartyListMembers(Sint16 *unitIds)
Writes the party members to unitIds, ended by BATTLE_UNIT_LIST_END, and
returns how many there are.
References gmPartyCountMembers(), MainRoutineStateWork and Sint32.
Referenced by gmDjinnSetAllForParty(), gmPartyFindOwnerWithAction(), gmPartyInventoryAdd(), gmPartyInventoryCountFreeSlots(), gmPartyInventoryCountItem(), gmPartyInventoryFindMember(), gmPartyInventoryFindRoom(), gmPartyInventoryHasSpace(), gmPartySumDjinnCounts() and scFieldPartyListMembers().
Definition at line 146 of file game_party.c.
gmPartyAdjustCoins
Sint32 gmPartyAdjustCoins(Sint32 amount)
Adds amount to the party's coins, kept between 0 and COIN_MAX, and returns
the new total.
References MainRoutineStateWork and Sint32.
Referenced by dbShopTestTalkToSunshinesWife(), scLemuriaSpringRunSpringGame(), scNaribweRoomsReadFortune() and scYallamRoomsTalkToSunshinesWife().
Definition at line 166 of file game_party.c.
gmSummonListLearned
Sint32 gmSummonListLearned(Uint8 *output)
Writes the summons the party can call to output, in menu order, ending with
SUMMON_END, and returns how many.
References gmDjinnGetRecoveryTable(), Sint32 and SummonOrderList.
Definition at line 208 of file game_party.c.
gmSummonDefinitionGetNear
const SUMMON_DEFINITION *gmSummonDefinitionGetNear(Uint32 summonId)
Returns summon summonId's definition, or NULL past the last.
References SummonDefinitionTable.
Definition at line 230 of file game_party.c.
gmSummonLearn
void gmSummonLearn(Sint32 summonId)
Lets the party call summon summonId from now on, setting its bit in the
party's summon mask. A summon tablet and Lemuria's spring call it.
References gmDjinnGetRecoveryTable() and Sint32.
Referenced by dbShopTestGiveMuramasaAndSummon() and scLemuriaSpringGivePrize().
Definition at line 239 of file game_party.c.