From 242d68487a51a61dbc3d703c0505c1e8a38849a9 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Mon, 30 Oct 2023 14:31:28 -0300 Subject: [PATCH] Weak Armor tests --- test/battle/ability/weak_armor.c | 126 +++++++++++++++++++++++++++++++ 1 file changed, 126 insertions(+) diff --git a/test/battle/ability/weak_armor.c b/test/battle/ability/weak_armor.c index abe4a797e..f23f67cba 100644 --- a/test/battle/ability/weak_armor.c +++ b/test/battle/ability/weak_armor.c @@ -29,6 +29,13 @@ SINGLE_BATTLE_TEST("Weak Armor lowers Defense by 1 and boosts Speed by 2 when hi ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player); MESSAGE("Slugma's Weak Armor lowered its Defense!"); MESSAGE("Slugma's Weak Armor raised its Speed!"); + } else { + NONE_OF { + ABILITY_POPUP(player, ABILITY_WEAK_ARMOR); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player); + MESSAGE("Slugma's Weak Armor lowered its Defense!"); + MESSAGE("Slugma's Weak Armor raised its Speed!"); + } } } THEN { if (move == MOVE_TACKLE) { @@ -68,3 +75,122 @@ SINGLE_BATTLE_TEST("Weak Armor does not trigger when brought in by Dragon Tail a EXPECT_EQ(player->statStages[STAT_SPEED], DEFAULT_STAT_STAGE); } } + +SINGLE_BATTLE_TEST("Weak Armor still lowers boosts Speed if Defense can't go any lower") +{ + GIVEN { + PLAYER(SPECIES_SLUGMA) { Ability(ABILITY_WEAK_ARMOR); } + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(opponent, MOVE_SCREECH); } + TURN { MOVE(opponent, MOVE_SCREECH); } + TURN { MOVE(opponent, MOVE_SCREECH); } + TURN { MOVE(opponent, MOVE_TACKLE); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, opponent); + HP_BAR(player); + ABILITY_POPUP(player, ABILITY_WEAK_ARMOR); + NONE_OF { + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player); + MESSAGE("Slugma's Weak Armor lowered its Defense!"); + } + MESSAGE("Slugma's Defense won't go lower!"); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player); + MESSAGE("Slugma's Weak Armor raised its Speed!"); + } THEN { + EXPECT_EQ(player->statStages[STAT_DEF], MIN_STAT_STAGE); + EXPECT_EQ(player->statStages[STAT_SPEED], DEFAULT_STAT_STAGE + 2); + } +} + +SINGLE_BATTLE_TEST("Weak Armor still lowers Defense if Speed can't go any higher") +{ + GIVEN { + PLAYER(SPECIES_SLUGMA) { Ability(ABILITY_WEAK_ARMOR); } + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, MOVE_AGILITY); } + TURN { MOVE(player, MOVE_AGILITY); } + TURN { MOVE(player, MOVE_AGILITY); } + TURN { MOVE(opponent, MOVE_TACKLE); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, opponent); + HP_BAR(player); + ABILITY_POPUP(player, ABILITY_WEAK_ARMOR); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player); + MESSAGE("Slugma's Weak Armor lowered its Defense!"); + NONE_OF { + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player); + MESSAGE("Slugma's Weak Armor raised its Speed!"); + } + MESSAGE("Slugma's Speed won't go higher!"); + } THEN { + EXPECT_EQ(player->statStages[STAT_DEF], DEFAULT_STAT_STAGE - 1); + EXPECT_EQ(player->statStages[STAT_SPEED], MAX_STAT_STAGE); + } +} + +SINGLE_BATTLE_TEST("Weak Armor doesn't interrupt multi hit moves if Defense can't go any lower") +{ + u32 j; + KNOWN_FAILING; + GIVEN { + PLAYER(SPECIES_MAGCARGO) { Ability(ABILITY_WEAK_ARMOR); Defense(999); } + OPPONENT(SPECIES_CLOYSTER) { Ability(ABILITY_SKILL_LINK); } + } WHEN { + TURN { MOVE(opponent, MOVE_SCREECH); } + TURN { MOVE(opponent, MOVE_SCREECH); } + TURN { MOVE(opponent, MOVE_FURY_SWIPES); } + } SCENE { + for (j = 0; j < 2; j++) + { + ANIMATION(ANIM_TYPE_MOVE, MOVE_FURY_SWIPES, opponent); + ABILITY_POPUP(player, ABILITY_WEAK_ARMOR); + MESSAGE("Magcargo's Weak Armor lowered its Defense!"); + MESSAGE("Magcargo's Weak Armor raised its Speed!"); + } + ANIMATION(ANIM_TYPE_MOVE, MOVE_FURY_SWIPES, opponent); + ABILITY_POPUP(player, ABILITY_WEAK_ARMOR); + MESSAGE("Magcargo's Defense won't go lower!"); + MESSAGE("Magcargo's Weak Armor raised its Speed!"); + for (j = 0; j < 2; j++) + { + ANIMATION(ANIM_TYPE_MOVE, MOVE_FURY_SWIPES, opponent); + ABILITY_POPUP(player, ABILITY_WEAK_ARMOR); + MESSAGE("Magcargo's Defense won't go lower!"); + MESSAGE("Slugma's Speed won't go higher!"); + } + } THEN { + EXPECT_EQ(player->statStages[STAT_DEF], MIN_STAT_STAGE); + EXPECT_EQ(player->statStages[STAT_SPEED], DEFAULT_STAT_STAGE + 2); + } +} + +SINGLE_BATTLE_TEST("Weak Armor doesn't interrupt multi hit moves if Speed can't go any higher") +{ + u32 j; + KNOWN_FAILING; + GIVEN { + PLAYER(SPECIES_MAGCARGO) { Ability(ABILITY_WEAK_ARMOR); Defense(999); } + OPPONENT(SPECIES_CLOYSTER) { Ability(ABILITY_SKILL_LINK); } + } WHEN { + TURN { MOVE(player, MOVE_AGILITY); } + TURN { MOVE(player, MOVE_AGILITY); } + TURN { MOVE(opponent, MOVE_FURY_SWIPES); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_FURY_SWIPES, opponent); + ABILITY_POPUP(player, ABILITY_WEAK_ARMOR); + MESSAGE("Magcargo's Weak Armor lowered its Defense!"); + MESSAGE("Magcargo's Weak Armor raised its Speed!"); + for (j = 0; j < 4; j++) + { + ANIMATION(ANIM_TYPE_MOVE, MOVE_FURY_SWIPES, opponent); + ABILITY_POPUP(player, ABILITY_WEAK_ARMOR); + MESSAGE("Magcargo's Weak Armor lowered its Defense!"); + MESSAGE("Magcargo's Speed won't go higher!"); + } + } THEN { + EXPECT_EQ(player->statStages[STAT_DEF], MIN_STAT_STAGE); + EXPECT_EQ(player->statStages[STAT_SPEED], DEFAULT_STAT_STAGE + 2); + } +}