From a9b4d0208bc368875f303434d42ea474869ed180 Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Fri, 17 May 2019 10:38:48 +0200 Subject: [PATCH] Move new species to battle_config.h --- include/constants/battle_config.h | 12 ++++++++++++ include/constants/items.h | 2 -- include/constants/species.h | 7 ------- src/battle_util.c | 4 ++++ 4 files changed, 16 insertions(+), 9 deletions(-) diff --git a/include/constants/battle_config.h b/include/constants/battle_config.h index 8a65728746..d0ed6c3572 100644 --- a/include/constants/battle_config.h +++ b/include/constants/battle_config.h @@ -1,6 +1,18 @@ #ifndef GUARD_CONSTANTS_BATTLE_CONFIG_H #define GUARD_CONSTANTS_BATTLE_CONFIG_H +// Species with peculiar battle effects. Remove them if they're properly placed in constant/species.h +#define SPECIES_DIALGA 0 +#define SPECIES_PALKIA 0 +#define SPECIES_GIRATINA 0 +#define SPECIES_CHERRIM 0 +#define SPECIES_ARCEUS 0 +#define SPECIES_SILVALLY 0 +#define SPECIES_GENESECT 0 + +// Items with peculiar battle effects. Remove them if they're properly placed in constant/items.h +#define ITEM_GRISEOUS_ORB 0 + #define GEN_3 0 #define GEN_4 1 #define GEN_5 2 diff --git a/include/constants/items.h b/include/constants/items.h index c02b06273a..3a894f8ff6 100644 --- a/include/constants/items.h +++ b/include/constants/items.h @@ -475,6 +475,4 @@ // Check if the item is one that can be used on a Pokemon. #define ITEM_HAS_EFFECT(item) ((item) >= ITEM_POTION && (item) <= ITEM_0B2) -#define ITEM_GRISEOUS_ORB 0 - #endif // GUARD_CONSTANTS_ITEMS_H diff --git a/include/constants/species.h b/include/constants/species.h index afb250d6ac..02e5ea3964 100644 --- a/include/constants/species.h +++ b/include/constants/species.h @@ -447,13 +447,6 @@ #define NUM_SPECIES SPECIES_EGG -#define SPECIES_DIALGA 0 -#define SPECIES_PALKIA 0 -#define SPECIES_GIRATINA 0 -#define SPECIES_CHERRIM 0 -#define SPECIES_ARCEUS 0 -#define SPECIES_SILVALLY 0 - // National Dex Index Defines #define NATIONAL_DEX_NONE 0 diff --git a/src/battle_util.c b/src/battle_util.c index 166c801fb2..7c5eccc2b8 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -6115,6 +6115,10 @@ bool32 CanBattlerGetOrLoseItem(u8 battlerId, u16 itemId) return FALSE; else if (species == SPECIES_GIRATINA && itemId == ITEM_GRISEOUS_ORB) return FALSE; + else if (species == SPECIES_GENESECT && GetBattlerHoldEffect(battlerId, FALSE) == HOLD_EFFECT_DRIVE) + return FALSE; + else if (species == SPECIES_SILVALLY && GetBattlerHoldEffect(battlerId, FALSE) == HOLD_EFFECT_MEMORY) + return FALSE; else return TRUE; }