From ca39889587281cfda54d2dd554cebbd9f00f7e67 Mon Sep 17 00:00:00 2001 From: Alex Date: Wed, 22 Nov 2023 21:55:08 +0100 Subject: [PATCH] Fixes Howl --- data/battle_scripts_1.s | 8 +++++ test/battle/move_effect/attack_up_user_ally.c | 33 +++++++++++++++++++ 2 files changed, 41 insertions(+) diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 898be404b5c6..07e0bf065aa2 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -596,6 +596,7 @@ BattleScript_EffectAttackUpUserAlly_TryAlly: BattleScript_EffectAttackUpUserAlly_End: goto BattleScript_MoveEnd BattleScript_EffectAttackUpUserAlly_TryAlly_: + jumpifability BS_ATTACKER_PARTNER, ABILITY_SOUNDPROOF, BattleScript_EffectAttackUpUserAlly_TryAllyBlocked setstatchanger STAT_ATK, 1, FALSE statbuffchange STAT_CHANGE_ALLOW_PTR, BattleScript_EffectAttackUpUserAlly_End jumpifbyte CMP_NOT_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_INCREASE, BattleScript_EffectAttackUpUserAlly_AllyAnim @@ -610,6 +611,13 @@ BattleScript_EffectAttackUpUserAlly_AllyAnim: waitmessage B_WAIT_TIME_LONG goto BattleScript_EffectAttackUpUserAlly_End +BattleScript_EffectAttackUpUserAlly_TryAllyBlocked: + copybyte sBATTLER, gBattlerTarget + call BattleScript_AbilityPopUpTarget + printstring STRINGID_PKMNSXBLOCKSY2 + waitmessage B_WAIT_TIME_LONG + goto BattleScript_MoveEnd + BattleScript_EffectTeatime:: attackcanceler attackstring diff --git a/test/battle/move_effect/attack_up_user_ally.c b/test/battle/move_effect/attack_up_user_ally.c index 6691b49ed8f7..4b7fdae084de 100644 --- a/test/battle/move_effect/attack_up_user_ally.c +++ b/test/battle/move_effect/attack_up_user_ally.c @@ -63,3 +63,36 @@ DOUBLE_BATTLE_TEST("Howl raises user's and partner's Attack", s16 damageLeft, s1 EXPECT_MUL_EQ(results[0].damageRight, Q_4_12(1.5), results[1].damageRight); } } + +DOUBLE_BATTLE_TEST("Howl does not work on partner if it has Soundproof") +{ + s16 damage[2]; + + GIVEN { + ASSUME(gBattleMoves[MOVE_TACKLE].split == SPLIT_PHYSICAL); + PLAYER(SPECIES_WOBBUFFET) { Speed(15); } + PLAYER(SPECIES_VOLTORB) { Speed(10); Ability(ABILITY_SOUNDPROOF); } + OPPONENT(SPECIES_WOBBUFFET) { Speed(5); } + OPPONENT(SPECIES_WYNAUT) { Speed(1); } + } WHEN { + TURN { MOVE(playerRight, MOVE_TACKLE, target: opponentLeft); } + TURN { MOVE(playerLeft, MOVE_HOWL); MOVE(playerRight, MOVE_TACKLE, target: opponentLeft); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, playerRight); + HP_BAR(opponentLeft, captureDamage: &damage[0]); + + ANIMATION(ANIM_TYPE_MOVE, MOVE_HOWL, playerLeft); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, playerLeft); + MESSAGE("Wobbuffet's Attack rose!"); + NONE_OF { + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, playerRight); + MESSAGE("Wynaut's Attack rose!"); + } + ABILITY_POPUP(playerRight, ABILITY_SOUNDPROOF); + MESSAGE("Voltorb's Soundproof blocks Howl!"); + ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, playerRight); + HP_BAR(opponentLeft, captureDamage: &damage[1]); + } THEN { + EXPECT_EQ(damage[0], damage[1]); + } +}