ソースを参照

全部改用 Bossbar

LTCatt 6 年 前
親
コミット
e0bc4f2b42

+ 3 - 3
data/ltw/functions/state/7/next.mcfunction

@@ -22,13 +22,13 @@ execute unless entity @a[tag=new_selector] if score $game_type mem matches 1 if
 execute unless entity @a[tag=new_selector] if score $game_type mem matches 1 if score $round mem matches ..5 run function ltw:state/7/continue_gameparty
 
 # 初始化倒计时与 HUD
-scoreboard players set $countdown mem 13
+scoreboard players set $countdown mem 10
 scoreboard players set $bossbar_color mem 0
 scoreboard players set @a[tag=!new_selector] bossbar_color 2
 scoreboard players set @a[tag=new_selector] bossbar_color 4
-scoreboard players set $countdown_max mem 13
+scoreboard players set $countdown_max mem 10
 scoreboard players set $bossbar_type mem 2
-bossbar set mini:yellow name "等待他人选择奖励"
+bossbar set mini:yellow name "等待他人选择"
 bossbar set mini:blue name "剩余时间"
 function lib:bossbar/show
 

+ 7 - 0
data/mini/functions/colormatch/game/remove_ground.mcfunction

@@ -10,5 +10,12 @@ scoreboard players operation $countdown_fast mem < $color_match_time mem
 scoreboard players remove $countdown_fast mem 3
 scoreboard players set $color_match_type mem 1
 
+# HUD
+scoreboard players set $bossbar_color mem 3
+scoreboard players operation $countdown_max mem = $countdown_fast mem
+scoreboard players set $bossbar_type mem 1
+bossbar set mini:green name "下一轮"
+function lib:bossbar/show
+
 # 预备下一轮
 function mini:colormatch/game/prepare_round

+ 7 - 0
data/mini/functions/colormatch/game/start_new_round.mcfunction

@@ -8,6 +8,13 @@ execute if score $color_match_time mem matches 37.. run scoreboard players remov
 execute if score $color_match_time mem matches 12..36 run scoreboard players remove $color_match_time mem 1
 scoreboard players operation $countdown_fast mem = $color_match_time mem
 
+# HUD
+scoreboard players set $bossbar_color mem 1
+scoreboard players operation $countdown_max mem = $countdown_fast mem
+scoreboard players set $bossbar_type mem 1
+bossbar set mini:red name "地板消失"
+function lib:bossbar/show
+
 # 重置分数
 scoreboard players set $color_match_type mem 0
 

+ 2 - 2
data/mini/functions/colormatch/tick2.mcfunction

@@ -8,5 +8,5 @@ execute if score $countdown_fast mem matches 0 if score $color_match_type mem ma
 execute if score $countdown_fast mem matches 0 if score $color_match_type mem matches 1 run function mini:colormatch/game/start_new_round
 
 # 显示当前剩余秒数
-execute if score $countdown_fast mem matches 1.. if score $color_match_type mem matches 0 run title @a actionbar [{"text":"地板消失: ","color":"red","bold": true},{"score": { "name": "$countdown_fast","objective": "mem"}}]
-execute if score $countdown_fast mem matches 1.. if score $color_match_type mem matches 1 run title @a actionbar [{"text":"下一轮: ","color":"green","bold": true},{"score": { "name": "$countdown_fast","objective": "mem"}}]
+# execute if score $countdown_fast mem matches 1.. if score $color_match_type mem matches 0 run title @a actionbar [{"text":"地板消失: ","color":"red","bold": true},{"score": { "name": "$countdown_fast","objective": "mem"}}]
+# execute if score $countdown_fast mem matches 1.. if score $color_match_type mem matches 1 run title @a actionbar [{"text":"下一轮: ","color":"green","bold": true},{"score": { "name": "$countdown_fast","objective": "mem"}}]

+ 0 - 6
data/mini/functions/hotpm/tick2.mcfunction

@@ -1,8 +1,2 @@
-# 土豆倒计时
-title @a[tag=pm_holding] actionbar [{"text":"土豆爆炸: ","color":"red","bold": true},{"score": { "name": "$countdown_fast","objective": "mem"}}]
-execute as @a[tag=pm_holding] at @s run title @a[tag=!pm_holding,distance=..8] actionbar [{"text":"土豆爆炸: ","color":"gold","bold": true},{"score": { "name": "$countdown_fast","objective": "mem"}}]
-execute as @a[tag=pm_holding] at @s run title @a[tag=!pm_holding,distance=8..17] actionbar [{"text":"土豆爆炸: ","color":"yellow","bold": true},{"score": { "name": "$countdown_fast","objective": "mem"}}]
-execute as @a[tag=pm_holding] at @s run title @a[tag=!pm_holding,distance=17..] actionbar [{"text":"土豆爆炸: ","color":"green","bold": true},{"score": { "name": "$countdown_fast","objective": "mem"}}]
-
 # 爆炸
 execute if score $countdown_fast mem matches 0 as @a[tag=pm_holding] at @s run function mini:hotpm/player_lose_heart

+ 12 - 0
data/mini/functions/hotpm/tick5.mcfunction

@@ -4,3 +4,15 @@ execute as @a[gamemode=!spectator] at @s if block ~ ~-1 ~ minecraft:barrier run
 
 # 给持有者播放音效
 execute as @a[tag=pm_holding] at @s run function lib:sounds/creeper
+
+# HUD
+scoreboard players set $bossbar_color mem 0
+scoreboard players set @a[tag=pm_holding] bossbar_color 1
+scoreboard players set @a[tag=!pm_holding,distance=..15] bossbar_color 2
+scoreboard players set @a[tag=!pm_holding,distance=15..] bossbar_color 3
+scoreboard players operation $countdown_max mem = $countdown_fast mem
+scoreboard players set $bossbar_type mem 1
+bossbar set mini:green name "土豆爆炸"
+bossbar set mini:yellow name "土豆爆炸"
+bossbar set mini:red name "土豆爆炸"
+function lib:bossbar/show