{
    onUpdate(pokemon) {
      if (this.gameType !== "doubles")
        return;
      const ally = pokemon.allies()[0];
      if (!ally || !["joltikender", "joltikchild"].includes(pokemon.species.id) || !["galvantulaender", "galvantulaparent"].includes(ally.species.id)) {
        if (pokemon.getVolatile("commanding"))
          pokemon.removeVolatile("commanding");
          if (pokemon.species.id !== "joltikchild" || pokemon.transformed)
            return;
          if (pokemon.species.id === "joltikchild") {
            pokemon.formeChange("Joltik-Ender");
          }
        return;
      }
      if (!pokemon.getVolatile("commanding")) {
        if (ally.getVolatile("attachment"))
          return;
        this.queue.cancelAction(pokemon);
        this.add("-activate", pokemon, "ability: Attachment", "[of] " + ally);
        if (pokemon.species.id !== "joltikender" || pokemon.transformed)
          return;
        if (pokemon.species.id === "joltikender") {
          pokemon.formeChange("Joltik-Child");
        }
        pokemon.addVolatile("commanding");
        ally.addVolatile("attachment", pokemon);
      } else {
        if (!ally.fainted)
          return;
        pokemon.removeVolatile("commanding");
        if (pokemon.species.id !== "joltikchild" || pokemon.transformed)
          return;
        if (pokemon.species.id === "joltikchild") {
          pokemon.formeChange("Joltik-Ender");
        }
      }
    },
    flags: { failroleplay: 1, noreceiver: 1, noentrain: 1, notrace: 1, failskillswap: 1 },
    name: "Attachment",
    rating: 0,
    num: -32002
}