#enraged
execute if score .difficulty_level progression matches 1..2 if score @n[type=zombie,tag=id12_mob] health <= .50% boss run tag @s add enraged
execute if score .difficulty_level progression matches 3..4 if score @n[type=zombie,tag=id12_mob] health <= .75% boss run tag @s add enraged
execute if score .difficulty_level progression matches 1.. if entity @e[type=armor_stand,tag=id12_area] run function main:game/mobs/ai/id/id12/enraged_1
#hp
execute at @s as @n[type=zombie,tag=id12_mob] run function main:game/mobs/ai/id/boss/health_shield

#when player is above a certain height
execute at @a if entity @a[y=-56,dy=20] unless block ~ ~-1 ~ #main:air if score .cooldown_far boss matches ..0 as @s at @s if entity @n[type=zombie,tag=id12_mob,y=-76,dy=20] run function main:game/mobs/ai/id/id12/far

#if not stop
execute if score .stop boss matches ..0 run function main:game/mobs/ai/id/id12/tick_1

execute if score .stop boss matches 1 run function main:game/mobs/ai/id/id12/slowness_clear

#move, follow, idle
execute as @s at @e[type=zombie,tag=id12_mob] run tp @s ~ ~ ~
execute as @s at @s rotated as @n[type=zombie,tag=id12_mob] run tp @s ~ ~ ~ ~ 0

#conditions
#remove slow
execute if score .attack_is_playing boss matches 1 run effect clear @n[type=zombie,tag=id12_mob] slowness

#hideout
execute as @s[tag=hideout] at @s run function main:game/mobs/ai/id/id12/hideout/tick
execute unless score .start dialog matches 1.. if entity @s[tag=!hideout] run tag @e[type=zombie,tag=id12_mob] remove immune
execute at @n[type=zombie,tag=id12_mob,tag=!immune,tag=!hideout] positioned ~ ~ ~ if entity @a[distance=6..] run scoreboard players add .far boss 2

execute at @n[type=zombie,tag=id12_mob] positioned ~ ~ ~ if entity @a[distance=..8] as @s[tag=hideout] run function main:game/mobs/ai/id/id12/hideout/end

#jump attack
execute as @s[tag=jump_attack] at @n[type=zombie,tag=id12_mob] if block ~ ~-2 ~ #main:air run scoreboard players set .stop boss 10

execute as @s[tag=jump_attack,tag=!jump_attack_land] at @n[type=zombie,tag=id12_mob] unless block ~ ~-2 ~ #main:air run function main:game/mobs/ai/id/id12/jump_attack/land

#scores
function main:game/mobs/ai/id/id12/tick_scores