scoreboard players remove @s manalabs_scp_ray_age 1

tag @s add manalabs_scp_block_stop
execute if block ^ ^ ^0.25 air [] run tag @s remove manalabs_scp_block_stop
execute if block ^ ^ ^0.25 water [] run tag @s remove manalabs_scp_block_stop
execute if block ^ ^ ^0.25 light_block [] run tag @s remove manalabs_scp_block_stop
scoreboard players set @s[tag=manalabs_scp_block_stop] manalabs_scp_ray_age 0

# particle minecraft:villager_happy

execute if score @s manalabs_scp_ray_age matches 184.. as @e[type=manalabs_scp:scp173,r=0.5] run effect @s slowness 1 10 true
execute if score @s manalabs_scp_ray_age matches 184.. as @e[type=manalabs_scp:scp173,r=0.5] run tag @s add manalabs_scp_stopped_movement
execute if score @s manalabs_scp_ray_age matches 184.. if entity @e[type=manalabs_scp:scp173,r=0.5] run scoreboard players set @s manalabs_scp_ray_age 0
# execute if score @s manalabs_scp_ray_age matches 184.. run particle minecraft:villager_happy

execute if score @s manalabs_scp_ray_age matches 150..183 as @e[type=manalabs_scp:scp173,r=4] run effect @s slowness 1 10 true
execute if score @s manalabs_scp_ray_age matches 150..183 as @e[type=manalabs_scp:scp173,r=4] run tag @s add manalabs_scp_stopped_movement
execute if score @s manalabs_scp_ray_age matches 150..183 if entity @e[type=manalabs_scp:scp173,r=4] run scoreboard players set @s manalabs_scp_ray_age 0
# execute if score @s manalabs_scp_ray_age matches 150..183 run particle minecraft:villager_angry

execute if score @s manalabs_scp_ray_age matches 120..149 as @e[type=manalabs_scp:scp173,r=15] run effect @s slowness 1 10 true
execute if score @s manalabs_scp_ray_age matches 120..149 as @e[type=manalabs_scp:scp173,r=15] run tag @s add manalabs_scp_stopped_movement
execute if score @s manalabs_scp_ray_age matches 120..149 if entity @e[type=manalabs_scp:scp173,r=15] run scoreboard players set @s manalabs_scp_ray_age 0
# execute if score @s manalabs_scp_ray_age matches 120..149 run particle minecraft:soul_particle

execute if score @s manalabs_scp_ray_age matches 1..119 as @e[type=manalabs_scp:scp173,r=20] run effect @s slowness 1 10 true
execute if score @s manalabs_scp_ray_age matches 1..119 as @e[type=manalabs_scp:scp173,r=20] run tag @s add manalabs_scp_stopped_movement
execute if score @s manalabs_scp_ray_age matches 1..119 if entity @e[type=manalabs_scp:scp173,r=20] run scoreboard players set @s manalabs_scp_ray_age 0
# execute if score @s manalabs_scp_ray_age matches ..119 run particle minecraft:note_particle

execute as @s[scores={manalabs_scp_ray_age=1..}] positioned ^ ^ ^0.25 run function manalabs/scp/scp173/ray_tick
