next.mcfunction 2.0 KB

1234567891011121314151617181920212223242526272829
  1. # 选取下一轮选择的人群
  2. tag @a remove new_selector
  3. execute unless entity @a[tag=new_selector] run tag @a[tag=mini_rank1] add new_selector
  4. execute if entity @a[tag=mini_rank1,tag=new_selector] run tellraw @a[tag=!new_selector] ["",{"text": ">> ","color":"gold","bold": true},"轮到第一名 ",{"selector": "@a[tag=new_selector]","color":"gold"}," 选择奖励了!"]
  5. execute unless entity @a[tag=new_selector] run tag @a[tag=mini_rank2] add new_selector
  6. execute if entity @a[tag=mini_rank2,tag=new_selector] run tellraw @a[tag=!new_selector] ["",{"text": ">> ","color":"gold","bold": true},"轮到第二名 ",{"selector": "@a[tag=new_selector]","color":"gold"}," 选择奖励了!"]
  7. execute unless entity @a[tag=new_selector] run tag @a[tag=mini_rank3] add new_selector
  8. execute if entity @a[tag=mini_rank3,tag=new_selector] run tellraw @a[tag=!new_selector] ["",{"text": ">> ","color":"gold","bold": true},"轮到第三名 ",{"selector": "@a[tag=new_selector]","color":"gold"}," 选择奖励了!"]
  9. execute unless entity @a[tag=new_selector] run tag @a[tag=mini_rank4] add new_selector
  10. execute if entity @a[tag=mini_rank4,tag=new_selector] run tellraw @a[tag=!new_selector] ["",{"text": ">> ","color":"gold","bold": true},{"text":"轮到其他人选择奖励了!","color":"gold"}]
  11. execute unless entity @a[tag=new_selector] if entity @a[tag=selecting] run tellraw @a ["",{"text": ">> ","color":"red","bold": true},{"selector": "@a[tag=selecting]","color":"red"}," 未选择奖励……"]
  12. # 以玩家为对象开始执行
  13. execute as @a[tag=new_selector] run function ltw:state/7/next2
  14. execute unless entity @a[tag=new_selector] if score $round mem matches 5.. run function ltw:main/game_end
  15. execute unless entity @a[tag=new_selector] if score $round mem matches ..4 run function ltw:state/7/continue_gameparty
  16. # 初始化倒计时与 HUD
  17. scoreboard players set $countdown mem 10
  18. # 播放音效
  19. execute as @a[tag=new_selector] at @s run function lib:sounds/hit
  20. execute if entity @a[tag=new_selector] as @a[tag=!new_selector] at @s run function lib:sounds/hit2