Fixing bugs with Moxie clones+Dynamax, Fling Flinch infinite loop and Focus Sash+foreseen moves (#4625)

* Fixed Elixirs not being able to be used unless the first move was missing PP

* Revert "Pokedex Plus fixes (#4514)"

This reverts commit 982934c4aa.

* Pokedex Plus fixes (#4514)

* Pokedex plus no longer allows browsing unseen evos

* Restore "has no evolutions" printing

* only print "has no evolution" text at 0 depth

* Revert config changes

* fix duplicate icons and removed eevee hardcodes

* add new scope and indentation fixes

* actually introduce new scope

* Revert "Fixed Elixirs not being able to be used unless the first move was missing PP"

This reverts commit 313f2e5526.

* Initial Testing of Focus Sash+Future Sight

* Fixed infinite loop when flinging Razor Fang on a mon that's already moved

* Fixed Moxie clones not triggering on pokemon fainted by Max Moves

* Fixed Focus Sash enduring another time if broken by foreseen moves

* Update src/battle_script_commands.c

Co-authored-by: Alex <93446519+AlexOn1ine@users.noreply.github.com>

* Update src/battle_script_commands.c

Co-authored-by: Alex <93446519+AlexOn1ine@users.noreply.github.com>

* Added assumptions to tests

---------

Co-authored-by: Hedara <hedara90@gmail.com>
Co-authored-by: sneed <56992013+Sneed69@users.noreply.github.com>
Co-authored-by: Alex <93446519+AlexOn1ine@users.noreply.github.com>
This commit is contained in:
hedara90 2024-05-26 17:01:20 +02:00 committed by GitHub
parent 474f929c02
commit 487dc92119
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 46 additions and 1 deletions

View file

@ -2096,6 +2096,9 @@ static void Cmd_adjustdamage(void)
{
gMoveResultFlags |= MOVE_RESULT_FOE_HUNG_ON;
gLastUsedItem = gBattleMons[gBattlerTarget].item;
gSpecialStatuses[gBattlerTarget].focusBanded = FALSE;
gSpecialStatuses[gBattlerTarget].focusSashed = FALSE;
}
else if (gSpecialStatuses[gBattlerTarget].sturdied)
{
@ -3212,6 +3215,10 @@ void SetMoveEffect(bool32 primary, bool32 certain)
{
gBattleMons[gEffectBattler].status2 |= sStatusFlagsForMoveEffects[gBattleScripting.moveEffect];
gBattlescriptCurrInstr++;
}
else
{
gBattlescriptCurrInstr++;
}
break;
case MOVE_EFFECT_UPROAR:
@ -8406,7 +8413,7 @@ static bool32 HasAttackerFaintedTarget(void)
&& gBattleStruct->moveTarget[gBattlerAttacker] == gBattlerTarget
&& gBattlerTarget != gBattlerAttacker
&& gCurrentTurnActionNumber == GetBattlerTurnOrderNum(gBattlerAttacker)
&& (gChosenMove == gChosenMoveByBattler[gBattlerAttacker] || gChosenMove == gBattleMons[gBattlerAttacker].moves[gChosenMovePos]))
&& (gChosenMove == gChosenMoveByBattler[gBattlerAttacker] || gChosenMove == gBattleMons[gBattlerAttacker].moves[gChosenMovePos] || gChosenMove == GetMaxMove(gBattlerAttacker, gChosenMoveByBattler[gBattlerAttacker])))
return TRUE;
else
return FALSE;
@ -9486,6 +9493,7 @@ static void Cmd_various(void)
case VARIOUS_TRY_ACTIVATE_BEAST_BOOST:
{
VARIOUS_ARGS();
i = GetHighestStatId(battler);
if (GetBattlerAbility(battler) == ABILITY_BEAST_BOOST
&& HasAttackerFaintedTarget()

View file

@ -5,6 +5,8 @@ ASSUMPTIONS
{
ASSUME(gMovesInfo[MOVE_SEED_FLARE].power == gMovesInfo[MOVE_FUTURE_SIGHT].power);
ASSUME(gMovesInfo[MOVE_SEED_FLARE].category == gMovesInfo[MOVE_FUTURE_SIGHT].category);
ASSUME(gMovesInfo[MOVE_FUTURE_SIGHT].effect == EFFECT_FUTURE_SIGHT);
ASSUME(gMovesInfo[MOVE_FUTURE_SIGHT].power > 0);
}
SINGLE_BATTLE_TEST("Future Sight uses Sp. Atk stat of the original user without modifiers")
@ -153,3 +155,22 @@ SINGLE_BATTLE_TEST("Future Sight will miss timing if target faints by residual d
NOT MESSAGE("Foe Wynaut took the Future Sight attack!");
}
}
SINGLE_BATTLE_TEST("Future Sight breaks Focus Sash and doesn't make the holder endure another move")
{
ASSUME(gMovesInfo[MOVE_PSYCHIC].power > 0);
ASSUME(gItemsInfo[ITEM_FOCUS_SASH].holdEffect == HOLD_EFFECT_FOCUS_SASH);
GIVEN {
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_PIDGEY) { Level(1); Item(ITEM_FOCUS_SASH); }
} WHEN {
TURN { MOVE(player, MOVE_FUTURE_SIGHT); }
TURN { }
TURN { }
TURN { MOVE(player, MOVE_PSYCHIC); }
} SCENE {
MESSAGE("Foe Pidgey hung on using its Focus Sash!");
ANIMATION(ANIM_TYPE_MOVE, MOVE_PSYCHIC, player);
MESSAGE("Foe Pidgey fainted!");
}
}

View file

@ -1470,3 +1470,19 @@ SINGLE_BATTLE_TEST("(DYNAMAX) Max Moves don't execute effects on fainted battler
NOT MESSAGE("Foe Wobbuffet's Speed fell!");
}
}
SINGLE_BATTLE_TEST("(DYNAMAX) Moxie clones can be triggered by Max Moves fainting opponents")
{
ASSUME(gMovesInfo[MOVE_WATERFALL].power > 0);
GIVEN {
PLAYER(SPECIES_GYARADOS) { Ability(ABILITY_MOXIE); }
OPPONENT(SPECIES_WOBBUFFET) { HP(1); }
OPPONENT(SPECIES_WYNAUT);
} WHEN {
TURN { MOVE(opponent, MOVE_CELEBRATE); MOVE(player, MOVE_WATERFALL, dynamax: TRUE); SEND_OUT(opponent, 1); }
} SCENE {
MESSAGE("Foe Wobbuffet fainted!");
ABILITY_POPUP(player, ABILITY_MOXIE);
MESSAGE("Gyarados's Moxie raised its Attack!");
}
}