Răsfoiți Sursa

死亡玩家调整为旁观,可以算分了

LTCatt 6 ani în urmă
părinte
comite
1333a6687c

+ 1 - 0
data/mini/functions/main/player_death.mcfunction

@@ -1,2 +1,3 @@
 # 玩家死亡后触发
 execute if score $mini_type mem matches 5 run function mini:zombie/player_failed
+execute if score $mini_type mem matches 6 run function mini:phantom/player_failed

+ 1 - 0
data/mini/functions/phantom/game/summon2.mcfunction

@@ -2,4 +2,5 @@
 execute as @e[tag=new_phantom] at @s run tp @s ~ 35 ~
 attribute @e[tag=new_phantom,limit=1] generic.max_health base set 4
 attribute @e[tag=new_phantom,limit=1] generic.attack_damage base set 1
+effect give @e[tag=new_phantom] instant_damage
 tag @e[tag=new_phantom] remove new_phantom

+ 5 - 1
data/mini/functions/phantom/game_end.mcfunction

@@ -1,2 +1,6 @@
+# 游戏结束
 forceload remove 1000 6000 1064 6064
-gamerule doDaylightCycle false
+gamerule doDaylightCycle false
+
+# 计算得分
+execute as @a[tag=!watcher,tag=!debug] run scoreboard players operation @s mini_score = @s kill_phantom

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

@@ -19,7 +19,7 @@ setblock 1032 5 6032 redstone_block
 # 清理残余实体
 kill @e[type=arrow]
 kill @e[type=item]
-kill @e[type=phantom]
+tp @e[type=phantom] 1000 -100 6000
 kill @e[type=trident]
 
 # 伤害管理

+ 1 - 0
data/mini/functions/phantom/player_enter.mcfunction

@@ -11,6 +11,7 @@ gamerule naturalRegeneration false
 
 # 计分板重置
 scoreboard players reset @s kill_phantom
+scoreboard players set @s[tag=!watcher,tag=!rejoining,tag=!debug] kill_phantom 0
 scoreboard players reset @s use_trident
 scoreboard players reset @s countdown
 

+ 3 - 0
data/mini/functions/phantom/player_failed.mcfunction

@@ -0,0 +1,3 @@
+# 玩家死亡时由玩家自己触发
+
+gamemode spectator