Przeglądaj źródła

color match修复bug尝试1

HerobrineXia 6 lat temu
rodzic
commit
57ab28b3c1

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

@@ -13,6 +13,9 @@ fill 1049 11 4025 1075 40 4025 stone
 scoreboard players set $color_match_round mem 0
 scoreboard players set $color_match_time mem 15
 
+# 设置模式为地板消失
+scoreboard players set $color_match_type mem 0
+
 # 刷新地基
 function mini:colormatch/prepare_round
 schedule function mini:colormatch/start_new_round 28t replace

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

@@ -3,5 +3,3 @@ scoreboard players set $floor_generate_part mem 0
 
 # 调用地板生成
 function mini:colormatch/generate_parts
-
-#

+ 27 - 27
data/mini/functions/colormatch/get_random_floor.mcfunction

@@ -1,35 +1,35 @@
 scoreboard players set $random_min mem 1
-scoreboard players set $random_max mem 25
+scoreboard players set $random_max mem 24
 function lib:random
 
 # TODO 更换地板方块-增强对比+辨识度
 # 随机选择不消失的方块
-execute positioned 1000 10 4000 run fill ~ ~1 ~ ~25 ~1 ~25 air replace
-execute positioned 1000 10 4000 if score $random mem matches 1 run clone ~ ~ ~ ~25 ~ ~25 ~ ~1 ~ filtered iron_block
-execute positioned 1000 10 4000 if score $random mem matches 2 run clone ~ ~ ~ ~25 ~ ~25 ~ ~1 ~ filtered white_concrete
-execute positioned 1000 10 4000 if score $random mem matches 3 run clone ~ ~ ~ ~25 ~ ~25 ~ ~1 ~ filtered quartz_block
-execute positioned 1000 10 4000 if score $random mem matches 4 run clone ~ ~ ~ ~25 ~ ~25 ~ ~1 ~ filtered snow_block
-execute positioned 1000 10 4000 if score $random mem matches 5 run clone ~ ~ ~ ~25 ~ ~25 ~ ~1 ~ filtered white_wool
-execute positioned 1000 10 4000 if score $random mem matches 6 run clone ~ ~ ~ ~25 ~ ~25 ~ ~1 ~ filtered gold_block
-execute positioned 1000 10 4000 if score $random mem matches 7 run clone ~ ~ ~ ~25 ~ ~25 ~ ~1 ~ filtered sponge
-execute positioned 1000 10 4000 if score $random mem matches 8 run clone ~ ~ ~ ~25 ~ ~25 ~ ~1 ~ filtered sandstone
-execute positioned 1000 10 4000 if score $random mem matches 9 run clone ~ ~ ~ ~25 ~ ~25 ~ ~1 ~ filtered yellow_concrete
-execute positioned 1000 10 4000 if score $random mem matches 10 run clone ~ ~ ~ ~25 ~ ~25 ~ ~1 ~ filtered end_stone
-execute positioned 1000 10 4000 if score $random mem matches 11 run clone ~ ~ ~ ~25 ~ ~25 ~ ~1 ~ filtered emerald_block
-execute positioned 1000 10 4000 if score $random mem matches 12 run clone ~ ~ ~ ~25 ~ ~25 ~ ~1 ~ filtered lime_concrete
-execute positioned 1000 10 4000 if score $random mem matches 13 run clone ~ ~ ~ ~25 ~ ~25 ~ ~1 ~ filtered melon
-execute positioned 1000 10 4000 if score $random mem matches 14 run clone ~ ~ ~ ~25 ~ ~25 ~ ~1 ~ filtered dark_prismarine
-execute positioned 1000 10 4000 if score $random mem matches 15 run clone ~ ~ ~ ~25 ~ ~25 ~ ~1 ~ filtered green_wool
-execute positioned 1000 10 4000 if score $random mem matches 16 run clone ~ ~ ~ ~25 ~ ~25 ~ ~1 ~ filtered diamond_block
-execute positioned 1000 10 4000 if score $random mem matches 17 run clone ~ ~ ~ ~25 ~ ~25 ~ ~1 ~ filtered prismarine
-execute positioned 1000 10 4000 if score $random mem matches 18 run clone ~ ~ ~ ~25 ~ ~25 ~ ~1 ~ filtered blue_ice
-execute positioned 1000 10 4000 if score $random mem matches 19 run clone ~ ~ ~ ~25 ~ ~25 ~ ~1 ~ filtered warped_wart_block
-execute positioned 1000 10 4000 if score $random mem matches 20 run clone ~ ~ ~ ~25 ~ ~25 ~ ~1 ~ filtered prismarine_bricks
-execute positioned 1000 10 4000 if score $random mem matches 21 run clone ~ ~ ~ ~25 ~ ~25 ~ ~1 ~ filtered red_wool
-execute positioned 1000 10 4000 if score $random mem matches 22 run clone ~ ~ ~ ~25 ~ ~25 ~ ~1 ~ filtered red_concrete
-execute positioned 1000 10 4000 if score $random mem matches 23 run clone ~ ~ ~ ~25 ~ ~25 ~ ~1 ~ filtered netherrack
-execute positioned 1000 10 4000 if score $random mem matches 24 run clone ~ ~ ~ ~25 ~ ~25 ~ ~1 ~ filtered red_nether_bricks
-execute positioned 1000 10 4000 if score $random mem matches 25 run clone ~ ~ ~ ~25 ~ ~25 ~ ~1 ~ filtered bricks
+execute positioned 1000 10 4000 run fill ~ ~1 ~ ~24 ~1 ~24 air replace
+execute positioned 1000 10 4000 if score $random mem matches 1 run clone ~ ~ ~ ~24 ~ ~24 ~ ~1 ~ filtered iron_block
+execute positioned 1000 10 4000 if score $random mem matches 2 run clone ~ ~ ~ ~24 ~ ~24 ~ ~1 ~ filtered white_concrete
+execute positioned 1000 10 4000 if score $random mem matches 3 run clone ~ ~ ~ ~24 ~ ~24 ~ ~1 ~ filtered quartz_block
+execute positioned 1000 10 4000 if score $random mem matches 4 run clone ~ ~ ~ ~24 ~ ~24 ~ ~1 ~ filtered snow_block
+execute positioned 1000 10 4000 if score $random mem matches 5 run clone ~ ~ ~ ~24 ~ ~24 ~ ~1 ~ filtered white_wool
+execute positioned 1000 10 4000 if score $random mem matches 6 run clone ~ ~ ~ ~24 ~ ~24 ~ ~1 ~ filtered gold_block
+execute positioned 1000 10 4000 if score $random mem matches 7 run clone ~ ~ ~ ~24 ~ ~24 ~ ~1 ~ filtered sponge
+execute positioned 1000 10 4000 if score $random mem matches 8 run clone ~ ~ ~ ~24 ~ ~24 ~ ~1 ~ filtered sandstone
+execute positioned 1000 10 4000 if score $random mem matches 9 run clone ~ ~ ~ ~24 ~ ~24 ~ ~1 ~ filtered yellow_concrete
+execute positioned 1000 10 4000 if score $random mem matches 10 run clone ~ ~ ~ ~24 ~ ~24 ~ ~1 ~ filtered end_stone
+execute positioned 1000 10 4000 if score $random mem matches 11 run clone ~ ~ ~ ~24 ~ ~24 ~ ~1 ~ filtered emerald_block
+execute positioned 1000 10 4000 if score $random mem matches 12 run clone ~ ~ ~ ~24 ~ ~24 ~ ~1 ~ filtered lime_concrete
+execute positioned 1000 10 4000 if score $random mem matches 13 run clone ~ ~ ~ ~24 ~ ~24 ~ ~1 ~ filtered melon
+execute positioned 1000 10 4000 if score $random mem matches 14 run clone ~ ~ ~ ~24 ~ ~24 ~ ~1 ~ filtered dark_prismarine
+execute positioned 1000 10 4000 if score $random mem matches 15 run clone ~ ~ ~ ~24 ~ ~24 ~ ~1 ~ filtered green_wool
+execute positioned 1000 10 4000 if score $random mem matches 16 run clone ~ ~ ~ ~24 ~ ~24 ~ ~1 ~ filtered diamond_block
+execute positioned 1000 10 4000 if score $random mem matches 17 run clone ~ ~ ~ ~24 ~ ~24 ~ ~1 ~ filtered prismarine
+execute positioned 1000 10 4000 if score $random mem matches 18 run clone ~ ~ ~ ~24 ~ ~24 ~ ~1 ~ filtered blue_ice
+execute positioned 1000 10 4000 if score $random mem matches 19 run clone ~ ~ ~ ~24 ~ ~24 ~ ~1 ~ filtered warped_wart_block
+execute positioned 1000 10 4000 if score $random mem matches 20 run clone ~ ~ ~ ~24 ~ ~24 ~ ~1 ~ filtered prismarine_bricks
+execute positioned 1000 10 4000 if score $random mem matches 21 run clone ~ ~ ~ ~24 ~ ~24 ~ ~1 ~ filtered red_wool
+execute positioned 1000 10 4000 if score $random mem matches 22 run clone ~ ~ ~ ~24 ~ ~24 ~ ~1 ~ filtered red_concrete
+execute positioned 1000 10 4000 if score $random mem matches 23 run clone ~ ~ ~ ~24 ~ ~24 ~ ~1 ~ filtered netherrack
+execute positioned 1000 10 4000 if score $random mem matches 24 run clone ~ ~ ~ ~24 ~ ~24 ~ ~1 ~ filtered red_nether_bricks
+execute positioned 1000 10 4000 if score $random mem matches 24 run clone ~ ~ ~ ~24 ~ ~24 ~ ~1 ~ filtered bricks
 
 # 存计分板
 scoreboard players operation $floor_next_round mem = $random mem

+ 8 - 0
data/mini/functions/colormatch/remove_ground.mcfunction

@@ -0,0 +1,8 @@
+# 去除地板
+execute positioned 1001 11 4000 run clone ~ ~ ~ ~24 ~ ~24 1050 15 4000
+
+# 告知玩家
+tellraw @a [{"text":">> ","color":"gold","bold": true},{"text":" 时间到!","color":"white","bold": false}]
+# 重置分数
+scoreboard players set $countdown mem 5
+scoreboard players set $color_match_type mem 1

+ 26 - 26
data/mini/functions/colormatch/show_block_amount.mcfunction

@@ -3,59 +3,59 @@ scoreboard objectives add block_count dummy
 
 # 获取分数
 tellraw @a [{"text":"本轮方块列表:","color":"gold"}]
-execute store result score block_count block_count positioned 1000 10 4000 run clone ~ ~ ~ ~25 ~ ~25 ~ ~1 ~ filtered iron_block
+execute store result score block_count block_count positioned 1000 10 4000 run clone ~ ~ ~ ~24 ~ ~24 ~ ~1 ~ filtered iron_block
 tellraw @a [{"text":"iron_block数量: ","color":"green"},{"score": {"objective": "block_count","name": "block_count"},"color":"white"}]
-execute store result score block_count block_count positioned 1000 10 4000 run clone ~ ~ ~ ~25 ~ ~25 ~ ~1 ~ filtered white_concrete
+execute store result score block_count block_count positioned 1000 10 4000 run clone ~ ~ ~ ~24 ~ ~24 ~ ~1 ~ filtered white_concrete
 tellraw @a [{"text":"white_concrete数量: ","color":"green"},{"score": {"objective": "block_count","name": "block_count"},"color":"white"}]
-execute store result score block_count block_count positioned 1000 10 4000 run clone ~ ~ ~ ~25 ~ ~25 ~ ~1 ~ filtered quartz_block
+execute store result score block_count block_count positioned 1000 10 4000 run clone ~ ~ ~ ~24 ~ ~24 ~ ~1 ~ filtered quartz_block
 tellraw @a [{"text":"quartz_block数量: ","color":"green"},{"score": {"objective": "block_count","name": "block_count"},"color":"white"}]
-execute store result score block_count block_count positioned 1000 10 4000 run clone ~ ~ ~ ~25 ~ ~25 ~ ~1 ~ filtered snow_block
+execute store result score block_count block_count positioned 1000 10 4000 run clone ~ ~ ~ ~24 ~ ~24 ~ ~1 ~ filtered snow_block
 tellraw @a [{"text":"snow_block数量: ","color":"green"},{"score": {"objective": "block_count","name": "block_count"},"color":"white"}]
-execute store result score block_count block_count positioned 1000 10 4000 run clone ~ ~ ~ ~25 ~ ~25 ~ ~1 ~ filtered white_wool
+execute store result score block_count block_count positioned 1000 10 4000 run clone ~ ~ ~ ~24 ~ ~24 ~ ~1 ~ filtered white_wool
 tellraw @a [{"text":"white_wool数量: ","color":"green"},{"score": {"objective": "block_count","name": "block_count"},"color":"white"}]
-execute store result score block_count block_count positioned 1000 10 4000 run clone ~ ~ ~ ~25 ~ ~25 ~ ~1 ~ filtered gold_block
+execute store result score block_count block_count positioned 1000 10 4000 run clone ~ ~ ~ ~24 ~ ~24 ~ ~1 ~ filtered gold_block
 tellraw @a [{"text":"gold_block数量: ","color":"green"},{"score": {"objective": "block_count","name": "block_count"},"color":"white"}]
-execute store result score block_count block_count positioned 1000 10 4000 run clone ~ ~ ~ ~25 ~ ~25 ~ ~1 ~ filtered sponge
+execute store result score block_count block_count positioned 1000 10 4000 run clone ~ ~ ~ ~24 ~ ~24 ~ ~1 ~ filtered sponge
 tellraw @a [{"text":"sponge数量: ","color":"green"},{"score": {"objective": "block_count","name": "block_count"},"color":"white"}]
-execute store result score block_count block_count positioned 1000 10 4000 run clone ~ ~ ~ ~25 ~ ~25 ~ ~1 ~ filtered sandstone
+execute store result score block_count block_count positioned 1000 10 4000 run clone ~ ~ ~ ~24 ~ ~24 ~ ~1 ~ filtered sandstone
 tellraw @a [{"text":"sandstone数量: ","color":"green"},{"score": {"objective": "block_count","name": "block_count"},"color":"white"}]
-execute store result score block_count block_count positioned 1000 10 4000 run clone ~ ~ ~ ~25 ~ ~25 ~ ~1 ~ filtered yellow_concrete
+execute store result score block_count block_count positioned 1000 10 4000 run clone ~ ~ ~ ~24 ~ ~24 ~ ~1 ~ filtered yellow_concrete
 tellraw @a [{"text":"yellow_concrete数量: ","color":"green"},{"score": {"objective": "block_count","name": "block_count"},"color":"white"}]
-execute store result score block_count block_count positioned 1000 10 4000 run clone ~ ~ ~ ~25 ~ ~25 ~ ~1 ~ filtered end_stone
+execute store result score block_count block_count positioned 1000 10 4000 run clone ~ ~ ~ ~24 ~ ~24 ~ ~1 ~ filtered end_stone
 tellraw @a [{"text":"end_stone数量: ","color":"green"},{"score": {"objective": "block_count","name": "block_count"},"color":"white"}]
-execute store result score block_count block_count positioned 1000 10 4000 run clone ~ ~ ~ ~25 ~ ~25 ~ ~1 ~ filtered emerald_block
+execute store result score block_count block_count positioned 1000 10 4000 run clone ~ ~ ~ ~24 ~ ~24 ~ ~1 ~ filtered emerald_block
 tellraw @a [{"text":"emerald_block数量: ","color":"green"},{"score": {"objective": "block_count","name": "block_count"},"color":"white"}]
-execute store result score block_count block_count positioned 1000 10 4000 run clone ~ ~ ~ ~25 ~ ~25 ~ ~1 ~ filtered lime_concrete
+execute store result score block_count block_count positioned 1000 10 4000 run clone ~ ~ ~ ~24 ~ ~24 ~ ~1 ~ filtered lime_concrete
 tellraw @a [{"text":"lime_concrete数量: ","color":"green"},{"score": {"objective": "block_count","name": "block_count"},"color":"white"}]
-execute store result score block_count block_count positioned 1000 10 4000 run clone ~ ~ ~ ~25 ~ ~25 ~ ~1 ~ filtered melon
+execute store result score block_count block_count positioned 1000 10 4000 run clone ~ ~ ~ ~24 ~ ~24 ~ ~1 ~ filtered melon
 tellraw @a [{"text":"melon数量: ","color":"green"},{"score": {"objective": "block_count","name": "block_count"},"color":"white"}]
-execute store result score block_count block_count positioned 1000 10 4000 run clone ~ ~ ~ ~25 ~ ~25 ~ ~1 ~ filtered dark_prismarine
+execute store result score block_count block_count positioned 1000 10 4000 run clone ~ ~ ~ ~24 ~ ~24 ~ ~1 ~ filtered dark_prismarine
 tellraw @a [{"text":"dark_prismarine数量: ","color":"green"},{"score": {"objective": "block_count","name": "block_count"},"color":"white"}]
-execute store result score block_count block_count positioned 1000 10 4000 run clone ~ ~ ~ ~25 ~ ~25 ~ ~1 ~ filtered green_wool
+execute store result score block_count block_count positioned 1000 10 4000 run clone ~ ~ ~ ~24 ~ ~24 ~ ~1 ~ filtered green_wool
 tellraw @a [{"text":"green_wool数量: ","color":"green"},{"score": {"objective": "block_count","name": "block_count"},"color":"white"}]
-execute store result score block_count block_count positioned 1000 10 4000 run clone ~ ~ ~ ~25 ~ ~25 ~ ~1 ~ filtered diamond_block
+execute store result score block_count block_count positioned 1000 10 4000 run clone ~ ~ ~ ~24 ~ ~24 ~ ~1 ~ filtered diamond_block
 tellraw @a [{"text":"diamond_block数量: ","color":"green"},{"score": {"objective": "block_count","name": "block_count"},"color":"white"}]
-execute store result score block_count block_count positioned 1000 10 4000 run clone ~ ~ ~ ~25 ~ ~25 ~ ~1 ~ filtered prismarine
+execute store result score block_count block_count positioned 1000 10 4000 run clone ~ ~ ~ ~24 ~ ~24 ~ ~1 ~ filtered prismarine
 tellraw @a [{"text":"prismarine数量: ","color":"green"},{"score": {"objective": "block_count","name": "block_count"},"color":"white"}]
-execute store result score block_count block_count positioned 1000 10 4000 run clone ~ ~ ~ ~25 ~ ~25 ~ ~1 ~ filtered blue_ice
+execute store result score block_count block_count positioned 1000 10 4000 run clone ~ ~ ~ ~24 ~ ~24 ~ ~1 ~ filtered blue_ice
 tellraw @a [{"text":"blue_ice数量: ","color":"green"},{"score": {"objective": "block_count","name": "block_count"},"color":"white"}]
-execute store result score block_count block_count positioned 1000 10 4000 run clone ~ ~ ~ ~25 ~ ~25 ~ ~1 ~ filtered warped_wart_block
+execute store result score block_count block_count positioned 1000 10 4000 run clone ~ ~ ~ ~24 ~ ~24 ~ ~1 ~ filtered warped_wart_block
 tellraw @a [{"text":"warped_wart_block数量: ","color":"green"},{"score": {"objective": "block_count","name": "block_count"},"color":"white"}]
-execute store result score block_count block_count positioned 1000 10 4000 run clone ~ ~ ~ ~25 ~ ~25 ~ ~1 ~ filtered prismarine_bricks
+execute store result score block_count block_count positioned 1000 10 4000 run clone ~ ~ ~ ~24 ~ ~24 ~ ~1 ~ filtered prismarine_bricks
 tellraw @a [{"text":"prismarine_bricks数量: ","color":"green"},{"score": {"objective": "block_count","name": "block_count"},"color":"white"}]
-execute store result score block_count block_count positioned 1000 10 4000 run clone ~ ~ ~ ~25 ~ ~25 ~ ~1 ~ filtered red_wool
+execute store result score block_count block_count positioned 1000 10 4000 run clone ~ ~ ~ ~24 ~ ~24 ~ ~1 ~ filtered red_wool
 tellraw @a [{"text":"red_wool数量: ","color":"green"},{"score": {"objective": "block_count","name": "block_count"},"color":"white"}]
-execute store result score block_count block_count positioned 1000 10 4000 run clone ~ ~ ~ ~25 ~ ~25 ~ ~1 ~ filtered red_concrete
+execute store result score block_count block_count positioned 1000 10 4000 run clone ~ ~ ~ ~24 ~ ~24 ~ ~1 ~ filtered red_concrete
 tellraw @a [{"text":"red_concrete数量: ","color":"green"},{"score": {"objective": "block_count","name": "block_count"},"color":"white"}]
-execute store result score block_count block_count positioned 1000 10 4000 run clone ~ ~ ~ ~25 ~ ~25 ~ ~1 ~ filtered netherrack
+execute store result score block_count block_count positioned 1000 10 4000 run clone ~ ~ ~ ~24 ~ ~24 ~ ~1 ~ filtered netherrack
 tellraw @a [{"text":"netherrack数量: ","color":"green"},{"score": {"objective": "block_count","name": "block_count"},"color":"white"}]
-execute store result score block_count block_count positioned 1000 10 4000 run clone ~ ~ ~ ~25 ~ ~25 ~ ~1 ~ filtered red_nether_bricks
+execute store result score block_count block_count positioned 1000 10 4000 run clone ~ ~ ~ ~24 ~ ~24 ~ ~1 ~ filtered red_nether_bricks
 tellraw @a [{"text":"red_nether_bricks数量: ","color":"green"},{"score": {"objective": "block_count","name": "block_count"},"color":"white"}]
-execute store result score block_count block_count positioned 1000 10 4000 run clone ~ ~ ~ ~25 ~ ~25 ~ ~1 ~ filtered bricks
+execute store result score block_count block_count positioned 1000 10 4000 run clone ~ ~ ~ ~24 ~ ~24 ~ ~1 ~ filtered bricks
 tellraw @a [{"text":"bricks数量: ","color":"green"},{"score": {"objective": "block_count","name": "block_count"},"color":"white"}]
 
 # 删除方块
-execute positioned 1000 10 4000 run fill ~ ~1 ~ ~25 ~1 ~25 air replace
+execute positioned 1000 10 4000 run fill ~ ~1 ~ ~24 ~1 ~24 air replace
 
 # 删除计分板
 scoreboard objectives remove block_count

+ 5 - 1
data/mini/functions/colormatch/start_new_round.mcfunction

@@ -1,13 +1,17 @@
 # 替换墙壁
 function mini:colormatch/replace_wall
 # 复制地板
-execute positioned 1000 10 4000 run clone ~ ~ ~ ~25 ~ ~25 1050 15 4000
+execute positioned 1001 10 4000 run clone ~ ~ ~ ~24 ~ ~24 1050 15 4000
+
 # 设置倒计时
 scoreboard players add $color_match_round mem 1
 execute if score $color_match_round mem matches 2 run scoreboard players remove $color_match_time mem 1
 execute if score $color_match_round mem matches 2 run scoreboard players set $color_match_round mem 0
 scoreboard players operation $countdown mem = $color_match_time mem
 
+# 重置分数
+scoreboard players set $color_match_type mem 0
+
 # TODO 告知玩家是啥方块
 # 告知玩家
 tellraw @a [{"text":">> ","color":"gold","bold": true},{"text":" 新的一轮开始了!","color":"white","bold": false}]

+ 3 - 1
data/mini/functions/colormatch/tick20.mcfunction

@@ -1,4 +1,6 @@
 # 每秒函数
-execute if score $countdown mem matches 0 run function mini:colormatch/start_new_round
+# 开新的一轮
+execute if score $countdown mem matches 0 if score $color_match_type mem matches 0 run function mini:colormatch/remove_ground
+execute if score $countdown mem matches 0 if score $color_match_type mem matches 1 run function mini:colormatch/start_new_round
 
 # TODO 显示当前剩余秒数

+ 3 - 3
data/mini/functions/colormatch/tick4.mcfunction

@@ -1,3 +1,3 @@
-execute as @a[tag=mini_running] at @s if block ~ ~ ~ lava run function mini:tntrun/player_failed
-execute as @a[tag=mini_running] at @s if block ~ ~-1 ~ lava run function mini:tntrun/player_failed
-execute as @a[tag=mini_running] at @s if block ~ ~-2 ~ lava run function mini:tntrun/player_failed
+execute as @a[tag=mini_running] at @s if block ~ ~ ~ lava run function mini:colormatch/player_failed
+execute as @a[tag=mini_running] at @s if block ~ ~-1 ~ lava run function mini:colormatch/player_failed
+execute as @a[tag=mini_running] at @s if block ~ ~-2 ~ lava run function mini:colormatch/player_failed