pokeemerald/test/ability_water_absorb.c

86 lines
3.0 KiB
C
Raw Normal View History

2023-02-03 00:22:02 +01:00
#include "global.h"
#include "test_battle.h"
SINGLE_BATTLE_TEST("Water Absorb heals 25% when hit by water type moves")
{
GIVEN {
ASSUME(gBattleMoves[MOVE_BUBBLE].type == TYPE_WATER);
2023-06-23 11:38:18 +02:00
PLAYER(SPECIES_POLIWAG) { Ability(ABILITY_WATER_ABSORB); HP(1); MaxHP(100); }
2023-02-03 00:22:02 +01:00
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(opponent, MOVE_BUBBLE); }
} SCENE {
ABILITY_POPUP(player, ABILITY_WATER_ABSORB);
2023-06-22 18:24:35 +02:00
HP_BAR(player, damage: -25);
2023-02-03 00:22:02 +01:00
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);
2023-06-23 11:38:18 +02:00
PLAYER(SPECIES_POLIWAG) { Ability(ABILITY_WATER_ABSORB); HP(1); MaxHP(100); }
2023-02-03 00:22:02 +01:00
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);
2023-06-23 11:38:18 +02:00
PLAYER(SPECIES_POLIWAG) { Ability(ABILITY_WATER_ABSORB); HP(1); MaxHP(100); }
2023-02-03 00:22:02 +01:00
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(opponent, MOVE_SOAK); }
} SCENE {
ABILITY_POPUP(player, ABILITY_WATER_ABSORB);
2023-06-22 18:24:35 +02:00
HP_BAR(player, damage: -25);
2023-02-03 00:22:02 +01:00
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);
2023-06-23 11:38:18 +02:00
PLAYER(SPECIES_POLIWAG) { Ability(ABILITY_WATER_ABSORB); HP(1); MaxHP(100); }
2023-02-03 00:22:02 +01:00
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(opponent, MOVE_WATER_SHURIKEN); }
} SCENE {
ABILITY_POPUP(player, ABILITY_WATER_ABSORB);
2023-06-22 18:24:35 +02:00
HP_BAR(player, damage: -25);
2023-02-03 00:22:02 +01:00
MESSAGE("Poliwag restored HP using its Water Absorb!");
}
}
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);
2023-06-23 11:38:18 +02:00
PLAYER(SPECIES_POLIWAG) { Ability(ABILITY_WATER_ABSORB); HP(1); MaxHP(100); Item(item); }
2023-02-03 00:22:02 +01:00
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(opponent, MOVE_BUBBLE); }
} SCENE {
ABILITY_POPUP(player, ABILITY_WATER_ABSORB);
2023-06-22 18:24:35 +02:00
HP_BAR(player, damage: -25);
2023-02-03 00:22:02 +01:00
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
}
}