summaryrefslogtreecommitdiff
path: root/include/constants
diff options
context:
space:
mode:
Diffstat (limited to 'include/constants')
-rw-r--r--include/constants/items.h30
-rw-r--r--include/constants/rgb.h23
2 files changed, 39 insertions, 14 deletions
diff --git a/include/constants/items.h b/include/constants/items.h
index 95c6aacfe..71338da8e 100644
--- a/include/constants/items.h
+++ b/include/constants/items.h
@@ -17,7 +17,11 @@
#define ITEM_LUXURY_BALL 11
#define ITEM_PREMIER_BALL 12
-#define LAST_BALL ITEM_PREMIER_BALL
+// Note: If moving ball IDs around, updating FIRST_BALL/LAST_BALL is not sufficient
+// Several places expect the ball IDs to be first and contiguous (e.g. gBattlescriptsForBallThrow and MON_DATA_POKEBALL)
+// If adding new balls, it's easiest to insert them after the last ball and increment the below IDs (and removing ITEM_034 for example)
+#define FIRST_BALL ITEM_MASTER_BALL
+#define LAST_BALL ITEM_PREMIER_BALL
// Pokemon Items
#define ITEM_POTION 13
@@ -145,6 +149,8 @@
#define ITEM_FAB_MAIL 131
#define ITEM_RETRO_MAIL 132
+#define FIRST_MAIL_INDEX ITEM_ORANGE_MAIL
+
// Berries
#define ITEM_CHERI_BERRY 133
#define ITEM_CHESTO_BERRY 134
@@ -189,6 +195,10 @@
#define ITEM_LANSAT_BERRY 173
#define ITEM_STARF_BERRY 174
#define ITEM_ENIGMA_BERRY 175
+
+#define FIRST_BERRY_INDEX ITEM_CHERI_BERRY
+#define LAST_BERRY_INDEX ITEM_ENIGMA_BERRY
+
#define ITEM_0B0 176
#define ITEM_0B1 177
#define ITEM_0B2 178
@@ -467,9 +477,6 @@
#define ITEMS_COUNT 377
#define ITEM_FIELD_ARROW ITEMS_COUNT
-#define FIRST_BERRY_INDEX ITEM_CHERI_BERRY
-#define LAST_BERRY_INDEX ITEM_ENIGMA_BERRY
-
// Range of berries given out by various NPCS
#define FIRST_BERRY_MASTER_BERRY ITEM_POMEG_BERRY
#define LAST_BERRY_MASTER_BERRY ITEM_NOMEL_BERRY
@@ -506,6 +513,21 @@
#define GOOD_ROD 1
#define SUPER_ROD 2
+// Secondary IDs for bikes
+#define MACH_BIKE 0
+#define ACRO_BIKE 1
+
+// Item type IDs (used to determine the exit callback)
+#define ITEM_USE_MAIL 0
+#define ITEM_USE_PARTY_MENU 1
+#define ITEM_USE_FIELD 2
+#define ITEM_USE_PBLOCK_CASE 3
+#define ITEM_USE_BAG_MENU 4 // No exit callback, stays in bag menu
+
+// Item battle usage IDs (only checked to see if nonzero)
+#define ITEM_B_USE_MEDICINE 1
+#define ITEM_B_USE_OTHER 2
+
// Check if the item is one that can be used on a Pokemon.
#define ITEM_HAS_EFFECT(item) ((item) >= ITEM_POTION && (item) <= ITEM_0B2)
diff --git a/include/constants/rgb.h b/include/constants/rgb.h
index 1896250d2..be3049d3c 100644
--- a/include/constants/rgb.h
+++ b/include/constants/rgb.h
@@ -5,18 +5,21 @@
#define GET_G(color) (((color) >> 5) & 0x1F)
#define GET_B(color) (((color) >> 10) & 0x1F)
-#define RGB(r, g, b) ((r) | ((g) << 5) | ((b) << 10))
+#define RGB(r, g, b) ((r) | ((g) << 5) | ((b) << 10))
#define RGB2(r, g, b) (((b) << 10) | ((g) << 5) | (r))
#define _RGB(r, g, b) ((((b) & 0x1F) << 10) + (((g) & 0x1F) << 5) + ((r) & 0x1F))
-#define RGB_BLACK RGB(0, 0, 0)
-#define RGB_WHITE RGB(31, 31, 31)
-#define RGB_RED RGB(31, 0, 0)
-#define RGB_GREEN RGB(0, 31, 0)
-#define RGB_BLUE RGB(0, 0, 31)
-#define RGB_YELLOW RGB(31, 31, 0)
-#define RGB_MAGENTA RGB(31, 0, 31)
-#define RGB_CYAN RGB(0, 31, 31)
-#define RGB_WHITEALPHA (RGB_WHITE | 0x8000)
+#define RGB_ALPHA (1 << 15)
+#define IS_ALPHA(color) ((color) & RGB_ALPHA)
+
+#define RGB_BLACK RGB(0, 0, 0)
+#define RGB_WHITE RGB(31, 31, 31)
+#define RGB_RED RGB(31, 0, 0)
+#define RGB_GREEN RGB(0, 31, 0)
+#define RGB_BLUE RGB(0, 0, 31)
+#define RGB_YELLOW RGB(31, 31, 0)
+#define RGB_MAGENTA RGB(31, 0, 31)
+#define RGB_CYAN RGB(0, 31, 31)
+#define RGB_WHITEALPHA (RGB_WHITE | RGB_ALPHA)
#endif // GUARD_RGB_H