ソースを参照

Merge branch 'master' of github.com:LTCatt/LTW3

HerobrineXia 5 年 前
親
コミット
74761b11db

+ 1 - 1
data/item/functions/bonus_item/add_score.mcfunction

@@ -1,5 +1,5 @@
 #as player
-execute store result score #bonus_add_score mem run data get block 0 0 0 RecordItem.tag.bonus_add_score
+execute store result score #bonus_add_score mem run data get storage item:bouns item.tag.bonus_add_score
 
 # 正常的加分
 execute if score #bonus_add_score mem matches ..10 run scoreboard players operation @s total_score += #bonus_add_score mem

+ 4 - 0
data/item/functions/bonus_item/bonus_item_tag.json

@@ -9,5 +9,9 @@
     "bonus_give_items":[
         {"id":"minecraft:stone","Count":64,"tag":{"is_bonus":true,"display":{"Name":"\"普通的石头\""}}},
         {"id":"minecraft:arrow","Count":64,"tag":{"is_bonus":true}}
+    ],
+    "bonus_random_bounds":[
+        {"type":"normal","level":"white","count":2},
+        {"type":"score","level":"green","count":1}
     ]
 }

+ 4 - 19
data/item/functions/bonus_item/call.mcfunction

@@ -1,24 +1,9 @@
 # 当玩家拾取到奖励物品时触发
 # as player
 
-# 将玩家拾取到的原物品替换到原点的唱片机里
-data modify block 0 0 0 RecordItem set from entity @s Inventory[{"tag":{"bonus_new":1b}}]
+# 获取玩家待处理奖励物品列表
+data modify storage item:bouns item_buff set value []
+data modify storage item:bouns item_buff append from entity @s Inventory[{"tag":{"bonus_new":1b}}]
 clear @s #item:bonus{"bonus_new":1b}
 
-# 播放音效
-function lib:sounds/hit
-
-# 显示拾取提示(获得得分的提示由 add_score 显示)
-execute unless data block 0 0 0 RecordItem.tag.bonus_add_score run tellraw @a ["",{"text": ">> ","color":"aqua","bold": true},{"selector": "@s","color":"aqua"}," 获得了 ",{"nbt": "RecordItem.tag.item_name","block": "0 0 0","interpret": true}]
-
-# 如果有 return 标签则退回物品(最先执行)
-execute if data block 0 0 0 RecordItem.tag{"bonus_return":1b} run function item:bonus_item/return_item
-
-# 如果有 add_score 标签则增加积分
-execute if data block 0 0 0 RecordItem.tag.bonus_add_score run function item:bonus_item/add_score
-
-# 如果有 give_items 标签则给予物品
-execute if data block 0 0 0 RecordItem.tag.bonus_give_items[0] run function item:bonus_item/give_items
-
-# 执行特定函数
-execute if score $state mem matches 7 run function item:bonus_item/pickup_1
+execute if data storage item:bouns item_buff[0] run function item:bonus_item/call_each

+ 27 - 0
data/item/functions/bonus_item/call_each.mcfunction

@@ -0,0 +1,27 @@
+# 处理单个奖励物品
+# as player
+
+# 获取当前物品
+data modify storage item:bouns item set from storage item:bouns item_buff[0]
+data remove storage item:bouns item_buff[0]
+
+# 播放音效
+function lib:sounds/hit
+
+# 显示拾取提示(获得得分的提示由 add_score 显示,获得随机物品则该物品不显示)
+execute unless data storage item:bouns item.tag.bonus_add_score unless data storage item:bouns item.tag.bonus_random_bounds[0] run tellraw @a ["",{"text": ">> ","color":"aqua","bold": true},{"selector": "@s","color":"aqua"}," 获得了 ",{"nbt": "item.tag.item_name","storage":"item:bouns","interpret": true}]
+
+# 如果有 return 标签则退回物品(最先执行)
+execute if data storage item:bouns item.tag{"bonus_return":1b} run function item:bonus_item/return_item
+
+# 如果有 add_score 标签则增加积分
+execute if data storage item:bouns item.tag.bonus_add_score run function item:bonus_item/add_score
+
+# 如果有 give_items 标签则给予物品
+execute if data storage item:bouns item.tag.bonus_give_items[0] run function item:bonus_item/give_items
+
+# 如果有 random_bounds 标签则返还随机物品
+execute if data storage item:bouns item.tag.bonus_random_bounds[0] run function item:bonus_item/random_bounds
+
+# 执行特定函数
+execute if score $state mem matches 7 run function item:bonus_item/pickup_1

+ 5 - 5
data/item/functions/bonus_item/give_items.mcfunction

@@ -1,9 +1,9 @@
 #as player
-setblock 0 0 1 jukebox replace
-data modify block 0 0 1 RecordItem set from block 0 0 0 RecordItem.tag.bonus_give_items[0]
-setblock 0 0 1 air destroy
+setblock 0 0 0 jukebox replace
+data modify block 0 0 0 RecordItem set from storage item:bouns item.tag.bonus_give_items[0]
+setblock 0 0 0 air destroy
 tag @s add item_op
 execute as @e[tag=!bonus_old,tag=!item_new,type=item,nbt={"Item":{"tag":{"is_bonus":1b}}},limit=1] run function item:bonus_item/tp
 tag @s remove item_op
-data remove block 0 0 0 RecordItem.tag.bonus_give_items[0]
-execute if data block 0 0 0 RecordItem.tag.bonus_give_items[0] run function item:bonus_item/give_items
+data remove storage item:bouns item.tag.bonus_give_items[0]
+execute if data storage item:bouns item.tag.bonus_give_items[0] run function item:bonus_item/give_items

+ 8 - 0
data/item/functions/bonus_item/random_bounds.mcfunction

@@ -0,0 +1,8 @@
+#as player
+setblock 0 0 1 shulker_box replace
+data modify storage item:bonus random_bounds set from storage item:bouns item.tag.bonus_random_bounds[0]
+data remove storage item:bouns item.tag.bonus_random_bounds[0]
+execute store result score $item.random.count mem run data get storage item:bonus random_bounds.count
+execute if score $item.random.count mem matches 1.. if data storage item:bonus random_bounds{"type":"normal"} run function item:bonus_item/random_normal
+execute if score $item.random.count mem matches 1.. if data storage item:bonus random_bounds{"type":"score"} run function item:bonus_item/random_score
+execute if data storage item:bouns item.tag.bonus_random_bounds[0] run function item:bonus/random_bounds

+ 8 - 0
data/item/functions/bonus_item/random_normal.mcfunction

@@ -0,0 +1,8 @@
+#as player
+scoreboard players remove $item.random.count mem 1
+execute if data storage item:bonus random_bounds{"level":"white"} run loot replace block 0 0 1 container.0 loot item:gameparty/normal/white
+execute if data storage item:bonus random_bounds{"level":"green"} run loot replace block 0 0 1 container.0 loot item:gameparty/normal/green
+execute if data storage item:bonus random_bounds{"level":"blue"} run loot replace block 0 0 1 container.0 loot item:gameparty/normal/blue
+execute if data storage item:bonus random_bounds{"level":"purple"} run loot replace block 0 0 1 container.0 loot item:gameparty/normal/purple
+data modify storage item:bouns item_buff prepend from block 0 0 1 Items[{"Slot":0b}]
+execute if score $item.random.count mem matches 1.. run function item:bonus_item/random_normal

+ 8 - 0
data/item/functions/bonus_item/random_score.mcfunction

@@ -0,0 +1,8 @@
+#as player
+scoreboard players remove $item.random.count mem 1
+execute if data storage item:bonus random_bounds{"level":"white"} run loot replace block 0 0 1 container.0 loot item:gameparty/score/white
+execute if data storage item:bonus random_bounds{"level":"green"} run loot replace block 0 0 1 container.0 loot item:gameparty/score/green
+execute if data storage item:bonus random_bounds{"level":"blue"} run loot replace block 0 0 1 container.0 loot item:gameparty/score/blue
+execute if data storage item:bonus random_bounds{"level":"purple"} run loot replace block 0 0 1 container.0 loot item:gameparty/score/purple
+data modify storage item:bouns item_buff prepend from block 0 0 1 Items[{"Slot":0b}]
+execute if score $item.random.count mem matches 1.. run function item:bonus_item/random_score

+ 4 - 4
data/item/functions/bonus_item/return_item.mcfunction

@@ -1,7 +1,7 @@
-setblock 0 0 1 jukebox replace
-data modify block 0 0 1 RecordItem set from block 0 0 0 RecordItem
-data modify block 0 0 1 RecordItem.tag.bonus_new set value 0b
-setblock 0 0 1 air destroy
+setblock 0 0 0 jukebox replace
+data modify block 0 0 0 RecordItem set from storage item:bouns item
+data modify block 0 0 0 RecordItem.tag.bonus_new set value 0b
+setblock 0 0 0 air destroy
 tag @s add item_op
 execute as @e[tag=!bonus_old,tag=!item_new,type=item,nbt={"Item":{"tag":{"is_bonus":1b}}},limit=1] run function item:bonus_item/tp
 tag @s remove item_op

+ 1 - 1
data/ltw/functions/init.mcfunction

@@ -100,7 +100,7 @@ scoreboard players set #const_81 mem 81
 scoreboard players set #const_100 mem 100
 
 # 玩家队伍
-team remove debugging
+# team remove debugging
 team add debugging "调试者"
 team modify debugging color red
 team modify debugging collisionRule never

+ 1 - 3
data/ltw/functions/main/player_enter.mcfunction

@@ -33,10 +33,8 @@ function lib:bossbar/show
 # TODO: {土豆} 按存活回合数记分(两个炸弹同时爆炸把两个人炸死可以并列)
 # TODO: {TNTRun} 有多人汇报存在严重卡顿,检查是否是场地的粒子造成,或者是游戏中的光照更新、实体、方块变化
 
-# 龙猫
-# TODO: {幻翼} 在玩家第一次到达半血时显示回血的提示
-
 # HIM
+# FIXME: {色彩} 钻石刷新不出来,变成了洞
 # FIXME: {交易} 在缓慢旋转视角时能观察到村民前后抽搐
 
 # 010

+ 1 - 1
data/ltw/functions/state/0/start_game.mcfunction

@@ -9,7 +9,7 @@ tellraw @a[team=playing,tag=!selected_player] ["",{"text": ">> ","color": "red",
 team join watching @a[team=playing,tag=!selected_player]
 tellraw @a[team=playing,tag=selected_player] ["",{"text": ">> ","color": "green","bold": true},{"text": "游戏开始!","color": "green"}]
 tellraw @a[team=watching] ["",{"text": ">> ","color": "green","bold": true},{"text": "游戏开始, 你将旁观本局游戏!","color": "green"}]
-tellraw @a[team=debugging] ["",{"text": ">> ","color": "blue","bold": true},{"text": "你正处于 Debug 模式中, 将忽略游戏开始!","color": "blue"}]
+tellraw @a[team=debugging] ["",{"text": ">> ","color": "aqua","bold": true},{"text": "你正处于 Debug 模式中, 将忽略游戏开始!","color": "aqua"}]
 
 # 设置数据
 scoreboard players reset * total_score

+ 1 - 1
data/mini/functions/diamond/player_enter.mcfunction

@@ -4,7 +4,7 @@ title @s clear
 title @s actionbar ""
 
 # 解锁配方
-recipe give @s *
+recipe give @s[team=playing] *
 
 # 设置玩家生命
 attribute @s generic.max_health base set 20

+ 1 - 1
data/mini/functions/hotpm/player_intro.mcfunction

@@ -1,5 +1,5 @@
 # 向单个玩家展示小游戏介绍
-tp @s[team=!debugging] 1030.06 17.20 3007.77 -290.29 32.65
+tp @s[team=!debugging] 1029 15 3007.77 -290.29 32.65
 tellraw @s ["",{"text":"\n >> 炸弹狂魔 >>\n\n","color":"gold","bold":true}, " 在炸弹爆炸前攻击他人, 将炸弹扔到其他人身上!\n"]
 tellraw @s ["",{"text": " <生命淘汰制> ","color":"red","bold": true}, {"text":"你有 3 条生命, 生命耗尽后即被淘汰。","color":"gray"}]
 tellraw @s ["",{"text": " <PVP> ","color":"light_purple","bold": true}, {"text":"攻击其他玩家可以转移炸弹, 远程伤害同样有效。","color":"gray"}]

+ 1 - 1
data/mini/functions/hotpm/watcher_limit.mcfunction

@@ -1,3 +1,3 @@
 # 观察者限制飞行范围
 execute as @a[gamemode=spectator,team=!debugging] run spectate
-execute as @a[gamemode=spectator,team=!debugging] unless entity @s[x=1001,y=5,z=3001,dx=29,dy=13,dz=27] run tp @s 1029 17.20 3007.77 -290.29 32.65
+execute as @a[gamemode=spectator,team=!debugging] unless entity @s[x=1001,y=5,z=3001,dx=29,dy=11,dz=27] run tp @s 1029 15 3007.77 -290.29 32.65

+ 1 - 1
data/mini/functions/trade/player_enter.mcfunction

@@ -4,7 +4,7 @@ title @s clear
 title @s actionbar ""
 
 # 解锁配方
-recipe give @s *
+recipe give @s[team=playing] *
 
 # 设置玩家生命
 attribute @s generic.max_health base set 20