battle 4 up to 0xE5
This commit is contained in:
@@ -261,7 +261,7 @@ u8 sub_803FB4C(void) // msg, can't select a move
|
||||
}
|
||||
}
|
||||
|
||||
if (IsImprisoned(gActiveBank, move))
|
||||
if (GetImprisonedMovesCount(gActiveBank, move))
|
||||
{
|
||||
gCurrentMove = move;
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_PALACE)
|
||||
@@ -314,13 +314,6 @@ u8 sub_803FB4C(void) // msg, can't select a move
|
||||
return limitations;
|
||||
}
|
||||
|
||||
#define MOVE_LIMITATION_ZEROMOVE (1 << 0)
|
||||
#define MOVE_LIMITATION_PP (1 << 1)
|
||||
#define MOVE_LIMITATION_DISABLED (1 << 2)
|
||||
#define MOVE_LIMITATION_TORMENTED (1 << 3)
|
||||
#define MOVE_LIMITATION_TAUNT (1 << 4)
|
||||
#define MOVE_LIMITATION_IMPRISION (1 << 5)
|
||||
|
||||
u8 CheckMoveLimitations(u8 bank, u8 unusableMoves, u8 check)
|
||||
{
|
||||
u8 holdEffect;
|
||||
@@ -346,7 +339,7 @@ u8 CheckMoveLimitations(u8 bank, u8 unusableMoves, u8 check)
|
||||
unusableMoves |= gBitTable[i];
|
||||
if (gDisableStructs[bank].tauntTimer1 && check & MOVE_LIMITATION_TAUNT && gBattleMoves[gBattleMons[bank].moves[i]].power == 0)
|
||||
unusableMoves |= gBitTable[i];
|
||||
if (IsImprisoned(bank, gBattleMons[bank].moves[i]) && check & MOVE_LIMITATION_IMPRISION)
|
||||
if (GetImprisonedMovesCount(bank, gBattleMons[bank].moves[i]) && check & MOVE_LIMITATION_IMPRISION)
|
||||
unusableMoves |= gBitTable[i];
|
||||
if (gDisableStructs[bank].encoreTimer1 && gDisableStructs[bank].encoredMove != gBattleMons[bank].moves[i])
|
||||
unusableMoves |= gBitTable[i];
|
||||
@@ -374,7 +367,7 @@ bool8 AreAllMovesUnusable(void)
|
||||
return (unusable == 0xF);
|
||||
}
|
||||
|
||||
u8 IsImprisoned(u8 bank, u16 move)
|
||||
u8 GetImprisonedMovesCount(u8 bank, u16 move)
|
||||
{
|
||||
s32 i;
|
||||
u8 imprisionedMoves = 0;
|
||||
@@ -382,7 +375,7 @@ u8 IsImprisoned(u8 bank, u16 move)
|
||||
|
||||
for (i = 0; i < gNoOfAllBanks; i++)
|
||||
{
|
||||
if (bankSide != GetBankSide(i) && gStatuses3[i] & STATUS3_IMPRISIONED)
|
||||
if (bankSide != GetBankSide(i) && gStatuses3[i] & STATUS3_IMPRISONED_OTHERS)
|
||||
{
|
||||
s32 j;
|
||||
for (j = 0; j < 4; j++)
|
||||
@@ -1327,7 +1320,7 @@ u8 AtkCanceller_UnableToUseMove(void)
|
||||
gBattleStruct->atkCancellerTracker++;
|
||||
break;
|
||||
case 8: // imprisoned
|
||||
if (IsImprisoned(gBankAttacker, gCurrentMove))
|
||||
if (GetImprisonedMovesCount(gBankAttacker, gCurrentMove))
|
||||
{
|
||||
gProtectStructs[gBankAttacker].usedImprisionedMove = 1;
|
||||
CancelMultiTurnMoves(gBankAttacker);
|
||||
@@ -2379,7 +2372,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 bank, u8 ability, u8 special, u16 moveArg)
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ABILITYEFFECT_COUNT_OTHER_SIZE: // 16
|
||||
case ABILITYEFFECT_COUNT_OTHER_SIDE: // 16
|
||||
side = GetBankSide(bank);
|
||||
for (i = 0; i < gNoOfAllBanks; i++)
|
||||
{
|
||||
@@ -6238,7 +6231,7 @@ u8 GetMoveTarget(u16 move, u8 useMoveTarget)
|
||||
targetBank = Random() % gNoOfAllBanks;
|
||||
} while (targetBank == gBankAttacker || side == GetBankSide(targetBank) || gAbsentBankFlags & gBitTable[targetBank]);
|
||||
if (gBattleMoves[move].type == TYPE_ELECTRIC
|
||||
&& AbilityBattleEffects(ABILITYEFFECT_COUNT_OTHER_SIZE, gBankAttacker, ABILITY_LIGHTNING_ROD, 0, 0)
|
||||
&& AbilityBattleEffects(ABILITYEFFECT_COUNT_OTHER_SIDE, gBankAttacker, ABILITY_LIGHTNING_ROD, 0, 0)
|
||||
&& gBattleMons[targetBank].ability != ABILITY_LIGHTNING_ROD)
|
||||
{
|
||||
targetBank ^= 2;
|
||||
|
||||
1756
src/battle_4.c
1756
src/battle_4.c
File diff suppressed because it is too large
Load Diff
@@ -1361,20 +1361,20 @@ void BoxMonRestorePP(struct BoxPokemon *boxMon)
|
||||
void sub_806E994(void)
|
||||
{
|
||||
gLastUsedAbility = gBattleStruct->field_B0;
|
||||
gBattleTextBuff1[0] = 0xFD;
|
||||
gBattleTextBuff1[1] = 4;
|
||||
|
||||
gBattleTextBuff1[0] = B_BUFF_PLACEHOLDER_BEGIN;
|
||||
gBattleTextBuff1[1] = B_BUFF_MON_NICK_WITH_PREFIX;
|
||||
gBattleTextBuff1[2] = gBattleStruct->field_49;
|
||||
gBattleTextBuff1[4] = EOS;
|
||||
gBattleTextBuff1[4] = B_BUFF_EOS;
|
||||
|
||||
if (!GetBankSide(gBattleStruct->field_49))
|
||||
gBattleTextBuff1[3] = pokemon_order_func(gBattlePartyID[gBattleStruct->field_49]);
|
||||
else
|
||||
gBattleTextBuff1[3] = gBattlePartyID[gBattleStruct->field_49];
|
||||
gBattleTextBuff2[0] = 0xFD;
|
||||
gBattleTextBuff2[1] = 4;
|
||||
gBattleTextBuff2[2] = gBankInMenu;
|
||||
gBattleTextBuff2[3] = pokemon_order_func(gBattlePartyID[gBankInMenu]);
|
||||
gBattleTextBuff2[4] = EOS;
|
||||
BattleStringExpandPlaceholders(gText_PkmnsXPreventsSwitching, gStringVar4);
|
||||
|
||||
PREPARE_MON_NICK_WITH_PREFIX_BUFFER(gBattleTextBuff2, gBankInMenu, pokemon_order_func(gBattlePartyID[gBankInMenu]))
|
||||
|
||||
BattleStringExpandPlaceholders(gText_PkmnsXPreventsSwitching, gStringVar4);
|
||||
}
|
||||
|
||||
struct PokeItem
|
||||
@@ -1388,7 +1388,7 @@ extern const struct PokeItem gAlteringCaveWildMonHeldItems[9];
|
||||
static s32 GetWildMonTableIdInAlteringCave(u16 species)
|
||||
{
|
||||
s32 i;
|
||||
for (i = 0; i < 9; i++)
|
||||
for (i = 0; i < (s32) ARRAY_COUNT(gAlteringCaveWildMonHeldItems); i++)
|
||||
if (gAlteringCaveWildMonHeldItems[i].species == species)
|
||||
return i;
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user