Merge pull request #1889 from ghoulslash/be/brickbreak

Update Brick Break with config
This commit is contained in:
Eduardo Quezada D'Ottone 2021-11-12 19:03:43 -03:00 committed by GitHub
commit 45fcb50e09
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 26 additions and 7 deletions

View file

@ -152,6 +152,7 @@
#define B_MEMENTO_FAIL GEN_7 // In Gen4+, Memento fails if there is no target or if the target is protected or behind substitute. But not if Atk/Sp. Atk are at -6.
#define B_GLARE_GHOST GEN_7 // In Gen4+, Glare can hit Ghost-type Pokémon normally.
#define B_SKILL_SWAP GEN_7 // In Gen4+, Skill Swap triggers switch-in abilities after use.
#define B_BRICK_BREAK GEN_7 // In Gen4+, you can destroy your own side's screens. In Gen 5+, screens are not removed if the target is immune.
// Ability settings
#define B_ABILITY_WEATHER GEN_7 // In Gen6+, ability-induced weather lasts 5 turns. Before, it lasted until the battle ended or until it was changed by a move or a different weather-affecting ability.

View file

@ -13103,14 +13103,32 @@ static void Cmd_snatchsetbattlers(void)
static void Cmd_removelightscreenreflect(void) // brick break
{
u8 opposingSide = GetBattlerSide(gBattlerAttacker) ^ BIT_SIDE;
if (gSideTimers[opposingSide].reflectTimer || gSideTimers[opposingSide].lightscreenTimer)
u8 side;
bool32 failed;
#if B_BRICK_BREAK >= GEN_4
side = GetBattlerSide(gBattlerAttacker);
#else
side = GetBattlerSide(gBattlerAttacker) ^ BIT_SIDE;
#endif
#if B_BRICK_BREAK >= GEN_5
failed = (gMoveResultFlags & MOVE_RESULT_NO_EFFECT);
#else
failed = FALSE;
#endif
if (!failed
&& (gSideTimers[side].reflectTimer
|| gSideTimers[side].lightscreenTimer
|| gSideTimers[side].auroraVeilTimer))
{
gSideStatuses[opposingSide] &= ~(SIDE_STATUS_REFLECT);
gSideStatuses[opposingSide] &= ~(SIDE_STATUS_LIGHTSCREEN);
gSideTimers[opposingSide].reflectTimer = 0;
gSideTimers[opposingSide].lightscreenTimer = 0;
gSideStatuses[side] &= ~(SIDE_STATUS_REFLECT);
gSideStatuses[side] &= ~(SIDE_STATUS_LIGHTSCREEN);
gSideStatuses[side] &= ~(SIDE_STATUS_AURORA_VEIL);
gSideTimers[side].reflectTimer = 0;
gSideTimers[side].lightscreenTimer = 0;
gSideTimers[side].auroraVeilTimer = 0;
gBattleScripting.animTurn = 1;
gBattleScripting.animTargetsHit = 1;
}