#Shield distance
function olink:ch1/find_linked
tp @e[tag=st_stone,tag=1,tag=ch1_olinked,limit=1] ^1.5 ^0.3 ^
tp @e[tag=st_stone,tag=2,tag=ch1_olinked,limit=1] ^ ^0.3 ^1.5
tp @e[tag=st_stone,tag=3,tag=ch1_olinked,limit=1] ^-1.5 ^0.3 ^
tp @e[tag=st_stone,tag=4,tag=ch1_olinked,limit=1] ^ ^0.3 ^-1.5

tp @e[tag=st_point,tag=1,tag=ch1_olinked,limit=1] ^1.2 ^0.1 ^-0.3
tp @e[tag=st_point,tag=2,tag=ch1_olinked,limit=1] ^0.3 ^0.1 ^1.2
tp @e[tag=st_point,tag=3,tag=ch1_olinked,limit=1] ^-1.2 ^0.1 ^0.3
tp @e[tag=st_point,tag=4,tag=ch1_olinked,limit=1] ^-0.3 ^0.1 ^-1.2

#Shields rotate
tp @s ~ ~ ~ ~8 0
execute if entity @s[tag=tp] at @e[tag=ch1_olinked,tag=st_caster,limit=1] run tp @s ~ ~ ~

#shield up
execute if score @s countdown matches 0.. run function attacks:spinning_stones/animation

# Colision
execute at @e[tag=ch1_olinked,tag=st_stone] as @e[distance=..0.6,tag=!unspellable,type=!player,tag=!ch1_olinked] run function attacks:spinning_stones/collision
execute at @e[tag=ch1_olinked,tag=st_stone] as @a[distance=..0.6] unless entity @e[tag=st_player,limit=1] run function attacks:spinning_stones/p_collision

execute unless entity @e[tag=ch1_olinked,tag=st_caster,limit=1] run kill @e[tag=ch1_olinked,tag=st]
