tag @a add wave
data remove storage dialog text
schedule clear main:dialog/text/text_schedule
scoreboard players set .start dialog 0
scoreboard players set .duration dialog 0
tellraw @a ["\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"]
#reset variables
scoreboard players set @a combo_timer 0
scoreboard players operation @a combo /= .2 number
scoreboard players set .kills arena 0
scoreboard players set .enemies arena 0
scoreboard players set .reroll_load transformator 1

#health increase per room
scoreboard players operation .health_multiplier arena += .health_room_multiplier arena

execute as @e[type=item_display,tag=room_particle] run kill @s
execute as @e[type=#main:room,tag=room_marker] run kill @s
clear @a written_book[custom_data={book:crafting}]
# execute as @e[type=item,tag=gold] run kill @s
# execute as @e[type=item,tag=artifact] run kill @s
# execute as @e[tag=npc] run kill @s
kill @e[type=!player,tag=!smithed.entity,tag=!set_reward]

tag @s remove choice_boss
tag @s remove choice_1_this
tag @s remove choice_2_this
tag @s remove choice_3_this
tag @s remove choice_4_this
tag @s remove choice_5_this
tag @s remove choice_6_this
tag @s remove choice_7_this
tag @s remove choice_8_this
tag @s remove choice_9_this
tag @s remove choice_10_this
$tag @s add $(tag)
scoreboard players set .enemies_ranged arena 0
scoreboard players set .enemies_melee arena 0
scoreboard players set .enemies_big arena 0

#stages
execute if score .stage arena matches 1 run function main:game/room/random {"stage":1}

execute if score .stage arena matches 3 run function main:game/room/random {"stage":2}

execute if score .stage arena matches 2 run function main:game/room/random {"stage":3}

execute if score .stage arena matches 4 run function main:game/room/random {"stage":4}

execute if score .room_number room matches -9.. run scoreboard players add .room_count room 1
execute if score .room_number room matches 1.. run function main:mechanics/artifacts/inputs/enter_combat

function main:game/wave/tick/progress_bar/room