tick20.mcfunction 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. xp set @a 0 points
  2. # 显示倒计时
  3. execute if score $countdown mem matches ..10 run title @a times 3 14 2
  4. execute if score $countdown mem matches ..10 run title @a subtitle {"score":{"name":"$countdown","objective":"mem"}}
  5. execute if score $countdown mem matches ..10 run title @a title [""]
  6. execute if score $countdown mem matches ..10 as @a at @s run function lib:sounds/hit2
  7. # 120s:时间提示
  8. execute if score $countdown mem matches 120 run title @a subtitle {"text":"⚠ 还剩两分钟! ⚠","color":"yellow"}
  9. execute if score $countdown mem matches 120 run title @a times 1 50 3
  10. execute if score $countdown mem matches 120 run title @a title ""
  11. # 90s:雷达提示
  12. execute if score $countdown mem matches 90 run title @a subtitle {"text":"⚠ 玩家雷达将在三十秒后开启! ⚠","color":"yellow"}
  13. execute if score $countdown mem matches 90 run title @a times 1 100 3
  14. execute if score $countdown mem matches 90 run title @a title ""
  15. execute if score $countdown mem matches 90 run scoreboard players set $bossbar_color mem 2
  16. execute if score $countdown mem matches 90 run function lib:bossbar/show
  17. # 60s:雷达开启
  18. execute if score $countdown mem matches 61 as @a run function lib:sounds/music/mini_fast
  19. execute if score $countdown mem matches 60 run title @a subtitle {"text":"⚠ 玩家雷达已开启!还剩一分钟! ⚠","color":"red"}
  20. execute if score $countdown mem matches 60 run title @a times 1 120 3
  21. execute if score $countdown mem matches 60 run title @a title ""
  22. execute if score $countdown mem matches 60 run scoreboard players set $bossbar_color mem 1
  23. execute if score $countdown mem matches 60 run function lib:bossbar/show
  24. execute if score $countdown mem matches 60 run playsound minecraft:entity.ender_dragon.growl player @a 0 1000000 0 1000000 1.5
  25. # 30s:时间提示
  26. execute if score $countdown mem matches 30 run title @a subtitle {"text":"⚠ 还剩三十秒! ⚠","color":"yellow"}
  27. execute if score $countdown mem matches 30 run title @a times 1 50 3
  28. execute if score $countdown mem matches 30 run title @a title ""
  29. # 0s:游戏结束
  30. execute if score $countdown mem matches 0 run function mini:main/game_end
  31. # 回复生命值
  32. execute if score $foursec mem matches 1 run effect give @a[team=playing] regeneration 1 10 true
  33. execute if score $foursec mem matches 1 run schedule function mini:iron/game/clear_effect 1t replace
  34. # 给予进度
  35. advancement grant @a[team=playing,scores={iron_count=10..}] only ltw:blood/iron1
  36. advancement grant @a[team=playing,scores={iron_count=25..}] only ltw:blood/iron2
  37. advancement grant @a[team=playing,scores={iron_count=40..}] only ltw:blood/iron3
  38. advancement grant @a[team=playing,scores={iron_count=60..}] only ltw:blood/iron4