{
  num: -13013,
  accuracy: 100,
  basePower: 150,
  category: "Physical",
  name: "Kokujo Tengen Myo'o",
  pp: 5,
  priority: 0,
  flags: { contact: 1, mirror: 1, metronome: 1 },
  breaksProtect: true,
  bankaiOnly(source, move) {
    if (!source) return false;
    const species = source.species || source.template || {};
    const speciesName = species.name || species.species || "";
    const speciesId = species.id || "";
    if (source.hasAbility?.("giantavatar")) return true;
    if (speciesName === "Komamura-Mega" || speciesName === "Komamura-Bankai" || speciesId === "komamuramega" || speciesId === "komamurabankai") return true;
    if (species.forme === "Mega" && (species.baseSpecies === "Komamura" || speciesName.includes("Komamura"))) return true;
    this.add("-fail", source, move);
    this.attrLastMove("[still]");
    return false;
  },
  onTry(source, target, move) {
    if (!this.effect.bankaiOnly.call(this, source, move)) return null;
  },
  onTryHit(target, source, move) {
    if (!this.effect.bankaiOnly.call(this, source, move)) return null;
    const protectedTarget = target?.volatiles?.protect || target?.volatiles?.banefulbunker || target?.volatiles?.burningbulwark || target?.volatiles?.kingsshield || target?.volatiles?.obstruct || target?.volatiles?.silktrap || target?.volatiles?.spikyshield;
    const protectedSide = target?.side?.sideConditions?.craftyshield || target?.side?.sideConditions?.matblock || target?.side?.sideConditions?.quickguard || target?.side?.sideConditions?.wideguard;
    if (protectedTarget || protectedSide) {
      move.komamuraProtectedTargets = move.komamuraProtectedTargets || {};
      move.komamuraProtectedTargets[target.uuid || target.name] = true;
    }
  },
  onBasePower(basePower, source, target, move) {
    if (move.komamuraProtectedTargets?.[target.uuid || target.name]) return this.chainModify(0.5);
  },
  onAfterMoveSecondarySelf(source, target, move) {
    if (!source || source.fainted) return;
    this.damage(Math.max(1, Math.floor((source.baseMaxhp || source.maxhp) / 8)), source, source, move);
    if (target && !target.fainted && target.hp > 0) this.boost({ def: -1 }, source, source, move);
  },
  target: "normal",
  type: "Steel",
  zMove: { basePower: 200 },
  contestType: "Tough",
  desc: "Bankai-only. A devastating armored avatar strike that partially bypasses protection. The user loses 1/8 max HP after use, and if the target survives, the user's Defense drops by 1 stage."
}
