{
  num: -130123,
  accuracy: true,
  basePower: 95,
  category: "Physical",
  name: "Kageoni",
  pp: 10,
  priority: 0,
  flags: { protect: 1, mirror: 1, metronome: 1, slicing: 1 },
  onModifyPriority(priority, source, target, move) {
    if (target && target.volatiles && target.volatiles.shadowmark) return priority + 1;
  },
  onModifyMove(move, pokemon, target) {
    move.ignoreEvasion = true;
    if (target && target.volatiles && target.volatiles.shadowmark) move.willCrit = true;
  },
  onBasePower(basePower, pokemon, target, move) {
    if (target && target.volatiles && target.volatiles.shadowmark) return this.chainModify(1.35);
  },
  onHit(target, source, move) {
    if (!target || !source) return;
    target.addVolatile("shadowmark", source, move);
  },
  onAfterMoveSecondarySelf(source, target, move) {
    if (!source || !source.hasAbility("katenkyokotsu")) return;
    if (!source.terastallized) source.setType(["Dark", "Ghost"]);
    this.add("-activate", source, "ability: Katen Kyokotsu");
    source.shunsuiGamesWon = source.shunsuiGamesWon || {};
    const fresh = !source.shunsuiGamesWon.kageoni;
    if (fresh) {
      source.shunsuiGamesWon.kageoni = true;
      this.boost({atk: 1}, source, source, this.dex.abilities.get("katenkyokotsu"));
    }
    const score = Object.keys(source.shunsuiGamesWon).length;
    if (score >= 3 && !source.shunsuiGameMaster) {
      source.shunsuiGameMaster = true;
      this.boost({atk: 1, spe: 1}, source, source, this.dex.abilities.get("katenkyokotsu"));
      this.heal(Math.max(1, Math.floor(source.maxhp / 4)), source, source, this.dex.abilities.get("katenkyokotsu"));
    }
    let heal = source.shunsuiRepeatGamePenalty === "kageoni" ? Math.floor(source.maxhp / 12) : Math.floor(source.maxhp / (source.shunsuiGameMaster ? 6 : 8));
    if (target && target.fainted) heal = Math.max(heal, Math.floor(source.maxhp / 3));
    this.heal(Math.max(1, heal), source, source, this.dex.abilities.get("katenkyokotsu"));
  },
  secondary: null,
  target: "normal",
  type: "Dark",
  zMove: { basePower: 175 },
  contestType: "Cool",
  desc: "The shadow game. It marks the target's shadow. Against Shadow Marked targets, it gains priority, always crits, and hits much harder. Winning shifts Shunsui to Dark/Ghost, heals him, and adds to Katen Kyokotsu's score."
}
