Skip to Content
The Alchemy Project

src/game/game_snapshot.c

Equipping a given item, and the equipment put aside for the Colosso. More…

Included by game.c.

Structures

NameDescription
structINVENTORY_SNAPSHOTWhat InventorySnapshotWork holds while the Colosso has the party's equipment: 65 halfwords of the 70 it reserves.

Macros

NameDescription
#defineINVENTORY_SNAPSHOT_SENTINEL 26484The first halfword of InventorySnapshotWork while it holds the party's equipment, put aside while the Colosso takes it away.

Functions

NameDescription
voidgmInventoryAddAndEquip (Sint32 unitId, Sint32 itemId)Gives a unit itemId and equips every exactly matching inventory entry.
voidgmInventorySnapshotSave (void)Saves Isaac's to Mia's inventories, the shortcuts and the party order, then keeps only the Psynergy-granting items, gives Isaac the Short Sword, sets FLAG_COLOSSO_HOLDS_EQUIPMENT and restores everyone's HP and PP.
voidgmInventorySnapshotRestore (void)Gives back the inventories, shortcuts and party order gmInventorySnapshotSave put aside, then clears the snapshot and FLAG_COLOSSO_HOLDS_EQUIPMENT.

Description

Equipping a given item, and the equipment put aside for the Colosso. Part of game.c.

Macros in detail

INVENTORY_SNAPSHOT_SENTINEL

#define INVENTORY_SNAPSHOT_SENTINEL 26484

The first halfword of InventorySnapshotWork while it holds the party's equipment, put aside while the Colosso takes it away.

Referenced by gmInventorySnapshotRestore() and gmInventorySnapshotSave().

Definition at line 20 of file game_snapshot.c.

Functions in detail

gmInventoryAddAndEquip

void gmInventoryAddAndEquip(Sint32 unitId, Sint32 itemId)

Gives a unit itemId and equips every exactly matching inventory entry.

References gmInventoryAddItem(), gmInventoryEquip(), gmUnitGet() and Sint32.

Referenced by gmInventorySnapshotSave().

Definition at line 5 of file game_snapshot.c.

gmInventorySnapshotSave

void gmInventorySnapshotSave(void)

Saves Isaac's to Mia's inventories, the shortcuts and the party order, then keeps only the Psynergy-granting items, gives Isaac the Short Sword, sets FLAG_COLOSSO_HOLDS_EQUIPMENT and restores everyone's HP and PP. Nothing happens when a snapshot is already saved, apart from the restore.

References gmFlagSet(), gmInventoryAddAndEquip(), gmInventoryCompactSlots(), gmItemGetDefinition(), gmPartyRestoreHpPp(), gmUnitCalculate(), gmUnitGet(), gmUnitUpdateClass(), InventorySnapshotWork, MainRoutineStateWork and Sint32.

Referenced by scColosseumEntranceApplyArrivalState().

Definition at line 41 of file game_snapshot.c.

gmInventorySnapshotRestore

void gmInventorySnapshotRestore(void)

Gives back the inventories, shortcuts and party order gmInventorySnapshotSave put aside, then clears the snapshot and FLAG_COLOSSO_HOLDS_EQUIPMENT.

References gmFlagClear(), gmUnitCalculate(), gmUnitGet(), gmUnitUpdateClass(), InventorySnapshotWork, MainRoutineStateWork and Sint32.

Referenced by scBabiPalaceRestorePartyAndInventory() and scInit().

Definition at line 96 of file game_snapshot.c.