mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-11-17 20:17:38 +01:00
remove duplicate non-user check
This commit is contained in:
parent
18f5d9f0a3
commit
b9e425252d
@ -545,22 +545,20 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score)
|
|||||||
{
|
{
|
||||||
score -= 10;
|
score -= 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// check off screen
|
||||||
|
if (gStatuses3[battlerDef] & STATUS3_SEMI_INVULNERABLE && GetWhoStrikesFirst(battlerAtk, battlerDef, TRUE) != 1)
|
||||||
|
RETURN_SCORE_MINUS(20); // if target off screen and we go first, don't use move
|
||||||
|
|
||||||
// check if negates type
|
// check if negates type
|
||||||
if (!(gBattleMoves[move].target & MOVE_TARGET_USER))
|
switch (effectiveness)
|
||||||
{
|
{
|
||||||
if (gStatuses3[battlerDef] & STATUS3_SEMI_INVULNERABLE && GetWhoStrikesFirst(battlerAtk, battlerDef, TRUE) != 1)
|
case AI_EFFECTIVENESS_x0:
|
||||||
RETURN_SCORE_MINUS(20); // if target off screen and we go first, don't use move
|
RETURN_SCORE_MINUS(20);
|
||||||
|
break;
|
||||||
switch (effectiveness)
|
case AI_EFFECTIVENESS_x0_25:
|
||||||
{
|
RETURN_SCORE_MINUS(10);
|
||||||
case AI_EFFECTIVENESS_x0:
|
break;
|
||||||
RETURN_SCORE_MINUS(20);
|
|
||||||
break;
|
|
||||||
case AI_EFFECTIVENESS_x0_25:
|
|
||||||
RETURN_SCORE_MINUS(10);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// target ability checks
|
// target ability checks
|
||||||
@ -2422,7 +2420,7 @@ static s16 AI_TryToFaint(u8 battlerAtk, u8 battlerDef, u16 move, s16 score)
|
|||||||
{
|
{
|
||||||
// this move can faint the target
|
// this move can faint the target
|
||||||
if (GetWhoStrikesFirst(battlerAtk, battlerDef, TRUE) == 0 || GetMovePriority(battlerAtk, move) > 0)
|
if (GetWhoStrikesFirst(battlerAtk, battlerDef, TRUE) == 0 || GetMovePriority(battlerAtk, move) > 0)
|
||||||
score += 4;
|
score += 4; // we go first or we're using priority move
|
||||||
else
|
else
|
||||||
score += 2;
|
score += 2;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user