tick20.mcfunction 2.0 KB

12345678910111213141516171819202122232425262728293031323334
  1. # 60s:教学
  2. execute if score $countdown mem matches 60 run tellraw @a[team=playing,scores={green_total=..10}] [{"text":"\n>> ","color":"light_purple","bold": true},{"text":"提示:如果有近战武器,或许可以冲进幻翼群里直接近战……","bold":false},"\n"]
  3. # 给予进度
  4. execute as @a[team=playing,scores={temp=1..,kill_phantom=7..9}] run advancement grant @s only ltw:blood/phantom1
  5. execute as @a[team=playing,scores={temp=1..,kill_phantom=15..17}] run advancement grant @s only ltw:blood/phantom2
  6. execute as @a[team=playing,scores={temp=1..,kill_phantom=24..26}] run advancement grant @s only ltw:blood/phantom3
  7. execute as @a[team=playing,scores={temp=1..,kill_phantom=30..32}] run advancement grant @s only ltw:blood/phantom4
  8. # 判断是否符合刷出新物品的条件:0 为可以,其他为不可以
  9. scoreboard players set #new_item mem 0
  10. # 当前场地上没有奖励幻翼
  11. execute if entity @e[tag=bonus_phantom] run scoreboard players set #new_item mem 1
  12. # 如果没有物品,则计算冷却
  13. execute if score #new_item mem matches 0 run scoreboard players add $new_item_cd mem 1
  14. # 已经超过 10s 冷却时间
  15. execute if score $new_item_cd mem matches ..9 run scoreboard players set #new_item mem 1
  16. # 召唤幻翼
  17. execute if score $countdown mem matches 11.. run function mini:phantom/game/try_summon
  18. # 显示倒计时
  19. execute if score $countdown mem matches ..10 run title @a times 3 14 2
  20. execute if score $countdown mem matches ..10 run title @a subtitle {"score":{"name":"$countdown","objective":"mem"}}
  21. execute if score $countdown mem matches ..10 run title @a title [""]
  22. execute if score $countdown mem matches ..10 as @a at @s run function lib:sounds/hit2
  23. # 0s:游戏结束
  24. execute if score $countdown mem matches 0 run function mini:main/game_end
  25. # 回复生命值
  26. execute if score $foursec mem matches 1 run effect give @a[team=playing] regeneration 1 10 true
  27. execute if score $foursec mem matches 1 run schedule function mini:phantom/game/clear_effect 1t replace