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.
FACE_ISAAC_CHILD
#define FACE_ISAAC_CHILD 56
Portrait numbers
Used by gPortrait_CharacterMap.
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
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.
item.h
Structures
ItemEffect
struct ItemEffect
One effect of an item while equipped: its kind (enum ItemEffectKind) and amount.
| Field | Declared as | |
|---|---|---|
kind | u8 kind | enum ItemEffectKind; 0 for none |
amount | s8 amount | what the kind adds or scales by |
reserved02 | u8 reserved02[2] | not named by TBS code |
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.
| Field | Declared as | |
|---|---|---|
price | s16 price | coins |
type | u8 type | enum ItemType; 0 for an item that is not equipment |
flags | u8 flags | enum ItemFlags |
equipMask | u16 equipMask | one bit per character that can equip it, bit 0 Isaac |
icon | u16 icon | indexes gUiIcon_ItemIconPointers |
primaryBonus | s16 primaryBonus | Attack added while equipped |
secondaryBonus | s8 secondaryBonus | Defense added while equipped |
unleashChance | u8 unleashChance | in steps of 5 percent |
useType | u8 useType | what using it costs (ITEM_USE_), or 0 for nothing |
reserved0d | u8 reserved0d | not named by TBS code |
unleashAction | u16 unleashAction | the action a weapon unleashes, or 0 |
reserved10 | u8 reserved10[4] | not named by TBS code |
element | s32 element | a weapon's attack element; 4 for none |
effects | struct ItemEffect effects[4] | what it does while equipped |
actionId | u16 actionId | the ability used, or taught as Psynergy |
reserved2a | u8 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.
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_MASK | 0x1ff | |
INVENTORY_EQUIPPED | 0x200 | |
INVENTORY_BROKEN | 0x400 | |
INVENTORY_ENTRY_MASK | 0x7ff | |
INVENTORY_QUANTITY_SHIFT | 11 | |
INVENTORY_QUANTITY_STEP | 0x800 | |
INVENTORY_QUANTITY_MASK | 0xf800 | |
INVENTORY_SLOTS | 15 |
ItemFlags
enum ItemFlags
| Value | = | |
|---|---|---|
ITEM_CURSED | 1 | |
ITEM_CANNOT_UNEQUIP | 2 | |
ITEM_RARE | 4 | selects the shop's rare item offers |
ITEM_INDISPENSABLE | 8 | |
ITEM_STACKABLE | 0x10 |
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_NONE | 0 | not equipment: Herb, Game Ticket, the keys, unused rows |
ITEM_TYPE_WEAPON | 1 | swords, axes, maces, rods and staffs |
ITEM_TYPE_ARMOR | 2 | armor, clothes and robes |
ITEM_TYPE_SHIELD | 3 | shields, gloves and armlets |
ITEM_TYPE_HELM | 4 | helms, caps, crowns and circlets |
ITEM_TYPE_BOOTS | 5 | Hyper Boots to Turtle Boots |
ITEM_TYPE_PSYNERGY | 6 | The items that teach Psynergy while held: Orb of Force to Catch Beads. |
ITEM_TYPE_RING | 8 | Adept Ring to Cleric's Ring |
ITEM_TYPE_SHIRT | 9 | Mythril Shirt, Silk Shirt, Running Shirt |
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_POWER | Element 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_CHANCE | percent added to the weapon's unleash | |
ITEM_EFFECT_24 | summed by UnitCalc; TBS never reads it | |
ITEM_EFFECT_25 | sets restraint bit 3, which lifts bit 0 | |
ITEM_EFFECT_ADD_TURNS | more actions each round | |
ITEM_EFFECT_LURE | sets FLAG_LURE_CAP while worn: encounters come faster |
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.
ITEM_USE_TEACHES
#define ITEM_USE_TEACHES 3
Not used up: equipped, it teaches its actionId as Psynergy.
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