diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index bee2c3f82a..e629ec2598 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -308,7 +308,7 @@ gBattleScriptsForMoveEffects:: .4byte BattleScript_EffectCloseCombat @ EFFECT_CLOSE_COMBAT .4byte BattleScript_EffectLastResort @ EFFECT_LAST_RESORT .4byte BattleScript_EffectHit @ EFFECT_RECOIL_33_STATUS - .4byte BattleScript_EffectFlinchStatus @ EFFECT_FLINCH_STATUS + .4byte BattleScript_EffectHit @ EFFECT_UNUSED_282 .4byte BattleScript_EffectHit @ EFFECT_RECOIL_50 .4byte BattleScript_EffectShellSmash @ EFFECT_SHELL_SMASH .4byte BattleScript_EffectShiftGear @ EFFECT_SHIFT_GEAR @@ -3776,13 +3776,6 @@ BattleScript_EffectFlinchHit:: setmoveeffect MOVE_EFFECT_FLINCH goto BattleScript_EffectHit -BattleScript_EffectFlinchStatus: - setmoveeffect MOVE_EFFECT_FLINCH - call BattleScript_EffectHit_Ret - argumentstatuseffect - tryfaintmon BS_TARGET - goto BattleScript_MoveEnd - BattleScript_EffectRestoreHp:: attackcanceler attackstring diff --git a/include/constants/battle_move_effects.h b/include/constants/battle_move_effects.h index 13f910c7ec..c63c5829ab 100644 --- a/include/constants/battle_move_effects.h +++ b/include/constants/battle_move_effects.h @@ -285,7 +285,7 @@ #define EFFECT_CLOSE_COMBAT 279 #define EFFECT_LAST_RESORT 280 #define EFFECT_RECOIL_33_STATUS 281 -#define EFFECT_FLINCH_STATUS 282 +#define EFFECT_UNUSED_282 282 #define EFFECT_RECOIL_50 283 #define EFFECT_SHELL_SMASH 284 #define EFFECT_SHIFT_GEAR 285 diff --git a/src/battle_ai_util.c b/src/battle_ai_util.c index 9af0685d2e..972cda12b1 100644 --- a/src/battle_ai_util.c +++ b/src/battle_ai_util.c @@ -859,27 +859,6 @@ static bool32 AI_IsMoveEffectInPlus(u32 battlerAtk, u32 battlerDef, u32 move, s3 if (AI_CanConfuse(battlerAtk, battlerDef, abilityDef, BATTLE_PARTNER(battlerAtk), move, MOVE_NONE)) return TRUE; break; - case EFFECT_FLINCH_STATUS: - switch (gBattleMoves[move].argument) - { - case STATUS1_PARALYSIS: - if (AI_CanParalyze(battlerAtk, battlerDef, abilityDef, move, MOVE_NONE)) - return TRUE; - break; - case STATUS1_BURN: - if (AI_CanBurn(battlerAtk, battlerDef, abilityDef, BATTLE_PARTNER(battlerAtk), move, MOVE_NONE)) - return TRUE; - break; - case STATUS1_FREEZE: - if (AI_CanGetFrostbite(battlerDef, abilityDef)) - return TRUE; - break; - } - // fallthrough - case EFFECT_FLINCH_HIT: - if (ShouldTryToFlinch(battlerAtk, battlerDef, abilityAtk, abilityDef, move)) - return TRUE; - break; case EFFECT_HIT_ESCAPE: if (CountUsablePartyMons(battlerAtk) != 0 && ShouldPivot(battlerAtk, battlerDef, abilityDef, move, AI_THINKING_STRUCT->movesetIndex)) return TRUE; @@ -957,6 +936,15 @@ static bool32 AI_IsMoveEffectInPlus(u32 battlerAtk, u32 battlerDef, u32 move, s3 if (AI_CanBurn(battlerAtk, battlerDef, abilityDef, BATTLE_PARTNER(battlerAtk), move, MOVE_NONE)) return TRUE; break; + case MOVE_EFFECT_FREEZE: + case MOVE_EFFECT_FROSTBITE: + if (AI_CanGetFrostbite(battlerDef, abilityDef)) + return TRUE; + break; + case MOVE_EFFECT_FLINCH: + if (ShouldTryToFlinch(battlerAtk, battlerDef, abilityAtk, abilityDef, move)) + return TRUE; + break; } } diff --git a/src/battle_tv.c b/src/battle_tv.c index 0d2ddc75ad..de44db8158 100644 --- a/src/battle_tv.c +++ b/src/battle_tv.c @@ -369,7 +369,6 @@ static const u16 sPoints_MoveEffect[NUM_BATTLE_MOVE_EFFECTS] = [EFFECT_CLOSE_COMBAT] = 0, // TODO: Assign points [EFFECT_LAST_RESORT] = 0, // TODO: Assign points [EFFECT_RECOIL_33_STATUS] = 0, // TODO: Assign points - [EFFECT_FLINCH_STATUS] = 0, // TODO: Assign points [EFFECT_RECOIL_50] = 0, // TODO: Assign points [EFFECT_SHELL_SMASH] = 0, // TODO: Assign points [EFFECT_SHIFT_GEAR] = 0, // TODO: Assign points diff --git a/src/battle_util.c b/src/battle_util.c index fc2f794653..868825e03c 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -5679,7 +5679,6 @@ u32 AbilityBattleEffects(u32 caseID, u32 battler, u32 ability, u32 special, u32 && RandomWeighted(RNG_STENCH, 9, 1) && !IS_MOVE_STATUS(move) && gBattleMoves[gCurrentMove].effect != EFFECT_FLINCH_HIT - && gBattleMoves[gCurrentMove].effect != EFFECT_FLINCH_STATUS && !MoveHasMoveEffect(gCurrentMove, MOVE_EFFECT_FLINCH)) { gBattleScripting.moveEffect = MOVE_EFFECT_FLINCH; diff --git a/src/data/battle_moves.h b/src/data/battle_moves.h index aaa5a1e6d2..489e85c00f 100644 --- a/src/data/battle_moves.h +++ b/src/data/battle_moves.h @@ -7491,12 +7491,11 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_DYNAMAX] = [MOVE_THUNDER_FANG] = { - .effect = EFFECT_FLINCH_STATUS, + .effect = EFFECT_HIT, .power = 65, .type = TYPE_ELECTRIC, .accuracy = 95, .pp = 15, - .secondaryEffectChance = 10, .target = MOVE_TARGET_SELECTED, .priority = 0, .split = SPLIT_PHYSICAL, @@ -7505,21 +7504,19 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_DYNAMAX] = .makesContact = TRUE, .sheerForceBoost = TRUE, .bitingMove = TRUE, + ADDITIONAL_EFFECTS( + SECONDARY_EFFECT(MOVE_EFFECT_PARALYSIS, 10), + SECONDARY_EFFECT(MOVE_EFFECT_FLINCH, 10) + ) }, [MOVE_ICE_FANG] = { - #if B_USE_FROSTBITE == TRUE - .argument = STATUS1_FROSTBITE, - #else - .argument = STATUS1_FREEZE, - #endif - .effect = EFFECT_FLINCH_STATUS, + .effect = EFFECT_HIT, .power = 65, .type = TYPE_ICE, .accuracy = 95, .pp = 15, - .secondaryEffectChance = 10, .target = MOVE_TARGET_SELECTED, .priority = 0, .split = SPLIT_PHYSICAL, @@ -7527,16 +7524,19 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_DYNAMAX] = .makesContact = TRUE, .sheerForceBoost = TRUE, .bitingMove = TRUE, + ADDITIONAL_EFFECTS( + SECONDARY_EFFECT(B_USE_FROSTBITE ? MOVE_EFFECT_FROSTBITE : MOVE_EFFECT_FREEZE, 10), + SECONDARY_EFFECT(MOVE_EFFECT_FLINCH, 10) + ) }, [MOVE_FIRE_FANG] = { - .effect = EFFECT_FLINCH_STATUS, + .effect = EFFECT_HIT, .power = 65, .type = TYPE_FIRE, .accuracy = 95, .pp = 15, - .secondaryEffectChance = 10, .target = MOVE_TARGET_SELECTED, .priority = 0, .split = SPLIT_PHYSICAL, @@ -7545,6 +7545,10 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_DYNAMAX] = .makesContact = TRUE, .sheerForceBoost = TRUE, .bitingMove = TRUE, + ADDITIONAL_EFFECTS( + SECONDARY_EFFECT(MOVE_EFFECT_BURN, 10), + SECONDARY_EFFECT(MOVE_EFFECT_FLINCH, 10) + ) }, [MOVE_SHADOW_SNEAK] = diff --git a/test/battle/move_effect/flinch_status.c b/test/battle/move_effect/flinch_status.c index 6d0012d42c..bfe6382b49 100644 --- a/test/battle/move_effect/flinch_status.c +++ b/test/battle/move_effect/flinch_status.c @@ -3,12 +3,12 @@ ASSUMPTIONS { - ASSUME(gBattleMoves[MOVE_THUNDER_FANG].effect == EFFECT_FLINCH_STATUS); - ASSUME(gBattleMoves[MOVE_THUNDER_FANG].argument == STATUS1_PARALYSIS); - ASSUME(gBattleMoves[MOVE_ICE_FANG].effect == EFFECT_FLINCH_STATUS); - ASSUME(gBattleMoves[MOVE_ICE_FANG].argument == STATUS1_FREEZE); - ASSUME(gBattleMoves[MOVE_FIRE_FANG].effect == EFFECT_FLINCH_STATUS); - ASSUME(gBattleMoves[MOVE_FIRE_FANG].argument == STATUS1_BURN); + ASSUME(gBattleMoves[MOVE_THUNDER_FANG].additionalEffects[0].moveEffect == MOVE_EFFECT_PARALYSIS); + ASSUME(gBattleMoves[MOVE_THUNDER_FANG].additionalEffects[1].moveEffect == MOVE_EFFECT_FLINCH); + ASSUME(gBattleMoves[MOVE_ICE_FANG].additionalEffects[0].moveEffect == MOVE_EFFECT_FREEZE); + ASSUME(gBattleMoves[MOVE_ICE_FANG].additionalEffects[1].moveEffect == MOVE_EFFECT_FLINCH); + ASSUME(gBattleMoves[MOVE_FIRE_FANG].additionalEffects[0].moveEffect == MOVE_EFFECT_BURN); + ASSUME(gBattleMoves[MOVE_FIRE_FANG].additionalEffects[1].moveEffect == MOVE_EFFECT_FLINCH); } SINGLE_BATTLE_TEST("Thunder, Ice and Fire Fang inflict status 10% of the time") @@ -49,7 +49,7 @@ SINGLE_BATTLE_TEST("Thunder, Ice and Fire Fang cause the opponent to flinch 10% PARAMETRIZE { move = MOVE_ICE_FANG; } PARAMETRIZE { move = MOVE_FIRE_FANG; } - PASSES_RANDOMLY(10, 100, RNG_SECONDARY_EFFECT); + PASSES_RANDOMLY(10, 100, RNG_SECONDARY_EFFECT_2); GIVEN { PLAYER(SPECIES_WOBBUFFET) { Speed(100); } OPPONENT(SPECIES_WOBBUFFET) { Speed(1); }