{
    num: 226,
    accuracy: true,
    basePower: 0,
    category: "Status",
    name: "Baton Pass",
    pp: 1,
    noPPBoosts: true,
    priority: -2,
    flags: { nosketch: 1, noassist: 1 },
    onHit(target) {
        if (!this.canSwitch(target.side) || target.volatiles['commanded']) {
            this.attrLastMove('[still]');
            this.add('-fail', target);
            return this.NOT_FAIL;
        }
        let statChanges = {};
        for (const stat in target.boosts) {
            if (target.boosts[stat] > 0) {
                let newBoost = Math.floor(target.boosts[stat] / 2);
                statChanges[stat] = newBoost - target.boosts[stat];
            } else if (target.boosts[stat] < 0) {
                let newBoost = Math.ceil(target.boosts[stat] / 2);
                statChanges[stat] = newBoost - target.boosts[stat];
            }
        }
        this.boost(statChanges, target);

        for (const vol in target.volatiles) {
            delete target.volatiles[vol];
        }
    },
    self: {
        onHit(source) {
            source.skipBeforeSwitchOutEventFlag = true;
        },
    },
    selfSwitch: 'copyvolatile',
    secondary: null,
    target: "self",
    type: "Normal",
    zMove: { effect: 'clearnegativeboost' },
    contestType: "Cute",
}
