{
  num: -130125,
  accuracy: 100,
  basePower: 75,
  category: "Physical",
  name: "Irooni",
  pp: 5,
  priority: 0,
  flags: { contact: 1, protect: 1, mirror: 1, metronome: 1, slicing: 1 },
  onModifyMove(move, pokemon, target) {
    move.ignoreEvasion = true;
  },
  onBasePower(basePower, source, target, move) {
    if (!target) return;
    if (target.hasType("Dark") || target.hasType("Ghost") || target.hasType("Psychic") || target.hasType("Poison") || target.hasType("Steel")) return this.chainModify(16 / 7);
  },
  onAfterMoveSecondarySelf(source, target, move) {
    if (!source) return;
    source.addVolatile("colorexposed", source, move);
    if (!source.hasAbility("katenkyokotsu")) return;
    if (!source.terastallized) source.setType(["Dark", "Steel"]);
    this.add("-activate", source, "ability: Katen Kyokotsu");
    source.shunsuiGamesWon = source.shunsuiGamesWon || {};
    const fresh = !source.shunsuiGamesWon.irooni;
    if (fresh) {
      source.shunsuiGamesWon.irooni = true;
      this.boost({def: 1, spd: 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 === "irooni" ? 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: 140 },
  contestType: "Clever",
  desc: "The color game. Shunsui calls black, dealing huge damage to dark-colored type groups, shifting to Dark/Steel, and healing, but exposing himself to counterattacks afterward. Winning adds to Katen Kyokotsu's score."
}
