diff --git a/src/battle_util.c b/src/battle_util.c index f6c577a31ca0..b2cf51ba0c1c 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -5313,6 +5313,7 @@ u32 AbilityBattleEffects(u32 caseID, u32 battler, u32 ability, u32 special, u32 } if (caseID == ABILITYEFFECT_WOULD_ABSORB) { + gBattleStruct->pledgeMove = FALSE; if (effect && gLastUsedAbility != 0xFFFF) RecordAbilityBattle(battler, gLastUsedAbility); @@ -5320,6 +5321,7 @@ u32 AbilityBattleEffects(u32 caseID, u32 battler, u32 ability, u32 special, u32 } else if (effect == 1) // Drain Hp ability. { + gBattleStruct->pledgeMove = FALSE; if (BATTLER_MAX_HP(battler) || (B_HEAL_BLOCKING >= GEN_5 && gStatuses3[battler] & STATUS3_HEAL_BLOCK)) { if ((gProtectStructs[gBattlerAttacker].notFirstStrike)) @@ -5342,6 +5344,7 @@ u32 AbilityBattleEffects(u32 caseID, u32 battler, u32 ability, u32 special, u32 } else if (effect == 2) // Boost Stat ability; { + gBattleStruct->pledgeMove = FALSE; if (!CompareStat(battler, statId, MAX_STAT_STAGE, CMP_LESS_THAN)) { if ((gProtectStructs[gBattlerAttacker].notFirstStrike)) @@ -5363,6 +5366,7 @@ u32 AbilityBattleEffects(u32 caseID, u32 battler, u32 ability, u32 special, u32 } else if (effect == 3) { + gBattleStruct->pledgeMove = FALSE; if (!(gBattleResources->flags->flags[battler] & RESOURCE_FLAG_FLASH_FIRE)) { gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_FLASH_FIRE_BOOST; diff --git a/test/battle/move_effect/pledge.c b/test/battle/move_effect/pledge.c index 2220b74186a6..d2cc16aa47da 100644 --- a/test/battle/move_effect/pledge.c +++ b/test/battle/move_effect/pledge.c @@ -836,3 +836,216 @@ DOUBLE_BATTLE_TEST("Pledge move combo doesn't trigger on opponent's Pledge move HP_BAR(opponentLeft); } } + +DOUBLE_BATTLE_TEST("Pledge move combo doesn't trigger on opponent's Pledge move - Electrify") +{ + GIVEN { + ASSUME(gMovesInfo[MOVE_ELECTRIFY].effect == EFFECT_ELECTRIFY); + PLAYER(SPECIES_MAROWAK) { Ability(ABILITY_LIGHTNING_ROD); } + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WYNAUT); + } WHEN { + TURN { MOVE(playerRight, MOVE_ELECTRIFY, target: opponentRight); + MOVE(opponentLeft, MOVE_GRASS_PLEDGE, target: playerLeft); + MOVE(opponentRight, MOVE_FIRE_PLEDGE, target: playerLeft); + MOVE(playerLeft, MOVE_WATER_PLEDGE, target: opponentRight); } + } SCENE { + NONE_OF { + ANIMATION(ANIM_TYPE_MOVE, MOVE_GRASS_PLEDGE, opponentLeft); + ANIMATION(ANIM_TYPE_MOVE, MOVE_GRASS_PLEDGE, opponentRight); + ANIMATION(ANIM_TYPE_MOVE, MOVE_FIRE_PLEDGE, opponentRight); + ANIMATION(ANIM_TYPE_MOVE, MOVE_FIRE_PLEDGE, playerLeft); + } + ANIMATION(ANIM_TYPE_MOVE, MOVE_WATER_PLEDGE, playerLeft); + HP_BAR(opponentRight); + } +} + +DOUBLE_BATTLE_TEST("Pledge move combo doesn't trigger on opponent's Pledge move - Storm Drain") +{ + GIVEN { + PLAYER(SPECIES_GASTRODON) { Ability(ABILITY_STORM_DRAIN); } + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WYNAUT); + } WHEN { + TURN { MOVE(opponentLeft, MOVE_FIRE_PLEDGE, target: playerLeft); + MOVE(opponentRight, MOVE_WATER_PLEDGE, target: playerLeft); + MOVE(playerLeft, MOVE_GRASS_PLEDGE, target: opponentRight); } + } SCENE { + NONE_OF { + ANIMATION(ANIM_TYPE_MOVE, MOVE_FIRE_PLEDGE, opponentLeft); + ANIMATION(ANIM_TYPE_MOVE, MOVE_FIRE_PLEDGE, opponentRight); + ANIMATION(ANIM_TYPE_MOVE, MOVE_WATER_PLEDGE, opponentRight); + ANIMATION(ANIM_TYPE_MOVE, MOVE_WATER_PLEDGE, playerLeft); + } + ANIMATION(ANIM_TYPE_MOVE, MOVE_GRASS_PLEDGE, playerLeft); + HP_BAR(opponentRight); + } +} + +DOUBLE_BATTLE_TEST("Pledge move combo doesn't trigger on opponent's Pledge move - Sap Sipper") +{ + GIVEN { + PLAYER(SPECIES_GOODRA) { Ability(ABILITY_SAP_SIPPER); } + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WYNAUT); + } WHEN { + TURN { MOVE(opponentLeft, MOVE_WATER_PLEDGE, target: playerLeft); + MOVE(opponentRight, MOVE_GRASS_PLEDGE, target: playerLeft); + MOVE(playerLeft, MOVE_FIRE_PLEDGE, target: opponentRight); } + } SCENE { + NONE_OF { + ANIMATION(ANIM_TYPE_MOVE, MOVE_WATER_PLEDGE, opponentLeft); + ANIMATION(ANIM_TYPE_MOVE, MOVE_WATER_PLEDGE, opponentRight); + ANIMATION(ANIM_TYPE_MOVE, MOVE_GRASS_PLEDGE, opponentRight); + ANIMATION(ANIM_TYPE_MOVE, MOVE_GRASS_PLEDGE, playerLeft); + } + ANIMATION(ANIM_TYPE_MOVE, MOVE_FIRE_PLEDGE, playerLeft); + HP_BAR(opponentRight); + } +} + +DOUBLE_BATTLE_TEST("Pledge move combo doesn't trigger on opponent's Pledge move - Dry Skin") +{ + GIVEN { + PLAYER(SPECIES_PARASECT) { Ability(ABILITY_DRY_SKIN); } + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WYNAUT); + } WHEN { + TURN { MOVE(opponentLeft, MOVE_FIRE_PLEDGE, target: playerLeft); + MOVE(opponentRight, MOVE_WATER_PLEDGE, target: playerLeft); + MOVE(playerLeft, MOVE_GRASS_PLEDGE, target: opponentRight); } + } SCENE { + NONE_OF { + ANIMATION(ANIM_TYPE_MOVE, MOVE_FIRE_PLEDGE, opponentLeft); + ANIMATION(ANIM_TYPE_MOVE, MOVE_FIRE_PLEDGE, opponentRight); + ANIMATION(ANIM_TYPE_MOVE, MOVE_WATER_PLEDGE, opponentRight); + ANIMATION(ANIM_TYPE_MOVE, MOVE_WATER_PLEDGE, playerLeft); + } + ANIMATION(ANIM_TYPE_MOVE, MOVE_GRASS_PLEDGE, playerLeft); + HP_BAR(opponentRight); + } +} + +DOUBLE_BATTLE_TEST("Pledge move combo doesn't trigger on opponent's Pledge move - Flash Fire") +{ + GIVEN { + PLAYER(SPECIES_HEATRAN) { Ability(ABILITY_FLASH_FIRE); } + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WYNAUT); + } WHEN { + TURN { MOVE(opponentLeft, MOVE_GRASS_PLEDGE, target: playerLeft); + MOVE(opponentRight, MOVE_FIRE_PLEDGE, target: playerLeft); + MOVE(playerLeft, MOVE_WATER_PLEDGE, target: opponentRight); } + } SCENE { + NONE_OF { + ANIMATION(ANIM_TYPE_MOVE, MOVE_GRASS_PLEDGE, opponentLeft); + ANIMATION(ANIM_TYPE_MOVE, MOVE_GRASS_PLEDGE, opponentRight); + ANIMATION(ANIM_TYPE_MOVE, MOVE_FIRE_PLEDGE, opponentRight); + ANIMATION(ANIM_TYPE_MOVE, MOVE_FIRE_PLEDGE, playerLeft); + } + ANIMATION(ANIM_TYPE_MOVE, MOVE_WATER_PLEDGE, playerLeft); + HP_BAR(opponentRight); + } +} + +DOUBLE_BATTLE_TEST("Pledge move combo doesn't trigger on opponent's Pledge move - Motor Drive") +{ + GIVEN { + ASSUME(gMovesInfo[MOVE_ELECTRIFY].effect == EFFECT_ELECTRIFY); + PLAYER(SPECIES_ELECTIVIRE) { Ability(ABILITY_MOTOR_DRIVE); } + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WYNAUT); + } WHEN { + TURN { MOVE(playerRight, MOVE_ELECTRIFY, target: opponentRight); + MOVE(opponentLeft, MOVE_WATER_PLEDGE, target: playerLeft); + MOVE(opponentRight, MOVE_GRASS_PLEDGE, target: playerLeft); + MOVE(playerLeft, MOVE_FIRE_PLEDGE, target: opponentRight); } + } SCENE { + NONE_OF { + ANIMATION(ANIM_TYPE_MOVE, MOVE_WATER_PLEDGE, opponentLeft); + ANIMATION(ANIM_TYPE_MOVE, MOVE_WATER_PLEDGE, opponentRight); + ANIMATION(ANIM_TYPE_MOVE, MOVE_GRASS_PLEDGE, opponentRight); + ANIMATION(ANIM_TYPE_MOVE, MOVE_GRASS_PLEDGE, playerLeft); + } + ANIMATION(ANIM_TYPE_MOVE, MOVE_FIRE_PLEDGE, playerLeft); + HP_BAR(opponentRight); + } +} + +DOUBLE_BATTLE_TEST("Pledge move combo doesn't trigger on opponent's Pledge move - Volt Absorb") +{ + GIVEN { + ASSUME(gMovesInfo[MOVE_ELECTRIFY].effect == EFFECT_ELECTRIFY); + PLAYER(SPECIES_JOLTEON) { Ability(ABILITY_VOLT_ABSORB); } + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WYNAUT); + } WHEN { + TURN { MOVE(playerRight, MOVE_ELECTRIFY, target: opponentRight); + MOVE(opponentLeft, MOVE_WATER_PLEDGE, target: playerLeft); + MOVE(opponentRight, MOVE_GRASS_PLEDGE, target: playerLeft); + MOVE(playerLeft, MOVE_GRASS_PLEDGE, target: opponentRight); } + } SCENE { + NONE_OF { + ANIMATION(ANIM_TYPE_MOVE, MOVE_FIRE_PLEDGE, opponentLeft); + ANIMATION(ANIM_TYPE_MOVE, MOVE_FIRE_PLEDGE, opponentRight); + ANIMATION(ANIM_TYPE_MOVE, MOVE_GRASS_PLEDGE, opponentRight); + ANIMATION(ANIM_TYPE_MOVE, MOVE_FIRE_PLEDGE, playerLeft); + } + ANIMATION(ANIM_TYPE_MOVE, MOVE_GRASS_PLEDGE, playerLeft); + HP_BAR(opponentRight); + } +} + +DOUBLE_BATTLE_TEST("Pledge move combo doesn't trigger on opponent's Pledge move - Water Absorb") +{ + GIVEN { + PLAYER(SPECIES_VAPOREON) { Ability(ABILITY_WATER_ABSORB); } + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WYNAUT); + } WHEN { + TURN { MOVE(opponentLeft, MOVE_FIRE_PLEDGE, target: playerLeft); + MOVE(opponentRight, MOVE_WATER_PLEDGE, target: playerLeft); + MOVE(playerLeft, MOVE_GRASS_PLEDGE, target: opponentRight); } + } SCENE { + NONE_OF { + ANIMATION(ANIM_TYPE_MOVE, MOVE_FIRE_PLEDGE, opponentLeft); + ANIMATION(ANIM_TYPE_MOVE, MOVE_FIRE_PLEDGE, opponentRight); + ANIMATION(ANIM_TYPE_MOVE, MOVE_WATER_PLEDGE, opponentRight); + ANIMATION(ANIM_TYPE_MOVE, MOVE_WATER_PLEDGE, playerLeft); + } + ANIMATION(ANIM_TYPE_MOVE, MOVE_GRASS_PLEDGE, playerLeft); + HP_BAR(opponentRight); + } +} + +DOUBLE_BATTLE_TEST("Pledge move combo doesn't trigger on opponent's Pledge move - Well Baked Body") +{ + GIVEN { + PLAYER(SPECIES_DACHSBUN) { Ability(ABILITY_WELL_BAKED_BODY); } + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WYNAUT); + } WHEN { + TURN { MOVE(opponentLeft, MOVE_GRASS_PLEDGE, target: playerLeft); + MOVE(opponentRight, MOVE_FIRE_PLEDGE, target: playerLeft); + MOVE(playerLeft, MOVE_WATER_PLEDGE, target: opponentRight); } + } SCENE { + NONE_OF { + ANIMATION(ANIM_TYPE_MOVE, MOVE_GRASS_PLEDGE, opponentLeft); + ANIMATION(ANIM_TYPE_MOVE, MOVE_GRASS_PLEDGE, opponentRight); + ANIMATION(ANIM_TYPE_MOVE, MOVE_FIRE_PLEDGE, opponentRight); + ANIMATION(ANIM_TYPE_MOVE, MOVE_FIRE_PLEDGE, playerLeft); + } + ANIMATION(ANIM_TYPE_MOVE, MOVE_WATER_PLEDGE, playerLeft); + HP_BAR(opponentRight); + } +}