game_end.mcfunction 2.0 KB

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