diff --git a/include/battle_ai_util.h b/include/battle_ai_util.h index c83c47e583..2ace5b4c55 100644 --- a/include/battle_ai_util.h +++ b/include/battle_ai_util.h @@ -101,7 +101,8 @@ bool32 HasOnlyMovesWithSplit(u32 battlerId, u32 split, bool32 onlyOffensive); bool32 HasMoveWithSplit(u32 battler, u32 split); bool32 HasMoveWithType(u32 battler, u32 type); bool32 HasMoveWithTypeAndSplit(u32 battler, u32 type, u32 split); -bool32 HasMoveEffect(u32 battlerId, u32 moveEffect); +bool32 HasMoveEffect(u32 battlerId, u32 effect); +bool32 HasMoveWithMoveEffect(u32 battlerId, u32 moveEffect, u32 effectHitOnly); bool32 HasMoveWithLowAccuracy(u32 battlerAtk, u32 battlerDef, u32 accCheck, bool32 ignoreStatus, u32 atkAbility, u32 defAbility, u32 atkHoldEffect, u32 defHoldEffect); bool32 IsAromaVeilProtectedMove(u32 move); bool32 IsNonVolatileStatusMoveEffect(u32 moveEffect); diff --git a/include/battle_util.h b/include/battle_util.h index 6e3f6a09d6..4ab858fb06 100644 --- a/include/battle_util.h +++ b/include/battle_util.h @@ -221,7 +221,7 @@ void CopyMonAbilityAndTypesToBattleMon(u32 battler, struct Pokemon *mon); void RecalcBattlerStats(u32 battler, struct Pokemon *mon); bool32 IsAlly(u32 battlerAtk, u32 battlerDef); bool32 IsGen6ExpShareEnabled(void); -bool32 MoveHasMoveEffect(u16 move, u16 moveEffect); +bool32 MoveHasMoveEffect(u32 move, u32 moveEffect, bool32 effectHitOnly); // Ability checks bool32 IsRolePlayBannedAbilityAtk(u16 ability); diff --git a/src/battle_ai_main.c b/src/battle_ai_main.c index 19c8feebef..5dfd372d2e 100644 --- a/src/battle_ai_main.c +++ b/src/battle_ai_main.c @@ -3532,9 +3532,6 @@ static s32 AI_CheckViability(u32 battlerAtk, u32 battlerDef, u32 move, s32 score if (!IS_BATTLER_OF_TYPE(battlerAtk, gBattleMoves[gBattleMons[battlerAtk].moves[0]].type)) ADJUST_SCORE(1); break; - case EFFECT_FLINCH_HIT: - score += ShouldTryToFlinch(battlerAtk, battlerDef, aiData->abilities[battlerAtk], aiData->abilities[battlerDef], move); - break; case EFFECT_SWALLOW: if (gDisableStructs[battlerAtk].stockpileCounter == 0) { @@ -4881,11 +4878,21 @@ static s32 AI_CheckViability(u32 battlerAtk, u32 battlerDef, u32 move, s32 score break; } // move effect checks - // check move additional effects that are certain/100% likely to happen + // check move additional effects that are likely to happen for (i = 0; i < gBattleMoves[move].numAdditionalEffects; i++) { - if (gBattleMoves[move].additionalEffects[i].self - || gBattleMoves[move].additionalEffects[i].chance % 100) + if (gBattleMoves[move].additionalEffects[i].self) + continue; + + switch (gBattleMoves[move].additionalEffects[i].moveEffect) + { + case MOVE_EFFECT_FLINCH: + score += ShouldTryToFlinch(battlerAtk, battlerDef, aiData->abilities[battlerAtk], aiData->abilities[battlerDef], move); + break; + } + + // Only consider the below if they're certain to happen + if (gBattleMoves[move].additionalEffects[i].chance % 100) continue; switch (gBattleMoves[move].additionalEffects[i].moveEffect) diff --git a/src/battle_ai_util.c b/src/battle_ai_util.c index 972cda12b1..bf3f1920c8 100644 --- a/src/battle_ai_util.c +++ b/src/battle_ai_util.c @@ -1962,14 +1962,30 @@ bool32 HasMoveWithType(u32 battler, u32 type) return FALSE; } -bool32 HasMoveEffect(u32 battlerId, u32 moveEffect) +bool32 HasMoveEffect(u32 battlerId, u32 effect) { s32 i; u16 *moves = GetMovesArray(battlerId); for (i = 0; i < MAX_MON_MOVES; i++) { - if (moves[i] != MOVE_NONE && moves[i] != MOVE_UNAVAILABLE && gBattleMoves[moves[i]].effect == moveEffect) + if (moves[i] != MOVE_NONE && moves[i] != MOVE_UNAVAILABLE + && gBattleMoves[moves[i]].effect == effect) + return TRUE; + } + + return FALSE; +} + +bool32 HasMoveWithMoveEffect(u32 battlerId, u32 moveEffect, u32 effectHitOnly) +{ + s32 i; + u16 *moves = GetMovesArray(battlerId); + + for (i = 0; i < MAX_MON_MOVES; i++) + { + if (moves[i] != MOVE_NONE && moves[i] != MOVE_UNAVAILABLE + && MoveHasMoveEffect(moves[i], moveEffect, effectHitOnly)) return TRUE; } @@ -3693,7 +3709,7 @@ void IncreaseParalyzeScore(u32 battlerAtk, u32 battlerDef, u32 move, s32 *score) if ((defSpeed >= atkSpeed && defSpeed / 2 < atkSpeed) // You'll go first after paralyzing foe || HasMoveEffect(battlerAtk, EFFECT_HEX) - || HasMoveEffect(battlerAtk, EFFECT_FLINCH_HIT) + || HasMoveWithMoveEffect(battlerAtk, MOVE_EFFECT_FLINCH, TRUE) // filter out Fake Out || gBattleMons[battlerDef].status2 & STATUS2_INFATUATION || gBattleMons[battlerDef].status2 & STATUS2_CONFUSION) ADJUST_SCORE_PTR(4); @@ -3733,7 +3749,7 @@ void IncreaseConfusionScore(u32 battlerAtk, u32 battlerDef, u32 move, s32 *score { if (gBattleMons[battlerDef].status1 & STATUS1_PARALYSIS || gBattleMons[battlerDef].status2 & STATUS2_INFATUATION - || (AI_DATA->abilities[battlerAtk] == ABILITY_SERENE_GRACE && HasMoveEffect(battlerAtk, EFFECT_FLINCH_HIT))) + || (AI_DATA->abilities[battlerAtk] == ABILITY_SERENE_GRACE && HasMoveWithMoveEffect(battlerAtk, MOVE_EFFECT_FLINCH, TRUE))) ADJUST_SCORE_PTR(3); else ADJUST_SCORE_PTR(2); diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 75bb978747..dabb7dc43d 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -3657,7 +3657,7 @@ static void Cmd_seteffectwithchance(void) SetMoveEffect( percentChance == 0, // a primary effect - percentChance == 100 // certain to happen + percentChance >= 100 // certain to happen ); } else diff --git a/src/battle_tv.c b/src/battle_tv.c index de44db8158..cf2131a6ec 100644 --- a/src/battle_tv.c +++ b/src/battle_tv.c @@ -117,7 +117,6 @@ static const u16 sPoints_MoveEffect[NUM_BATTLE_MOVE_EFFECTS] = [EFFECT_ROAR] = 5, [EFFECT_MULTI_HIT] = 1, [EFFECT_CONVERSION] = 3, - [EFFECT_FLINCH_HIT] = 1, [EFFECT_RESTORE_HP] = 3, [EFFECT_TOXIC] = 5, [EFFECT_PAY_DAY] = 1, diff --git a/src/battle_util.c b/src/battle_util.c index 868825e03c..5f8c7fc1e0 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -5678,8 +5678,7 @@ u32 AbilityBattleEffects(u32 caseID, u32 battler, u32 ability, u32 special, u32 && !gProtectStructs[gBattlerAttacker].confusionSelfDmg && RandomWeighted(RNG_STENCH, 9, 1) && !IS_MOVE_STATUS(move) - && gBattleMoves[gCurrentMove].effect != EFFECT_FLINCH_HIT - && !MoveHasMoveEffect(gCurrentMove, MOVE_EFFECT_FLINCH)) + && !MoveHasMoveEffect(gCurrentMove, MOVE_EFFECT_FLINCH, FALSE)) { gBattleScripting.moveEffect = MOVE_EFFECT_FLINCH; BattleScriptPushCursor(); @@ -11135,12 +11134,13 @@ bool32 IsGen6ExpShareEnabled(void) #endif } -bool32 MoveHasMoveEffect(u16 move, u16 moveEffect) +bool32 MoveHasMoveEffect(u32 move, u32 moveEffect, bool32 effectHitOnly) { u8 i; for (i = 0; i < gBattleMoves[move].numAdditionalEffects; i++) { - if (gBattleMoves[move].additionalEffects[i].moveEffect == moveEffect) + if (gBattleMoves[move].additionalEffects[i].moveEffect == moveEffect + && !(effectHitOnly && gBattleMoves[move].effect != EFFECT_HIT)) return TRUE; } return FALSE; diff --git a/src/data/battle_moves.h b/src/data/battle_moves.h index 489e85c00f..6be1880503 100644 --- a/src/data/battle_moves.h +++ b/src/data/battle_moves.h @@ -407,12 +407,11 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_DYNAMAX] = [MOVE_STOMP] = { - .effect = EFFECT_FLINCH_HIT, + .effect = EFFECT_HIT, .power = 65, .type = TYPE_NORMAL, .accuracy = 100, .pp = 20, - .secondaryEffectChance = 30, .target = MOVE_TARGET_SELECTED, .priority = 0, .split = SPLIT_PHYSICAL, @@ -420,6 +419,9 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_DYNAMAX] = .makesContact = TRUE, .sheerForceBoost = TRUE, .minimizeDoubleDamage = TRUE, + ADDITIONAL_EFFECTS( + SECONDARY_EFFECT(MOVE_EFFECT_FLINCH, 30) + ) }, [MOVE_DOUBLE_KICK] = @@ -479,12 +481,11 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_DYNAMAX] = [MOVE_ROLLING_KICK] = { - .effect = EFFECT_FLINCH_HIT, + .effect = EFFECT_HIT, .power = 60, .type = TYPE_FIGHTING, .accuracy = 85, .pp = 15, - .secondaryEffectChance = 30, .target = MOVE_TARGET_SELECTED, .priority = 0, .split = SPLIT_PHYSICAL, @@ -492,6 +493,9 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_DYNAMAX] = .makesContact = TRUE, .ignoresKingsRock = B_UPDATED_MOVE_FLAGS < GEN_3, .sheerForceBoost = TRUE, + ADDITIONAL_EFFECTS( + SECONDARY_EFFECT(MOVE_EFFECT_FLINCH, 30) + ) }, [MOVE_SAND_ATTACK] = @@ -511,18 +515,20 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_DYNAMAX] = [MOVE_HEADBUTT] = { - .effect = EFFECT_FLINCH_HIT, + .effect = EFFECT_HIT, .power = 70, .type = TYPE_NORMAL, .accuracy = 100, .pp = 15, - .secondaryEffectChance = 30, .target = MOVE_TARGET_SELECTED, .priority = 0, .split = SPLIT_PHYSICAL, .zMoveEffect = Z_EFFECT_NONE, .makesContact = TRUE, .sheerForceBoost = TRUE, + ADDITIONAL_EFFECTS( + SECONDARY_EFFECT(MOVE_EFFECT_FLINCH, 30) + ) }, [MOVE_HORN_ATTACK] = @@ -765,12 +771,11 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_DYNAMAX] = [MOVE_BITE] = { - .effect = EFFECT_FLINCH_HIT, + .effect = EFFECT_HIT, .power = 60, .type = TYPE_DARK, .accuracy = 100, .pp = 25, - .secondaryEffectChance = 30, .target = MOVE_TARGET_SELECTED, .priority = 0, .split = SPLIT_PHYSICAL, @@ -778,6 +783,9 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_DYNAMAX] = .makesContact = TRUE, .sheerForceBoost = TRUE, .bitingMove = TRUE, + ADDITIONAL_EFFECTS( + SECONDARY_EFFECT(MOVE_EFFECT_FLINCH, 30) + ) }, [MOVE_GROWL] = @@ -2212,17 +2220,19 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_DYNAMAX] = [MOVE_BONE_CLUB] = { - .effect = EFFECT_FLINCH_HIT, + .effect = EFFECT_HIT, .power = 65, .type = TYPE_GROUND, .accuracy = 85, .pp = 20, - .secondaryEffectChance = 10, .target = MOVE_TARGET_SELECTED, .priority = 0, .split = SPLIT_PHYSICAL, .zMoveEffect = Z_EFFECT_NONE, .sheerForceBoost = TRUE, + ADDITIONAL_EFFECTS( + SECONDARY_EFFECT(MOVE_EFFECT_FLINCH, 10) + ) }, [MOVE_FIRE_BLAST] = @@ -2248,22 +2258,22 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_DYNAMAX] = [MOVE_WATERFALL] = { - #if B_UPDATED_MOVE_DATA >= GEN_4 - .effect = EFFECT_FLINCH_HIT, - #else - .effect = EFFECT_HIT, - #endif + .effect = EFFECT_HIT, .power = 80, .type = TYPE_WATER, .accuracy = 100, .pp = 15, - .secondaryEffectChance = 20, .target = MOVE_TARGET_SELECTED, .priority = 0, .split = SPLIT_PHYSICAL, .zMoveEffect = Z_EFFECT_NONE, .makesContact = TRUE, - .sheerForceBoost = TRUE, + #if B_UPDATED_MOVE_DATA >= GEN_4 + .sheerForceBoost = TRUE, + ADDITIONAL_EFFECTS( + SECONDARY_EFFECT(MOVE_EFFECT_FLINCH, 20) + ) + #endif }, [MOVE_CLAMP] = @@ -2804,27 +2814,28 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_DYNAMAX] = [MOVE_ROCK_SLIDE] = { - .effect = EFFECT_FLINCH_HIT, + .effect = EFFECT_HIT, .power = 75, .type = TYPE_ROCK, .accuracy = 90, .pp = 10, - .secondaryEffectChance = 30, .target = MOVE_TARGET_BOTH, .priority = 0, .split = SPLIT_PHYSICAL, .zMoveEffect = Z_EFFECT_NONE, .sheerForceBoost = TRUE, + ADDITIONAL_EFFECTS( + SECONDARY_EFFECT(MOVE_EFFECT_FLINCH, 30) + ) }, [MOVE_HYPER_FANG] = { - .effect = EFFECT_FLINCH_HIT, + .effect = EFFECT_HIT, .power = 80, .type = TYPE_NORMAL, .accuracy = 90, .pp = 15, - .secondaryEffectChance = 10, .target = MOVE_TARGET_SELECTED, .priority = 0, .split = SPLIT_PHYSICAL, @@ -2832,6 +2843,9 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_DYNAMAX] = .makesContact = TRUE, .sheerForceBoost = TRUE, .bitingMove = TRUE, + ADDITIONAL_EFFECTS( + SECONDARY_EFFECT(MOVE_EFFECT_FLINCH, 10) + ) }, [MOVE_SHARPEN] = @@ -4288,12 +4302,11 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_DYNAMAX] = [MOVE_TWISTER] = { - .effect = EFFECT_FLINCH_HIT, + .effect = EFFECT_HIT, .power = 40, .type = TYPE_DRAGON, .accuracy = 100, .pp = 20, - .secondaryEffectChance = 20, .target = MOVE_TARGET_BOTH, .priority = 0, .split = SPLIT_SPECIAL, @@ -4301,6 +4314,9 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_DYNAMAX] = .sheerForceBoost = TRUE, .damagesAirborneDoubleDamage = TRUE, .windMove = TRUE, + ADDITIONAL_EFFECTS( + SECONDARY_EFFECT(MOVE_EFFECT_FLINCH, 20) + ) }, [MOVE_RAIN_DANCE] = @@ -5422,12 +5438,11 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_DYNAMAX] = [MOVE_NEEDLE_ARM] = { - .effect = EFFECT_FLINCH_HIT, + .effect = EFFECT_HIT, .power = 60, .type = TYPE_GRASS, .accuracy = 100, .pp = 15, - .secondaryEffectChance = 30, .target = MOVE_TARGET_SELECTED, .priority = 0, .split = SPLIT_PHYSICAL, @@ -5435,6 +5450,9 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_DYNAMAX] = .makesContact = TRUE, .sheerForceBoost = TRUE, .minimizeDoubleDamage = B_UPDATED_MOVE_FLAGS < GEN_4, + ADDITIONAL_EFFECTS( + SECONDARY_EFFECT(MOVE_EFFECT_FLINCH, 30) + ) }, [MOVE_SLACK_OFF] = @@ -5564,12 +5582,11 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_DYNAMAX] = [MOVE_ASTONISH] = { - .effect = EFFECT_FLINCH_HIT, + .effect = EFFECT_HIT, .power = 30, .type = TYPE_GHOST, .accuracy = 100, .pp = 15, - .secondaryEffectChance = 30, .target = MOVE_TARGET_SELECTED, .priority = 0, .split = SPLIT_PHYSICAL, @@ -5577,6 +5594,9 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_DYNAMAX] = .makesContact = TRUE, .sheerForceBoost = TRUE, .minimizeDoubleDamage = B_UPDATED_MOVE_FLAGS < GEN_4, + ADDITIONAL_EFFECTS( + SECONDARY_EFFECT(MOVE_EFFECT_FLINCH, 30) + ) }, [MOVE_WEATHER_BALL] = @@ -5843,17 +5863,19 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_DYNAMAX] = #else .pp = 30, #endif - .effect = EFFECT_FLINCH_HIT, + .effect = EFFECT_HIT, .power = 80, .type = TYPE_PSYCHIC, .accuracy = 100, - .secondaryEffectChance = 10, .target = MOVE_TARGET_SELECTED, .priority = 0, .split = SPLIT_SPECIAL, .zMoveEffect = Z_EFFECT_NONE, .sheerForceBoost = TRUE, .minimizeDoubleDamage = B_UPDATED_MOVE_FLAGS < GEN_4, + ADDITIONAL_EFFECTS( + SECONDARY_EFFECT(MOVE_EFFECT_FLINCH, 10) + ) }, [MOVE_SKY_UPPERCUT] = @@ -7109,18 +7131,20 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_DYNAMAX] = [MOVE_DARK_PULSE] = { - .effect = EFFECT_FLINCH_HIT, + .effect = EFFECT_HIT, .power = 80, .type = TYPE_DARK, .accuracy = 100, .pp = 15, - .secondaryEffectChance = 20, .target = MOVE_TARGET_SELECTED, .priority = 0, .split = SPLIT_SPECIAL, .zMoveEffect = Z_EFFECT_NONE, .sheerForceBoost = TRUE, .pulseMove = TRUE, + ADDITIONAL_EFFECTS( + SECONDARY_EFFECT(MOVE_EFFECT_FLINCH, 20) + ) }, [MOVE_NIGHT_SLASH] = @@ -7177,17 +7201,19 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_DYNAMAX] = #else .pp = 20, #endif - .effect = EFFECT_FLINCH_HIT, + .effect = EFFECT_HIT, .power = 75, .type = TYPE_FLYING, .accuracy = 95, - .secondaryEffectChance = 30, .target = MOVE_TARGET_SELECTED, .priority = 0, .split = SPLIT_SPECIAL, .zMoveEffect = Z_EFFECT_NONE, .sheerForceBoost = TRUE, .slicingMove = TRUE, + ADDITIONAL_EFFECTS( + SECONDARY_EFFECT(MOVE_EFFECT_FLINCH, 30) + ) }, [MOVE_X_SCISSOR] = @@ -7244,12 +7270,11 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_DYNAMAX] = [MOVE_DRAGON_RUSH] = { - .effect = EFFECT_FLINCH_HIT, + .effect = EFFECT_HIT, .power = 100, .type = TYPE_DRAGON, .accuracy = 75, .pp = 10, - .secondaryEffectChance = 20, .target = MOVE_TARGET_SELECTED, .priority = 0, .split = SPLIT_PHYSICAL, @@ -7257,6 +7282,9 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_DYNAMAX] = .makesContact = TRUE, .sheerForceBoost = TRUE, .minimizeDoubleDamage = B_UPDATED_MOVE_FLAGS >= GEN_6, + ADDITIONAL_EFFECTS( + SECONDARY_EFFECT(MOVE_EFFECT_FLINCH, 20) + ) }, [MOVE_POWER_GEM] = @@ -7600,18 +7628,20 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_DYNAMAX] = [MOVE_ZEN_HEADBUTT] = { - .effect = EFFECT_FLINCH_HIT, + .effect = EFFECT_HIT, .power = 80, .type = TYPE_PSYCHIC, .accuracy = 90, .pp = 15, - .secondaryEffectChance = 20, .target = MOVE_TARGET_SELECTED, .priority = 0, .split = SPLIT_PHYSICAL, .zMoveEffect = Z_EFFECT_NONE, .makesContact = TRUE, .sheerForceBoost = TRUE, + ADDITIONAL_EFFECTS( + SECONDARY_EFFECT(MOVE_EFFECT_FLINCH, 20) + ) }, [MOVE_MIRROR_SHOT] = @@ -7830,18 +7860,20 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_DYNAMAX] = [MOVE_IRON_HEAD] = { - .effect = EFFECT_FLINCH_HIT, + .effect = EFFECT_HIT, .power = 80, .type = TYPE_STEEL, .accuracy = 100, .pp = 15, - .secondaryEffectChance = 30, .target = MOVE_TARGET_SELECTED, .priority = 0, .split = SPLIT_PHYSICAL, .zMoveEffect = Z_EFFECT_NONE, .makesContact = TRUE, .sheerForceBoost = TRUE, + ADDITIONAL_EFFECTS( + SECONDARY_EFFECT(MOVE_EFFECT_FLINCH, 30) + ) }, [MOVE_MAGNET_BOMB] = @@ -9325,18 +9357,20 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_DYNAMAX] = [MOVE_HEART_STAMP] = { - .effect = EFFECT_FLINCH_HIT, + .effect = EFFECT_HIT, .power = 60, .type = TYPE_PSYCHIC, .accuracy = 100, .pp = 25, - .secondaryEffectChance = 30, .target = MOVE_TARGET_SELECTED, .priority = 0, .split = SPLIT_PHYSICAL, .zMoveEffect = Z_EFFECT_NONE, .makesContact = TRUE, .sheerForceBoost = TRUE, + ADDITIONAL_EFFECTS( + SECONDARY_EFFECT(MOVE_EFFECT_FLINCH, 30) + ) }, [MOVE_HORN_LEECH] = @@ -9427,12 +9461,11 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_DYNAMAX] = [MOVE_STEAMROLLER] = { - .effect = EFFECT_FLINCH_HIT, + .effect = EFFECT_HIT, .power = 65, .type = TYPE_BUG, .accuracy = 100, .pp = 20, - .secondaryEffectChance = 30, .target = MOVE_TARGET_SELECTED, .priority = 0, .split = SPLIT_PHYSICAL, @@ -9440,6 +9473,9 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_DYNAMAX] = .makesContact = TRUE, .sheerForceBoost = TRUE, .minimizeDoubleDamage = TRUE, + ADDITIONAL_EFFECTS( + SECONDARY_EFFECT(MOVE_EFFECT_FLINCH, 30) + ) }, [MOVE_COTTON_GUARD] = @@ -9754,17 +9790,19 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_DYNAMAX] = [MOVE_ICICLE_CRASH] = { - .effect = EFFECT_FLINCH_HIT, + .effect = EFFECT_HIT, .power = 85, .type = TYPE_ICE, .accuracy = 90, .pp = 10, - .secondaryEffectChance = 30, .target = MOVE_TARGET_SELECTED, .priority = 0, .split = SPLIT_PHYSICAL, .zMoveEffect = Z_EFFECT_NONE, .sheerForceBoost = TRUE, + ADDITIONAL_EFFECTS( + SECONDARY_EFFECT(MOVE_EFFECT_FLINCH, 30) + ) }, [MOVE_V_CREATE] = @@ -11657,17 +11695,19 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_DYNAMAX] = [MOVE_ZING_ZAP] = { - .effect = EFFECT_FLINCH_HIT, + .effect = EFFECT_HIT, .power = 80, .type = TYPE_ELECTRIC, .accuracy = 100, .pp = 10, - .secondaryEffectChance = 30, .target = MOVE_TARGET_SELECTED, .priority = 0, .split = SPLIT_PHYSICAL, .zMoveEffect = Z_EFFECT_NONE, .makesContact = TRUE, + ADDITIONAL_EFFECTS( + SECONDARY_EFFECT(MOVE_EFFECT_FLINCH, 30) + ) }, [MOVE_NATURES_MADNESS] = @@ -11798,12 +11838,11 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_DYNAMAX] = [MOVE_FLOATY_FALL] = { - .effect = EFFECT_FLINCH_HIT, + .effect = EFFECT_HIT, .power = 90, .type = TYPE_FLYING, .accuracy = 95, .pp = 15, - .secondaryEffectChance = 30, .target = MOVE_TARGET_SELECTED, .priority = 0, .split = SPLIT_PHYSICAL, @@ -11813,6 +11852,9 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_DYNAMAX] = .mirrorMoveBanned = B_UPDATED_MOVE_FLAGS < GEN_8, .gravityBanned = TRUE, .metronomeBanned = TRUE, + ADDITIONAL_EFFECTS( + SECONDARY_EFFECT(MOVE_EFFECT_FLINCH, 30) + ) }, [MOVE_PIKA_PAPOW] = @@ -12030,12 +12072,11 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_DYNAMAX] = [MOVE_DOUBLE_IRON_BASH] = { - .effect = EFFECT_FLINCH_HIT, + .effect = EFFECT_HIT, .power = 60, .type = TYPE_STEEL, .accuracy = 100, .pp = 5, - .secondaryEffectChance = 30, .target = MOVE_TARGET_SELECTED, .priority = 0, .split = SPLIT_PHYSICAL, @@ -12046,6 +12087,9 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_DYNAMAX] = .strikeCount = 2, .minimizeDoubleDamage = B_UPDATED_MOVE_FLAGS < GEN_8, .metronomeBanned = TRUE, + ADDITIONAL_EFFECTS( + SECONDARY_EFFECT(MOVE_EFFECT_FLINCH, 30) + ) }, [MOVE_DYNAMAX_CANNON] = @@ -13042,17 +13086,19 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_DYNAMAX] = [MOVE_FIERY_WRATH] = { - .effect = EFFECT_FLINCH_HIT, + .effect = EFFECT_HIT, .power = 90, .type = TYPE_DARK, .accuracy = 100, .pp = 10, - .secondaryEffectChance = 20, .target = MOVE_TARGET_BOTH, .priority = 0, .split = SPLIT_SPECIAL, .zMoveEffect = Z_EFFECT_NONE, .metronomeBanned = TRUE, + ADDITIONAL_EFFECTS( + SECONDARY_EFFECT(MOVE_EFFECT_FLINCH, 20) + ) }, [MOVE_THUNDEROUS_KICK] = @@ -13289,17 +13335,19 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_DYNAMAX] = [MOVE_MOUNTAIN_GALE] = { - .effect = EFFECT_FLINCH_HIT, + .effect = EFFECT_HIT, .power = 100, .type = TYPE_ICE, .accuracy = 85, .pp = 5, - .secondaryEffectChance = 30, .target = MOVE_TARGET_SELECTED, .priority = 0, .split = SPLIT_PHYSICAL, .zMoveEffect = Z_EFFECT_NONE, .sheerForceBoost = TRUE, + ADDITIONAL_EFFECTS( + SECONDARY_EFFECT(MOVE_EFFECT_FLINCH, 30) + ) }, [MOVE_VICTORY_DANCE] = diff --git a/test/battle/move_effect/flinch_hit.c b/test/battle/move_effect/flinch_hit.c index c8c650db7d..f33b9c7e7d 100644 --- a/test/battle/move_effect/flinch_hit.c +++ b/test/battle/move_effect/flinch_hit.c @@ -3,7 +3,7 @@ ASSUMPTIONS { - ASSUME(gBattleMoves[MOVE_HEADBUTT].effect == EFFECT_FLINCH_HIT); + ASSUME(gBattleMoves[MOVE_HEADBUTT].additionalEffects[0].moveEffect == MOVE_EFFECT_FLINCH); } SINGLE_BATTLE_TEST("Headbutt flinches the target if attacker is faster") diff --git a/test/battle/move_effect/fling.c b/test/battle/move_effect/fling.c index 8d44d9b9f1..9a989d17b3 100644 --- a/test/battle/move_effect/fling.c +++ b/test/battle/move_effect/fling.c @@ -206,12 +206,12 @@ SINGLE_BATTLE_TEST("Fling applies special effects when throwing specific Items") { u16 item, effect; - PARAMETRIZE {item = ITEM_FLAME_ORB; effect = EFFECT_WILL_O_WISP; } - PARAMETRIZE {item = ITEM_TOXIC_ORB; effect = EFFECT_TOXIC; } - PARAMETRIZE {item = ITEM_POISON_BARB; effect = EFFECT_POISON; } - PARAMETRIZE {item = ITEM_LIGHT_BALL; effect = EFFECT_PARALYZE; } - PARAMETRIZE {item = ITEM_RAZOR_FANG; effect = EFFECT_FLINCH_HIT; } - PARAMETRIZE {item = ITEM_KINGS_ROCK; effect = EFFECT_FLINCH_HIT; } + PARAMETRIZE {item = ITEM_FLAME_ORB; effect = MOVE_EFFECT_BURN; } + PARAMETRIZE {item = ITEM_TOXIC_ORB; effect = MOVE_EFFECT_TOXIC; } + PARAMETRIZE {item = ITEM_POISON_BARB; effect = MOVE_EFFECT_POISON; } + PARAMETRIZE {item = ITEM_LIGHT_BALL; effect = MOVE_EFFECT_PARALYSIS; } + PARAMETRIZE {item = ITEM_RAZOR_FANG; effect = MOVE_EFFECT_FLINCH; } + PARAMETRIZE {item = ITEM_KINGS_ROCK; effect = MOVE_EFFECT_FLINCH; } GIVEN { PLAYER(SPECIES_WOBBUFFET) { Item(item); } @@ -224,23 +224,23 @@ SINGLE_BATTLE_TEST("Fling applies special effects when throwing specific Items") HP_BAR(opponent); switch (effect) { - case EFFECT_WILL_O_WISP: + case MOVE_EFFECT_BURN: MESSAGE("Foe Wobbuffet was burned!"); STATUS_ICON(opponent, STATUS1_BURN); break; - case EFFECT_PARALYZE: + case MOVE_EFFECT_PARALYSIS: MESSAGE("Foe Wobbuffet is paralyzed! It may be unable to move!"); STATUS_ICON(opponent, STATUS1_PARALYSIS); break; - case EFFECT_POISON: + case MOVE_EFFECT_POISON: MESSAGE("Foe Wobbuffet was poisoned!"); STATUS_ICON(opponent, STATUS1_POISON); break; - case EFFECT_TOXIC: + case MOVE_EFFECT_TOXIC: MESSAGE("Foe Wobbuffet is badly poisoned!"); STATUS_ICON(opponent, STATUS1_TOXIC_POISON); break; - case EFFECT_FLINCH_HIT: + case MOVE_EFFECT_FLINCH: MESSAGE("Foe Wobbuffet flinched!"); break; }