00ll00 6 ani în urmă
părinte
comite
8c91eae5b8

+ 4 - 4
data/item/functions/shop/buy_arrow3.mcfunction

@@ -2,10 +2,10 @@
 # 触发器ID 9
 execute unless entity @s[scores={shop_arrow=0..}] run scoreboard players set @s shop_arrow 0
 tag @s remove canbuy
-tag @s[scores={shop_arrow=1,gold=81..}] add canbuy
-tellraw @s[scores={shop_arrow=2..}] ["",{"text":">> ","color":"aqua","bold":true},{"text":"你已经购买了这个物品了!","color":"aqua"}]
-tellraw @s[scores={shop_arrow=1,gold=..80}] ["",{"text":">> ","color":"red","bold":true},{"text":"你没有足够的金块来购买这个物品!","color":"red"}]
-tellraw @s[scores={shop_arrow=..0}] ["",{"text":">> ","color":"red","bold":true},{"text":"你需要先购买上一级的物品!","color":"red"}]
+tag @s[scores={shop_arrow=2,gold=81..}] add canbuy
+tellraw @s[scores={shop_arrow=3..}] ["",{"text":">> ","color":"aqua","bold":true},{"text":"你已经购买了这个物品了!","color":"aqua"}]
+tellraw @s[scores={shop_arrow=2,gold=..80}] ["",{"text":">> ","color":"red","bold":true},{"text":"你没有足够的金块来购买这个物品!","color":"red"}]
+tellraw @s[scores={shop_arrow=..1}] ["",{"text":">> ","color":"red","bold":true},{"text":"你需要先购买上一级的物品!","color":"red"}]
 tellraw @s[tag=canbuy] ["",{"text":">> ","color":"green","bold":true},"你购买了 ",{"text":"缓慢之箭 x2","color":"green"}]
 execute as @s[tag=canbuy] run tellraw @a[tag=!canbuy] ["",{"text":">> ","color":"green","bold":true},{"selector": "@s","color":"green"}," 购买了 ",{"text":"缓慢之箭 x2","color":"green"}]
 scoreboard players add @s[tag=canbuy] shop_arrow 1

+ 15 - 0
data/item/functions/shop/buy_bow.mcfunction

@@ -0,0 +1,15 @@
+# 破损的弓 (1 gb)
+# 触发器ID 15
+execute unless entity @s[scores={shop_bow=0..}] run scoreboard players set @s shop_bow 0
+tag @s remove canbuy
+tag @s[scores={shop_bow=0,gold=81..}] add canbuy
+tellraw @s[scores={shop_bow=1..}] ["",{"text":">> ","color":"aqua","bold":true},{"text":"你已经购买了这个物品了!","color":"aqua"}]
+tellraw @s[scores={shop_bow=0,gold=..80}] ["",{"text":">> ","color":"red","bold":true},{"text":"你没有足够的金块来购买这个物品!","color":"red"}]
+tellraw @s[scores={shop_bow=..-1}] ["",{"text":">> ","color":"red","bold":true},{"text":"你需要先购买上一级的物品!","color":"red"}]
+tellraw @s[tag=canbuy] ["",{"text":">> ","color":"green","bold":true},"你购买了 ",{"text":"破损的弓","color":"green"}]
+execute as @s[tag=canbuy] run tellraw @a[tag=!canbuy] ["",{"text":">> ","color":"green","bold":true},{"selector": "@s","color":"green"}," 购买了 ",{"text":"破损的弓","color":"green"}]
+scoreboard players add @s[tag=canbuy] shop_bow 1
+scoreboard players remove @s[tag=canbuy] gold 81
+execute as @s[tag=!canbuy] at @s run function lib:sounds/error
+execute as @s[tag=canbuy] at @s run function lib:sounds/levelup
+execute as @s[tag=canbuy] run function item:shop/refresh_gold

+ 15 - 0
data/item/functions/shop/buy_potion_resist.mcfunction

@@ -0,0 +1,15 @@
+# 抗性提升 (0:20) (1 gb)
+# 触发器ID 16
+execute unless entity @s[scores={shop_potion_rst=0..}] run scoreboard players set @s shop_potion_rst 0
+tag @s remove canbuy
+tag @s[scores={shop_potion_rst=0,gold=81..}] add canbuy
+tellraw @s[scores={shop_potion_rst=1..}] ["",{"text":">> ","color":"aqua","bold":true},{"text":"你已经购买了这个物品了!","color":"aqua"}]
+tellraw @s[scores={shop_potion_rst=0,gold=..80}] ["",{"text":">> ","color":"red","bold":true},{"text":"你没有足够的金块来购买这个物品!","color":"red"}]
+tellraw @s[scores={shop_potion_rst=..-1}] ["",{"text":">> ","color":"red","bold":true},{"text":"你需要先购买上一级的物品!","color":"red"}]
+tellraw @s[tag=canbuy] ["",{"text":">> ","color":"green","bold":true},"你购买了 ",{"text":"抗性提升 (0:20)","color":"green"}]
+execute as @s[tag=canbuy] run tellraw @a[tag=!canbuy] ["",{"text":">> ","color":"green","bold":true},{"selector": "@s","color":"green"}," 购买了 ",{"text":"抗性提升 (0:20)","color":"green"}]
+scoreboard players add @s[tag=canbuy] shop_potion_rst 1
+scoreboard players remove @s[tag=canbuy] gold 81
+execute as @s[tag=!canbuy] at @s run function lib:sounds/error
+execute as @s[tag=canbuy] at @s run function lib:sounds/levelup
+execute as @s[tag=canbuy] run function item:shop/refresh_gold

+ 15 - 0
data/item/functions/shop/buy_potion_speed1.mcfunction

@@ -0,0 +1,15 @@
+# 速度 (0:15) (4 gi)
+# 触发器ID 17
+execute unless entity @s[scores={shop_potion_spd=0..}] run scoreboard players set @s shop_potion_spd 0
+tag @s remove canbuy
+tag @s[scores={shop_potion_spd=0,gold=36..}] add canbuy
+tellraw @s[scores={shop_potion_spd=1..}] ["",{"text":">> ","color":"aqua","bold":true},{"text":"你已经购买了这个物品了!","color":"aqua"}]
+tellraw @s[scores={shop_potion_spd=0,gold=..35}] ["",{"text":">> ","color":"red","bold":true},{"text":"你没有足够的金锭来购买这个物品!","color":"red"}]
+tellraw @s[scores={shop_potion_spd=..-1}] ["",{"text":">> ","color":"red","bold":true},{"text":"你需要先购买上一级的物品!","color":"red"}]
+tellraw @s[tag=canbuy] ["",{"text":">> ","color":"green","bold":true},"你购买了 ",{"text":"速度 (0:15)","color":"green"}]
+execute as @s[tag=canbuy] run tellraw @a[tag=!canbuy] ["",{"text":">> ","color":"green","bold":true},{"selector": "@s","color":"green"}," 购买了 ",{"text":"速度 (0:15)","color":"green"}]
+scoreboard players add @s[tag=canbuy] shop_potion_spd 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
+execute as @s[tag=canbuy] run function item:shop/refresh_gold

+ 15 - 0
data/item/functions/shop/buy_potion_speed2.mcfunction

@@ -0,0 +1,15 @@
+# 速度 II (0:15) (1 gb)
+# 触发器ID 18
+execute unless entity @s[scores={shop_potion_spd=0..}] run scoreboard players set @s shop_potion_spd 0
+tag @s remove canbuy
+tag @s[scores={shop_potion_spd=1,gold=81..}] add canbuy
+tellraw @s[scores={shop_potion_spd=2..}] ["",{"text":">> ","color":"aqua","bold":true},{"text":"你已经购买了这个物品了!","color":"aqua"}]
+tellraw @s[scores={shop_potion_spd=1,gold=..80}] ["",{"text":">> ","color":"red","bold":true},{"text":"你没有足够的金块来购买这个物品!","color":"red"}]
+tellraw @s[scores={shop_potion_spd=..0}] ["",{"text":">> ","color":"red","bold":true},{"text":"你需要先购买上一级的物品!","color":"red"}]
+tellraw @s[tag=canbuy] ["",{"text":">> ","color":"green","bold":true},"你购买了 ",{"text":"速度 II (0:15)","color":"green"}]
+execute as @s[tag=canbuy] run tellraw @a[tag=!canbuy] ["",{"text":">> ","color":"green","bold":true},{"selector": "@s","color":"green"}," 购买了 ",{"text":"速度 II (0:15)","color":"green"}]
+scoreboard players add @s[tag=canbuy] shop_potion_spd 1
+scoreboard players remove @s[tag=canbuy] gold 81
+execute as @s[tag=!canbuy] at @s run function lib:sounds/error
+execute as @s[tag=canbuy] at @s run function lib:sounds/levelup
+execute as @s[tag=canbuy] run function item:shop/refresh_gold

+ 4 - 0
data/item/functions/shop/check.mcfunction

@@ -12,5 +12,9 @@ execute if score @s buy_trigger matches 11 run function item:shop/buy_weapon1
 execute if score @s buy_trigger matches 12 run function item:shop/buy_weapon2
 execute if score @s buy_trigger matches 13 run function item:shop/buy_weapon3
 execute if score @s buy_trigger matches 14 run function item:shop/buy_weapon4
+execute if score @s buy_trigger matches 15 run function item:shop/buy_bow
+execute if score @s buy_trigger matches 16 run function item:shop/buy_potion_resist
+execute if score @s buy_trigger matches 17 run function item:shop/buy_potion_speed1
+execute if score @s buy_trigger matches 18 run function item:shop/buy_potion_speed2
 scoreboard players set @s buy_trigger 0
 scoreboard players enable @s buy_trigger

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

@@ -63,6 +63,9 @@ scoreboard objectives add shop_apple dummy "苹果升级"
 scoreboard objectives add shop_armor dummy "护甲升级"
 scoreboard objectives add shop_weapon dummy "武器升级"
 scoreboard objectives add shop_orange dummy "活跃橙升级"
+scoreboard objectives add shop_potion_spd dummy "速度药水升级"
+scoreboard objectives add shop_potion_rst dummy "抗性药水升级"
+scoreboard objectives add shop_bow dummy "弓升级"
 
 # 常量与变量初始化
 scoreboard players set $c_mini_total mem 7