1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-08-09 00:00:44 +00:00

Doc equips usage (inventory, current and player-specific constants) (#1142)

* Doc equips usage (inventory, current and player-specific constants)

* Improve some comments

* `currentSword`(`Item`) -> `currentSwordItemId`

* Comments on the right in `D_801261F8`

* Improve `sDebugSaveInventory.equipment` formatting with extra parentheses

* Use constants for `sNewSaveInventory.equipment`

* Run formatter

* Make comments in z64save.h header a single line even if very long

* `CHECK_OWNED_EQUIP_ALT`

* One more use of `CHECK_OWNED_EQUIP`

* `OWNED_EQUIP_FLAG`

* `OWNED_EQUIP_FLAG_ALT`

* Improve (?) giving sword by item id

* "half-byte" -> "nibble"

* Improve equips for setting kokiri sword

* Improve (?) checking boots by item id

* Improve (?) checking equips by item id

* Fixup one spot assuming `EQUIP_TYPE_SWORD == 0`

* Comments on the right in `sBootDListGroups`
This commit is contained in:
Dragorn421 2022-04-30 18:18:56 +02:00 committed by GitHub
parent 72847660eb
commit b9fded7b4e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
27 changed files with 237 additions and 127 deletions

View file

@ -2,12 +2,74 @@
#define Z64ITEM_H
typedef enum {
/* 0x00 */ EQUIP_SWORD,
/* 0x01 */ EQUIP_SHIELD,
/* 0x02 */ EQUIP_TUNIC,
/* 0x03 */ EQUIP_BOOTS
/* 0 */ EQUIP_TYPE_SWORD,
/* 1 */ EQUIP_TYPE_SHIELD,
/* 2 */ EQUIP_TYPE_TUNIC,
/* 3 */ EQUIP_TYPE_BOOTS,
/* 4 */ EQUIP_TYPE_MAX
} EquipmentType;
// `EquipInv*` enums are for Inventory.equipment (for example used in the `CHECK_OWNED_EQUIP` macro)
typedef enum {
/* 0 */ EQUIP_INV_SWORD_KOKIRI,
/* 1 */ EQUIP_INV_SWORD_MASTER,
/* 2 */ EQUIP_INV_SWORD_BGS,
/* 3 */ EQUIP_INV_SWORD_BROKENGIANTKNIFE
} EquipInvSword;
typedef enum {
/* 0 */ EQUIP_INV_SHIELD_DEKU,
/* 1 */ EQUIP_INV_SHIELD_HYLIAN,
/* 2 */ EQUIP_INV_SHIELD_MIRROR
} EquipInvShield;
typedef enum {
/* 0 */ EQUIP_INV_TUNIC_KOKIRI,
/* 1 */ EQUIP_INV_TUNIC_GORON,
/* 2 */ EQUIP_INV_TUNIC_ZORA
} EquipInvTunic;
typedef enum {
/* 0 */ EQUIP_INV_BOOTS_KOKIRI,
/* 1 */ EQUIP_INV_BOOTS_IRON,
/* 2 */ EQUIP_INV_BOOTS_HOVER
} EquipInvBoots;
// `EquipValue*` enums are for ItemEquips.equipment (for example used in the `CUR_EQUIP_VALUE` macro)
typedef enum {
/* 0 */ EQUIP_VALUE_SWORD_NONE,
/* 1 */ EQUIP_VALUE_SWORD_KOKIRI,
/* 2 */ EQUIP_VALUE_SWORD_MASTER,
/* 3 */ EQUIP_VALUE_SWORD_BGS,
/* 4 */ EQUIP_VALUE_SWORD_MAX
} EquipValueSword;
typedef enum {
/* 0 */ EQUIP_VALUE_SHIELD_NONE,
/* 1 */ EQUIP_VALUE_SHIELD_DEKU,
/* 2 */ EQUIP_VALUE_SHIELD_HYLIAN,
/* 3 */ EQUIP_VALUE_SHIELD_MIRROR,
/* 4 */ EQUIP_VALUE_SHIELD_MAX
} EquipValueShield;
typedef enum {
/* 0 */ EQUIP_VALUE_TUNIC_NONE,
/* 1 */ EQUIP_VALUE_TUNIC_KOKIRI,
/* 2 */ EQUIP_VALUE_TUNIC_GORON,
/* 3 */ EQUIP_VALUE_TUNIC_ZORA,
/* 4 */ EQUIP_VALUE_TUNIC_MAX
} EquipValueTunic;
typedef enum {
/* 0 */ EQUIP_VALUE_BOOTS_NONE,
/* 1 */ EQUIP_VALUE_BOOTS_KOKIRI,
/* 2 */ EQUIP_VALUE_BOOTS_IRON,
/* 3 */ EQUIP_VALUE_BOOTS_HOVER,
/* 4 */ EQUIP_VALUE_BOOTS_MAX
} EquipValueBoots;
typedef enum {
/* 0x00 */ UPG_QUIVER,
/* 0x01 */ UPG_BOMB_BAG,