## ran from "controller.animation.chill_blast_projectile.impact"
## on impact the projectile summons a storm_cloud entity over the target's head and gives them a blue texture overlay, a shaking animation, and slowness effect all for 5 seconds

##clears any current storm clouds to prevent entity stacking
execute as @e[r=3,type=ldz:storm_cloud] run event entity @s despawn
playsound mob.ender_chiller.projectile_impact @a[r=8]
execute positioned ~ ~-3 ~ as @e[tag=!Chilled,type=!ldz:end_force,type=!ldz:ender_lord_dummy,type=!ldz:chill_blast_projectile,type=!ldz:ender_lord_wisp,type=!ldz:chill_blast_player_projectile,type=!ldz:storm_cloud,type=!minecraft:item,r=3] run tag @s add Chilled  
execute positioned ~ ~-3 ~ at @e[tag=Chilled,family=!flight_mob,r=3] run effect @e[r=2.5] slowness 5 4 true
execute positioned ~ ~-3 ~ at @e[tag=Chilled,family=flight_mob,r=4] run effect @e[r=4] slowness 5 6 true

## sets entity property ldz:ice_overlay to true giving the entity the is_shaking component and the ice blue texture overlay
execute positioned ~ ~-3 ~ run event entity @e[tag=Chilled,r=3] set_ice_overlay_to_true
 
execute positioned ~ ~-3 ~ as @e[tag=Chilled,r=3] at @e[tag=Chilled,r=3] run summon ldz:storm_cloud ^^2^

execute positioned ~ ~-3 ~ as @p[tag=Chilled,r=3] run camerashake add @s 0.04 5 positional

