Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Encapsulate move data #5852

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
8e83ca4
Moved structs and data to their own "move" files
AsparagusEduardo Dec 16, 2024
b2cb2e1
Moved GetMoveName to move.h + removed direct access to field
AsparagusEduardo Dec 16, 2024
454b06d
Moved GetMoveAnimationScript
AsparagusEduardo Dec 16, 2024
f8179fc
GetMoveDescription
AsparagusEduardo Dec 16, 2024
d3733bb
GetMoveEffect
AsparagusEduardo Dec 16, 2024
d2c730c
GetMoveType -> GetBattleMoveType
AsparagusEduardo Dec 16, 2024
d32fa31
GetMoveType
AsparagusEduardo Dec 16, 2024
ecbb1b2
Moved functions to inlines
AsparagusEduardo Dec 16, 2024
829fb5d
GetMoveCategory
AsparagusEduardo Dec 16, 2024
92ddd0a
GetMovePower
AsparagusEduardo Dec 16, 2024
0b75a16
GetMoveAccuracy
AsparagusEduardo Dec 17, 2024
f03f856
GetMoveTarget -> GetBattleMoveTarget
AsparagusEduardo Dec 18, 2024
5a5e188
GetMoveTarget
AsparagusEduardo Dec 18, 2024
36cb2f5
GetMovePP
AsparagusEduardo Dec 18, 2024
7159912
GetMoveZEffect/GetMoveZPowerOverride
AsparagusEduardo Dec 18, 2024
10b32d2
Renamed GetMovePriority -> GetBattleMovePriority
AsparagusEduardo Dec 18, 2024
33c11e9
GetMovePriority
AsparagusEduardo Dec 18, 2024
82d72b2
GetMoveRecoil
AsparagusEduardo Dec 18, 2024
82dc1ef
GetMoveStrikeCount
AsparagusEduardo Dec 18, 2024
cf52c54
GetMoveCriticalHitStage
AsparagusEduardo Dec 18, 2024
b16094d
MoveAlwaysCrits
AsparagusEduardo Dec 18, 2024
84abf76
GetMoveAdditionalEffectCount
AsparagusEduardo Dec 18, 2024
3d08ba6
MoveMakesContact
AsparagusEduardo Dec 19, 2024
6ef5859
MoveIgnoresProtect, MoveCanBeBouncedBack, MoveCanSnatched
AsparagusEduardo Dec 19, 2024
679ba82
King's Rock, Punching, Biting, Pulse, Sound, Ballistic, Powder and Da…
AsparagusEduardo Dec 19, 2024
adcdb1a
Wind, Slicing, Healing, Minimize, Ignores Target Ability
AsparagusEduardo Dec 19, 2024
6975735
More flags
AsparagusEduardo Dec 22, 2024
b40f57f
Merge branch '_RHH/upcoming' into _RHH/pr/upcoming/encapsulateMoveData
AsparagusEduardo Dec 22, 2024
8a300a7
Fixed unused var
AsparagusEduardo Dec 22, 2024
9e22606
Banned flags
AsparagusEduardo Dec 23, 2024
3deb4de
Fixes Metronome
AsparagusEduardo Dec 23, 2024
501b883
Contest data
AsparagusEduardo Dec 23, 2024
39e6e90
Additional effects
AsparagusEduardo Dec 23, 2024
33762cc
Incoming changes
AsparagusEduardo Dec 23, 2024
2b2e9f6
Merge branch '_RHH/upcoming' into _RHH/pr/upcoming/encapsulateMoveData
AsparagusEduardo Dec 23, 2024
587ca4a
Misc
AsparagusEduardo Dec 23, 2024
56bc335
Argument encapsulation
AsparagusEduardo Dec 24, 2024
fdcaec2
Merge branch '_RHH/upcoming' into _RHH/pr/upcoming/encapsulateMoveData
AsparagusEduardo Dec 24, 2024
2227476
Merge branch '_RHH/upcoming' into _RHH/pr/upcoming/encapsulateMoveData
AsparagusEduardo Dec 26, 2024
1896ca0
Removed last uses of gMovesInfo outside of the header
AsparagusEduardo Dec 26, 2024
dde7a05
Applied code suggestions
AsparagusEduardo Dec 29, 2024
98a5d5f
Merge branch '_RHH/upcoming' into _RHH/pr/upcoming/encapsulateMoveData
AsparagusEduardo Dec 29, 2024
771e388
Changed incoming access to gMovesInfo
AsparagusEduardo Dec 29, 2024
37b7f60
GetMoveBattleScript
AsparagusEduardo Dec 30, 2024
de92119
Merge branch '_RHH/upcoming' into _RHH/pr/upcoming/encapsulateMoveData
AsparagusEduardo Dec 30, 2024
fc34aec
Cleanup
AsparagusEduardo Dec 30, 2024
5cf696a
Replace move macros with inline functions
AsparagusEduardo Dec 30, 2024
01a9f08
Merge branch '_RHH/upcoming' into _RHH/pr/upcoming/encapsulateMoveData
AsparagusEduardo Jan 1, 2025
ca006ca
Use inline function for incoming changes
AsparagusEduardo Jan 1, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 18 additions & 4 deletions include/battle.h
Original file line number Diff line number Diff line change
Expand Up @@ -851,11 +851,25 @@ STATIC_ASSERT(sizeof(((struct BattleStruct *)0)->palaceFlags) * 8 >= MAX_BATTLER
#define F_DYNAMIC_TYPE_IGNORE_PHYSICALITY (1 << 6) // If set, the dynamic type's physicality won't be used for certain move effects.
#define F_DYNAMIC_TYPE_SET (1 << 7) // Set for all dynamic types to distinguish a dynamic type of Normal (0) from no dynamic type.

#define IS_MOVE_PHYSICAL(move) (GetBattleMoveCategory(move) == DAMAGE_CATEGORY_PHYSICAL)
#define IS_MOVE_SPECIAL(move) (GetBattleMoveCategory(move) == DAMAGE_CATEGORY_SPECIAL)
#define IS_MOVE_STATUS(move) (GetMoveCategory(move) == DAMAGE_CATEGORY_STATUS)
static inline bool32 IsBattleMovePhysical(u32 move)
AsparagusEduardo marked this conversation as resolved.
Show resolved Hide resolved
{
return GetBattleMoveCategory(move) == DAMAGE_CATEGORY_PHYSICAL;
}

static inline bool32 IsBattleMoveSpecial(u32 move)
{
return GetBattleMoveCategory(move) == DAMAGE_CATEGORY_SPECIAL;
}

#define IS_MOVE_RECOIL(move) (GetMoveRecoil(move) > 0 || GetMoveEffect(move) == EFFECT_RECOIL_IF_MISS)
static inline bool32 IsBattleMoveStatus(u32 move)
{
return GetMoveCategory(move) == DAMAGE_CATEGORY_STATUS;
}

static inline bool32 IsBattleMoveRecoil(u32 move)
{
return GetMoveRecoil(move) > 0 || GetMoveEffect(move) == EFFECT_RECOIL_IF_MISS;
}

/* Checks if 'battlerId' is any of the types.
* Passing multiple types is more efficient than calling this multiple
Expand Down
1 change: 0 additions & 1 deletion include/move.h
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,6 @@ static inline const u8 *GetMoveBattleScript(u32 moveId)
return gBattleMoveEffects[EFFECT_PLACEHOLDER].battleScript;
}
return gBattleMoveEffects[gMovesInfo[moveId].effect].battleScript;

}

#endif // GUARD_MOVES_H
50 changes: 25 additions & 25 deletions src/battle_ai_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ static void SetBattlerAiMovesData(struct AiLogicData *aiData, u32 battlerAtk, u3

if (move != MOVE_NONE
&& move != MOVE_UNAVAILABLE
//&& !IS_MOVE_STATUS(move) /* we want to get effectiveness and accuracy of status moves */
//&& !IsBattleMoveStatus(move) /* we want to get effectiveness and accuracy of status moves */
&& !(aiData->moveLimitations[battlerAtk] & (1u << moveIndex)))
{
dmg = AI_CalcDamage(move, battlerAtk, battlerDef, &effectiveness, TRUE, weather, rollType);
Expand Down Expand Up @@ -800,11 +800,11 @@ static s32 AI_CheckBadMove(u32 battlerAtk, u32 battlerDef, u32 move, s32 score)
RETURN_SCORE_MINUS(20);
break;
case ABILITY_JUSTIFIED:
if (moveType == TYPE_DARK && !IS_MOVE_STATUS(move))
if (moveType == TYPE_DARK && !IsBattleMoveStatus(move))
RETURN_SCORE_MINUS(10);
break;
case ABILITY_RATTLED:
if (!IS_MOVE_STATUS(move)
if (!IsBattleMoveStatus(move)
&& (moveType == TYPE_DARK || moveType == TYPE_GHOST || moveType == TYPE_BUG))
RETURN_SCORE_MINUS(10);
break;
Expand Down Expand Up @@ -911,7 +911,7 @@ static s32 AI_CheckBadMove(u32 battlerAtk, u32 battlerDef, u32 move, s32 score)

// gen7+ dark type mons immune to priority->elevated moves from prankster
if (B_PRANKSTER_DARK_TYPES >= GEN_7 && IS_BATTLER_OF_TYPE(battlerDef, TYPE_DARK)
&& aiData->abilities[battlerAtk] == ABILITY_PRANKSTER && IS_MOVE_STATUS(move)
&& aiData->abilities[battlerAtk] == ABILITY_PRANKSTER && IsBattleMoveStatus(move)
&& !(moveTarget & (MOVE_TARGET_OPPONENTS_FIELD | MOVE_TARGET_USER)))
RETURN_SCORE_MINUS(10);

Expand Down Expand Up @@ -956,7 +956,7 @@ static s32 AI_CheckBadMove(u32 battlerAtk, u32 battlerDef, u32 move, s32 score)
RETURN_SCORE_MINUS(30);
}

if (!IS_MOVE_STATUS(move))
if (!IsBattleMoveStatus(move))
{
if (weather & B_WEATHER_SUN_PRIMAL)
{
Expand Down Expand Up @@ -1697,7 +1697,7 @@ static s32 AI_CheckBadMove(u32 battlerAtk, u32 battlerDef, u32 move, s32 score)
if (!isDoubleBattle
|| !IsBattlerAlive(BATTLE_PARTNER(battlerAtk))
|| PartnerHasSameMoveEffectWithoutTarget(BATTLE_PARTNER(battlerAtk), move, aiData->partnerMove)
|| (aiData->partnerMove != MOVE_NONE && IS_MOVE_STATUS(aiData->partnerMove))
|| (aiData->partnerMove != MOVE_NONE && IsBattleMoveStatus(aiData->partnerMove))
|| *(gBattleStruct->monToSwitchIntoId + BATTLE_PARTNER(battlerAtk)) != PARTY_SIZE) //Partner is switching out.
ADJUST_SCORE(-10);
break;
Expand Down Expand Up @@ -2483,7 +2483,7 @@ static s32 AI_CheckBadMove(u32 battlerAtk, u32 battlerDef, u32 move, s32 score)
case EFFECT_SUCKER_PUNCH:
if (predictedMove != MOVE_NONE)
{
if (IS_MOVE_STATUS(predictedMove) || AI_IsSlower(battlerAtk, battlerDef, move)) // Opponent going first
if (IsBattleMoveStatus(predictedMove) || AI_IsSlower(battlerAtk, battlerDef, move)) // Opponent going first
ADJUST_SCORE(-10);
}
break;
Expand Down Expand Up @@ -2582,7 +2582,7 @@ static s32 AI_CheckBadMove(u32 battlerAtk, u32 battlerDef, u32 move, s32 score)
ADJUST_SCORE(-10);
break;
case EFFECT_UPPER_HAND:
if (predictedMove == MOVE_NONE || IS_MOVE_STATUS(predictedMove) || AI_IsSlower(battlerAtk, battlerDef, move) || GetBattleMovePriority(battlerDef, predictedMove) < 1 || GetBattleMovePriority(battlerDef, predictedMove) > 3) // Opponent going first or not using priority move
if (predictedMove == MOVE_NONE || IsBattleMoveStatus(predictedMove) || AI_IsSlower(battlerAtk, battlerDef, move) || GetBattleMovePriority(battlerDef, predictedMove) < 1 || GetBattleMovePriority(battlerDef, predictedMove) > 3) // Opponent going first or not using priority move
ADJUST_SCORE(-10);
break;
case EFFECT_PLACEHOLDER:
Expand Down Expand Up @@ -2618,7 +2618,7 @@ static s32 AI_TryToFaint(u32 battlerAtk, u32 battlerDef, u32 move, s32 score)
if (IS_TARGETING_PARTNER(battlerAtk, battlerDef))
return score;

if (IS_MOVE_STATUS(move))
if (IsBattleMoveStatus(move))
return score; // status moves aren't accounted here

if (CanIndexMoveFaintTarget(battlerAtk, battlerDef, movesetIndex, 0) && GetMoveEffect(move) != EFFECT_EXPLOSION)
Expand Down Expand Up @@ -2665,7 +2665,7 @@ static s32 AI_DoubleBattle(u32 battlerAtk, u32 battlerDef, u32 move, s32 score)
switch (partnerEffect)
{
case EFFECT_HELPING_HAND:
if (IS_MOVE_STATUS(move))
if (IsBattleMoveStatus(move))
ADJUST_SCORE(-7);
break;
case EFFECT_PERISH_SONG:
Expand Down Expand Up @@ -2697,7 +2697,7 @@ static s32 AI_DoubleBattle(u32 battlerAtk, u32 battlerDef, u32 move, s32 score)
if (IsAttackBoostMoveEffect(effect))
ADJUST_SCORE(-3);
// encourage moves hitting multiple opponents
if (!IS_MOVE_STATUS(move) && (moveTarget & (MOVE_TARGET_BOTH | MOVE_TARGET_FOES_AND_ALLY)))
if (!IsBattleMoveStatus(move) && (moveTarget & (MOVE_TARGET_BOTH | MOVE_TARGET_FOES_AND_ALLY)))
ADJUST_SCORE(GOOD_EFFECT);
}
}
Expand Down Expand Up @@ -2850,7 +2850,7 @@ static s32 AI_DoubleBattle(u32 battlerAtk, u32 battlerDef, u32 move, s32 score)
break;
case ABILITY_JUSTIFIED:
if (moveType == TYPE_DARK
&& !IS_MOVE_STATUS(move)
&& !IsBattleMoveStatus(move)
&& HasMoveWithCategory(battlerAtkPartner, DAMAGE_CATEGORY_PHYSICAL)
&& BattlerStatCanRise(battlerAtkPartner, atkPartnerAbility, STAT_ATK)
&& !CanIndexMoveFaintTarget(battlerAtk, battlerAtkPartner, AI_THINKING_STRUCT->movesetIndex, 1))
Expand All @@ -2859,7 +2859,7 @@ static s32 AI_DoubleBattle(u32 battlerAtk, u32 battlerDef, u32 move, s32 score)
}
break;
case ABILITY_RATTLED:
if (!IS_MOVE_STATUS(move)
if (!IsBattleMoveStatus(move)
&& (moveType == TYPE_DARK || moveType == TYPE_GHOST || moveType == TYPE_BUG)
&& BattlerStatCanRise(battlerAtkPartner, atkPartnerAbility, STAT_SPEED)
&& !CanIndexMoveFaintTarget(battlerAtk, battlerAtkPartner, AI_THINKING_STRUCT->movesetIndex, 1))
Expand Down Expand Up @@ -2916,7 +2916,7 @@ static s32 AI_DoubleBattle(u32 battlerAtk, u32 battlerDef, u32 move, s32 score)
case EFFECT_BEAT_UP:
if (atkPartnerAbility == ABILITY_JUSTIFIED
&& moveType == TYPE_DARK
&& !IS_MOVE_STATUS(move)
&& !IsBattleMoveStatus(move)
&& HasMoveWithCategory(battlerAtkPartner, DAMAGE_CATEGORY_PHYSICAL)
&& BattlerStatCanRise(battlerAtkPartner, atkPartnerAbility, STAT_ATK)
&& !CanIndexMoveFaintTarget(battlerAtk, battlerAtkPartner, AI_THINKING_STRUCT->movesetIndex, 0))
Expand Down Expand Up @@ -2986,7 +2986,7 @@ static s32 AI_DoubleBattle(u32 battlerAtk, u32 battlerDef, u32 move, s32 score)
instructedMove = gLastMoves[battlerAtkPartner];

if (instructedMove != MOVE_NONE
&& !IS_MOVE_STATUS(instructedMove)
&& !IsBattleMoveStatus(instructedMove)
&& (GetBattlerMoveTargetType(battlerAtkPartner, instructedMove) & (MOVE_TARGET_BOTH | MOVE_TARGET_FOES_AND_ALLY))) // Use instruct on multi-target moves
{
RETURN_SCORE_PLUS(WEAK_EFFECT);
Expand Down Expand Up @@ -3199,7 +3199,7 @@ static u32 AI_CalcMoveEffectScore(u32 battlerAtk, u32 battlerDef, u32 move)
moveEffect = EFFECT_PROTECT;

// check status move preference
if (AI_THINKING_STRUCT->aiFlags[battlerAtk] & AI_FLAG_PREFER_STATUS_MOVES && IS_MOVE_STATUS(move) && effectiveness != AI_EFFECTIVENESS_x0)
if (AI_THINKING_STRUCT->aiFlags[battlerAtk] & AI_FLAG_PREFER_STATUS_MOVES && IsBattleMoveStatus(move) && effectiveness != AI_EFFECTIVENESS_x0)
ADJUST_SCORE(10);

// check thawing moves
Expand Down Expand Up @@ -3648,13 +3648,13 @@ static u32 AI_CalcMoveEffectScore(u32 battlerAtk, u32 battlerDef, u32 move)
}
break;
case MOVE_CRAFTY_SHIELD:
if (predictedMove != MOVE_NONE && IS_MOVE_STATUS(predictedMove) && !(GetBattlerMoveTargetType(battlerDef, predictedMove) & MOVE_TARGET_USER))
if (predictedMove != MOVE_NONE && IsBattleMoveStatus(predictedMove) && !(GetBattlerMoveTargetType(battlerDef, predictedMove) & MOVE_TARGET_USER))
ProtectChecks(battlerAtk, battlerDef, move, predictedMove, &score);
break;

case MOVE_MAT_BLOCK:
if (gDisableStructs[battlerAtk].isFirstTurn && predictedMove != MOVE_NONE
&& !IS_MOVE_STATUS(predictedMove) && !(GetBattlerMoveTargetType(battlerDef, predictedMove) & MOVE_TARGET_USER))
&& !IsBattleMoveStatus(predictedMove) && !(GetBattlerMoveTargetType(battlerDef, predictedMove) & MOVE_TARGET_USER))
ProtectChecks(battlerAtk, battlerDef, move, predictedMove, &score);
break;
case MOVE_KINGS_SHIELD:
Expand Down Expand Up @@ -3899,7 +3899,7 @@ static u32 AI_CalcMoveEffectScore(u32 battlerAtk, u32 battlerDef, u32 move)
&& IsBattlerAlive(BATTLE_PARTNER(battlerAtk)))
{
u32 predictedMoveOnPartner = gLastMoves[BATTLE_PARTNER(battlerAtk)];
if (predictedMoveOnPartner != MOVE_NONE && !IS_MOVE_STATUS(predictedMoveOnPartner))
if (predictedMoveOnPartner != MOVE_NONE && !IsBattleMoveStatus(predictedMoveOnPartner))
ADJUST_SCORE(GOOD_EFFECT);
}
break;
Expand All @@ -3910,7 +3910,7 @@ static u32 AI_CalcMoveEffectScore(u32 battlerAtk, u32 battlerDef, u32 move)
ADJUST_SCORE(IncreaseStatUpScore(battlerAtk, battlerDef, STAT_CHANGE_SPDEF));
break;
case EFFECT_TAUNT:
if (IS_MOVE_STATUS(predictedMove))
if (IsBattleMoveStatus(predictedMove))
ADJUST_SCORE(GOOD_EFFECT);
else if (HasMoveWithCategory(battlerDef, DAMAGE_CATEGORY_STATUS))
ADJUST_SCORE(DECENT_EFFECT);
Expand Down Expand Up @@ -4035,7 +4035,7 @@ static u32 AI_CalcMoveEffectScore(u32 battlerAtk, u32 battlerDef, u32 move)
ADJUST_SCORE(GOOD_EFFECT);
break;
case EFFECT_MAGIC_COAT:
if (IS_MOVE_STATUS(predictedMove) && GetBattlerMoveTargetType(battlerDef, predictedMove) & (MOVE_TARGET_SELECTED | MOVE_TARGET_OPPONENTS_FIELD | MOVE_TARGET_BOTH))
if (IsBattleMoveStatus(predictedMove) && GetBattlerMoveTargetType(battlerDef, predictedMove) & (MOVE_TARGET_SELECTED | MOVE_TARGET_OPPONENTS_FIELD | MOVE_TARGET_BOTH))
ADJUST_SCORE(GOOD_EFFECT);
break;
case EFFECT_RECYCLE:
Expand Down Expand Up @@ -4313,7 +4313,7 @@ static u32 AI_CalcMoveEffectScore(u32 battlerAtk, u32 battlerDef, u32 move)
ADJUST_SCORE(DECENT_EFFECT);
break;
case EFFECT_POWDER:
if (predictedMove != MOVE_NONE && !IS_MOVE_STATUS(predictedMove) && predictedType == TYPE_FIRE)
if (predictedMove != MOVE_NONE && !IsBattleMoveStatus(predictedMove) && predictedType == TYPE_FIRE)
ADJUST_SCORE(DECENT_EFFECT);
break;
case EFFECT_TELEKINESIS:
Expand Down Expand Up @@ -4385,7 +4385,7 @@ static u32 AI_CalcMoveEffectScore(u32 battlerAtk, u32 battlerDef, u32 move)
break;
case EFFECT_CAMOUFLAGE:
if (predictedMove != MOVE_NONE && AI_IsFaster(battlerAtk, battlerDef, move) // Attacker goes first
&& !IS_MOVE_STATUS(move) && AI_GetMoveEffectiveness(predictedMove, battlerDef, battlerAtk) != AI_EFFECTIVENESS_x0)
&& !IsBattleMoveStatus(move) && AI_GetMoveEffectiveness(predictedMove, battlerDef, battlerAtk) != AI_EFFECTIVENESS_x0)
ADJUST_SCORE(DECENT_EFFECT);
break;
case EFFECT_TOXIC_THREAD:
Expand Down Expand Up @@ -4946,7 +4946,7 @@ static s32 AI_PreferBatonPass(u32 battlerAtk, u32 battlerDef, u32 move, s32 scor
{
if (IS_TARGETING_PARTNER(battlerAtk, battlerDef)
|| CountUsablePartyMons(battlerAtk) == 0
|| !IS_MOVE_STATUS(move)
|| !IsBattleMoveStatus(move)
|| !HasMoveEffect(battlerAtk, EFFECT_BATON_PASS)
|| IsBattlerTrapped(battlerAtk, TRUE))
return score;
Expand Down Expand Up @@ -5178,7 +5178,7 @@ static s32 AI_HPAware(u32 battlerAtk, u32 battlerDef, u32 move, s32 score)
else
{
// low HP
if (IS_MOVE_STATUS(move))
if (IsBattleMoveStatus(move))
ADJUST_SCORE(-2); // don't use status moves if target is at low health
}
}
Expand Down
14 changes: 7 additions & 7 deletions src/battle_ai_switch_items.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ static bool32 ShouldSwitchIfHasBadOdds(u32 battler)
}

// Only check damage if it's a damaging move
if (!IS_MOVE_STATUS(aiMove))
if (!IsBattleMoveStatus(aiMove))
{
// Check if mon has a super effective move
if (AI_GetMoveEffectiveness(aiMove, battler, opposingBattler) >= AI_EFFECTIVENESS_x2)
Expand Down Expand Up @@ -156,7 +156,7 @@ static bool32 ShouldSwitchIfHasBadOdds(u32 battler)
for (i = 0; i < MAX_MON_MOVES; i++)
{
playerMove = gBattleMons[opposingBattler].moves[i];
if (playerMove != MOVE_NONE && !IS_MOVE_STATUS(playerMove))
if (playerMove != MOVE_NONE && !IsBattleMoveStatus(playerMove))
{
damageTaken = AI_CalcDamage(playerMove, opposingBattler, battler, &effectiveness, FALSE, weather, DMG_ROLL_HIGHEST).expected;
if (damageTaken > maxDamageTaken)
Expand Down Expand Up @@ -704,7 +704,7 @@ static bool32 FindMonWithFlagsAndSuperEffective(u32 battler, u16 flags, u32 perc
return FALSE;
if (gLastHitBy[battler] == 0xFF)
return FALSE;
if (IS_MOVE_STATUS(gLastLandedMoves[battler]))
if (IsBattleMoveStatus(gLastLandedMoves[battler]))
return FALSE;

if (IsDoubleBattle())
Expand Down Expand Up @@ -1245,7 +1245,7 @@ static u32 GetBestMonDmg(struct Pokemon *party, int firstId, int lastId, u8 inva
for (j = 0; j < MAX_MON_MOVES; j++)
{
aiMove = AI_DATA->switchinCandidate.battleMon.moves[j];
if (aiMove != MOVE_NONE && !IS_MOVE_STATUS(aiMove))
if (aiMove != MOVE_NONE && !IsBattleMoveStatus(aiMove))
{
aiMove = GetMonData(&party[i], MON_DATA_MOVE1 + j);
dmg = AI_CalcPartyMonDamage(aiMove, battler, opposingBattler, AI_DATA->switchinCandidate.battleMon, TRUE, rollType);
Expand Down Expand Up @@ -1701,7 +1701,7 @@ static s32 GetMaxDamagePlayerCouldDealToSwitchin(u32 battler, u32 opposingBattle
for (i = 0; i < MAX_MON_MOVES; i++)
{
playerMove = gBattleMons[opposingBattler].moves[i];
if (playerMove != MOVE_NONE && !IS_MOVE_STATUS(playerMove))
if (playerMove != MOVE_NONE && !IsBattleMoveStatus(playerMove))
{
damageTaken = AI_CalcPartyMonDamage(playerMove, opposingBattler, battler, battleMon, FALSE, DMG_ROLL_HIGHEST);
if (damageTaken > maxDamageTaken)
Expand Down Expand Up @@ -1829,7 +1829,7 @@ static u32 GetBestMonIntegrated(struct Pokemon *party, int firstId, int lastId,
{
aiMove = AI_DATA->switchinCandidate.battleMon.moves[j];

if (aiMove != MOVE_NONE && !IS_MOVE_STATUS(aiMove))
if (aiMove != MOVE_NONE && !IsBattleMoveStatus(aiMove))
{
if (AI_THINKING_STRUCT->aiFlags[battler] & AI_FLAG_CONSERVATIVE)
damageDealt = AI_CalcPartyMonDamage(aiMove, battler, opposingBattler, AI_DATA->switchinCandidate.battleMon, TRUE, DMG_ROLL_LOWEST);
Expand Down Expand Up @@ -1859,7 +1859,7 @@ static u32 GetBestMonIntegrated(struct Pokemon *party, int firstId, int lastId,
}

// Check for mon with resistance and super effective move for best type matchup mon with effective move
if (aiMove != MOVE_NONE && !IS_MOVE_STATUS(aiMove))
if (aiMove != MOVE_NONE && !IsBattleMoveStatus(aiMove))
{
if (typeMatchup < bestResistEffective)
{
Expand Down
Loading
Loading