{
    name: 'Distortion World',
    effectType: 'PseudoWeather',
    duration: 3,
    onStart(battle, source, effect) {
        battle.add('-start', 'Distortion World', '[from] ability: ' + effect.name, '[of] ' + source);
    },
    durationCallback(source, effect) {
        if (source?.hasAbility(['persistent'])) {
            this.add('-activate', source, `ability: ${source.ability}`, effect);
            return 5;
        }
        return 3;
    },
    onNegateImmunity: false,
    onEffectivenessPriority: 1,
    onEffectiveness(typeMod, target, type, move) {
        if (move && move.id === 'freezedry' && type === 'Water') return;
        if (move && !this.dex.getImmunity(move, type)) return 1;
        return -typeMod;
    },
    onFieldStart(target, source, effect) {
        if (effect?.effectType === 'Ability') {
            this.add('-start', 'move: Shadow Force', '[from] ability: ' + effect, '[of] ' + source);
        } else {
            this.add('-start', 'move: Shadow Force');
        }
        this.add('-message', 'The Distortion World leaked into the battlefield!');
    },
    onFieldRestart(target, source) {
        this.field.removePseudoWeather('distortionworld');
    },
    onFieldResidualOrder: 23,
    onFieldEnd() {
        this.add('-end', 'move: Shadow Force');
        this.add('-message', 'The Distortion World stopped influencing the battlefield.');
    },
}
