00ll00 il y a 6 ans
Parent
commit
114143ce14

+ 2 - 1
.gitignore

@@ -1,3 +1,4 @@
 .vscode
 *.code-workspace
-*.py
+*.py
+*.pyc

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

@@ -0,0 +1,15 @@
+# 老板换碟 (1 gi)
+# 触发器ID 20
+execute unless entity @s[scores={shop_bgm=0..}] run scoreboard players set @s shop_bgm 0
+tag @s remove canbuy
+tag @s[scores={shop_bgm=0,gold=9..}] add canbuy
+tellraw @s[scores={shop_bgm=1..}] ["",{"text":">> ","color":"aqua","bold":true},{"text":"你已经购买了这个物品了!","color":"aqua"}]
+tellraw @s[scores={shop_bgm=0,gold=..8}] ["",{"text":">> ","color":"red","bold":true},{"text":"你没有足够的金锭来购买这个物品!","color":"red"}]
+tellraw @s[scores={shop_bgm=..-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"}]
+function item:shop/special_bgm
+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
+execute as @s[tag=canbuy] run function item:shop/refresh_gold

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

@@ -0,0 +1,15 @@
+# 漂亮烟花 (1 gb)
+# 触发器ID 19
+execute unless entity @s[scores={shop_firework=0..}] run scoreboard players set @s shop_firework 0
+tag @s remove canbuy
+tag @s[scores={shop_firework=0,gold=81..}] add canbuy
+tellraw @s[scores={shop_firework=1..}] ["",{"text":">> ","color":"aqua","bold":true},{"text":"你已经购买了这个物品了!","color":"aqua"}]
+tellraw @s[scores={shop_firework=0,gold=..80}] ["",{"text":">> ","color":"red","bold":true},{"text":"你没有足够的金块来购买这个物品!","color":"red"}]
+tellraw @s[scores={shop_firework=..-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"}]
+function item:shop/special_firework
+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

+ 1 - 1
data/item/functions/shop/buy_orange.mcfunction

@@ -6,7 +6,7 @@ tag @s[scores={shop_orange=0,gold=243..}] add canbuy
 tellraw @s[scores={shop_orange=1..}] ["",{"text":">> ","color":"aqua","bold":true},{"text":"你已经购买了这个物品了!","color":"aqua"}]
 tellraw @s[scores={shop_orange=0,gold=..242}] ["",{"text":">> ","color":"red","bold":true},{"text":"你没有足够的金块来购买这个物品!","color":"red"}]
 tellraw @s[scores={shop_orange=..-1}] ["",{"text":">> ","color":"red","bold":true},{"text":"你需要先购买上一级的物品!","color":"red"}]
-tellraw @s[tag=canbuy] ["",{"text":">> ","color":"green","bold":true},"你购买了 ",{"text":"活跃橙","color":"green"},{"text":"请私聊龙猫领取","color":"green"}]
+tellraw @s[tag=canbuy] ["",{"text":">> ","color":"green","bold":true},"你购买了 ",{"text":"活跃橙","color":"green"},{"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_orange 1
 scoreboard players remove @s[tag=canbuy] gold 243

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

@@ -0,0 +1,15 @@
+# 哼唧 (1 gn)
+# 触发器ID 21
+execute unless entity @s[scores={shop_pig=0..}] run scoreboard players set @s shop_pig 0
+tag @s remove canbuy
+tag @s[scores={shop_pig=0,gold=1..}] add canbuy
+tellraw @s[scores={shop_pig=1..}] ["",{"text":">> ","color":"aqua","bold":true},{"text":"你已经购买了这个物品了!","color":"aqua"}]
+tellraw @s[scores={shop_pig=0,gold=..0}] ["",{"text":">> ","color":"red","bold":true},{"text":"你没有足够的金粒来购买这个物品!","color":"red"}]
+tellraw @s[scores={shop_pig=..-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"}]
+function item:shop/special_pig
+scoreboard players remove @s[tag=canbuy] gold 1
+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

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

@@ -16,5 +16,8 @@ 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
+execute if score @s buy_trigger matches 19 run function item:shop/buy_firework
+execute if score @s buy_trigger matches 20 run function item:shop/buy_bgm
+execute if score @s buy_trigger matches 21 run function item:shop/buy_pig
 scoreboard players set @s buy_trigger 0
 scoreboard players enable @s buy_trigger

+ 1 - 0
data/item/functions/shop/special_bgm.mcfunction

@@ -0,0 +1 @@
+execute as @a run function lib:sounds/music/mini_fast

+ 0 - 0
data/item/functions/shop/special_firework.mcfunction


+ 1 - 0
data/item/functions/shop/special_pig.mcfunction

@@ -0,0 +1 @@
+execute at @s run playsound entity.pig.ambient ambient @a ~ ~ ~ 

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

@@ -66,6 +66,9 @@ 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 objectives add shop_firework dummy "烟花"
+scoreboard objectives add shop_bgm dummy "BGM"
+scoreboard objectives add shop_pig dummy "猪叫"
 
 # 常量与变量初始化
 scoreboard players set $c_mini_total mem 7