Fix Spiky Shield

This commit is contained in:
DizzyEggg 2019-03-30 11:50:55 +01:00
parent 876be1d9cd
commit ea0049da89

View file

@ -4180,11 +4180,11 @@ static void atk49_moveend(void)
{
s32 i;
bool32 effect = FALSE;
u8 moveType = 0;
u8 holdEffectAtk = 0;
u32 moveType = 0;
u32 holdEffectAtk = 0;
u16 *choicedMoveAtk = NULL;
u8 arg1, arg2;
u16 originallyUsedMove;
u32 arg1, arg2;
u32 originallyUsedMove;
if (gChosenMove == 0xFFFF)
originallyUsedMove = 0;
@ -4194,11 +4194,7 @@ static void atk49_moveend(void)
arg1 = gBattlescriptCurrInstr[1];
arg2 = gBattlescriptCurrInstr[2];
if (gBattleMons[gBattlerAttacker].item == ITEM_ENIGMA_BERRY)
holdEffectAtk = gEnigmaBerries[gBattlerAttacker].holdEffect;
else
holdEffectAtk = ItemId_GetHoldEffect(gBattleMons[gBattlerAttacker].item);
holdEffectAtk = GetBattlerHoldEffect(gBattlerAttacker, TRUE);
choicedMoveAtk = &gBattleStruct->choicedMove[gBattlerAttacker];
GET_MOVE_TYPE(gCurrentMove, moveType);
@ -4207,9 +4203,9 @@ static void atk49_moveend(void)
switch (gBattleScripting.atk49_state)
{
case ATK49_SPIKY_SHIELD:
if (gProtectStructs[gBattlerTarget].spikyShielded && gBattleMoves[gCurrentMove].flags & FLAG_MAKES_CONTACT)
{
if (!(GetBattlerAbility(gBattlerAttacker) == ABILITY_MAGIC_GUARD))
if (gProtectStructs[gBattlerTarget].spikyShielded
&& gBattleMoves[gCurrentMove].flags & FLAG_MAKES_CONTACT
&& GetBattlerAbility(gBattlerAttacker) != ABILITY_MAGIC_GUARD)
{
gMoveResultFlags &= ~(MOVE_RESULT_NO_EFFECT);
gBattleMoveDamage = gBattleMons[gBattlerAttacker].maxHP / 8;
@ -4220,7 +4216,6 @@ static void atk49_moveend(void)
gBattlescriptCurrInstr = BattleScript_SpikyShieldEffect;
effect = 1;
}
}
gBattleScripting.atk49_state++;
break;
case ATK49_RAGE: // rage check