state_enter.mcfunction 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. # 要求系统进入状态 7(选择奖励)
  2. scoreboard players set $state mem 7
  3. execute as @a run function ltw:state/7/player_enter
  4. # HUD
  5. scoreboard objectives setdisplay belowName total_score_disp
  6. scoreboard objectives setdisplay sidebar total_score
  7. scoreboard objectives setdisplay list total_score_disp
  8. # 初始化地图
  9. forceload add 0 2000 50 2050
  10. kill @e[type=item]
  11. # 生成地图
  12. setblock 0 10 2000 minecraft:structure_block{mode:"LOAD",name:"ltw:select"}
  13. setblock 0 11 2000 minecraft:redstone_block
  14. # 生成奖励物品
  15. execute store result score $t_player_count mem if entity @a[tag=!watcher]
  16. scoreboard players set $t_player_count mem 8
  17. execute if score $t_player_count mem matches 1.. positioned 9.0 13.0 2014.0 run function item:bonus_item/rank/random
  18. execute if score $t_player_count mem matches 2.. positioned 5.0 13.0 2014.0 run function item:bonus_item/rank/random
  19. execute if score $t_player_count mem matches 3.. positioned 0.0 13.0 2009.0 run function item:bonus_item/rank/random
  20. execute if score $t_player_count mem matches 4.. positioned 0.0 13.0 2005.0 run function item:bonus_item/rank/random
  21. execute if score $t_player_count mem matches 5.. positioned 5.0 13.0 2000.0 run function item:bonus_item/rank/random
  22. execute if score $t_player_count mem matches 6.. positioned 9.0 13.0 2000.0 run function item:bonus_item/rank/random
  23. execute if score $t_player_count mem matches 7.. positioned 14.0 13.0 2005.0 run function item:bonus_item/rank/random
  24. execute if score $t_player_count mem matches 8.. positioned 14.0 13.0 2009.0 run function item:bonus_item/rank/random
  25. # 生成奖励物品背景
  26. execute as @e[team=white,type=item] at @s run fill ~-0.5 ~-0.5 ~-0.5 ~0.5 ~0.5 ~0.5 white_concrete_powder
  27. execute as @e[team=green,type=item] at @s run fill ~-0.5 ~-0.5 ~-0.5 ~0.5 ~0.5 ~0.5 lime_concrete_powder
  28. execute as @e[team=blue,type=item] at @s run fill ~-0.5 ~-0.5 ~-0.5 ~0.5 ~0.5 ~0.5 light_blue_concrete_powder
  29. execute as @e[team=purple,type=item] at @s run fill ~-0.5 ~-0.5 ~-0.5 ~0.5 ~0.5 ~0.5 purple_concrete_powder
  30. # 传送回原位
  31. execute as @e[type=item,x=-1,y=12,z=1999,dx=2,dy=2,dz=50] at @s run tp @s 1.5 ~ ~
  32. execute as @e[type=item,x=13,y=12,z=1999,dx=2,dy=2,dz=50] at @s run tp @s -1.5 ~ ~
  33. execute as @e[type=item,x=-1,y=12,z=1999,dx=50,dy=2,dz=2] at @s run tp @s ~ ~ 1.5
  34. execute as @e[type=item,x=-1,y=12,z=2013,dx=50,dy=2,dz=2] at @s run tp @s ~ ~ -1.5
  35. # 生成屏障
  36. execute as @e[type=item] at @s run fill ~-0.1 ~1 ~-0.1 ~0.1 ~1 ~0.1 barrier
  37. # 判断进入下一轮小游戏或结束
  38. # execute if score $game_type mem matches 1 if score $round mem matches ..5 run function ltw:state/7/continue_gameparty
  39. # execute if score $game_type mem matches 1 if score $round mem matches 6.. run function ltw:main/game_end