mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2025-03-06 07:27:47 +01:00
Fix Spiky Shield
This commit is contained in:
parent
876be1d9cd
commit
ea0049da89
@ -4180,11 +4180,11 @@ static void atk49_moveend(void)
|
|||||||
{
|
{
|
||||||
s32 i;
|
s32 i;
|
||||||
bool32 effect = FALSE;
|
bool32 effect = FALSE;
|
||||||
u8 moveType = 0;
|
u32 moveType = 0;
|
||||||
u8 holdEffectAtk = 0;
|
u32 holdEffectAtk = 0;
|
||||||
u16 *choicedMoveAtk = NULL;
|
u16 *choicedMoveAtk = NULL;
|
||||||
u8 arg1, arg2;
|
u32 arg1, arg2;
|
||||||
u16 originallyUsedMove;
|
u32 originallyUsedMove;
|
||||||
|
|
||||||
if (gChosenMove == 0xFFFF)
|
if (gChosenMove == 0xFFFF)
|
||||||
originallyUsedMove = 0;
|
originallyUsedMove = 0;
|
||||||
@ -4194,11 +4194,7 @@ static void atk49_moveend(void)
|
|||||||
arg1 = gBattlescriptCurrInstr[1];
|
arg1 = gBattlescriptCurrInstr[1];
|
||||||
arg2 = gBattlescriptCurrInstr[2];
|
arg2 = gBattlescriptCurrInstr[2];
|
||||||
|
|
||||||
if (gBattleMons[gBattlerAttacker].item == ITEM_ENIGMA_BERRY)
|
holdEffectAtk = GetBattlerHoldEffect(gBattlerAttacker, TRUE);
|
||||||
holdEffectAtk = gEnigmaBerries[gBattlerAttacker].holdEffect;
|
|
||||||
else
|
|
||||||
holdEffectAtk = ItemId_GetHoldEffect(gBattleMons[gBattlerAttacker].item);
|
|
||||||
|
|
||||||
choicedMoveAtk = &gBattleStruct->choicedMove[gBattlerAttacker];
|
choicedMoveAtk = &gBattleStruct->choicedMove[gBattlerAttacker];
|
||||||
GET_MOVE_TYPE(gCurrentMove, moveType);
|
GET_MOVE_TYPE(gCurrentMove, moveType);
|
||||||
|
|
||||||
@ -4207,19 +4203,18 @@ static void atk49_moveend(void)
|
|||||||
switch (gBattleScripting.atk49_state)
|
switch (gBattleScripting.atk49_state)
|
||||||
{
|
{
|
||||||
case ATK49_SPIKY_SHIELD:
|
case ATK49_SPIKY_SHIELD:
|
||||||
if (gProtectStructs[gBattlerTarget].spikyShielded && gBattleMoves[gCurrentMove].flags & FLAG_MAKES_CONTACT)
|
if (gProtectStructs[gBattlerTarget].spikyShielded
|
||||||
|
&& gBattleMoves[gCurrentMove].flags & FLAG_MAKES_CONTACT
|
||||||
|
&& GetBattlerAbility(gBattlerAttacker) != ABILITY_MAGIC_GUARD)
|
||||||
{
|
{
|
||||||
if (!(GetBattlerAbility(gBattlerAttacker) == ABILITY_MAGIC_GUARD))
|
gMoveResultFlags &= ~(MOVE_RESULT_NO_EFFECT);
|
||||||
{
|
gBattleMoveDamage = gBattleMons[gBattlerAttacker].maxHP / 8;
|
||||||
gMoveResultFlags &= ~(MOVE_RESULT_NO_EFFECT);
|
if (gBattleMoveDamage == 0)
|
||||||
gBattleMoveDamage = gBattleMons[gBattlerAttacker].maxHP / 8;
|
gBattleMoveDamage = 1;
|
||||||
if (gBattleMoveDamage == 0)
|
PREPARE_MOVE_BUFFER(gBattleTextBuff1, MOVE_SPIKY_SHIELD);
|
||||||
gBattleMoveDamage = 1;
|
BattleScriptPushCursor();
|
||||||
PREPARE_MOVE_BUFFER(gBattleTextBuff1, MOVE_SPIKY_SHIELD);
|
gBattlescriptCurrInstr = BattleScript_SpikyShieldEffect;
|
||||||
BattleScriptPushCursor();
|
effect = 1;
|
||||||
gBattlescriptCurrInstr = BattleScript_SpikyShieldEffect;
|
|
||||||
effect = 1;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
gBattleScripting.atk49_state++;
|
gBattleScripting.atk49_state++;
|
||||||
break;
|
break;
|
||||||
@ -9994,7 +9989,7 @@ static void atkD0_settaunt(void)
|
|||||||
u8 turns = 4;
|
u8 turns = 4;
|
||||||
if (GetBattlerTurnOrderNum(gBattlerTarget) > GetBattlerTurnOrderNum(gBattlerAttacker))
|
if (GetBattlerTurnOrderNum(gBattlerTarget) > GetBattlerTurnOrderNum(gBattlerAttacker))
|
||||||
turns--; // If the target hasn't yet moved this turn, Taunt lasts for only three turns (source: Bulbapedia)
|
turns--; // If the target hasn't yet moved this turn, Taunt lasts for only three turns (source: Bulbapedia)
|
||||||
|
|
||||||
gDisableStructs[gBattlerTarget].tauntTimer = gDisableStructs[gBattlerTarget].tauntTimer2 = turns;
|
gDisableStructs[gBattlerTarget].tauntTimer = gDisableStructs[gBattlerTarget].tauntTimer2 = turns;
|
||||||
gBattlescriptCurrInstr += 5;
|
gBattlescriptCurrInstr += 5;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user