mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-12-26 11:44:17 +01:00
Fix Mirror Armor against Clear Body
This commit is contained in:
parent
5d958e245a
commit
0577d8d04d
@ -3584,7 +3584,7 @@ BattleScript_MirrorArmorReflect::
|
|||||||
call BattleScript_AbilityPopUp
|
call BattleScript_AbilityPopUp
|
||||||
jumpifsubstituteblocks BattleScript_AbilityNoSpecificStatLoss
|
jumpifsubstituteblocks BattleScript_AbilityNoSpecificStatLoss
|
||||||
BattleScript_MirrorArmorReflectStatLoss:
|
BattleScript_MirrorArmorReflectStatLoss:
|
||||||
statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_CHANGE_NOT_PROTECT_AFFECTED | STAT_CHANGE_ALLOW_PTR, BattleScript_MirrorArmorReflectEnd
|
statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_CHANGE_MIRROR_ARMOR | STAT_CHANGE_NOT_PROTECT_AFFECTED | STAT_CHANGE_ALLOW_PTR, BattleScript_MirrorArmorReflectEnd
|
||||||
jumpifbyte CMP_LESS_THAN, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_DECREASE, BattleScript_MirrorArmorReflectAnim
|
jumpifbyte CMP_LESS_THAN, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_DECREASE, BattleScript_MirrorArmorReflectAnim
|
||||||
goto BattleScript_MirrorArmorReflectWontFall
|
goto BattleScript_MirrorArmorReflectWontFall
|
||||||
BattleScript_MirrorArmorReflectAnim:
|
BattleScript_MirrorArmorReflectAnim:
|
||||||
|
@ -273,6 +273,7 @@
|
|||||||
|
|
||||||
// Cmd_statbuffchange
|
// Cmd_statbuffchange
|
||||||
#define STAT_CHANGE_ALLOW_PTR (1 << 0) // If set, allow use of jumpptr. Set in every use of statbuffchange
|
#define STAT_CHANGE_ALLOW_PTR (1 << 0) // If set, allow use of jumpptr. Set in every use of statbuffchange
|
||||||
|
#define STAT_CHANGE_MIRROR_ARMOR (1 << 1) // Stat change redirection caused by Mirror Armor ability.
|
||||||
#define STAT_CHANGE_NOT_PROTECT_AFFECTED (1 << 5)
|
#define STAT_CHANGE_NOT_PROTECT_AFFECTED (1 << 5)
|
||||||
#define STAT_CHANGE_UPDATE_MOVE_EFFECT (1 << 6)
|
#define STAT_CHANGE_UPDATE_MOVE_EFFECT (1 << 6)
|
||||||
|
|
||||||
|
@ -10877,8 +10877,9 @@ static u32 ChangeStatBuffs(s8 statValue, u32 statId, u32 flags, const u8 *BS_ptr
|
|||||||
bool32 certain = FALSE;
|
bool32 certain = FALSE;
|
||||||
bool32 notProtectAffected = FALSE;
|
bool32 notProtectAffected = FALSE;
|
||||||
u32 index;
|
u32 index;
|
||||||
bool32 affectsUser = (flags & MOVE_EFFECT_AFFECTS_USER);
|
|
||||||
u16 activeBattlerAbility;
|
u16 activeBattlerAbility;
|
||||||
|
bool32 affectsUser = (flags & MOVE_EFFECT_AFFECTS_USER);
|
||||||
|
bool32 mirrorArmored = (flags & STAT_CHANGE_MIRROR_ARMOR);
|
||||||
|
|
||||||
if (affectsUser)
|
if (affectsUser)
|
||||||
gActiveBattler = gBattlerAttacker;
|
gActiveBattler = gBattlerAttacker;
|
||||||
@ -10889,10 +10890,10 @@ static u32 ChangeStatBuffs(s8 statValue, u32 statId, u32 flags, const u8 *BS_ptr
|
|||||||
|
|
||||||
gSpecialStatuses[gActiveBattler].changedStatsBattlerId = gBattlerAttacker;
|
gSpecialStatuses[gActiveBattler].changedStatsBattlerId = gBattlerAttacker;
|
||||||
|
|
||||||
flags &= ~MOVE_EFFECT_AFFECTS_USER;
|
flags &= ~(MOVE_EFFECT_AFFECTS_USER | STAT_CHANGE_MIRROR_ARMOR);
|
||||||
|
|
||||||
if (flags & MOVE_EFFECT_CERTAIN)
|
if (flags & MOVE_EFFECT_CERTAIN)
|
||||||
certain++;
|
certain = TRUE;
|
||||||
flags &= ~MOVE_EFFECT_CERTAIN;
|
flags &= ~MOVE_EFFECT_CERTAIN;
|
||||||
|
|
||||||
if (flags & STAT_CHANGE_NOT_PROTECT_AFFECTED)
|
if (flags & STAT_CHANGE_NOT_PROTECT_AFFECTED)
|
||||||
@ -10948,7 +10949,7 @@ static u32 ChangeStatBuffs(s8 statValue, u32 statId, u32 flags, const u8 *BS_ptr
|
|||||||
|| activeBattlerAbility == ABILITY_CLEAR_BODY
|
|| activeBattlerAbility == ABILITY_CLEAR_BODY
|
||||||
|| activeBattlerAbility == ABILITY_FULL_METAL_BODY
|
|| activeBattlerAbility == ABILITY_FULL_METAL_BODY
|
||||||
|| activeBattlerAbility == ABILITY_WHITE_SMOKE)
|
|| activeBattlerAbility == ABILITY_WHITE_SMOKE)
|
||||||
&& !affectsUser && !certain && gCurrentMove != MOVE_CURSE)
|
&& (!affectsUser || mirrorArmored) && !certain && gCurrentMove != MOVE_CURSE)
|
||||||
{
|
{
|
||||||
if (GetBattlerHoldEffect(gActiveBattler, TRUE) == HOLD_EFFECT_CLEAR_AMULET)
|
if (GetBattlerHoldEffect(gActiveBattler, TRUE) == HOLD_EFFECT_CLEAR_AMULET)
|
||||||
{
|
{
|
||||||
@ -11010,7 +11011,7 @@ static u32 ChangeStatBuffs(s8 statValue, u32 statId, u32 flags, const u8 *BS_ptr
|
|||||||
}
|
}
|
||||||
return STAT_CHANGE_DIDNT_WORK;
|
return STAT_CHANGE_DIDNT_WORK;
|
||||||
}
|
}
|
||||||
else if (activeBattlerAbility == ABILITY_MIRROR_ARMOR && !affectsUser && gBattlerAttacker != gBattlerTarget && gActiveBattler == gBattlerTarget)
|
else if (activeBattlerAbility == ABILITY_MIRROR_ARMOR && !affectsUser && !mirrorArmored && gBattlerAttacker != gBattlerTarget && gActiveBattler == gBattlerTarget)
|
||||||
{
|
{
|
||||||
if (flags == STAT_CHANGE_ALLOW_PTR)
|
if (flags == STAT_CHANGE_ALLOW_PTR)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user