Jelajahi Sumber

修复血量显示 Bug

LTCatt 6 tahun lalu
induk
melakukan
8703464f0d

+ 3 - 1
data/ltw/functions/init.mcfunction

@@ -19,12 +19,14 @@ gamerule doTileDrops false
 gamerule doMobLoot false
 
 # 主寄存区块:将所有需要不卸载的都放里面
-#   已占用: (0,0,0) (0,0,1)
+#   已占用:(0,0,0) (0,0,1)
 forceload add 0 0
 
 # 记分板
 scoreboard objectives remove health
 scoreboard objectives add health health "生命值"
+scoreboard objectives remove health_disp
+scoreboard objectives add health_disp dummy "生命值"
 scoreboard objectives remove death
 scoreboard objectives add death deathCount "死亡触发"
 scoreboard objectives remove mem

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

@@ -8,8 +8,8 @@ execute if score $mini_type mem matches 3 run scoreboard objectives setdisplay s
 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
-execute if score $mini_type mem matches 5 run scoreboard objectives setdisplay sidebar health
-execute if score $mini_type mem matches 5 run scoreboard objectives setdisplay belowName health
+execute if score $mini_type mem matches 5 run scoreboard objectives setdisplay sidebar health_disp
+execute if score $mini_type mem matches 5 run scoreboard objectives setdisplay belowName health_disp
 scoreboard objectives setdisplay list total_score_disp
 # TODO : [LTCat] 添加 list HUD 统一
 

+ 6 - 1
data/mini/functions/main/tick20.mcfunction

@@ -1 +1,6 @@
-execute if score $mini_type mem matches 5 run function mini:zombie/tick20
+
+# 触发单个模块
+execute if score $mini_type mem matches 5 run function mini:zombie/tick20
+
+# 结束游戏判定
+function mini:main/check_game_end

+ 7 - 1
data/mini/functions/main/tick5.mcfunction

@@ -1,5 +1,11 @@
+
+# 触发单个模块
 execute if score $mini_type mem matches 1 run function mini:parkour/tick5
 execute if score $mini_type mem matches 2 run function mini:tntrun/tick5
 execute if score $mini_type mem matches 3 run function mini:hotpm/tick5
 execute if score $mini_type mem matches 4 run function mini:colormatch/tick5
-function mini:main/check_game_end
+
+# 同步生命值
+scoreboard players reset * health_disp
+scoreboard players set @a[gamemode=!spectator] health_disp 20
+scoreboard players operation @a[gamemode=!spectator] health_disp = @s health

+ 1 - 1
data/mini/functions/zombie/game_init.mcfunction

@@ -18,4 +18,4 @@ scoreboard players set $zombie_luck mem 0
 team modify ltw friendlyFire false
 gamerule fallDamage false
 
-# FIXME 玩家生命值显示存在问题
+# FIXME [LTCat] 玩家生命值显示存在问题

+ 2 - 0
data/mini/functions/zombie/tick20.mcfunction

@@ -20,3 +20,5 @@ effect give @e[type=zombie,limit=1,sort=random] slowness 2 2
 # 召唤怪物
 execute if score $random mem matches -5..5 run function mini:zombie/game/summon_zombie
 execute if score $random mem matches ..-10 run function mini:zombie/game/summon_evoker
+
+# FIXME [010/HIM] 连续小游戏过程中侧边栏得分会显示出 $t_score_max