# Next state - enemy
execute if entity @s[tag=enemy] positioned ~-22 12 ~-22 unless entity @e[dx=44,dy=32,dz=44,limit=1,tag=EB,tag=!void_mark,tag=!nonlocking] run function game:room/4_wave_ongoing/next_state_enemy

# Next state - boss
execute if entity @s[tag=boss] positioned ~-22 12 ~-22 unless entity @e[dx=44,dy=32,dz=44,limit=1,tag=EB,tag=!nonlocking] run scoreboard players set @s room_state 5

execute if entity @s[tag=!boss] run scoreboard players add @s room_clock 1
execute if score @s room_clock matches 300.. positioned ~-22 12 ~-22 run function game:room/4_wave_ongoing/glow_enemies
