From b4db3b6a813ea84bba39d748f3192514a7433a8d Mon Sep 17 00:00:00 2001 From: kittenchilly Date: Thu, 7 Sep 2023 15:32:26 -0500 Subject: [PATCH 1/6] Add enigma berry effect --- src/battle_util.c | 9 +++++++++ src/data/items.h | 1 + 2 files changed, 10 insertions(+) diff --git a/src/battle_util.c b/src/battle_util.c index 1ff0a762e..cd73d4577 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -7761,6 +7761,15 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn) gBattleScripting.statChanger = SET_STATCHANGER(STAT_SPATK, 1, FALSE); } break; + case HOLD_EFFECT_ENIGMA_BERRY: // consume and heal if hit by super effective move + if (IsBattlerAlive(battlerId) + && TARGET_TURN_DAMAGED + && gMoveResultFlags & MOVE_RESULT_SUPER_EFFECTIVE) + { + effect = ItemHealHp(battlerId, gLastUsedItem, TRUE, TRUE); + } + break; + case HOLD_EFFECT_JABOCA_BERRY: // consume and damage attacker if used physical move if (IsBattlerAlive(battlerId) && TARGET_TURN_DAMAGED diff --git a/src/data/items.h b/src/data/items.h index 5e15b2734..98940277b 100644 --- a/src/data/items.h +++ b/src/data/items.h @@ -7630,6 +7630,7 @@ const struct Item gItems[] = .itemId = ITEM_ENIGMA_BERRY, .price = 20, .holdEffect = HOLD_EFFECT_ENIGMA_BERRY, + .holdEffectParam = 25, .description = sEnigmaBerryDesc, .pocket = POCKET_BERRIES, .type = ITEM_USE_BAG_MENU, From 8f8705929ac9dd94ed4d2a364a4b23a3745ab1be Mon Sep 17 00:00:00 2001 From: kittenchilly Date: Thu, 7 Sep 2023 15:37:58 -0500 Subject: [PATCH 2/6] Update battle_util.c --- src/battle_util.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/battle_util.c b/src/battle_util.c index cd73d4577..87f93389d 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -7769,7 +7769,6 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn) effect = ItemHealHp(battlerId, gLastUsedItem, TRUE, TRUE); } break; - case HOLD_EFFECT_JABOCA_BERRY: // consume and damage attacker if used physical move if (IsBattlerAlive(battlerId) && TARGET_TURN_DAMAGED From 40ac21476433c9d8ca37df10d70f6c8ae81ddfd6 Mon Sep 17 00:00:00 2001 From: kittenchilly Date: Thu, 7 Sep 2023 17:10:25 -0500 Subject: [PATCH 3/6] Fix enigma berry --- src/battle_util.c | 23 +++++++++++++++-------- src/data/items.h | 1 - 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/src/battle_util.c b/src/battle_util.c index 87f93389d..94437dca2 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -6802,6 +6802,21 @@ static u8 ItemEffectMoveEnd(u32 battlerId, u16 holdEffect) case HOLD_EFFECT_SP_DEFENSE_UP: effect = StatRaiseBerry(battlerId, gLastUsedItem, STAT_SPDEF, FALSE); break; + case HOLD_EFFECT_ENIGMA_BERRY: // consume and heal if hit by super effective move + if (IsBattlerAlive(battlerId) + && TARGET_TURN_DAMAGED + && (gBattleScripting.overrideBerryRequirements + || (!DoesSubstituteBlockMove(gBattlerAttacker, battlerId, gCurrentMove) && (gMoveResultFlags & MOVE_RESULT_SUPER_EFFECTIVE)))) + { + gBattleMoveDamage = (gBattleMons[battlerId].maxHP * 25 / 100) * -1; + if (GetBattlerAbility(battlerId) == ABILITY_RIPEN) + gBattleMoveDamage *= 2; + + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_ItemHealHP_RemoveItemRet; + return ITEM_HP_CHANGE; + } + break; case HOLD_EFFECT_KEE_BERRY: // consume and boost defense if used physical move effect = DamagedStatBoostBerryEffect(battlerId, STAT_DEF, SPLIT_PHYSICAL); break; @@ -7761,14 +7776,6 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn) gBattleScripting.statChanger = SET_STATCHANGER(STAT_SPATK, 1, FALSE); } break; - case HOLD_EFFECT_ENIGMA_BERRY: // consume and heal if hit by super effective move - if (IsBattlerAlive(battlerId) - && TARGET_TURN_DAMAGED - && gMoveResultFlags & MOVE_RESULT_SUPER_EFFECTIVE) - { - effect = ItemHealHp(battlerId, gLastUsedItem, TRUE, TRUE); - } - break; case HOLD_EFFECT_JABOCA_BERRY: // consume and damage attacker if used physical move if (IsBattlerAlive(battlerId) && TARGET_TURN_DAMAGED diff --git a/src/data/items.h b/src/data/items.h index 98940277b..5e15b2734 100644 --- a/src/data/items.h +++ b/src/data/items.h @@ -7630,7 +7630,6 @@ const struct Item gItems[] = .itemId = ITEM_ENIGMA_BERRY, .price = 20, .holdEffect = HOLD_EFFECT_ENIGMA_BERRY, - .holdEffectParam = 25, .description = sEnigmaBerryDesc, .pocket = POCKET_BERRIES, .type = ITEM_USE_BAG_MENU, From 09f92719cbe33e0bb0b0045e4e8b13f01d547fda Mon Sep 17 00:00:00 2001 From: Alex <93446519+AlexOn1ine@users.noreply.github.com> Date: Sun, 10 Sep 2023 23:59:12 +0200 Subject: [PATCH 4/6] Tests for status curing berries (#3289) --- test/battle/hold_effect/cure_status.c | 215 ++++++++++++++++++++++++++ 1 file changed, 215 insertions(+) create mode 100644 test/battle/hold_effect/cure_status.c diff --git a/test/battle/hold_effect/cure_status.c b/test/battle/hold_effect/cure_status.c new file mode 100644 index 000000000..c8c32ecf7 --- /dev/null +++ b/test/battle/hold_effect/cure_status.c @@ -0,0 +1,215 @@ +#include "global.h" +#include "test/battle.h" + +ASSUMPTIONS +{ + ASSUME(gItems[ITEM_LUM_BERRY].holdEffect == HOLD_EFFECT_CURE_STATUS); +} + +SINGLE_BATTLE_TEST("Pecha and Lum Berries cure poison") +{ + u16 item; + + PARAMETRIZE { item = ITEM_PECHA_BERRY; } + PARAMETRIZE { item = ITEM_LUM_BERRY; } + + GIVEN { + ASSUME(gItems[ITEM_PECHA_BERRY].holdEffect == HOLD_EFFECT_CURE_PSN); + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET) { Item(item); } + } WHEN { + TURN { MOVE(player, MOVE_POISON_POWDER); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_POISON_POWDER, player); + ANIMATION(ANIM_TYPE_STATUS, B_ANIM_STATUS_PSN, opponent); + STATUS_ICON(opponent, poison: TRUE); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, opponent); + STATUS_ICON(opponent, poison: FALSE); + } +} + +SINGLE_BATTLE_TEST("Pecha and Lum Berries cure bad poison") +{ + u16 item; + + PARAMETRIZE { item = ITEM_PECHA_BERRY; } + PARAMETRIZE { item = ITEM_LUM_BERRY; } + + GIVEN { + ASSUME(gItems[ITEM_PECHA_BERRY].holdEffect == HOLD_EFFECT_CURE_PSN); + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET) { Item(item); } + } WHEN { + TURN { MOVE(player, MOVE_TOXIC); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_TOXIC, player); + ANIMATION(ANIM_TYPE_STATUS, B_ANIM_STATUS_PSN, opponent); + STATUS_ICON(opponent, badPoison: TRUE); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, opponent); + STATUS_ICON(opponent, badPoison: FALSE); + } +} + +SINGLE_BATTLE_TEST("Rawst and Lum Berries cure burn") +{ + u16 item; + + PARAMETRIZE { item = ITEM_RAWST_BERRY; } + PARAMETRIZE { item = ITEM_LUM_BERRY; } + + GIVEN { + ASSUME(gItems[ITEM_RAWST_BERRY].holdEffect == HOLD_EFFECT_CURE_BRN); + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET) { Item(item); } + } WHEN { + TURN { MOVE(player, MOVE_WILL_O_WISP); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_WILL_O_WISP, player); + ANIMATION(ANIM_TYPE_STATUS, B_ANIM_STATUS_BRN, opponent); + STATUS_ICON(opponent, burn: TRUE); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, opponent); + STATUS_ICON(opponent, burn: FALSE); + } +} + +SINGLE_BATTLE_TEST("Aspear and Lum Berries cure freeze") +{ + u16 item; + + PARAMETRIZE { item = ITEM_ASPEAR_BERRY; } + PARAMETRIZE { item = ITEM_LUM_BERRY; } + + GIVEN { + ASSUME(gItems[ITEM_ASPEAR_BERRY].holdEffect == HOLD_EFFECT_CURE_FRZ); + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET) { Item(item); } + } WHEN { + TURN { MOVE(player, MOVE_ICE_PUNCH); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_ICE_PUNCH, player); + ANIMATION(ANIM_TYPE_STATUS, B_ANIM_STATUS_FRZ, opponent); + STATUS_ICON(opponent, freeze: TRUE); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, opponent); + STATUS_ICON(opponent, freeze: FALSE); + } +} + +SINGLE_BATTLE_TEST("Chesto and Lum Berries cure sleep") +{ + u16 item; + + PARAMETRIZE { item = ITEM_CHESTO_BERRY; } + PARAMETRIZE { item = ITEM_LUM_BERRY; } + + GIVEN { + ASSUME(gItems[ITEM_CHESTO_BERRY].holdEffect == HOLD_EFFECT_CURE_SLP); + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET) { Item(item); } + } WHEN { + TURN { MOVE(player, MOVE_HYPNOSIS); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_HYPNOSIS, player); + ANIMATION(ANIM_TYPE_STATUS, B_ANIM_STATUS_SLP, opponent); + STATUS_ICON(opponent, sleep: TRUE); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, opponent); + STATUS_ICON(opponent, sleep: FALSE); + } +} + +SINGLE_BATTLE_TEST("Cheri and Lum Berries cure paralysis") +{ + u16 item; + + PARAMETRIZE { item = ITEM_CHERI_BERRY; } + PARAMETRIZE { item = ITEM_LUM_BERRY; } + + GIVEN { + ASSUME(gItems[ITEM_CHERI_BERRY].holdEffect == HOLD_EFFECT_CURE_PAR); + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET) { Item(item); } + } WHEN { + TURN { MOVE(player, MOVE_THUNDER_WAVE); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_THUNDER_WAVE, player); + ANIMATION(ANIM_TYPE_STATUS, B_ANIM_STATUS_PRZ, opponent); + STATUS_ICON(opponent, paralysis: TRUE); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, opponent); + STATUS_ICON(opponent, paralysis: FALSE); + } +} + +SINGLE_BATTLE_TEST("Perism and Lum Berries cure confusion") +{ + u16 item; + + PARAMETRIZE { item = ITEM_PERSIM_BERRY; } + PARAMETRIZE { item = ITEM_LUM_BERRY; } + + GIVEN { + ASSUME(gItems[ITEM_PERSIM_BERRY].holdEffect == HOLD_EFFECT_CURE_CONFUSION); + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET) { Item(item); } + } WHEN { + TURN { MOVE(player, MOVE_CONFUSE_RAY); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_CONFUSE_RAY, player); + ANIMATION(ANIM_TYPE_STATUS, B_ANIM_STATUS_CONFUSION, opponent); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, opponent); + } +} + +SINGLE_BATTLE_TEST("Berry hold effect cures status if a pokemon enters a battle") +{ + u16 status; + u16 item; + + PARAMETRIZE{ status = STATUS1_BURN; item = ITEM_RAWST_BERRY; } + PARAMETRIZE{ status = STATUS1_FREEZE; item = ITEM_ASPEAR_BERRY; } + PARAMETRIZE{ status = STATUS1_PARALYSIS; item = ITEM_CHERI_BERRY; } + PARAMETRIZE{ status = STATUS1_POISON; item = ITEM_PECHA_BERRY; } + PARAMETRIZE{ status = STATUS1_TOXIC_POISON; item = ITEM_PECHA_BERRY; } + PARAMETRIZE{ status = STATUS1_SLEEP; item = ITEM_CHESTO_BERRY; } + + GIVEN { + ASSUME(gItems[ITEM_RAWST_BERRY].holdEffect == HOLD_EFFECT_CURE_BRN); + ASSUME(gItems[ITEM_ASPEAR_BERRY].holdEffect == HOLD_EFFECT_CURE_FRZ); + ASSUME(gItems[ITEM_CHERI_BERRY].holdEffect == HOLD_EFFECT_CURE_PAR); + ASSUME(gItems[ITEM_PECHA_BERRY].holdEffect == HOLD_EFFECT_CURE_PSN); + ASSUME(gItems[ITEM_CHESTO_BERRY].holdEffect == HOLD_EFFECT_CURE_SLP); + PLAYER(SPECIES_WOBBUFFET) { Status1(status); Item(ITEM_LUM_BERRY); } + OPPONENT(SPECIES_WOBBUFFET) { Status1(status); Item(item); } + } WHEN { + TURN { } + } SCENE { + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, player); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, opponent); + } +} + +SINGLE_BATTLE_TEST("Pokemon can be further poisoned with Toxic spikes after a status healing hold effect was previously used") +{ + u16 item; + + PARAMETRIZE { item = ITEM_PECHA_BERRY; } + PARAMETRIZE { item = ITEM_LUM_BERRY; } + + KNOWN_FAILING; + GIVEN { + ASSUME(gItems[ITEM_PECHA_BERRY].holdEffect == HOLD_EFFECT_CURE_PSN); + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WYNAUT) { Item(item); } + } WHEN { + TURN { MOVE(player, MOVE_TOXIC_SPIKES); } + TURN { SWITCH(opponent, 1); } + TURN { SWITCH(opponent, 0); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_TOXIC_SPIKES, player); + ANIMATION(ANIM_TYPE_STATUS, B_ANIM_STATUS_PSN, opponent); + STATUS_ICON(opponent, poison: TRUE); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, opponent); + STATUS_ICON(opponent, poison: FALSE); + ANIMATION(ANIM_TYPE_STATUS, B_ANIM_STATUS_PSN, opponent); + STATUS_ICON(opponent, poison: TRUE); + } +} From 13dedfb5116ac9d61e65ddd905092308bcb03e56 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada D'Ottone Date: Mon, 11 Sep 2023 10:37:17 -0300 Subject: [PATCH 5/6] Revert "Implement Enigma Berry's hold effect" (#3298) --- src/battle_util.c | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/src/battle_util.c b/src/battle_util.c index 94437dca2..1ff0a762e 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -6802,21 +6802,6 @@ static u8 ItemEffectMoveEnd(u32 battlerId, u16 holdEffect) case HOLD_EFFECT_SP_DEFENSE_UP: effect = StatRaiseBerry(battlerId, gLastUsedItem, STAT_SPDEF, FALSE); break; - case HOLD_EFFECT_ENIGMA_BERRY: // consume and heal if hit by super effective move - if (IsBattlerAlive(battlerId) - && TARGET_TURN_DAMAGED - && (gBattleScripting.overrideBerryRequirements - || (!DoesSubstituteBlockMove(gBattlerAttacker, battlerId, gCurrentMove) && (gMoveResultFlags & MOVE_RESULT_SUPER_EFFECTIVE)))) - { - gBattleMoveDamage = (gBattleMons[battlerId].maxHP * 25 / 100) * -1; - if (GetBattlerAbility(battlerId) == ABILITY_RIPEN) - gBattleMoveDamage *= 2; - - BattleScriptPushCursor(); - gBattlescriptCurrInstr = BattleScript_ItemHealHP_RemoveItemRet; - return ITEM_HP_CHANGE; - } - break; case HOLD_EFFECT_KEE_BERRY: // consume and boost defense if used physical move effect = DamagedStatBoostBerryEffect(battlerId, STAT_DEF, SPLIT_PHYSICAL); break; From ca9e78410269c66a0980b80387f4f5fa11f9dbc9 Mon Sep 17 00:00:00 2001 From: Alex <93446519+AlexOn1ine@users.noreply.github.com> Date: Wed, 13 Sep 2023 10:31:20 +0200 Subject: [PATCH 6/6] Fixes Toxic Debris + CanTargetFaintAi index issue (#3306) * Fixes Toxic Debris + CanTargetFaintAi index issue * swap macro --- data/battle_scripts_1.s | 3 + src/battle_ai_util.c | 2 +- src/battle_util.c | 4 +- test/battle/ability/toxic_debris.c | 96 ++++++++++++++++++++++++++++++ 4 files changed, 102 insertions(+), 3 deletions(-) create mode 100644 test/battle/ability/toxic_debris.c diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 9ef768530..405ad3d10 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -7333,6 +7333,9 @@ BattleScript_ToxicDebrisActivates:: printstring STRINGID_POISONSPIKESSCATTERED waitmessage B_WAIT_TIME_LONG BattleScript_ToxicDebrisRet: + copybyte sBATTLER, gBattlerTarget + copybyte gBattlerTarget, gBattlerAttacker + copybyte gBattlerAttacker, sBATTLER return BattleScript_EarthEaterActivates:: diff --git a/src/battle_ai_util.c b/src/battle_ai_util.c index d7e32a452..aff8ba91a 100644 --- a/src/battle_ai_util.c +++ b/src/battle_ai_util.c @@ -1154,7 +1154,7 @@ bool32 CanTargetFaintAi(u8 battlerDef, u8 battlerAtk) for (i = 0; i < MAX_MON_MOVES; i++) { if (moves[i] != MOVE_NONE && moves[i] != 0xFFFF && !(unusable & gBitTable[i]) - && AI_DATA->simulatedDmg[battlerDef][battlerAtk][moves[i]] >= gBattleMons[battlerAtk].hp) + && AI_DATA->simulatedDmg[battlerDef][battlerAtk][i] >= gBattleMons[battlerAtk].hp) { return TRUE; } diff --git a/src/battle_util.c b/src/battle_util.c index 1ff0a762e..32bbce974 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -5710,10 +5710,10 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move && !gProtectStructs[gBattlerAttacker].confusionSelfDmg && IS_MOVE_PHYSICAL(gCurrentMove) && TARGET_TURN_DAMAGED - && !(gSideStatuses[GetBattlerSide(gBattlerAttacker)] & SIDE_STATUS_TOXIC_SPIKES) + && (gSideTimers[gBattlerAttacker].toxicSpikesAmount != 2) && IsBattlerAlive(gBattlerTarget)) { - gBattlerTarget = gBattlerAttacker; + SWAP(gBattlerAttacker, gBattlerTarget, i); BattleScriptPushCursor(); gBattlescriptCurrInstr = BattleScript_ToxicDebrisActivates; effect++; diff --git a/test/battle/ability/toxic_debris.c b/test/battle/ability/toxic_debris.c new file mode 100644 index 000000000..95749358a --- /dev/null +++ b/test/battle/ability/toxic_debris.c @@ -0,0 +1,96 @@ +#include "global.h" +#include "test/battle.h" + +SINGLE_BATTLE_TEST("Toxic Debris sets Toxic Spikes on the opposing side if hit by a physical attack") +{ + u32 move; + + PARAMETRIZE { move = MOVE_TACKLE;} + PARAMETRIZE { move = MOVE_SWIFT;} + + GIVEN { + PLAYER(SPECIES_WOBBUFFET) { Ability(ABILITY_TOXIC_DEBRIS); } + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(opponent, move); } + } SCENE { + if (move == MOVE_TACKLE) { + ABILITY_POPUP(player, ABILITY_TOXIC_DEBRIS); + MESSAGE("Poison Spikes were scattered all around the opposing team's feet!"); + } + else { + NOT ABILITY_POPUP(player, ABILITY_TOXIC_DEBRIS); + NOT MESSAGE("Poison Spikes were scattered all around the opposing team's feet!"); + } + } +} + +SINGLE_BATTLE_TEST("Toxic Debris does not activate if two layers of Toxic Spikes are already up") +{ + GIVEN { + PLAYER(SPECIES_WOBBUFFET) { Ability(ABILITY_TOXIC_DEBRIS); } + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(opponent, MOVE_TACKLE); } + TURN { MOVE(opponent, MOVE_TACKLE); } + TURN { MOVE(opponent, MOVE_TACKLE); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, opponent); + ABILITY_POPUP(player, ABILITY_TOXIC_DEBRIS); + MESSAGE("Poison Spikes were scattered all around the opposing team's feet!"); + ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, opponent); + ABILITY_POPUP(player, ABILITY_TOXIC_DEBRIS); + MESSAGE("Poison Spikes were scattered all around the opposing team's feet!"); + ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, opponent); + NOT ABILITY_POPUP(player, ABILITY_TOXIC_DEBRIS); + NOT MESSAGE("Poison Spikes were scattered all around the opposing team's feet!"); + } +} + +SINGLE_BATTLE_TEST("If a Substitute is hit, Toxic Debris does not set Toxic Spikes") +{ + GIVEN { + PLAYER(SPECIES_WOBBUFFET) { Ability(ABILITY_TOXIC_DEBRIS); } + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, MOVE_SUBSTITUTE); } + TURN { MOVE(opponent, MOVE_TACKLE); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_SUBSTITUTE, player); + ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, opponent); + NOT ABILITY_POPUP(player, ABILITY_TOXIC_DEBRIS); + NOT MESSAGE("Poison Spikes were scattered all around the opposing team's feet!"); + } +} + +SINGLE_BATTLE_TEST("Each hit of a Multi Hit move activates Toxic Debris") +{ + GIVEN { + PLAYER(SPECIES_WOBBUFFET) { Ability(ABILITY_TOXIC_DEBRIS); } + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(opponent, MOVE_FURY_SWIPES); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_FURY_SWIPES, opponent); + ABILITY_POPUP(player, ABILITY_TOXIC_DEBRIS); + MESSAGE("Poison Spikes were scattered all around the opposing team's feet!"); + ANIMATION(ANIM_TYPE_MOVE, MOVE_FURY_SWIPES, opponent); + ABILITY_POPUP(player, ABILITY_TOXIC_DEBRIS); + MESSAGE("Poison Spikes were scattered all around the opposing team's feet!"); + } +} + +SINGLE_BATTLE_TEST("Air Balloon is popped after Toxic Debris activates") +{ + GIVEN { + PLAYER(SPECIES_WOBBUFFET) { Ability(ABILITY_TOXIC_DEBRIS); Item(ITEM_AIR_BALLOON); } + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(opponent, MOVE_TACKLE); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, opponent); + ABILITY_POPUP(player, ABILITY_TOXIC_DEBRIS); + MESSAGE("Poison Spikes were scattered all around the opposing team's feet!"); + MESSAGE("Wobbuffet's Air Balloon popped!"); + } +}