Merge pull request #1419 from LOuroboros/mega_bracelet
Added a check for the Mega Bracelet in CanMegaEvolve
This commit is contained in:
commit
df900ca310
1 changed files with 7 additions and 0 deletions
|
@ -8038,6 +8038,13 @@ bool32 CanMegaEvolve(u8 battlerId)
|
||||||
u8 partnerPosition = GetBattlerPosition(BATTLE_PARTNER(battlerId));
|
u8 partnerPosition = GetBattlerPosition(BATTLE_PARTNER(battlerId));
|
||||||
struct MegaEvolutionData *mega = &(((struct ChooseMoveStruct*)(&gBattleResources->bufferA[gActiveBattler][4]))->mega);
|
struct MegaEvolutionData *mega = &(((struct ChooseMoveStruct*)(&gBattleResources->bufferA[gActiveBattler][4]))->mega);
|
||||||
|
|
||||||
|
#ifdef ITEM_EXPANSION
|
||||||
|
// Check if Player has a Mega Bracelet
|
||||||
|
if ((GetBattlerPosition(battlerId) == B_POSITION_PLAYER_LEFT || (!(gBattleTypeFlags & BATTLE_TYPE_MULTI) && GetBattlerPosition(battlerId) == B_POSITION_PLAYER_RIGHT))
|
||||||
|
&& !CheckBagHasItem(ITEM_MEGA_BRACELET, 1))
|
||||||
|
return FALSE;
|
||||||
|
#endif
|
||||||
|
|
||||||
// Check if trainer already mega evolved a pokemon.
|
// Check if trainer already mega evolved a pokemon.
|
||||||
if (mega->alreadyEvolved[battlerPosition])
|
if (mega->alreadyEvolved[battlerPosition])
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
Loading…
Reference in a new issue