Sfoglia il codice sorgente

修复测试方法

LTCatt 6 anni fa
parent
commit
33835df66f

+ 5 - 12
data/ltw/functions/state/0/start_gameparty.mcfunction

@@ -1,15 +1,8 @@
-# 尝试开始小游戏模式
+# 开始小游戏模式
 
-# 计算玩家数量
-execute store result score $count mem if entity @a[tag=hub_gameparty]
-
-# 根据玩家数量判定
-execute if score $count mem matches ..2 run tellraw @a [{"text": "需要至少 3 人以开始小游戏模式, 当前仅有 ","color":"red"},{"score": { "name": "$count","objective": "mem"}}, " 人!"]
-execute if score $count mem matches 9.. run tellraw @a [{"text": "小游戏模式最多支持 8 人, 当前已有 ","color":"red"},{"score": { "name": "$count","objective": "mem"}}, " 人!"]
-
-# 判断旁观
-execute if score $count mem matches 3..8 run tag @a remove watcher
-execute if score $count mem matches 3..8 run tag @a[tag=!hub_gameparty] add watcher
+# 设置旁观
+tag @a remove watcher
+tag @a[tag=!hub_gameparty] add watcher
 
 # 设置数据
 scoreboard players reset * total_score
@@ -20,4 +13,4 @@ scoreboard players add $ game_id 1
 scoreboard players operation @a game_id = $ game_id
 
 # 开始小游戏
-execute if score $count mem matches 3..8 run function ltw:state/3/state_enter
+function ltw:state/3/state_enter

+ 0 - 0
data/ltw/functions/state/0/start_classic.mcfunction → data/ltw/functions/state/0/try_start_classic.mcfunction


+ 11 - 0
data/ltw/functions/state/0/try_start_gameparty.mcfunction

@@ -0,0 +1,11 @@
+# 尝试开始小游戏模式
+
+# 计算玩家数量
+execute store result score $count mem if entity @a[tag=hub_gameparty]
+
+# 根据玩家数量判定
+execute if score $count mem matches ..2 run tellraw @a [{"text": "需要至少 3 人以开始小游戏模式, 当前仅有 ","color":"red"},{"score": { "name": "$count","objective": "mem"}}, " 人!"]
+execute if score $count mem matches 9.. run tellraw @a [{"text": "小游戏模式最多支持 8 人, 当前已有 ","color":"red"},{"score": { "name": "$count","objective": "mem"}}, " 人!"]
+
+# 判断旁观
+execute if score $count mem matches 3..8 run function ltw:state/0/start_gameparty

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

@@ -8,7 +8,6 @@ effect give @s saturation 1000000 0 true
 effect give @s instant_health 10 0 true
 effect give @s night_vision 1000000 0 true
 effect give @s resistance 1000000 4 true
-effect give @s slow_falling 1000000 0 true
 
 # 传送玩家
 tp @s[tag=!watcher,tag=!rejoining] 1062 16.5 4012
@@ -24,4 +23,3 @@ function mini:main/player_max_health
 # 重新加入处理
 execute if entity @s[tag=rejoining] run function mini:hotpm/player_lose_heart
 # TODO 旁观者应该直接让生命值清零
-# TODO 测试方法存在问题……等我修(龙猫

+ 2 - 1
data/mini/functions/colormatch/player_lose_heart.mcfunction

@@ -5,4 +5,5 @@ 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 ~ 17.5 ~
+execute if entity @s[tag=mini_running] run tp @s ~ 16.5 ~
+effect give @s levitation 5 255

+ 3 - 0
data/test/functions/back_to_hub.mcfunction

@@ -0,0 +1,3 @@
+# 测试用:回到主大厅
+
+function ltw:state/0/state_enter

+ 1 - 1
data/test/functions/start_colormatch.mcfunction → data/test/functions/mini/colormatch.mcfunction

@@ -1,6 +1,6 @@
 # 测试用:快速开始 Color Match
-tag @a remove watcher
 function ltw:state/0/start_gameparty
+tag @a remove watcher
 scoreboard players set $round mem 100
 scoreboard players set $mini_type mem 4
 function mini:main/game_init

+ 1 - 2
data/test/functions/start_hotpm.mcfunction → data/test/functions/mini/hotpm.mcfunction

@@ -1,7 +1,6 @@
 # 测试用:快速开始 Hot Potato
-
-tag @a remove watcher
 function ltw:state/0/start_gameparty
+tag @a remove watcher
 scoreboard players set $round mem 100
 scoreboard players set $mini_type mem 3
 function mini:main/game_init

+ 1 - 2
data/test/functions/start_parkour.mcfunction → data/test/functions/mini/parkour.mcfunction

@@ -1,7 +1,6 @@
 # 测试用:快速开始跑酷
-
-tag @a remove watcher
 function ltw:state/0/start_gameparty
+tag @a remove watcher
 scoreboard players set $round mem 100
 scoreboard players set $mini_type mem 1
 function mini:main/game_init

+ 1 - 2
data/test/functions/start_tntrun.mcfunction → data/test/functions/mini/tntrun.mcfunction

@@ -1,7 +1,6 @@
 # 测试用:快速开始 TNT Run
-
-tag @a remove watcher
 function ltw:state/0/start_gameparty
+tag @a remove watcher
 scoreboard players set $round mem 100
 scoreboard players set $mini_type mem 2
 function mini:main/game_init

+ 4 - 0
data/test/functions/start_gameparty.mcfunction

@@ -0,0 +1,4 @@
+# 测试用:已强制开始小游戏模式,且忽略旁观
+function ltw:state/0/start_gameparty
+tag @a remove watcher
+say 已强制开始小游戏模式!

+ 0 - 7
data/test/functions/start_random.mcfunction

@@ -1,7 +0,0 @@
-# 测试用:快速开始随机小游戏
-
-tag @a remove watcher
-function ltw:state/3/state_enter
-function ltw:state/4/state_enter
-scoreboard players set $countdown mem 5
-say 已开始随机小游戏!