Key Items configuration in file.

This commit is contained in:
Eduardo Quezada 2020-10-17 01:25:54 -03:00
parent 217afe4a03
commit 137d9801c0
3 changed files with 52 additions and 0 deletions

View File

@ -0,0 +1,20 @@
#ifndef GUARD_CONSTANTS_ITEM_CONFIG_H
#define GUARD_CONSTANTS_ITEM_CONFIG_H
// Used by other branches to communicate with each other.
#define ITEM_EXPANSION
#ifndef GEN_3
#define GEN_3 0
#define GEN_4 1
#define GEN_5 2
#define GEN_6 3
#define GEN_7 4
#define GEN_8 5
#endif
// Item config
#define P_KEY_FOSSILS GEN_7 // In Gen4+, all Gen 3 fossils became regular items.
#define P_KEY_ESCAPE_ROPE GEN_7 // In Gen8, Escape Rope became a Key Item.
#endif // GUARD_CONSTANTS_ITEM_CONFIG_H

View File

@ -2,6 +2,7 @@
#define GUARD_ITEM_H
#include "constants/item.h"
#include "constants/item_config.h"
typedef void (*ItemUseFunc)(u8);

View File

@ -1283,7 +1283,13 @@ const struct Item gItems[] =
.itemId = ITEM_ESCAPE_ROPE,
.price = 550,
.description = sEscapeRopeDesc,
#if P_KEY_ESCAPE_ROPE >= GEN_8
.importance = 1,
.pocket = POCKET_KEY_ITEMS,
#else
.importance = 0,
.pocket = POCKET_ITEMS,
#endif
.type = 2,
.fieldUseFunc = ItemUseOutOfBattle_EscapeRope,
.secondaryId = 0,
@ -4813,8 +4819,13 @@ const struct Item gItems[] =
.itemId = ITEM_OLD_AMBER,
.price = 0,
.description = sOldAmberDesc,
#if P_KEY_FOSSILS >= GEN_4
.importance = 1,
.pocket = POCKET_KEY_ITEMS,
#else
.importance = 0,
.pocket = POCKET_ITEMS,
#endif
.type = 4,
.fieldUseFunc = ItemUseOutOfBattle_CannotUse,
.secondaryId = 0,
@ -4878,8 +4889,13 @@ const struct Item gItems[] =
.itemId = ITEM_HELIX_FOSSIL,
.price = 0,
.description = sHelixFossilDesc,
#if P_KEY_FOSSILS >= GEN_4
.importance = 1,
.pocket = POCKET_KEY_ITEMS,
#else
.importance = 0,
.pocket = POCKET_ITEMS,
#endif
.type = 4,
.fieldUseFunc = ItemUseOutOfBattle_CannotUse,
.secondaryId = 0,
@ -4891,8 +4907,13 @@ const struct Item gItems[] =
.itemId = ITEM_DOME_FOSSIL,
.price = 0,
.description = sDomeFossilDesc,
#if P_KEY_FOSSILS >= GEN_4
.importance = 1,
.pocket = POCKET_KEY_ITEMS,
#else
.importance = 0,
.pocket = POCKET_ITEMS,
#endif
.type = 4,
.fieldUseFunc = ItemUseOutOfBattle_CannotUse,
.secondaryId = 0,
@ -4904,8 +4925,13 @@ const struct Item gItems[] =
.itemId = ITEM_ROOT_FOSSIL,
.price = 0,
.description = sRootFossilDesc,
#if P_KEY_FOSSILS >= GEN_4
.importance = 1,
.pocket = POCKET_KEY_ITEMS,
#else
.importance = 0,
.pocket = POCKET_ITEMS,
#endif
.type = 4,
.fieldUseFunc = ItemUseOutOfBattle_CannotUse,
.secondaryId = 0,
@ -4917,8 +4943,13 @@ const struct Item gItems[] =
.itemId = ITEM_CLAW_FOSSIL,
.price = 0,
.description = sClawFossilDesc,
#if P_KEY_FOSSILS >= GEN_4
.importance = 1,
.pocket = POCKET_KEY_ITEMS,
#else
.importance = 0,
.pocket = POCKET_ITEMS,
#endif
.type = 4,
.fieldUseFunc = ItemUseOutOfBattle_CannotUse,
.secondaryId = 0,