mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2025-01-14 15:43:43 +01:00
redo prankster checks to handle assist
This commit is contained in:
parent
80a48de702
commit
fc84ebbd3e
@ -146,6 +146,7 @@ struct ProtectStruct
|
||||
u32 custap:1; // also quick claw
|
||||
u32 touchedProtectLike:1;
|
||||
u32 disableEjectPack:1;
|
||||
u32 pranksterElevated:1;
|
||||
u32 physicalDmg;
|
||||
u32 specialDmg;
|
||||
u8 physicalBattlerId;
|
||||
|
@ -4293,6 +4293,7 @@ s8 GetChosenMovePriority(u32 battlerId)
|
||||
{
|
||||
u16 move;
|
||||
|
||||
gProtectStructs[battlerId].pranksterElevated = 0;
|
||||
if (gProtectStructs[battlerId].noValidMoves)
|
||||
move = MOVE_STRUGGLE;
|
||||
else
|
||||
@ -4314,6 +4315,7 @@ s8 GetMovePriority(u32 battlerId, u16 move)
|
||||
}
|
||||
else if (GetBattlerAbility(battlerId) == ABILITY_PRANKSTER && IS_MOVE_STATUS(move))
|
||||
{
|
||||
gProtectStructs[battlerId].pranksterElevated = 1;
|
||||
priority++;
|
||||
}
|
||||
else if (GetBattlerAbility(battlerId) == ABILITY_TRIAGE)
|
||||
|
@ -3415,13 +3415,14 @@ u8 AtkCanceller_UnableToUseMove(void)
|
||||
break;
|
||||
case CANCELLER_PRANKSTER:
|
||||
#if B_PRANKSTER_DARK_TYPES >= GEN_7
|
||||
if (GetBattlerAbility(gBattlerAttacker) == ABILITY_PRANKSTER
|
||||
&& IS_MOVE_STATUS(gCurrentMove)
|
||||
if (gProtectStructs[gBattlerAttacker].pranksterElevated
|
||||
&& GetBattlerSide(gBattlerAttacker) != GetBattlerSide(gBattlerTarget)
|
||||
&& !(gBattleMoves[gCurrentMove].target & MOVE_TARGET_OPPONENTS_FIELD)
|
||||
&& IS_BATTLER_OF_TYPE(gBattlerTarget, TYPE_DARK)
|
||||
&& !(gBattleMoves[gCurrentMove].target & (MOVE_TARGET_OPPONENTS_FIELD | MOVE_TARGET_DEPENDS)) // Don't block hazards, assist-type moves
|
||||
&& IS_BATTLER_OF_TYPE(gBattlerTarget, TYPE_DARK) // Only Dark types can block Prankster'e
|
||||
&& !(gStatuses3[gBattlerTarget] & STATUS3_SEMI_INVULNERABLE)
|
||||
&& GetBattlerAbility(gBattlerTarget) != ABILITY_MAGIC_BOUNCE) // Magic bounce will bounce back prankster'd status move instead of blocking it
|
||||
&& !(IS_MOVE_STATUS(gCurrentMove) // Magic bounce/coat will bounce back prankster'd status move instead of blocking it
|
||||
&& (GetBattlerAbility(gBattlerTarget) == ABILITY_MAGIC_BOUNCE || TestMoveFlags(gCurrentMove, FLAG_MAGIC_COAT_AFFECTED)))
|
||||
)
|
||||
{
|
||||
if (!(gBattleTypeFlags & BATTLE_TYPE_DOUBLE) || !(gBattleMoves[gCurrentMove].target & (MOVE_TARGET_BOTH | MOVE_TARGET_FOES_AND_ALLY)))
|
||||
CancelMultiTurnMoves(gBattlerAttacker); // Don't cancel moves that can hit two targets bc one target might not be protected
|
||||
@ -6853,7 +6854,11 @@ u8 GetMoveTarget(u16 move, u8 setTarget)
|
||||
moveTarget = setTarget - 1;
|
||||
else
|
||||
moveTarget = gBattleMoves[move].target;
|
||||
|
||||
|
||||
// Special cases
|
||||
if (move == MOVE_CURSE && !IS_BATTLER_OF_TYPE(gBattlerAttacker, TYPE_GHOST))
|
||||
moveTarget = MOVE_TARGET_USER;
|
||||
|
||||
switch (moveTarget)
|
||||
{
|
||||
case MOVE_TARGET_SELECTED:
|
||||
|
Loading…
x
Reference in New Issue
Block a user