{
    num: 678,
    accuracy: true,
    basePower: 0,
    category: "Status",
    name: "Psychic Terrain",
    pp: 10,
    priority: 0,
    flags: { nonsky: 1, metronome: 1 },
    terrain: "psychicterrain",
    condition: {
        duration: 5,
        durationCallback(source, effect) {
            if (source?.hasItem("terrainextender")) {
                return 8;
            }
            return 5;
        },
        onTryHitPriority: 4,
        onTryHit(target, source, effect) {
            if (effect && (effect.priority <= 0.1 || effect.target === "self")) {
                return;
            }
            if (target.isSemiInvulnerable() || target.isAlly(source))
                return;
            if (!target.isGrounded() || target.hasItem("heavydutyboots")) {
                const baseMove = this.dex.moves.get(effect.id);
                if (baseMove.priority > 0) {
                    this.hint("Psychic Terrain doesn't affect Pok\xE9mon immune to Ground or Pokemon holding Heavy-Duty Boots.");
                }
                return;
            }
            this.add("-activate", target, "move: Psychic Terrain");
            return null;
        },
        onBasePowerPriority: 6,
        onBasePower(basePower, attacker, defender, move) {
            if (move.type === "Psychic" && attacker.isGrounded() && !attacker.isSemiInvulnerable() && !attacker.hasItem("heavydutyboots")) {
                this.debug("psychic terrain boost");
                return this.chainModify([5325, 4096]);
            }
        },
        onFieldStart(field, source, effect) {
            if (effect?.effectType === "Ability") {
                this.add("-fieldstart", "move: Psychic Terrain", "[from] ability: " + effect.name, "[of] " + source);
            } else {
                this.add("-fieldstart", "move: Psychic Terrain");
            }
        },
        onFieldResidualOrder: 27,
        onFieldResidualSubOrder: 7,
        onFieldEnd() {
            this.add("-fieldend", "move: Psychic Terrain");
        }
    },
    secondary: null,
    target: "all",
    type: "Psychic",
    zMove: { boost: { spa: 1 } },
    contestType: "Clever"
}
