mirror of
https://github.com/rh-hideout/pokeemerald-expansion.git
synced 2026-04-26 02:14:22 -05:00
Fix max move message against semi invulnerable target (#8313)
Co-authored-by: Alex <93446519+AlexOn1ine@users.noreply.github.com>
This commit is contained in:
parent
7ec0a1db9a
commit
7229305ff9
|
|
@ -9333,8 +9333,10 @@ BattleScript_TargetAbilityStatRaiseRet_End:
|
|||
@@@ MAX MOVES @@@
|
||||
BattleScript_EffectMaxMove::
|
||||
attackcanceler
|
||||
attackstring
|
||||
ppreduce
|
||||
accuracycheck BattleScript_ButItFailed, NO_ACC_CALC_CHECK_LOCK_ON
|
||||
goto BattleScript_HitFromAtkString
|
||||
goto BattleScript_HitFromCritCalc
|
||||
|
||||
BattleScript_EffectRaiseStatAllies::
|
||||
savetarget
|
||||
|
|
|
|||
|
|
@ -1370,8 +1370,23 @@ static void AccuracyCheck(bool32 recalcDragonDarts, const u8 *nextInstr, const u
|
|||
if (gBattleMons[gBattlerTarget].volatiles.lockOn && gDisableStructs[gBattlerTarget].battlerWithSureHit == gBattlerAttacker)
|
||||
gBattlescriptCurrInstr = nextInstr;
|
||||
else if (IsSemiInvulnerable(gBattlerTarget, CHECK_ALL))
|
||||
{
|
||||
if (gBattlerTarget != BATTLE_PARTNER(gBattlerAttacker))
|
||||
{
|
||||
gBattleStruct->moveResultFlags[gBattlerTarget] |= MOVE_RESULT_MISSED;
|
||||
gBattleStruct->missStringId[gBattlerTarget] = gBattleCommunication[MISS_TYPE] = B_MSG_AVOIDED_ATK;
|
||||
}
|
||||
gBattlescriptCurrInstr = failInstr;
|
||||
else if (!JumpIfMoveAffectedByProtect(gCurrentMove, gBattlerTarget, TRUE, failInstr))
|
||||
}
|
||||
else if (IsBattlerProtected(gBattlerAttacker, gBattlerTarget, gCurrentMove))
|
||||
{
|
||||
gBattleStruct->moveResultFlags[gBattlerTarget] |= MOVE_RESULT_MISSED;
|
||||
gBattleStruct->missStringId[gBattlerTarget] = gBattleCommunication[MISS_TYPE] = B_MSG_PROTECTED;
|
||||
gLastLandedMoves[gBattlerTarget] = 0;
|
||||
gLastHitByType[gBattlerTarget] = 0;
|
||||
gBattlescriptCurrInstr = failInstr;
|
||||
}
|
||||
else
|
||||
gBattlescriptCurrInstr = nextInstr;
|
||||
if (GetActiveGimmick(gBattlerAttacker) == GIMMICK_DYNAMAX)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1671,6 +1671,20 @@ SINGLE_BATTLE_TEST("Dynamax: Destiny Bond fails if a dynamaxed battler is presen
|
|||
}
|
||||
}
|
||||
|
||||
SINGLE_BATTLE_TEST("Dynamax: max move against semi-invulnerable target prints the correct message")
|
||||
{
|
||||
GIVEN {
|
||||
PLAYER(SPECIES_WOBBUFFET) {Speed(1);};
|
||||
OPPONENT(SPECIES_WOBBUFFET) {Speed(2);};
|
||||
} WHEN {
|
||||
TURN { MOVE(player, MOVE_SCRATCH, gimmick: GIMMICK_DYNAMAX); MOVE(opponent, MOVE_FLY); }
|
||||
} SCENE {
|
||||
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_DYNAMAX_GROWTH, player);
|
||||
MESSAGE("Wobbuffet used Max Strike!");
|
||||
MESSAGE("The opposing Wobbuffet avoided the attack!");
|
||||
}
|
||||
}
|
||||
|
||||
DOUBLE_BATTLE_TEST("Dynamax stat lowering moves don't make stat-changing abilities apply to partner")
|
||||
{
|
||||
u32 move, stat, ability;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user