scoreboard players add @s svm_ep.lifetime 1
tag @s add executor
execute as @a[distance=..15,scores={svm_ep.fighting_style=2}] if score @s svm_ep.entity_id = @n[tag=executor] svm_ep.entity_id run tag @s add same_id


execute as @s[scores={svm_ep.lifetime=..1100}] as @n[distance=..15,tag=same_id] if predicate svm_ep:shift as @n[tag=executor] run function svm_ep:fighting_style/chain/projectile/turn


execute at @s if entity @a[distance=..15,tag=same_id] positioned ^ ^ ^0.25 if block ~ ~ ~ #svm_ep:no_physical_hitbox run tp @s ~ ~ ~ ~ ~1
execute at @s[scores={svm_ep.chain_charge=10..}] if entity @a[distance=..15,tag=same_id] positioned ^ ^ ^0.25 if block ~ ~ ~ #svm_ep:no_physical_hitbox run tp @s ~ ~ ~ ~ ~1
execute at @s[scores={svm_ep.chain_charge=20..}] if entity @a[distance=..15,tag=same_id] positioned ^ ^ ^0.25 if block ~ ~ ~ #svm_ep:no_physical_hitbox run tp @s ~ ~ ~ ~ ~1
execute at @s[scores={svm_ep.chain_charge=30..}] if entity @a[distance=..15,tag=same_id] positioned ^ ^ ^0.25 if block ~ ~ ~ #svm_ep:no_physical_hitbox run tp @s ~ ~ ~ ~ ~1
execute at @s[scores={svm_ep.chain_charge=40..}] if entity @a[distance=..15,tag=same_id] positioned ^ ^ ^0.25 if block ~ ~ ~ #svm_ep:no_physical_hitbox run tp @s ~ ~ ~ ~ ~1
execute at @s positioned ^ ^ ^0.35 unless block ~ ~ ~ #svm_ep:no_physical_hitbox run scoreboard players set @s svm_ep.lifetime 1200
execute at @s positioned ~ ~-0.1 ~ if block ~ ~ ~ #svm_ep:no_physical_hitbox run tp @s ~ ~.05 ~ ~ ~1
execute at @s positioned ~ ~-0.1 ~ if block ~ ~ ~ #svm_ep:no_physical_hitbox run tp @s ~ ~.05 ~ ~ ~1
execute at @s positioned ~ ~-0.1 ~ if block ~ ~ ~ #svm_ep:no_physical_hitbox run tp @s ~ ~.05 ~ ~ ~1


execute at @s positioned ^ ^ ^0.85 run particle heart


tag @a[distance=..25,scores={svm_ep.fighting_style=2}] remove same_id
tag @s remove executor

kill @s[scores={svm_ep.lifetime=1000..1100}]