pokemon-showdown/data/mods/gen8linked/items.ts
WeWuzNidokangz 580ed48329
OMs: Fix generation consistency (#9088)
* Linked: Fix generation consistency

* Fix same issue with Pokebilities

* Clean up
2022-12-05 16:05:08 -07:00

15 lines
370 B
TypeScript

export const Items: {[k: string]: ModdedItemData} = {
leppaberry: {
inherit: true,
onUpdate(pokemon) {
if (!pokemon.hp) return;
const moveSlot = pokemon.getMoveData(pokemon.m.lastMoveAbsolute);
if (moveSlot?.pp === 0) {
pokemon.addVolatile('leppaberry');
pokemon.volatiles['leppaberry'].moveSlot = moveSlot;
pokemon.eatItem();
}
},
},
};