fix mirror armor setstatchanger, handle reflected stat blockage

This commit is contained in:
ghoulslash 2021-11-02 12:02:58 -04:00
parent ffcba355b0
commit 592a1dab63
2 changed files with 3 additions and 1 deletions

View File

@ -2894,7 +2894,7 @@ BattleScript_MirrorArmorReflect::
call BattleScript_AbilityPopUp
jumpifsubstituteblocks BattleScript_AbilityNoSpecificStatLoss
BattleScript_MirrorArmorReflectStatLoss:
statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_NOT_PROTECT_AFFECTED, BattleScript_MirrorArmorReflectWontFall
statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_NOT_PROTECT_AFFECTED | STAT_BUFF_ALLOW_PTR, BattleScript_MirrorArmorReflectEnd
jumpifbyte CMP_LESS_THAN, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_DECREASE, BattleScript_MirrorArmorReflectAnim
goto BattleScript_MirrorArmorReflectWontFall
BattleScript_MirrorArmorReflectAnim:

View File

@ -9689,10 +9689,12 @@ static u32 ChangeStatBuffs(s8 statValue, u32 statId, u32 flags, const u8 *BS_ptr
{
if (flags == STAT_BUFF_ALLOW_PTR)
{
SET_STATCHANGER(statId, GET_STAT_BUFF_VALUE(statValue) | STAT_BUFF_NEGATIVE, TRUE);
BattleScriptPush(BS_ptr);
gBattleScripting.battler = gActiveBattler;
gBattlerAbility = gActiveBattler;
gBattlescriptCurrInstr = BattleScript_MirrorArmorReflect;
RecordAbilityBattle(gActiveBattler, gBattleMons[gActiveBattler].ability);
}
return STAT_CHANGE_DIDNT_WORK;
}