{
  num: -21020,
  accuracy: 95,
  basePower: 100,
  category: "Special",
  name: "Gene Splice",
  pp: 5,
  priority: 0,
  flags: { protect: 1, mirror: 1, metronome: 1 },
  onTryHit(target, source) {
    const targetAbility = target.getAbility();
    const sourceAbility = source.getAbility();
    if (sourceAbility.flags["failskillswap"] || targetAbility.flags["failskillswap"] || target.volatiles["dynamax"]) {
      return false;
    }
    const sourceCanBeSet = this.runEvent("SetAbility", source, source, this.effect, targetAbility);
    if (!sourceCanBeSet) return sourceCanBeSet;
    const targetCanBeSet = this.runEvent("SetAbility", target, source, this.effect, sourceAbility);
    if (!targetCanBeSet) return targetCanBeSet;
  },
  onHit(target, source, move) {
    const targetAbility = target.getAbility();
    const sourceAbility = source.getAbility();
    this.add("-activate", source, "move: Gene Splice", targetAbility, sourceAbility, "[of] " + target);
    this.singleEvent("End", sourceAbility, source.abilityState, source);
    this.singleEvent("End", targetAbility, target.abilityState, target);
    source.ability = targetAbility.id;
    target.ability = sourceAbility.id;
    source.abilityState = { id: this.toID(source.ability), target: source };
    target.abilityState = { id: this.toID(target.ability), target };
    target.volatileStaleness = "external";
    this.singleEvent("Start", targetAbility, source.abilityState, source);
    this.singleEvent("Start", sourceAbility, target.abilityState, target);
  },
  secondary: null,
  target: "normal",
  type: "Poison",
  contestType: "Clever"
}
