# This function should run if the spawning preset is set to 0, returns a spawn id for function astro_game:obstacles/actions/spawn
## Tutorial mode
execute unless entity @e[tag=tutorial] if score countdown astro_game.obstacles matches 0 positioned as @e[tag=commander_chair] run summon minecraft:text_display ~ ~0 ~-10 {interpolation_duration:3,billboard:"fixed",brightness:{sky:15,block:15},line_width:300,alignment:"center",Tags:["tutorial"],transformation:{left_rotation:[0.0f,0.0f,0.0f,1.0f],right_rotation:[0.0f,0.0f,0.0f,1.0f],translation:[0.0f,0.0f,0.0f],scale:[0.0f,0.0f,0.0f]},text:[{text:"\n\n",font:"default",type:"text"},{text:"Introduction\n\n",font:"default",color:"#00C0FF",type:"text"},{text:"This is the tutorial.\n",color:"#66F5FF",type:"text"},{text:"      Let's navigate through the basics.      ",color:"#66F5FF",type:"text"},{text:"\n\n",font:"default",color:"#00C0FF",type:"text"},{text:"\uF869",font:"al",color:"#FFFFFF",type:"text"},{text:" NEXT",font:"default",color:"#FFFFFF",type:"text"},{text:"\n\n",font:"default",color:"#00C0FF",type:"text"}],background:-16777216}

execute if score waiting_for_completion astro_game.tutorial matches 1 run return 0
execute if score boost_offset_buffer astro_game.powerups matches 1.. run return 0

execute if score stage astro_game.tutorial matches 0 as @e[tag=tutorial] run function astro_game:obstacles/actions/spawning_presets/tutorial/stage_0
execute if score stage astro_game.tutorial matches 1 as @e[tag=tutorial] run function astro_game:obstacles/actions/spawning_presets/tutorial/stage_1
execute if score stage astro_game.tutorial matches 2 as @e[tag=tutorial] run function astro_game:obstacles/actions/spawning_presets/tutorial/stage_2
execute if score stage astro_game.tutorial matches 3 as @e[tag=tutorial] run function astro_game:obstacles/actions/spawning_presets/tutorial/stage_3
execute if score stage astro_game.tutorial matches 4 as @e[tag=tutorial] run return run function astro_game:obstacles/actions/spawning_presets/tutorial/stage_4
execute if score stage astro_game.tutorial matches 5 as @e[tag=tutorial] run function astro_game:obstacles/actions/spawning_presets/tutorial/stage_5
execute if score stage astro_game.tutorial matches 6 as @e[tag=tutorial] run return run function astro_game:obstacles/actions/spawning_presets/tutorial/stage_6
execute if score stage astro_game.tutorial matches 7 as @e[tag=tutorial] run function astro_game:obstacles/actions/spawning_presets/tutorial/stage_7
execute if score stage astro_game.tutorial matches 8 as @e[tag=tutorial] run return run function astro_game:obstacles/actions/spawning_presets/tutorial/stage_8
execute if score stage astro_game.tutorial matches 9 as @e[tag=tutorial] run function astro_game:obstacles/actions/spawning_presets/tutorial/stage_9
execute if score stage astro_game.tutorial matches 10 as @e[tag=tutorial] run return run function astro_game:obstacles/actions/spawning_presets/tutorial/stage_10
execute if score stage astro_game.tutorial matches 11 as @e[tag=tutorial] run function astro_game:obstacles/actions/spawning_presets/tutorial/stage_11
execute if score stage astro_game.tutorial matches 12 as @e[tag=tutorial] run return run function astro_game:obstacles/actions/spawning_presets/tutorial/stage_12
execute if score stage astro_game.tutorial matches 13 as @e[tag=tutorial] run function astro_game:obstacles/actions/spawning_presets/tutorial/stage_13
execute if score stage astro_game.tutorial matches 14 as @e[tag=tutorial] run return run function astro_game:obstacles/actions/spawning_presets/tutorial/stage_14
execute if score stage astro_game.tutorial matches 15 as @e[tag=tutorial] run function astro_game:obstacles/actions/spawning_presets/tutorial/stage_15
execute if score stage astro_game.tutorial matches 16 as @e[tag=tutorial] run return run function astro_game:obstacles/actions/spawning_presets/tutorial/stage_16
execute if score stage astro_game.tutorial matches 17 as @e[tag=tutorial] run function astro_game:obstacles/actions/spawning_presets/tutorial/stage_17
execute if score stage astro_game.tutorial matches 18 as @e[tag=tutorial] run return run function astro_game:obstacles/actions/spawning_presets/tutorial/stage_18
execute if score stage astro_game.tutorial matches 19 as @e[tag=tutorial] run function astro_game:obstacles/actions/spawning_presets/tutorial/stage_19
execute if score stage astro_game.tutorial matches 20 as @e[tag=tutorial] run return run function astro_game:obstacles/actions/spawning_presets/tutorial/stage_20
execute if score stage astro_game.tutorial matches 21 as @e[tag=tutorial] run function astro_game:obstacles/actions/spawning_presets/tutorial/stage_21

return 0