{
  name: "Ice Mace",
  num: -31001,
  accuracy: 100,
  basePower: 65,
  category: "Physical",
  pp: 10,
  priority: 0,
  type: "Ice",
  target: "normal",
  flags: { contact: 1, protect: 1, mirror: 1 },

  onBasePower(basePower, source, target, move) {
    if (!target?.item) return;
    const item = target.getItem();
    if (!item || item.id === "") return;
    if (target.volatiles?.substitute) return;

    if (this.dex.items.get(item.id)?.canBeKnockedOff) {
      return this.chainModify(1.5);
    }
  },

  onHit(target, source, move) {
    if (!target?.item) return;
    if (target.volatiles?.substitute) return;

    const item = target.getItem();
    if (!item || item.id === "") return;

    const dexItem = this.dex.items.get(item.id);
    if (!dexItem?.canBeKnockedOff) return;

    const removed = target.takeItem(source);
    if (!removed) return;

    this.add("-enditem", target, removed.name, "[from] move: Ice Mace");

    const hasBBIce = source?.hasAbility?.("battlebondice");
    if (!hasBBIce) return;

    const curName = source?.species?.name || source?.species?.id || "";
    const curId = this.dex.toID(curName);
    const baseName = source?.baseSpecies?.name || source?.baseSpecies?.id || source?.baseSpecies?.baseSpecies || "";
    const baseId = this.dex.toID(baseName);

    const isBBIceForm =
      curId.includes("battlebondice") ||
      (curId.includes("battlebond") && curId.includes("ice"));

    const isTransformedFromOmega =
      baseId === "greninjaomega" && curId && curId !== baseId;

    const baseFormName = source?._bbIceBaseForm ? this.dex.toID(source._bbIceBaseForm) : "";

    const abilityMarkedTransformed =
      !!baseFormName && curId && curId !== baseFormName;

    if (isBBIceForm || isTransformedFromOmega || abilityMarkedTransformed) {
      this.boost({ atk: 1 }, source, source, this.effect);
    }
  }
}
