Procházet zdrojové kódy

color match测试2

HerobrineXia před 6 roky
rodič
revize
23bf3fabc6

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

@@ -1,6 +1,9 @@
 # 结束 TNT Run
 forceload remove 1001 4000 1075 4025
 
+# 移除tag
+tag @a remove color_match_fall
+
 # 开启伤害
 gamerule fallDamage true
 gamerule fireDamage true

+ 1 - 0
data/mini/functions/colormatch/game_init.mcfunction

@@ -8,6 +8,7 @@ fill 1075 11 3999 1075 40 4025 stone
 fill 1075 11 3999 1049 40 3999 stone
 fill 1049 11 3999 1049 40 4025 stone
 fill 1049 11 4025 1075 40 4025 stone
+fill 1074 30 4024 1050 30 4000 barrier
 
 # 设置分数
 scoreboard players set $color_match_round mem 0

+ 3 - 0
data/mini/functions/colormatch/player_enter.mcfunction

@@ -2,6 +2,9 @@
 gamemode creative
 title @s clear
 
+# 重置tag
+tag @s remove color_match_fall
+
 # 状态效果
 effect clear @s
 effect give @s saturation 1000000 0 true

+ 4 - 0
data/mini/functions/colormatch/player_failed.mcfunction

@@ -3,3 +3,7 @@ tellraw @a [{"text":">> ","color":"gold","bold": true},{"selector":"@s","color":
 
 # 失去一颗心
 function mini:main/player_lose_heart
+
+# 给与本轮无敌
+execute if entity @s[tag=mini_running] run tp @s ~ 35 ~
+execute if entity @s[tag=mini_running] run tag @s add color_match_fall

+ 4 - 0
data/mini/functions/colormatch/start_new_round.mcfunction

@@ -12,6 +12,10 @@ scoreboard players operation $countdown mem = $color_match_time mem
 # 重置分数
 scoreboard players set $color_match_type mem 0
 
+# 将玩家拉下屏障
+execute as @a[tag=color_match_fall] at @s run tp @s ~ 20 ~
+tag @a[tag=color_match_fall] remove color_match_fall
+
 # TODO 告知玩家是啥方块
 # 告知玩家
 tellraw @a [{"text":">> ","color":"gold","bold": true},{"text":" 新的一轮开始了!","color":"white","bold": false}]