mirror of
https://github.com/rh-hideout/pokeemerald-expansion.git
synced 2026-04-26 10:25:49 -05:00
Prevent Coaching score inflation in certain circumstances. (#9154)
This commit is contained in:
parent
1c5ea66878
commit
318baaa5aa
|
|
@ -3318,10 +3318,35 @@ static s32 AI_DoubleBattle(enum BattlerId battlerAtk, enum BattlerId battlerDef,
|
|||
}
|
||||
else
|
||||
{
|
||||
ADJUST_SCORE(IncreaseStatUpScore(battlerAtkPartner, BATTLE_OPPOSITE(battlerAtk), STAT_CHANGE_ATK));
|
||||
ADJUST_SCORE(IncreaseStatUpScore(battlerAtkPartner, BATTLE_OPPOSITE(battlerAtk), STAT_CHANGE_DEF));
|
||||
ADJUST_SCORE(IncreaseStatUpScore(battlerAtkPartner, BATTLE_OPPOSITE(battlerAtkPartner), STAT_CHANGE_ATK));
|
||||
ADJUST_SCORE(IncreaseStatUpScore(battlerAtkPartner, BATTLE_OPPOSITE(battlerAtkPartner), STAT_CHANGE_DEF));
|
||||
s32 statUpScore = 0;
|
||||
s32 tempScore = 0;
|
||||
enum BattlerId foe = LEFT_FOE(battlerAtk);
|
||||
|
||||
if (IsBattlerAlive(foe))
|
||||
{
|
||||
tempScore += IncreaseStatUpScore(battlerAtkPartner, foe, STAT_CHANGE_ATK);
|
||||
tempScore += IncreaseStatUpScore(battlerAtkPartner, foe, STAT_CHANGE_DEF);
|
||||
if (tempScore == 0)
|
||||
break;
|
||||
statUpScore += tempScore;
|
||||
}
|
||||
|
||||
tempScore = 0;
|
||||
foe = RIGHT_FOE(battlerAtk);
|
||||
|
||||
if (IsBattlerAlive(foe))
|
||||
{
|
||||
tempScore += IncreaseStatUpScore(battlerAtkPartner, foe, STAT_CHANGE_ATK);
|
||||
tempScore += IncreaseStatUpScore(battlerAtkPartner, foe, STAT_CHANGE_DEF);
|
||||
if (tempScore == 0)
|
||||
break;
|
||||
statUpScore += tempScore;
|
||||
}
|
||||
|
||||
if (statUpScore > BEST_EFFECT)
|
||||
ADJUST_SCORE(BEST_EFFECT);
|
||||
else
|
||||
ADJUST_SCORE(statUpScore);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user