##ID2 - Behavior and AI

execute as @s at @s positioned ~-5 ~-5 ~-5 if entity @a[dx=9,dy=9,dz=9] run function main:game/mobs/ai/movement/move {"tag":"id20_mob","height":0,"speed":-0.15,"score":""}

##ROCK THROW
#particles for attack
execute as @s[scores={enemy_ability_cooldown_1=21..}] at @s positioned ~ ~2.5 ~ run function main:particles/green_indicator
execute as @s[scores={enemy_ability_cooldown_1=11..20}] at @s positioned ~ ~2.5 ~ run function main:particles/yellow_indicator
execute as @s[scores={enemy_ability_cooldown_1=1..10}] at @s positioned ~ ~2.5 ~ run function main:particles/red_indicator

#shot
execute as @s[scores={enemy_ability_cooldown_1=..0,stun=..0}] at @s run function main:game/mobs/ai/id/id20/shoot

#if stun
execute if entity @s[scores={stun=1..}] store result score @s enemy_ability_cooldown_1 run random value 80..120

#vfx
execute as @s[scores={enemy_ability_cooldown_1=..20}] at @s run function main:game/mobs/ai/id/id20/prep