{
    onStart(pokemon) {
        this.field.setTerrain('electricterrain');

        if (pokemon.hadronEngineAttempted) return;

            if (this.field.isTerrain('electricterrain')) {
                pokemon.addVolatile('hadronengine');
                pokemon.hadronEngineAttempted = true;
            }

    },
    onEnd(pokemon) {
        pokemon.removeVolatile('hadronengine');
    },
    condition: {
        onStart(pokemon) {
            this.add('-start', pokemon, 'Hadron Engine Boost', '[silent]');
        },
        onModifySpAPriority: 5,
        onModifySpA(atk, attacker, defender, move) {
            if (this.field.isTerrain('electricterrain')) {
                this.debug('Hadron Engine boost');
                return this.chainModify([5461, 4096]);
            }
        },
        onUpdate(pokemon) {
            if (!this.field.isTerrain('electricterrain')) {
                this.add('-end', pokemon, 'Hadron Engine Boost', '[silent]');
                pokemon.removeVolatile('hadronengine');
            }
        },
        onEnd(pokemon) {
            this.add('-end', pokemon, 'Hadron Engine Boost', '[silent]');
        },
    },
    flags: {},
    name: "Hadron Engine",
    rating: 4.5,
    num: 289,
}
