From 90cf2f026401e1b2839206079b1d8169a35a70d5 Mon Sep 17 00:00:00 2001 From: Alex Date: Tue, 12 Mar 2024 00:40:41 +0100 Subject: [PATCH 1/3] Couple things for 1.8 release --- src/battle_ai_main.c | 4 ++-- src/battle_util.c | 2 +- src/data/moves_info.h | 10 +++------- test/battle/ability/dancer.c | 20 ++++++++++++++++++++ 4 files changed, 26 insertions(+), 10 deletions(-) diff --git a/src/battle_ai_main.c b/src/battle_ai_main.c index 4eb608d7e4fb..c552f446db83 100644 --- a/src/battle_ai_main.c +++ b/src/battle_ai_main.c @@ -3769,9 +3769,9 @@ static u32 AI_CalcMoveScore(u32 battlerAtk, u32 battlerDef, u32 move) IncreaseStatUpScore(battlerAtk, battlerDef, STAT_CHANGE_DEF, &score); break; case EFFECT_FIRST_TURN_ONLY: - if (ShouldFakeOut(battlerAtk, battlerDef, move)) + if (ShouldFakeOut(battlerAtk, battlerDef, move) && MoveHasAdditionalEffectWithChance(move, MOVE_EFFECT_FLINCH, 100)) ADJUST_SCORE(GOOD_EFFECT); - else if (gMovesInfo[move].argument == MOVE_FIRST_IMPRESSION && gDisableStructs[battlerAtk].isFirstTurn && GetBestDmgMoveFromBattler(battlerAtk, battlerDef) == move) + else if (gDisableStructs[battlerAtk].isFirstTurn && GetBestDmgMoveFromBattler(battlerAtk, battlerDef) == move) ADJUST_SCORE(BEST_EFFECT); break; case EFFECT_STOCKPILE: diff --git a/src/battle_util.c b/src/battle_util.c index 41b10b5d1eef..50fb23c6196e 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -8581,7 +8581,7 @@ static inline u32 CalcMoveBasePower(u32 move, u32 battlerAtk, u32 battlerDef, u3 basePower *= 2; break; case EFFECT_VARY_POWER_BASED_ON_HP: - basePower = gMovesInfo[move].argument * gBattleMons[battlerDef].hp / gBattleMons[battlerDef].maxHP; + basePower = gMovesInfo[move].power * gBattleMons[battlerDef].hp / gBattleMons[battlerDef].maxHP; break; case EFFECT_ASSURANCE: if (gProtectStructs[battlerDef].physicalDmg != 0 || gProtectStructs[battlerDef].specialDmg != 0 || gProtectStructs[battlerDef].confusionSelfDmg) diff --git a/src/data/moves_info.h b/src/data/moves_info.h index b4639fd290ea..bd39f63a1d63 100644 --- a/src/data/moves_info.h +++ b/src/data/moves_info.h @@ -9116,14 +9116,13 @@ const struct MoveInfo gMovesInfo[MOVES_COUNT_DYNAMAX] = .name = COMPOUND_STRING("Wring Out"), .description = sWringOutDescription, .effect = EFFECT_VARY_POWER_BASED_ON_HP, - .power = 1, + .power = 120, .type = TYPE_NORMAL, .accuracy = 100, .pp = 5, .target = MOVE_TARGET_SELECTED, .priority = 0, .category = DAMAGE_CATEGORY_SPECIAL, - .argument = 120, .makesContact = TRUE, .contestEffect = CONTEST_EFFECT_STARTLE_PREV_MON, .contestCategory = CONTEST_CATEGORY_SMART, @@ -11094,14 +11093,13 @@ const struct MoveInfo gMovesInfo[MOVES_COUNT_DYNAMAX] = .name = COMPOUND_STRING("Crush Grip"), .description = sWringOutDescription, .effect = EFFECT_VARY_POWER_BASED_ON_HP, - .power = 1, + .power = 120, .type = TYPE_NORMAL, .accuracy = 100, .pp = 5, .target = MOVE_TARGET_SELECTED, .priority = 0, .category = DAMAGE_CATEGORY_PHYSICAL, - .argument = 120, .makesContact = TRUE, .contestEffect = CONTEST_EFFECT_BADLY_STARTLE_FRONT_MON, .contestCategory = CONTEST_CATEGORY_TOUGH, @@ -14866,7 +14864,6 @@ const struct MoveInfo gMovesInfo[MOVES_COUNT_DYNAMAX] = .target = MOVE_TARGET_SELECTED, .priority = 2, .category = DAMAGE_CATEGORY_PHYSICAL, - .argument = MOVE_FIRST_IMPRESSION, .makesContact = TRUE, .contestEffect = CONTEST_EFFECT_BETTER_IF_FIRST, .contestCategory = CONTEST_CATEGORY_COOL, @@ -19652,14 +19649,13 @@ const struct MoveInfo gMovesInfo[MOVES_COUNT_DYNAMAX] = .name = COMPOUND_STRING("Hard Press"), .description = sWringOutDescription, .effect = EFFECT_VARY_POWER_BASED_ON_HP, - .power = 1, + .power = 100, .type = TYPE_STEEL, .accuracy = 100, .pp = 10, .target = MOVE_TARGET_SELECTED, .priority = 0, .category = DAMAGE_CATEGORY_PHYSICAL, - .argument = 100, .makesContact = TRUE, }, diff --git a/test/battle/ability/dancer.c b/test/battle/ability/dancer.c index 97435a2ea752..0fc2fd23b10b 100644 --- a/test/battle/ability/dancer.c +++ b/test/battle/ability/dancer.c @@ -33,3 +33,23 @@ SINGLE_BATTLE_TEST("Dancer can copy Teeter Dance") ANIMATION(ANIM_TYPE_MOVE, MOVE_TEETER_DANCE, opponent); } } + +DOUBLE_BATTLE_TEST("Dancer can copy Teeter Dance and confuse both opposing targets") +{ + KNOWN_FAILING; // Fails because opied move that targets both opposing mons, targets only one when copied by Dancer + GIVEN { + ASSUME(gMovesInfo[MOVE_TEETER_DANCE].danceMove == TRUE); + PLAYER(SPECIES_WOBBUFFET) + PLAYER(SPECIES_WYNAUT) + OPPONENT(SPECIES_ORICORIO) { Ability(ABILITY_DANCER); Item(ITEM_LUM_BERRY); } + OPPONENT(SPECIES_SLOWPOKE) { Ability(ABILITY_OWN_TEMPO); } + } WHEN { + TURN { MOVE(playerLeft, MOVE_TEETER_DANCE); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_TEETER_DANCE, playerLeft); + ABILITY_POPUP(opponentLeft, ABILITY_DANCER); + ANIMATION(ANIM_TYPE_MOVE, MOVE_TEETER_DANCE, opponentLeft); + MESSAGE("Wobbuffet became confused!"); + MESSAGE("Wynaut became confusef!"); + } +} From b748a2a0a028edeb78d889b9cd3e436e9dfb54c1 Mon Sep 17 00:00:00 2001 From: Alex Date: Tue, 12 Mar 2024 01:13:21 +0100 Subject: [PATCH 2/3] revert EFFECT_VARY_POWER_BASED_ON_HP change --- src/battle_util.c | 2 +- src/data/moves_info.h | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/battle_util.c b/src/battle_util.c index 50fb23c6196e..41b10b5d1eef 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -8581,7 +8581,7 @@ static inline u32 CalcMoveBasePower(u32 move, u32 battlerAtk, u32 battlerDef, u3 basePower *= 2; break; case EFFECT_VARY_POWER_BASED_ON_HP: - basePower = gMovesInfo[move].power * gBattleMons[battlerDef].hp / gBattleMons[battlerDef].maxHP; + basePower = gMovesInfo[move].argument * gBattleMons[battlerDef].hp / gBattleMons[battlerDef].maxHP; break; case EFFECT_ASSURANCE: if (gProtectStructs[battlerDef].physicalDmg != 0 || gProtectStructs[battlerDef].specialDmg != 0 || gProtectStructs[battlerDef].confusionSelfDmg) diff --git a/src/data/moves_info.h b/src/data/moves_info.h index bd39f63a1d63..b4639fd290ea 100644 --- a/src/data/moves_info.h +++ b/src/data/moves_info.h @@ -9116,13 +9116,14 @@ const struct MoveInfo gMovesInfo[MOVES_COUNT_DYNAMAX] = .name = COMPOUND_STRING("Wring Out"), .description = sWringOutDescription, .effect = EFFECT_VARY_POWER_BASED_ON_HP, - .power = 120, + .power = 1, .type = TYPE_NORMAL, .accuracy = 100, .pp = 5, .target = MOVE_TARGET_SELECTED, .priority = 0, .category = DAMAGE_CATEGORY_SPECIAL, + .argument = 120, .makesContact = TRUE, .contestEffect = CONTEST_EFFECT_STARTLE_PREV_MON, .contestCategory = CONTEST_CATEGORY_SMART, @@ -11093,13 +11094,14 @@ const struct MoveInfo gMovesInfo[MOVES_COUNT_DYNAMAX] = .name = COMPOUND_STRING("Crush Grip"), .description = sWringOutDescription, .effect = EFFECT_VARY_POWER_BASED_ON_HP, - .power = 120, + .power = 1, .type = TYPE_NORMAL, .accuracy = 100, .pp = 5, .target = MOVE_TARGET_SELECTED, .priority = 0, .category = DAMAGE_CATEGORY_PHYSICAL, + .argument = 120, .makesContact = TRUE, .contestEffect = CONTEST_EFFECT_BADLY_STARTLE_FRONT_MON, .contestCategory = CONTEST_CATEGORY_TOUGH, @@ -14864,6 +14866,7 @@ const struct MoveInfo gMovesInfo[MOVES_COUNT_DYNAMAX] = .target = MOVE_TARGET_SELECTED, .priority = 2, .category = DAMAGE_CATEGORY_PHYSICAL, + .argument = MOVE_FIRST_IMPRESSION, .makesContact = TRUE, .contestEffect = CONTEST_EFFECT_BETTER_IF_FIRST, .contestCategory = CONTEST_CATEGORY_COOL, @@ -19649,13 +19652,14 @@ const struct MoveInfo gMovesInfo[MOVES_COUNT_DYNAMAX] = .name = COMPOUND_STRING("Hard Press"), .description = sWringOutDescription, .effect = EFFECT_VARY_POWER_BASED_ON_HP, - .power = 100, + .power = 1, .type = TYPE_STEEL, .accuracy = 100, .pp = 10, .target = MOVE_TARGET_SELECTED, .priority = 0, .category = DAMAGE_CATEGORY_PHYSICAL, + .argument = 100, .makesContact = TRUE, }, From 043b106dc8bff81707ae556b8bb9b685209b7b4f Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Tue, 12 Mar 2024 07:39:20 -0300 Subject: [PATCH 3/3] Fix comment --- test/battle/ability/dancer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/battle/ability/dancer.c b/test/battle/ability/dancer.c index 0fc2fd23b10b..7e520f440bca 100644 --- a/test/battle/ability/dancer.c +++ b/test/battle/ability/dancer.c @@ -36,7 +36,7 @@ SINGLE_BATTLE_TEST("Dancer can copy Teeter Dance") DOUBLE_BATTLE_TEST("Dancer can copy Teeter Dance and confuse both opposing targets") { - KNOWN_FAILING; // Fails because opied move that targets both opposing mons, targets only one when copied by Dancer + KNOWN_FAILING; // Fails because copied move that targets both opposing mons, targets only one when copied by Dancer GIVEN { ASSUME(gMovesInfo[MOVE_TEETER_DANCE].danceMove == TRUE); PLAYER(SPECIES_WOBBUFFET)