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

Battle Dome point assignment based on move data #3230

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 0 additions & 2 deletions include/battle_ai_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ bool32 HasMoveEffect(u32 battlerId, u16 moveEffect);
bool32 HasMoveWithLowAccuracy(u8, u8, u8, bool32, u16, u16, u16, u16);
bool32 IsAromaVeilProtectedMove(u16 move);
bool32 IsNonVolatileStatusMoveEffect(u16 moveEffect);
bool32 IsStatLoweringMoveEffect(u16 moveEffect);
bool32 IsMoveRedirectionPrevented(u16 move, u16 atkAbility);
bool32 IsMoveEncouragedToHit(u8 battlerAtk, u8 battlerDef, u16 move);
bool32 IsHazardMoveEffect(u16 moveEffect);
Expand All @@ -123,7 +122,6 @@ bool32 ShouldFakeOut(u8 battlerAtk, u8 battlerDef, u16 move);
bool32 HasThawingMove(u8 battler);
bool32 IsStatRaisingEffect(u16 effect);
bool32 IsStatLoweringEffect(u16 effect);
bool32 IsStatRaisingEffect(u16 effect);
bool32 IsAttackBoostMoveEffect(u16 effect);
bool32 IsUngroundingEffect(u16 effect);
bool32 IsSemiInvulnerable(u8 battlerDef, u16 move);
Expand Down
2 changes: 1 addition & 1 deletion include/constants/battle_dome.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
#define MOVE_POINTS_POWERFUL 10 // Most of the moves that are >= 100 power
#define MOVE_POINTS_POPULAR 11 // Group seems arbitrary. All using it are TM/HMs, but its only 11/58
#define MOVE_POINTS_LUCK 12
#define MOVE_POINTS_STRONG 13 // Most of the moves that are >= 90 power
#define MOVE_POINTS_STRONG 13 // Moves that are >= 90 power
#define MOVE_POINTS_LOW_PP 14
#define MOVE_POINTS_EFFECT 15 // Moves with additional effects
#define NUM_MOVE_POINT_TYPES 16
Expand Down
10 changes: 5 additions & 5 deletions src/battle_ai_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -809,21 +809,21 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score)
RETURN_SCORE_MINUS(10);
break;
case ABILITY_FLOWER_VEIL:
if (IS_BATTLER_OF_TYPE(battlerDef, TYPE_GRASS) && (IsNonVolatileStatusMoveEffect(moveEffect) || IsStatLoweringMoveEffect(moveEffect)))
if (IS_BATTLER_OF_TYPE(battlerDef, TYPE_GRASS) && (IsNonVolatileStatusMoveEffect(moveEffect) || IsStatLoweringEffect(moveEffect)))
RETURN_SCORE_MINUS(10);
break;
case ABILITY_MAGIC_BOUNCE:
if (gBattleMoves[move].magicCoatAffected)
RETURN_SCORE_MINUS(20);
break;
case ABILITY_CONTRARY:
if (IsStatLoweringMoveEffect(moveEffect))
if (IsStatLoweringEffect(moveEffect))
RETURN_SCORE_MINUS(20);
break;
case ABILITY_CLEAR_BODY:
case ABILITY_FULL_METAL_BODY:
case ABILITY_WHITE_SMOKE:
if (IsStatLoweringMoveEffect(moveEffect))
if (IsStatLoweringEffect(moveEffect))
RETURN_SCORE_MINUS(10);
break;
case ABILITY_HYPER_CUTTER:
Expand All @@ -841,7 +841,7 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score)
break;
case ABILITY_DEFIANT:
case ABILITY_COMPETITIVE:
if (IsStatLoweringMoveEffect(moveEffect) && !IsTargetingPartner(battlerAtk, battlerDef))
if (IsStatLoweringEffect(moveEffect) && !IsTargetingPartner(battlerAtk, battlerDef))
RETURN_SCORE_MINUS(8);
break;
case ABILITY_COMATOSE:
Expand Down Expand Up @@ -882,7 +882,7 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score)
RETURN_SCORE_MINUS(20);
break;
case ABILITY_FLOWER_VEIL:
if ((IS_BATTLER_OF_TYPE(battlerDef, TYPE_GRASS)) && (IsNonVolatileStatusMoveEffect(moveEffect) || IsStatLoweringMoveEffect(moveEffect)))
if ((IS_BATTLER_OF_TYPE(battlerDef, TYPE_GRASS)) && (IsNonVolatileStatusMoveEffect(moveEffect) || IsStatLoweringEffect(moveEffect)))
RETURN_SCORE_MINUS(10);
break;
case ABILITY_AROMA_VEIL:
Expand Down
24 changes: 0 additions & 24 deletions src/battle_ai_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -1404,30 +1404,6 @@ bool32 IsConfusionMoveEffect(u16 moveEffect)
}
}

bool32 IsStatLoweringMoveEffect(u16 moveEffect)
{
switch (moveEffect)
{
case EFFECT_ATTACK_DOWN:
case EFFECT_DEFENSE_DOWN:
case EFFECT_SPEED_DOWN:
case EFFECT_SPECIAL_ATTACK_DOWN:
case EFFECT_SPECIAL_DEFENSE_DOWN:
case EFFECT_ACCURACY_DOWN:
case EFFECT_EVASION_DOWN:
case EFFECT_ATTACK_DOWN_2:
case EFFECT_DEFENSE_DOWN_2:
case EFFECT_SPEED_DOWN_2:
case EFFECT_SPECIAL_ATTACK_DOWN_2:
case EFFECT_SPECIAL_DEFENSE_DOWN_2:
case EFFECT_ACCURACY_DOWN_2:
case EFFECT_EVASION_DOWN_2:
return TRUE;
default:
return FALSE;
}
}

bool32 IsHazardMoveEffect(u16 moveEffect)
{
switch (moveEffect)
Expand Down
Loading
Loading