LTCatt 6 anos atrás
pai
commit
68aa235299

+ 7 - 7
data/ltw/functions/main/game_end.mcfunction

@@ -40,19 +40,19 @@ scoreboard players operation #rank3_gold mem *= #total_gold mem
 scoreboard players operation #rank3_gold mem /= #const_100 mem
 
 # 显示排名
-execute if entity @a[tag=total_rank2] if entity @a[tag=total_rank3] run tellraw @a ["",{"text":"\n\n----- 游戏结束 -----\n\n","color":"green","bold":true},{"text": "第一名 - ","color":"green"},{"selector": "@a[tag=total_rank1]","color":"white"},{"text":" (","color":"gray"},{"score":{"name": "@p[tag=total_rank1]","objective": "total_score"},"color":"gray"},{"text":")","color":"gray"},{"text": "\n第二名 - ","color":"green"},{"selector": "@a[tag=total_rank2]","color":"white"},{"text":" (","color":"gray"},{"score":{"name": "@p[tag=total_rank2]","objective": "total_score"},"color":"gray"},{"text":")","color":"gray"},{"text": "\n第三名 - ","color":"green"},{"selector": "@a[tag=total_rank3]","color":"white"},{"text":" (","color":"gray"},{"score":{"name": "@p[tag=total_rank3]","objective": "total_score"},"color":"gray"},{"text":")","color":"gray"},"\n\n"]
-execute if entity @a[tag=total_rank2] unless entity @a[tag=total_rank3] run tellraw @a ["",{"text":"\n\n\n----- 游戏结束 -----\n\n","color":"green","bold":true},{"text": "第一名 - ","color":"green"},{"selector": "@a[tag=total_rank1]","color":"white"},{"text":" (","color":"gray"},{"score":{"name": "@p[tag=total_rank1]","objective": "total_score"},"color":"gray"},{"text":")","color":"gray"},{"text": "\n第二名 - ","color":"green"},{"selector": "@a[tag=total_rank2]","color":"white"},{"text":" (","color":"gray"},{"score":{"name": "@p[tag=total_rank2]","objective": "total_score"},"color":"gray"},{"text":")","color":"gray"},"\n\n\n"]
-execute unless entity @a[tag=total_rank2] run tellraw @a ["",{"text":"\n\n\n\n----- 游戏结束 -----\n\n","color":"green","bold":true},{"text": "第一名 - ","color":"green"},{"selector": "@a[tag=total_rank1]","color":"white"},{"text":" (","color":"gray"},{"score":{"name": "@p[tag=total_rank1]","objective": "total_score"},"color":"gray"},{"text":")","color":"gray"},"\n\n\n"]
+execute if entity @a[tag=total_rank2] if entity @a[tag=total_rank3] run tellraw @a ["",{"text":"\n\n----- 游戏结束 -----\n\n","color":"green","bold":true},{"text": "第一名 - ","color":"green"},{"selector": "@a[tag=total_rank1]","color":"white"},{"text":" (","color":"gray"},{"score":{"name": "@p[tag=total_rank1]","objective": "total_score"},"color":"gray"},{"text":" 分)","color":"gray"},{"text": "\n第二名 - ","color":"green"},{"selector": "@a[tag=total_rank2]","color":"white"},{"text":" (","color":"gray"},{"score":{"name": "@p[tag=total_rank2]","objective": "total_score"},"color":"gray"},{"text":" 分)","color":"gray"},{"text": "\n第三名 - ","color":"green"},{"selector": "@a[tag=total_rank3]","color":"white"},{"text":" (","color":"gray"},{"score":{"name": "@p[tag=total_rank3]","objective": "total_score"},"color":"gray"},{"text":" 分)","color":"gray"},"\n\n"]
+execute if entity @a[tag=total_rank2] unless entity @a[tag=total_rank3] run tellraw @a ["",{"text":"\n\n\n----- 游戏结束 -----\n\n","color":"green","bold":true},{"text": "第一名 - ","color":"green"},{"selector": "@a[tag=total_rank1]","color":"white"},{"text":" (","color":"gray"},{"score":{"name": "@p[tag=total_rank1]","objective": "total_score"},"color":"gray"},{"text":" 分)","color":"gray"},{"text": "\n第二名 - ","color":"green"},{"selector": "@a[tag=total_rank2]","color":"white"},{"text":" (","color":"gray"},{"score":{"name": "@p[tag=total_rank2]","objective": "total_score"},"color":"gray"},{"text":" 分)","color":"gray"},"\n\n\n"]
+execute unless entity @a[tag=total_rank2] run tellraw @a ["",{"text":"\n\n\n\n----- 游戏结束 -----\n\n","color":"green","bold":true},{"text": "第一名 - ","color":"green"},{"selector": "@a[tag=total_rank1]","color":"white"},{"text":" (","color":"gray"},{"score":{"name": "@p[tag=total_rank1]","objective": "total_score"},"color":"gray"},{"text":" 分)","color":"gray"},"\n\n\n"]
 
 # 给予金粒奖励
 execute as @a[tag=total_rank1] run scoreboard players operation @s gold += #rank1_gold mem
-tellraw @a[tag=total_rank1] ["",{"text": ">> ","color":"green","bold": true},"由于获得第一名, 你得到了 ",{"selector": "#rank1_gold","color":"green"},{"text": " 金粒","color":"green"}]
+tellraw @a[tag=total_rank1] ["",{"text": ">> ","color":"green","bold": true},"由于获得第一名, 你得到了 ",{"score":{"name": "#rank1_gold","objective": "mem"},"color":"green"},{"text": " 金粒","color":"green"}]
 execute as @a[tag=total_rank2] run scoreboard players operation @s gold += #rank2_gold mem
-tellraw @a[tag=total_rank2] ["",{"text": ">> ","color":"green","bold": true},"由于获得第二名, 你得到了 ",{"selector": "#rank2_gold","color":"green"},{"text": " 金粒","color":"green"}]
+tellraw @a[tag=total_rank2] ["",{"text": ">> ","color":"green","bold": true},"由于获得第二名, 你得到了 ",{"score":{"name": "#rank2_gold","objective": "mem"},"color":"green"},{"text": " 金粒","color":"green"}]
 execute as @a[tag=total_rank3] run scoreboard players operation @s gold += #rank3_gold mem
-tellraw @a[tag=total_rank3] ["",{"text": ">> ","color":"green","bold": true},"由于获得第三名, 你得到了 ",{"selector": "#rank3_gold","color":"green"},{"text": " 金粒","color":"green"}]
+tellraw @a[tag=total_rank3] ["",{"text": ">> ","color":"green","bold": true},"由于获得第三名, 你得到了 ",{"score":{"name": "#rank3_gold","objective": "mem"},"color":"green"},{"text": " 金粒","color":"green"}]
 scoreboard players add @a[tag=!total_rank1,tag=!total_rank2,tag=!total_rank3,tag=!watcher] gold 1
-tellraw @a[tag=!total_rank1,tag=!total_rank2,tag=!total_rank3,tag=!watcher] ["",{"text": ">> ","color":"aqua","bold": true},"由于没有获得名次, 你得到了 ",{"text": " 1 金粒","color":"aqua"}]
+tellraw @a[tag=!total_rank1,tag=!total_rank2,tag=!total_rank3,tag=!watcher] ["",{"text": ">> ","color":"aqua","bold": true},"由于没有获得名次, 你得到了 ",{"text": "1 金粒","color":"aqua"}]
 
 # 返回主大厅
 schedule function ltw:state/0/state_enter 2t replace

+ 17 - 0
data/ltw/functions/shop/buy_apple1.mcfunction

@@ -0,0 +1,17 @@
+# 金苹果 (30 gi)
+
+execute unless entity @s[scores={shop_apple=0..}] run scoreboard players set @s shop_apple 0
+tag @s remove canbuy
+tag @s[scores={shop_apple=..0,gold=270..}] add canbuy
+
+tellraw @s[scores={shop_apple=1..}] ["",{"text":">> ","color":"aqua","bold":true},{"text":"你已经购买了这个物品了!","color":"aqua"}]
+tellraw @s[scores={shop_apple=..0,gold=..269}] ["",{"text":">> ","color":"red","bold":true},{"text":"你没有足够的金锭来购买这个物品!","color":"red"}]
+
+tellraw @s[tag=canbuy] ["",{"text":">> ","color":"green","bold":true},"你购买了 ",{"text":"生命果","color":"green"},"!"]
+scoreboard players add @s[tag=canbuy] shop_apple 1
+scoreboard players remove @s[tag=canbuy] gold 270
+
+execute as @s[tag=!canbuy] at @s run function lib:sounds/error
+execute as @s[tag=canbuy] at @s run function lib:sounds/levelup
+
+function ltw:shop/refresh_gold

+ 2 - 3
data/ltw/functions/shop/buy_armor1.mcfunction

@@ -7,12 +7,11 @@ tag @s[scores={shop_armor=..0,gold=36..}] add canbuy
 tellraw @s[scores={shop_armor=1..}] ["",{"text":">> ","color":"aqua","bold":true},{"text":"你已经购买了这个物品了!","color":"aqua"}]
 tellraw @s[scores={shop_armor=..0,gold=..35}] ["",{"text":">> ","color":"red","bold":true},{"text":"你没有足够的金锭来购买这个物品!","color":"red"}]
 
-tellraw @s[tag=canbuy] ["",{"text":">> ","color":"green","bold":true},{"text":"你购买了 皮革帽子!","color":"green"}]
+tellraw @s[tag=canbuy] ["",{"text":">> ","color":"green","bold":true},"你购买了 ",{"text":"皮革帽子","color":"green"},"!"]
 scoreboard players add @s[tag=canbuy] shop_armor 1
 scoreboard players remove @s[tag=canbuy] gold 36
 
 execute as @s[tag=!canbuy] at @s run function lib:sounds/error
 execute as @s[tag=canbuy] at @s run function lib:sounds/levelup
 
-function ltw:shop/refresh_gold
-function ltw:shop/refresh_equip
+function ltw:shop/refresh_gold

+ 2 - 3
data/ltw/functions/shop/buy_armor2.mcfunction

@@ -8,12 +8,11 @@ tellraw @s[scores={shop_armor=2..}] ["",{"text":">> ","color":"aqua","bold":true
 tellraw @s[scores={shop_armor=1,gold=..62}] ["",{"text":">> ","color":"red","bold":true},{"text":"你没有足够的金锭来购买这个物品!","color":"red"}]
 tellraw @s[scores={shop_armor=..0}] ["",{"text":">> ","color":"red","bold":true},{"text":"你需要先购买上一级的物品!","color":"red"}]
 
-tellraw @s[tag=canbuy] ["",{"text":">> ","color":"green","bold":true},{"text":"你升级到了 皮革裤子!","color":"green"}]
+tellraw @s[tag=canbuy] ["",{"text":">> ","color":"green","bold":true},"你升级到了 ",{"text":"皮革裤子","color":"green"},"!"]
 scoreboard players add @s[tag=canbuy] shop_armor 1
 scoreboard players remove @s[tag=canbuy] gold 63
 
 execute as @s[tag=!canbuy] at @s run function lib:sounds/error
 execute as @s[tag=canbuy] at @s run function lib:sounds/levelup
 
-function ltw:shop/refresh_gold
-function ltw:shop/refresh_equip
+function ltw:shop/refresh_gold

+ 2 - 3
data/ltw/functions/shop/buy_armor3.mcfunction

@@ -8,12 +8,11 @@ tellraw @s[scores={shop_armor=3..}] ["",{"text":">> ","color":"aqua","bold":true
 tellraw @s[scores={shop_armor=2,gold=..89}] ["",{"text":">> ","color":"red","bold":true},{"text":"你没有足够的金锭来购买这个物品!","color":"red"}]
 tellraw @s[scores={shop_armor=..1}] ["",{"text":">> ","color":"red","bold":true},{"text":"你需要先购买上一级的物品!","color":"red"}]
 
-tellraw @s[tag=canbuy] ["",{"text":">> ","color":"green","bold":true},{"text":"你升级到了 皮革外套!","color":"green"}]
+tellraw @s[tag=canbuy] ["",{"text":">> ","color":"green","bold":true},"你升级到了 ",{"text":"皮革外套","color":"green"},"!"]
 scoreboard players add @s[tag=canbuy] shop_armor 1
 scoreboard players remove @s[tag=canbuy] gold 90
 
 execute as @s[tag=!canbuy] at @s run function lib:sounds/error
 execute as @s[tag=canbuy] at @s run function lib:sounds/levelup
 
-function ltw:shop/refresh_gold
-function ltw:shop/refresh_equip
+function ltw:shop/refresh_gold

+ 2 - 3
data/ltw/functions/shop/buy_arrow1.mcfunction

@@ -7,12 +7,11 @@ tag @s[scores={shop_arrow=..0,gold=9..}] add canbuy
 tellraw @s[scores={shop_arrow=1..}] ["",{"text":">> ","color":"aqua","bold":true},{"text":"你已经购买了这个物品了!","color":"aqua"}]
 tellraw @s[scores={shop_arrow=..0,gold=..8}] ["",{"text":">> ","color":"red","bold":true},{"text":"你没有足够的金锭来购买这个物品!","color":"red"}]
 
-tellraw @s[tag=canbuy] ["",{"text":">> ","color":"green","bold":true},{"text":"你购买了 箭 x2!","color":"green"}]
+tellraw @s[tag=canbuy] ["",{"text":">> ","color":"green","bold":true},"你购买了 ",{"text":"箭 x2","color":"green"},"!"]
 scoreboard players add @s[tag=canbuy] shop_arrow 1
 scoreboard players remove @s[tag=canbuy] gold 9
 
 execute as @s[tag=!canbuy] at @s run function lib:sounds/error
 execute as @s[tag=canbuy] at @s run function lib:sounds/levelup
 
-function ltw:shop/refresh_gold
-function ltw:shop/refresh_equip
+function ltw:shop/refresh_gold

+ 2 - 3
data/ltw/functions/shop/buy_arrow2.mcfunction

@@ -8,12 +8,11 @@ tellraw @s[scores={shop_arrow=2..}] ["",{"text":">> ","color":"aqua","bold":true
 tellraw @s[scores={shop_arrow=1,gold=..44}] ["",{"text":">> ","color":"red","bold":true},{"text":"你没有足够的金锭来购买这个物品!","color":"red"}]
 tellraw @s[scores={shop_arrow=..0}] ["",{"text":">> ","color":"red","bold":true},{"text":"你需要先购买上一级的物品!","color":"red"}]
 
-tellraw @s[tag=canbuy] ["",{"text":">> ","color":"green","bold":true},{"text":"你升级到了 缓慢之箭 x3!","color":"green"}]
+tellraw @s[tag=canbuy] ["",{"text":">> ","color":"green","bold":true},"你升级到了 ",{"text":"缓慢之箭 x3","color":"green"},"!"]
 scoreboard players add @s[tag=canbuy] shop_arrow 1
 scoreboard players remove @s[tag=canbuy] gold 45
 
 execute as @s[tag=!canbuy] at @s run function lib:sounds/error
 execute as @s[tag=canbuy] at @s run function lib:sounds/levelup
 
-function ltw:shop/refresh_gold
-function ltw:shop/refresh_equip
+function ltw:shop/refresh_gold

+ 17 - 0
data/ltw/functions/shop/buy_potion1.mcfunction

@@ -0,0 +1,17 @@
+# 速度药 (5 gi)
+
+execute unless entity @s[scores={shop_potion=0..}] run scoreboard players set @s shop_potion 0
+tag @s remove canbuy
+tag @s[scores={shop_potion=..0,gold=36..}] add canbuy
+
+tellraw @s[scores={shop_potion=1..}] ["",{"text":">> ","color":"aqua","bold":true},{"text":"你已经购买了这个物品了!","color":"aqua"}]
+tellraw @s[scores={shop_potion=..0,gold=..35}] ["",{"text":">> ","color":"red","bold":true},{"text":"你没有足够的金锭来购买这个物品!","color":"red"}]
+
+tellraw @s[tag=canbuy] ["",{"text":">> ","color":"green","bold":true},"你购买了 ",{"text":"速度 (0:20) 药水","color":"green"},"!"]
+scoreboard players add @s[tag=canbuy] shop_potion 1
+scoreboard players remove @s[tag=canbuy] gold 36
+
+execute as @s[tag=!canbuy] at @s run function lib:sounds/error
+execute as @s[tag=canbuy] at @s run function lib:sounds/levelup
+
+function ltw:shop/refresh_gold

+ 2 - 3
data/ltw/functions/shop/buy_weapon1.mcfunction

@@ -7,12 +7,11 @@ tag @s[scores={shop_weapon=..0,gold=18..}] add canbuy
 tellraw @s[scores={shop_weapon=1..}] ["",{"text":">> ","color":"aqua","bold":true},{"text":"你已经购买了这个物品了!","color":"aqua"}]
 tellraw @s[scores={shop_weapon=..0,gold=..17}] ["",{"text":">> ","color":"red","bold":true},{"text":"你没有足够的金锭来购买这个物品!","color":"red"}]
 
-tellraw @s[tag=canbuy] ["",{"text":">> ","color":"green","bold":true},{"text":"你购买了 木锹!","color":"green"}]
+tellraw @s[tag=canbuy] ["",{"text":">> ","color":"green","bold":true},"你购买了 ",{"text":"木锹","color":"green"},"!"]
 scoreboard players add @s[tag=canbuy] shop_weapon 1
 scoreboard players remove @s[tag=canbuy] gold 18
 
 execute as @s[tag=!canbuy] at @s run function lib:sounds/error
 execute as @s[tag=canbuy] at @s run function lib:sounds/levelup
 
-function ltw:shop/refresh_gold
-function ltw:shop/refresh_equip
+function ltw:shop/refresh_gold

+ 6 - 7
data/ltw/functions/shop/buy_weapon2.mcfunction

@@ -1,19 +1,18 @@
-# 石铲 (5 gi)
+# 木斧 (6 gi)
 
 execute unless entity @s[scores={shop_weapon=0..}] run scoreboard players set @s shop_weapon 0
 tag @s remove canbuy
-tag @s[scores={shop_weapon=1,gold=45..}] add canbuy
+tag @s[scores={shop_weapon=1,gold=54..}] add canbuy
 
 tellraw @s[scores={shop_weapon=2..}] ["",{"text":">> ","color":"aqua","bold":true},{"text":"你已经购买了这个物品了!","color":"aqua"}]
-tellraw @s[scores={shop_weapon=1,gold=..44}] ["",{"text":">> ","color":"red","bold":true},{"text":"你没有足够的金锭来购买这个物品!","color":"red"}]
+tellraw @s[scores={shop_weapon=1,gold=..53}] ["",{"text":">> ","color":"red","bold":true},{"text":"你没有足够的金锭来购买这个物品!","color":"red"}]
 tellraw @s[scores={shop_weapon=..0}] ["",{"text":">> ","color":"red","bold":true},{"text":"你需要先购买上一级的物品!","color":"red"}]
 
-tellraw @s[tag=canbuy] ["",{"text":">> ","color":"green","bold":true},{"text":"你升级到了 石锹!","color":"green"}]
+tellraw @s[tag=canbuy] ["",{"text":">> ","color":"green","bold":true},"你升级到了 ",{"text":"木斧","color":"green"},"!"]
 scoreboard players add @s[tag=canbuy] shop_weapon 1
-scoreboard players remove @s[tag=canbuy] gold 45
+scoreboard players remove @s[tag=canbuy] gold 54
 
 execute as @s[tag=!canbuy] at @s run function lib:sounds/error
 execute as @s[tag=canbuy] at @s run function lib:sounds/levelup
 
-function ltw:shop/refresh_gold
-function ltw:shop/refresh_equip
+function ltw:shop/refresh_gold

+ 8 - 8
data/ltw/functions/shop/refresh_equip.mcfunction

@@ -5,21 +5,21 @@ give @s[scores={shop_arrow=1}] arrow 2
 give @s[scores={shop_arrow=2}] tipped_arrow{Potion:"minecraft:slowness"} 3
 
 clear @s wooden_hoe
-clear @s stone_hoe
-give @s[scores={shop_weapon=1}] wooden_hoe
-give @s[scores={shop_weapon=2}] stone_hoe
+clear @s wooden_axe
+give @s[scores={shop_weapon=1}] wooden_hoe{display:{Name:'{"text":"木锹","italic":false,"color":"gray"}'}}
+give @s[scores={shop_weapon=2}] wooden_axe{display:{Name:'{"text":"木斧","italic":false,"color":"gray"}'}}
 
 clear @s potion
-give @s[scores={shop_potion=1}] potion
+give @s[scores={shop_potion=1}] potion{CustomPotionEffects:[{Id:1,Amplifier:0,Duration:400}],CustomPotionColor:8039610,display:{Name:'{"text":"喷溅型速度药水","italic":false,"color":"gray"}'}}
 
 clear @s golden_apple
-give @s[scores={shop_potion=1}] golden_apple
+give @s[scores={shop_apple=1}] golden_apple{display:{Lore:['{"text":"恢复 4 颗心或生命 +1","italic":false,"color":"gray"}'],Name:'{"text":"生命果","italic":false,"color":"green"}'}}
 
 replaceitem entity @s armor.head air
-replaceitem entity @s[scores={shop_armor=1}] armor.head leather_helmet
+replaceitem entity @s[scores={shop_armor=1}] armor.head leather_helmet{display:{Name:'{"text":"皮革帽子","italic":false,"color":"gray"}'}}
 replaceitem entity @s armor.chest air
-replaceitem entity @s[scores={shop_armor=3}] armor.chest leather_chestplate
+replaceitem entity @s[scores={shop_armor=3}] armor.chest leather_chestplate{display:{Name:'{"text":"皮革外套","italic":false,"color":"gray"}'}}
 replaceitem entity @s armor.legs air
-replaceitem entity @s[scores={shop_armor=2}] armor.legs leather_leggings
+replaceitem entity @s[scores={shop_armor=2}] armor.legs leather_leggings{display:{Name:'{"text":"皮革裤子","italic":false,"color":"gray"}'}}
 
 # FIXME : 幻翼击杀数有旁观显示

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

@@ -25,5 +25,4 @@ tp @s[tag=!debug] 10 16 10
 
 # 刷新物品
 clear @s[tag=!debug]
-function ltw:shop/refresh_gold
-function ltw:shop/refresh_equip
+function ltw:shop/refresh_gold