Introduce a MOVE_UNAVAILABLE constant
This commit is contained in:
@@ -2355,7 +2355,7 @@ void SetMoveEffect(bool8 primary, u8 certain)
|
||||
break;
|
||||
if (gBattleMons[gEffectBattler].status1)
|
||||
break;
|
||||
if (noSunCanFreeze == 0)
|
||||
if (noSunCanFreeze == FALSE)
|
||||
break;
|
||||
if (gBattleMons[gEffectBattler].ability == ABILITY_MAGMA_ARMOR)
|
||||
break;
|
||||
@@ -2553,9 +2553,9 @@ void SetMoveEffect(bool8 primary, u8 certain)
|
||||
case MOVE_EFFECT_PAYDAY:
|
||||
if (GET_BATTLER_SIDE(gBattlerAttacker) == B_SIDE_PLAYER)
|
||||
{
|
||||
u16 PayDay = gPaydayMoney;
|
||||
u16 payDay = gPaydayMoney;
|
||||
gPaydayMoney += (gBattleMons[gBattlerAttacker].level * 5);
|
||||
if (PayDay > gPaydayMoney)
|
||||
if (payDay > gPaydayMoney)
|
||||
gPaydayMoney = 0xFFFF;
|
||||
}
|
||||
BattleScriptPush(gBattlescriptCurrInstr + 1);
|
||||
@@ -2743,10 +2743,10 @@ void SetMoveEffect(bool8 primary, u8 certain)
|
||||
gLastUsedAbility = gBattleMons[gBattlerTarget].ability;
|
||||
RecordAbilityBattle(gBattlerTarget, gLastUsedAbility);
|
||||
}
|
||||
else if (gBattleMons[gBattlerAttacker].item != 0
|
||||
else if (gBattleMons[gBattlerAttacker].item != ITEM_NONE
|
||||
|| gBattleMons[gBattlerTarget].item == ITEM_ENIGMA_BERRY
|
||||
|| IS_ITEM_MAIL(gBattleMons[gBattlerTarget].item)
|
||||
|| gBattleMons[gBattlerTarget].item == 0)
|
||||
|| gBattleMons[gBattlerTarget].item == ITEM_NONE)
|
||||
{
|
||||
gBattlescriptCurrInstr++;
|
||||
}
|
||||
@@ -4184,8 +4184,8 @@ static void Cmd_moveend(void)
|
||||
u8 endMode, endState;
|
||||
u16 originallyUsedMove;
|
||||
|
||||
if (gChosenMove == 0xFFFF)
|
||||
originallyUsedMove = 0;
|
||||
if (gChosenMove == MOVE_UNAVAILABLE)
|
||||
originallyUsedMove = MOVE_NONE;
|
||||
else
|
||||
originallyUsedMove = gChosenMove;
|
||||
|
||||
@@ -4206,10 +4206,13 @@ static void Cmd_moveend(void)
|
||||
{
|
||||
case MOVEEND_RAGE: // rage check
|
||||
if (gBattleMons[gBattlerTarget].status2 & STATUS2_RAGE
|
||||
&& gBattleMons[gBattlerTarget].hp != 0 && gBattlerAttacker != gBattlerTarget
|
||||
&& gBattleMons[gBattlerTarget].hp != 0
|
||||
&& gBattlerAttacker != gBattlerTarget
|
||||
&& GetBattlerSide(gBattlerAttacker) != GetBattlerSide(gBattlerTarget)
|
||||
&& !(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) && TARGET_TURN_DAMAGED
|
||||
&& gBattleMoves[gCurrentMove].power && gBattleMons[gBattlerTarget].statStages[STAT_ATK] < MAX_STAT_STAGE)
|
||||
&& !(gMoveResultFlags & MOVE_RESULT_NO_EFFECT)
|
||||
&& TARGET_TURN_DAMAGED
|
||||
&& gBattleMoves[gCurrentMove].power != 0
|
||||
&& gBattleMons[gBattlerTarget].statStages[STAT_ATK] < MAX_STAT_STAGE)
|
||||
{
|
||||
gBattleMons[gBattlerTarget].statStages[STAT_ATK]++;
|
||||
BattleScriptPushCursor();
|
||||
@@ -4220,9 +4223,11 @@ static void Cmd_moveend(void)
|
||||
break;
|
||||
case MOVEEND_DEFROST: // defrosting check
|
||||
if (gBattleMons[gBattlerTarget].status1 & STATUS1_FREEZE
|
||||
&& gBattleMons[gBattlerTarget].hp != 0 && gBattlerAttacker != gBattlerTarget
|
||||
&& gBattleMons[gBattlerTarget].hp != 0
|
||||
&& gBattlerAttacker != gBattlerTarget
|
||||
&& gSpecialStatuses[gBattlerTarget].specialDmg
|
||||
&& !(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) && moveType == TYPE_FIRE)
|
||||
&& !(gMoveResultFlags & MOVE_RESULT_NO_EFFECT)
|
||||
&& moveType == TYPE_FIRE)
|
||||
{
|
||||
gBattleMons[gBattlerTarget].status1 &= ~STATUS1_FREEZE;
|
||||
gActiveBattler = gBattlerTarget;
|
||||
@@ -4259,7 +4264,7 @@ static void Cmd_moveend(void)
|
||||
if (gHitMarker & HITMARKER_OBEYS
|
||||
&& holdEffectAtk == HOLD_EFFECT_CHOICE_BAND
|
||||
&& gChosenMove != MOVE_STRUGGLE
|
||||
&& (*choicedMoveAtk == 0 || *choicedMoveAtk == 0xFFFF))
|
||||
&& (*choicedMoveAtk == MOVE_NONE || *choicedMoveAtk == MOVE_UNAVAILABLE))
|
||||
{
|
||||
if (gChosenMove == MOVE_BATON_PASS && !(gMoveResultFlags & MOVE_RESULT_FAILED))
|
||||
{
|
||||
@@ -4274,17 +4279,17 @@ static void Cmd_moveend(void)
|
||||
break;
|
||||
}
|
||||
if (i == MAX_MON_MOVES)
|
||||
*choicedMoveAtk = 0;
|
||||
*choicedMoveAtk = MOVE_NONE;
|
||||
++gBattleScripting.moveendState;
|
||||
break;
|
||||
case MOVEEND_CHANGED_ITEMS: // changed held items
|
||||
for (i = 0; i < gBattlersCount; i++)
|
||||
{
|
||||
u16* changedItem = &gBattleStruct->changedItems[i];
|
||||
if (*changedItem != 0)
|
||||
if (*changedItem != ITEM_NONE)
|
||||
{
|
||||
gBattleMons[i].item = *changedItem;
|
||||
*changedItem = 0;
|
||||
*changedItem = ITEM_NONE;
|
||||
}
|
||||
}
|
||||
gBattleScripting.moveendState++;
|
||||
@@ -4371,8 +4376,8 @@ static void Cmd_moveend(void)
|
||||
}
|
||||
else
|
||||
{
|
||||
gLastMoves[gBattlerAttacker] = 0xFFFF;
|
||||
gLastResultingMoves[gBattlerAttacker] = 0xFFFF;
|
||||
gLastMoves[gBattlerAttacker] = MOVE_UNAVAILABLE;
|
||||
gLastResultingMoves[gBattlerAttacker] = MOVE_UNAVAILABLE;
|
||||
}
|
||||
|
||||
if (!(gHitMarker & HITMARKER_FAINTED(gBattlerTarget)))
|
||||
@@ -4380,7 +4385,7 @@ static void Cmd_moveend(void)
|
||||
|
||||
if (gHitMarker & HITMARKER_OBEYS && !(gMoveResultFlags & MOVE_RESULT_NO_EFFECT))
|
||||
{
|
||||
if (gChosenMove == 0xFFFF)
|
||||
if (gChosenMove == MOVE_UNAVAILABLE)
|
||||
{
|
||||
gLastLandedMoves[gBattlerTarget] = gChosenMove;
|
||||
}
|
||||
@@ -4392,15 +4397,18 @@ static void Cmd_moveend(void)
|
||||
}
|
||||
else
|
||||
{
|
||||
gLastLandedMoves[gBattlerTarget] = 0xFFFF;
|
||||
gLastLandedMoves[gBattlerTarget] = MOVE_UNAVAILABLE;
|
||||
}
|
||||
}
|
||||
gBattleScripting.moveendState++;
|
||||
break;
|
||||
case MOVEEND_MIRROR_MOVE: // mirror move
|
||||
if (!(gAbsentBattlerFlags & gBitTable[gBattlerAttacker]) && !(gBattleStruct->absentBattlerFlags & gBitTable[gBattlerAttacker])
|
||||
&& gBattleMoves[originallyUsedMove].flags & FLAG_MIRROR_MOVE_AFFECTED && gHitMarker & HITMARKER_OBEYS
|
||||
&& gBattlerAttacker != gBattlerTarget && !(gHitMarker & HITMARKER_FAINTED(gBattlerTarget))
|
||||
if (!(gAbsentBattlerFlags & gBitTable[gBattlerAttacker])
|
||||
&& !(gBattleStruct->absentBattlerFlags & gBitTable[gBattlerAttacker])
|
||||
&& gBattleMoves[originallyUsedMove].flags & FLAG_MIRROR_MOVE_AFFECTED
|
||||
&& gHitMarker & HITMARKER_OBEYS
|
||||
&& gBattlerAttacker != gBattlerTarget
|
||||
&& !(gHitMarker & HITMARKER_FAINTED(gBattlerTarget))
|
||||
&& !(gMoveResultFlags & MOVE_RESULT_NO_EFFECT))
|
||||
{
|
||||
u8 target, attacker;
|
||||
@@ -6585,10 +6593,10 @@ static void Cmd_trymirrormove(void)
|
||||
s32 validMovesCount;
|
||||
s32 i;
|
||||
u16 move;
|
||||
u16 movesArray[4];
|
||||
u16 validMoves[MAX_BATTLERS_COUNT];
|
||||
|
||||
for (i = 0; i < 3; i++)
|
||||
movesArray[i] = 0;
|
||||
for (i = 0; i < (MAX_BATTLERS_COUNT - 1); i++) // -1 to exclude the user
|
||||
validMoves[i] = MOVE_NONE;
|
||||
|
||||
for (validMovesCount = 0, i = 0; i < gBattlersCount; i++)
|
||||
{
|
||||
@@ -6597,9 +6605,9 @@ static void Cmd_trymirrormove(void)
|
||||
move = *(i * 2 + gBattlerAttacker * 8 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 0)
|
||||
| (*(i * 2 + gBattlerAttacker * 8 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 1) << 8);
|
||||
|
||||
if (move != 0 && move != 0xFFFF)
|
||||
if (move != MOVE_NONE && move != MOVE_UNAVAILABLE)
|
||||
{
|
||||
movesArray[validMovesCount] = move;
|
||||
validMoves[validMovesCount] = move;
|
||||
validMovesCount++;
|
||||
}
|
||||
}
|
||||
@@ -6608,24 +6616,24 @@ static void Cmd_trymirrormove(void)
|
||||
move = *(gBattleStruct->lastTakenMove + gBattlerAttacker * 2 + 0)
|
||||
| (*(gBattleStruct->lastTakenMove + gBattlerAttacker * 2 + 1) << 8);
|
||||
|
||||
if (move != 0 && move != 0xFFFF)
|
||||
if (move != MOVE_NONE && move != MOVE_UNAVAILABLE)
|
||||
{
|
||||
gHitMarker &= ~HITMARKER_ATTACKSTRING_PRINTED;
|
||||
gCurrentMove = move;
|
||||
gBattlerTarget = GetMoveTarget(gCurrentMove, NO_TARGET_OVERRIDE);
|
||||
gBattlescriptCurrInstr = gBattleScriptsForMoveEffects[gBattleMoves[gCurrentMove].effect];
|
||||
}
|
||||
else if (validMovesCount)
|
||||
else if (validMovesCount != 0)
|
||||
{
|
||||
gHitMarker &= ~HITMARKER_ATTACKSTRING_PRINTED;
|
||||
i = Random() % validMovesCount;
|
||||
gCurrentMove = movesArray[i];
|
||||
gCurrentMove = validMoves[i];
|
||||
gBattlerTarget = GetMoveTarget(gCurrentMove, NO_TARGET_OVERRIDE);
|
||||
gBattlescriptCurrInstr = gBattleScriptsForMoveEffects[gBattleMoves[gCurrentMove].effect];
|
||||
}
|
||||
else
|
||||
else // no valid moves found
|
||||
{
|
||||
gSpecialStatuses[gBattlerAttacker].ppNotAffectedByPressure = 1;
|
||||
gSpecialStatuses[gBattlerAttacker].ppNotAffectedByPressure = TRUE;
|
||||
gBattlescriptCurrInstr++;
|
||||
}
|
||||
}
|
||||
@@ -7164,7 +7172,7 @@ static void Cmd_forcerandomswitch(void)
|
||||
|| (gBattleTypeFlags & BATTLE_TYPE_BATTLE_TOWER && gBattleTypeFlags & BATTLE_TYPE_RECORDED_LINK)
|
||||
|| (gBattleTypeFlags & BATTLE_TYPE_INGAME_PARTNER))
|
||||
{
|
||||
if ((gBattlerTarget & BIT_FLANK) != 0)
|
||||
if ((gBattlerTarget & BIT_FLANK) != B_FLANK_LEFT)
|
||||
{
|
||||
firstMonId = 3;
|
||||
lastMonId = 6;
|
||||
@@ -7182,7 +7190,7 @@ static void Cmd_forcerandomswitch(void)
|
||||
else if ((gBattleTypeFlags & BATTLE_TYPE_MULTI && gBattleTypeFlags & BATTLE_TYPE_LINK)
|
||||
|| (gBattleTypeFlags & BATTLE_TYPE_MULTI && gBattleTypeFlags & BATTLE_TYPE_RECORDED_LINK))
|
||||
{
|
||||
if (GetLinkTrainerFlankId(GetBattlerMultiplayerId(gBattlerTarget)) == 1)
|
||||
if (GetLinkTrainerFlankId(GetBattlerMultiplayerId(gBattlerTarget)) == B_FLANK_RIGHT)
|
||||
{
|
||||
firstMonId = 3;
|
||||
lastMonId = 6;
|
||||
@@ -7208,7 +7216,7 @@ static void Cmd_forcerandomswitch(void)
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((gBattlerTarget & BIT_FLANK) != 0)
|
||||
if ((gBattlerTarget & BIT_FLANK) != B_FLANK_LEFT)
|
||||
{
|
||||
firstMonId = 3;
|
||||
lastMonId = 6;
|
||||
@@ -7305,7 +7313,7 @@ static void Cmd_tryconversiontypechange(void) // randomly changes user's type to
|
||||
|
||||
while (validMoves < MAX_MON_MOVES)
|
||||
{
|
||||
if (gBattleMons[gBattlerAttacker].moves[validMoves] == 0)
|
||||
if (gBattleMons[gBattlerAttacker].moves[validMoves] == MOVE_NONE)
|
||||
break;
|
||||
|
||||
validMoves++;
|
||||
@@ -7674,7 +7682,7 @@ static void Cmd_setfocusenergy(void)
|
||||
|
||||
static void Cmd_transformdataexecution(void)
|
||||
{
|
||||
gChosenMove = 0xFFFF;
|
||||
gChosenMove = MOVE_UNAVAILABLE;
|
||||
gBattlescriptCurrInstr++;
|
||||
if (gBattleMons[gBattlerTarget].status2 & STATUS2_TRANSFORMED
|
||||
|| gStatuses3[gBattlerTarget] & STATUS3_SEMI_INVULNERABLE)
|
||||
@@ -7688,7 +7696,7 @@ static void Cmd_transformdataexecution(void)
|
||||
u8 *battleMonAttacker, *battleMonTarget;
|
||||
|
||||
gBattleMons[gBattlerAttacker].status2 |= STATUS2_TRANSFORMED;
|
||||
gDisableStructs[gBattlerAttacker].disabledMove = 0;
|
||||
gDisableStructs[gBattlerAttacker].disabledMove = MOVE_NONE;
|
||||
gDisableStructs[gBattlerAttacker].disableTimer = 0;
|
||||
gDisableStructs[gBattlerAttacker].transformedMonPersonality = gBattleMons[gBattlerTarget].personality;
|
||||
gDisableStructs[gBattlerAttacker].mimickedMoves = 0;
|
||||
@@ -7754,12 +7762,12 @@ static bool8 IsMoveUncopyableByMimic(u16 move)
|
||||
|
||||
static void Cmd_mimicattackcopy(void)
|
||||
{
|
||||
gChosenMove = 0xFFFF;
|
||||
gChosenMove = MOVE_UNAVAILABLE;
|
||||
|
||||
if (IsMoveUncopyableByMimic(gLastMoves[gBattlerTarget])
|
||||
|| gBattleMons[gBattlerAttacker].status2 & STATUS2_TRANSFORMED
|
||||
|| gLastMoves[gBattlerTarget] == 0
|
||||
|| gLastMoves[gBattlerTarget] == 0xFFFF)
|
||||
|| gLastMoves[gBattlerTarget] == MOVE_NONE
|
||||
|| gLastMoves[gBattlerTarget] == MOVE_UNAVAILABLE)
|
||||
{
|
||||
gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1);
|
||||
}
|
||||
@@ -7900,7 +7908,7 @@ static void Cmd_disablelastusedattack(void)
|
||||
if (gBattleMons[gBattlerTarget].moves[i] == gLastMoves[gBattlerTarget])
|
||||
break;
|
||||
}
|
||||
if (gDisableStructs[gBattlerTarget].disabledMove == 0
|
||||
if (gDisableStructs[gBattlerTarget].disabledMove == MOVE_NONE
|
||||
&& i != MAX_MON_MOVES && gBattleMons[gBattlerTarget].pp[i] != 0)
|
||||
{
|
||||
PREPARE_MOVE_BUFFER(gBattleTextBuff1, gBattleMons[gBattlerTarget].moves[i])
|
||||
@@ -7933,7 +7941,7 @@ static void Cmd_trysetencore(void)
|
||||
i = 4;
|
||||
}
|
||||
|
||||
if (gDisableStructs[gBattlerTarget].encoredMove == 0
|
||||
if (gDisableStructs[gBattlerTarget].encoredMove == MOVE_NONE
|
||||
&& i != 4 && gBattleMons[gBattlerTarget].pp[i] != 0)
|
||||
{
|
||||
gDisableStructs[gBattlerTarget].encoredMove = gBattleMons[gBattlerTarget].moves[i];
|
||||
@@ -7975,7 +7983,7 @@ static void Cmd_painsplitdmgcalc(void)
|
||||
static void Cmd_settypetorandomresistance(void) // conversion 2
|
||||
{
|
||||
if (gLastLandedMoves[gBattlerAttacker] == MOVE_NONE
|
||||
|| gLastLandedMoves[gBattlerAttacker] == 0xFFFF)
|
||||
|| gLastLandedMoves[gBattlerAttacker] == MOVE_UNAVAILABLE)
|
||||
{
|
||||
gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1);
|
||||
}
|
||||
@@ -8042,12 +8050,12 @@ static void Cmd_setalwayshitflag(void)
|
||||
|
||||
static void Cmd_copymovepermanently(void) // sketch
|
||||
{
|
||||
gChosenMove = 0xFFFF;
|
||||
gChosenMove = MOVE_UNAVAILABLE;
|
||||
|
||||
if (!(gBattleMons[gBattlerAttacker].status2 & STATUS2_TRANSFORMED)
|
||||
&& gLastPrintedMoves[gBattlerTarget] != MOVE_STRUGGLE
|
||||
&& gLastPrintedMoves[gBattlerTarget] != 0
|
||||
&& gLastPrintedMoves[gBattlerTarget] != 0xFFFF
|
||||
&& gLastPrintedMoves[gBattlerTarget] != MOVE_NONE
|
||||
&& gLastPrintedMoves[gBattlerTarget] != MOVE_UNAVAILABLE
|
||||
&& gLastPrintedMoves[gBattlerTarget] != MOVE_SKETCH)
|
||||
{
|
||||
s32 i;
|
||||
@@ -8096,11 +8104,11 @@ static void Cmd_copymovepermanently(void) // sketch
|
||||
static bool8 IsTwoTurnsMove(u16 move)
|
||||
{
|
||||
if (gBattleMoves[move].effect == EFFECT_SKULL_BASH
|
||||
|| gBattleMoves[move].effect == EFFECT_RAZOR_WIND
|
||||
|| gBattleMoves[move].effect == EFFECT_SKY_ATTACK
|
||||
|| gBattleMoves[move].effect == EFFECT_SOLAR_BEAM
|
||||
|| gBattleMoves[move].effect == EFFECT_SEMI_INVULNERABLE
|
||||
|| gBattleMoves[move].effect == EFFECT_BIDE)
|
||||
|| gBattleMoves[move].effect == EFFECT_RAZOR_WIND
|
||||
|| gBattleMoves[move].effect == EFFECT_SKY_ATTACK
|
||||
|| gBattleMoves[move].effect == EFFECT_SOLAR_BEAM
|
||||
|| gBattleMoves[move].effect == EFFECT_SEMI_INVULNERABLE
|
||||
|| gBattleMoves[move].effect == EFFECT_BIDE)
|
||||
return TRUE;
|
||||
else
|
||||
return FALSE;
|
||||
@@ -8108,8 +8116,11 @@ static bool8 IsTwoTurnsMove(u16 move)
|
||||
|
||||
static bool8 IsInvalidForSleepTalkOrAssist(u16 move)
|
||||
{
|
||||
if (move == 0 || move == MOVE_SLEEP_TALK || move == MOVE_ASSIST
|
||||
|| move == MOVE_MIRROR_MOVE || move == MOVE_METRONOME)
|
||||
if (move == MOVE_NONE
|
||||
|| move == MOVE_SLEEP_TALK
|
||||
|| move == MOVE_ASSIST
|
||||
|| move == MOVE_MIRROR_MOVE
|
||||
|| move == MOVE_METRONOME)
|
||||
return TRUE;
|
||||
else
|
||||
return FALSE;
|
||||
@@ -8123,11 +8134,11 @@ static u8 AttacksThisTurn(u8 battlerId, u16 move) // Note: returns 1 if it's a c
|
||||
return 2;
|
||||
|
||||
if (gBattleMoves[move].effect == EFFECT_SKULL_BASH
|
||||
|| gBattleMoves[move].effect == EFFECT_RAZOR_WIND
|
||||
|| gBattleMoves[move].effect == EFFECT_SKY_ATTACK
|
||||
|| gBattleMoves[move].effect == EFFECT_SOLAR_BEAM
|
||||
|| gBattleMoves[move].effect == EFFECT_SEMI_INVULNERABLE
|
||||
|| gBattleMoves[move].effect == EFFECT_BIDE)
|
||||
|| gBattleMoves[move].effect == EFFECT_RAZOR_WIND
|
||||
|| gBattleMoves[move].effect == EFFECT_SKY_ATTACK
|
||||
|| gBattleMoves[move].effect == EFFECT_SOLAR_BEAM
|
||||
|| gBattleMoves[move].effect == EFFECT_SEMI_INVULNERABLE
|
||||
|| gBattleMoves[move].effect == EFFECT_BIDE)
|
||||
{
|
||||
if ((gHitMarker & HITMARKER_CHARGING))
|
||||
return 1;
|
||||
@@ -8215,8 +8226,8 @@ static void Cmd_remaininghptopower(void)
|
||||
|
||||
static void Cmd_tryspiteppreduce(void)
|
||||
{
|
||||
if (gLastMoves[gBattlerTarget] != 0
|
||||
&& gLastMoves[gBattlerTarget] != 0xFFFF)
|
||||
if (gLastMoves[gBattlerTarget] != MOVE_NONE
|
||||
&& gLastMoves[gBattlerTarget] != MOVE_UNAVAILABLE)
|
||||
{
|
||||
s32 i;
|
||||
|
||||
@@ -9092,7 +9103,7 @@ static void Cmd_tryswapitems(void) // trick
|
||||
}
|
||||
// can't swap if two pokemon don't have an item
|
||||
// or if either of them is an enigma berry or a mail
|
||||
else if ((gBattleMons[gBattlerAttacker].item == 0 && gBattleMons[gBattlerTarget].item == 0)
|
||||
else if ((gBattleMons[gBattlerAttacker].item == ITEM_NONE && gBattleMons[gBattlerTarget].item == ITEM_NONE)
|
||||
|| gBattleMons[gBattlerAttacker].item == ITEM_ENIGMA_BERRY
|
||||
|| gBattleMons[gBattlerTarget].item == ITEM_ENIGMA_BERRY
|
||||
|| IS_ITEM_MAIL(gBattleMons[gBattlerAttacker].item)
|
||||
@@ -9150,7 +9161,7 @@ static void Cmd_tryswapitems(void) // trick
|
||||
|
||||
static void Cmd_trycopyability(void) // role play
|
||||
{
|
||||
if (gBattleMons[gBattlerTarget].ability != 0
|
||||
if (gBattleMons[gBattlerTarget].ability != ABILITY_NONE
|
||||
&& gBattleMons[gBattlerTarget].ability != ABILITY_WONDER_GUARD)
|
||||
{
|
||||
gBattleMons[gBattlerAttacker].ability = gBattleMons[gBattlerTarget].ability;
|
||||
@@ -9263,8 +9274,8 @@ static void Cmd_scaledamagebyhealthratio(void)
|
||||
|
||||
static void Cmd_tryswapabilities(void) // skill swap
|
||||
{
|
||||
if ((gBattleMons[gBattlerAttacker].ability == 0
|
||||
&& gBattleMons[gBattlerTarget].ability == 0)
|
||||
if ((gBattleMons[gBattlerAttacker].ability == ABILITY_NONE
|
||||
&& gBattleMons[gBattlerTarget].ability == ABILITY_NONE)
|
||||
|| gBattleMons[gBattlerAttacker].ability == ABILITY_WONDER_GUARD
|
||||
|| gBattleMons[gBattlerTarget].ability == ABILITY_WONDER_GUARD
|
||||
|| gMoveResultFlags & MOVE_RESULT_NO_EFFECT)
|
||||
@@ -9358,7 +9369,7 @@ static void Cmd_assistattackselect(void)
|
||||
s32 chooseableMovesNo = 0;
|
||||
struct Pokemon* party;
|
||||
s32 monId, moveId;
|
||||
u16* movesArray = gBattleStruct->assistPossibleMoves;
|
||||
u16* validMoves = gBattleStruct->assistPossibleMoves;
|
||||
|
||||
if (GET_BATTLER_SIDE(gBattlerAttacker) != B_SIDE_PLAYER)
|
||||
party = gEnemyParty;
|
||||
@@ -9389,14 +9400,14 @@ static void Cmd_assistattackselect(void)
|
||||
if (move == MOVE_NONE)
|
||||
continue;
|
||||
|
||||
movesArray[chooseableMovesNo] = move;
|
||||
validMoves[chooseableMovesNo] = move;
|
||||
chooseableMovesNo++;
|
||||
}
|
||||
}
|
||||
if (chooseableMovesNo)
|
||||
{
|
||||
gHitMarker &= ~HITMARKER_ATTACKSTRING_PRINTED;
|
||||
gCalledMove = movesArray[((Random() & 0xFF) * chooseableMovesNo) >> 8];
|
||||
gCalledMove = validMoves[((Random() & 0xFF) * chooseableMovesNo) >> 8];
|
||||
gBattlerTarget = GetMoveTarget(gCalledMove, NO_TARGET_OVERRIDE);
|
||||
gBattlescriptCurrInstr += 5;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user