From c95eab832e018a6e3d76f54c2c1ce50421594d3e Mon Sep 17 00:00:00 2001 From: ShaeTsuPog Date: Wed, 26 Apr 2023 21:49:25 -0700 Subject: [PATCH 01/10] ability tests and leaf guard fix --- data/battle_scripts_1.s | 7 +++ test/ability_dry_skin.c | 114 ++++++++++++++++++++++++++++++++++++++ test/ability_hydration.c | 16 ++++++ test/ability_ice_body.c | 18 ++++++ test/ability_leaf_guard.c | 48 ++++++++++++++++ test/ability_rain_dish.c | 18 ++++++ test/ability_snow_cloak.c | 17 ++++++ 7 files changed, 238 insertions(+) create mode 100644 test/ability_dry_skin.c create mode 100644 test/ability_hydration.c create mode 100644 test/ability_ice_body.c create mode 100644 test/ability_leaf_guard.c create mode 100644 test/ability_rain_dish.c create mode 100644 test/ability_snow_cloak.c diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index dcb076c278a4..16dafadb487a 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -3969,6 +3969,7 @@ BattleScript_EffectRest:: jumpifuproarwakes BattleScript_RestCantSleep jumpifability BS_TARGET, ABILITY_INSOMNIA, BattleScript_InsomniaProtects jumpifability BS_TARGET, ABILITY_VITAL_SPIRIT, BattleScript_InsomniaProtects + jumpifleafguardprotected BS_TARGET, BattleScript_LeafGuardPreventsRest trysetrest BattleScript_AlreadyAtFullHp pause B_WAIT_TIME_SHORT printfromtable gRestUsedStringIds @@ -3990,6 +3991,12 @@ BattleScript_RestIsAlreadyAsleep:: waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd +BattleScript_LeafGuardPreventsRest:: + pause B_WAIT_TIME_SHORT + printstring STRINGID_BUTITFAILED + waitmessage B_WAIT_TIME_LONG + goto BattleScript_MoveEnd + BattleScript_EffectOHKO:: attackcanceler attackstring diff --git a/test/ability_dry_skin.c b/test/ability_dry_skin.c new file mode 100644 index 000000000000..d28562fb2e3a --- /dev/null +++ b/test/ability_dry_skin.c @@ -0,0 +1,114 @@ +#include "global.h" +#include "test_battle.h" + +#define TEST_MAX_HP (200) + +SINGLE_BATTLE_TEST("Dry Skin causes 1/8th Max HP damage in Sun") +{ + GIVEN { + PLAYER(SPECIES_HELIOLISK) { Ability(ABILITY_DRY_SKIN); HP(100); MaxHP(TEST_MAX_HP); }; + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, MOVE_SUNNY_DAY); } + } SCENE { + ABILITY_POPUP(player, ABILITY_DRY_SKIN); + HP_BAR(player, damage: TEST_MAX_HP / 8); + MESSAGE("The Heliolisk's Dry Skin takes its toll!"); + } +} + +SINGLE_BATTLE_TEST("Dry Skin heals 1/8th Max HP in Rain") +{ + GIVEN { + PLAYER(SPECIES_HELIOLISK) { Ability(ABILITY_DRY_SKIN); HP(100); MaxHP(TEST_MAX_HP); }; + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, MOVE_RAIN_DANCE); } + } SCENE { + ABILITY_POPUP(player, ABILITY_DRY_SKIN); + MESSAGE("Heliolisk's Dry Skin restored its HP a little!"); + HP_BAR(player, hp: TEST_MAX_HP / 8 + 100); + } +} + +SINGLE_BATTLE_TEST("Dry Skin increases damage taken from Fire-type moves by 25%", s16 damage) +{ + GIVEN { + ASSUME(gBattleMoves[MOVE_EMBER].type == TYPE_FIRE); + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_HELIOLISK) { Ability(ABILITY_DRY_SKIN); }; + } WHEN { + TURN {MOVE(player, MOVE_EMBER); } + } SCENE { + MESSAGE("Wobbuffet used Ember!"); + HP_BAR(opponent, captureDamage: &results[i].damage); + } FINALLY { + EXPECT_MUL_EQ(results[0].damage, Q_4_12(1.25), results[1].damage); + } +} + +SINGLE_BATTLE_TEST("Dry Skin heals 25% when hit by water type moves") +{ + GIVEN { + ASSUME(gBattleMoves[MOVE_BUBBLE].type == TYPE_WATER); + PLAYER(SPECIES_HELIOLISK) { Ability(ABILITY_DRY_SKIN); HP(100); MaxHP(TEST_MAX_HP); }; + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(opponent, MOVE_BUBBLE); } + } SCENE { + ABILITY_POPUP(player, ABILITY_DRY_SKIN); + HP_BAR(player, hp: TEST_MAX_HP / 4 + 100); + MESSAGE("Heliolisk restored HP using its Dry Skin!"); + } +} + +SINGLE_BATTLE_TEST("Dry Skin does not activate if protected") +{ + GIVEN { + ASSUME(gBattleMoves[MOVE_BUBBLE].type == TYPE_WATER); + PLAYER(SPECIES_HELIOLISK) { Ability(ABILITY_DRY_SKIN); HP(100); MaxHP(TEST_MAX_HP); }; + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, MOVE_PROTECT); MOVE(opponent, MOVE_BUBBLE); } + } SCENE { + NONE_OF { ABILITY_POPUP(player, ABILITY_DRY_SKIN); HP_BAR(player); MESSAGE("Heliolisk restored HP using its Dry Skin!"); } + } +} + +SINGLE_BATTLE_TEST("Dry Skin 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_HELIOLISK) { Ability(ABILITY_DRY_SKIN); HP(100); MaxHP(TEST_MAX_HP); }; + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(opponent, MOVE_WATER_SHURIKEN); } + } SCENE { + ABILITY_POPUP(player, ABILITY_DRY_SKIN); + HP_BAR(player, hp: TEST_MAX_HP / 4 + 100); + MESSAGE("Heliolisk restored HP using its Dry Skin!"); + } +} + +SINGLE_BATTLE_TEST("Dry Skin prevents Items from activating") +{ + u32 item; + PARAMETRIZE { item = ITEM_ABSORB_BULB; } + PARAMETRIZE { item = ITEM_LUMINOUS_MOSS; } + GIVEN { + ASSUME(gBattleMoves[MOVE_BUBBLE].type == TYPE_WATER); + PLAYER(SPECIES_HELIOLISK) { Ability(ABILITY_DRY_SKIN); HP(100); MaxHP(TEST_MAX_HP); Item(item); }; + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(opponent, MOVE_BUBBLE); } + } SCENE { + ABILITY_POPUP(player, ABILITY_DRY_SKIN); + HP_BAR(player, hp: TEST_MAX_HP / 4 + 100); + MESSAGE("Heliolisk restored HP using its Dry Skin!"); + NONE_OF { + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, player); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player); + } + } +} diff --git a/test/ability_hydration.c b/test/ability_hydration.c new file mode 100644 index 000000000000..45689b2121ed --- /dev/null +++ b/test/ability_hydration.c @@ -0,0 +1,16 @@ +#include "global.h" +#include "test_battle.h" + +SINGLE_BATTLE_TEST("Hydration cures non-volatile Status conditions if it is raining") +{ + GIVEN { + PLAYER(SPECIES_VAPOREON) { Ability(ABILITY_HYDRATION); Status1(STATUS1_BURN); } + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, MOVE_RAIN_DANCE); } + } SCENE { + ABILITY_POPUP(player, ABILITY_HYDRATION); + MESSAGE("Vaporeon's Hydration cured its burn problem!"); + STATUS_ICON(player, none: TRUE); + } +} diff --git a/test/ability_ice_body.c b/test/ability_ice_body.c new file mode 100644 index 000000000000..7bb56ed930af --- /dev/null +++ b/test/ability_ice_body.c @@ -0,0 +1,18 @@ +#include "global.h" +#include "test_battle.h" + +#define TEST_MAX_HP (100) + +SINGLE_BATTLE_TEST("Ice Body recovers 1/16th of Max HP in Hail.") +{ + GIVEN { + PLAYER(SPECIES_GLALIE) { Ability(ABILITY_ICE_BODY); HP(1); MaxHP(TEST_MAX_HP); }; + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(opponent, MOVE_HAIL); } + } SCENE { + ABILITY_POPUP(player, ABILITY_ICE_BODY); + MESSAGE("Glalie's Ice Body healed it a little bit!"); + HP_BAR(player, hp: TEST_MAX_HP / 16 + 1); + } +} diff --git a/test/ability_leaf_guard.c b/test/ability_leaf_guard.c new file mode 100644 index 000000000000..93eaa5ae2162 --- /dev/null +++ b/test/ability_leaf_guard.c @@ -0,0 +1,48 @@ +#include "global.h" +#include "test_battle.h" + +SINGLE_BATTLE_TEST("Leaf Guard prevents non-volatile status conditions in sun") +{ + GIVEN { + ASSUME(gBattleMoves[MOVE_WILL_O_WISP].effect == EFFECT_WILL_O_WISP); + PLAYER(SPECIES_LEAFEON) { Ability(ABILITY_LEAF_GUARD); } + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, MOVE_SUNNY_DAY); MOVE(opponent, MOVE_WILL_O_WISP); } + } SCENE { + ABILITY_POPUP(player, ABILITY_LEAF_GUARD); + NOT ANIMATION(ANIM_TYPE_MOVE, MOVE_WILL_O_WISP, opponent); + MESSAGE("It doesn't affect Leafeon…"); + NOT STATUS_ICON(player, burn: TRUE); + } +} + +SINGLE_BATTLE_TEST("Leaf Guard prevents non-volatile status conditions from items") +{ + GIVEN { + ASSUME(gItems[ITEM_FLAME_ORB].holdEffect == HOLD_EFFECT_FLAME_ORB); + PLAYER(SPECIES_LEAFEON) {Ability(ABILITY_LEAF_GUARD); Item(ITEM_FLAME_ORB); }; + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, MOVE_SUNNY_DAY); } + } SCENE { + NOT MESSAGE("Leafeon was burned!"); + NOT STATUS_ICON(player, burn: TRUE); + } +} + +SINGLE_BATTLE_TEST("Leaf Guard prevents Rest during sun") +{ + GIVEN { + ASSUME(gBattleMoves[MOVE_REST].effect == EFFECT_REST); + PLAYER(SPECIES_LEAFEON) { Ability(ABILITY_LEAF_GUARD); HP(100); MaxHP(200); }; + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(opponent, MOVE_SUNNY_DAY); MOVE(player, MOVE_REST); } + } SCENE { + NOT MESSAGE("Leafeon went to sleep!"); + NOT STATUS_ICON(player, sleep: TRUE); + NOT MESSAGE("Leafeon regained health!"); + NONE_OF {HP_BAR(player);} + } +} diff --git a/test/ability_rain_dish.c b/test/ability_rain_dish.c new file mode 100644 index 000000000000..f9a457d4a5b7 --- /dev/null +++ b/test/ability_rain_dish.c @@ -0,0 +1,18 @@ +#include "global.h" +#include "test_battle.h" + +#define TEST_MAX_HP (100) + +SINGLE_BATTLE_TEST("Rain Dish recovers 1/16th of Max HP in Rain") +{ + GIVEN { + PLAYER(SPECIES_LUDICOLO) { Ability(ABILITY_RAIN_DISH); HP(1); MaxHP(TEST_MAX_HP); }; + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(opponent, MOVE_RAIN_DANCE); } + } SCENE { + ABILITY_POPUP(player, ABILITY_RAIN_DISH); + MESSAGE("Ludicolo's Rain Dish restored its HP a little!"); + HP_BAR(player, hp: TEST_MAX_HP / 16 + 1); + } +} diff --git a/test/ability_snow_cloak.c b/test/ability_snow_cloak.c new file mode 100644 index 000000000000..41c726d1ac90 --- /dev/null +++ b/test/ability_snow_cloak.c @@ -0,0 +1,17 @@ +#include "global.h" +#include "test_battle.h" + +SINGLE_BATTLE_TEST("Snow Cloak reduces accuracy during hail") +{ + PASSES_RANDOMLY(4, 5, RNG_ACCURACY); + GIVEN { + ASSUME(gBattleMoves[MOVE_POUND].accuracy == 100); + PLAYER(SPECIES_GLACEON) { Ability(ABILITY_SNOW_CLOAK); }; + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(opponent, MOVE_HAIL); } + TURN { MOVE(opponent, MOVE_POUND); } + } SCENE { + HP_BAR(player); + } +} From b7b09603811301d3a277bb96b9ed2a8ebbc0f906 Mon Sep 17 00:00:00 2001 From: ShaeTsuPog Date: Wed, 26 Apr 2023 23:22:21 -0700 Subject: [PATCH 02/10] Update ability_leaf_guard.c --- test/ability_leaf_guard.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/ability_leaf_guard.c b/test/ability_leaf_guard.c index 93eaa5ae2162..0f1df333f2a0 100644 --- a/test/ability_leaf_guard.c +++ b/test/ability_leaf_guard.c @@ -40,9 +40,8 @@ SINGLE_BATTLE_TEST("Leaf Guard prevents Rest during sun") } WHEN { TURN { MOVE(opponent, MOVE_SUNNY_DAY); MOVE(player, MOVE_REST); } } SCENE { - NOT MESSAGE("Leafeon went to sleep!"); + MESSAGE("But it failed!"); NOT STATUS_ICON(player, sleep: TRUE); - NOT MESSAGE("Leafeon regained health!"); NONE_OF {HP_BAR(player);} } } From ae46256fef8ef1fe1e2a2295cf4aa38fe2ac9ad7 Mon Sep 17 00:00:00 2001 From: ShaeTsuPog Date: Thu, 27 Apr 2023 04:27:42 -0700 Subject: [PATCH 03/10] Hail immunity tests --- test/ability_ice_body.c | 14 +++++++++++++- test/ability_snow_cloak.c | 12 ++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/test/ability_ice_body.c b/test/ability_ice_body.c index 7bb56ed930af..b28c5ef0ab5d 100644 --- a/test/ability_ice_body.c +++ b/test/ability_ice_body.c @@ -3,7 +3,19 @@ #define TEST_MAX_HP (100) -SINGLE_BATTLE_TEST("Ice Body recovers 1/16th of Max HP in Hail.") +SINGLE_BATTLE_TEST("Ice Body prevents damage from hail") +{ + GIVEN { + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_GLALIE) { Ability(ABILITY_ICE_BODY); }; + } WHEN { + TURN { MOVE(player, MOVE_HAIL); MOVE(opponent, MOVE_SKILL_SWAP); } + } SCENE { + NONE_OF { HP_BAR(player); } + } +} + +SINGLE_BATTLE_TEST("Ice Body recovers 1/16th of Max HP in hail.") { GIVEN { PLAYER(SPECIES_GLALIE) { Ability(ABILITY_ICE_BODY); HP(1); MaxHP(TEST_MAX_HP); }; diff --git a/test/ability_snow_cloak.c b/test/ability_snow_cloak.c index 41c726d1ac90..4ae95946f810 100644 --- a/test/ability_snow_cloak.c +++ b/test/ability_snow_cloak.c @@ -1,6 +1,18 @@ #include "global.h" #include "test_battle.h" +SINGLE_BATTLE_TEST("Snow Cloak prevents damage from hail") +{ + GIVEN { + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_GLACEON) { Ability(ABILITY_SNOW_CLOAK); }; + } WHEN { + TURN { MOVE(player, MOVE_HAIL); MOVE(opponent, MOVE_SKILL_SWAP); } + } SCENE { + NONE_OF { HP_BAR(player); } + } +} + SINGLE_BATTLE_TEST("Snow Cloak reduces accuracy during hail") { PASSES_RANDOMLY(4, 5, RNG_ACCURACY); From 56681fdbe2f6d44c92d55fb3084fc046bd229044 Mon Sep 17 00:00:00 2001 From: ShaeTsuPog Date: Thu, 27 Apr 2023 04:38:36 -0700 Subject: [PATCH 04/10] Update sand veil to actually test sandstorm immunity. --- test/ability_sand_veil.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/ability_sand_veil.c b/test/ability_sand_veil.c index 5514f27c0e90..0a1a981df61b 100644 --- a/test/ability_sand_veil.c +++ b/test/ability_sand_veil.c @@ -4,7 +4,7 @@ SINGLE_BATTLE_TEST("Sand Veil prevents damage from sandstorm") { GIVEN { - PLAYER(SPECIES_SANDSHREW) { Ability(ABILITY_SAND_VEIL); }; + PLAYER(SPECIES_CACNEA) { Ability(ABILITY_SAND_VEIL); }; OPPONENT(SPECIES_WOBBUFFET); } WHEN { TURN { MOVE(opponent, MOVE_SANDSTORM); } From 94b40e5b5b9d1cbc0f426422edeba96dd0dc1264 Mon Sep 17 00:00:00 2001 From: ShaeTsuPog Date: Thu, 27 Apr 2023 05:42:20 -0700 Subject: [PATCH 05/10] Add generational config for Leaf Guard --- data/battle_scripts_1.s | 2 ++ include/config/battle.h | 1 + 2 files changed, 3 insertions(+) diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 16dafadb487a..902eca615c5e 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -3969,7 +3969,9 @@ BattleScript_EffectRest:: jumpifuproarwakes BattleScript_RestCantSleep jumpifability BS_TARGET, ABILITY_INSOMNIA, BattleScript_InsomniaProtects jumpifability BS_TARGET, ABILITY_VITAL_SPIRIT, BattleScript_InsomniaProtects +.if B_LEAF_GUARD_PREVENTS_REST >= GEN_5 jumpifleafguardprotected BS_TARGET, BattleScript_LeafGuardPreventsRest +.endif trysetrest BattleScript_AlreadyAtFullHp pause B_WAIT_TIME_SHORT printfromtable gRestUsedStringIds diff --git a/include/config/battle.h b/include/config/battle.h index b9d3926b05a6..cb06b8fd3837 100644 --- a/include/config/battle.h +++ b/include/config/battle.h @@ -118,6 +118,7 @@ #define B_SYMBIOSIS_GEMS GEN_LATEST // In Gen7+, Symbiosis passes an item after a gem-boosted attack. Previously, items are passed before the gem-boosted attack hits, making the item effect apply. #define B_CHECK_IF_CHARGED_UP TRUE // If set to TRUE, certain abilities such as Electromorphosis WILL check if the STATUS3_CHARGED_UP status flag is applied. #define B_ABSORBING_ABILITY_STRING GEN_LATEST // In Gen5+, the abilities that absorb moves of a certain type use a generic string for stat increases and decreases. +#define B_LEAF_GUARD_PREVENTS_REST GEN_LATEST // In Gen5+, Leaf Guard prevents the use of Rest in harsh sunlight. // Item settings #define B_HP_BERRIES GEN_LATEST // In Gen4+, berries which restore hp activate immediately after HP drops to half. In Gen3, the effect occurs at the end of the turn. From fe576e710f067b047f65c504945b3c0b76543113 Mon Sep 17 00:00:00 2001 From: ShaeTsuPog Date: Thu, 27 Apr 2023 06:32:20 -0700 Subject: [PATCH 06/10] add ASSUME to leaf guard test --- test/ability_leaf_guard.c | 1 + 1 file changed, 1 insertion(+) diff --git a/test/ability_leaf_guard.c b/test/ability_leaf_guard.c index 0f1df333f2a0..ff6e1a53dddf 100644 --- a/test/ability_leaf_guard.c +++ b/test/ability_leaf_guard.c @@ -34,6 +34,7 @@ SINGLE_BATTLE_TEST("Leaf Guard prevents non-volatile status conditions from item SINGLE_BATTLE_TEST("Leaf Guard prevents Rest during sun") { GIVEN { + ASSUME(B_LEAF_GUARD_PREVENTS_REST >= GEN_5); ASSUME(gBattleMoves[MOVE_REST].effect == EFFECT_REST); PLAYER(SPECIES_LEAFEON) { Ability(ABILITY_LEAF_GUARD); HP(100); MaxHP(200); }; OPPONENT(SPECIES_WOBBUFFET); From b85ba89b13250c4c6ca68f81dba844c953c518d8 Mon Sep 17 00:00:00 2001 From: ShaeTsuPog Date: Thu, 27 Apr 2023 13:24:59 -0700 Subject: [PATCH 07/10] Update ability_dry_skin.c --- test/ability_dry_skin.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/test/ability_dry_skin.c b/test/ability_dry_skin.c index d28562fb2e3a..e4cc7c2fc375 100644 --- a/test/ability_dry_skin.c +++ b/test/ability_dry_skin.c @@ -6,27 +6,27 @@ SINGLE_BATTLE_TEST("Dry Skin causes 1/8th Max HP damage in Sun") { GIVEN { - PLAYER(SPECIES_HELIOLISK) { Ability(ABILITY_DRY_SKIN); HP(100); MaxHP(TEST_MAX_HP); }; + PLAYER(SPECIES_PARASECT) { Ability(ABILITY_DRY_SKIN); HP(100); MaxHP(TEST_MAX_HP); }; OPPONENT(SPECIES_WOBBUFFET); } WHEN { TURN { MOVE(player, MOVE_SUNNY_DAY); } } SCENE { ABILITY_POPUP(player, ABILITY_DRY_SKIN); HP_BAR(player, damage: TEST_MAX_HP / 8); - MESSAGE("The Heliolisk's Dry Skin takes its toll!"); + MESSAGE("The Parasect's Dry Skin takes its toll!"); } } SINGLE_BATTLE_TEST("Dry Skin heals 1/8th Max HP in Rain") { GIVEN { - PLAYER(SPECIES_HELIOLISK) { Ability(ABILITY_DRY_SKIN); HP(100); MaxHP(TEST_MAX_HP); }; + PLAYER(SPECIES_PARASECT) { Ability(ABILITY_DRY_SKIN); HP(100); MaxHP(TEST_MAX_HP); }; OPPONENT(SPECIES_WOBBUFFET); } WHEN { TURN { MOVE(player, MOVE_RAIN_DANCE); } } SCENE { ABILITY_POPUP(player, ABILITY_DRY_SKIN); - MESSAGE("Heliolisk's Dry Skin restored its HP a little!"); + MESSAGE("Parasect's Dry Skin restored its HP a little!"); HP_BAR(player, hp: TEST_MAX_HP / 8 + 100); } } @@ -36,7 +36,7 @@ SINGLE_BATTLE_TEST("Dry Skin increases damage taken from Fire-type moves by 25%" GIVEN { ASSUME(gBattleMoves[MOVE_EMBER].type == TYPE_FIRE); PLAYER(SPECIES_WOBBUFFET); - OPPONENT(SPECIES_HELIOLISK) { Ability(ABILITY_DRY_SKIN); }; + OPPONENT(SPECIES_PARASECT) { Ability(ABILITY_DRY_SKIN); }; } WHEN { TURN {MOVE(player, MOVE_EMBER); } } SCENE { @@ -51,14 +51,14 @@ SINGLE_BATTLE_TEST("Dry Skin heals 25% when hit by water type moves") { GIVEN { ASSUME(gBattleMoves[MOVE_BUBBLE].type == TYPE_WATER); - PLAYER(SPECIES_HELIOLISK) { Ability(ABILITY_DRY_SKIN); HP(100); MaxHP(TEST_MAX_HP); }; + PLAYER(SPECIES_PARASECT) { Ability(ABILITY_DRY_SKIN); HP(100); MaxHP(TEST_MAX_HP); }; OPPONENT(SPECIES_WOBBUFFET); } WHEN { TURN { MOVE(opponent, MOVE_BUBBLE); } } SCENE { ABILITY_POPUP(player, ABILITY_DRY_SKIN); HP_BAR(player, hp: TEST_MAX_HP / 4 + 100); - MESSAGE("Heliolisk restored HP using its Dry Skin!"); + MESSAGE("Parasect restored HP using its Dry Skin!"); } } @@ -66,12 +66,12 @@ SINGLE_BATTLE_TEST("Dry Skin does not activate if protected") { GIVEN { ASSUME(gBattleMoves[MOVE_BUBBLE].type == TYPE_WATER); - PLAYER(SPECIES_HELIOLISK) { Ability(ABILITY_DRY_SKIN); HP(100); MaxHP(TEST_MAX_HP); }; + PLAYER(SPECIES_PARASECT) { Ability(ABILITY_DRY_SKIN); HP(100); MaxHP(TEST_MAX_HP); }; OPPONENT(SPECIES_WOBBUFFET); } WHEN { TURN { MOVE(player, MOVE_PROTECT); MOVE(opponent, MOVE_BUBBLE); } } SCENE { - NONE_OF { ABILITY_POPUP(player, ABILITY_DRY_SKIN); HP_BAR(player); MESSAGE("Heliolisk restored HP using its Dry Skin!"); } + NONE_OF { ABILITY_POPUP(player, ABILITY_DRY_SKIN); HP_BAR(player); MESSAGE("Parasect restored HP using its Dry Skin!"); } } } @@ -80,14 +80,14 @@ SINGLE_BATTLE_TEST("Dry Skin 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_HELIOLISK) { Ability(ABILITY_DRY_SKIN); HP(100); MaxHP(TEST_MAX_HP); }; + PLAYER(SPECIES_PARASECT) { Ability(ABILITY_DRY_SKIN); HP(100); MaxHP(TEST_MAX_HP); }; OPPONENT(SPECIES_WOBBUFFET); } WHEN { TURN { MOVE(opponent, MOVE_WATER_SHURIKEN); } } SCENE { ABILITY_POPUP(player, ABILITY_DRY_SKIN); HP_BAR(player, hp: TEST_MAX_HP / 4 + 100); - MESSAGE("Heliolisk restored HP using its Dry Skin!"); + MESSAGE("Parasect restored HP using its Dry Skin!"); } } @@ -98,14 +98,14 @@ SINGLE_BATTLE_TEST("Dry Skin prevents Items from activating") PARAMETRIZE { item = ITEM_LUMINOUS_MOSS; } GIVEN { ASSUME(gBattleMoves[MOVE_BUBBLE].type == TYPE_WATER); - PLAYER(SPECIES_HELIOLISK) { Ability(ABILITY_DRY_SKIN); HP(100); MaxHP(TEST_MAX_HP); Item(item); }; + PLAYER(SPECIES_PARASECT) { Ability(ABILITY_DRY_SKIN); HP(100); MaxHP(TEST_MAX_HP); Item(item); }; OPPONENT(SPECIES_WOBBUFFET); } WHEN { TURN { MOVE(opponent, MOVE_BUBBLE); } } SCENE { ABILITY_POPUP(player, ABILITY_DRY_SKIN); HP_BAR(player, hp: TEST_MAX_HP / 4 + 100); - MESSAGE("Heliolisk restored HP using its Dry Skin!"); + MESSAGE("Parasect restored HP using its Dry Skin!"); NONE_OF { ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, player); ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player); From 16342fec2df83729472e64db6df2e80ee14c4564 Mon Sep 17 00:00:00 2001 From: ShaeTsuPog Date: Thu, 27 Apr 2023 13:29:30 -0700 Subject: [PATCH 08/10] Change "reduces accuracy" to "increases evasion" --- test/ability_sand_veil.c | 2 +- test/ability_snow_cloak.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/ability_sand_veil.c b/test/ability_sand_veil.c index 0a1a981df61b..ec7c17f8ecc0 100644 --- a/test/ability_sand_veil.c +++ b/test/ability_sand_veil.c @@ -14,7 +14,7 @@ SINGLE_BATTLE_TEST("Sand Veil prevents damage from sandstorm") } } -SINGLE_BATTLE_TEST("Sand Veil reduces accuracy during sandstorm") +SINGLE_BATTLE_TEST("Sand Veil increases evasion during sandstorm") { PASSES_RANDOMLY(4, 5, RNG_ACCURACY); GIVEN { diff --git a/test/ability_snow_cloak.c b/test/ability_snow_cloak.c index 4ae95946f810..1f47eb94baba 100644 --- a/test/ability_snow_cloak.c +++ b/test/ability_snow_cloak.c @@ -13,7 +13,7 @@ SINGLE_BATTLE_TEST("Snow Cloak prevents damage from hail") } } -SINGLE_BATTLE_TEST("Snow Cloak reduces accuracy during hail") +SINGLE_BATTLE_TEST("Snow Cloak increases evasion during hail") { PASSES_RANDOMLY(4, 5, RNG_ACCURACY); GIVEN { From d4c2e0f968c8713586f9f3d35e024285da867529 Mon Sep 17 00:00:00 2001 From: ShaeTsuPog Date: Thu, 27 Apr 2023 15:05:12 -0700 Subject: [PATCH 09/10] Update test descriptions for Water Absorb and Dry Skin. --- test/ability_dry_skin.c | 2 +- test/ability_water_absorb.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/ability_dry_skin.c b/test/ability_dry_skin.c index e4cc7c2fc375..6c28d0c428ec 100644 --- a/test/ability_dry_skin.c +++ b/test/ability_dry_skin.c @@ -91,7 +91,7 @@ SINGLE_BATTLE_TEST("Dry Skin is only triggered once on multi strike moves") } } -SINGLE_BATTLE_TEST("Dry Skin prevents Items from activating") +SINGLE_BATTLE_TEST("Dry Skin prevents Absorb Bulb and Luminous Moss from activating") { u32 item; PARAMETRIZE { item = ITEM_ABSORB_BULB; } diff --git a/test/ability_water_absorb.c b/test/ability_water_absorb.c index aaaa149acea6..7d62748367b5 100644 --- a/test/ability_water_absorb.c +++ b/test/ability_water_absorb.c @@ -63,7 +63,7 @@ SINGLE_BATTLE_TEST("Water Absorb is only triggered once on multi strike moves") } } -SINGLE_BATTLE_TEST("Water Absorb prevents Items from activating") +SINGLE_BATTLE_TEST("Water Absorb prevents Absorb Bulb and Luminous Moss from activating") { u32 item; PARAMETRIZE { item = ITEM_ABSORB_BULB; } From 73588ead1501e5ec48df380b245fdeb253cc50e5 Mon Sep 17 00:00:00 2001 From: ShaeTsuPog Date: Thu, 27 Apr 2023 17:38:53 -0700 Subject: [PATCH 10/10] Update ability_leaf_guard.c --- test/ability_leaf_guard.c | 65 +++++++++++++++++++++++++++++++++------ 1 file changed, 56 insertions(+), 9 deletions(-) diff --git a/test/ability_leaf_guard.c b/test/ability_leaf_guard.c index ff6e1a53dddf..a4c83c48561f 100644 --- a/test/ability_leaf_guard.c +++ b/test/ability_leaf_guard.c @@ -3,31 +3,78 @@ SINGLE_BATTLE_TEST("Leaf Guard prevents non-volatile status conditions in sun") { + u32 move; + PARAMETRIZE { move = MOVE_WILL_O_WISP; } + PARAMETRIZE { move = MOVE_HYPNOSIS; } + PARAMETRIZE { move = MOVE_THUNDER_WAVE; } + PARAMETRIZE { move = MOVE_TOXIC; } + PARAMETRIZE { move = MOVE_POWDER_SNOW; } GIVEN { ASSUME(gBattleMoves[MOVE_WILL_O_WISP].effect == EFFECT_WILL_O_WISP); + ASSUME(gBattleMoves[MOVE_HYPNOSIS].effect == EFFECT_SLEEP); + ASSUME(gBattleMoves[MOVE_THUNDER_WAVE].effect == EFFECT_PARALYZE); + ASSUME(gBattleMoves[MOVE_TOXIC].effect == EFFECT_TOXIC); + ASSUME(gBattleMoves[MOVE_POWDER_SNOW].effect == EFFECT_FREEZE_HIT); PLAYER(SPECIES_LEAFEON) { Ability(ABILITY_LEAF_GUARD); } OPPONENT(SPECIES_WOBBUFFET); } WHEN { - TURN { MOVE(player, MOVE_SUNNY_DAY); MOVE(opponent, MOVE_WILL_O_WISP); } + TURN { MOVE(player, MOVE_SUNNY_DAY); MOVE(opponent, move); } } SCENE { - ABILITY_POPUP(player, ABILITY_LEAF_GUARD); - NOT ANIMATION(ANIM_TYPE_MOVE, MOVE_WILL_O_WISP, opponent); - MESSAGE("It doesn't affect Leafeon…"); - NOT STATUS_ICON(player, burn: TRUE); + switch (move) + { + case MOVE_WILL_O_WISP: + MESSAGE("Foe Wobbuffet used Will-o-Wisp!"); + NOT ANIMATION(ANIM_TYPE_MOVE, MOVE_WILL_O_WISP, opponent); + ABILITY_POPUP(player, ABILITY_LEAF_GUARD); + MESSAGE("It doesn't affect Leafeon…"); + break; + case MOVE_HYPNOSIS: + MESSAGE("Foe Wobbuffet used Hypnosis!"); + NOT ANIMATION(ANIM_TYPE_MOVE, MOVE_HYPNOSIS, opponent); + ABILITY_POPUP(player, ABILITY_LEAF_GUARD); + MESSAGE("It doesn't affect Leafeon…"); + break; + case MOVE_THUNDER_WAVE: + MESSAGE("Foe Wobbuffet used Thunder Wave!"); + NOT ANIMATION(ANIM_TYPE_MOVE, MOVE_THUNDER_WAVE, opponent); + ABILITY_POPUP(player, ABILITY_LEAF_GUARD); + MESSAGE("It doesn't affect Leafeon…"); + break; + case MOVE_TOXIC: + MESSAGE("Foe Wobbuffet used Toxic!"); + NOT ANIMATION(ANIM_TYPE_MOVE, MOVE_TOXIC, opponent); + ABILITY_POPUP(player, ABILITY_LEAF_GUARD); + MESSAGE("It doesn't affect Leafeon…"); + break; + case MOVE_POWDER_SNOW: + MESSAGE("Foe Wobbuffet used Powder Snow!"); + ANIMATION(ANIM_TYPE_MOVE, MOVE_POWDER_SNOW, opponent); + MESSAGE("It's super effective!"); + break; + } + NONE_OF {STATUS_ICON(player, status1: TRUE);} } } -SINGLE_BATTLE_TEST("Leaf Guard prevents non-volatile status conditions from items") +SINGLE_BATTLE_TEST("Leaf Guard prevents status conditions from Flame Orb and Toxic Orb") { + u32 item; + PARAMETRIZE { item = ITEM_FLAME_ORB; } + PARAMETRIZE { item = ITEM_TOXIC_ORB; } GIVEN { ASSUME(gItems[ITEM_FLAME_ORB].holdEffect == HOLD_EFFECT_FLAME_ORB); - PLAYER(SPECIES_LEAFEON) {Ability(ABILITY_LEAF_GUARD); Item(ITEM_FLAME_ORB); }; + ASSUME(gItems[ITEM_TOXIC_ORB].holdEffect == HOLD_EFFECT_TOXIC_ORB); + PLAYER(SPECIES_LEAFEON) {Ability(ABILITY_LEAF_GUARD); Item(item); }; OPPONENT(SPECIES_WOBBUFFET); } WHEN { TURN { MOVE(player, MOVE_SUNNY_DAY); } } SCENE { - NOT MESSAGE("Leafeon was burned!"); - NOT STATUS_ICON(player, burn: TRUE); + if (item == ITEM_FLAME_ORB) { + NONE_OF { MESSAGE("Leafeon was burned!"); STATUS_ICON(player, burn: TRUE);} + } + else { + NONE_OF { MESSAGE("Leafeon is badly poisoned!"); STATUS_ICON(player, poison: TRUE);} + } } }