2023-11-01 13:47:31 +00:00
|
|
|
#include "global.h"
|
|
|
|
#include "test/battle.h"
|
|
|
|
|
|
|
|
ASSUMPTIONS
|
|
|
|
{
|
2024-01-29 11:51:32 +00:00
|
|
|
ASSUME(gMovesInfo[MOVE_KNOCK_OFF].effect == EFFECT_KNOCK_OFF);
|
2023-11-01 13:47:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
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);
|
2024-10-21 18:52:45 +01:00
|
|
|
MESSAGE("The opposing Wobbuffet restored its health using its Sitrus Berry!");
|
2023-11-01 13:47:31 +00:00
|
|
|
}
|
|
|
|
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_ITEM_KNOCKOFF);
|
2024-10-21 18:52:45 +01:00
|
|
|
MESSAGE("Wobbuffet knocked off the opposing Wobbuffet's Sitrus Berry!");
|
2024-04-03 09:13:39 +01:00
|
|
|
} THEN {
|
|
|
|
EXPECT(opponent->item == ITEM_NONE);
|
2023-11-01 13:47:31 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
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);
|
2024-10-21 18:52:45 +01:00
|
|
|
MESSAGE("Using Weakness Policy, the Attack of the opposing Wobbuffet sharply rose!");
|
|
|
|
MESSAGE("Using Weakness Policy, the Sp. Atk of the opposing Wobbuffet sharply rose!");
|
2023-11-01 13:47:31 +00:00
|
|
|
} else if (item == ITEM_ROCKY_HELMET) {
|
|
|
|
HP_BAR(player);
|
2024-10-21 18:52:45 +01:00
|
|
|
MESSAGE("Wobbuffet was hurt by the opposing Wobbuffet's Rocky Helmet!");
|
2023-11-01 13:47:31 +00:00
|
|
|
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_ITEM_KNOCKOFF);
|
2024-10-21 18:52:45 +01:00
|
|
|
MESSAGE("Wobbuffet knocked off the opposing Wobbuffet's Rocky Helmet!");
|
2023-11-01 13:47:31 +00:00
|
|
|
}
|
2024-04-03 09:13:39 +01:00
|
|
|
} THEN {
|
|
|
|
EXPECT(opponent->item == ITEM_NONE);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
SINGLE_BATTLE_TEST("Knock Off deals additional damage to opponents holding an item in Gen 6+", s16 damage)
|
|
|
|
{
|
|
|
|
u16 item = 0;
|
|
|
|
|
|
|
|
PARAMETRIZE { item = ITEM_NONE; }
|
|
|
|
PARAMETRIZE { item = ITEM_LEFTOVERS; }
|
|
|
|
|
|
|
|
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);
|
|
|
|
HP_BAR(opponent, captureDamage: &results[i].damage);
|
|
|
|
if (item != ITEM_NONE)
|
|
|
|
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_ITEM_KNOCKOFF);
|
|
|
|
} FINALLY {
|
|
|
|
if (B_KNOCK_OFF_DMG >= GEN_6)
|
|
|
|
EXPECT_MUL_EQ(results[0].damage, UQ_4_12(1.5), results[1].damage);
|
|
|
|
else
|
|
|
|
EXPECT_EQ(results[0].damage, results[1].damage);
|
|
|
|
} THEN {
|
|
|
|
EXPECT(opponent->item == ITEM_NONE);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
SINGLE_BATTLE_TEST("Knock Off does not remove items through Substitute")
|
|
|
|
{
|
|
|
|
GIVEN {
|
|
|
|
PLAYER(SPECIES_WOBBUFFET);
|
|
|
|
OPPONENT(SPECIES_WOBBUFFET) { Item(ITEM_LEFTOVERS); };
|
|
|
|
} WHEN {
|
2024-08-15 03:48:20 +01:00
|
|
|
TURN { MOVE(opponent, MOVE_SUBSTITUTE);
|
2024-04-03 09:13:39 +01:00
|
|
|
MOVE(player, MOVE_KNOCK_OFF); }
|
|
|
|
} SCENE {
|
|
|
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_KNOCK_OFF, player);
|
|
|
|
NOT { ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_ITEM_KNOCKOFF); }
|
|
|
|
} THEN {
|
2024-05-13 16:25:49 +01:00
|
|
|
EXPECT(opponent->item == ITEM_LEFTOVERS);
|
2024-04-03 09:13:39 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
SINGLE_BATTLE_TEST("Recycle cannot recover an item removed by Knock Off")
|
|
|
|
{
|
|
|
|
GIVEN {
|
|
|
|
PLAYER(SPECIES_WOBBUFFET);
|
|
|
|
OPPONENT(SPECIES_WOBBUFFET) { Item(ITEM_LEFTOVERS); }
|
|
|
|
} WHEN {
|
|
|
|
TURN { MOVE(player, MOVE_KNOCK_OFF);
|
|
|
|
MOVE(opponent, MOVE_RECYCLE); }
|
|
|
|
} SCENE {
|
|
|
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_KNOCK_OFF, player);
|
|
|
|
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_ITEM_KNOCKOFF);
|
2024-10-21 18:52:45 +01:00
|
|
|
MESSAGE("Wobbuffet knocked off the opposing Wobbuffet's Leftovers!");
|
2024-08-15 03:48:20 +01:00
|
|
|
|
2024-10-21 18:52:45 +01:00
|
|
|
MESSAGE("The opposing Wobbuffet used Recycle!");
|
2024-04-03 09:13:39 +01:00
|
|
|
MESSAGE("But it failed!");
|
|
|
|
} THEN {
|
|
|
|
EXPECT(opponent->item == ITEM_NONE);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
SINGLE_BATTLE_TEST("Knock Off does not prevent targets from receiving another item in Gen 5+")
|
|
|
|
{
|
|
|
|
GIVEN {
|
|
|
|
PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_LEFTOVERS); }
|
|
|
|
OPPONENT(SPECIES_WOBBUFFET) { Item(ITEM_LEFTOVERS); }
|
|
|
|
} WHEN {
|
|
|
|
TURN { MOVE(player, MOVE_KNOCK_OFF); }
|
|
|
|
TURN { MOVE(player, MOVE_BESTOW); }
|
|
|
|
} SCENE {
|
|
|
|
// turn 1
|
|
|
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_KNOCK_OFF, player);
|
|
|
|
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_ITEM_KNOCKOFF);
|
2024-10-21 18:52:45 +01:00
|
|
|
MESSAGE("Wobbuffet knocked off the opposing Wobbuffet's Leftovers!");
|
2024-04-03 09:13:39 +01:00
|
|
|
// turn 2
|
|
|
|
if (B_KNOCK_OFF_REMOVAL >= GEN_5) {
|
|
|
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_BESTOW, player);
|
|
|
|
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT);
|
2024-10-21 18:52:45 +01:00
|
|
|
MESSAGE("The opposing Wobbuffet restored a little HP using its Leftovers!");
|
2024-04-03 09:13:39 +01:00
|
|
|
} else {
|
|
|
|
NOT { ANIMATION(ANIM_TYPE_MOVE, MOVE_BESTOW, player); }
|
|
|
|
MESSAGE("But it failed!");
|
|
|
|
}
|
|
|
|
} THEN {
|
|
|
|
if (B_KNOCK_OFF_REMOVAL >= GEN_5)
|
|
|
|
EXPECT(opponent->item == ITEM_LEFTOVERS);
|
|
|
|
else
|
|
|
|
EXPECT(opponent->item == ITEM_NONE);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Knock Off triggers Unburden regardless of whether the item is fully removed (Gen 5+) or not.
|
|
|
|
SINGLE_BATTLE_TEST("Knock Off triggers Unburden")
|
|
|
|
{
|
|
|
|
GIVEN {
|
|
|
|
PLAYER(SPECIES_WOBBUFFET) { Speed(60); }
|
|
|
|
OPPONENT(SPECIES_WOBBUFFET) { Ability(ABILITY_UNBURDEN); Item(ITEM_LEFTOVERS); Speed(50); }
|
|
|
|
} WHEN {
|
|
|
|
TURN { MOVE(player, MOVE_KNOCK_OFF); }
|
|
|
|
TURN { MOVE(player, MOVE_CELEBRATE); }
|
|
|
|
} SCENE {
|
|
|
|
// turn 1
|
|
|
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_KNOCK_OFF, player);
|
|
|
|
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_ITEM_KNOCKOFF);
|
2024-10-21 18:52:45 +01:00
|
|
|
MESSAGE("Wobbuffet knocked off the opposing Wobbuffet's Leftovers!");
|
2024-04-03 09:13:39 +01:00
|
|
|
// turn 2
|
2024-10-21 18:52:45 +01:00
|
|
|
MESSAGE("The opposing Wobbuffet used Celebrate!");
|
2024-04-03 09:13:39 +01:00
|
|
|
MESSAGE("Wobbuffet used Celebrate!");
|
|
|
|
} THEN {
|
|
|
|
EXPECT(opponent->item == ITEM_NONE);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
DOUBLE_BATTLE_TEST("Knock Off does not trigger the opposing ally's Symbiosis")
|
|
|
|
{
|
|
|
|
GIVEN {
|
|
|
|
PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_LEFTOVERS); }
|
|
|
|
PLAYER(SPECIES_FLORGES) { Item(ITEM_LEFTOVERS); }
|
|
|
|
OPPONENT(SPECIES_WOBBUFFET);
|
|
|
|
OPPONENT(SPECIES_WOBBUFFET);
|
|
|
|
} WHEN {
|
|
|
|
TURN { MOVE(opponentLeft, MOVE_KNOCK_OFF, target: playerLeft); }
|
|
|
|
} SCENE {
|
|
|
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_KNOCK_OFF, opponentLeft);
|
|
|
|
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_ITEM_KNOCKOFF);
|
2024-10-21 18:52:45 +01:00
|
|
|
MESSAGE("The opposing Wobbuffet knocked off Wobbuffet's Leftovers!");
|
2024-04-03 09:13:39 +01:00
|
|
|
NONE_OF {
|
|
|
|
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT);
|
2024-10-21 18:52:45 +01:00
|
|
|
MESSAGE("Wobbuffet restored its health using its Leftovers!");
|
2024-04-03 09:13:39 +01:00
|
|
|
}
|
|
|
|
} THEN {
|
|
|
|
EXPECT(playerLeft->item == ITEM_NONE);
|
2023-11-01 13:47:31 +00:00
|
|
|
}
|
|
|
|
}
|
2024-05-13 12:33:04 +01:00
|
|
|
|
|
|
|
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 {
|
2024-12-01 18:06:02 +00:00
|
|
|
NOT MESSAGE("Wobbuffet knocked off the opposing Wobbuffet's Poké Ball!");
|
2024-12-01 19:37:46 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
SINGLE_BATTLE_TEST("Knock Off does knock off Mega Stones from Pokemon that don't actually use them")
|
|
|
|
{
|
|
|
|
GIVEN {
|
|
|
|
PLAYER(SPECIES_WOBBUFFET);
|
|
|
|
OPPONENT(SPECIES_WOBBUFFET) { Item(ITEM_ABSOLITE); }
|
|
|
|
} WHEN {
|
|
|
|
TURN { MOVE(opponent, MOVE_CELEBRATE); MOVE(player, MOVE_KNOCK_OFF); }
|
|
|
|
} SCENE {
|
2024-12-01 18:06:02 +00:00
|
|
|
MESSAGE("Wobbuffet knocked off the opposing Wobbuffet's Absolite!");
|
2024-12-01 19:37:46 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
SINGLE_BATTLE_TEST("Knock Off doesn't knock off Mega Stones from Pokemon that actually use them")
|
|
|
|
{
|
|
|
|
GIVEN {
|
|
|
|
PLAYER(SPECIES_WOBBUFFET);
|
|
|
|
OPPONENT(SPECIES_ABSOL) { Item(ITEM_ABSOLITE); }
|
|
|
|
} WHEN {
|
|
|
|
TURN { MOVE(opponent, MOVE_CELEBRATE); MOVE(player, MOVE_KNOCK_OFF); }
|
|
|
|
} SCENE {
|
2024-12-01 18:06:02 +00:00
|
|
|
NOT MESSAGE("Wobbuffet knocked off the opposing Absol's Absolite!");
|
2024-12-01 19:37:46 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
SINGLE_BATTLE_TEST("Knock Off does knock off Orbs for Primal Reversion from Pokemon that don't actually use them")
|
|
|
|
{
|
|
|
|
GIVEN {
|
|
|
|
PLAYER(SPECIES_WOBBUFFET);
|
|
|
|
OPPONENT(SPECIES_WOBBUFFET) { Item(ITEM_RED_ORB); }
|
|
|
|
} WHEN {
|
|
|
|
TURN { MOVE(opponent, MOVE_CELEBRATE); MOVE(player, MOVE_KNOCK_OFF); }
|
|
|
|
} SCENE {
|
2024-12-01 18:06:02 +00:00
|
|
|
MESSAGE("Wobbuffet knocked off the opposing Wobbuffet's Red Orb!");
|
2024-12-01 19:37:46 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
SINGLE_BATTLE_TEST("Knock Off doesn't knock off Orbs for Primal Reversion from Pokemon that actually use them")
|
|
|
|
{
|
|
|
|
GIVEN {
|
|
|
|
PLAYER(SPECIES_WOBBUFFET);
|
|
|
|
OPPONENT(SPECIES_GROUDON) { Item(ITEM_RED_ORB); }
|
|
|
|
} WHEN {
|
|
|
|
TURN { MOVE(opponent, MOVE_CELEBRATE); MOVE(player, MOVE_KNOCK_OFF); }
|
|
|
|
} SCENE {
|
2024-12-01 18:06:02 +00:00
|
|
|
NOT MESSAGE("Wobbuffet knocked off the opposing Groudon's Red Orb!");
|
2024-12-01 19:37:46 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
SINGLE_BATTLE_TEST("Knock Off doesn't knock off Z-Crystals")
|
|
|
|
{
|
|
|
|
GIVEN {
|
|
|
|
PLAYER(SPECIES_WOBBUFFET);
|
|
|
|
OPPONENT(SPECIES_WOBBUFFET) { Item(ITEM_ELECTRIUM_Z); }
|
|
|
|
} WHEN {
|
|
|
|
TURN { MOVE(opponent, MOVE_CELEBRATE); MOVE(player, MOVE_KNOCK_OFF); }
|
|
|
|
} SCENE {
|
2024-12-01 18:06:02 +00:00
|
|
|
NOT MESSAGE("Wobbuffet knocked off the opposing Wobbuffet's Electrium Z!");
|
2024-12-01 19:37:46 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
SINGLE_BATTLE_TEST("Knock Off doesn't knock off Ultranecrozium Z from Pokemon that actually use it")
|
|
|
|
{
|
|
|
|
GIVEN {
|
|
|
|
PLAYER(SPECIES_WOBBUFFET);
|
|
|
|
OPPONENT(SPECIES_NECROZMA_DUSK_MANE) { Item(ITEM_ULTRANECROZIUM_Z); }
|
|
|
|
} WHEN {
|
|
|
|
TURN { MOVE(opponent, MOVE_CELEBRATE); MOVE(player, MOVE_KNOCK_OFF); }
|
|
|
|
} SCENE {
|
2024-12-01 18:06:02 +00:00
|
|
|
NOT MESSAGE("Wobbuffet knocked off the opposing Necrozma's Ultranecrozium Z!");
|
2024-12-01 19:37:46 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
SINGLE_BATTLE_TEST("Knock Off does knock off other form-change hold items from Pokemon that don't actually use them")
|
|
|
|
{
|
|
|
|
GIVEN {
|
|
|
|
PLAYER(SPECIES_WOBBUFFET);
|
|
|
|
OPPONENT(SPECIES_WOBBUFFET) { Item(ITEM_SKY_PLATE); }
|
|
|
|
} WHEN {
|
|
|
|
TURN { MOVE(opponent, MOVE_CELEBRATE); MOVE(player, MOVE_KNOCK_OFF); }
|
|
|
|
} SCENE {
|
2024-12-01 18:06:02 +00:00
|
|
|
MESSAGE("Wobbuffet knocked off the opposing Wobbuffet's Sky Plate!");
|
2024-12-01 19:37:46 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
SINGLE_BATTLE_TEST("Knock Off doesn't knock off other form-change hold items from Pokemon that actually use them")
|
|
|
|
{
|
|
|
|
GIVEN {
|
|
|
|
PLAYER(SPECIES_WOBBUFFET);
|
|
|
|
OPPONENT(SPECIES_ARCEUS) { Item(ITEM_SKY_PLATE); }
|
|
|
|
} WHEN {
|
|
|
|
TURN { MOVE(opponent, MOVE_CELEBRATE); MOVE(player, MOVE_KNOCK_OFF); }
|
|
|
|
} SCENE {
|
2024-12-01 18:06:02 +00:00
|
|
|
NOT MESSAGE("Wobbuffet knocked off the opposing Arceus's Sky Plate!");
|
2024-12-01 19:37:46 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
SINGLE_BATTLE_TEST("Knock Off does knock off begin-battle form-change hold items from Pokemon that don't actually use them")
|
|
|
|
{
|
|
|
|
GIVEN {
|
|
|
|
PLAYER(SPECIES_WOBBUFFET);
|
|
|
|
OPPONENT(SPECIES_WOBBUFFET) { Item(ITEM_RUSTED_SHIELD); }
|
|
|
|
} WHEN {
|
|
|
|
TURN { MOVE(opponent, MOVE_CELEBRATE); MOVE(player, MOVE_KNOCK_OFF); }
|
|
|
|
} SCENE {
|
2024-12-01 18:06:02 +00:00
|
|
|
MESSAGE("Wobbuffet knocked off the opposing Wobbuffet's Rusted Shield!");
|
2024-12-01 19:37:46 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
SINGLE_BATTLE_TEST("Knock Off doesn't knock off begin-battle form-change hold items from Pokemon that actually use them")
|
|
|
|
{
|
|
|
|
GIVEN {
|
|
|
|
PLAYER(SPECIES_WOBBUFFET);
|
2024-12-01 18:06:02 +00:00
|
|
|
OPPONENT(SPECIES_ZAMAZENTA_HERO) { Item(ITEM_RUSTED_SHIELD); }
|
2024-12-01 19:37:46 +00:00
|
|
|
} WHEN {
|
|
|
|
TURN { MOVE(opponent, MOVE_CELEBRATE); MOVE(player, MOVE_KNOCK_OFF); }
|
|
|
|
} SCENE {
|
2024-12-01 18:06:02 +00:00
|
|
|
NOT MESSAGE("Wobbuffet knocked off the opposing Zamazenta's Rusted Shield!");
|
2024-05-13 12:33:04 +01:00
|
|
|
}
|
|
|
|
}
|