Skip to content

Commit

Permalink
add check for held item before using poltergeist and a check that it …
Browse files Browse the repository at this point in the history
…is the first turn for moves that are first turn only (#4693)
  • Loading branch information
iriv24 authored Jun 1, 2024
1 parent 0a8284c commit 43e2a97
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/battle_ai_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,14 @@ bool32 IsDamageMoveUnusable(u32 move, u32 battlerAtk, u32 battlerDef)
if (!(gFieldStatuses & STATUS_FIELD_TERRAIN_ANY) && gMovesInfo[move].argument == ARG_TRY_REMOVE_TERRAIN_FAIL)
return TRUE;
break;
case EFFECT_POLTERGEIST:
if (AI_DATA->items[battlerDef] == ITEM_NONE)
return TRUE;
break;
case EFFECT_FIRST_TURN_ONLY:
if (!gDisableStructs[battlerAtk].isFirstTurn)
return TRUE;
break;
}

return FALSE;
Expand Down

0 comments on commit 43e2a97

Please sign in to comment.