import { createEntityShockWave, createLocationShockWave } from "modules/class/attacks";
import { filterEntities } from "modules/helper/utils";
import { applyEffect } from "modules/class/effects/effectsManager";
import { freezeSlowness, lightningStun, poisonEffect } from "./effects";
export const createFreezeShockWave = (source) => {
    createLocationShockWave(source.dimension, source.location, {
        damage: 1,
        knockback: 0,
        speed: 0.5,
        radius: 3,
        expansionParticlesOffset: 0.3,
        expansionParticlesStepSize: 1.5,
        //centerParticles: ["cc:ice_smoke"],
        expansionParticles: ["cc:freeze_smoke", "cc:freeze_effect"],
        verticalTolerance: 3,
        entityHitFunction: (entity, firstHit) => {
            if (firstHit &&
                filterEntities(entity, {
                    include: "mob",
                    exclude: ["minecraft:item", "tame"],
                })) {
                applyEffect(entity, freezeSlowness);
            }
            return true;
        },
    });
};
export const createFireShockWave = (source) => {
    createLocationShockWave(source.dimension, source.location, {
        damage: 2,
        knockback: 10,
        speed: 0.5,
        radius: 10,
        expansionParticlesOffset: 0.3,
        expansionParticlesStepSize: 1.5,
        //centerParticles: ["cc:ice_smoke"],
        expansionParticles: ["cc:fire_smoke"],
        verticalTolerance: 3,
        entityHitFunction: (entity, firstHit) => {
            if (firstHit) {
                entity.setOnFire(3);
            }
            return true;
        },
    });
};
export const createLightningShockWave = (source, location) => {
    createEntityShockWave(source, {
        damage: 1,
        knockback: 0,
        speed: 0.5,
        radius: 5,
        expansionParticlesOffset: 0.3,
        expansionParticlesStepSize: 1.5,
        //centerParticles: ["cc:ice_smoke"],
        expansionParticles: ["cc:lightning_effect", "cc:lightning_smoke"],
        verticalTolerance: 3,
        entityHitFunction: (entity, firstHit) => {
            if (firstHit &&
                filterEntities(entity, {
                    include: "all",
                    exclude: ["minecraft:item"],
                })) {
                applyEffect(entity, lightningStun);
            }
            return true;
        },
    });
};
export const createPoisonShockWave = (source) => {
    createLocationShockWave(source.dimension, source.location, {
        damage: 1,
        knockback: 0,
        speed: 0.5,
        radius: 5,
        expansionParticlesOffset: 0.1,
        expansionParticlesStepSize: 1.5,
        //centerParticles: ["cc:ice_smoke"],
        expansionParticles: ["cc:poison_effect", "cc:poison_smoke"],
        verticalTolerance: 3,
        entityHitFunction: (entity, firstHit) => {
            if (firstHit &&
                filterEntities(entity, {
                    include: "all",
                    exclude: ["minecraft:item"],
                })) {
                applyEffect(entity, poisonEffect);
            }
            return true;
        },
    });
};
export const createIceShieldShockWave = (source) => {
    createEntityShockWave(source, {
        damage: 1,
        knockback: 3,
        speed: 0.5,
        radius: 2,
        expansionParticlesMinRange: 0.1,
        expansionParticlesOffset: 0.3,
        expansionParticlesStepSize: 1.5,
        centerParticles: ["cc:circle"],
        expansionParticles: ["cc:freeze_effect"],
        verticalTolerance: 3,
        entityHitFunction: (entity, firstHit) => {
            if (firstHit) {
                applyEffect(entity, freezeSlowness);
            }
            return true;
        },
    });
};
export const createRitualLightningShockWave = (source, location) => {
    createLocationShockWave(source.dimension, location ?? source.location, {
        damage: 0,
        knockback: 0,
        speed: 0.8,
        radius: 10,
        expansionParticlesOffset: 0.3,
        expansionParticlesStepSize: 1.5,
        //centerParticles: ["cc:ice_smoke"],
        expansionParticles: ["cc:freeze_ritual"],
        verticalTolerance: 3,
        entityHitFunction: (entity, firstHit) => {
            return false;
        },
    });
};

export const createJungleGolemSmash2 = (source) => {
    createEntityShockWave(source, {
        damage: 1,
        knockback: 14,
        speed: 0.45,
        radius: 5.5,
        expansionParticlesMinRange: 0.1,
        expansionParticlesOffset: 0.3,
        expansionParticlesStepSize: 1.5,
        centerParticles: ["cc:shock_effect"],
        expansionParticles: ["cc:dust_smoke"],
        verticalTolerance: 3,
        entityHitFunction: (entity, firstHit) => {
            return true;
        },
    });
};
export const createJungleGolemSmash = (source) => {
    createEntityShockWave(source, {
        damage: 1,
        knockback: 14,
        speed: 0.45,
        radius: 5.5,
        expansionParticlesMinRange: 0.1,
        expansionParticlesOffset: 0.3,
        expansionParticlesStepSize: 1.5,
        centerParticles: ["cc:shock_effect"],
        expansionParticles: ["cc:dust_smoke"],
        verticalTolerance: 3,
        entityHitFunction: (entity, firstHit) => {
            return true;
        },
    });
};
export const createScytheShockWave = (source) => {
    createEntityShockWave(source, {
        damage: 3,
        knockback: 10,
        speed: 0.5,
        radius: 3,
        expansionParticlesMinRange: 0.1,
        expansionParticlesOffset: 0.3,
        expansionParticlesStepSize: 1.5,
        centerParticles: ["cc:scythe_sway"],
        // expansionParticles: ["cc:scythe_sway"],
        verticalTolerance: 3,
        entityHitFunction: (entity, firstHit) => {
            return true;
        },
    });
};
