diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index e629ec2598..f470a789f6 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -24,11 +24,11 @@ gBattleScriptsForMoveEffects:: .4byte BattleScript_EffectHit @ EFFECT_HIT .4byte BattleScript_EffectSleep @ EFFECT_SLEEP - .4byte BattleScript_EffectPoisonHit @ EFFECT_POISON_HIT + .4byte BattleScript_EffectHit @ EFFECT_UNUSED_2 .4byte BattleScript_EffectAbsorb @ EFFECT_ABSORB - .4byte BattleScript_EffectHit @ EFFECT_BURN_HIT + .4byte BattleScript_EffectHit @ EFFECT_UNUSED_4 .4byte BattleScript_EffectFreezeHit @ EFFECT_FREEZE_HIT - .4byte BattleScript_EffectParalyzeHit @ EFFECT_PARALYZE_HIT + .4byte BattleScript_EffectHit @ EFFECT_UNUSED_6 .4byte BattleScript_EffectExplosion @ EFFECT_EXPLOSION .4byte BattleScript_EffectDreamEater @ EFFECT_DREAM_EATER .4byte BattleScript_EffectMirrorMove @ EFFECT_MIRROR_MOVE @@ -421,7 +421,7 @@ gBattleScriptsForMoveEffects:: .4byte BattleScript_EffectHit @ EFFECT_HYDRO_STEAM .4byte BattleScript_EffectHitSetEntryHazard @ EFFECT_HIT_SET_ENTRY_HAZARD .4byte BattleScript_EffectDireClaw @ EFFECT_DIRE_CLAW - .4byte BattleScript_EffectBarbBarrage @ EFFECT_BARB_BARRAGE + .4byte BattleScript_EffectHit @ EFFECT_BARB_BARRAGE .4byte BattleScript_EffectRevivalBlessing @ EFFECT_REVIVAL_BLESSING .4byte BattleScript_EffectFrostbiteHit @ EFFECT_FROSTBITE_HIT .4byte BattleScript_EffectSnow @ EFFECT_SNOWSCAPE @@ -3343,11 +3343,6 @@ BattleScript_CantMakeAsleep:: orhalfword gMoveResultFlags, MOVE_RESULT_FAILED goto BattleScript_MoveEnd -BattleScript_EffectBarbBarrage: -BattleScript_EffectPoisonHit: - setmoveeffect MOVE_EFFECT_POISON - goto BattleScript_EffectHit - BattleScript_EffectAbsorb:: call BattleScript_EffectHit_Ret jumpifstatus3 BS_ATTACKER, STATUS3_HEAL_BLOCK, BattleScript_AbsorbHealBlock @@ -3385,10 +3380,6 @@ BattleScript_EffectFreezeHit:: setmoveeffect MOVE_EFFECT_FREEZE goto BattleScript_EffectHit -BattleScript_EffectParalyzeHit:: - setmoveeffect MOVE_EFFECT_PARALYSIS - goto BattleScript_EffectHit - BattleScript_EffectExplosion_AnimDmgRet: jumpifbyte CMP_NO_COMMON_BITS, gMoveResultFlags, MOVE_RESULT_MISSED, BattleScript_ExplosionAnimRet call BattleScript_PreserveMissedBitDoMoveAnim diff --git a/include/constants/battle_move_effects.h b/include/constants/battle_move_effects.h index c63c5829ab..09f9ddced9 100644 --- a/include/constants/battle_move_effects.h +++ b/include/constants/battle_move_effects.h @@ -3,11 +3,11 @@ #define EFFECT_HIT 0 #define EFFECT_SLEEP 1 -#define EFFECT_POISON_HIT 2 +#define EFFECT_UNUSED_2 2 #define EFFECT_ABSORB 3 -#define EFFECT_BURN_HIT 4 +#define EFFECT_UNUSED_4 4 #define EFFECT_FREEZE_HIT 5 -#define EFFECT_PARALYZE_HIT 6 +#define EFFECT_UNUSED_6 6 #define EFFECT_EXPLOSION 7 #define EFFECT_DREAM_EATER 8 #define EFFECT_MIRROR_MOVE 9 diff --git a/src/battle_ai_util.c b/src/battle_ai_util.c index bf3f1920c8..f456db6dbd 100644 --- a/src/battle_ai_util.c +++ b/src/battle_ai_util.c @@ -846,7 +846,6 @@ static bool32 AI_IsMoveEffectInPlus(u32 battlerAtk, u32 battlerDef, u32 move, s3 switch (gBattleMoves[move].effect) { - case EFFECT_POISON_HIT: case EFFECT_POISON_FANG: if (AI_CanPoison(battlerAtk, battlerDef, abilityDef, move, MOVE_NONE)) return TRUE; @@ -928,8 +927,9 @@ static bool32 AI_IsMoveEffectInPlus(u32 battlerAtk, u32 battlerDef, u32 move, s3 switch (gBattleMoves[move].additionalEffects[i].moveEffect) { - case MOVE_EFFECT_PARALYSIS: - if (AI_CanParalyze(battlerAtk, battlerDef, abilityDef, move, MOVE_NONE)) + case MOVE_EFFECT_POISON: + case MOVE_EFFECT_TOXIC: + if (AI_CanPoison(battlerAtk, battlerDef, abilityDef, move, MOVE_NONE)) return TRUE; break; case MOVE_EFFECT_BURN: @@ -941,6 +941,10 @@ static bool32 AI_IsMoveEffectInPlus(u32 battlerAtk, u32 battlerDef, u32 move, s3 if (AI_CanGetFrostbite(battlerDef, abilityDef)) return TRUE; break; + case MOVE_EFFECT_PARALYSIS: + if (AI_CanParalyze(battlerAtk, battlerDef, abilityDef, move, MOVE_NONE)) + return TRUE; + break; case MOVE_EFFECT_FLINCH: if (ShouldTryToFlinch(battlerAtk, battlerDef, abilityAtk, abilityDef, move)) return TRUE; diff --git a/src/battle_tv.c b/src/battle_tv.c index cf2131a6ec..67c1e9f5fa 100644 --- a/src/battle_tv.c +++ b/src/battle_tv.c @@ -88,11 +88,8 @@ static const u16 sPoints_MoveEffect[NUM_BATTLE_MOVE_EFFECTS] = { [EFFECT_HIT] = 1, [EFFECT_SLEEP] = 1, - [EFFECT_POISON_HIT] = 1, [EFFECT_ABSORB] = 4, - [EFFECT_BURN_HIT] = 1, [EFFECT_FREEZE_HIT] = 1, - // [EFFECT_PARALYZE_HIT] = 1, // same as EFFECT_HIT so who cares [EFFECT_EXPLOSION] = 0, [EFFECT_DREAM_EATER] = 5, [EFFECT_MIRROR_MOVE] = 1, diff --git a/src/data/battle_frontier/battle_pyramid_wild_requirements.h b/src/data/battle_frontier/battle_pyramid_wild_requirements.h index efafd2cfa5..a7c25ebd1d 100644 --- a/src/data/battle_frontier/battle_pyramid_wild_requirements.h +++ b/src/data/battle_frontier/battle_pyramid_wild_requirements.h @@ -13,7 +13,7 @@ struct BattlePyramidRequirement { u8 nEvoItems; }; -// EFFECT_PARALYZE, EFFECT_PARALYZE_HIT (30% or more) +// EFFECT_PARALYZE, MOVE_EFFECT_PARALYZE (30% or more) static const u16 sParalyzingMoves[] = { //MOVE_THUNDER_PUNCH, MOVE_BODY_SLAM, @@ -35,7 +35,7 @@ static const u16 sParalyzingMoves[] = { MOVE_COMBAT_TORQUE, }; -// EFFECT_POISON_HIT (30% or more), EFFECT_POISON, EFFECT_POISON_FANG, EFFECT_TOXIC, EFFECT_TOXIC_THREAD +// MOVE_EFFECT_POISON (30% or more), EFFECT_POISON, EFFECT_POISON_FANG, EFFECT_TOXIC, EFFECT_TOXIC_THREAD static const u16 sPoisoningMoves[] = { MOVE_POISON_STING, //MOVE_TWINEEDLE, diff --git a/src/data/battle_moves.h b/src/data/battle_moves.h index 6be1880503..58235edd1e 100644 --- a/src/data/battle_moves.h +++ b/src/data/battle_moves.h @@ -705,27 +705,28 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_DYNAMAX] = [MOVE_POISON_STING] = { - .effect = EFFECT_POISON_HIT, + .effect = EFFECT_HIT, .power = 15, .type = TYPE_POISON, .accuracy = 100, .pp = 35, - .secondaryEffectChance = 30, .target = MOVE_TARGET_SELECTED, .priority = 0, .split = SPLIT_PHYSICAL, .zMoveEffect = Z_EFFECT_NONE, .sheerForceBoost = TRUE, + ADDITIONAL_EFFECTS( + SECONDARY_EFFECT(MOVE_EFFECT_POISON, 30) + ) }, [MOVE_TWINEEDLE] = { - .effect = EFFECT_POISON_HIT, + .effect = EFFECT_HIT, .power = 25, .type = TYPE_BUG, .accuracy = 100, .pp = 20, - .secondaryEffectChance = 20, .target = MOVE_TARGET_SELECTED, .priority = 0, .split = SPLIT_PHYSICAL, @@ -733,6 +734,9 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_DYNAMAX] = .sheerForceBoost = TRUE, .ignoresKingsRock = B_UPDATED_MOVE_FLAGS < GEN_5, // && B_UPDATED_MOVE_FLAGS > GEN_2 .strikeCount = 2, + ADDITIONAL_EFFECTS( + SECONDARY_EFFECT(MOVE_EFFECT_POISON, 20) + ) }, [MOVE_PIN_MISSILE] = @@ -2191,31 +2195,35 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_DYNAMAX] = #else .power = 20, #endif - .effect = EFFECT_POISON_HIT, + .effect = EFFECT_HIT, .type = TYPE_POISON, .accuracy = 70, .pp = 20, - .secondaryEffectChance = 40, .target = MOVE_TARGET_SELECTED, .priority = 0, .split = SPLIT_SPECIAL, .zMoveEffect = Z_EFFECT_NONE, .sheerForceBoost = TRUE, + ADDITIONAL_EFFECTS( + SECONDARY_EFFECT(MOVE_EFFECT_POISON, 40) + ) }, [MOVE_SLUDGE] = { - .effect = EFFECT_POISON_HIT, + .effect = EFFECT_HIT, .power = 65, .type = TYPE_POISON, .accuracy = 100, .pp = 20, - .secondaryEffectChance = 30, .target = MOVE_TARGET_SELECTED, .priority = 0, .split = SPLIT_SPECIAL, .zMoveEffect = Z_EFFECT_NONE, .sheerForceBoost = TRUE, + ADDITIONAL_EFFECTS( + SECONDARY_EFFECT(MOVE_EFFECT_POISON, 30) + ) }, [MOVE_BONE_CLUB] = @@ -3389,18 +3397,20 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_DYNAMAX] = [MOVE_SLUDGE_BOMB] = { - .effect = EFFECT_POISON_HIT, + .effect = EFFECT_HIT, .power = 90, .type = TYPE_POISON, .accuracy = 100, .pp = 10, - .secondaryEffectChance = 30, .target = MOVE_TARGET_SELECTED, .priority = 0, .split = SPLIT_SPECIAL, .zMoveEffect = Z_EFFECT_NONE, .sheerForceBoost = TRUE, .ballisticMove = TRUE, + ADDITIONAL_EFFECTS( + SECONDARY_EFFECT(MOVE_EFFECT_POISON, 30) + ) }, [MOVE_MUD_SLAP] = @@ -6140,12 +6150,11 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_DYNAMAX] = [MOVE_POISON_TAIL] = { - .effect = EFFECT_POISON_HIT, + .effect = EFFECT_HIT, .power = 50, .type = TYPE_POISON, .accuracy = 100, .pp = 25, - .secondaryEffectChance = 10, .target = MOVE_TARGET_SELECTED, .priority = 0, .split = SPLIT_PHYSICAL, @@ -6153,6 +6162,9 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_DYNAMAX] = .makesContact = TRUE, .highCritRatio = TRUE, .sheerForceBoost = TRUE, + ADDITIONAL_EFFECTS( + SECONDARY_EFFECT(MOVE_EFFECT_POISON, 10) + ) }, [MOVE_COVET] = @@ -7115,18 +7127,20 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_DYNAMAX] = [MOVE_POISON_JAB] = { - .effect = EFFECT_POISON_HIT, + .effect = EFFECT_HIT, .power = 80, .type = TYPE_POISON, .accuracy = 100, .pp = 20, - .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_POISON, 30) + ) }, [MOVE_DARK_PULSE] = @@ -7823,12 +7837,11 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_DYNAMAX] = [MOVE_CROSS_POISON] = { - .effect = EFFECT_POISON_HIT, + .effect = EFFECT_HIT, .power = 70, .type = TYPE_POISON, .accuracy = 100, .pp = 20, - .secondaryEffectChance = 10, .target = MOVE_TARGET_SELECTED, .priority = 0, .split = SPLIT_PHYSICAL, @@ -7837,6 +7850,9 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_DYNAMAX] = .highCritRatio = TRUE, .sheerForceBoost = TRUE, .slicingMove = TRUE, + ADDITIONAL_EFFECTS( + SECONDARY_EFFECT(MOVE_EFFECT_POISON, 10) + ) }, [MOVE_GUNK_SHOT] = @@ -7846,16 +7862,18 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_DYNAMAX] = #else .accuracy = 70, #endif - .effect = EFFECT_POISON_HIT, + .effect = EFFECT_HIT, .power = 120, .type = TYPE_POISON, .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_POISON, 30) + ) }, [MOVE_IRON_HEAD] = @@ -8539,17 +8557,19 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_DYNAMAX] = [MOVE_SLUDGE_WAVE] = { - .effect = EFFECT_POISON_HIT, + .effect = EFFECT_HIT, .power = 95, .type = TYPE_POISON, .accuracy = 100, .pp = 10, - .secondaryEffectChance = 10, .target = MOVE_TARGET_FOES_AND_ALLY, .priority = 0, .split = SPLIT_SPECIAL, .zMoveEffect = Z_EFFECT_NONE, .sheerForceBoost = TRUE, + ADDITIONAL_EFFECTS( + SECONDARY_EFFECT(MOVE_EFFECT_POISON, 10) + ) }, [MOVE_QUIVER_DANCE] = @@ -13399,12 +13419,14 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_DYNAMAX] = #else .pp = 15, #endif - .secondaryEffectChance = 50, .target = MOVE_TARGET_SELECTED, .priority = 0, .split = SPLIT_PHYSICAL, .zMoveEffect = Z_EFFECT_NONE, .sheerForceBoost = TRUE, + ADDITIONAL_EFFECTS( + SECONDARY_EFFECT(MOVE_EFFECT_POISON, 50) + ) }, [MOVE_ESPER_WING] = @@ -14380,12 +14402,11 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_DYNAMAX] = [MOVE_NOXIOUS_TORQUE] = { - .effect = EFFECT_POISON_HIT, + .effect = EFFECT_HIT, .power = 100, .type = TYPE_POISON, .accuracy = 100, .pp = 10, - .secondaryEffectChance = 30, .target = MOVE_TARGET_SELECTED, .priority = 0, .split = SPLIT_PHYSICAL, @@ -14400,6 +14421,9 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_DYNAMAX] = .instructBanned = TRUE, .encoreBanned = TRUE, .assistBanned = TRUE, + ADDITIONAL_EFFECTS( + SECONDARY_EFFECT(MOVE_EFFECT_POISON, 30) + ) }, [MOVE_COMBAT_TORQUE] = diff --git a/test/battle/ability/immunity.c b/test/battle/ability/immunity.c index 3c6c4afa6f..cab0bf945e 100644 --- a/test/battle/ability/immunity.c +++ b/test/battle/ability/immunity.c @@ -4,7 +4,7 @@ SINGLE_BATTLE_TEST("Immunity prevents Poison Sting poison") { GIVEN { - ASSUME(gBattleMoves[MOVE_POISON_STING].effect == EFFECT_POISON_HIT); + ASSUME(gBattleMoves[MOVE_POISON_STING].additionalEffects[0].moveEffect == MOVE_EFFECT_POISON); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_SNORLAX) { Ability(ABILITY_IMMUNITY); } } WHEN { diff --git a/test/battle/ability/pastel_veil.c b/test/battle/ability/pastel_veil.c index 74d764fc30..104505f3c9 100644 --- a/test/battle/ability/pastel_veil.c +++ b/test/battle/ability/pastel_veil.c @@ -4,7 +4,7 @@ SINGLE_BATTLE_TEST("Pastel Veil prevents Poison Sting poison") { GIVEN { - ASSUME(gBattleMoves[MOVE_POISON_STING].effect == EFFECT_POISON_HIT); + ASSUME(gBattleMoves[MOVE_POISON_STING].additionalEffects[0].moveEffect == MOVE_EFFECT_POISON); PLAYER(SPECIES_WOBBUFFET); OPPONENT(SPECIES_PONYTA_GALARIAN) { Ability(ABILITY_PASTEL_VEIL); } } WHEN { @@ -18,7 +18,7 @@ SINGLE_BATTLE_TEST("Pastel Veil prevents Poison Sting poison") DOUBLE_BATTLE_TEST("Pastel Veil prevents Poison Sting poison on partner") { GIVEN { - ASSUME(gBattleMoves[MOVE_POISON_STING].effect == EFFECT_POISON_HIT); + ASSUME(gBattleMoves[MOVE_POISON_STING].additionalEffects[0].moveEffect == MOVE_EFFECT_POISON); PLAYER(SPECIES_WOBBUFFET); PLAYER(SPECIES_WYNAUT); OPPONENT(SPECIES_PONYTA_GALARIAN) { Ability(ABILITY_PASTEL_VEIL); } diff --git a/test/battle/move_effect/barb_barrage.c b/test/battle/move_effect/barb_barrage.c index 89062b3de6..a7db476532 100644 --- a/test/battle/move_effect/barb_barrage.c +++ b/test/battle/move_effect/barb_barrage.c @@ -3,7 +3,8 @@ ASSUMPTIONS { - //ASSUME(gBattleMoves[MOVE_BARB_BARRAGE].effect == EFFECT_BARB_BARRAGE); + ASSUME(gBattleMoves[MOVE_BARB_BARRAGE].effect == EFFECT_BARB_BARRAGE); + ASSUME(gBattleMoves[MOVE_BARB_BARRAGE].additionalEffects[0].moveEffect == MOVE_EFFECT_POISON); } SINGLE_BATTLE_TEST("Barb Barrage inflicts poison") diff --git a/test/battle/move_effect/poison_hit.c b/test/battle/move_effect/poison_hit.c index 229355cb65..c7751f6c5b 100644 --- a/test/battle/move_effect/poison_hit.c +++ b/test/battle/move_effect/poison_hit.c @@ -3,8 +3,8 @@ ASSUMPTIONS { - ASSUME(gBattleMoves[MOVE_POISON_STING].effect == EFFECT_POISON_HIT); - ASSUME(gBattleMoves[MOVE_TWINEEDLE].effect == EFFECT_POISON_HIT); + ASSUME(gBattleMoves[MOVE_POISON_STING].additionalEffects[0].moveEffect == MOVE_EFFECT_POISON); + ASSUME(gBattleMoves[MOVE_TWINEEDLE].additionalEffects[0].moveEffect == MOVE_EFFECT_POISON); } SINGLE_BATTLE_TEST("Poison Sting inflicts poison")