2023-02-03 00:22:02 +01:00
|
|
|
#include "global.h"
|
|
|
|
#include "test_battle.h"
|
|
|
|
|
|
|
|
#define TEST_MAX_HP (100)
|
|
|
|
|
|
|
|
SINGLE_BATTLE_TEST("Water Absorb heals 25% when hit by water type moves")
|
|
|
|
{
|
|
|
|
GIVEN {
|
|
|
|
ASSUME(gBattleMoves[MOVE_BUBBLE].type == TYPE_WATER);
|
|
|
|
PLAYER(SPECIES_POLIWAG) { Ability(ABILITY_WATER_ABSORB); HP(1); MaxHP(TEST_MAX_HP); };
|
|
|
|
OPPONENT(SPECIES_WOBBUFFET);
|
|
|
|
} WHEN {
|
|
|
|
TURN { MOVE(opponent, MOVE_BUBBLE); }
|
|
|
|
} SCENE {
|
|
|
|
ABILITY_POPUP(player, ABILITY_WATER_ABSORB);
|
|
|
|
HP_BAR(player, hp: TEST_MAX_HP / 4 + 1);
|
|
|
|
MESSAGE("Poliwag restored HP using its Water Absorb!");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
SINGLE_BATTLE_TEST("Water Absorb does not activate if protected")
|
|
|
|
{
|
|
|
|
GIVEN {
|
|
|
|
ASSUME(gBattleMoves[MOVE_BUBBLE].type == TYPE_WATER);
|
|
|
|
PLAYER(SPECIES_POLIWAG) { Ability(ABILITY_WATER_ABSORB); HP(1); MaxHP(TEST_MAX_HP); };
|
|
|
|
OPPONENT(SPECIES_WOBBUFFET);
|
|
|
|
} WHEN {
|
|
|
|
TURN { MOVE(player, MOVE_PROTECT); MOVE(opponent, MOVE_BUBBLE); }
|
|
|
|
} SCENE {
|
|
|
|
NONE_OF { ABILITY_POPUP(player, ABILITY_WATER_ABSORB); HP_BAR(player); MESSAGE("Poliwag restored HP using its Water Absorb!"); }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
SINGLE_BATTLE_TEST("Water Absorb activates on status moves")
|
|
|
|
{
|
|
|
|
GIVEN {
|
|
|
|
ASSUME(gBattleMoves[MOVE_SOAK].type == TYPE_WATER);
|
|
|
|
ASSUME(gBattleMoves[MOVE_SOAK].split == SPLIT_STATUS);
|
|
|
|
PLAYER(SPECIES_POLIWAG) { Ability(ABILITY_WATER_ABSORB); HP(1); MaxHP(TEST_MAX_HP); };
|
|
|
|
OPPONENT(SPECIES_WOBBUFFET);
|
|
|
|
} WHEN {
|
|
|
|
TURN { MOVE(opponent, MOVE_SOAK); }
|
|
|
|
} SCENE {
|
|
|
|
ABILITY_POPUP(player, ABILITY_WATER_ABSORB);
|
|
|
|
HP_BAR(player, hp: TEST_MAX_HP / 4 + 1);
|
|
|
|
MESSAGE("Poliwag restored HP using its Water Absorb!");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
SINGLE_BATTLE_TEST("Water Absorb is only triggered once on multi strike moves")
|
|
|
|
{
|
|
|
|
GIVEN {
|
|
|
|
ASSUME(gBattleMoves[MOVE_WATER_SHURIKEN].type == TYPE_WATER);
|
|
|
|
ASSUME(gBattleMoves[MOVE_WATER_SHURIKEN].effect == EFFECT_MULTI_HIT);
|
|
|
|
PLAYER(SPECIES_POLIWAG) { Ability(ABILITY_WATER_ABSORB); HP(1); MaxHP(TEST_MAX_HP); };
|
|
|
|
OPPONENT(SPECIES_WOBBUFFET);
|
|
|
|
} WHEN {
|
|
|
|
TURN { MOVE(opponent, MOVE_WATER_SHURIKEN); }
|
|
|
|
} SCENE {
|
|
|
|
ABILITY_POPUP(player, ABILITY_WATER_ABSORB);
|
|
|
|
HP_BAR(player, hp: TEST_MAX_HP / 4 + 1);
|
|
|
|
MESSAGE("Poliwag restored HP using its Water Absorb!");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-05-02 20:08:05 +02:00
|
|
|
SINGLE_BATTLE_TEST("Water Absorb prevents Absorb Bulb and Luminous Moss from activating")
|
2023-02-03 00:22:02 +01:00
|
|
|
{
|
|
|
|
u32 item;
|
|
|
|
PARAMETRIZE { item = ITEM_ABSORB_BULB; }
|
|
|
|
PARAMETRIZE { item = ITEM_LUMINOUS_MOSS; }
|
|
|
|
GIVEN {
|
|
|
|
ASSUME(gBattleMoves[MOVE_BUBBLE].type == TYPE_WATER);
|
|
|
|
PLAYER(SPECIES_POLIWAG) { Ability(ABILITY_WATER_ABSORB); HP(1); MaxHP(TEST_MAX_HP); Item(item); };
|
|
|
|
OPPONENT(SPECIES_WOBBUFFET);
|
|
|
|
} WHEN {
|
|
|
|
TURN { MOVE(opponent, MOVE_BUBBLE); }
|
|
|
|
} SCENE {
|
|
|
|
ABILITY_POPUP(player, ABILITY_WATER_ABSORB);
|
|
|
|
HP_BAR(player, hp: TEST_MAX_HP / 4 + 1);
|
|
|
|
MESSAGE("Poliwag restored HP using its Water Absorb!");
|
2023-02-26 22:43:15 +01:00
|
|
|
NONE_OF {
|
2023-02-03 00:22:02 +01:00
|
|
|
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, player);
|
|
|
|
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player);
|
|
|
|
}
|
2023-02-26 22:43:15 +01:00
|
|
|
|
2023-02-03 00:22:02 +01:00
|
|
|
}
|
|
|
|
}
|