Redid Fang Moves

Pass tests too
This commit is contained in:
Nephrite 2023-11-23 00:21:57 +09:00
parent 7fb811d33d
commit ffe89c7248
7 changed files with 33 additions and 50 deletions

View file

@ -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

View file

@ -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

View file

@ -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;
}
}

View file

@ -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

View file

@ -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;

View file

@ -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] =

View file

@ -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); }