add check for held item before using poltergeist and a check that it is the first turn for moves that are first turn only (#4693)

This commit is contained in:
Isaac Rivera 2024-06-01 19:00:17 -04:00 committed by GitHub
parent 0a8284ce9f
commit 43e2a973fc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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;