瀏覽代碼

修复土豆测试

HerobrineXia 6 年之前
父節點
當前提交
c6a0c87c3d

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

@@ -24,6 +24,7 @@ gamemode adventure @s[tag=!watcher,tag=!rejoining]
 
 # 设置玩家生命数量
 scoreboard players set @s mini_heart 3
+function mini:main/player_max_health
 
 # 3秒后给予土豆
 execute if entity @s[tag=!watcher,tag=!rejoining] run schedule function mini:hotpm/pm_init_first 3s replace

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

@@ -2,7 +2,7 @@
 function mini:hotpm/pm_lost
 #记录位置
 execute at @s run summon minecraft:area_effect_cloud ~ ~ ~ {Tags:["pm_boom"]}
-#去除tag
+#减少生命
 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

+ 4 - 1
data/mini/functions/hotpm/pm_get.mcfunction

@@ -5,4 +5,7 @@ effect clear @s speed
 effect clear @s jump_boost
 effect give @s glowing 1000000 0 true
 effect give @s speed 1000000 1 true
-effect give @s jump_boost 1000000 2 true
+effect give @s jump_boost 1000000 2 true
+
+# 告知玩家
+tellraw @a [{"text":">> ","color":"gold","bold": true},{"selector":"@s","color":"yellow","bold":false},{"text":" 获得了土豆!","color":"white","bold":false}]

+ 0 - 3
data/mini/functions/hotpm/pm_init.mcfunction

@@ -3,9 +3,6 @@ execute at @s as @a[sort=furthest,tag=mini_running,tag=!watcher,limit=1] run fun
 # 强制观战
 execute at @s as @a[gamemode=spectator,distance=..0.1] run spectate @p[tag=pm_hoding]
 
-# 告知玩家
-tellraw @a [{"text":">> ","color":"gold","bold": true},{"selector":"@a[tag=pm_hoding]","color":"yellow","bold":false},{"text":" 获得了土豆!","color":"white","bold":false}]
-
 # 土豆爆炸时间 = 5 * (存活人数 + 1)
 scoreboard players set $countdown mem 5
 execute as @a[tag=mini_running] run scoreboard players add $countdown mem 5

+ 4 - 2
data/mini/functions/hotpm/pm_lost.mcfunction

@@ -1,8 +1,10 @@
 # 玩家失去土豆时执行
 tag @s remove pm_hoding
-
 effect clear @s glowing
 effect clear @s speed
 effect clear @s jump_boost
 effect give @s speed 3 1 true
-effect give @s jump_boost 2 1 true
+effect give @s jump_boost 2 1 true
+
+# 告知玩家
+tellraw @a [{"text":">> ","color":"gold","bold": true},{"selector":"@s","color":"yellow","bold": false},{"text":"爆炸了!","color":"white","bold": false}]

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

@@ -23,5 +23,8 @@ execute as @a[tag=!mini_rank1,tag=!mini_rank2] unless entity @a[tag=mini_rank3]
 # 4
 tag @a[tag=!mini_rank1,tag=!mini_rank2,tag=!mini_rank3,tag=!watcher] add mini_rank4
 
+# 重置玩家血量上限
+execute as @a run attribute @s generic.max_health base set 20
+
 # 进入状态 6
 function ltw:state/6/state_enter