Removes redundant Decorate check (#5696)

This commit is contained in:
Alex 2024-11-21 06:13:31 +01:00 committed by GitHub
parent 81442e32e2
commit 3cc048cc01
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 23 additions and 18 deletions

View file

@ -8571,15 +8571,6 @@ bool32 IsMoveMakingContact(u32 move, u32 battlerAtk)
bool32 IsBattlerProtected(u32 battlerAtk, u32 battlerDef, u32 move)
{
// Decorate bypasses protect and detect, but not crafty shield
if (move == MOVE_DECORATE)
{
if (gSideStatuses[GetBattlerSide(battlerDef)] & SIDE_STATUS_CRAFTY_SHIELD)
return TRUE;
else if (gProtectStructs[battlerDef].protected)
return FALSE;
}
// Z-Moves and Max Moves bypass protection (except Max Guard).
if ((IsZMove(move) || IsMaxMove(move))
&& (!gProtectStructs[battlerDef].maxGuarded

View file

@ -103,7 +103,7 @@ SINGLE_BATTLE_TEST("King's Shield, Silk Trap and Obstruct protect from damaging
MESSAGE("Wobbuffet's Attack fell!");
#else
MESSAGE("Wobbuffet's Attack harshly fell!");
#endif
#endif
} else if (statId == STAT_SPEED) {
MESSAGE("Wobbuffet's Speed fell!");
} else if (statId == STAT_DEF) {
@ -487,36 +487,49 @@ DOUBLE_BATTLE_TEST("Crafty Shield protects self and ally from status moves")
}
}
SINGLE_BATTLE_TEST("Protect does not block Confide")
SINGLE_BATTLE_TEST("Protect does not block Confide or Decorate")
{
u32 move;
PARAMETRIZE { move = MOVE_CONFIDE; }
PARAMETRIZE { move = MOVE_DECORATE; }
GIVEN {
ASSUME(gMovesInfo[MOVE_CONFIDE].effect == EFFECT_SPECIAL_ATTACK_DOWN);
ASSUME(gMovesInfo[MOVE_CONFIDE].ignoresProtect == TRUE);
ASSUME(gMovesInfo[MOVE_DECORATE].effect == EFFECT_DECORATE);
ASSUME(gMovesInfo[MOVE_DECORATE].ignoresProtect == TRUE);
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(opponent, MOVE_PROTECT); MOVE(player, MOVE_CONFIDE); }
TURN { MOVE(opponent, MOVE_PROTECT); MOVE(player, move); }
} SCENE {
MESSAGE("Wobbuffet used Confide!");
ANIMATION(ANIM_TYPE_MOVE, MOVE_CONFIDE, player);
ANIMATION(ANIM_TYPE_MOVE, move, player);
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, opponent);
NOT MESSAGE("The opposing Wobbuffet protected itself!");
}
}
DOUBLE_BATTLE_TEST("Crafty Shield protects self and ally from Confide")
DOUBLE_BATTLE_TEST("Crafty Shield protects self and ally from Confide and Decorate")
{
u32 move;
PARAMETRIZE { move = MOVE_CONFIDE; }
PARAMETRIZE { move = MOVE_DECORATE; }
GIVEN {
ASSUME(gMovesInfo[MOVE_CONFIDE].effect == EFFECT_SPECIAL_ATTACK_DOWN);
ASSUME(gMovesInfo[MOVE_CONFIDE].ignoresProtect == TRUE);
ASSUME(gMovesInfo[MOVE_DECORATE].effect == EFFECT_DECORATE);
ASSUME(gMovesInfo[MOVE_DECORATE].ignoresProtect == TRUE);
PLAYER(SPECIES_WOBBUFFET);
PLAYER(SPECIES_WYNAUT);
OPPONENT(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WYNAUT);
} WHEN {
TURN { MOVE(opponentLeft, MOVE_CRAFTY_SHIELD); MOVE(playerLeft, MOVE_CONFIDE, target: opponentLeft); MOVE(playerRight, MOVE_CONFIDE, target: opponentRight); }
TURN { MOVE(opponentLeft, MOVE_CRAFTY_SHIELD); MOVE(playerLeft, move, target: opponentLeft); MOVE(playerRight, move, target: opponentRight); }
} SCENE {
MESSAGE("Wobbuffet used Confide!");
NOT ANIMATION(ANIM_TYPE_MOVE, move, playerLeft);
MESSAGE("The opposing Wobbuffet protected itself!");
MESSAGE("Wynaut used Confide!");
NOT ANIMATION(ANIM_TYPE_MOVE, move, playerRight);
MESSAGE("The opposing Wynaut protected itself!");
}
}
@ -570,3 +583,4 @@ SINGLE_BATTLE_TEST("Spiky Shield does not damage users on Counter or Mirror Coat
}
}
}