Alchemy
Loading...
Searching...
No Matches

game.c

Go to the documentation of this file.
1/// @file
2/// The game object: the rules of the party and its world. Units and their
3/// stats, a new game, items and inventories, Psynergy and levels, the game
4/// flags, enemy units and the party's counters, element levels and classes,
5/// battle arithmetic and the Djinn.
6///
7/// game_internal.h holds what every part shares (its includes and one inline
8/// helper); the code is in the files under game/, included here in the order
9/// it has in the ROM. Camelot's own files are not recoverable: the ROM shows
10/// one object, and these parts are ours, cut where one family ends and the
11/// next begins. Its tables are the .tsv files in this folder, built by the .s
12/// files beside them; README.md gives the words and prefixes. Where to start:
13///
14/// Units units.c: UnitGet, UnitCalc, GameState_InitDefaults
15/// Items inventory.c: Inventory_AddItem, Inventory_Equip,
16/// PartyInventory_Add
17/// Levels levels.c: Unit_RefreshPsynergy, Owner_LevelUp
18/// Flags flags.c: GameFlag_Test, GameFlag_SetBit
19/// Enemies, party party.c: BattleUnitSet, Party_AddActiveOwner,
20/// Party_AdjustCoins
21/// Classes classes.c: Class_Determine, Unit_UpdateClass
22/// Battle maths battle_calc.c: Battle_GetElementMultiplier,
23/// BattleRandom
24/// Djinn djinn.c: Djinn_AddToOwner, Djinn_Activate
25
26#include "game_internal.h"
27
28// The game object's code, in ROM order. Each part is compiled here, as part
29// of this one object, never on its own: the order of these includes is the
30// order of the code in the ROM.
31#include "game/units.c"
32#include "game/inventory.c"
33#include "game/levels.c"
34#include "game/flags.c"
35#include "game/party.c"
36#include "game/classes.c"
37#include "game/battle_calc.c"
38#include "game/djinn.c"
39#include "game/snapshot.c"
Battle arithmetic: element multipliers, random rolls and success rates.
The game flags: bits, bytes and nibbles.
Element levels and classes.
Djinn: definitions, setting and standby, and their counts.
What every part of the game object shares: its includes and the inventory helper two parts use.
Items and inventories: equipping, adding, removing, breaking and counting.
Actions and Psynergy lists, characters, experience and levelling up.
Enemy units, the active party, coins and counters, and summons.
Equipping a given item, and the equipment put aside for the Colosso.
The party's units and their stats, a new game, the prologue, HP and PP.