# Gate close (spawn and armory are generated with a room state of 6)
execute positioned ~-22.5 ~ ~-22.5 as @e[dx=44,dy=31,dz=44,tag=gate] at @s run function game:room/2_room_start/close_gate
execute positioned ~-22.5 ~ ~-22.5 as @a[dx=44,dy=31,dz=44] at @s run playsound custom.gate.close ambient @s ~ ~ ~

# One time room passives
execute as @a run function items:passive/room_trigger/start

# Mana display
tag @a add display_M+K

# Room wave
scoreboard players set @s room_wave 1
scoreboard players set @s room_clock 40

# room hits
scoreboard players set room_hits game 0

# Map
tag @s[tag=!mapped] add mapped

# Next state
scoreboard players set @s room_state 3
