#congrats
tag @a remove game_won
execute as @e[type=zombie,tag=crystal_prison] unless score @s health matches ..0 run scoreboard players operation .crystal_hp progression = @s health
execute as @e[type=zombie,tag=crystal_prison] if score @s health matches ..0 run scoreboard players set .crystal_hp progression 1000000

scoreboard players add .full_clears progression 1
scoreboard players add .runs_started progression 1
function main:game/condition/score

function main:game/condition/stop with storage player_data 1
clear

scoreboard players set .respawn death 60

schedule function main:hub/death/tick 2t

execute if score .difficulty_level progression matches 0 run return run scoreboard players set .difficulty_level_max progression 1
execute if score .difficulty_level progression matches 1 run return run scoreboard players set .difficulty_level_max progression 2
execute if score .difficulty_level progression matches 2 run return run scoreboard players set .difficulty_level_max progression 3
execute if score .difficulty_level progression matches 3 run return run scoreboard players set .difficulty_level_max progression 4
execute if score .difficulty_level progression matches 4 run return run scoreboard players set .difficulty_level_max progression 5

# playsound minecraft:ui.toast.challenge_complete master @a ~ ~ ~ 10 1.75
# execute at @a positioned ^ ^ ^1 run summon firework_rocket ~ ~ ~ {Life:0,LifeTime:0,FireworksItem:{id:"firework_rocket",count:1,components:{fireworks:{explosions:[{shape:"burst",has_twinkle:1b,has_trail:0b,colors:[I;65527,24319],fade_colors:[I;10551551]}]}}}}