tick20.mcfunction 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. # 180s:教学
  8. execute if score $countdown mem matches 180 run tellraw @a[team=playing,scores={green_total=..10}] [{"text":"\n>> ","color":"light_purple","bold": true},{"text":"提示:就算是为了小命,制作盾牌与武器也是很有必要的!","bold":false},"\n"]
  9. # 120s:雷达提示
  10. execute if score $countdown mem matches 120 run title @a subtitle {"text":"⚠ 玩家雷达将在三十秒后开启! ⚠","color":"yellow"}
  11. execute if score $countdown mem matches 120 run title @a times 1 100 3
  12. execute if score $countdown mem matches 120 run title @a title ""
  13. execute if score $countdown mem matches 120 run scoreboard players set $bossbar_color mem 2
  14. execute if score $countdown mem matches 120 run function lib:bossbar/show
  15. # 90s:雷达开启
  16. execute if score $countdown mem matches 91 as @a run function lib:sounds/music/mini_fast
  17. execute if score $countdown mem matches 90 run title @a subtitle {"text":"⚠ 玩家雷达已开启! ⚠","color":"red"}
  18. execute if score $countdown mem matches 90 run title @a times 1 120 3
  19. execute if score $countdown mem matches 90 run title @a title ""
  20. execute if score $countdown mem matches 90 run scoreboard players set $bossbar_color mem 1
  21. execute if score $countdown mem matches 90 run function lib:bossbar/show
  22. execute if score $countdown mem matches 90 run playsound minecraft:entity.ender_dragon.growl player @a 0 1000000 0 1000000 1.5
  23. # 60s:时间提示
  24. execute if score $countdown mem matches 60 run title @a subtitle {"text":"⚠ 最后一分钟! ⚠","color":"yellow"}
  25. execute if score $countdown mem matches 60 run title @a times 1 50 3
  26. execute if score $countdown mem matches 60 run title @a title ""
  27. # 30s:时间提示
  28. execute if score $countdown mem matches 30 run title @a subtitle {"text":"⚠ 最后三十秒! ⚠","color":"yellow"}
  29. execute if score $countdown mem matches 30 run title @a times 1 50 3
  30. execute if score $countdown mem matches 30 run title @a title ""
  31. # 0s:游戏结束
  32. execute if score $countdown mem matches 0 run function mini:main/game_end
  33. # 回复生命值
  34. execute if score $foursec mem matches 1 run effect give @a[team=playing] regeneration 1 10 true
  35. execute if score $foursec mem matches 1 run schedule function mini:iron/game/clear_effect 1t replace
  36. # 给予进度
  37. advancement grant @a[team=playing,scores={iron_count=10..}] only ltw:blood/iron1
  38. advancement grant @a[team=playing,scores={iron_count=20..}] only ltw:blood/iron2
  39. advancement grant @a[team=playing,scores={iron_count=40..}] only ltw:blood/iron3
  40. advancement grant @a[team=playing,scores={iron_count=50..}] only ltw:blood/iron4