mirror of
https://github.com/pret/pokeemerald.git
synced 2026-04-26 01:19:29 -05:00
Fixes Suction Cups ability popup and Red Card + Guard Dog interaction (#6171)
This commit is contained in:
parent
fe41f9eaf5
commit
5238665a7a
|
|
@ -8253,15 +8253,12 @@ BattleScript_FlashFireBoost::
|
|||
goto BattleScript_MoveEnd
|
||||
|
||||
BattleScript_AbilityPreventsPhasingOut::
|
||||
pause B_WAIT_TIME_SHORT
|
||||
call BattleScript_AbilityPopUp
|
||||
printstring STRINGID_PKMNANCHORSITSELFWITH
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
call BattleScript_AbilityPreventsPhasingOutRet
|
||||
goto BattleScript_MoveEnd
|
||||
|
||||
BattleScript_AbilityPreventsPhasingOutRet::
|
||||
pause B_WAIT_TIME_SHORT
|
||||
call BattleScript_AbilityPopUp
|
||||
call BattleScript_AbilityPopUpTarget
|
||||
printstring STRINGID_PKMNANCHORSITSELFWITH
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
return
|
||||
|
|
|
|||
|
|
@ -6566,8 +6566,7 @@ static void Cmd_moveend(void)
|
|||
if (redCardBattlers
|
||||
&& (gMovesInfo[gCurrentMove].effect != EFFECT_HIT_SWITCH_TARGET || gBattleStruct->hitSwitchTargetFailed)
|
||||
&& IsBattlerAlive(gBattlerAttacker)
|
||||
&& !TestIfSheerForceAffected(gBattlerAttacker, gCurrentMove)
|
||||
&& GetBattlerAbility(gBattlerAttacker) != ABILITY_GUARD_DOG)
|
||||
&& !TestIfSheerForceAffected(gBattlerAttacker, gCurrentMove))
|
||||
{
|
||||
// Since we check if battler was damaged, we don't need to check move result.
|
||||
// In fact, doing so actually prevents multi-target moves from activating red card properly
|
||||
|
|
@ -6592,7 +6591,8 @@ static void Cmd_moveend(void)
|
|||
if (gMovesInfo[gCurrentMove].effect == EFFECT_HIT_ESCAPE)
|
||||
gBattlescriptCurrInstr = BattleScript_MoveEnd; // Prevent user switch-in selection
|
||||
BattleScriptPushCursor();
|
||||
if (gBattleStruct->commanderActive[gBattlerAttacker] != SPECIES_NONE)
|
||||
if (gBattleStruct->commanderActive[gBattlerAttacker] != SPECIES_NONE
|
||||
|| GetBattlerAbility(gBattlerAttacker) == ABILITY_GUARD_DOG)
|
||||
{
|
||||
gBattlescriptCurrInstr = BattleScript_RedCardActivationNoSwitch;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -273,12 +273,13 @@ DOUBLE_BATTLE_TEST("Red Card activates but fails if the attacker is rooted")
|
|||
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, playerLeft);
|
||||
MESSAGE("Wobbuffet held up its Red Card against the opposing Wobbuffet!");
|
||||
MESSAGE("The opposing Wobbuffet anchored itself with its roots!");
|
||||
NOT MESSAGE("The opposing Unown was dragged out!");
|
||||
|
||||
// Red Card already consumed so cannot activate.
|
||||
ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, opponentRight);
|
||||
NONE_OF {
|
||||
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, playerRight);
|
||||
MESSAGE("Wynaut held up its Red Card against the opposing Wynaut!");
|
||||
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, playerLeft);
|
||||
MESSAGE("Wobbuffet held up its Red Card against the opposing Wynaut!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -301,12 +302,41 @@ DOUBLE_BATTLE_TEST("Red Card activates but fails if the attacker has Suction Cup
|
|||
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, playerLeft);
|
||||
MESSAGE("Wobbuffet held up its Red Card against the opposing Octillery!");
|
||||
MESSAGE("The opposing Octillery anchors itself with Suction Cups!");
|
||||
NOT MESSAGE("The opposing Unown was dragged out!");
|
||||
|
||||
// Red Card already consumed so cannot activate.
|
||||
ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, opponentRight);
|
||||
NONE_OF {
|
||||
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, playerRight);
|
||||
MESSAGE("Wynaut held up its Red Card against the opposing Wynaut!");
|
||||
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, playerLeft);
|
||||
MESSAGE("Wobbuffet held up its Red Card against the opposing Wynaut!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
DOUBLE_BATTLE_TEST("Red Card activates but fails if the attacker has Guard Dog")
|
||||
{
|
||||
GIVEN {
|
||||
PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_RED_CARD); }
|
||||
PLAYER(SPECIES_WYNAUT);
|
||||
OPPONENT(SPECIES_OKIDOGI) { Ability(ABILITY_GUARD_DOG); }
|
||||
OPPONENT(SPECIES_WYNAUT);
|
||||
OPPONENT(SPECIES_UNOWN);
|
||||
} WHEN {
|
||||
TURN {
|
||||
MOVE(opponentLeft, MOVE_TACKLE, target: playerLeft);
|
||||
MOVE(opponentRight, MOVE_TACKLE, target: playerLeft);
|
||||
}
|
||||
} SCENE {
|
||||
ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, opponentLeft);
|
||||
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, playerLeft);
|
||||
MESSAGE("Wobbuffet held up its Red Card against the opposing Okidogi!");
|
||||
NOT MESSAGE("The opposing Unown was dragged out!");
|
||||
|
||||
// Red Card already consumed so cannot activate.
|
||||
ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, opponentRight);
|
||||
NONE_OF {
|
||||
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, playerLeft);
|
||||
MESSAGE("Wobbuffet held up its Red Card against the opposing Wynaut!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ SINGLE_BATTLE_TEST("Dragon Tail switches the target after Rocky Helmet and Iron
|
|||
}
|
||||
}
|
||||
|
||||
SINGLE_BATTLE_TEST("Dragon Tail effect will fails against Guard Dog ability")
|
||||
SINGLE_BATTLE_TEST("Dragon Tail effect fails against target with Guard Dog")
|
||||
{
|
||||
GIVEN {
|
||||
PLAYER(SPECIES_WOBBUFFET);
|
||||
|
|
@ -104,7 +104,7 @@ SINGLE_BATTLE_TEST("Dragon Tail effect will fails against Guard Dog ability")
|
|||
}
|
||||
}
|
||||
|
||||
SINGLE_BATTLE_TEST("Dragon Tail effect will fails against Suction Cups ability")
|
||||
SINGLE_BATTLE_TEST("Dragon Tail effect fails against target with Suction Cups")
|
||||
{
|
||||
GIVEN {
|
||||
PLAYER(SPECIES_WOBBUFFET);
|
||||
|
|
@ -114,6 +114,7 @@ SINGLE_BATTLE_TEST("Dragon Tail effect will fails against Suction Cups ability")
|
|||
TURN { MOVE(player, MOVE_DRAGON_TAIL); }
|
||||
} SCENE {
|
||||
ANIMATION(ANIM_TYPE_MOVE, MOVE_DRAGON_TAIL, player);
|
||||
ABILITY_POPUP(opponent, ABILITY_SUCTION_CUPS);
|
||||
MESSAGE("The opposing Octillery anchors itself with Suction Cups!");
|
||||
NOT MESSAGE("The opposing Charmander was dragged out!");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -68,3 +68,38 @@ SINGLE_BATTLE_TEST("Roar fails if replacements fainted")
|
|||
MESSAGE("But it failed!");
|
||||
}
|
||||
}
|
||||
|
||||
SINGLE_BATTLE_TEST("Roar fails against target with Guard Dog")
|
||||
{
|
||||
GIVEN {
|
||||
PLAYER(SPECIES_WOBBUFFET);
|
||||
OPPONENT(SPECIES_OKIDOGI) { Ability(ABILITY_GUARD_DOG); }
|
||||
OPPONENT(SPECIES_CHARMANDER);
|
||||
} WHEN {
|
||||
TURN { MOVE(player, MOVE_ROAR); }
|
||||
} SCENE {
|
||||
NONE_OF {
|
||||
ANIMATION(ANIM_TYPE_MOVE, MOVE_ROAR, player);
|
||||
MESSAGE("The opposing Charmander was dragged out!");
|
||||
}
|
||||
MESSAGE("Wobbuffet used Roar!");
|
||||
MESSAGE("But it failed!");
|
||||
}
|
||||
}
|
||||
|
||||
SINGLE_BATTLE_TEST("Roar fails to switch out target with Suction Cups")
|
||||
{
|
||||
GIVEN {
|
||||
PLAYER(SPECIES_WOBBUFFET);
|
||||
OPPONENT(SPECIES_OCTILLERY) { Ability(ABILITY_SUCTION_CUPS); }
|
||||
OPPONENT(SPECIES_CHARMANDER);
|
||||
} WHEN {
|
||||
TURN { MOVE(player, MOVE_ROAR); }
|
||||
} SCENE {
|
||||
MESSAGE("Wobbuffet used Roar!");
|
||||
NOT ANIMATION(ANIM_TYPE_MOVE, MOVE_ROAR, player);
|
||||
ABILITY_POPUP(opponent, ABILITY_SUCTION_CUPS);
|
||||
MESSAGE("The opposing Octillery anchors itself with Suction Cups!");
|
||||
NOT MESSAGE("The opposing Charmander was dragged out!");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user