mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-12-28 04:34:28 +01:00
Fix Defiant stat raise by allies
This commit is contained in:
parent
d1fb5fa148
commit
7018745230
@ -226,6 +226,7 @@ struct SpecialStatus
|
||||
s32 specialDmg;
|
||||
u8 physicalBattlerId;
|
||||
u8 specialBattlerId;
|
||||
u8 changedStatsBattlerId; // Battler that was responsible for the latest stat change. Can be self.
|
||||
};
|
||||
|
||||
struct SideTimer
|
||||
|
@ -7808,6 +7808,8 @@ static u32 ChangeStatBuffs(s8 statValue, u32 statId, u32 flags, const u8 *BS_ptr
|
||||
else
|
||||
gActiveBattler = gBattlerTarget;
|
||||
|
||||
gSpecialStatuses[gActiveBattler].changedStatsBattlerId = gBattlerAttacker;
|
||||
|
||||
flags &= ~(MOVE_EFFECT_AFFECTS_USER);
|
||||
|
||||
if (flags & MOVE_EFFECT_CERTAIN)
|
||||
|
@ -489,9 +489,10 @@ void PrepareStringBattle(u16 stringId, u8 battler)
|
||||
stringId = STRINGID_STATSWONTDECREASE2;
|
||||
|
||||
// Check Defiant and Competitive stat raise whenever a stat is lowered.
|
||||
else if (((GetBattlerAbility(gBattlerTarget) == ABILITY_DEFIANT && gBattleMons[gBattlerTarget].statStages[STAT_ATK] != 12)
|
||||
|| (GetBattlerAbility(gBattlerTarget) == ABILITY_COMPETITIVE && gBattleMons[gBattlerTarget].statStages[STAT_SPATK] != 12))
|
||||
&& stringId == STRINGID_PKMNSSTATCHANGED4)
|
||||
else if (stringId == STRINGID_PKMNSSTATCHANGED4
|
||||
&& ((GetBattlerAbility(gBattlerTarget) == ABILITY_DEFIANT && gBattleMons[gBattlerTarget].statStages[STAT_ATK] != 12)
|
||||
|| (GetBattlerAbility(gBattlerTarget) == ABILITY_COMPETITIVE && gBattleMons[gBattlerTarget].statStages[STAT_SPATK] != 12))
|
||||
&& gSpecialStatuses[gBattlerTarget].changedStatsBattlerId != BATTLE_PARTNER(gBattlerTarget))
|
||||
{
|
||||
gBattlerAbility = gBattlerTarget;
|
||||
BattleScriptPushCursor();
|
||||
|
Loading…
Reference in New Issue
Block a user