LTCatt 6 лет назад
Родитель
Сommit
5152f75db4

+ 4 - 0
data/lib/functions/bossbar/show.mcfunction

@@ -16,9 +16,13 @@ execute if score $bossbar_color mem matches 0 run bossbar set mini:yellow player
 execute if score $bossbar_color mem matches 0 run bossbar set mini:green players @a[scores={bossbar_color=3}]
 execute if score $bossbar_color mem matches 0 run bossbar set mini:blue players @a[scores={bossbar_color=4}]
 execute if score $bossbar_color mem matches 1 run bossbar set mini:red players @a
+execute unless score $bossbar_color mem matches 1 run bossbar set mini:red players
 execute if score $bossbar_color mem matches 2 run bossbar set mini:yellow players @a
+execute unless score $bossbar_color mem matches 2 run bossbar set mini:yellow players
 execute if score $bossbar_color mem matches 3 run bossbar set mini:green players @a
+execute unless score $bossbar_color mem matches 3 run bossbar set mini:green players
 execute if score $bossbar_color mem matches 4 run bossbar set mini:blue players @a
+execute unless score $bossbar_color mem matches 4 run bossbar set mini:blue players
 
 # 立即刷新
 function lib:bossbar/tick2

+ 1 - 0
data/ltw/functions/state/0/state_enter.mcfunction

@@ -7,6 +7,7 @@ scoreboard objectives setdisplay belowName gold_total
 scoreboard objectives setdisplay sidebar gold_total
 scoreboard objectives setdisplay list gold_total
 scoreboard players set $bossbar_type mem 0
+function lib:bossbar/show
 
 # 伤害管理
 scoreboard players set $remove_resistance mem 0

+ 1 - 0
data/ltw/functions/state/3/state_enter.mcfunction

@@ -7,6 +7,7 @@ scoreboard objectives setdisplay belowName total_score_disp
 scoreboard objectives setdisplay sidebar total_score
 scoreboard objectives setdisplay list total_score_disp
 scoreboard players set $bossbar_type mem 0
+function lib:bossbar/show
 
 # 修改时间
 time set midnight

+ 2 - 1
data/ltw/functions/state/4/state_enter.mcfunction

@@ -9,4 +9,5 @@ scoreboard players set $countdown mem 10
 scoreboard objectives setdisplay belowName total_score_disp
 scoreboard objectives setdisplay sidebar total_score
 scoreboard objectives setdisplay list total_score_disp
-scoreboard players set $bossbar_type mem 0
+scoreboard players set $bossbar_type mem 0
+function lib:bossbar/show

+ 1 - 0
data/ltw/functions/state/6/state_enter.mcfunction

@@ -7,6 +7,7 @@ scoreboard objectives setdisplay belowName total_score_disp
 scoreboard objectives setdisplay sidebar total_score
 scoreboard objectives setdisplay list total_score_disp
 scoreboard players set $bossbar_type mem 0
+function lib:bossbar/show
 
 # 初始化倒计时
 scoreboard players set $countdown mem 3

+ 1 - 0
data/ltw/functions/state/7/continue_gameparty.mcfunction

@@ -1,5 +1,6 @@
 # 清除 Bossbar
 scoreboard players set $bossbar_type mem 0
+function lib:bossbar/show
 
 # 继续下一轮小游戏
 scoreboard players add $round mem 1

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

@@ -23,14 +23,14 @@ execute unless entity @a[tag=new_selector] if score $game_type mem matches 1 if
 
 # 初始化倒计时与 HUD
 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 10
-scoreboard players set $bossbar_type mem 2
-function lib:bossbar/show
-bossbar set mini:yellow name "等待他人选择"
-bossbar set mini:blue name "剩余时间"
+# 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 10
+# scoreboard players set $bossbar_type mem 2
+# function lib:bossbar/show
+# bossbar set mini:yellow name "等待他人选择"
+# bossbar set mini:blue name "剩余时间"
 
 # 播放音效
 execute as @a[tag=new_selector] at @s run function lib:sounds/hit

+ 1 - 0
data/ltw/functions/state/7/state_enter.mcfunction

@@ -7,6 +7,7 @@ scoreboard objectives setdisplay belowName total_score_disp
 scoreboard objectives setdisplay sidebar total_score
 scoreboard objectives setdisplay list total_score_disp
 scoreboard players set $bossbar_type mem 0
+function lib:bossbar/show
 
 # 初始化倒计时
 scoreboard players set $countdown mem 5

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

@@ -1,7 +1,7 @@
 # 显示倒计时
-# execute if entity @a[tag=selecting] run title @a times 3 14 2
-# execute if entity @a[tag=selecting] run title @a subtitle {"score":{"name":"$countdown","objective":"mem"}}
-# execute if entity @a[tag=selecting] run title @a title ""
+execute if entity @a[tag=selecting] run title @a times 3 14 2
+execute if entity @a[tag=selecting] run title @a subtitle {"score":{"name":"$countdown","objective":"mem"}}
+execute if entity @a[tag=selecting] run title @a title ""
 
 # 下一状态
 execute if score $countdown mem matches 1 run function ltw:state/7/next

+ 2 - 1
data/mini/functions/colormatch/game_start.mcfunction

@@ -5,4 +5,5 @@ function mini:colormatch/game/start_new_round
 execute if score $mini_type mem matches 4 run scoreboard objectives setdisplay list mini_heart_disp
 execute if score $mini_type mem matches 4 run scoreboard objectives setdisplay belowName mini_heart
 execute if score $mini_type mem matches 4 run scoreboard objectives setdisplay sidebar total_score
-scoreboard players set $bossbar_type mem 0
+scoreboard players set $bossbar_type mem 0
+function lib:bossbar/show

+ 2 - 1
data/mini/functions/hotpm/game_start.mcfunction

@@ -5,4 +5,5 @@ schedule function mini:hotpm/game/pm_init_first 2s replace
 execute if score $mini_type mem matches 3 run scoreboard objectives setdisplay list mini_heart_disp
 execute if score $mini_type mem matches 3 run scoreboard objectives setdisplay belowName mini_heart
 execute if score $mini_type mem matches 3 run scoreboard objectives setdisplay sidebar total_score
-scoreboard players set $bossbar_type mem 0
+scoreboard players set $bossbar_type mem 0
+function lib:bossbar/show

+ 2 - 1
data/mini/functions/tntrun/game_start.mcfunction

@@ -8,4 +8,5 @@ schedule function mini:tntrun/player_enter3 2s replace
 execute if score $mini_type mem matches 2 run scoreboard objectives setdisplay list total_score_disp
 execute if score $mini_type mem matches 2 run scoreboard objectives setdisplay belowName total_score_disp
 execute if score $mini_type mem matches 2 run scoreboard objectives setdisplay sidebar total_score
-scoreboard players set $bossbar_type mem 0
+scoreboard players set $bossbar_type mem 0
+function lib:bossbar/show

+ 2 - 1
data/mini/functions/zombie/game_start.mcfunction

@@ -4,4 +4,5 @@ scoreboard players set $countdown mem 170
 execute if score $mini_type mem matches 5 run scoreboard objectives setdisplay list health_disp
 execute if score $mini_type mem matches 5 run scoreboard objectives setdisplay belowName health_disp
 execute if score $mini_type mem matches 5 run scoreboard objectives setdisplay sidebar total_score
-scoreboard players set $bossbar_type mem 0
+scoreboard players set $bossbar_type mem 0
+function lib:bossbar/show