game_end.mcfunction 1.2 KB

123456789101112131415161718192021222324252627282930
  1. # 小游戏结束
  2. execute if score $mini_type mem matches 1 run function mini:parkour/game_end
  3. execute if score $mini_type mem matches 2 run function mini:tntrun/game_end
  4. execute if score $mini_type mem matches 3 run function mini:hotpm/game_end
  5. execute if score $mini_type mem matches 4 run function mini:colormatch/game_end
  6. execute if score $mini_type mem matches 5 run function mini:phantom/game_end
  7. # 计算排名
  8. tag @a remove mini_rank1
  9. tag @a remove mini_rank2
  10. tag @a remove mini_rank3
  11. tag @a remove mini_rank4
  12. # 1
  13. function mini:main/get_max_score
  14. execute as @a if score @s mini_score = #score_max mem run tag @s[tag=!watcher] add mini_rank1
  15. tag @a[tag=mini_rank1] add max_uncounted
  16. # 2
  17. function mini:main/get_max_score
  18. execute as @a[tag=!max_uncounted] if score @s mini_score = #score_max mem run tag @s[tag=!watcher] add mini_rank2
  19. tag @a[tag=mini_rank2] add max_uncounted
  20. # 3
  21. function mini:main/get_max_score
  22. execute as @a[tag=!max_uncounted] if score @s mini_score = #score_max mem run tag @s[tag=!watcher] add mini_rank3
  23. tag @a[tag=max_uncounted] remove max_uncounted
  24. # 4
  25. tag @a[tag=!mini_rank1,tag=!mini_rank2,tag=!mini_rank3,tag=!watcher] add mini_rank4
  26. # 进入状态 6
  27. function ltw:state/6/state_enter