mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-12-27 20:24:18 +01:00
Psychic Terrain blocks priority moves
This commit is contained in:
parent
3be070f0c3
commit
6ae949e360
@ -5984,6 +5984,11 @@ BattleScript_DazzlingProtected::
|
||||
printstring STRINGID_POKEMONCANNOTUSEMOVE
|
||||
waitmessage 0x40
|
||||
goto BattleScript_MoveEnd
|
||||
|
||||
BattleScript_MoveUsedPsychicTerrainPrevents::
|
||||
printstring STRINGID_POKEMONCANNOTUSEMOVE
|
||||
waitmessage 0x40
|
||||
goto BattleScript_MoveEnd
|
||||
|
||||
BattleScript_AbilityNoSpecificStatLoss::
|
||||
pause 0x20
|
||||
|
@ -285,5 +285,6 @@ extern const u8 BattleScript_TrainerSlideMsgEnd2[];
|
||||
extern const u8 BattleScript_MoveEffectFeint[];
|
||||
extern const u8 BattleScript_ProteanActivates[];
|
||||
extern const u8 BattleScript_DazzlingProtected[];
|
||||
extern const u8 BattleScript_MoveUsedPsychicTerrainPrevents[];
|
||||
|
||||
#endif // GUARD_BATTLE_SCRIPTS_H
|
||||
|
@ -64,6 +64,7 @@ bool8 HandleWishPerishSongOnTurnEnd(void);
|
||||
bool8 HandleFaintedMonActions(void);
|
||||
void TryClearRageAndFuryCutter(void);
|
||||
u8 AtkCanceller_UnableToUseMove(void);
|
||||
u8 AtkCanceller_UnableToUseMove2(void);
|
||||
bool8 HasNoMonsToSwitch(u8 battlerId, u8 r1, u8 r2);
|
||||
u8 CastformDataTypeChange(u8 battlerId);
|
||||
bool32 TryChangeBattleWeather(u8 battler, u32 weatherEnumId, bool32 viaAbility);
|
||||
|
@ -979,6 +979,8 @@ static void atk00_attackcanceler(void)
|
||||
return;
|
||||
}
|
||||
|
||||
if (AtkCanceller_UnableToUseMove2())
|
||||
return;
|
||||
if (AbilityBattleEffects(ABILITYEFFECT_MOVES_BLOCK, gBattlerTarget, 0, 0, 0))
|
||||
return;
|
||||
if (!gBattleMons[gBattlerAttacker].pp[gCurrMovePos] && gCurrentMove != MOVE_STRUGGLE && !(gHitMarker & (HITMARKER_x800000 | HITMARKER_NO_ATTACKSTRING))
|
||||
|
@ -1986,6 +1986,8 @@ enum
|
||||
CANCELLER_BIDE,
|
||||
CANCELLER_THAW,
|
||||
CANCELLER_END,
|
||||
CANCELLER_PSYCHIC_TERRAIN,
|
||||
CANCELLER_END2,
|
||||
};
|
||||
|
||||
u8 AtkCanceller_UnableToUseMove(void)
|
||||
@ -2288,6 +2290,38 @@ u8 AtkCanceller_UnableToUseMove(void)
|
||||
return effect;
|
||||
}
|
||||
|
||||
// After Protean Activation.
|
||||
u8 AtkCanceller_UnableToUseMove2(void)
|
||||
{
|
||||
u8 effect = 0;
|
||||
do
|
||||
{
|
||||
switch (gBattleStruct->atkCancellerTracker)
|
||||
{
|
||||
case CANCELLER_END:
|
||||
gBattleStruct->atkCancellerTracker++;
|
||||
case CANCELLER_PSYCHIC_TERRAIN:
|
||||
if (gFieldStatuses & STATUS_FIELD_PSYCHIC_TERRAIN
|
||||
&& IsBattlerGrounded(gBattlerAttacker)
|
||||
&& gBattleStruct->movePriorities[gBattlerAttacker] > 0
|
||||
&& GetBattlerSide(gBattlerAttacker) != GetBattlerSide(gBattlerTarget))
|
||||
{
|
||||
CancelMultiTurnMoves(gBattlerAttacker);
|
||||
gBattlescriptCurrInstr = BattleScript_MoveUsedPsychicTerrainPrevents;
|
||||
gHitMarker |= HITMARKER_UNABLE_TO_USE_MOVE;
|
||||
effect = 1;
|
||||
}
|
||||
gBattleStruct->atkCancellerTracker++;
|
||||
break;
|
||||
case CANCELLER_END2:
|
||||
break;
|
||||
}
|
||||
|
||||
} while (gBattleStruct->atkCancellerTracker != CANCELLER_END2 && effect == 0);
|
||||
|
||||
return effect;
|
||||
}
|
||||
|
||||
bool8 HasNoMonsToSwitch(u8 battler, u8 partyIdBattlerOn1, u8 partyIdBattlerOn2)
|
||||
{
|
||||
struct Pokemon *party;
|
||||
|
Loading…
Reference in New Issue
Block a user