#This function should run as an entity with the tag "turret_input_box"

#Reset interaction value to allow more right clicks
data remove entity @s interaction

#Handle cooldown
execute if score message_skip_cooldown astro_game.tutorial matches 1.. run return 0
scoreboard players set message_skip_cooldown astro_game.tutorial 10

#Exit if it's not time to process
execute if score waiting_for_completion astro_game.tutorial matches 0 run return 0

#Hide message
execute as @e[tag=tutorial] run function astro_game:obstacles/actions/spawning_presets/tutorial/hide_message

#process
execute if score stage astro_game.tutorial matches 0 as @e[tag=tutorial] run return run function astro_game:obstacles/actions/spawning_presets/tutorial/next_stage
execute if score stage astro_game.tutorial matches 1 as @e[tag=tutorial] run return run function astro_game:obstacles/actions/spawning_presets/tutorial/next_stage
execute if score stage astro_game.tutorial matches 2 as @e[tag=tutorial] run return run function astro_game:obstacles/actions/spawning_presets/tutorial/next_stage
execute if score stage astro_game.tutorial matches 3 as @e[tag=tutorial] run return run function astro_game:obstacles/actions/spawning_presets/tutorial/next_stage
execute if score stage astro_game.tutorial matches 5 as @e[tag=tutorial] run return run function astro_game:obstacles/actions/spawning_presets/tutorial/next_stage
execute if score stage astro_game.tutorial matches 7 as @e[tag=tutorial] run return run function astro_game:obstacles/actions/spawning_presets/tutorial/next_stage
execute if score stage astro_game.tutorial matches 9 as @e[tag=tutorial] run return run function astro_game:obstacles/actions/spawning_presets/tutorial/next_stage
execute if score stage astro_game.tutorial matches 11 as @e[tag=tutorial] run return run function astro_game:obstacles/actions/spawning_presets/tutorial/next_stage
execute if score stage astro_game.tutorial matches 13 as @e[tag=tutorial] run return run function astro_game:obstacles/actions/spawning_presets/tutorial/next_stage
execute if score stage astro_game.tutorial matches 15 as @e[tag=tutorial] run return run function astro_game:obstacles/actions/spawning_presets/tutorial/next_stage
execute if score stage astro_game.tutorial matches 17 as @e[tag=tutorial] run return run function astro_game:obstacles/actions/spawning_presets/tutorial/next_stage
execute if score stage astro_game.tutorial matches 19 as @e[tag=tutorial] run return run function astro_game:obstacles/actions/spawning_presets/tutorial/next_stage
execute if score stage astro_game.tutorial matches 21 as @e[tag=tutorial] run return run function astro_game:game/end

