include/game/game.h
The game's rules and data as the battles, the field and the menus share them: the tables of items, abilities, summons, Djinn, characters and enemies, the field Psynergy each ability casts, and the game module's functions the other modules call.
#include "types.h"#include "edition.h"#include "battle/battle_sprites.h"#include "battle/battle_unit.h"#include "game/item.h"#include "game/character_ids.h"#include "game/character.h"#include "battle/battle_action_run.h"#include "flags.h"#include "system.h"#include "game/game_functions.h"
Included by battle_internal.h, battle_effect_internal.h, psynergy_test.c, psynergy_test_2.c, shop_test.c, test_scenes.c, field_engine_internal.h, field_internal.h, field_psynergy_internal.h, lucky_dice.c, psynergy_reach.c, script_commands_internal.h, super_lucky_dice.c, game_internal.h, credits.c, menu_internal.h, airs_rock.c, airs_rock_inside.c, alhafra.c, alhafra_manor.c, alhafra_rooms.c, alhafran_cave.c, ancient_lemuria.c, anemos_inner_sanctum.c, anemos_inner_sanctum_dullahan.c, ankohl_ruins.c, apojii_islands_cave.c, aqua_rock.c, aqua_rock_inside.c, atteka_inlet.c, caverns.c, champa.c, champa_cliff_caves.c, champa_rooms.c, champa_sanctum.c, clear.c, contigo.c, daila.c, daila_rooms.c, dehkan_plateau.c, eastern_alhafra.c, eastern_alhafra_ship.c, epilogue.c, gabomba_catacombs.c, gabomba_statue.c, gabomba_statue_chamber.c, gaia_rock.c, gaia_rock_inside.c, garoh.c, garoh_rooms.c and 74 more.
Structures
| Name | Description | |
|---|---|---|
struct | ELEMENT_LEVEL_BONUS | The elemental power and resistance of one element level, in ElementPowerResistByLevel. |
Macros
| Name | Description | |
|---|---|---|
#define | DRAGON_ENEMY_COUNT 47 | How many enemies EnemyDragonIds and EnemySeaCreatureIds list. |
#define | SEA_CREATURE_ENEMY_COUNT 29 | |
#define | SUMMON_COUNT 29 | How many summons there are (summon_table.c), and the number that ends a list of them (gmSummonListLearned). |
#define | SUMMON_END 32 | Ends the summon lists, and marks a summon already moved to the front. |
#define | INVENTORY_SNAPSHOT_SPARE 392 | Where InventorySnapshot's spare space begins, past the party's equipment gmInventorySnapshotSave keeps and the Trial Road's state: the scenes keep their own state there (scene/flame_throwers.h's FLAME_THROWERS_STATE). |
Enumerations
| Name | Description | |
|---|---|---|
enum | FIELD_PSY { FIELD_PSYNERGY_MOVE, FIELD_PSYNERGY_MIND_READ, FIELD_PSYNERG … } | What a Psynergy does when cast on the field (an ability's fieldPsynergy), each named for the abilities that have it in the English release. |
enum | FIELD_PSYNERGY_HANDLER { FIELD_PSYNERGY_HANDLER_UNTARGETED, FIELD_PSYNERGY_HANDLER_ON … } | A step of the current field Psynergy (fdPsynergyRunHandler). |
enum | SUMMON_ID { SUMMON_VENUS, SUMMON_MERCURY, SUMMON_MARS, SUMMON_JUPITER, S … } | The summons by summon id, each named for its ability, in the order of SummonAbilities (summon_table.c): the elements' own four, The Broken Seal's twelve, then this game's thirteen. |
Functions
| Name | Description | |
|---|---|---|
void | btDjinnRecoverAllStub (void) | Counts the Djinn recovery down twenty times, setting every recovering Djinni of a party member with HP (btDjinnRecoverAll). |
Sint32 | gmDjinnGiveStub (Sint32 unitId, Sint32 element, Sint32 djinnIndex) | Gives a Djinni to a unit. |
void | fdPartyClearUnusableShortcutsStub (void) | Clears each button shortcut whose Psynergy can no longer be cast (fdPartyClearUnusableShortcuts). |
Sint32 | gmInventoryAddItemStub (Sint32 unitId, Sint32 itemId) | Gives a unit one item, joining its first matching stack (up to INVENTORY_STACK_MAX) or taking the first free slot. |
Sint32 | gmInventoryRemoveStub (Sint32 owner, Sint32 slot) | Takes one item out of slot, closing up the inventory when it was the last. |
void | gmUnitCalculateBaseElements (Sint32 unitId, BATTLE_ELEMENT_STATS *dest) | A unit's base power and resistance in each element (game_classes.c). |
Sint32 | gmClassDetermine (Sint32 character, Uint32 *djinn, Sint32 item) | The class a character has with these Djinn and its class-changing item (game_classes.c). |
Sint32 | gmUnitGetElementLevels (Sint32 characterOrEnemy, const Uint8 *djinn, Sint32 *output) | A unit's level in each element (game_classes.c). |
Sint32 | gmUnitRebuildPsynergyList (Sint32 owner) | Rebuilds a character's Psynergy list from what it learned, its class and its items (game_levels.c). |
void | mnMessageDecodeRawUnboundedStub (Sint32 msg, Uint16 *text) | Decodes message into text with no length limit (mnMessageDecodeRawUnbounded). |
const CHARACTER_DEFINITION * | gmCharacterGetDefinition (Sint32 character) | Returns character index's definition: growth curves, starting level and equipment. |
void | gmPartyBalanceDjinn (void) | Moves Djinn between the party members until each holds within one of the others. |
Variables
| Name | Description | |
|---|---|---|
extern const ITEM_DEFINITION | ItemDefinitionTable [] | The definitions of the items (item_table.c) and the summons (summon_table.c). |
extern const SUMMON_DEFINITION | SummonDefinitionTable [] | The 29 summons, by summon id, read through gmSummonDefinitionGetNearStub. |
extern const Uint16 | EnemyDragonIds [DRAGON_ENEMY_COUNT] | The dragons, by enemy id: the Hydras, Serpents, Dinos, Dragons, Lizards, Chimeras and the Doom Dragon. |
extern const Uint16 | EnemySeaCreatureIds [SEA_CREATURE_ENEMY_COUNT] | The sea creatures, by enemy id: the Cuttles, Jellies, Hydras, Poseidon, the shells and urchins, the Mermen, the sea Dragons, the Seabirds, the Lizard Men and the Kraken. |
extern const ABILITY_DEFINITION | AbilityDefinitions [] | The definitions of the abilities, the Djinn and the enemies (the enemies' in enemy_table.c). |
extern const DJINN_DEFINITION | DjinnDefinitionTable [] | The 80 Djinn, 20 of each element in element order. |
extern const ENEMY_DEFINITION | EnemyDefinitions [] | |
extern const Uint8 | SummonOrderList [SUMMON_COUNT] | The summons in the order the Summon command lists them (summon_table.c). |
extern const Uint32 | CharacterLevelExpTable [] | The experience each character needs for each level (experience_table.c). |
extern const Sint16 | ElementPowerResistCurve [5][2] | The curve gmBattleGetElementMultiplier reads an element's power against a resistance on, and the enemies' element presets (element_table.c). |
extern const ENEMY_ELEMENT_PRESET | EnemyElementPresetTable [] | The 48 enemy element presets, by ENEMY_DEFINITION.elementPreset; each is named by the enemies that have it, in the English release's words. |
extern const CHARACTER_DEFINITION | CharacterDefinitionTable [] | The characters' definitions, and those a new game gives their starting equipment. |
extern const Sint32 | CharacterNewGameIds [] | The characters gmPartyInitCharacters gives their starting equipment, ended by -1. |
extern const Uint16 | ItemRareItemCounters [512] | Each item's rare item counter number plus one, 0 for an ordinary item (rare_item_stock.c). |
extern const Uint8 | CharacterElementGroupTable [] | Each character's element group (experience_table.c). |
extern const Sint16 | DjinnElementSprites [] | The Djinni sprite of each element, SPRITE_VENUS_DJINNI to SPRITE_JUPITER_DJINNI, whose picture mnDjinnShowJoinedMessage shows as the portrait. |
extern const Sint16 | CharacterSpriteTable [] | Each party member's sprite, by character; each is the character's own id. |
extern const Sint32 | ClassSeriesByElements [4][4] | The class series by a character's strongest and second element (element_table.c). |
extern const Uint8 | NewGameSceneStateTable [4][5] | Four rows of five numbers a new game copies after RareItemStock, which nothing is known to read (rare_item_stock.c). |
extern const Uint16 | DataTransferFlags [TRANSFERRED_FLAG_COUNT] | What "Transfer data from Golden Sun" takes from The Broken Seal's save: the flags it copies, and the chance of each of its Djinn being handed out when the player transfers none (experience_table.c). |
extern const Sint16 | DataTransferDjinnChances [ELEMENT_COUNT] [TRANSFERRED_DJINN_PER_ELEMENT] | The percent chance that gmDataTransferGiveDefaultDjinn hands out each of The Broken Seal's seven Djinn of each element, one row per element. |
Description
The game's rules and data as the battles, the field and the menus share them: the tables of items, abilities, summons, Djinn, characters and enemies, the field Psynergy each ability casts, and the game module's functions the other modules call.
Macros in detail
DRAGON_ENEMY_COUNT
#define DRAGON_ENEMY_COUNT 47
How many enemies EnemyDragonIds and EnemySeaCreatureIds list.
Referenced by EnemyDragonIds and gmEnemyIsDragon().
Definition at line 88 of file game.h.
SEA_CREATURE_ENEMY_COUNT
#define SEA_CREATURE_ENEMY_COUNT 29
Referenced by EnemySeaCreatureIds and gmEnemyIsSeaCreature().
Definition at line 89 of file game.h.
SUMMON_COUNT
#define SUMMON_COUNT 29
How many summons there are (summon_table.c), and the number that ends a list
of them (gmSummonListLearned).
Referenced by gmSummonDefinitionGetNear(), gmSummonListLearned() and SummonOrderList.
Definition at line 129 of file game.h.
SUMMON_END
#define SUMMON_END 32
Ends the summon lists, and marks a summon already moved to the front.
Referenced by gmSummonListLearned(), mnBattleSummonMenuRun(), mnSummonShowLearnedMessage(), SummonAbilities and SummonUnusedElements.
Definition at line 168 of file game.h.
INVENTORY_SNAPSHOT_SPARE
#define INVENTORY_SNAPSHOT_SPARE 392
Where InventorySnapshot's spare space begins, past the party's equipment
gmInventorySnapshotSave keeps and the Trial Road's state: the scenes keep
their own state there (scene/flame_throwers.h's FLAME_THROWERS_STATE).
Definition at line 215 of file game.h.
Enumerations in detail
FIELD_PSY
enum FIELD_PSY
What a Psynergy does when cast on the field (an ability's fieldPsynergy), each named for the abilities that have it in the English release. The field effect it starts keeps it as its animation.
| Enumerator | Value | Description |
|---|---|---|
FIELD_PSYNERGY_MOVE | 1 | |
FIELD_PSYNERGY_MIND_READ | 2 | |
FIELD_PSYNERGY_PLY | 3 | |
FIELD_PSYNERGY_FORCE | 4 | |
FIELD_PSYNERGY_DOUSE | 5 | |
FIELD_PSYNERGY_FROST | 6 | |
FIELD_PSYNERGY_LIFT | 7 | |
FIELD_PSYNERGY_REVEAL | 8 | |
FIELD_PSYNERGY_HALT | 9 | |
FIELD_PSYNERGY_CLOAK | 10 | |
FIELD_PSYNERGY_CARRY | 11 | |
FIELD_PSYNERGY_GROWTH | 12 | |
FIELD_PSYNERGY_CATCH | 13 | |
FIELD_PSYNERGY_WHIRLWIND | 14 | Whirlwind and Gale. |
FIELD_PSYNERGY_RETREAT | 15 | |
FIELD_PSYNERGY_AVOID | 16 | |
FIELD_PSYNERGY_LASH | 17 | |
FIELD_PSYNERGY_POUND | 18 | |
FIELD_PSYNERGY_TREMOR | 19 | |
FIELD_PSYNERGY_SCOOP | 20 | |
FIELD_PSYNERGY_BURST | 21 | |
FIELD_PSYNERGY_PARCH | 22 | |
FIELD_PSYNERGY_SAND | 23 | |
FIELD_PSYNERGY_HOVER | 24 | |
FIELD_PSYNERGY_CYCLONE | 25 | |
FIELD_PSYNERGY_BLAZE | 26 | |
FIELD_PSYNERGY_GRIND | 27 | |
FIELD_PSYNERGY_RING | 28 | The two abilities whose names are question marks. |
FIELD_PSYNERGY_ARROW | 29 | |
FIELD_PSYNERGY_TELEPORT | 30 |
Definition at line 24 of file game.h.
FIELD_PSYNERGY_HANDLER
enum FIELD_PSYNERGY_HANDLER
A step of the current field Psynergy (fdPsynergyRunHandler).
| Enumerator | Value | Description |
|---|---|---|
FIELD_PSYNERGY_HANDLER_UNTARGETED | 0 | Casts it with no target (fdPsynergyRun). |
FIELD_PSYNERGY_HANDLER_ON_TARGET | 1 | Casts it on its target, secondActorId (fdPsynergyDispatch). |
FIELD_PSYNERGY_HANDLER_END_MIND_READ | 2 | Ends it, when it is Mind Read (fdPsynergyFinishMindRead). |
FIELD_PSYNERGY_HANDLER_END | 3 | Ends a lasting one, Reveal, Cloak, Avoid, Sand, Hover or the Ring (fdPsynergyRunEnd). |
Definition at line 61 of file game.h.
SUMMON_ID
enum SUMMON_ID
The summons by summon id, each named for its ability, in the order of
SummonAbilities (summon_table.c): the elements' own four, The Broken Seal's
twelve, then this game's thirteen.
| Enumerator | Value | Description |
|---|---|---|
SUMMON_VENUS | ||
SUMMON_MERCURY | ||
SUMMON_MARS | ||
SUMMON_JUPITER | ||
SUMMON_RAMSES | ||
SUMMON_NEREID | ||
SUMMON_KIRIN | ||
SUMMON_ATALANTA | ||
SUMMON_CYBELE | ||
SUMMON_NEPTUNE | ||
SUMMON_TIAMAT | ||
SUMMON_PROCNE | ||
SUMMON_JUDGMENT | ||
SUMMON_BOREAS | ||
SUMMON_METEOR | ||
SUMMON_THOR | ||
SUMMON_ZAGAN | ||
SUMMON_MEGAERA | ||
SUMMON_FLORA | ||
SUMMON_MOLOCH | ||
SUMMON_ULYSSES | ||
SUMMON_HAURES | ||
SUMMON_ECLIPSE | ||
SUMMON_COATLICUE | ||
SUMMON_DAEDALUS | ||
SUMMON_AZUL | ||
SUMMON_CATASTROPHE | ||
SUMMON_CHARON | ||
SUMMON_IRIS |
Definition at line 134 of file game.h.
Functions in detail
btDjinnRecoverAllStub
void btDjinnRecoverAllStub(void)
Counts the Djinn recovery down twenty times, setting every recovering Djinni
of a party member with HP (btDjinnRecoverAll).
Referenced by gmDjinnSetAllForParty().
Definition at line 100 of file game.h.
gmDjinnGiveStub
Sint32 gmDjinnGiveStub(Sint32 unitId, Sint32 element, Sint32 djinnIndex)
Gives a Djinni to a unit.
Referenced by btDebugParamSetLoad(), mnDjinnMenuDrawStatPreview(), mnDjinnMenuRunPreview() and mnDjinnSetFoundFlagAndAdd().
Definition at line 102 of file game.h.
fdPartyClearUnusableShortcutsStub
void fdPartyClearUnusableShortcutsStub(void)
Clears each button shortcut whose Psynergy can no longer be cast
(fdPartyClearUnusableShortcuts).
Referenced by gmInventoryDiscard(), mnDjinnMenuRun(), mnItemMenuRun(), mnItemMenuRunCommands() and mnPsynergyMenuRun().
Definition at line 105 of file game.h.
gmInventoryAddItemStub
Sint32 gmInventoryAddItemStub(Sint32 unitId, Sint32 itemId)
Gives a unit one item, joining its first matching stack (up to
INVENTORY_STACK_MAX) or taking the first free slot.
Referenced by btDebugParamSetLoad(), fdInventoryTryAddAndReturnMember(), mnDebugWarpArafura2(), mnDebugWarpJupiter(), mnItemMenuRunCommands(), mnShopBuyDone(), mnShopGiveGameTicket(), mnShopOpenDebugShop() and mnShopSelectBuy().
Definition at line 108 of file game.h.
gmInventoryRemoveStub
Sint32 gmInventoryRemoveStub(Sint32 owner, Sint32 slot)
Takes one item out of slot, closing up the inventory when it was the last.
Referenced by btDebugParamSetLoad(), btStagingRunItem(), fdUseItem(), mnForgeOfferItem(), mnInventoryMakeRoom(), mnItemMenuRunCommands(), mnItemUse(), mnShopGiveGameTicket() and mnShopSelectBuy().
Definition at line 110 of file game.h.
mnMessageDecodeRawUnboundedStub
void mnMessageDecodeRawUnboundedStub(Sint32 msg, Uint16 *text)
Decodes message into text with no length limit (mnMessageDecodeRawUnbounded).
Referenced by btLinkBattleReceiveParty() and gmPartyInitCharacters().
Definition at line 125 of file game.h.