Alchemy

game

games/tbs/include/game on GitHub

character_ids.h

games/tbs/include/game/character_ids.h

Macros

ISAAC_CHILD

#define ISAAC_CHILD 18

The childhood sprites, shown while flag 32 is set; the eight party members' sprites share their character numbers

Used by gPortrait_CharacterMap.

Line 20

FACE_ISAAC_CHILD

#define FACE_ISAAC_CHILD 56

Portrait numbers

Used by gPortrait_CharacterMap.

Line 24

Also, macros without a comment: CHARACTER_IDS_H, ISAAC, GARET, IVAN, MIA, FELIX, JENNA, SHEBA, PIERS, BATTLE_CHARACTER, GARET_CHILD, FACE_GARET_CHILD.

ed_asm.h

games/tbs/include/game/ed_asm.h

edition.h

games/tbs/include/game/edition.h

Macros, without a comment: GUARD_EDITION_H, LANGUAGE_JAPANESE, LANGUAGE_ENGLISH, LANGUAGE_GERMAN, LANGUAGE_SPANISH, LANGUAGE_FRENCH, LANGUAGE_ITALIAN, LANGUAGE, LANGUAGE, LANGUAGE, LANGUAGE, LANGUAGE, LANGUAGE.

game.h

games/tbs/include/game/game.h

Macros, without a comment: GAME_H.

Globals, without a comment: gItem_DefinitionTable, gSummon_DefinitionTable, gBattleAction_DefinitionTable, gCharacter_ElementGroupTable, gCharacter_LevelExpTable, gDjinn_ElementSprites, gOwner_FourColumnValues, gDjinn_DefinitionTable, gElement_PowerResistCurve, gEnemy_Definitions, gEnemy_ElementPresetTable, gGameFlagBytes, gInventorySnapshot, gItemCounters, gSaveStamp, gItem_ArtifactSlotTable, gCharacter_SpriteTable, gCharacter_ChildSpriteTable, gSummon_OrderList.

Declarations, without a comment: Audio_Check.

game_flags.h

games/tbs/include/game/game_flags.h

Macros

GAME_FLAG_BYTE

#define GAME_FLAG_BYTE(flag) (((u32)(flag) << 20) >> 23)

The byte of gGameFlagBytes that holds flag: bits 3 to 11 of its number, isolated by shifting up and back down, which is how the game computes it.

Used by GameFlag_ClearBit, GameFlag_DecrementByte, GameFlag_IncrementByte, GameFlag_SetBit, GameFlag_SetNibble, GameFlag_Test, GameFlag_Toggle.

Line 12

item.h

games/tbs/include/game/item.h

Structures

ItemEffect

struct ItemEffect

One effect of an item while equipped: its kind (enum ItemEffectKind) and amount.

FieldDeclared as
kindu8 kindenum ItemEffectKind; 0 for none
amounts8 amountwhat the kind adds or scales by
reserved02u8 reserved02[2]not named by TBS code

Line 92

ItemDefinition

struct ItemDefinition

An item's definition: its price, type, who can equip it, its bonuses and unleash, its effects and the action it is used for.

FieldDeclared as
prices16 pricecoins
typeu8 typeenum ItemType; 0 for an item that is not equipment
flagsu8 flagsenum ItemFlags
equipMasku16 equipMaskone bit per character that can equip it, bit 0 Isaac
iconu16 iconindexes gUiIcon_ItemIconPointers
primaryBonuss16 primaryBonusAttack added while equipped
secondaryBonuss8 secondaryBonusDefense added while equipped
unleashChanceu8 unleashChancein steps of 5 percent
useTypeu8 useTypewhat using it costs (ITEM_USE_), or 0 for nothing
reserved0du8 reserved0dnot named by TBS code
unleashActionu16 unleashActionthe action a weapon unleashes, or 0
reserved10u8 reserved10[4]not named by TBS code
elements32 elementa weapon's attack element; 4 for none
effectsstruct ItemEffect effects[4]what it does while equipped
actionIdu16 actionIdthe ability used, or taught as Psynergy
reserved2au8 reserved2a[2]not named by TBS code

Used by BattleCommand_BuildPlan, BattlePres_RunItem, Equipment_GetUnleashRateBonus, GomaCaveEntrance_GiveShamansRod, InventoryMenu_SortByListOrder, Inventory_AddItem, Inventory_CheckDiscard, Inventory_CountItem, Inventory_Equip, Inventory_FindEquipped, Inventory_GetEquippedDefinition, Inventory_GetEquippedItem, ItemIcon_Compose, ItemMenu_BuildCommands, ItemMenu_DrawEquipPage, ItemMenu_DrawItemDetails, Item_CanOwnerEquipDirect, Item_ClassifyUseAbility, Item_ClassifyUseMode, Item_GetDirect, Item_GetEquipmentGroup, Item_GetEquippedElement, Item_Use, Menu_DrawOwnerStatusPanel, RollWeaponUnleash, Shop_BuyDone, Shop_ConfirmEquip, Shop_DrawEquipComparison, Shop_DrawStock, Shop_RepairItem, Shop_SelectBuy, Shop_SelectBuyNum, Shop_SelectSellNum, Shop_SellItem, Ui_PrepareTransferForItem, gItem_DefinitionTable, item.

Line 104

Enumerations

InventoryEncoding

enum InventoryEncoding

An inventory entry's parts, and a unit's slot count. bits: 15..11 quantity | 10 broken | 9 equipped | 8..0 item id

Value=
ITEM_ID_MASK0x1ff
INVENTORY_EQUIPPED0x200
INVENTORY_BROKEN0x400
INVENTORY_ENTRY_MASK0x7ff
INVENTORY_QUANTITY_SHIFT11
INVENTORY_QUANTITY_STEP0x800
INVENTORY_QUANTITY_MASK0xf800
INVENTORY_SLOTS15

Line 15

ItemFlags

enum ItemFlags

Value=
ITEM_CURSED1
ITEM_CANNOT_UNEQUIP2
ITEM_RARE4selects the shop's rare item offers
ITEM_INDISPENSABLE8
ITEM_STACKABLE0x10

Line 26

ItemType

enum ItemType

An item's type (struct ItemDefinition's type, items.tsv's type column). A unit equips one item of each type, except Psynergy items.

Value=
ITEM_TYPE_NONE0not equipment: Herb, Game Ticket, the keys, unused rows
ITEM_TYPE_WEAPON1swords, axes, maces, rods and staffs
ITEM_TYPE_ARMOR2armor, clothes and robes
ITEM_TYPE_SHIELD3shields, gloves and armlets
ITEM_TYPE_HELM4helms, caps, crowns and circlets
ITEM_TYPE_BOOTS5Hyper Boots to Turtle Boots
ITEM_TYPE_PSYNERGY6The items that teach Psynergy while held: Orb of Force to Catch Beads.
ITEM_TYPE_RING8Adept Ring to Cleric's Ring
ITEM_TYPE_SHIRT9Mythril Shirt, Silk Shirt, Running Shirt

Line 43

ItemEffectKind

enum ItemEffectKind

Value=
ITEM_EFFECT_NONE
ITEM_EFFECT_ADD_HP
ITEM_EFFECT_ADD_HP_REGEN
ITEM_EFFECT_ADD_PP
ITEM_EFFECT_ADD_PP_REGEN
ITEM_EFFECT_ADD_AGILITY
ITEM_EFFECT_ADD_LUCK
ITEM_EFFECT_SCALE_HP
ITEM_EFFECT_SCALE_HP_REGEN
ITEM_EFFECT_SCALE_PP
ITEM_EFFECT_SCALE_PP_REGEN
ITEM_EFFECT_SCALE_ATTACK
ITEM_EFFECT_SCALE_DEFENSE
ITEM_EFFECT_SCALE_AGILITY
ITEM_EFFECT_SCALE_LUCK
ITEM_EFFECT_ADD_VENUS_POWERElement power and resistance, in the element order Venus, Mercury, Mars, Jupiter
ITEM_EFFECT_ADD_MERCURY_POWER
ITEM_EFFECT_ADD_MARS_POWER
ITEM_EFFECT_ADD_JUPITER_POWER
ITEM_EFFECT_ADD_VENUS_RESIST
ITEM_EFFECT_ADD_MERCURY_RESIST
ITEM_EFFECT_ADD_MARS_RESIST
ITEM_EFFECT_ADD_JUPITER_RESIST
ITEM_EFFECT_ADD_UNLEASH_CHANCEpercent added to the weapon's unleash
ITEM_EFFECT_24summed by UnitCalc; TBS never reads it
ITEM_EFFECT_25sets restraint bit 3, which lifts bit 0
ITEM_EFFECT_ADD_TURNSmore actions each round
ITEM_EFFECT_LUREsets FLAG_LURE_CAP while worn: encounters come faster

Line 57

Macros

ITEM_USE_CONSUMED

#define ITEM_USE_CONSUMED 1 ///< one is used up

What using an item costs (struct ItemDefinition's useType).

Used by BattlePres_RunItem, GomaCaveEntrance_GiveShamansRod.

Line 35

ITEM_USE_TEACHES

#define ITEM_USE_TEACHES 3

Not used up: equipped, it teaches its actionId as Psynergy.

Line 38

Also, macros without a comment: ITEM_USE_MAY_BREAK, ITEM_USE_EMPTIES.

Declarations, without a comment: Item_Get.

item_gift.h

games/tbs/include/game/item_gift.h

owner_value.h

games/tbs/include/game/owner_value.h

On this page