game_end.mcfunction 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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. execute if score $mini_type mem matches 201 run function mini:ass/game_end
  8. execute if score $mini_type mem matches 202 run function mini:rgb/game_end
  9. execute if score $mini_type mem matches 101 run function mini:diamond/game_end
  10. execute if score $mini_type mem matches 102 run function mini:trade/game_end
  11. # 计算排名
  12. tag @a remove mini_rank1
  13. tag @a remove mini_rank2
  14. tag @a remove mini_rank3
  15. tag @a remove mini_rank4
  16. # 1
  17. function mini:main/get_max_score
  18. execute as @a if score @s mini_score = #score_max mem run tag @s[team=playing] add mini_rank1
  19. tag @a[tag=mini_rank1] add max_uncounted
  20. # 2
  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[team=playing] add mini_rank2
  23. tag @a[tag=mini_rank2] add max_uncounted
  24. # 3
  25. function mini:main/get_max_score
  26. execute as @a[tag=!max_uncounted] if score @s mini_score = #score_max mem run tag @s[team=playing] add mini_rank3
  27. tag @a[tag=max_uncounted] remove max_uncounted
  28. # 4
  29. tag @a[tag=!mini_rank1,tag=!mini_rank2,tag=!mini_rank3,team=playing] add mini_rank4
  30. # 给予进度
  31. execute if score $mini_type mem matches 2 run advancement grant @a[tag=mini_rank1,scores={layer=3..}] only ltw:parkour/tnt2
  32. execute if score $mini_type mem matches 3 run advancement grant @a[tag=mini_rank1,scores={mini_heart=2..}] only ltw:vs/potato2
  33. execute if score $mini_type mem matches 3 run advancement grant @a[tag=mini_rank1,scores={mini_heart=5..}] only ltw:vs/potato3
  34. execute if score $mini_type mem matches 4 if score $color_match_time mem matches ..13 run advancement grant @a[tag=mini_rank1] only ltw:parkour/colormatch2
  35. # 清理怪东西
  36. clear @a[team=!debugging] #mini:game_item{game_item:1b}
  37. # 进入状态 6
  38. function ltw:state/6/state_enter