HerobrineXia 6 лет назад
Родитель
Сommit
30fdbd3307

+ 1 - 1
data/mini/functions/hotpm/pm_boom.mcfunction

@@ -7,4 +7,4 @@ execute at @s run summon minecraft:area_effect_cloud ~ ~ ~ {Tags:["pm_boom"]}
 #减少生命
 function mini:hotpm/player_failed
 #选新土豆
-execute if score $t_alive mem matches 2.. as @e[type=area_effect_cloud,tag=pm_boom] run function mini:hotpm/pm_init
+execute if score $alive mem matches 2.. as @e[type=area_effect_cloud,tag=pm_boom] run function mini:hotpm/pm_init

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

@@ -6,3 +6,7 @@ execute if score $mini_type mem matches 4 run function mini:colormatch/game_init
 
 # 计分板初始化
 scoreboard players reset * mini_score
+
+# 计算玩家数量
+execute store result score $alive mem if entity @a[tag=mini_running,tag=!watcher]
+

+ 3 - 3
data/mini/functions/main/player_failed.mcfunction

@@ -2,9 +2,9 @@
 
 # 计数
 tag @s remove mini_running
-execute store result score $t_alive mem if entity @a[tag=mini_running,tag=!watcher]
+execute store result score $alive mem if entity @a[tag=mini_running,tag=!watcher]
 execute store result score $t_finish mem if entity @a[tag=!mini_running,tag=!watcher]
-execute if entity @s[tag=!rejoining] if score $t_alive mem matches 1.. run tellraw @a [{"selector": "@s","color":"red"}," 已失败! 剩余 ",{"score": {"name": "$t_alive","objective": "mem"}}," 人!"]
+execute if entity @s[tag=!rejoining] if score $alive mem matches 1.. run tellraw @a [{"selector": "@s","color":"red"}," 已失败! 剩余 ",{"score": {"name": "$alive","objective": "mem"}}," 人!"]
 
 # 给存活的玩家加分
 scoreboard players add @a[tag=mini_running] mini_score 1
@@ -15,4 +15,4 @@ spectate @r[tag=mini_running]
 
 # 如果只有一个玩家没有失败,则游戏结束
 # 这里设置成等于就不会触发多次 game_end 了
-execute if score $t_alive mem matches 1 run function mini:main/game_end
+execute if score $alive mem matches 1 run function mini:main/game_end

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

@@ -2,7 +2,7 @@
 
 # 计数
 tag @s remove mini_running
-execute store result score $t_alive mem if entity @a[tag=mini_running,tag=!watcher]
+execute store result score $alive mem if entity @a[tag=mini_running,tag=!watcher]
 execute store result score $t_finish mem if entity @a[tag=!mini_running,tag=!watcher]
 execute if entity @s[tag=!rejoining] if score $t_finish mem matches ..3 run tellraw @a [{"selector": "@s","color":"green"}," 已成功! 第 ",{"score": {"name": "$t_finish","objective": "mem"}}," 名!"]
 
@@ -16,4 +16,4 @@ spectate @r[tag=mini_running]
 # 如果有三个玩家成功,或只有一个玩家未成功,则游戏结束
 # 这里设置成等于就不会触发多次 game_end 了
 execute if score $t_finish mem matches 3 run function mini:main/game_end
-execute if score $t_finish mem matches ..2 if score $t_alive mem matches 1 run function mini:main/game_end
+execute if score $t_finish mem matches ..2 if score $alive mem matches 1 run function mini:main/game_end