diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/berry.c | 5 | ||||
-rw-r--r-- | src/berry_tag_screen.c | 3 | ||||
-rw-r--r-- | src/calculate_base_damage.c | 5 | ||||
-rw-r--r-- | src/mail.c | 16 | ||||
-rw-r--r-- | src/pokemon_1.c | 3 | ||||
-rw-r--r-- | src/pokemon_3.c | 9 |
6 files changed, 16 insertions, 25 deletions
diff --git a/src/berry.c b/src/berry.c index 9f641262d..84db22a27 100644 --- a/src/berry.c +++ b/src/berry.c @@ -5,9 +5,10 @@ #include "main.h" #include "text.h" #include "rng.h" +#include "items.h" -#define FIRST_BERRY 0x85 // ITEM_CHERI_BERRY -#define LAST_BERRY 0xaf // ITEM_ENIGMA_BERRY +#define FIRST_BERRY ITEM_CHERI_BERRY +#define LAST_BERRY ITEM_ENIGMA_BERRY extern struct Berry gBerries[]; extern u8 BerryTreeScript; diff --git a/src/berry_tag_screen.c b/src/berry_tag_screen.c index e7ef9ca76..1b432fe70 100644 --- a/src/berry_tag_screen.c +++ b/src/berry_tag_screen.c @@ -13,9 +13,10 @@ #include "string_util.h" #include "task.h" #include "text.h" +#include "items.h" #define OFFSET_7B (123) -#define FIRST_BERRY (0x85) // ITEM_CHERI_BERRY +#define FIRST_BERRY ITEM_CHERI_BERRY struct Struct2000000 { /*0x00*/ u8 filler_0[0x1FFFF]; diff --git a/src/calculate_base_damage.c b/src/calculate_base_damage.c index e6fd49444..86446e588 100644 --- a/src/calculate_base_damage.c +++ b/src/calculate_base_damage.c @@ -11,6 +11,7 @@ #include "hold_effects.h" #include "event_data.h" #include "battle.h" +#include "items.h" extern u8 gPlayerPartyCount; extern struct Pokemon gPlayerParty[6]; @@ -89,7 +90,7 @@ s32 CalculateBaseDamage(struct BattlePokemon *attacker, struct BattlePokemon *de spAttack = attacker->spAttack; spDefense = defender->spDefense; - if (attacker->item == 175) + if (attacker->item == ITEM_ENIGMA_BERRY) { attackerHoldEffect = gEnigmaBerries[a7].holdEffect; attackerHoldEffectParam = gEnigmaBerries[a7].holdEffectParam; @@ -100,7 +101,7 @@ s32 CalculateBaseDamage(struct BattlePokemon *attacker, struct BattlePokemon *de attackerHoldEffectParam = ItemId_GetHoldEffectParam(attacker->item); } - if (defender->item == 175) + if (defender->item == ITEM_ENIGMA_BERRY) { defenderHoldEffect = gEnigmaBerries[a8].holdEffect; defenderHoldEffectParam = gEnigmaBerries[a8].holdEffectParam; diff --git a/src/mail.c b/src/mail.c index 14f63c52a..6cff514a1 100644 --- a/src/mail.c +++ b/src/mail.c @@ -8,6 +8,7 @@ #include "string_util.h" #include "task.h" #include "text.h" +#include "items.h" struct UnkMailStruct { @@ -56,21 +57,6 @@ struct MailGraphics { u16 color12; }; -enum { - ITEM_ORANGE_MAIL = 0x79, - ITEM_HARBOR_MAIL, - ITEM_GLITTER_MAIL, - ITEM_MECH_MAIL, - ITEM_WOOD_MAIL, - ITEM_WAVE_MAIL, - ITEM_BEAD_MAIL, - ITEM_SHADOW_MAIL, - ITEM_TROPIC_MAIL, - ITEM_DREAM_MAIL, - ITEM_FAB_MAIL, - ITEM_RETRO_MAIL, -}; - extern struct Unk2000000 unk_2000000; extern struct MailGraphics gMailGraphicsTable[]; extern u16 gUnknown_083E562C[][2]; diff --git a/src/pokemon_1.c b/src/pokemon_1.c index d6f475171..b8735fbc4 100644 --- a/src/pokemon_1.c +++ b/src/pokemon_1.c @@ -8,6 +8,7 @@ #include "main.h" #include "rng.h" #include "sprite.h" +#include "items.h" //Extracts the upper 16 bits of a 32-bit number #define HIHALF(n) (((n) & 0xFFFF0000) >> 16) @@ -341,7 +342,7 @@ void sub_803AF78(struct Pokemon *mon, struct UnknownPokemonStruct *dest) dest->species = GetMonData(mon, MON_DATA_SPECIES, NULL); heldItem = GetMonData(mon, MON_DATA_HELD_ITEM, NULL); - if (heldItem == 175) + if (heldItem == ITEM_ENIGMA_BERRY) heldItem = 0; dest->heldItem = heldItem; diff --git a/src/pokemon_3.c b/src/pokemon_3.c index fe64a6cf4..cf172b122 100644 --- a/src/pokemon_3.c +++ b/src/pokemon_3.c @@ -10,6 +10,7 @@ #include "event_data.h" #include "rtc.h" #include "item.h" +#include "items.h" #define EVO_FRIENDSHIP 0x0001 // Pokémon levels up with friendship ≥ 220 #define EVO_FRIENDSHIP_DAY 0x0002 // Pokémon levels up during the day with friendship ≥ 220 @@ -100,10 +101,10 @@ u8 GetItemEffectParamOffset(u16 itemId, u8 effectByte, u8 effectBit) temp = gItemEffectTable[itemId - 13]; - if (!temp && itemId != 175) + if (!temp && itemId != ITEM_ENIGMA_BERRY) return 0; - if (itemId == 175) + if (itemId == ITEM_ENIGMA_BERRY) { temp = gEnigmaBerries[gUnknown_02024A60].itemEffect; } @@ -213,7 +214,7 @@ u8 *sub_803F378(u16 itemId) int i; u8 *itemEffect; - if (itemId == 175) + if (itemId == ITEM_ENIGMA_BERRY) { if (gMain.inBattle) { @@ -281,7 +282,7 @@ u16 GetEvolutionTargetSpecies(struct Pokemon *mon, u8 type, u16 evolutionItem) u16 upperPersonality = personality >> 16; u8 holdEffect; - if (heldItem == 175) + if (heldItem == ITEM_ENIGMA_BERRY) holdEffect = gSaveBlock1.enigmaBerry.holdEffect; else holdEffect = ItemId_GetHoldEffect(heldItem); |