Просмотр исходного кода

扩展到 6 轮;最后一轮只刷出分数

LTCatt 6 лет назад
Родитель
Сommit
445ab7b8f3

+ 11 - 0
data/item/functions/bonus_item/gameparty/last/blue.mcfunction

@@ -0,0 +1,11 @@
+# 生成蓝色品质的物品实体
+
+loot spawn ~ ~ ~ loot item:gameparty/last/blue
+summon item ~ ~ ~ {Tags:["new_item"],Age:-32768,PickupDelay:0,NoGravity:1,Invulnerable:1,CustomNameVisible:1,Glowing:1,Motion:[0,0,0],Item:{id:"gold_nugget",Count:1}}
+data modify entity @e[tag=new_item,limit=1] Item set from entity @e[limit=1,type=item,sort=nearest,tag=!new_item] Item
+kill @e[limit=1,type=item,sort=nearest,tag=!new_item]
+execute as @e[tag=new_item] run data modify entity @s CustomName set from entity @s Item.tag.item_name
+team join blue @e[tag=new_item]
+tag @e[tag=new_item] add item_blue
+tag @e[tag=new_item] add item_new
+tag @e[tag=new_item] remove new_item

+ 11 - 0
data/item/functions/bonus_item/gameparty/last/green.mcfunction

@@ -0,0 +1,11 @@
+# 生成绿色品质的物品实体
+
+loot spawn ~ ~ ~ loot item:gameparty/last/green
+summon item ~ ~ ~ {Tags:["new_item"],Age:-32768,PickupDelay:0,NoGravity:1,Invulnerable:1,CustomNameVisible:1,Glowing:1,Motion:[0,0,0],Item:{id:"gold_nugget",Count:1}}
+data modify entity @e[tag=new_item,limit=1] Item set from entity @e[limit=1,type=item,sort=nearest,tag=!new_item] Item
+kill @e[limit=1,type=item,sort=nearest,tag=!new_item]
+execute as @e[tag=new_item] run data modify entity @s CustomName set from entity @s Item.tag.item_name
+team join green @e[tag=new_item]
+tag @e[tag=new_item] add item_green
+tag @e[tag=new_item] add item_new
+tag @e[tag=new_item] remove new_item

+ 11 - 0
data/item/functions/bonus_item/gameparty/last/purple.mcfunction

@@ -0,0 +1,11 @@
+# 生成紫色品质的物品实体
+
+loot spawn ~ ~ ~ loot item:gameparty/last/purple
+summon item ~ ~ ~ {Tags:["new_item"],Age:-32768,PickupDelay:0,NoGravity:1,Invulnerable:1,CustomNameVisible:1,Glowing:1,Motion:[0,0,0],Item:{id:"gold_nugget",Count:1}}
+data modify entity @e[tag=new_item,limit=1] Item set from entity @e[limit=1,type=item,sort=nearest,tag=!new_item] Item
+kill @e[limit=1,type=item,sort=nearest,tag=!new_item]
+execute as @e[tag=new_item] run data modify entity @s CustomName set from entity @s Item.tag.item_name
+team join purple @e[tag=new_item]
+tag @e[tag=new_item] add item_purple
+tag @e[tag=new_item] add item_new
+tag @e[tag=new_item] remove new_item

+ 16 - 0
data/item/functions/bonus_item/gameparty/last/random.mcfunction

@@ -0,0 +1,16 @@
+# 根据当前轮数生成随机品质的物品
+
+# 品质 = d100
+scoreboard players set $random_min mem 1
+scoreboard players set $random_max mem 100
+function lib:random
+scoreboard players operation $t_quality mem = $round mem
+
+# 根据品质生成不同的物品
+execute if score $t_quality mem matches ..24 run function item:bonus_item/gameparty/last/white
+# 绿色:35%
+execute if score $t_quality mem matches 25..59 run function item:bonus_item/gameparty/last/green
+# 蓝色:25%
+execute if score $t_quality mem matches 60..84 run function item:bonus_item/gameparty/last/blue
+# 紫色:15%
+execute if score $t_quality mem matches 85.. run function item:bonus_item/gameparty/last/purple

+ 11 - 0
data/item/functions/bonus_item/gameparty/last/white.mcfunction

@@ -0,0 +1,11 @@
+# 生成白色品质的物品实体
+
+loot spawn ~ ~ ~ loot item:gameparty/last/white
+summon item ~ ~ ~ {Tags:["new_item"],Age:-32768,PickupDelay:0,NoGravity:1,Invulnerable:1,CustomNameVisible:1,Glowing:1,Motion:[0,0,0],Item:{id:"gold_nugget",Count:1}}
+data modify entity @e[tag=new_item,limit=1] Item set from entity @e[limit=1,type=item,sort=nearest,tag=!new_item] Item
+kill @e[limit=1,type=item,sort=nearest,tag=!new_item]
+execute as @e[tag=new_item] run data modify entity @s CustomName set from entity @s Item.tag.item_name
+team join white @e[tag=new_item]
+tag @e[tag=new_item] add item_white
+tag @e[tag=new_item] add item_new
+tag @e[tag=new_item] remove new_item

+ 4 - 0
data/item/functions/bonus_item/gameparty/random.mcfunction

@@ -0,0 +1,4 @@
+# 根据轮数生成对应的物品
+
+execute if score $round mem matches ..5 run function item:bonus_item/gameparty/normal/random
+execute if score $round mem matches 6 run function item:bonus_item/gameparty/last/random

+ 19 - 0
data/item/loot_tables/gameparty/last/blue.json

@@ -0,0 +1,19 @@
+{"pools": [{"rolls": 1,"entries": [
+
+{
+    "type": "minecraft:item",
+    "weight": 11,
+    "name": "minecraft:nether_star",
+    "functions": [
+        {
+            "function": "minecraft:set_count",
+            "count": 3
+        },
+        {
+            "function": "minecraft:set_nbt",
+            "tag": "{\"item_name\":\"{\\\"text\\\":\\\"得分 +3\\\",\\\"color\\\":\\\"aqua\\\"}\",\"is_bonus\":1b,\"bonus_new\":1b,\"bonus_add_score\":3}"
+        }
+    ]
+}
+
+]}]}

+ 19 - 0
data/item/loot_tables/gameparty/last/green.json

@@ -0,0 +1,19 @@
+{"pools": [{"rolls": 1,"entries": [
+
+{
+    "type": "minecraft:item",
+    "weight": 26,
+    "name": "minecraft:nether_star",
+    "functions": [
+        {
+            "function": "minecraft:set_count",
+            "count": 2
+        },
+        {
+            "function": "minecraft:set_nbt",
+            "tag": "{\"item_name\":\"{\\\"text\\\":\\\"得分 +2\\\",\\\"color\\\":\\\"green\\\"}\",\"is_bonus\":1b,\"bonus_new\":1b,\"bonus_add_score\":2}"
+        }
+    ]
+}
+
+]}]}

+ 19 - 0
data/item/loot_tables/gameparty/last/purple.json

@@ -0,0 +1,19 @@
+{"pools": [{"rolls": 1,"entries": [
+
+{
+    "type": "minecraft:item",
+    "weight": 3,
+    "name": "minecraft:nether_star",
+    "functions": [
+        {
+            "function": "minecraft:set_count",
+            "count": 4
+        },
+        {
+            "function": "minecraft:set_nbt",
+            "tag": "{\"item_name\":\"{\\\"text\\\":\\\"得分 +4\\\",\\\"color\\\":\\\"light_purple\\\"}\",\"is_bonus\":1b,\"bonus_new\":1b,\"bonus_add_score\":4}"
+        }
+    ]
+}
+
+]}]}

+ 15 - 0
data/item/loot_tables/gameparty/last/white.json

@@ -0,0 +1,15 @@
+{"pools": [{"rolls": 1,"entries": [
+
+{
+    "type": "minecraft:item",
+    "weight": 13,
+    "name": "minecraft:nether_star",
+    "functions": [
+        {
+            "function": "minecraft:set_nbt",
+            "tag": "{\"item_name\":\"{\\\"text\\\":\\\"得分 +1\\\",\\\"color\\\":\\\"white\\\"}\",\"is_bonus\":1b,\"bonus_new\":1b,\"bonus_add_score\":1}"
+        }
+    ]
+}
+
+]}]}

+ 2 - 1
data/ltw/functions/state/3/tick20.mcfunction

@@ -1,7 +1,8 @@
 # 显示倒计时
 title @a times 3 14 2
 title @a subtitle {"score":{"name":"$countdown","objective":"mem"}}
-title @a title ["第 ",{"score": {"objective": "mem","name": "$round"}},"/5 轮"]
+execute if score $round mem matches ..5 run title @a title ["第 ",{"score": {"objective": "mem","name": "$round"}},"/6 轮"]
+execute if score $round mem matches 6 run title @a title {"text":"最后一轮","color":"gold"}
 
 # 退出状态
 execute if score $countdown mem matches 10 run function ltw:state/4/state_enter

+ 2 - 2
data/ltw/functions/state/7/next.mcfunction

@@ -16,8 +16,8 @@ execute unless entity @a[tag=mini_rank1] unless entity @a[tag=mini_rank2] unless
 
 # 以玩家为对象开始执行
 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:main/game_end
-execute unless entity @a[tag=new_selector] if score $game_type mem matches 1 if score $round mem matches ..4 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
+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
 
 # 初始化倒计时
 scoreboard players set $countdown mem 10

+ 2 - 2
data/test/functions/mini/colormatch.mcfunction

@@ -2,9 +2,9 @@
 tag @a add hub_gameparty
 tag @a remove hub_watch
 function ltw:state/0/start_gameparty
-scoreboard players set $round mem 5
+scoreboard players set $round mem 10
 scoreboard players set $mini_type mem 4
 function mini:main/game_init
 function ltw:state/4/state_enter
 scoreboard players set $countdown mem 5
-say 已开始陷阱迷阵!
+say 已开始单个测试游戏!

+ 2 - 2
data/test/functions/mini/hotpm.mcfunction

@@ -2,9 +2,9 @@
 tag @a add hub_gameparty
 tag @a remove hub_watch
 function ltw:state/0/start_gameparty
-scoreboard players set $round mem 1005
+scoreboard players set $round mem 10
 scoreboard players set $mini_type mem 3
 function mini:main/game_init
 function ltw:state/4/state_enter
 scoreboard players set $countdown mem 5
-say 已开始热土豆!
+say 已开始单个测试游戏!

+ 2 - 2
data/test/functions/mini/parkour.mcfunction

@@ -2,9 +2,9 @@
 tag @a add hub_gameparty
 tag @a remove hub_watch
 function ltw:state/0/start_gameparty
-scoreboard players set $round mem 5
+scoreboard players set $round mem 10
 scoreboard players set $mini_type mem 1
 function mini:main/game_init
 function ltw:state/4/state_enter
 scoreboard players set $countdown mem 5
-say 已开始跑酷!
+say 已开始单个测试游戏!

+ 2 - 2
data/test/functions/mini/tntrun.mcfunction

@@ -2,9 +2,9 @@
 tag @a add hub_gameparty
 tag @a remove hub_watch
 function ltw:state/0/start_gameparty
-scoreboard players set $round mem 5
+scoreboard players set $round mem 10
 scoreboard players set $mini_type mem 2
 function mini:main/game_init
 function ltw:state/4/state_enter
 scoreboard players set $countdown mem 5
-say 已开始 TNT Run!
+say 已开始单个测试游戏!

+ 2 - 2
data/test/functions/mini/zombie.mcfunction

@@ -2,9 +2,9 @@
 tag @a add hub_gameparty
 tag @a remove hub_watch
 function ltw:state/0/start_gameparty
-scoreboard players set $round mem 5
+scoreboard players set $round mem 10
 scoreboard players set $mini_type mem 5
 function mini:main/game_init
 function ltw:state/4/state_enter
 scoreboard players set $countdown mem 5
-say 已开始猪海寻路!
+say 已开始单个测试游戏!