aqupa 4 năm trước cách đây
mục cha
commit
d2d63ec352

+ 1 - 0
data/mini/functions/rgb/game/check_conditions.mcfunction

@@ -1,5 +1,6 @@
 # 位置相关
 execute as @e[type=marker,tag=rgb_rule,nbt={data:{enable:1b,conditions:[{type:"on_air"}]}}] run function mini:rgb/game/conditions/on_air
+execute as @e[type=marker,tag=rgb_rule,nbt={data:{enable:1b,conditions:[{type:"on_ground"}]}}] run function mini:rgb/game/conditions/on_ground
 execute as @e[type=marker,tag=rgb_rule,nbt={data:{enable:1b,conditions:[{type:"in_water"}]}}] run function mini:rgb/game/conditions/in_water
 execute as @e[type=marker,tag=rgb_rule,nbt={data:{enable:1b,conditions:[{type:"on_pumpkin"}]}}] run function mini:rgb/game/conditions/on_pumpkin
 

+ 13 - 0
data/mini/functions/rgb/game/conditions/on_ground.mcfunction

@@ -0,0 +1,13 @@
+# as rule marker
+# 站在地面 value/4 秒
+# 离开地面自动归零
+
+execute store result score #temp_scr rgb_sys run data get entity @s data.player.conditions.on_ground
+scoreboard players set #temp rgb_sys 0
+execute store success score #temp rgb_sys if entity @a[tag=rgb_op,nbt={OnGround:1b}] run scoreboard players add #temp_scr rgb_sys 1
+execute if score #temp rgb_sys matches 0 run scoreboard players set #temp_scr rgb_sys 0
+
+execute store result score #temp rgb_sys run data get entity @s data.conditions[{type:"on_ground"}].value
+execute if score #temp_scr rgb_sys < #temp rgb_sys run data modify entity @s data.enable set value 0
+
+execute store result entity @s data.player.conditions.on_ground short 1 run scoreboard players get #temp_scr rgb_sys

+ 3 - 0
data/mini/functions/rgb/game/events/effect.mcfunction

@@ -0,0 +1,3 @@
+# as rule marker
+# with rgb_op
+

+ 4 - 0
data/mini/functions/rgb/game/events/place_tnt.mcfunction

@@ -0,0 +1,4 @@
+# as rule marker
+# with rgb_op
+
+execute as @a[tag=rgb_op] at @s run setblock ~ ~-1 ~ tnt

+ 4 - 0
data/mini/functions/rgb/game/handle_event.mcfunction

@@ -9,8 +9,12 @@ execute if data entity @s data.events[{type:"set_red"}] run function mini:rgb/ga
 execute if data entity @s data.events[{type:"set_green"}] run function mini:rgb/game/events/set_green
 execute if data entity @s data.events[{type:"set_blue"}] run function mini:rgb/game/events/set_blue
 
+# 效果事件
+execute if data entity @s data.events[{type:"effect"}] run function mini:rgb/game/events/effect
+
 # 方块事件
 execute if data entity @s data.events[{type:"place_air"}] run function mini:rgb/game/events/place_air
+execute if data entity @s data.events[{type:"place_tnt"}] run function mini:rgb/game/events/place_tnt
 
 # 完成游戏
 execute if data entity @s data.events[{type:"finish"}] run function mini:rgb/game/events/finish

+ 1 - 1
data/mini/functions/rgb/tick20.mcfunction

@@ -1,6 +1,6 @@
 # 切换计分板显示
 scoreboard players add $scb_switch rgb_sys 1
-execute if score $scb_switch rgb_sys matches 6.. run scoreboard players set $scb_switch rgb_sy 0
+execute if score $scb_switch rgb_sys matches 6.. run scoreboard players set $scb_switch rgb_sys 0
 
 execute if score $scb_switch rgb_sys matches 0..1 run scoreboard objectives setdisplay sidebar rgb_R
 execute if score $scb_switch rgb_sys matches 2..3 run scoreboard objectives setdisplay sidebar rgb_G

+ 12 - 1
data/mini/loot_tables/rgb/effect.json

@@ -10,7 +10,18 @@
                     "functions": [
                         {
                             "function": "minecraft:set_nbt",
-                            "tag": "{conditions:[{name:'{\"text\":\"R≥10\",\"color\":\"red\"}',type:'red_ge',value:10s}],events:[{name:'{\"text\":\"脚下方块消失\",\"color\":\"yellow\"}',type:'eff_float',value:3s}]}"
+                            "tag": "{conditions:[{name:'{\"text\":\"R≥5\",\"color\":\"red\"}',type:'red_ge',value:20s},{name:'{\"text\":\"站在地上\",\"color\":\"yellow\"}',type:'on_ground',value:1s}],events:[{name:'{\"text\":\"脚下方块变为TNT\",\"color\":\"yellow\"}',type:'place_tnt'},{name:'{\"text\":\"R-1\",\"color\":\"red\"}'}]}"
+                        }
+                    ]
+                },
+                {
+                    "type": "minecraft:item",
+                    "name": "minecraft:armor_stand",
+                    "weight": 1,
+                    "functions": [
+                        {
+                            "function": "minecraft:set_nbt",
+                            "tag": "{conditions:[{name:'{\"text\":\"G<5\",\"color\":\"green\"}',type:'green_l',value:5s},{name:'{\"text\":\"站在地上\",\"color\":\"yellow\"}',type:'on_ground',value:1s}],events:[{name:'{\"text\":\"漂浮5秒\",\"color\":\"yellow\"}',type:'effect',value:'float_lvl1_5s'},{name:'{\"text\":\"G+1\",\"color\":\"green\"}'}]}"
                         }
                     ]
                 }