tick20.mcfunction 1.4 KB

12345678910111213141516171819202122232425
  1. # 召唤幻翼
  2. execute if score $countdown mem matches 11.. run function mini:phantom/game/try_summon
  3. # 显示倒计时
  4. execute if score $countdown mem matches ..10 run title @a times 3 14 2
  5. execute if score $countdown mem matches ..10 run title @a subtitle {"score":{"name":"$countdown","objective":"mem"}}
  6. execute if score $countdown mem matches ..10 run title @a title [""]
  7. execute if score $countdown mem matches ..10 as @a at @s run function lib:sounds/hit2
  8. # -10s:提示游戏结束
  9. execute if score $countdown mem matches 10 run tellraw @a ["",{"text": ">> ","color":"aqua","bold": true},{"text": "太阳即将升起!","color":"aqua"}]
  10. # 0s:游戏结束
  11. execute if score $countdown mem matches 0 run function mini:main/game_end
  12. # 击杀音效
  13. execute as @a run scoreboard players operation @s temp = @s kill_phantom
  14. execute as @a run scoreboard players operation @s temp -= @s kill_phantom2
  15. execute as @a[scores={temp=1..}] at @s run function lib:sounds/hit
  16. # 击杀提示
  17. execute as @a run scoreboard players operation @s kill_phantom2 = @s kill_phantom
  18. execute as @a run scoreboard players operation @s kill_phantom2 %= #const_5 mem
  19. execute as @a[scores={temp=1..,kill_phantom2=0}] run tellraw @a ["",{"text": ">> ","color":"gold","bold": true},{"selector": "@s","color":"gold"}," 已击杀 ",{"score": { "name": "@s","objective": "kill_phantom"}}," 只幻翼!"]
  20. execute as @a run scoreboard players operation @s kill_phantom2 = @s kill_phantom