Prechádzať zdrojové kódy

修复土豆的提示

HerobrineXia 6 rokov pred
rodič
commit
77c5673fe2

+ 1 - 0
data/mini/functions/hotpm/game/pm_check.mcfunction

@@ -2,6 +2,7 @@
 execute if score $player_alive mem matches 6..8 run scoreboard players set $potato_count mem 3
 execute if score $player_alive mem matches 4..5 run scoreboard players set $potato_count mem 2
 execute if score $player_alive mem matches 2..3 run scoreboard players set $potato_count mem 1
+execute if score $player_alive mem matches 1 run scoreboard players set $potato_count mem 0
 
 # 计算当前土豆数量
 execute store result score $current_potato mem if entity @a[tag=pm_holding]

+ 1 - 1
data/mini/functions/hotpm/game/pm_give.mcfunction

@@ -3,7 +3,7 @@ scoreboard players reset @a temp
 execute as @a run scoreboard players operation @s temp = @s mini_heart
 execute as @a run scoreboard players operation @s temp *= #const_100 mem
 execute as @a run scoreboard players operation @s temp += @s total_score
-scoreboard players add @a[tag=pm_explode_last] temp 10000
+scoreboard players add @a[tag=!pm_explode_last] temp 10000
 
 # 寻找最高分
 tag @a[tag=!mini_running] add max_uncounted

+ 8 - 9
data/mini/functions/hotpm/player_lose_heart.mcfunction

@@ -1,17 +1,16 @@
 # 玩家失败时由玩家自己触发
 
-tellraw @a ["",{"text":">> ","color":"red","bold": true},{"selector":"@s","color":"red"}," 爆炸了!"]
-# 玩家失去土豆
-function mini:hotpm/game/pm_lost
-
+tellraw @a ["",{"text":">> ","color":"red","bold": true},{"selector":"@a[tag=pm_holding]","color":"red"}," 爆炸了!"]
 # 增加tag
-tag @s add pm_explode_last
-
+tag @a[tag=pm_holding] add pm_explode_last
 
 # 特效
-summon minecraft:creeper ~ ~-1 ~ {ignited:1,ExplosionRadius:1,Fuse:0,Invulnerable:1}
-particle minecraft:explosion ~ ~1 ~ 0.4 0.4 0.4 0 5
+execute at @a[tag=pm_holding] run summon minecraft:creeper ~ ~-1 ~ {ignited:1,ExplosionRadius:1,Fuse:0,Invulnerable:1}
+execute at @a[tag=pm_holding] run particle minecraft:explosion ~ ~1 ~ 0.4 0.4 0.4 0 5
 # 减少生命
-function mini:main/player_lose_heart
+execute as @a[tag=pm_holding] run function mini:main/player_lose_heart
+# 玩家失去土豆
+execute as @a[tag=pm_holding] run function mini:hotpm/game/pm_lost
+
 # 强制观战
 # execute at @s as @a[gamemode=spectator,distance=..0.1] run spectate @p[tag=pm_holding]

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

@@ -1,5 +1,5 @@
 # 爆炸
-execute if score $countdown_fast mem matches 0 as @a[tag=pm_holding] at @s run function mini:hotpm/player_lose_heart
+execute if score $countdown_fast mem matches 0 run function mini:hotpm/player_lose_heart
 
 # 检测土豆
 function mini:hotpm/game/pm_check