LTCatt 6 éve
szülő
commit
2a73de504c

+ 14 - 0
data/lib/functions/bossbar/refresh.mcfunction

@@ -0,0 +1,14 @@
+
+execute store result bossbar mini:red max run scoreboard players get $countdown_max mem
+execute store result bossbar mini:yellow max run scoreboard players get $countdown_max mem
+execute store result bossbar mini:green max run scoreboard players get $countdown_max mem
+execute store result bossbar mini:blue max run scoreboard players get $countdown_max mem
+
+execute if score $bossbar_color mem matches 1 run bossbar set mini:red players @a
+execute if score $bossbar_color mem matches 2 run bossbar set mini:yellow players @a
+execute if score $bossbar_color mem matches 3 run bossbar set mini:green players @a
+execute if score $bossbar_color mem matches 4 run bossbar set mini:blue players @a
+bossbar set mini:red players @a[scores={bossbar_color=1}]
+bossbar set mini:yellow players @a[scores={bossbar_color=2}]
+bossbar set mini:green players @a[scores={bossbar_color=3}]
+bossbar set mini:blue players @a[scores={bossbar_color=4}]

+ 0 - 5
data/lib/functions/bossbar/set_max.mcfunction

@@ -1,5 +0,0 @@
-# 设置完$countdown_max需要调用此函数来设置上限
-execute store result bossbar mini:red max run scoreboard players get $countdown_max mem
-execute store result bossbar mini:yellow max run scoreboard players get $countdown_max mem
-execute store result bossbar mini:green max run scoreboard players get $countdown_max mem
-execute store result bossbar mini:blue max run scoreboard players get $countdown_max mem

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

@@ -0,0 +1,4 @@
+bossbar set mini:red players @a
+bossbar set mini:yellow players @a
+bossbar set mini:green players @a
+bossbar set mini:blue players @a

+ 0 - 5
data/lib/functions/bossbar/set_player.mcfunction

@@ -1,5 +0,0 @@
-# 玩家的bossbar_color: 1红 2黄 3绿 4蓝
-bossbar set mini:red players @a[scores={bossbar_color=1}]
-bossbar set mini:yellow players @a[scores={bossbar_color=2}]
-bossbar set mini:green players @a[scores={bossbar_color=3}]
-bossbar set mini:blue players @a[scores={bossbar_color=4}]

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

@@ -1,4 +0,0 @@
-bossbar set mini:red players @a[scores={bossbar_color=1}]
-bossbar set mini:yellow players @a[scores={bossbar_color=2}]
-bossbar set mini:green players @a[scores={bossbar_color=3}]
-bossbar set mini:blue players @a[scores={bossbar_color=4}]

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

@@ -1,4 +0,0 @@
-bossbar set mini:red players
-bossbar set mini:yellow players
-bossbar set mini:green players
-bossbar set mini:blue players

+ 1 - 5
data/lib/functions/bossbar/tick2.mcfunction

@@ -1,9 +1,5 @@
 # mem的$bossbar_type: 0关闭 1countdown_fast 2count_down
 # mem的$bossbar_type: 0关闭 1countdown_fast 2count_down
 # 玩家的bossbar_color: 1红 2黄 3绿 4蓝
 # 玩家的bossbar_color: 1红 2黄 3绿 4蓝
+execute if score $bossbar_type mem matches 0 run function lib:bossbar/set_none
 execute if score $bossbar_type mem matches 1 run function lib:bossbar/set_countfast
 execute if score $bossbar_type mem matches 1 run function lib:bossbar/set_countfast
 execute if score $bossbar_type mem matches 2 run function lib:bossbar/set_countdown
 execute if score $bossbar_type mem matches 2 run function lib:bossbar/set_countdown
-
-# 显示bossbar
-execute unless score $bossbar_type mem matches 0 as @a run function lib:bossbar/show_color
-execute unless score $bossbar_type mem matches 0 as @a run function lib:bossbar/set_max
-execute if score $bossbar_type mem matches 0 as @a run function lib:bossbar/show_none

+ 1 - 2
data/ltw/functions/main/game_end.mcfunction

@@ -65,5 +65,4 @@ schedule function ltw:state/0/state_enter 2t replace
 execute as @a at @s run function lib:sounds/theend
 execute as @a at @s run function lib:sounds/theend
 forceload remove all
 forceload remove all
 
 
-# TODO : [010] 给奖励选择阶段添加上层罩子
-# TODO : 修改史莱姆足球
+# TODO : [010] 给奖励选择阶段添加上层罩子

+ 1 - 1
data/ltw/functions/main/player_leave.mcfunction

@@ -9,4 +9,4 @@ execute if score $state mem matches 1.. if score $game_type mem matches 1 if sco
 # 如果携带热土豆的玩家掉线,则重新生成土豆
 # 如果携带热土豆的玩家掉线,则重新生成土豆
 execute if score $state mem matches 5 if score $mini_type mem matches 3 run function mini:hotpm/player_leave
 execute if score $state mem matches 5 if score $mini_type mem matches 3 run function mini:hotpm/player_leave
 
 
-# TODO : 摸新的大厅
+# TODO : [010] 摸新的大厅

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

@@ -6,6 +6,7 @@ execute as @a run function ltw:state/0/player_enter
 scoreboard objectives setdisplay belowName gold_total
 scoreboard objectives setdisplay belowName gold_total
 scoreboard objectives setdisplay sidebar gold_total
 scoreboard objectives setdisplay sidebar gold_total
 scoreboard objectives setdisplay list gold_total
 scoreboard objectives setdisplay list gold_total
+scoreboard players set $bossbar_type mem 0
 
 
 # 伤害管理
 # 伤害管理
 scoreboard players set $remove_resistance mem 0
 scoreboard players set $remove_resistance mem 0

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

@@ -6,6 +6,7 @@ execute as @a run function ltw:state/3/player_enter
 scoreboard objectives setdisplay belowName total_score_disp
 scoreboard objectives setdisplay belowName total_score_disp
 scoreboard objectives setdisplay sidebar total_score
 scoreboard objectives setdisplay sidebar total_score
 scoreboard objectives setdisplay list total_score_disp
 scoreboard objectives setdisplay list total_score_disp
+scoreboard players set $bossbar_type mem 0
 
 
 # 修改时间
 # 修改时间
 time set midnight
 time set midnight

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

@@ -6,6 +6,7 @@ execute as @a run function ltw:state/4/player_enter
 scoreboard objectives setdisplay belowName total_score_disp
 scoreboard objectives setdisplay belowName total_score_disp
 scoreboard objectives setdisplay sidebar total_score
 scoreboard objectives setdisplay sidebar total_score
 scoreboard objectives setdisplay list total_score_disp
 scoreboard objectives setdisplay list total_score_disp
+scoreboard players set $bossbar_type mem 0
 
 
 # 初始化倒计时
 # 初始化倒计时
 scoreboard players set $countdown mem 10
 scoreboard players set $countdown mem 10

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

@@ -6,6 +6,7 @@ execute as @a run function ltw:state/6/player_enter
 scoreboard objectives setdisplay belowName total_score_disp
 scoreboard objectives setdisplay belowName total_score_disp
 scoreboard objectives setdisplay sidebar total_score
 scoreboard objectives setdisplay sidebar total_score
 scoreboard objectives setdisplay list total_score_disp
 scoreboard objectives setdisplay list total_score_disp
+scoreboard players set $bossbar_type mem 0
 
 
 # 初始化倒计时
 # 初始化倒计时
 scoreboard players set $countdown mem 10
 scoreboard players set $countdown mem 10

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

@@ -6,6 +6,7 @@ execute as @a run function ltw:state/7/player_enter
 scoreboard objectives setdisplay belowName total_score_disp
 scoreboard objectives setdisplay belowName total_score_disp
 scoreboard objectives setdisplay sidebar total_score
 scoreboard objectives setdisplay sidebar total_score
 scoreboard objectives setdisplay list total_score_disp
 scoreboard objectives setdisplay list total_score_disp
+scoreboard players set $bossbar_type mem 0
 
 
 # 初始化倒计时
 # 初始化倒计时
 scoreboard players set $countdown mem 7
 scoreboard players set $countdown mem 7

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

@@ -1,2 +1,8 @@
 # 开始轮次
 # 开始轮次
-function mini:colormatch/game/start_new_round
+function mini:colormatch/game/start_new_round
+
+# HUD
+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

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

@@ -1,2 +1,8 @@
 # 2秒后给予土豆
 # 2秒后给予土豆
 schedule function mini:hotpm/game/pm_init_first 2s replace
 schedule function mini:hotpm/game/pm_init_first 2s replace
+
+# HUD
+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

+ 1 - 26
data/mini/functions/main/game_start.mcfunction

@@ -1,32 +1,7 @@
-
-# HUD
-execute if score $mini_type mem matches 1 run scoreboard objectives setdisplay list total_score_disp
-execute if score $mini_type mem matches 1 run scoreboard objectives setdisplay belowName total_score_disp
-execute if score $mini_type mem matches 1 run scoreboard objectives setdisplay sidebar treasure
-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
-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
-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
-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
-execute if score $mini_type mem matches 6 run scoreboard objectives setdisplay list health_disp
-execute if score $mini_type mem matches 6 run scoreboard objectives setdisplay belowName health_disp
-execute if score $mini_type mem matches 6 run scoreboard objectives setdisplay sidebar kill_phantom
-execute if score $mini_type mem matches 7 run scoreboard objectives setdisplay list health_disp
-execute if score $mini_type mem matches 7 run scoreboard objectives setdisplay belowName total_score
-execute if score $mini_type mem matches 7 run scoreboard objectives setdisplay sidebar slime_score
-
-# 调用其他模块
 execute if score $mini_type mem matches 1 run function mini:parkour/game_start
 execute if score $mini_type mem matches 1 run function mini:parkour/game_start
 execute if score $mini_type mem matches 2 run function mini:tntrun/game_start
 execute if score $mini_type mem matches 2 run function mini:tntrun/game_start
 execute if score $mini_type mem matches 3 run function mini:hotpm/game_start
 execute if score $mini_type mem matches 3 run function mini:hotpm/game_start
 execute if score $mini_type mem matches 4 run function mini:colormatch/game_start
 execute if score $mini_type mem matches 4 run function mini:colormatch/game_start
 execute if score $mini_type mem matches 5 run function mini:zombie/game_start
 execute if score $mini_type mem matches 5 run function mini:zombie/game_start
 execute if score $mini_type mem matches 6 run function mini:phantom/game_start
 execute if score $mini_type mem matches 6 run function mini:phantom/game_start
-execute if score $mini_type mem matches 7 run function mini:slime/game_start
+execute if score $mini_type mem matches 7 run function mini:slime/game_start

+ 11 - 0
data/mini/functions/parkour/game_start.mcfunction

@@ -1,2 +1,13 @@
 # 游戏结束倒计时
 # 游戏结束倒计时
 scoreboard players set $countdown mem 140
 scoreboard players set $countdown mem 140
+
+# HUD
+execute if score $mini_type mem matches 1 run scoreboard objectives setdisplay list total_score_disp
+execute if score $mini_type mem matches 1 run scoreboard objectives setdisplay belowName total_score_disp
+execute if score $mini_type mem matches 1 run scoreboard objectives setdisplay sidebar treasure
+scoreboard players set $bossbar_color mem 4
+scoreboard players set $countdown_max mem 140
+scoreboard players set $bossbar_type mem 2
+bossbar set mini:blue name "倒计时"
+bossbar set mini:blue style notched_6
+function lib:bossbar/refresh

+ 6 - 0
data/mini/functions/phantom/game_start.mcfunction

@@ -1,2 +1,8 @@
 gamerule doDaylightCycle true
 gamerule doDaylightCycle true
 scoreboard players set $countdown mem 110
 scoreboard players set $countdown mem 110
+
+# HUD
+execute if score $mini_type mem matches 6 run scoreboard objectives setdisplay list health_disp
+execute if score $mini_type mem matches 6 run scoreboard objectives setdisplay belowName health_disp
+execute if score $mini_type mem matches 6 run scoreboard objectives setdisplay sidebar kill_phantom
+scoreboard players set $bossbar_type mem 0

+ 7 - 1
data/mini/functions/slime/game_start.mcfunction

@@ -1,2 +1,8 @@
 function mini:slime/game/summon
 function mini:slime/game/summon
-scoreboard players set $countdown mem 100
+scoreboard players set $countdown mem 100
+
+# HUD
+execute if score $mini_type mem matches 7 run scoreboard objectives setdisplay list health_disp
+execute if score $mini_type mem matches 7 run scoreboard objectives setdisplay belowName total_score
+execute if score $mini_type mem matches 7 run scoreboard objectives setdisplay sidebar slime_score
+scoreboard players set $bossbar_type mem 0

+ 6 - 0
data/mini/functions/tntrun/game_start.mcfunction

@@ -3,3 +3,9 @@ schedule function mini:tntrun/player_enter2 1t replace
 
 
 # 两秒后才开始 TNT 掉落
 # 两秒后才开始 TNT 掉落
 schedule function mini:tntrun/player_enter3 2s replace
 schedule function mini:tntrun/player_enter3 2s replace
+
+# HUD
+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

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

@@ -1 +1,7 @@
-scoreboard players set $countdown mem 170
+scoreboard players set $countdown mem 170
+
+# HUD
+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