start_game.mcfunction 1.3 KB

1234567891011121314151617181920212223242526272829
  1. # 开始游戏
  2. # 确认实际玩家
  3. tag @a remove selected_player
  4. tag @a[team=playing,sort=random,limit=8] add selected_player
  5. # 通知队伍
  6. tellraw @a[team=playing,tag=!selected_player] ["",{"text": ">> ","color": "red","bold": true},{"text": "你没有被选中参与, 将旁观本局游戏!","color": "red"}]
  7. team join watching @a[team=playing,tag=!selected_player]
  8. tellraw @a[team=playing,tag=selected_player] ["",{"text": ">> ","color": "green","bold": true},{"text": "游戏开始!","color": "green"}]
  9. tellraw @a[team=watching] ["",{"text": ">> ","color": "green","bold": true},{"text": "游戏开始, 你将旁观本局游戏!","color": "green"}]
  10. tellraw @a[team=debugging] ["",{"text": ">> ","color": "blue","bold": true},{"text": "你正处于 Debug 模式中, 将忽略游戏开始!","color": "blue"}]
  11. # 设置数据
  12. scoreboard players reset * total_score
  13. scoreboard players set @a[team=playing] total_score 0
  14. scoreboard players reset * total_score_disp
  15. scoreboard players set @a[team=playing] total_score_disp 0
  16. scoreboard players set $round mem 1
  17. scoreboard players add $ game_id 1
  18. scoreboard players operation @a game_id = $ game_id
  19. # 重置物品
  20. clear @a[team=playing]
  21. execute as @a[team=playing] at @s run function item:shop/refresh_equip
  22. # 开始小游戏
  23. function lib:sounds/music/stop
  24. function ltw:state/3/state_enter