src/game/game_party.c
Enemy units, the active party, coins and counters, and summons. More…
Included by game.c.
Macros
| Name | Description | |
|---|---|---|
#define | ENEMY_SUFFIX_FIRST '1' | suffix 0's character |
#define | ENEMY_SUFFIX_LAST 8 | the last suffix shown, '9' |
#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 letter, 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 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. |
Description
Enemy units, the active party, coins and counters, and summons. Part of
game.c.
Macros in detail
ENEMY_SUFFIX_FIRST
#define ENEMY_SUFFIX_FIRST '1'
#define ENEMY_SUFFIX_FIRST 'A'
suffix 0's character
Referenced by gmBattleUnitSet().
Definition at lines 7 and 10 of file game_party.c.
ENEMY_SUFFIX_LAST
#define ENEMY_SUFFIX_LAST 8
#define ENEMY_SUFFIX_LAST 25
the last suffix shown, '9'
the last suffix shown, 'Z'
Referenced by gmBattleUnitSet().
Definition at lines 8 and 11 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 205 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 letter, its items, rewards and elements. A Djinni fought is put on the party's side (README.md, "The unit"). Returns 0 for an id out of range.
References EnemyDefinitions, gmUnitCalculate(), gmUnitCalculateBaseElements(), gmUnitGet(), mnMessageDecodeRawStub(), Sint32 and syWordsClear().
Definition at line 17 of file game_party.c.
gmPartyCountMembers
Sint32 gmPartyCountMembers(void)
Returns the number of party members, counted from its FLAG_IN_PARTY flags.
References gmFlagGet() and Sint32.
Referenced by gmDjinnGiveToParty(), gmFlagRefreshLureCap(), gmPartyAddMember(), gmPartyGetAverageLevel(), gmPartyListMembers(), gmPartyRemoveMember(), gmPartyRestoreHpPp(), gmPartyRestorePpInLighthouse(), scBattleArenaCopyPartyOwnerIds(), scBattleArenaExplainPartyOrder(), scBattleArenaPartyContains(), scColossoAskDoneLookingAround() and scColossoOfferCheeringSpot().
Definition at line 111 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 gmFlagSet(), gmPartyCountMembers(), MainRoutineStateWork and Sint32.
Referenced by gmMainRoutineStateInitDefaults(), scBabiPalaceRestorePartyAndInventory(), scColosseumEntranceApplyArrivalState(), scColosseumEntranceEscortToEastExit(), scColosseumEntranceEscortToWestExit(), scColossoControlCharacterAlone(), scColossoOfferCheeringSpot() and scInit().
Definition at line 127 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 gmFlagClear(), gmPartyCountMembers(), MainRoutineStateWork and Sint32.
Referenced by scColosseumEntranceEscortToEastExit(), scColosseumEntranceEscortToWestExit(), scColossoControlCharacterAlone(), scColossoOfferCheeringSpot() and scInit().
Definition at line 144 of file game_party.c.
gmPartyListMembers
Sint32 gmPartyListMembers(Sint16 *unitIds)
Writes the party members to unitIds and returns how many there are.
References gmPartyCountMembers(), MainRoutineStateWork and Sint32.
Referenced by gmPartyInventoryAdd(), gmPartyInventoryCountFreeSlots(), gmPartyInventoryCountItem(), gmPartyInventoryFindMember(), gmPartyInventoryHasSpace(), gmPartySumDjinnCounts() and scFieldPartyListMembers().
Definition at line 163 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 scKalayTolbiDocksTalkToWomanSellingTickets() and scTolbiSpringRunSpringGame().
Definition at line 183 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 227 of file game_party.c.
gmSummonDefinitionGetNear
const SUMMON_DEFINITION *gmSummonDefinitionGetNear(Uint32 summonId)
Returns summon summonId's definition, or NULL past the last.
References SummonDefinitionTable and SummonOrderList.
Definition at line 249 of file game_party.c.