Removes unnecessary checks for Shield Dust and Covert Cloak (#5073)

* Removes unnecessary checks for Shield Dust and Covert Cloak

* remove redundant include

* Update test/battle/ability/shield_dust.c

Co-authored-by: hedara90 <90hedara@gmail.com>

* Update test/battle/hold_effect/covert_cloak.c

Co-authored-by: hedara90 <90hedara@gmail.com>

---------

Co-authored-by: hedara90 <90hedara@gmail.com>
This commit is contained in:
Alex 2024-08-01 09:58:14 +02:00 committed by GitHub
parent e6175b5b84
commit de8002e9e0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 29 additions and 10 deletions

View file

@ -11704,16 +11704,6 @@ static u32 ChangeStatBuffs(s8 statValue, u32 statId, u32 flags, const u8 *BS_ptr
}
return STAT_CHANGE_DIDNT_WORK;
}
else if (battlerAbility == ABILITY_SHIELD_DUST && flags == 0)
{
RecordAbilityBattle(battler, ABILITY_SHIELD_DUST);
return STAT_CHANGE_DIDNT_WORK;
}
else if (flags == 0 && battlerHoldEffect == HOLD_EFFECT_COVERT_CLOAK)
{
RecordItemEffectBattle(battler, HOLD_EFFECT_COVERT_CLOAK);
return STAT_CHANGE_DIDNT_WORK;
}
else // try to decrease
{
statValue = -GET_STAT_BUFF_VALUE(statValue);

View file

@ -164,3 +164,15 @@ SINGLE_BATTLE_TEST("Shield Dust blocks Sparkling Aria in singles")
}
}
}
SINGLE_BATTLE_TEST("Shield Dust does not prevent ability stat changes")
{
GIVEN {
PLAYER(SPECIES_VIVILLON) { Ability(ABILITY_SHIELD_DUST); }
OPPONENT(SPECIES_ELDEGOSS) { Ability(ABILITY_COTTON_DOWN); }
} WHEN {
TURN { MOVE(player, MOVE_TACKLE); }
} SCENE {
MESSAGE("Vivillon's Speed fell!");
}
}

View file

@ -1,6 +1,11 @@
#include "global.h"
#include "test/battle.h"
ASSUMPTIONS
{
ASSUME(gItemsInfo[ITEM_COVERT_CLOAK].holdEffect == HOLD_EFFECT_COVERT_CLOAK);
}
SINGLE_BATTLE_TEST("Covert Cloak blocks secondary effects")
{
u16 move;
@ -162,3 +167,15 @@ SINGLE_BATTLE_TEST("Covert Cloak blocks Sparkling Aria in singles")
}
}
}
SINGLE_BATTLE_TEST("Covert Cloak does not prevent ability stat changes")
{
GIVEN {
PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_COVERT_CLOAK); }
OPPONENT(SPECIES_ELDEGOSS) { Ability(ABILITY_COTTON_DOWN); }
} WHEN {
TURN { MOVE(player, MOVE_TACKLE); }
} SCENE {
MESSAGE("Wobbuffet's Speed fell!");
}
}