2
0
Эх сурвалжийг харах

强制的初始设置调整

龙腾猫跃 3 жил өмнө
parent
commit
d275e94f36

+ 1 - 1
data/item/functions/shop/refresh_equip.mcfunction

@@ -22,7 +22,7 @@ scoreboard players reset @s shop_03_apple
 
 # 04
 clear @s potion
-give @s[scores={shop_04_float=1}] potion{CustomPotionEffects:[{Id:25,Amplifier:1,Duration:40}],CustomPotionColor:8039610,display:{Name:'{"text":"弱效浮空药水","italic":false,"color":"gray"}'}}
+give @s[scores={shop_04_float=1}] potion{CustomPotionEffects:[{Id:25,Amplifier:1,Duration:40}],CustomPotionColor:8039610,display:{Name:'{"text":"浮空药水","italic":false,"color":"gray"}'}}
 give @s[scores={shop_04_float=2}] potion{CustomPotionEffects:[{Id:25,Amplifier:1,Duration:60}],CustomPotionColor:8039610,display:{Name:'{"text":"浮空药水","italic":false,"color":"white"}'}}
 
 # 05

+ 2 - 0
data/ltw/functions/init.mcfunction

@@ -66,6 +66,8 @@ scoreboard objectives remove music_time
 scoreboard objectives add music_time dummy "BGM 时间"
 scoreboard objectives add stat_total dummy "总场次"
 scoreboard objectives add stat_win dummy "总胜场"
+scoreboard objectives remove setup_trigger
+scoreboard objectives add setup_trigger trigger "触发器_视频设置"
 scoreboard players set $ game_id 0
 scoreboard players set $ round_id 0
 

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

@@ -12,6 +12,8 @@ xp set @s 0 points
 xp set @s 0 levels
 
 # 开启触发器
+scoreboard players enable @s setup_trigger
+scoreboard players set @s setup_trigger 0
 scoreboard players enable @s buy_trigger
 
 # 状态效果
@@ -26,7 +28,8 @@ effect give @s weakness 1000000 4 true
 gamemode adventure @s[team=!debugging]
 
 # 传送玩家
-tp @s[team=!debugging] -10 8 -32 -113 0
+tp @s[team=!debugging,tag=pass_setup] -10 8 -32 -113 0
+tp @s[team=!debugging,tag=!pass_setup] 2.5 300.2 -52.5 0 0
 
 # 刷新物品
 clear @s[team=!debugging]

+ 15 - 0
data/ltw/functions/state/0/setup/check.mcfunction

@@ -0,0 +1,15 @@
+# 范围检测
+execute if score @s setup_trigger matches 1.. at @s unless entity @s[x=-100,z=-100,y=200,dx=200,dy=200,dz=200] run scoreboard players set @s setup_trigger 0
+
+# 第一部分
+execute if score @s setup_trigger matches 1 run function ltw:state/0/setup/fail
+execute if score @s setup_trigger matches 2 run tp @s 11.5 300.2 -48.0 180 0
+
+# 第二部分
+execute if score @s setup_trigger matches 11 run function ltw:state/0/setup/fail
+execute if score @s setup_trigger matches 12 run function ltw:state/0/setup/orange
+execute if score @s setup_trigger matches 99 run function ltw:state/0/setup/finish
+
+# 重置
+scoreboard players set @s setup_trigger 0
+scoreboard players enable @s setup_trigger

+ 3 - 0
data/ltw/functions/state/0/setup/fail.mcfunction

@@ -0,0 +1,3 @@
+tp @s ~ ~ ~ ~180 90
+function lib:sounds/error
+tellraw @s ["",{"text": ">> ","color":"red","bold": true},{"text": "拜托啦,在认真修改设置之后再继续吧……","color":"red"}]

+ 2 - 0
data/ltw/functions/state/0/setup/finish.mcfunction

@@ -0,0 +1,2 @@
+tag @s add pass_setup
+function ltw:state/0/player_enter

+ 3 - 0
data/ltw/functions/state/0/setup/orange.mcfunction

@@ -0,0 +1,3 @@
+tp @s 11.5 300.2 -48.5 270 5
+function lib:sounds/error
+tellraw @s ["",{"text": ">> ","color":"red","bold": true},{"text": "不……是看右边墙上箭头指着的地方,不是左边的墙……","color":"red"}]

+ 2 - 2
data/ltw/functions/state/0/state/check_slot.mcfunction

@@ -1,7 +1,7 @@
 # 第八格
-execute unless data entity @s[team=watching] Inventory[{Slot:8b,tag:{lobby_item:1b,lobby_watch:1b}}] run function ltw:state/0/state/join_game
+execute unless data entity @s[team=watching,tag=pass_setup] Inventory[{Slot:8b,tag:{lobby_item:1b,lobby_watch:1b}}] run function ltw:state/0/state/join_game
 execute if data entity @s[team=watching] Inventory[{tag:{lobby_item:1b,lobby_ready:1b}}] run clear @s lime_dye{lobby_item:1b,lobby_ready:1b} 
-execute unless data entity @s[team=playing] Inventory[{Slot:8b,tag:{lobby_item:1b,lobby_ready:1b}}] run function ltw:state/0/state/join_watch
+execute unless data entity @s[team=playing,tag=pass_setup] Inventory[{Slot:8b,tag:{lobby_item:1b,lobby_ready:1b}}] run function ltw:state/0/state/join_watch
 execute if data entity @s[team=playing] Inventory[{tag:{lobby_item:1b,lobby_watch:1b}}] run clear @s gray_dye{lobby_item:1b,lobby_watch:1b}
 
 # 清除临时物品

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

@@ -4,7 +4,7 @@ clear @s gray_dye{lobby_item:1b,lobby_watch:1b}
 kill @e[type=item,nbt={Item:{id:"minecraft:gray_dye",tag:{lobby_item:1b,lobby_watch: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
-item replace entity @s hotbar.8 with lime_dye{lobby_item:1b,lobby_ready:1b,display:{Name:'[{"text":"已准备 (按 ","color":"green","italic":false},{"keybind":"key.drop","color":"green","italic":false},{"text":" 切换)","color":"green","italic":false}]',Lore:['{"text":"你将在下一局参与游戏","color":"gray","italic":false}']}}
+item replace entity @s[tag=pass_setup] hotbar.8 with lime_dye{lobby_item:1b,lobby_ready:1b,display:{Name:'[{"text":"已准备 (按 ","color":"green","italic":false},{"keybind":"key.drop","color":"green","italic":false},{"text":" 切换)","color":"green","italic":false}]',Lore:['{"text":"你将在下一局参与游戏","color":"gray","italic":false}']}}
 execute at @s run function lib:sounds/hit
 
 # 处理数据

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

@@ -4,7 +4,7 @@ clear @s gray_dye{lobby_item:1b,lobby_watch:1b}
 kill @e[type=item,nbt={Item:{id:"minecraft:lime_dye",tag:{lobby_item:1b,lobby_ready: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
-item replace entity @s hotbar.8 with gray_dye{lobby_item:1b,lobby_watch:1b,display:{Name:'[{"text":"旁观 (按 ","color":"white","italic":false},{"keybind":"key.drop","color":"white","italic":false},{"text":" 切换)","color":"white","italic":false}]',Lore:['{"text":"你将在下一局旁观游戏","color":"gray","italic":false}']}}
+item replace entity @s[tag=pass_setup] hotbar.8 with gray_dye{lobby_item:1b,lobby_watch:1b,display:{Name:'[{"text":"旁观 (按 ","color":"white","italic":false},{"keybind":"key.drop","color":"white","italic":false},{"text":" 切换)","color":"white","italic":false}]',Lore:['{"text":"你将在下一局旁观游戏","color":"gray","italic":false}']}}
 execute at @s run function lib:sounds/hit2
 
 # 处理数据

+ 2 - 0
data/ltw/functions/state/0/tick2.mcfunction

@@ -1,3 +1,5 @@
+execute as @a[tag=!pass_setup] at @s run function ltw:state/0/setup/check
+
 # 处理乱扔物品的玩家
 execute as @e[type=item,nbt={Item:{tag:{stats_item:1b}}},tag=!new_stats] unless data entity @s Thrower at @s run tag @a[distance=..3] add refresh
 execute as @e[type=item,nbt={Item:{tag:{stats_item:1b}}},tag=!new_stats] unless data entity @s Thrower run kill @s

+ 5 - 5
data/ltw/functions/state/0/tick5.mcfunction

@@ -19,12 +19,12 @@ execute store result score $count mem if entity @a[team=playing]
 execute store result score #total_count mem if entity @a
 
 # 开始:提示开始
-execute if score $count mem matches 3.. if score #start_countdown mem matches 999.. run tellraw @a [{"text":"","color":"green"},{"text": ">> ","bold": true},"游戏即将开始, 请使用快捷栏最后一格确定自己是否参与!"]
+execute if score $count mem matches 3.. if score #start_countdown mem matches 999.. run tellraw @a[tag=pass_setup] [{"text":"","color":"green"},{"text": ">> ","bold": true},"游戏即将开始, 请使用快捷栏最后一格确定自己是否参与!"]
 execute if score $count mem matches 3.. if score #start_countdown mem matches 999.. as @a at @s run function lib:sounds/levelup
 execute if score $count mem matches 3.. if score #start_countdown mem matches 999.. run scoreboard players set #start_countdown mem 121
 
 # 取消:提示取消
-execute if score $count mem matches ..2 if score #start_countdown mem matches ..999 run tellraw @a [{"text":"","color":"red"},{"text": ">> ","bold": true},"已准备人数不足, 游戏取消!"]
+execute if score $count mem matches ..2 if score #start_countdown mem matches ..999 run tellraw @a[tag=pass_setup] [{"text":"","color":"red"},{"text": ">> ","bold": true},"已准备人数不足, 游戏取消!"]
 execute if score $count mem matches ..2 if score #start_countdown mem matches ..999 as @a at @s run function lib:sounds/error
 execute if score $count mem matches ..2 if score #start_countdown mem matches ..999 run scoreboard players set #start_countdown mem 9999999
 
@@ -37,7 +37,7 @@ scoreboard players operation #start_div mem %= #4 mem
 execute if score #start_sec mem matches 1..10 if score #start_div mem matches 3 run execute as @a at @s run function lib:sounds/hit2
 
 # 20s:提示未准备
-execute if score #start_countdown mem matches 80 run tellraw @a[team=watching] [{"text":"","color":"red"},{"text":">> ","bold": true},"你还没有准备, 如果要参加游戏, 请丢出快捷栏最后一格的物品!"]
+execute if score #start_countdown mem matches 80 run tellraw @a[team=watching,tag=pass_setup] [{"text":"","color":"red"},{"text":">> ","bold": true},"你还没有准备, 如果要参加游戏, 请丢出快捷栏最后一格的物品!"]
 
 # 10s:提示玩家数量过多
 execute if score #start_countdown mem matches 40 if score $count mem matches 9.. run tellraw @a [{"text":"","color":"gold"},{"text":">> ","bold": true},"已超出游戏最多支持的 8 人人数上限, 将随机抽取 8 人开始游戏!"]
@@ -46,5 +46,5 @@ execute if score #start_countdown mem matches 40 if score $count mem matches 9..
 execute if score #start_countdown mem matches 0 run function ltw:state/0/start_game
 
 # 显示信息
-execute if score #start_countdown mem matches 1..199 run title @a[team=!debugging] actionbar [{"text":"","color":"green"},{"score":{"name":"$count","objective":"mem"}},"/",{"score":{"name":"#total_count","objective":"mem"}}," 人已准备 | ","将在 ",{"score":{"name":"#start_sec","objective":"mem"}}," 秒后开始游戏"]
-execute if score #start_countdown mem matches 200.. run title @a[team=!debugging] actionbar [{"text":"","color":"red"},{"score":{"name":"$count","objective":"mem"}},"/",{"score":{"name":"#total_count","objective":"mem"}}," 人已准备 | 需要 3 人以开始游戏"]
+execute if score #start_countdown mem matches 1..199 run title @a[team=!debugging,tag=pass_setup] actionbar [{"text":"","color":"green"},{"score":{"name":"$count","objective":"mem"}},"/",{"score":{"name":"#total_count","objective":"mem"}}," 人已准备 | ","将在 ",{"score":{"name":"#start_sec","objective":"mem"}}," 秒后开始游戏"]
+execute if score #start_countdown mem matches 200.. run title @a[team=!debugging,tag=pass_setup] actionbar [{"text":"","color":"red"},{"score":{"name":"$count","objective":"mem"}},"/",{"score":{"name":"#total_count","objective":"mem"}}," 人已准备 | 需要 3 人以开始游戏"]