LTCatt 6 лет назад
Родитель
Сommit
7628955d04

+ 1 - 1
data/item/functions/tick2.mcfunction

@@ -1,6 +1,6 @@
 
 # 防止玩家丢弃物品:如果物品存在 Thrower 则要求强制捡起
-execute if score $state mem matches 1.. as @e[type=item] if data entity @s Thrower run function item:disable_throw
+execute as @e[type=item] if data entity @s Thrower run function item:disable_throw
 
 # 检查玩家拾取奖励物品
 execute as @a if data entity @s Inventory[{"tag":{"bonus_new":1b}}] run function item:bonus_item/call

+ 18 - 0
data/ltw/functions/shop/buy_armor1.mcfunction

@@ -0,0 +1,18 @@
+# 皮革头 (4 gi)
+
+execute unless entity @s[scores={shop_armor=0..}] run scoreboard players set @s shop_armor 0
+tag @s remove canbuy
+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"}]
+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

+ 19 - 0
data/ltw/functions/shop/buy_armor2.mcfunction

@@ -0,0 +1,19 @@
+# 皮革裤 (7 gi)
+
+execute unless entity @s[scores={shop_armor=0..}] run scoreboard players set @s shop_armor 0
+tag @s remove canbuy
+tag @s[scores={shop_armor=1,gold=63..}] add canbuy
+
+tellraw @s[scores={shop_armor=2..}] ["",{"text":">> ","color":"aqua","bold":true},{"text":"你已经购买了这个物品了!","color":"aqua"}]
+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"}]
+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

+ 19 - 0
data/ltw/functions/shop/buy_armor3.mcfunction

@@ -0,0 +1,19 @@
+# 皮革衣 (10 gi)
+
+execute unless entity @s[scores={shop_armor=0..}] run scoreboard players set @s shop_armor 0
+tag @s remove canbuy
+tag @s[scores={shop_armor=2,gold=90..}] add canbuy
+
+tellraw @s[scores={shop_armor=3..}] ["",{"text":">> ","color":"aqua","bold":true},{"text":"你已经购买了这个物品了!","color":"aqua"}]
+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"}]
+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

+ 10 - 1
data/ltw/functions/shop/refresh_equip.mcfunction

@@ -2,4 +2,13 @@
 
 clear @s arrow
 give @s[scores={shop_arrow=1}] arrow 2
-give @s[scores={shop_arrow=2}] tipped_arrow{Potion:"minecraft:slowness"} 3
+give @s[scores={shop_arrow=2}] tipped_arrow{Potion:"minecraft:slowness"} 3
+
+replaceitem entity @s armor.head air
+replaceitem entity @s[scores={shop_armor=1}] armor.head leather_helmet
+replaceitem entity @s armor.chest air
+replaceitem entity @s[scores={shop_armor=3}] armor.chest leather_chestplate
+replaceitem entity @s armor.legs air
+replaceitem entity @s[scores={shop_armor=2}] armor.legs leather_leggings
+
+# FIXME : 幻翼击杀数有旁观显示