pokeemerald/test/battle/ability/poison_heal.c

78 lines
2.4 KiB
C
Raw Normal View History

#include "global.h"
#include "test/battle.h"
2023-10-06 15:13:26 +02:00
SINGLE_BATTLE_TEST("Poison Heal heals from (Toxic) Poison damage")
{
2023-10-06 15:13:26 +02:00
u8 status;
2023-10-11 16:11:46 +02:00
PARAMETRIZE { status = STATUS1_POISON; }
PARAMETRIZE { status = STATUS1_TOXIC_POISON; }
2023-10-06 15:13:26 +02:00
GIVEN {
2023-10-06 15:13:26 +02:00
PLAYER(SPECIES_SHROOMISH) { Ability(ABILITY_POISON_HEAL); Status1(status); HP(1), MaxHP(400); }
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(player, MOVE_CELEBRATE); }
} SCENE {
ABILITY_POPUP(player, ABILITY_POISON_HEAL);
MESSAGE("The poisoning healed Shroomish a little bit!");
HP_BAR(player, damage: -50);
}
}
2023-10-06 15:13:26 +02:00
SINGLE_BATTLE_TEST("Poison Heal heals from Toxic Poison damage are constant")
{
2023-10-06 15:13:26 +02:00
s16 turnOneHit;
s16 turnTwoHit;
GIVEN {
PLAYER(SPECIES_SHROOMISH) { Ability(ABILITY_POISON_HEAL); Status1(STATUS1_TOXIC_POISON); HP(1), MaxHP(400); }
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
2023-10-11 16:11:46 +02:00
TURN { }
TURN { }
} SCENE {
ABILITY_POPUP(player, ABILITY_POISON_HEAL);
MESSAGE("The poisoning healed Shroomish a little bit!");
2023-10-06 15:13:26 +02:00
HP_BAR(player, captureDamage: &turnOneHit);
ABILITY_POPUP(player, ABILITY_POISON_HEAL);
MESSAGE("The poisoning healed Shroomish a little bit!");
HP_BAR(player, captureDamage: &turnTwoHit);
} THEN {
EXPECT_EQ(turnOneHit, turnTwoHit);
}
}
SINGLE_BATTLE_TEST("Poison Heal does not heal or cause damage when under Heal Block")
{
GIVEN {
PLAYER(SPECIES_SHROOMISH) { Ability(ABILITY_POISON_HEAL); Status1(STATUS1_POISON); HP(1), MaxHP(400); }
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(opponent, MOVE_HEAL_BLOCK); }
} SCENE {
NONE_OF {
ABILITY_POPUP(player, ABILITY_POISON_HEAL);
MESSAGE("The poisoning healed Shroomish a little bit!");
HP_BAR(player, damage: -50);
}
}
}
SINGLE_BATTLE_TEST("Poison Heal activates before Toxic Orb")
{
GIVEN {
PLAYER(SPECIES_SHROOMISH) { Ability(ABILITY_POISON_HEAL); Item(ITEM_TOXIC_ORB); HP(1), MaxHP(400); }
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(player, MOVE_CELEBRATE); }
} SCENE {
NONE_OF {
ABILITY_POPUP(player, ABILITY_POISON_HEAL);
MESSAGE("The poisoning healed Shroomish a little bit!");
HP_BAR(player, damage: -50);
2023-10-06 15:13:26 +02:00
HP_BAR(player, damage: 50);
}
}
2023-10-06 15:13:26 +02:00
}