tick20.mcfunction 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. # 强制死亡机制
  2. execute if score $countdown mem matches 21 run tellraw @a ["",{"text": ">> ","color": "gold","bold": true},{"text": "强制死亡将在 20 秒后开启!","color": "gold"}]
  3. execute if score $countdown mem matches 1 run tellraw @a ["",{"text": ">> ","color": "gold","bold": true},{"text": "强制死亡已开启!","color": "gold"}]
  4. execute if score $countdown mem matches 1 run scoreboard players set $bossbar_color mem 1
  5. execute if score $countdown mem matches 1 run function lib:bossbar/show
  6. execute if score $countdown mem matches 1 as @a at @s run function lib:sounds/music/mini_fast
  7. execute if score $countdown mem matches 1 as @a at @s run function lib:sounds/dragon_growl
  8. execute if score $countdown mem matches 1 if score $player_alive mem matches 3.. run effect clear @a resistance
  9. execute if score $countdown mem matches 1 if score $player_alive mem matches 3.. run tellraw @a ["",{"text": ">> ","color": "gold","bold": true},{"text": "苦力怕现在会造成更多伤害!","color": "gold"}]
  10. execute if score $countdown mem matches ..0 run effect give @a[team=playing] wither 1000000 1 true
  11. # 回复生命值
  12. execute if score $countdown mem matches 1.. if score $foursec mem matches 1 if score $foursec mem matches 1 run effect give @a[team=playing] regeneration 1 10 true
  13. execute if score $countdown mem matches 1.. if score $foursec mem matches 1 run schedule function mini:ass/game/clear_effect 1t replace
  14. # -----------------------
  15. # 物品生成
  16. # -----------------------
  17. # 判断是否符合刷出新物品的条件:0 为可以,其他为不可以
  18. scoreboard players set #new_item mem 0
  19. # 当前场地上没有物品
  20. execute if entity @e[tag=bonus_item,x=1000,y=0,z=7000,dx=100,dy=1000,dz=100] run scoreboard players set #new_item mem 1
  21. # 没有进入即死
  22. execute if score $countdown mem matches ..1 run scoreboard players set #new_item mem 1
  23. # 如果没有物品,则计算冷却
  24. execute if score #new_item mem matches 0 run scoreboard players add $new_item_cd mem 1
  25. # 已经超过 15s 冷却时间
  26. execute if score $new_item_cd mem matches ..14 run scoreboard players set #new_item mem 1
  27. # 存活玩家数($player_alive)>= 3
  28. execute if score $player_alive mem matches ..2 run scoreboard players set #new_item mem 1
  29. # 死亡玩家数($player_finish)<= 2
  30. execute if score $player_finish mem matches 3.. run scoreboard players set #new_item mem 1
  31. # 如果上述条件均满足,则刷出新物品
  32. execute if score #new_item mem matches 0 run function mini:ass/game/new_item