{
    num: 256,
    accuracy: true,
    basePower: 0,
    category: "Status",
    name: "Swallow",
    pp: 10,
    priority: 0,
    flags: {snatch: 1, heal: 1, metronome: 1},
    onTry(source) {
        return !!source.volatiles['stockpile'];
    },
    onHit(pokemon) {
        const healAmount = [0.25, 0.5, 1];
        const success = !!this.heal(this.modify(pokemon.maxhp, healAmount[(pokemon.volatiles['stockpile'].layers - 1)]));
        if (!success) this.add('-fail', pokemon, 'heal');
        pokemon.removeVolatile('stockpile');

        const item = pokemon.getItem();
        if (item.isBerry) {
            pokemon.eatItem();
        }

        return success || this.NOT_FAIL;
    },
    secondary: null,
    target: "self",
    type: "Normal",
    zMove: {effect: 'clearnegativeboost'},
    contestType: "Tough",
}
