Преглед на файлове

将下界之星转换为得分

LTCatt преди 5 години
родител
ревизия
b1684f83eb

+ 1 - 1
data/mini/functions/trade/game/paper_show.mcfunction

@@ -5,5 +5,5 @@ clear @s paper{game_item:1b}
 execute if data entity @s Inventory[{Slot:8b}] run scoreboard players set @s item_slot 8
 execute if data entity @s Inventory[{Slot:8b}] at @s run function item:pop_slot/return_item
 
-# 给予tnt显示
+# 设置最后一格的物品
 replaceitem entity @s hotbar.8 paper{game_item:1b,display:{Name:'[{"text":"交易之纸","color":"aqua","italic":false}]',Lore:['[{"text":"奇物, 珍稀","italic":true,"color":"gray"}]','[{"color":"white","italic":false,"text":"在你握持该纸时, 一位村民"},{"text":" villager ","italic":true},{"color":"white","italic":false,"text":"将会出现在你周围 10 尺内"}]','[{"color":"white","italic":false,"text":"的一处尚未被占据的区域, 直到你不握持该纸时, 它会使用以"}]','[{"color":"white","italic":false,"text":"太化"},{"text":" etherealness ","color":"white","italic":true},{"color":"white","italic":false,"text":"进入以太位面并消失。"}]','[{"color":"white","italic":false,"text":"该村民被永久的浮空术"},{"text":" levitate ","color":"white","italic":true},{"color":"white","italic":false,"text":"影响, 且持续保持在与你相同"}]','[{"color":"white","italic":false,"text":"的高度。你可以穿过它所占据的空间, 且可以与它进行交易, 不"}]','[{"color":"white","italic":false,"text":"过对它的攻击会自动失手。它会通过所有豁免检定, 并且免疫所"}]','[{"color":"white","italic":false,"text":"有的伤害和异常状态。"}]']}}

+ 5 - 5
data/mini/functions/trade/game_start.mcfunction

@@ -1,11 +1,11 @@
-scoreboard players set $countdown mem 250
 
-# HUD
-scoreboard objectives setdisplay list health_disp
-scoreboard objectives setdisplay belowName health_disp
+# HUD 与倒计时
+scoreboard objectives setdisplay list total_score_disp
+scoreboard objectives setdisplay belowName emerald
 scoreboard objectives setdisplay sidebar emerald
 scoreboard players set $bossbar_color mem 4
-scoreboard players set $countdown_max mem 250
+scoreboard players set $countdown_max mem 270
+scoreboard players set $countdown mem 270
 scoreboard players set $bossbar_type mem 2
 function lib:bossbar/show
 bossbar set mini:red name "剩余时间"

+ 8 - 0
data/mini/functions/trade/tick20.mcfunction

@@ -17,3 +17,11 @@ execute if score $countdown mem matches 0 run function mini:main/game_end
 # 回复生命值
 execute if score $foursec mem matches 1 run effect give @a[team=playing] regeneration 1 10 true
 execute if score $foursec mem matches 1 run schedule function mini:trade/game/clear_effect 1t replace
+
+# 更新下界之星,转换为得分
+scoreboard players reset * temp2
+execute as @a[team=playing] store result score @s temp2 run clear @s nether_star 0
+execute as @a[scores={temp2=1..}] run scoreboard players operation @s total_score += @s temp2
+execute as @a[scores={temp2=1..}] run scoreboard players operation @s total_score_disp += @s temp2
+execute as @a[scores={temp2=1..}] run tellraw @a ["",{"text": ">> ","color":"aqua","bold": true},{"selector": "@s","color":"aqua"}," 从交易中获得了 ",{"score": {"name":"@s","objective": "temp2"},"color":"aqua"},{"text": " 分","color":"aqua"},", 当前共有 ",{"score": {"name": "@s","objective": "total_score"}}, " 分"]
+clear @a[team=playing] nether_star

+ 8 - 8
data/mini/loot_tables/trade_s.json

@@ -83,7 +83,7 @@
                                 },
                                 {
                                     "function": "set_nbt",
-                                    "tag":"{sell:{id:\"iron_ingot\",Count:2}}"
+                                    "tag":"{sell:{id:\"iron_ingot\",Count:3}}"
                                 },
                                 {
                                     "function": "set_nbt",
@@ -109,7 +109,7 @@
                             "functions": [
                                 {
                                     "function": "set_nbt",
-                                    "tag": "{buy:{id:\"emerald\",Count:6}}"
+                                    "tag": "{buy:{id:\"emerald\",Count:4}}"
                                 },
                                 {
                                     "function": "set_nbt",
@@ -139,11 +139,11 @@
                             "functions": [
                                 {
                                     "function": "set_nbt",
-                                    "tag": "{buy:{id:\"emerald\",Count:5}}"
+                                    "tag": "{buy:{id:\"emerald\",Count:4}}"
                                 },
                                 {
                                     "function": "set_nbt",
-                                    "tag":"{sell:{id:\"oak_planks\",Count:12}}"
+                                    "tag":"{sell:{id:\"oak_log\",Count:4}}"
                                 },
                                 {
                                     "function": "set_nbt",
@@ -157,7 +157,7 @@
                                         "condition": "minecraft:entity_properties",
                                         "entity": "this",
                                         "predicate": {
-                                            "nbt": "{Offers:{Recipes:[{sell:{id:\"minecraft:oak_planks\"}}]}}"
+                                            "nbt": "{Offers:{Recipes:[{sell:{id:\"minecraft:oak_log\"}}]}}"
                                         }
                                     }
                                 }
@@ -169,11 +169,11 @@
                             "functions": [
                                 {
                                     "function": "set_nbt",
-                                    "tag": "{buy:{id:\"emerald\",Count:18}}"
+                                    "tag": "{buy:{id:\"emerald\",Count:4}}"
                                 },
                                 {
                                     "function": "set_nbt",
-                                    "tag":"{sell:{id:\"nether_star\",Count:1,tag:{display:{Name:'{\"text\":\"得分 +1\",\"color\":\"white\",\"italic\":false}'}}}}"
+                                    "tag":"{sell:{id:\"cobblestone\",Count:8}}"
                                 },
                                 {
                                     "function": "set_nbt",
@@ -187,7 +187,7 @@
                                         "condition": "minecraft:entity_properties",
                                         "entity": "this",
                                         "predicate": {
-                                            "nbt": "{Offers:{Recipes:[{buy:{id:\"minecraft:emerald\"},sell:{id:\"minecraft:nether_star\"}}]}}"
+                                            "nbt": "{Offers:{Recipes:[{sell:{id:\"minecraft:cobblestone\"}}]}}"
                                         }
                                     }
                                 }