pokemon-showdown/data/mods/linked/items.ts
Guangcong Luo 2f805c93a2
Remove "Battle" prefix from data exports (#7039)
`BattlePokedex` is now `Pokedex`, `BattleItems` is now `Items`, etc.

I also renamed `Movedex` to `Moves` and `Statuses` to `Conditions`.

`TypeChart` isn't `Types` yet, because unlike the others, it's not
indexed by ID. That should probably be fixed one day.
2020-07-24 12:42:26 -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();
}
},
},
};