Просмотр исходного кода

修复旁观者会显示总分的 Bug

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

+ 2 - 0
data/ltw/functions/init.mcfunction

@@ -21,6 +21,8 @@ scoreboard objectives remove mem
 scoreboard objectives add mem dummy "全局变量"
 scoreboard objectives remove total_score
 scoreboard objectives add total_score dummy "得分"
+scoreboard objectives remove total_score_disp
+scoreboard objectives add total_score_disp dummy "得分"
 scoreboard objectives remove leave_game
 scoreboard objectives add leave_game minecraft.custom:leave_game "离开游戏"
 scoreboard objectives remove game_id

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

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

+ 3 - 3
data/ltw/functions/state/4/state_enter.mcfunction

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

+ 3 - 3
data/ltw/functions/state/6/state_enter.mcfunction

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

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

@@ -3,9 +3,9 @@ scoreboard players set $state mem 7
 execute as @a run function ltw:state/7/player_enter
 
 # HUD
-# scoreboard objectives setdisplay belowName total_score
-scoreboard objectives setdisplay sidebar total_score
-# scoreboard objectives setdisplay list total_score
+scoreboard objectives setdisplay belowName total_score_disp
+scoreboard objectives setdisplay sidebar total_score_disp
+scoreboard objectives setdisplay list total_score_disp
 
 # 初始化跑酷地图
 forceload add 0 2000 50 2050

+ 1 - 1
data/mini/functions/colormatch/player_enter.mcfunction

@@ -24,4 +24,4 @@ function mini:main/player_max_health
 # 重新加入处理
 execute if entity @s[tag=rejoining] run function mini:main/player_failed
 
-# FIXME : [010/HIM] 持有土豆的玩家如果掉线会导致游戏无法继续
+# FIXME : [010/HIM] 玩家掉线后,如果场上没有土豆,就再生成一次,以免游戏无法继续(玩家和土豆一起掉线.jpg)

+ 0 - 3
data/mini/functions/main/game_init.mcfunction

@@ -7,6 +7,3 @@ execute if score $mini_type mem matches 1 run function mini:parkour/game_init
 execute if score $mini_type mem matches 2 run function mini:tntrun/game_init
 execute if score $mini_type mem matches 3 run function mini:hotpm/game_init
 execute if score $mini_type mem matches 4 run function mini:colormatch/game_init
-
-# FIXME [010/HIM] 旁观者会在侧边栏显示为 0 分(龙猫:我真的不知道咋回事了.jpg)
-# FIXME [LTCat/HIM] 删除血量在list(可能belowname)的显示修复如上bug

+ 5 - 5
data/mini/functions/main/game_start.mcfunction

@@ -1,14 +1,14 @@
 
 # HUD
-execute if score $mini_type mem matches 1 run scoreboard objectives setdisplay sidebar total_score
-# execute if score $mini_type mem matches 1 run scoreboard objectives setdisplay belowName total_score
-execute if score $mini_type mem matches 2 run scoreboard objectives setdisplay sidebar total_score
-# execute if score $mini_type mem matches 2 run scoreboard objectives setdisplay belowName total_score
+execute if score $mini_type mem matches 1 run scoreboard objectives setdisplay sidebar 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 2 run scoreboard objectives setdisplay sidebar 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 3 run scoreboard objectives setdisplay sidebar mini_heart
 execute if score $mini_type mem matches 3 run scoreboard objectives setdisplay belowName mini_heart
 execute if score $mini_type mem matches 4 run scoreboard objectives setdisplay sidebar mini_heart
 execute if score $mini_type mem matches 4 run scoreboard objectives setdisplay belowName mini_heart
-# scoreboard objectives setdisplay list total_score
+scoreboard objectives setdisplay list total_score_disp
 
 
 # 调用其他模块

+ 4 - 0
data/mini/functions/main/show_result.mcfunction

@@ -6,6 +6,10 @@ execute unless entity @a[tag=mini_rank2] run tellraw @s [{"text":"\n>> 小游戏
 
 # 记分
 scoreboard players add @s[tag=mini_rank1,tag=!watcher] total_score 3
+scoreboard players add @s[tag=mini_rank1,tag=!watcher] total_score_disp 3
 scoreboard players add @s[tag=mini_rank2,tag=!watcher] total_score 2
+scoreboard players add @s[tag=mini_rank2,tag=!watcher] total_score_disp 2
 scoreboard players add @s[tag=mini_rank3,tag=!watcher] total_score 1
+scoreboard players add @s[tag=mini_rank3,tag=!watcher] total_score_disp 1
 scoreboard players add @s[tag=mini_rank4,tag=!watcher] total_score 0
+scoreboard players add @s[tag=mini_rank4,tag=!watcher] total_score_disp 0