schedule function lbdm:quest3/test_your_might 1t

# Запуск idle (костыль) 🩼
execute unless entity @a[x=248.625,y=-59,z=-77,distance=..6.25] run gamemode spectator @a
execute unless entity @a[x=248.625,y=-59,z=-77,distance=..6.25] as @e[tag=tym_scale,type=text_display] run data merge entity @s {transformation:{scale:[4.5f,0.35f,1.0f]},start_interpolation:0}
execute unless entity @a[x=248.625,y=-59,z=-77,distance=..6.25] run data merge entity @e[limit=1,type=text_display,tag=press_space] {transformation:{scale:[0.25f,0.25f,1.0f]},start_interpolation:0}
execute unless entity @a[x=248.625,y=-59,z=-77,distance=..6.25] run data merge entity @e[tag=test_your_might,type=text_display,limit=1] {transformation:{scale:[0f,0.35f,1.0f]},start_interpolation:0}
execute unless entity @a[x=248.625,y=-59,z=-77,distance=..6.25] run function lbdm:quest3/gooners/reset
execute unless entity @a[x=248.625,y=-59,z=-77,distance=..6.25] run worldborder warning distance 3
execute unless entity @a[x=248.625,y=-59,z=-77,distance=..6.25] run function lbdm:main/quest_ui/init {title:"Последние минуты","task":"Вырвись из плена"}
execute unless entity @a[x=248.625,y=-59,z=-77,distance=..6.25] as @e[tag=aj.quest3_tym.root] run function animated_java:quest3_tym/animations/pov_idle/play
execute unless entity @a[x=248.625,y=-59,z=-77,distance=..6.25] as @e[tag=aj.quest3_tym.root] run function animated_java:quest3_tym/animations/npc_idle/play
execute unless entity @a[x=248.625,y=-59,z=-77,distance=..6.25] as @n[tag=quest3_start_door] run function animated_java:quest2_door/animations/open/stop
# Закрепляет камеру pov
execute as @a run spectate @n[tag=aj.quest3_tym.camera]

# Отнятие общего might
execute if score #might_count temp matches 1.. run scoreboard players remove #might_count temp 2
execute if score #might_count temp matches ..-1 run scoreboard players remove #might_count temp 0

# Визуальное отображение
execute if score #might_count temp matches 1..2 run data merge entity @e[tag=test_your_might,type=text_display,limit=1] {transformation:{scale:[0.0f,0.35f,1.0f]},start_interpolation:0}
execute if score #might_count temp matches 10 run data merge entity @e[tag=test_your_might,type=text_display,limit=1] {transformation:{scale:[0.5f,0.35f,1.0f]},start_interpolation:0}
execute if score #might_count temp matches 20 run data merge entity @e[tag=test_your_might,type=text_display,limit=1] {transformation:{scale:[1f,0.35f,1.0f]},start_interpolation:0}
execute if score #might_count temp matches 30 run data merge entity @e[tag=test_your_might,type=text_display,limit=1] {transformation:{scale:[1.5f,0.35f,1.0f]},start_interpolation:0}
execute if score #might_count temp matches 40 run data merge entity @e[tag=test_your_might,type=text_display,limit=1] {transformation:{scale:[2f,0.35f,1.0f]},start_interpolation:0}
execute if score #might_count temp matches 50 run data merge entity @e[tag=test_your_might,type=text_display,limit=1] {transformation:{scale:[2.5f,0.35f,1.0f]},start_interpolation:0}
execute if score #might_count temp matches 60 run data merge entity @e[tag=test_your_might,type=text_display,limit=1] {transformation:{scale:[3f,0.35f,1.0f]},start_interpolation:0}
execute if score #might_count temp matches 70 run data merge entity @e[tag=test_your_might,type=text_display,limit=1] {transformation:{scale:[3.5f,0.35f,1.0f]},start_interpolation:0}
execute if score #might_count temp matches 80 run data merge entity @e[tag=test_your_might,type=text_display,limit=1] {transformation:{scale:[4f,0.35f,1.0f]},start_interpolation:0}
execute if score #might_count temp matches 90 run data merge entity @e[tag=test_your_might,type=text_display,limit=1] {transformation:{scale:[4.5f,0.35f,1.0f]},start_interpolation:0}
execute if score #might_count temp matches 100.. run data merge entity @e[tag=test_your_might,type=text_display,limit=1] {transformation:{scale:[5f,0.35f,1.0f]},start_interpolation:0}

# Если might_count будет равен 100, то сработает побег
execute if score #might_count temp matches 100.. run schedule clear lbdm:quest3/test_your_might
execute if score #might_count temp matches 100.. as @e[tag=aj.quest3_tym.root] run function animated_java:quest3_tym/animations/pov_idle/stop
execute if score #might_count temp matches 100.. as @e[tag=aj.quest3_tym.root] run function animated_java:quest3_tym/animations/npc_idle/stop
execute if score #might_count temp matches 100.. as @e[tag=aj.quest3_tym.root] run function animated_java:quest3_tym/animations/npc_look/play
execute if score #might_count temp matches 100.. as @e[tag=aj.quest3_tym.root] run function animated_java:quest3_tym/animations/pov_breakout_finish/play
execute if score #might_count temp matches 100.. as @a run spectate @n[tag=aj.quest3_tym.camera]
execute if score #might_count temp matches 100.. run function lbdm:main/quest_ui/disappear
execute if score #might_count temp matches 100.. run playsound minecraft:block.wool.break master @a 248.75 -57.5 -76.5 1 1
execute if score #might_count temp matches 100.. run particle block{block_state:"minecraft:brown_wool"} 249.25 -58.75 -76.5 0.05 0.05 0.05 1 10
execute if score #might_count temp matches 100.. run schedule function lbdm:quest3/start 60t
execute if score #might_count temp matches 100.. run schedule function lbdm:quest3/gooners/start 5s
execute if score #might_count temp matches 100.. as @e[tag=tym_scale,type=text_display] run data merge entity @s {transformation:{scale:[0f,0.35f,1.0f]},start_interpolation:0}
execute if score #might_count temp matches 100.. run data merge entity @e[limit=1,type=text_display,tag=press_space] {transformation:{scale:[0.0f,0.0f,0.0f]},start_interpolation:0}
execute if score #might_count temp matches 100.. run data merge entity @e[tag=test_your_might,type=text_display,limit=1] {transformation:{scale:[0f,0.35f,1.0f]},start_interpolation:0}
execute if score #might_count temp matches 100.. run schedule function lbdm:quest3/open_start_door 1.5s
execute if score #might_count temp matches 100.. run scoreboard players set #might_count temp 0

# Проверка на нажатие пробела
execute if entity @a[predicate=lbdm:input/space] run scoreboard players add space_timer temp 1
execute if score space_timer temp matches 1.. as @a unless predicate lbdm:input/space run scoreboard players set space_timer temp 0

execute if entity @a[tag=might_cooldown] run return 0
execute if score space_timer temp matches 1 run scoreboard players add #might_count temp 30
execute if score space_timer temp matches 1 as @e[tag=aj.quest3_tym.root] run function animated_java:quest3_tym/animations/pov_breakout_try/play
execute if score space_timer temp matches 1 run tag @a add might_cooldown
execute if score space_timer temp matches 1 run playsound minecraft:block.wool.break master @a 248.75 -57.5 -76.5 1 0.1
execute if score space_timer temp matches 1 run schedule function lbdm:quest3/space_cooldown 10t