# Sound start
execute if score @s room_clock matches 40 positioned ~-22.5 ~ ~-22.5 as @a[dx=44,dy=31,dz=44] at @s run playsound custom.wave.spawn ambient @s ~ ~ ~ 0.3

execute if score @s room_clock matches 40 run function game:room/3_spawn_wave/animation/place_runes
execute if score @s room_clock matches 0.. run function game:room/3_spawn_wave/animation/main
execute if score @s room_clock matches 0 run function game:room/3_spawn_wave/spawn

# Spawn clock
execute if score @s room_clock matches 0 as @a run function items:passive/room_trigger/wave_start
execute if score @s room_clock matches 0 run scoreboard players set @s room_state 4
execute if score @s room_clock matches 0.. run scoreboard players remove @s room_clock 1
