import{ContainerSlot,EffectType,EffectTypes,Entity,EntityProjectileComponent,Player}from"@minecraft/server";import*as mc from"@minecraft/server";import*as GMath from"../utils/GMath";import{log}from"../utils/Logger";var worldAoeClouds={},cloudConfig={duration:0,particle:"",particleWait:1,effectWait:2,effectDuration:1,effectDistance:1};function randomUUID(t){let e="",o="abcdefghijklmnopqrsuvwxyz";for(let n=0;n<t;n++)e+=o[Math.floor((o.length-1)*Math.random())];return e}function spawnAOECloud(t,e,o,n){const i=randomUUID(5);let a=0;worldAoeClouds[i]=mc.system.runInterval((()=>{if(a++,(1==a||a>1&&a%n.particleWait==0)&&t.spawnParticle(n.particle,e),a%n.effectWait==0){t.getEntities({maxDistance:n.effectDistance,location:e}).forEach((t=>{t.addEffect(o,n.effectDuration,{showParticles:!1})}))}}),1),mc.system.runTimeout((()=>{mc.system.clearRun(worldAoeClouds[i]),delete worldAoeClouds[i]}),n.duration)}export default{"snst_bckp:dragon_fireball":{onHit(t,e){t.hasTag("snst_bckp:removing")||(t.addTag("snst_bckp:removing"),mc.system.runTimeout((()=>{t.dimension.getEntities({location:t.location,maxDistance:4});t.dimension.playSound("random.explode",t.location),t.dimension.spawnParticle("snst_bckp:dragon_burst",t.location),spawnAOECloud(t.dimension,t.location,"instant_damage",{duration:200,particle:"snst_bckp:dragon_aoe_cloud",particleWait:40,effectWait:20,effectDuration:15,effectDistance:4}),t.remove()}),2))}},"snst_bckp:wither_skull_dangerous":{onHit(t,e){t.hasTag("snst_bckp:removing")||(t.addTag("snst_bckp:removing"),mc.system.runTimeout((()=>{t.dimension.getEntities({location:t.location,maxDistance:4});t.dimension.playSound("random.explode",t.location),t.dimension.spawnParticle("snst_bckp:wither_burst",t.location),spawnAOECloud(t.dimension,t.location,"wither",{duration:200,particle:"snst_bckp:wither_aoe_cloud",particleWait:40,effectWait:20,effectDuration:100,effectDistance:4}),t.remove()}),2))}}};