Introduce a MOVE_UNAVAILABLE constant
This commit is contained in:
+11
-9
@@ -679,10 +679,12 @@ void HandleAction_ActionFinished(void)
|
||||
gBattleResources->battleScriptsStack->size = 0;
|
||||
}
|
||||
|
||||
#define SOUND_MOVES_END 0xFFFF
|
||||
|
||||
static const u16 sSoundMovesTable[] =
|
||||
{
|
||||
MOVE_GROWL, MOVE_ROAR, MOVE_SING, MOVE_SUPERSONIC, MOVE_SCREECH, MOVE_SNORE,
|
||||
MOVE_UPROAR, MOVE_METAL_SOUND, MOVE_GRASS_WHISTLE, MOVE_HYPER_VOICE, 0xFFFF
|
||||
MOVE_UPROAR, MOVE_METAL_SOUND, MOVE_GRASS_WHISTLE, MOVE_HYPER_VOICE, SOUND_MOVES_END
|
||||
};
|
||||
|
||||
u8 GetBattlerForBattleScript(u8 caseId)
|
||||
@@ -1029,7 +1031,7 @@ u8 TrySetCantSelectMoveBattleScript(void)
|
||||
|
||||
gPotentialItemEffectBattler = gActiveBattler;
|
||||
|
||||
if (holdEffect == HOLD_EFFECT_CHOICE_BAND && *choicedMove != MOVE_NONE && *choicedMove != 0xFFFF && *choicedMove != move)
|
||||
if (holdEffect == HOLD_EFFECT_CHOICE_BAND && *choicedMove != MOVE_NONE && *choicedMove != MOVE_UNAVAILABLE && *choicedMove != move)
|
||||
{
|
||||
gCurrentMove = *choicedMove;
|
||||
gLastUsedItem = gBattleMons[gActiveBattler].item;
|
||||
@@ -1097,7 +1099,7 @@ u8 CheckMoveLimitations(u8 battlerId, u8 unusableMoves, u8 check)
|
||||
if (gDisableStructs[battlerId].encoreTimer && gDisableStructs[battlerId].encoredMove != gBattleMons[battlerId].moves[i])
|
||||
unusableMoves |= gBitTable[i];
|
||||
// Choice Band
|
||||
if (holdEffect == HOLD_EFFECT_CHOICE_BAND && *choicedMove != MOVE_NONE && *choicedMove != 0xFFFF && *choicedMove != gBattleMons[battlerId].moves[i])
|
||||
if (holdEffect == HOLD_EFFECT_CHOICE_BAND && *choicedMove != MOVE_NONE && *choicedMove != MOVE_UNAVAILABLE && *choicedMove != gBattleMons[battlerId].moves[i])
|
||||
unusableMoves |= gBitTable[i];
|
||||
}
|
||||
return unusableMoves;
|
||||
@@ -2640,12 +2642,12 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u8 ability, u8 special, u16 moveA
|
||||
case ABILITYEFFECT_MOVES_BLOCK: // 2
|
||||
if (gLastUsedAbility == ABILITY_SOUNDPROOF)
|
||||
{
|
||||
for (i = 0; sSoundMovesTable[i] != 0xFFFF; i++)
|
||||
for (i = 0; sSoundMovesTable[i] != SOUND_MOVES_END; i++)
|
||||
{
|
||||
if (sSoundMovesTable[i] == move)
|
||||
break;
|
||||
}
|
||||
if (sSoundMovesTable[i] != 0xFFFF)
|
||||
if (sSoundMovesTable[i] != SOUND_MOVES_END)
|
||||
{
|
||||
if (gBattleMons[gBattlerAttacker].status2 & STATUS2_MULTIPLETURNS)
|
||||
gHitMarker |= HITMARKER_NO_PPDEDUCT;
|
||||
@@ -3005,22 +3007,22 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u8 ability, u8 special, u16 moveA
|
||||
target2 = GetBattlerAtPosition(side + BIT_FLANK);
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE)
|
||||
{
|
||||
if (gBattleMons[target1].ability != 0 && gBattleMons[target1].hp != 0
|
||||
&& gBattleMons[target2].ability != 0 && gBattleMons[target2].hp != 0)
|
||||
if (gBattleMons[target1].ability != ABILITY_NONE && gBattleMons[target1].hp != 0
|
||||
&& gBattleMons[target2].ability != ABILITY_NONE && gBattleMons[target2].hp != 0)
|
||||
{
|
||||
gActiveBattler = GetBattlerAtPosition(((Random() & 1) * 2) | side);
|
||||
gBattleMons[i].ability = gBattleMons[gActiveBattler].ability;
|
||||
gLastUsedAbility = gBattleMons[gActiveBattler].ability;
|
||||
effect++;
|
||||
}
|
||||
else if (gBattleMons[target1].ability != 0 && gBattleMons[target1].hp != 0)
|
||||
else if (gBattleMons[target1].ability != ABILITY_NONE && gBattleMons[target1].hp != 0)
|
||||
{
|
||||
gActiveBattler = target1;
|
||||
gBattleMons[i].ability = gBattleMons[gActiveBattler].ability;
|
||||
gLastUsedAbility = gBattleMons[gActiveBattler].ability;
|
||||
effect++;
|
||||
}
|
||||
else if (gBattleMons[target2].ability != 0 && gBattleMons[target2].hp != 0)
|
||||
else if (gBattleMons[target2].ability != ABILITY_NONE && gBattleMons[target2].hp != 0)
|
||||
{
|
||||
gActiveBattler = target2;
|
||||
gBattleMons[i].ability = gBattleMons[gActiveBattler].ability;
|
||||
|
||||
Reference in New Issue
Block a user