[Bug] Enemy pokemon's Harvest creates berry icons on the player's side when triggered (#3077)

This commit is contained in:
schmidtc1 2024-07-22 20:42:55 -04:00 committed by GitHub
parent d3c9392721
commit e84649854d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -3031,7 +3031,11 @@ export class PostTurnLootAbAttr extends PostTurnAbAttr {
) as BerryModifier | undefined; ) as BerryModifier | undefined;
if (!berryModifier) { if (!berryModifier) {
pokemon.scene.addModifier(new BerryModifier(chosenBerry, pokemon.id, chosenBerryType, 1)); if (pokemon.isPlayer()) {
pokemon.scene.addModifier(new BerryModifier(chosenBerry, pokemon.id, chosenBerryType, 1));
} else {
pokemon.scene.addEnemyModifier(new BerryModifier(chosenBerry, pokemon.id, chosenBerryType, 1));
}
} else if (berryModifier.stackCount < berryModifier.getMaxHeldItemCount(pokemon)) { } else if (berryModifier.stackCount < berryModifier.getMaxHeldItemCount(pokemon)) {
berryModifier.stackCount++; berryModifier.stackCount++;
} }