sovereignx/test/battle/move_effect/knock_off.c
hedara90 ebdc9ffc39
Fixed some moves' on-hit effects bypassing Substitutes where they shouldn't and some other things discovered along the way (#4558)
* Fixed some moves' on-hit effects bypassing Substitutes where they shouldn't.
Fixed Sparkling Aria interaction with Shield Dust in Singles vs Doubles.
Fixed Wake-Up Slap and Smelling Salts getting boosted damage where they shouldn't vs Substitutes.

* Cleaned up check for Sparkling Aria+Shield Dust interaction and fixed for agbcc.
Fixed logic for checking if moves should do extra damage on statused targets.
Wrote tests for Wake-Up Slap and Smelling Salts receicing extra damage on statused targets.
Wrote tests to check Thousand Arrows type effectiveness vs ungrounded Flying types.

* Update src/battle_util.c

Co-authored-by: Alex <93446519+AlexOn1ine@users.noreply.github.com>

* Update src/battle_script_commands.c

Co-authored-by: Alex <93446519+AlexOn1ine@users.noreply.github.com>

* Update src/battle_script_commands.c

Co-authored-by: Alex <93446519+AlexOn1ine@users.noreply.github.com>

* Update test/battle/ability/shield_dust.c

Co-authored-by: Alex <93446519+AlexOn1ine@users.noreply.github.com>

* Update test/battle/item_effect/covert_cloak.c

Co-authored-by: Alex <93446519+AlexOn1ine@users.noreply.github.com>

* Update test/battle/item_effect/covert_cloak.c

Co-authored-by: Alex <93446519+AlexOn1ine@users.noreply.github.com>

* Update test/battle/item_effect/covert_cloak.c

Co-authored-by: Alex <93446519+AlexOn1ine@users.noreply.github.com>

* Update test/battle/move_effect/smelling_salts.c

Co-authored-by: Alex <93446519+AlexOn1ine@users.noreply.github.com>

* Update test/battle/move_effect/thousand_arrows.c

Co-authored-by: Alex <93446519+AlexOn1ine@users.noreply.github.com>

* Update test/battle/move_effect/wake_up_slap.c

Co-authored-by: Alex <93446519+AlexOn1ine@users.noreply.github.com>

* Update test/battle/move_effect/wake_up_slap.c

Co-authored-by: Alex <93446519+AlexOn1ine@users.noreply.github.com>

* Update test/battle/move_effect/wake_up_slap.c

Co-authored-by: Alex <93446519+AlexOn1ine@users.noreply.github.com>

---------

Co-authored-by: Hedara <hedara90@gmail.com>
Co-authored-by: Alex <93446519+AlexOn1ine@users.noreply.github.com>
2024-05-13 13:33:04 +02:00

65 lines
2.2 KiB
C

#include "global.h"
#include "test/battle.h"
ASSUMPTIONS
{
ASSUME(gMovesInfo[MOVE_KNOCK_OFF].effect == EFFECT_KNOCK_OFF);
}
SINGLE_BATTLE_TEST("Knock Off knocks a healing berry before it has the chance to activate")
{
GIVEN {
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET) { Item(ITEM_SITRUS_BERRY); MaxHP(500); HP(255); }
} WHEN {
TURN { MOVE(player, MOVE_KNOCK_OFF); }
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, MOVE_KNOCK_OFF, player);
NONE_OF {
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, opponent);
MESSAGE("Foe Wobbuffet's Sitrus Berry restored health!");
}
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_ITEM_KNOCKOFF);
MESSAGE("Wobbuffet knocked off Foe Wobbuffet's Sitrus Berry!");
}
}
SINGLE_BATTLE_TEST("Knock Off activates after Rocky Helmet and Weakness Policy")
{
u16 item = 0;
PARAMETRIZE { item = ITEM_WEAKNESS_POLICY; }
PARAMETRIZE { item = ITEM_ROCKY_HELMET; }
GIVEN {
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET) { Item(item); }
} WHEN {
TURN { MOVE(player, MOVE_KNOCK_OFF); }
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, MOVE_KNOCK_OFF, player);
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, opponent);
if (item == ITEM_WEAKNESS_POLICY) {
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE);
MESSAGE("Using WeaknssPolicy, the Attack of Foe Wobbuffet sharply rose!");
MESSAGE("Using WeaknssPolicy, the Sp. Atk of Foe Wobbuffet sharply rose!");
} else if (item == ITEM_ROCKY_HELMET) {
HP_BAR(player);
MESSAGE("Wobbuffet was hurt by Foe Wobbuffet's Rocky Helmet!");
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_ITEM_KNOCKOFF);
MESSAGE("Wobbuffet knocked off Foe Wobbuffet's Rocky Helmet!");
}
}
}
SINGLE_BATTLE_TEST("Knock Off doesn't knock off items from Pokemon behind substitutes")
{
GIVEN {
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET) { Item(ITEM_POKE_BALL); }
} WHEN {
TURN { MOVE(opponent, MOVE_SUBSTITUTE); MOVE(player, MOVE_KNOCK_OFF); }
} SCENE {
NOT MESSAGE("Wobbuffet knocked off Foe Wobbuffet's Poké Ball");
}
}