Przeglądaj źródła

奖励选择房间初始化

LTCatt 6 lat temu
rodzic
commit
0cc4e424ef

+ 0 - 14
data/item/functions/test/test_summon.mcfunction

@@ -1,14 +0,0 @@
-kill @e[type=item]
-
-summon item 9.0 12.5 2012.5 {Item:{id:"ender_pearl",Count:1},CustomName:'{"text":"末影珍珠","color":"aqua"}',Tags:["team_blue","bonus_item"],Age:-32768,PickupDelay:32767,NoGravity:1,Invulnerable:1,CustomNameVisible:1,Glowing:1}
-summon item 5.0 12.5 2012.5 {Item:{id:"iron_leggings",Count:1},CustomName:'"铁护腿"',Tags:["bonus_item"],Age:-32768,PickupDelay:32767,NoGravity:1,Invulnerable:1,CustomNameVisible:1,Glowing:1}
-summon item 1.5 12.5 2009.0 {Item:{id:"iron_chestplate",Count:1},CustomName:'"铁胸甲"',Tags:["bonus_item"],Age:-32768,PickupDelay:32767,NoGravity:1,Invulnerable:1,CustomNameVisible:1,Glowing:1}
-summon item 1.5 12.5 2005.0 {Item:{id:"nether_star",Count:1},CustomName:'{"text":"得分 +1","color":"light_purple"}',Tags:["team_purple","bonus_item"],Age:-32768,PickupDelay:32767,NoGravity:1,Invulnerable:1,CustomNameVisible:1,Glowing:1}
-summon item 5.0 12.5 2001.5 {Item:{id:"iron_helmet",Count:1},CustomName:'"铁头盔"',Tags:["bonus_item"],Age:-32768,PickupDelay:32767,NoGravity:1,Invulnerable:1,CustomNameVisible:1,Glowing:1}
-summon item 9.0 12.5 2001.5 {Item:{id:"fishing_rod",Count:1},CustomName:'{"text":"破损的钓鱼竿","color":"green"}',Tags:["team_green","bonus_item"],Age:-32768,PickupDelay:32767,NoGravity:1,Invulnerable:1,CustomNameVisible:1,Glowing:1}
-summon item 12.5 12.5 2005.0 {Item:{id:"stone_axe",Count:1},CustomName:'"石斧"',Tags:["bonus_item"],Age:-32768,PickupDelay:32767,NoGravity:1,Invulnerable:1,CustomNameVisible:1,Glowing:1}
-summon item 12.5 12.5 2009.0 {Item:{id:"potion",Count:1,tag:{Potion:"night_vision"}},CustomName:'{"text":"漂浮药水 0:05","color":"green"}',Tags:["team_green","bonus_item"],Age:-32768,PickupDelay:32767,NoGravity:1,Invulnerable:1,CustomNameVisible:1,Glowing:1}
-
-team join green @e[tag=team_green]
-team join blue @e[tag=team_blue]
-team join purple @e[tag=team_purple]

+ 31 - 3
data/ltw/functions/state/7/state_enter.mcfunction

@@ -7,13 +7,41 @@ scoreboard objectives setdisplay belowName total_score_disp
 scoreboard objectives setdisplay sidebar total_score
 scoreboard objectives setdisplay list total_score_disp
 
-# 初始化跑酷地图
+# 初始化地图
 forceload add 0 2000 50 2050
+kill @e[type=item]
 
 # 生成地图
 setblock 0 10 2000 minecraft:structure_block{mode:"LOAD",name:"ltw:select"}
 setblock 0 11 2000 minecraft:redstone_block
 
+# 生成奖励物品
+execute store result score $t_player_count mem if entity @a[tag=!watcher]
+scoreboard players set $t_player_count mem 8
+execute if score $t_player_count mem matches 1.. positioned 9.0 13.0 2014.0 run function item:bonus_item/rank/random
+execute if score $t_player_count mem matches 2.. positioned 5.0 13.0 2014.0 run function item:bonus_item/rank/random
+execute if score $t_player_count mem matches 3.. positioned 0.0 13.0 2009.0 run function item:bonus_item/rank/random
+execute if score $t_player_count mem matches 4.. positioned 0.0 13.0 2005.0 run function item:bonus_item/rank/random
+execute if score $t_player_count mem matches 5.. positioned 5.0 13.0 2000.0 run function item:bonus_item/rank/random
+execute if score $t_player_count mem matches 6.. positioned 9.0 13.0 2000.0 run function item:bonus_item/rank/random
+execute if score $t_player_count mem matches 7.. positioned 14.0 13.0 2005.0 run function item:bonus_item/rank/random
+execute if score $t_player_count mem matches 8.. positioned 14.0 13.0 2009.0 run function item:bonus_item/rank/random
+
+# 生成奖励物品背景
+execute as @e[team=white,type=item] at @s run fill ~-0.5 ~-0.5 ~-0.5 ~0.5 ~0.5 ~0.5 white_concrete_powder
+execute as @e[team=green,type=item] at @s run fill ~-0.5 ~-0.5 ~-0.5 ~0.5 ~0.5 ~0.5 lime_concrete_powder
+execute as @e[team=blue,type=item] at @s run fill ~-0.5 ~-0.5 ~-0.5 ~0.5 ~0.5 ~0.5 light_blue_concrete_powder
+execute as @e[team=purple,type=item] at @s run fill ~-0.5 ~-0.5 ~-0.5 ~0.5 ~0.5 ~0.5 purple_concrete_powder
+
+# 传送回原位
+execute as @e[type=item,x=-1,y=12,z=1999,dx=2,dy=2,dz=50] at @s run tp @s 1.5 ~ ~
+execute as @e[type=item,x=13,y=12,z=1999,dx=2,dy=2,dz=50] at @s run tp @s -1.5 ~ ~
+execute as @e[type=item,x=-1,y=12,z=1999,dx=50,dy=2,dz=2] at @s run tp @s ~ ~ 1.5
+execute as @e[type=item,x=-1,y=12,z=2013,dx=50,dy=2,dz=2] at @s run tp @s ~ ~ -1.5
+
+# 生成屏障
+execute as @e[type=item] at @s run fill ~-0.1 ~1 ~-0.1 ~0.1 ~1 ~0.1 barrier
+
 # 判断进入下一轮小游戏或结束
-execute if score $game_type mem matches 1 if score $round mem matches ..5 run function ltw:state/7/continue_gameparty
-execute if score $game_type mem matches 1 if score $round mem matches 6.. run function ltw:main/game_end
+# execute if score $game_type mem matches 1 if score $round mem matches ..5 run function ltw:state/7/continue_gameparty
+# execute if score $game_type mem matches 1 if score $round mem matches 6.. run function ltw:main/game_end