LTCatt 6 yıl önce
ebeveyn
işleme
a87b9df052

+ 2 - 1
data/item/functions/bonus_item/call.mcfunction

@@ -19,4 +19,5 @@ execute if data block 0 0 0 RecordItem.tag.bonus_add_score run function item:bon
 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 ltw:state/7/pickup
+tag @s add pickup_player
+schedule function item:bonus_item/pickup 1t replace

+ 5 - 0
data/item/functions/bonus_item/pickup.mcfunction

@@ -0,0 +1,5 @@
+# 有玩家捡起物品,并处理完成后触发
+# 执行者为 System
+
+execute if score $state mem matches 7 as @a[tag=pickup_player] run function ltw:state/7/pickup
+tag @a remove pickup_player

+ 1 - 1
data/lib/functions/sounds/error.mcfunction

@@ -1 +1 @@
-playsound minecraft:block.note_block.didgeridoo block @s
+playsound minecraft:block.note_block.didgeridoo block @s 0 1000000 0 1000000

+ 1 - 1
data/lib/functions/sounds/hit.mcfunction

@@ -1 +1 @@
-playsound minecraft:entity.arrow.hit_player player @s
+playsound minecraft:entity.arrow.hit_player player @s 0 1000000 0 1000000

+ 1 - 1
data/lib/functions/sounds/hit2.mcfunction

@@ -1 +1 @@
-playsound minecraft:entity.arrow.hit_player player @s ~ ~ ~ 1 0.5
+playsound minecraft:entity.arrow.hit_player player @s 0 1000000 0 1000000 0.5

+ 1 - 1
data/lib/functions/sounds/hurt.mcfunction

@@ -1 +1 @@
-playsound minecraft:entity.player.hurt player @s
+playsound minecraft:entity.player.hurt player @s 0 1000000 0 1000000

+ 1 - 0
data/lib/functions/sounds/levelup.mcfunction

@@ -0,0 +1 @@
+playsound minecraft:entity.player.levelup player @s 0 1000000 0 1000000

+ 16 - 15
data/ltw/functions/state/7/next.mcfunction

@@ -1,29 +1,30 @@
 # 选取下一轮选择的人群
 
-tag @a remove selecting
+tag @a remove new_selector
 
-execute unless entity @a[tag=selecting] run tag @a[tag=mini_rank1] add selecting
-execute if entity @a[tag=mini_rank1] run tellraw @a[tag=!selecting] ["",{"text": ">> ","color":"gold","bold": true},"轮到第一名 ",{"selector": "@a[tag=selecting]","color":"gold"}," 选择奖励了!"]
+execute unless entity @a[tag=new_selector] run tag @a[tag=mini_rank1] add new_selector
+execute if entity @a[tag=mini_rank1] run tellraw @a[tag=!new_selector] ["",{"text": ">> ","color":"gold","bold": true},"轮到第一名 ",{"selector": "@a[tag=new_selector]","color":"gold"}," 选择奖励了!"]
 
-execute unless entity @a[tag=selecting] run tag @a[tag=mini_rank2] add selecting
-execute unless entity @a[tag=mini_rank1] if entity @a[tag=mini_rank2] run tellraw @a[tag=!selecting] ["",{"text": ">> ","color":"gold","bold": true},"轮到第二名 ",{"selector": "@a[tag=selecting]","color":"gold"}," 选择奖励了!"]
+execute unless entity @a[tag=new_selector] run tag @a[tag=mini_rank2] add new_selector
+execute unless entity @a[tag=mini_rank1] if entity @a[tag=mini_rank2] run tellraw @a[tag=!new_selector] ["",{"text": ">> ","color":"gold","bold": true},"轮到第二名 ",{"selector": "@a[tag=new_selector]","color":"gold"}," 选择奖励了!"]
 
-execute unless entity @a[tag=selecting] run tag @a[tag=mini_rank3] add selecting
-execute unless entity @a[tag=mini_rank1] unless entity @a[tag=mini_rank2] if entity @a[tag=mini_rank3] run tellraw @a[tag=!selecting] ["",{"text": ">> ","color":"gold","bold": true},"轮到第三名 ",{"selector": "@a[tag=selecting]","color":"gold"}," 选择奖励了!"]
+execute unless entity @a[tag=new_selector] run tag @a[tag=mini_rank3] add new_selector
+execute unless entity @a[tag=mini_rank1] unless entity @a[tag=mini_rank2] if entity @a[tag=mini_rank3] run tellraw @a[tag=!new_selector] ["",{"text": ">> ","color":"gold","bold": true},"轮到第三名 ",{"selector": "@a[tag=new_selector]","color":"gold"}," 选择奖励了!"]
 
-execute unless entity @a[tag=selecting] run tag @a[tag=mini_rank4] add selecting
-execute unless entity @a[tag=mini_rank1] unless entity @a[tag=mini_rank2] unless entity @a[tag=mini_rank3] if entity @a[tag=mini_rank4] run tellraw @a[tag=!selecting] ["",{"text": ">> ","color":"gold","bold": true},"轮到其他人选择奖励了!"]
+execute unless entity @a[tag=new_selector] run tag @a[tag=mini_rank4] add new_selector
+execute unless entity @a[tag=mini_rank1] unless entity @a[tag=mini_rank2] unless entity @a[tag=mini_rank3] if entity @a[tag=mini_rank4] run tellraw @a[tag=!new_selector] ["",{"text": ">> ","color":"gold","bold": true},"轮到其他人选择奖励了!"]
 
 # 以玩家为对象开始执行
-execute as @a[tag=selecting] run function ltw:state/7/next2
-execute unless entity @a[tag=selecting] if score $game_type mem matches 1 if score $round mem matches ..5 run function ltw:state/7/continue_gameparty
-execute unless entity @a[tag=selecting] if score $game_type mem matches 1 if score $round mem matches 6.. run function ltw:main/game_end
+execute as @a[tag=new_selector] run function ltw:state/7/next2
+execute unless entity @a[tag=new_selector] if score $game_type mem matches 1 if score $round mem matches ..5 run function ltw:state/7/continue_gameparty
+execute unless entity @a[tag=new_selector] if score $game_type mem matches 1 if score $round mem matches 6.. run function ltw:main/game_end
 
 # 初始化倒计时
-scoreboard players set $countdown mem 10
+scoreboard players set $countdown mem 11
 
 # 播放音效
-execute as @a[tag=selecting] at @s run function lib:sounds/hit
-execute as @a[tag=!selecting] at @s run function lib:sounds/hit2
+execute as @a[tag=new_selector] at @s run function lib:sounds/hit
+execute if entity @a[tag=new_selector] as @a[tag=!new_selector] at @s run function lib:sounds/hit2
+execute unless entity @a[tag=new_selector] run function lib:sounds/levelup
 
 # FIXME : 僵尸游戏的旁观者偶尔会抽搐

+ 1 - 0
data/ltw/functions/state/7/next2.mcfunction

@@ -4,6 +4,7 @@ tag @s remove mini_rank1
 tag @s remove mini_rank2
 tag @s remove mini_rank3
 tag @s remove mini_rank4
+tag @s add selecting
 
 gamemode adventure
 

+ 2 - 0
data/ltw/functions/state/7/pickup.mcfunction

@@ -1,3 +1,5 @@
 # 当玩家捡起物品时触发
 
 gamemode spectator
+tag @s remove selecting
+execute unless entity @a[tag=selecting] run function ltw:state/7/next

+ 1 - 0
data/ltw/functions/state/7/player_enter.mcfunction

@@ -22,6 +22,7 @@ tag @s[tag=rejoining] remove mini_rank1
 tag @s[tag=rejoining] remove mini_rank2
 tag @s[tag=rejoining] remove mini_rank3
 tag @s[tag=rejoining] remove mini_rank4
+tag @s remove selecting
 
 # 自由旁观
 gamemode spectator