Removed ITEM_HAS_EFFECT (#2840)
This commit is contained in:
parent
023cc4d38d
commit
2658fe32c2
6 changed files with 123 additions and 124 deletions
|
@ -1001,7 +1001,4 @@
|
|||
#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) <= LAST_BERRY_INDEX)
|
||||
|
||||
#endif // GUARD_CONSTANTS_ITEMS_H
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
#define GUARD_POKEMON_H
|
||||
|
||||
#include "sprite.h"
|
||||
#include "constants/items.h"
|
||||
#include "constants/region_map_sections.h"
|
||||
#include "constants/map_groups.h"
|
||||
|
||||
|
@ -401,7 +402,7 @@ extern const struct BattleMove gBattleMoves[];
|
|||
extern const u8 gFacilityClassToPicIndex[];
|
||||
extern const u8 gFacilityClassToTrainerClass[];
|
||||
extern const struct SpeciesInfo gSpeciesInfo[];
|
||||
extern const u8 *const gItemEffectTable[];
|
||||
extern const u8 *const gItemEffectTable[ITEMS_COUNT];
|
||||
extern const u32 gExperienceTables[][MAX_LEVEL + 1];
|
||||
extern const struct LevelUpMove *const gLevelUpLearnsets[];
|
||||
extern const u16 *const gTeachableLearnsets[];
|
||||
|
|
|
@ -1085,13 +1085,13 @@ static bool8 ShouldUseItem(void)
|
|||
item = gBattleResources->battleHistory->trainerItems[i];
|
||||
if (item == ITEM_NONE)
|
||||
continue;
|
||||
if (gItemEffectTable[item - ITEM_POTION] == NULL)
|
||||
if (gItemEffectTable[item] == NULL)
|
||||
continue;
|
||||
|
||||
if (item == ITEM_ENIGMA_BERRY_E_READER)
|
||||
itemEffects = gSaveBlock1Ptr->enigmaBerry.itemEffect;
|
||||
else
|
||||
itemEffects = gItemEffectTable[item - ITEM_POTION];
|
||||
itemEffects = gItemEffectTable[item];
|
||||
|
||||
*(gBattleStruct->AI_itemType + gActiveBattler / 2) = GetAI_ItemType(item, itemEffects);
|
||||
|
||||
|
|
|
@ -447,128 +447,128 @@ const u8 gItemEffect_TamatoBerry[10] = {
|
|||
EV_BERRY_FRIENDSHIP_CHANGE,
|
||||
};
|
||||
|
||||
const u8 *const gItemEffectTable[] =
|
||||
const u8 *const gItemEffectTable[ITEMS_COUNT] =
|
||||
{
|
||||
// Medicine
|
||||
[ITEM_POTION - ITEM_POTION] = gItemEffect_Potion,
|
||||
[ITEM_SUPER_POTION - ITEM_POTION] = gItemEffect_SuperPotion,
|
||||
[ITEM_HYPER_POTION - ITEM_POTION] = gItemEffect_HyperPotion,
|
||||
[ITEM_MAX_POTION - ITEM_POTION] = gItemEffect_MaxPotion,
|
||||
[ITEM_FULL_RESTORE - ITEM_POTION] = gItemEffect_FullRestore,
|
||||
[ITEM_REVIVE - ITEM_POTION] = gItemEffect_Revive,
|
||||
[ITEM_MAX_REVIVE - ITEM_POTION] = gItemEffect_MaxRevive,
|
||||
[ITEM_FRESH_WATER - ITEM_POTION] = gItemEffect_FreshWater,
|
||||
[ITEM_SODA_POP - ITEM_POTION] = gItemEffect_SodaPop,
|
||||
[ITEM_LEMONADE - ITEM_POTION] = gItemEffect_Lemonade,
|
||||
[ITEM_MOOMOO_MILK - ITEM_POTION] = gItemEffect_MoomooMilk,
|
||||
[ITEM_ENERGY_POWDER - ITEM_POTION] = gItemEffect_EnergyPowder,
|
||||
[ITEM_ENERGY_ROOT - ITEM_POTION] = gItemEffect_EnergyRoot,
|
||||
[ITEM_HEAL_POWDER - ITEM_POTION] = gItemEffect_HealPowder,
|
||||
[ITEM_REVIVAL_HERB - ITEM_POTION] = gItemEffect_RevivalHerb,
|
||||
[ITEM_ANTIDOTE - ITEM_POTION] = gItemEffect_Antidote,
|
||||
[ITEM_PARALYZE_HEAL - ITEM_POTION] = gItemEffect_ParalyzeHeal,
|
||||
[ITEM_BURN_HEAL - ITEM_POTION] = gItemEffect_BurnHeal,
|
||||
[ITEM_ICE_HEAL - ITEM_POTION] = gItemEffect_IceHeal,
|
||||
[ITEM_AWAKENING - ITEM_POTION] = gItemEffect_Awakening,
|
||||
[ITEM_FULL_HEAL - ITEM_POTION] = gItemEffect_FullHeal,
|
||||
[ITEM_ETHER - ITEM_POTION] = gItemEffect_Ether,
|
||||
[ITEM_MAX_ETHER - ITEM_POTION] = gItemEffect_MaxEther,
|
||||
[ITEM_ELIXIR - ITEM_POTION] = gItemEffect_Elixir,
|
||||
[ITEM_MAX_ELIXIR - ITEM_POTION] = gItemEffect_MaxElixir,
|
||||
[ITEM_BERRY_JUICE - ITEM_POTION] = gItemEffect_BerryJuice,
|
||||
[ITEM_SACRED_ASH - ITEM_POTION] = gItemEffect_SacredAsh,
|
||||
[ITEM_SWEET_HEART - ITEM_POTION] = gItemEffect_Potion,
|
||||
[ITEM_MAX_HONEY - ITEM_POTION] = gItemEffect_MaxRevive,
|
||||
[ITEM_POTION] = gItemEffect_Potion,
|
||||
[ITEM_SUPER_POTION] = gItemEffect_SuperPotion,
|
||||
[ITEM_HYPER_POTION] = gItemEffect_HyperPotion,
|
||||
[ITEM_MAX_POTION] = gItemEffect_MaxPotion,
|
||||
[ITEM_FULL_RESTORE] = gItemEffect_FullRestore,
|
||||
[ITEM_REVIVE] = gItemEffect_Revive,
|
||||
[ITEM_MAX_REVIVE] = gItemEffect_MaxRevive,
|
||||
[ITEM_FRESH_WATER] = gItemEffect_FreshWater,
|
||||
[ITEM_SODA_POP] = gItemEffect_SodaPop,
|
||||
[ITEM_LEMONADE] = gItemEffect_Lemonade,
|
||||
[ITEM_MOOMOO_MILK] = gItemEffect_MoomooMilk,
|
||||
[ITEM_ENERGY_POWDER] = gItemEffect_EnergyPowder,
|
||||
[ITEM_ENERGY_ROOT] = gItemEffect_EnergyRoot,
|
||||
[ITEM_HEAL_POWDER] = gItemEffect_HealPowder,
|
||||
[ITEM_REVIVAL_HERB] = gItemEffect_RevivalHerb,
|
||||
[ITEM_ANTIDOTE] = gItemEffect_Antidote,
|
||||
[ITEM_PARALYZE_HEAL] = gItemEffect_ParalyzeHeal,
|
||||
[ITEM_BURN_HEAL] = gItemEffect_BurnHeal,
|
||||
[ITEM_ICE_HEAL] = gItemEffect_IceHeal,
|
||||
[ITEM_AWAKENING] = gItemEffect_Awakening,
|
||||
[ITEM_FULL_HEAL] = gItemEffect_FullHeal,
|
||||
[ITEM_ETHER] = gItemEffect_Ether,
|
||||
[ITEM_MAX_ETHER] = gItemEffect_MaxEther,
|
||||
[ITEM_ELIXIR] = gItemEffect_Elixir,
|
||||
[ITEM_MAX_ELIXIR] = gItemEffect_MaxElixir,
|
||||
[ITEM_BERRY_JUICE] = gItemEffect_BerryJuice,
|
||||
[ITEM_SACRED_ASH] = gItemEffect_SacredAsh,
|
||||
[ITEM_SWEET_HEART] = gItemEffect_Potion,
|
||||
[ITEM_MAX_HONEY] = gItemEffect_MaxRevive,
|
||||
|
||||
// Regional Specialties
|
||||
[ITEM_PEWTER_CRUNCHIES - ITEM_POTION] = gItemEffect_FullHeal,
|
||||
[ITEM_RAGE_CANDY_BAR - ITEM_POTION] = gItemEffect_FullHeal,
|
||||
[ITEM_LAVA_COOKIE - ITEM_POTION] = gItemEffect_FullHeal,
|
||||
[ITEM_OLD_GATEAU - ITEM_POTION] = gItemEffect_FullHeal,
|
||||
[ITEM_CASTELIACONE - ITEM_POTION] = gItemEffect_FullHeal,
|
||||
[ITEM_LUMIOSE_GALETTE - ITEM_POTION] = gItemEffect_FullHeal,
|
||||
[ITEM_SHALOUR_SABLE - ITEM_POTION] = gItemEffect_FullHeal,
|
||||
[ITEM_BIG_MALASADA - ITEM_POTION] = gItemEffect_FullHeal,
|
||||
[ITEM_PEWTER_CRUNCHIES] = gItemEffect_FullHeal,
|
||||
[ITEM_RAGE_CANDY_BAR] = gItemEffect_FullHeal,
|
||||
[ITEM_LAVA_COOKIE] = gItemEffect_FullHeal,
|
||||
[ITEM_OLD_GATEAU] = gItemEffect_FullHeal,
|
||||
[ITEM_CASTELIACONE] = gItemEffect_FullHeal,
|
||||
[ITEM_LUMIOSE_GALETTE] = gItemEffect_FullHeal,
|
||||
[ITEM_SHALOUR_SABLE] = gItemEffect_FullHeal,
|
||||
[ITEM_BIG_MALASADA] = gItemEffect_FullHeal,
|
||||
|
||||
// Vitamins
|
||||
[ITEM_HP_UP - ITEM_POTION] = gItemEffect_HPUp,
|
||||
[ITEM_PROTEIN - ITEM_POTION] = gItemEffect_Protein,
|
||||
[ITEM_IRON - ITEM_POTION] = gItemEffect_Iron,
|
||||
[ITEM_CALCIUM - ITEM_POTION] = gItemEffect_Calcium,
|
||||
[ITEM_ZINC - ITEM_POTION] = gItemEffect_Zinc,
|
||||
[ITEM_CARBOS - ITEM_POTION] = gItemEffect_Carbos,
|
||||
[ITEM_PP_UP - ITEM_POTION] = gItemEffect_PPUp,
|
||||
[ITEM_PP_MAX - ITEM_POTION] = gItemEffect_PPMax,
|
||||
[ITEM_HP_UP] = gItemEffect_HPUp,
|
||||
[ITEM_PROTEIN] = gItemEffect_Protein,
|
||||
[ITEM_IRON] = gItemEffect_Iron,
|
||||
[ITEM_CALCIUM] = gItemEffect_Calcium,
|
||||
[ITEM_ZINC] = gItemEffect_Zinc,
|
||||
[ITEM_CARBOS] = gItemEffect_Carbos,
|
||||
[ITEM_PP_UP] = gItemEffect_PPUp,
|
||||
[ITEM_PP_MAX] = gItemEffect_PPMax,
|
||||
|
||||
// EV Feathers
|
||||
[ITEM_HEALTH_FEATHER - ITEM_POTION] = gItemEffect_HpFeather,
|
||||
[ITEM_MUSCLE_FEATHER - ITEM_POTION] = gItemEffect_AtkFeather,
|
||||
[ITEM_RESIST_FEATHER - ITEM_POTION] = gItemEffect_DefFeather,
|
||||
[ITEM_GENIUS_FEATHER - ITEM_POTION] = gItemEffect_SpatkFeather,
|
||||
[ITEM_CLEVER_FEATHER - ITEM_POTION] = gItemEffect_SpdefFeather,
|
||||
[ITEM_SWIFT_FEATHER - ITEM_POTION] = gItemEffect_SpeedFeather,
|
||||
[ITEM_HEALTH_FEATHER] = gItemEffect_HpFeather,
|
||||
[ITEM_MUSCLE_FEATHER] = gItemEffect_AtkFeather,
|
||||
[ITEM_RESIST_FEATHER] = gItemEffect_DefFeather,
|
||||
[ITEM_GENIUS_FEATHER] = gItemEffect_SpatkFeather,
|
||||
[ITEM_CLEVER_FEATHER] = gItemEffect_SpdefFeather,
|
||||
[ITEM_SWIFT_FEATHER] = gItemEffect_SpeedFeather,
|
||||
|
||||
// Candy
|
||||
[ITEM_RARE_CANDY - ITEM_POTION] = gItemEffect_RareCandy,
|
||||
[ITEM_EXP_CANDY_XS - ITEM_POTION] = gItemEffect_RareCandy,
|
||||
[ITEM_EXP_CANDY_S - ITEM_POTION] = gItemEffect_RareCandy,
|
||||
[ITEM_EXP_CANDY_M - ITEM_POTION] = gItemEffect_RareCandy,
|
||||
[ITEM_EXP_CANDY_L - ITEM_POTION] = gItemEffect_RareCandy,
|
||||
[ITEM_EXP_CANDY_XL - ITEM_POTION] = gItemEffect_RareCandy,
|
||||
//[ITEM_DYNAMAX_CANDY - ITEM_POTION] = gItemEffect_DynamaxCandy, // Todo
|
||||
[ITEM_RARE_CANDY] = gItemEffect_RareCandy,
|
||||
[ITEM_EXP_CANDY_XS] = gItemEffect_RareCandy,
|
||||
[ITEM_EXP_CANDY_S] = gItemEffect_RareCandy,
|
||||
[ITEM_EXP_CANDY_M] = gItemEffect_RareCandy,
|
||||
[ITEM_EXP_CANDY_L] = gItemEffect_RareCandy,
|
||||
[ITEM_EXP_CANDY_XL] = gItemEffect_RareCandy,
|
||||
//[ITEM_DYNAMAX_CANDY] = gItemEffect_DynamaxCandy, // Todo
|
||||
|
||||
// Medicinal Flutes
|
||||
[ITEM_BLUE_FLUTE - ITEM_POTION] = gItemEffect_BlueFlute,
|
||||
[ITEM_YELLOW_FLUTE - ITEM_POTION] = gItemEffect_YellowFlute,
|
||||
[ITEM_RED_FLUTE - ITEM_POTION] = gItemEffect_RedFlute,
|
||||
[ITEM_BLUE_FLUTE] = gItemEffect_BlueFlute,
|
||||
[ITEM_YELLOW_FLUTE] = gItemEffect_YellowFlute,
|
||||
[ITEM_RED_FLUTE] = gItemEffect_RedFlute,
|
||||
|
||||
// X Items
|
||||
[ITEM_X_ATTACK - ITEM_POTION] = gItemEffect_XAttack,
|
||||
[ITEM_X_DEFENSE - ITEM_POTION] = gItemEffect_XDefense,
|
||||
[ITEM_X_SPEED - ITEM_POTION] = gItemEffect_XSpeed,
|
||||
[ITEM_X_ACCURACY - ITEM_POTION] = gItemEffect_XAccuracy,
|
||||
[ITEM_X_SP_ATK - ITEM_POTION] = gItemEffect_XSpecialAttack,
|
||||
[ITEM_X_SP_DEF - ITEM_POTION] = gItemEffect_XSpecialDefense,
|
||||
[ITEM_X_ATTACK] = gItemEffect_XAttack,
|
||||
[ITEM_X_DEFENSE] = gItemEffect_XDefense,
|
||||
[ITEM_X_SPEED] = gItemEffect_XSpeed,
|
||||
[ITEM_X_ACCURACY] = gItemEffect_XAccuracy,
|
||||
[ITEM_X_SP_ATK] = gItemEffect_XSpecialAttack,
|
||||
[ITEM_X_SP_DEF] = gItemEffect_XSpecialDefense,
|
||||
|
||||
[ITEM_DIRE_HIT - ITEM_POTION] = gItemEffect_DireHit,
|
||||
[ITEM_GUARD_SPEC - ITEM_POTION] = gItemEffect_GuardSpec,
|
||||
[ITEM_DIRE_HIT] = gItemEffect_DireHit,
|
||||
[ITEM_GUARD_SPEC] = gItemEffect_GuardSpec,
|
||||
|
||||
//[ITEM_MAX_MUSHROOMS - ITEM_POTION] = gItemEffect_MaxMushrooms, // Todo
|
||||
//[ITEM_MAX_MUSHROOMS] = gItemEffect_MaxMushrooms, // Todo
|
||||
|
||||
// Evolution Items
|
||||
[ITEM_FIRE_STONE - ITEM_POTION] = gItemEffect_EvoItem,
|
||||
[ITEM_WATER_STONE - ITEM_POTION] = gItemEffect_EvoItem,
|
||||
[ITEM_THUNDER_STONE - ITEM_POTION] = gItemEffect_EvoItem,
|
||||
[ITEM_LEAF_STONE - ITEM_POTION] = gItemEffect_EvoItem,
|
||||
[ITEM_ICE_STONE - ITEM_POTION] = gItemEffect_EvoItem,
|
||||
[ITEM_SUN_STONE - ITEM_POTION] = gItemEffect_EvoItem,
|
||||
[ITEM_MOON_STONE - ITEM_POTION] = gItemEffect_EvoItem,
|
||||
[ITEM_SHINY_STONE - ITEM_POTION] = gItemEffect_EvoItem,
|
||||
[ITEM_DUSK_STONE - ITEM_POTION] = gItemEffect_EvoItem,
|
||||
[ITEM_DAWN_STONE - ITEM_POTION] = gItemEffect_EvoItem,
|
||||
[ITEM_SWEET_APPLE - ITEM_POTION] = gItemEffect_EvoItem,
|
||||
[ITEM_TART_APPLE - ITEM_POTION] = gItemEffect_EvoItem,
|
||||
[ITEM_CRACKED_POT - ITEM_POTION] = gItemEffect_EvoItem,
|
||||
[ITEM_CHIPPED_POT - ITEM_POTION] = gItemEffect_EvoItem,
|
||||
[ITEM_GALARICA_CUFF - ITEM_POTION] = gItemEffect_EvoItem,
|
||||
[ITEM_GALARICA_WREATH - ITEM_POTION] = gItemEffect_EvoItem,
|
||||
[ITEM_FIRE_STONE] = gItemEffect_EvoItem,
|
||||
[ITEM_WATER_STONE] = gItemEffect_EvoItem,
|
||||
[ITEM_THUNDER_STONE] = gItemEffect_EvoItem,
|
||||
[ITEM_LEAF_STONE] = gItemEffect_EvoItem,
|
||||
[ITEM_ICE_STONE] = gItemEffect_EvoItem,
|
||||
[ITEM_SUN_STONE] = gItemEffect_EvoItem,
|
||||
[ITEM_MOON_STONE] = gItemEffect_EvoItem,
|
||||
[ITEM_SHINY_STONE] = gItemEffect_EvoItem,
|
||||
[ITEM_DUSK_STONE] = gItemEffect_EvoItem,
|
||||
[ITEM_DAWN_STONE] = gItemEffect_EvoItem,
|
||||
[ITEM_SWEET_APPLE] = gItemEffect_EvoItem,
|
||||
[ITEM_TART_APPLE] = gItemEffect_EvoItem,
|
||||
[ITEM_CRACKED_POT] = gItemEffect_EvoItem,
|
||||
[ITEM_CHIPPED_POT] = gItemEffect_EvoItem,
|
||||
[ITEM_GALARICA_CUFF] = gItemEffect_EvoItem,
|
||||
[ITEM_GALARICA_WREATH] = gItemEffect_EvoItem,
|
||||
|
||||
// Berries
|
||||
[ITEM_CHERI_BERRY - ITEM_POTION] = gItemEffect_CheriBerry,
|
||||
[ITEM_CHESTO_BERRY - ITEM_POTION] = gItemEffect_ChestoBerry,
|
||||
[ITEM_PECHA_BERRY - ITEM_POTION] = gItemEffect_PechaBerry,
|
||||
[ITEM_RAWST_BERRY - ITEM_POTION] = gItemEffect_RawstBerry,
|
||||
[ITEM_ASPEAR_BERRY - ITEM_POTION] = gItemEffect_AspearBerry,
|
||||
[ITEM_LEPPA_BERRY - ITEM_POTION] = gItemEffect_LeppaBerry,
|
||||
[ITEM_ORAN_BERRY - ITEM_POTION] = gItemEffect_OranBerry,
|
||||
[ITEM_PERSIM_BERRY - ITEM_POTION] = gItemEffect_PersimBerry,
|
||||
[ITEM_LUM_BERRY - ITEM_POTION] = gItemEffect_FullHeal,
|
||||
[ITEM_SITRUS_BERRY - ITEM_POTION] = gItemEffect_SitrusBerry,
|
||||
[ITEM_POMEG_BERRY - ITEM_POTION] = gItemEffect_PomegBerry,
|
||||
[ITEM_KELPSY_BERRY - ITEM_POTION] = gItemEffect_KelpsyBerry,
|
||||
[ITEM_QUALOT_BERRY - ITEM_POTION] = gItemEffect_QualotBerry,
|
||||
[ITEM_HONDEW_BERRY - ITEM_POTION] = gItemEffect_HondewBerry,
|
||||
[ITEM_GREPA_BERRY - ITEM_POTION] = gItemEffect_GrepaBerry,
|
||||
[ITEM_TAMATO_BERRY - ITEM_POTION] = gItemEffect_TamatoBerry,
|
||||
[LAST_BERRY_INDEX - ITEM_POTION] = NULL,
|
||||
[ITEM_CHERI_BERRY] = gItemEffect_CheriBerry,
|
||||
[ITEM_CHESTO_BERRY] = gItemEffect_ChestoBerry,
|
||||
[ITEM_PECHA_BERRY] = gItemEffect_PechaBerry,
|
||||
[ITEM_RAWST_BERRY] = gItemEffect_RawstBerry,
|
||||
[ITEM_ASPEAR_BERRY] = gItemEffect_AspearBerry,
|
||||
[ITEM_LEPPA_BERRY] = gItemEffect_LeppaBerry,
|
||||
[ITEM_ORAN_BERRY] = gItemEffect_OranBerry,
|
||||
[ITEM_PERSIM_BERRY] = gItemEffect_PersimBerry,
|
||||
[ITEM_LUM_BERRY] = gItemEffect_FullHeal,
|
||||
[ITEM_SITRUS_BERRY] = gItemEffect_SitrusBerry,
|
||||
[ITEM_POMEG_BERRY] = gItemEffect_PomegBerry,
|
||||
[ITEM_KELPSY_BERRY] = gItemEffect_KelpsyBerry,
|
||||
[ITEM_QUALOT_BERRY] = gItemEffect_QualotBerry,
|
||||
[ITEM_HONDEW_BERRY] = gItemEffect_HondewBerry,
|
||||
[ITEM_GREPA_BERRY] = gItemEffect_GrepaBerry,
|
||||
[ITEM_TAMATO_BERRY] = gItemEffect_TamatoBerry,
|
||||
[LAST_BERRY_INDEX] = NULL,
|
||||
};
|
||||
|
|
|
@ -4287,7 +4287,10 @@ static bool8 IsHPRecoveryItem(u16 item)
|
|||
if (item == ITEM_ENIGMA_BERRY_E_READER)
|
||||
effect = gSaveBlock1Ptr->enigmaBerry.itemEffect;
|
||||
else
|
||||
effect = gItemEffectTable[item - ITEM_POTION];
|
||||
effect = gItemEffectTable[item];
|
||||
|
||||
if (effect == NULL)
|
||||
return FALSE;
|
||||
|
||||
if (effect[4] & ITEM4_HEAL_HP)
|
||||
return TRUE;
|
||||
|
@ -4798,9 +4801,9 @@ void ItemUseCB_PPRecovery(u8 taskId, TaskFunc task)
|
|||
if (item == ITEM_ENIGMA_BERRY_E_READER)
|
||||
effect = gSaveBlock1Ptr->enigmaBerry.itemEffect;
|
||||
else
|
||||
effect = gItemEffectTable[item - ITEM_POTION];
|
||||
effect = gItemEffectTable[item];
|
||||
|
||||
if (!(effect[4] & ITEM4_HEAL_PP_ONE))
|
||||
if (effect == NULL || !(effect[4] & ITEM4_HEAL_PP_ONE))
|
||||
{
|
||||
gPartyMenu.data1 = 0;
|
||||
TryUsePPItem(taskId);
|
||||
|
@ -5673,14 +5676,14 @@ u8 GetItemEffectType(u16 item)
|
|||
const u8 *itemEffect;
|
||||
u32 statusCure;
|
||||
|
||||
if (!ITEM_HAS_EFFECT(item))
|
||||
return ITEM_EFFECT_NONE;
|
||||
|
||||
// Read the item's effect properties.
|
||||
if (item == ITEM_ENIGMA_BERRY_E_READER)
|
||||
itemEffect = gSaveBlock1Ptr->enigmaBerry.itemEffect;
|
||||
else
|
||||
itemEffect = gItemEffectTable[item - ITEM_POTION];
|
||||
itemEffect = gItemEffectTable[item];
|
||||
|
||||
if (itemEffect == NULL)
|
||||
return ITEM_EFFECT_NONE;
|
||||
|
||||
if ((itemEffect[0] & ITEM0_DIRE_HIT) || itemEffect[1] || (itemEffect[3] & ITEM3_GUARD_SPEC))
|
||||
return ITEM_EFFECT_X_ITEM;
|
||||
|
|
|
@ -5770,9 +5770,7 @@ bool8 PokemonUseItemEffects(struct Pokemon *mon, u16 item, u8 partyIndex, u8 mov
|
|||
}
|
||||
|
||||
// Skip using the item if it won't do anything
|
||||
if (!ITEM_HAS_EFFECT(item))
|
||||
return TRUE;
|
||||
if (gItemEffectTable[item - ITEM_POTION] == NULL && item != ITEM_ENIGMA_BERRY_E_READER)
|
||||
if (gItemEffectTable[item] == NULL && item != ITEM_ENIGMA_BERRY_E_READER)
|
||||
return TRUE;
|
||||
|
||||
// Get item effect
|
||||
|
@ -5785,7 +5783,7 @@ bool8 PokemonUseItemEffects(struct Pokemon *mon, u16 item, u8 partyIndex, u8 mov
|
|||
}
|
||||
else
|
||||
{
|
||||
itemEffect = gItemEffectTable[item - ITEM_POTION];
|
||||
itemEffect = gItemEffectTable[item];
|
||||
}
|
||||
|
||||
// Do item effect
|
||||
|
@ -6339,9 +6337,9 @@ u8 GetItemEffectParamOffset(u16 itemId, u8 effectByte, u8 effectBit)
|
|||
|
||||
offset = ITEM_EFFECT_ARG_START;
|
||||
|
||||
temp = gItemEffectTable[itemId - ITEM_POTION];
|
||||
temp = gItemEffectTable[itemId];
|
||||
|
||||
if (!temp && itemId != ITEM_ENIGMA_BERRY_E_READER)
|
||||
if (temp != NULL && !temp && itemId != ITEM_ENIGMA_BERRY_E_READER)
|
||||
return 0;
|
||||
|
||||
if (itemId == ITEM_ENIGMA_BERRY_E_READER)
|
||||
|
@ -6469,7 +6467,7 @@ u8 *UseStatIncreaseItem(u16 itemId)
|
|||
}
|
||||
else
|
||||
{
|
||||
itemEffect = gItemEffectTable[itemId - ITEM_POTION];
|
||||
itemEffect = gItemEffectTable[itemId];
|
||||
}
|
||||
|
||||
gPotentialItemEffectBattler = gBattlerInMenuId;
|
||||
|
|
Loading…
Reference in a new issue