Explorar o código

更新粒子效果商店

夏可文 %!s(int64=6) %!d(string=hai) anos
pai
achega
82dc498ce3

+ 6 - 0
data/item/functions/particle/reset_particle.mcfunction

@@ -0,0 +1,6 @@
+tag @s remove show_particle_1
+tag @s remove show_particle_2
+tag @s remove show_particle_3
+tag @s remove show_particle_4
+tag @s remove show_particle_5
+tag @s remove show_particle_6

+ 8 - 0
data/item/functions/particle/show_particle.mcfunction

@@ -0,0 +1,8 @@
+# 播放粒子效果
+execute as @a[tag=show_particle_1] at @s run particle minecraft:composter ~ ~ ~ 0.15 0 0.15 0.001 2 force @a[tag=particle]
+execute as @a[tag=show_particle_2] at @s run particle dust 1 1 1 1.5 ~ ~ ~ 0.15 0 0.15 0.001 2 force @a[tag=particle]
+execute as @a[tag=show_particle_3] at @s run particle minecraft:falling_water ~ ~ ~ 0.15 0 0.15 0.001 2 force @a[tag=particle]
+execute as @a[tag=show_particle_4] at @s run particle flame ~ ~0.1 ~ 0.15 0 0.15 0.001 2 force @a[tag=particle]
+execute as @a[tag=show_particle_5] at @s run particle dust 10 10 10 1.5 ~ ~ ~ 0.15 0 0.15 0.001 2 force @a[tag=particle]
+execute as @a[tag=show_particle_6] at @s run particle minecraft:soul_fire_flame ~ ~0.1 ~ 0.15 0 0.15 0.001 1 force @a[tag=particle]
+execute as @a[tag=show_particle_6] at @s run particle flame ~ ~0.1 ~ 0.15 0 0.15 0.001 1 force @a[tag=particle]

+ 16 - 0
data/item/functions/shop/buy_particle0.mcfunction

@@ -0,0 +1,16 @@
+# 关闭粒子 (0 e)
+# 触发器ID 102
+tag @s remove canbuy
+tag @s[tag=show_particle_1,tag=particle] add canbuy
+tag @s[tag=show_particle_2,tag=particle] add canbuy
+tag @s[tag=show_particle_3,tag=particle] add canbuy
+tag @s[tag=show_particle_4,tag=particle] add canbuy
+tag @s[tag=show_particle_5,tag=particle] add canbuy
+tag @s[tag=show_particle_6,tag=particle] add canbuy
+tellraw @s[tag=canbuy] ["",{"text":">> ","color":"aqua","bold":true},{"text":"成功关闭了自己的 ","color":"aqua"},{"text":"粒子效果","color":"green"}]
+tellraw @s[tag=!canbuy,tag=particle] ["",{"text":">> ","color":"aqua","bold":true},{"text":"你已经关闭了自己的 ","color":"aqua"},{"text":"粒子效果","color":"green"}]
+tellraw @s[tag=!particle] ["",{"text":">> ","color":"red","bold":true},{"text":"你需要先购买粒子效果系统!","color":"red"}]
+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:particle/reset_particle
+tag @s remove canbuy

+ 19 - 0
data/item/functions/shop/buy_particle1.mcfunction

@@ -0,0 +1,19 @@
+# 绿光粒子 (0 e)
+# 触发器ID 103
+execute unless entity @s[scores={shop_particle_1=0..}] run scoreboard players set @s shop_particle_1 0
+tag @s remove canbuy
+tag @s[scores={shop_particle_1=0,green=0..},tag=particle] add canbuy
+tellraw @s[scores={shop_particle_1=1..},tag=!show_particle_1] ["",{"text":">> ","color":"aqua","bold":true},{"text":"成功切换 ","color":"aqua"},{"text":"炫彩粒子","color":"green"}]
+tellraw @s[scores={shop_particle_1=1..},tag=show_particle_1] ["",{"text":">> ","color":"aqua","bold":true},{"text":"你已经激活了 ","color":"aqua"},{"text":"炫彩粒子","color":"green"}]
+tellraw @s[scores={shop_particle_1=0,green=..0}] ["",{"text":">> ","color":"red","bold":true},{"text":"你没有足够的绿宝石来购买这个粒子!","color":"red"}]
+tellraw @s[tag=!particle] ["",{"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_particle_1 1
+execute as @s[scores={shop_particle_1=0}] at @s run function lib:sounds/error
+execute as @s[scores={shop_particle_1=1..}] at @s run function lib:sounds/levelup
+tag @s remove canbuy
+
+# 切换粒子
+execute as @s[scores={shop_particle_1=1..},tag=!show_particle_1] run function item:particle/reset_particle
+execute as @s[scores={shop_particle_1=1..},tag=!show_particle_1] run tag @s add show_particle_1

+ 21 - 0
data/item/functions/shop/buy_particle2.mcfunction

@@ -0,0 +1,21 @@
+# 素雅粒子 (3 e)
+# 触发器ID 104
+execute unless entity @s[scores={shop_particle_2=0..}] run scoreboard players set @s shop_particle_2 0
+tag @s remove canbuy
+tag @s[scores={shop_particle_2=0,green=3..},tag=particle] add canbuy
+tellraw @s[scores={shop_particle_2=1..},tag=!show_particle_2] ["",{"text":">> ","color":"aqua","bold":true},{"text":"成功切换 ","color":"aqua"},{"text":"素雅粒子","color":"green"}]
+tellraw @s[scores={shop_particle_2=1..},tag=show_particle_2] ["",{"text":">> ","color":"aqua","bold":true},{"text":"你已经激活了 ","color":"aqua"},{"text":"素雅粒子","color":"green"}]
+tellraw @s[scores={shop_particle_2=0,green=..2}] ["",{"text":">> ","color":"red","bold":true},{"text":"你没有足够的绿宝石来购买这个粒子!","color":"red"}]
+tellraw @s[tag=!particle] ["",{"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_particle_2 1
+scoreboard players remove @s[tag=canbuy] green 3
+execute as @s[scores={shop_particle_2=0}] at @s run function lib:sounds/error
+execute as @s[scores={shop_particle_2=1..}] at @s run function lib:sounds/levelup
+execute as @s[tag=canbuy] run function item:shop/refresh_green
+tag @s remove canbuy
+
+# 切换粒子
+execute as @s[scores={shop_particle_2=1..},tag=!show_particle_2] run function item:particle/reset_particle
+execute as @s[scores={shop_particle_2=1..},tag=!show_particle_2] run tag @s add show_particle_2

+ 21 - 0
data/item/functions/shop/buy_particle3.mcfunction

@@ -0,0 +1,21 @@
+# 水滴粒子 (3 e)
+# 触发器ID 105
+execute unless entity @s[scores={shop_particle_3=0..}] run scoreboard players set @s shop_particle_3 0
+tag @s remove canbuy
+tag @s[scores={shop_particle_3=0,green=3..},tag=particle] add canbuy
+tellraw @s[scores={shop_particle_3=1..},tag=!show_particle_3] ["",{"text":">> ","color":"aqua","bold":true},{"text":"成功切换 ","color":"aqua"},{"text":"水滴粒子","color":"green"}]
+tellraw @s[scores={shop_particle_3=1..},tag=show_particle_3] ["",{"text":">> ","color":"aqua","bold":true},{"text":"你已经激活了 ","color":"aqua"},{"text":"水滴粒子","color":"green"}]
+tellraw @s[scores={shop_particle_3=0,green=..2}] ["",{"text":">> ","color":"red","bold":true},{"text":"你没有足够的绿宝石来购买这个粒子!","color":"red"}]
+tellraw @s[tag=!particle] ["",{"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_particle_3 1
+scoreboard players remove @s[tag=canbuy] green 3
+execute as @s[scores={shop_particle_3=0}] at @s run function lib:sounds/error
+execute as @s[scores={shop_particle_3=1..}] at @s run function lib:sounds/levelup
+execute as @s[tag=canbuy] run function item:shop/refresh_green
+tag @s remove canbuy
+
+# 切换粒子
+execute if entity @s[scores={shop_particle_3=1..},tag=!show_particle_3] run function item:particle/reset_particle
+execute if entity @s[scores={shop_particle_3=1..},tag=!show_particle_3] run tag @s add show_particle_3

+ 21 - 0
data/item/functions/shop/buy_particle4.mcfunction

@@ -0,0 +1,21 @@
+# 烈焰粒子 (6 e)
+# 触发器ID 106
+execute unless entity @s[scores={shop_particle_4=0..}] run scoreboard players set @s shop_particle_4 0
+tag @s remove canbuy
+tag @s[scores={shop_particle_4=0,green=6..},tag=particle] add canbuy
+tellraw @s[scores={shop_particle_4=1..},tag=!show_particle_4] ["",{"text":">> ","color":"aqua","bold":true},{"text":"成功切换 ","color":"aqua"},{"text":"烈焰粒子","color":"green"}]
+tellraw @s[scores={shop_particle_4=1..},tag=show_particle_4] ["",{"text":">> ","color":"aqua","bold":true},{"text":"你已经激活了 ","color":"aqua"},{"text":"烈焰粒子","color":"green"}]
+tellraw @s[scores={shop_particle_4=0,green=..5}] ["",{"text":">> ","color":"red","bold":true},{"text":"你没有足够的绿宝石来购买这个粒子!","color":"red"}]
+tellraw @s[tag=!particle] ["",{"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_particle_4 1
+scoreboard players remove @s[tag=canbuy] green 6
+execute as @s[scores={shop_particle_4=0}] at @s run function lib:sounds/error
+execute as @s[scores={shop_particle_4=1..}] at @s run function lib:sounds/levelup
+execute as @s[tag=canbuy] run function item:shop/refresh_green
+tag @s remove canbuy
+
+# 切换粒子
+execute if entity @s[scores={shop_particle_4=1..},tag=!show_particle_4] run function item:particle/reset_particle
+execute if entity @s[scores={shop_particle_4=1..},tag=!show_particle_4] run tag @s add show_particle_4

+ 21 - 0
data/item/functions/shop/buy_particle5.mcfunction

@@ -0,0 +1,21 @@
+# 炫彩粒子 (6 e)
+# 触发器ID 107
+execute unless entity @s[scores={shop_particle_5=0..}] run scoreboard players set @s shop_particle_5 0
+tag @s remove canbuy
+tag @s[scores={shop_particle_5=0,green=6..},tag=particle] add canbuy
+tellraw @s[scores={shop_particle_5=1..},tag=!show_particle_5] ["",{"text":">> ","color":"aqua","bold":true},{"text":"成功切换 ","color":"aqua"},{"text":"炫彩粒子","color":"green"}]
+tellraw @s[scores={shop_particle_5=1..},tag=show_particle_5] ["",{"text":">> ","color":"aqua","bold":true},{"text":"你已经激活了 ","color":"aqua"},{"text":"炫彩粒子","color":"green"}]
+tellraw @s[scores={shop_particle_5=0,green=..5}] ["",{"text":">> ","color":"red","bold":true},{"text":"你没有足够的绿宝石来购买这个粒子!","color":"red"}]
+tellraw @s[tag=!particle] ["",{"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_particle_5 1
+scoreboard players remove @s[tag=canbuy] green 6
+execute as @s[scores={shop_particle_5=0}] at @s run function lib:sounds/error
+execute as @s[scores={shop_particle_5=1..}] at @s run function lib:sounds/levelup
+execute as @s[tag=canbuy] run function item:shop/refresh_green
+tag @s remove canbuy
+
+# 切换粒子
+execute if entity @s[scores={shop_particle_5=1..},tag=!show_particle_5] run function item:particle/reset_particle
+execute if entity @s[scores={shop_particle_5=1..},tag=!show_particle_5] run tag @s add show_particle_5

+ 21 - 0
data/item/functions/shop/buy_particle6.mcfunction

@@ -0,0 +1,21 @@
+# 混焰粒子 (9 e)
+# 触发器ID 108
+execute unless entity @s[scores={shop_particle_6=0..}] run scoreboard players set @s shop_particle_6 0
+tag @s remove canbuy
+tag @s[scores={shop_particle_6=0,green=9..},tag=particle] add canbuy
+tellraw @s[scores={shop_particle_6=1..},tag=!show_particle_6] ["",{"text":">> ","color":"aqua","bold":true},{"text":"成功切换 ","color":"aqua"},{"text":"混焰粒子","color":"green"}]
+tellraw @s[scores={shop_particle_6=1..},tag=show_particle_6] ["",{"text":">> ","color":"aqua","bold":true},{"text":"你已经激活了 ","color":"aqua"},{"text":"混焰粒子","color":"green"}]
+tellraw @s[scores={shop_particle_6=0,green=..8}] ["",{"text":">> ","color":"red","bold":true},{"text":"你没有足够的绿宝石来购买这个粒子!","color":"red"}]
+tellraw @s[tag=!particle] ["",{"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_particle_6 1
+scoreboard players remove @s[tag=canbuy] green 9
+execute as @s[scores={shop_particle_6=0}] at @s run function lib:sounds/error
+execute as @s[scores={shop_particle_6=1..}] at @s run function lib:sounds/levelup
+execute as @s[tag=canbuy] run function item:shop/refresh_green
+tag @s remove canbuy
+
+# 切换粒子
+execute if entity @s[scores={shop_particle_6=1..},tag=!show_particle_6] run function item:particle/reset_particle
+execute if entity @s[scores={shop_particle_6=1..},tag=!show_particle_6] run tag @s add show_particle_6

+ 12 - 0
data/item/functions/shop/buy_particle_close.mcfunction

@@ -0,0 +1,12 @@
+# 粒子系统关闭 (0 eb)
+# 触发器ID 101
+execute unless entity @s[scores={shop_particle_s=0..}] run scoreboard players set @s shop_particle_s 0
+tag @s remove canbuy
+tag @s[scores={shop_particle_s=1..},tag=particle] add canbuy
+tellraw @s[scores={shop_particle_s=1..},tag=particle] ["",{"text":">> ","color":"aqua","bold":true},{"text":"成功关闭 ","color":"aqua"},{"text":"粒子系统","color":"green"}]
+tellraw @s[scores={shop_particle_s=1..},tag=!particle] ["",{"text":">> ","color":"aqua","bold":true},{"text":"你已经关闭了 ","color":"aqua"},{"text":"粒子系统","color":"green"}]
+tellraw @s[scores={shop_particle_s=0}] ["",{"text":">> ","color":"red","bold":true},{"text":"你需要先购买粒子效果系统!","color":"red"}]
+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 tag @s remove particle
+tag @s remove canbuy

+ 19 - 0
data/item/functions/shop/buy_particle_system.mcfunction

@@ -0,0 +1,19 @@
+# 粒子系统 (2 eb)
+# 触发器ID 100
+execute unless entity @s[scores={shop_particle_s=0..}] run scoreboard players set @s shop_particle_s 0
+tag @s remove canbuy
+tag @s[scores={shop_particle_s=0,green=18..},tag=!particle] add canbuy
+tellraw @s[scores={shop_particle_s=1..},tag=!particle] ["",{"text":">> ","color":"aqua","bold":true},{"text":"成功打开 ","color":"aqua"},{"text":"粒子系统","color":"green"}]
+tellraw @s[scores={shop_particle_s=1..},tag=particle] ["",{"text":">> ","color":"aqua","bold":true},{"text":"你已经打开了 ","color":"aqua"},{"text":"粒子系统","color":"green"}]
+tellraw @s[scores={shop_particle_s=0,green=..17}] ["",{"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_particle_s 1
+scoreboard players remove @s[tag=canbuy] green 18
+execute as @s[scores={shop_particle_s=0}] at @s run function lib:sounds/error
+execute as @s[scores={shop_particle_s=1..}] at @s run function lib:sounds/levelup
+execute as @s[tag=canbuy] run function item:shop/refresh_green
+tag @s remove canbuy
+
+# 打开粒子系统
+execute as @s[scores={shop_particle_s=1..},tag=!particle] run tag @s add particle

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

@@ -18,6 +18,15 @@ execute if score @s buy_trigger matches 18 if score $state mem matches 0 run fun
 execute if score @s buy_trigger matches 19 if score $state mem matches 0 run function item:shop/buy_firework
 execute if score @s buy_trigger matches 20 if score $state mem matches 0 run function item:shop/buy_bgm
 execute if score @s buy_trigger matches 21 if score $state mem matches 0 run function item:shop/buy_pig
+execute if score @s buy_trigger matches 100 if score $state mem matches 0 run function item:shop/buy_particle_system
+execute if score @s buy_trigger matches 101 if score $state mem matches 0 run function item:shop/buy_particle_close
+execute if score @s buy_trigger matches 102 if score $state mem matches 0 run function item:shop/buy_particle0
+execute if score @s buy_trigger matches 103 if score $state mem matches 0 run function item:shop/buy_particle1
+execute if score @s buy_trigger matches 104 if score $state mem matches 0 run function item:shop/buy_particle2
+execute if score @s buy_trigger matches 105 if score $state mem matches 0 run function item:shop/buy_particle3
+execute if score @s buy_trigger matches 106 if score $state mem matches 0 run function item:shop/buy_particle4
+execute if score @s buy_trigger matches 107 if score $state mem matches 0 run function item:shop/buy_particle5
+execute if score @s buy_trigger matches 108 if score $state mem matches 0 run function item:shop/buy_particle6
 execute if score @s buy_trigger matches 999 if score $state mem matches 0 run function item:shop/buy_dice
 execute if score @s buy_trigger matches 114514 if score $state mem matches 0 run function item:shop/buy_easter_egg
 scoreboard players set @s buy_trigger 0

+ 1 - 1
data/ltw/functions/clock/tick1.mcfunction

@@ -1,4 +1,4 @@
 # 每 1 Tick 执行一次
 
 # 调用其他模块
-execute if score $state mem matches 5 run function ltw:state/5/tick1
+execute if score $state mem matches 5 run function ltw:state/5/tick1

+ 3 - 0
data/ltw/functions/clock/tick2.mcfunction

@@ -15,6 +15,9 @@ function lib:effect/floating
 # 调用节奏方块模块
 execute if score $tempo_enable mem matches 1 run function lib:tempo_block/tick2
 
+# 调用粒子模块
+function item:particle/show_particle
+
 # 调用物品模块(必须最后调用)
 function item:tick2
 

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

@@ -76,6 +76,13 @@ scoreboard objectives add shop_firework dummy "烟花"
 scoreboard objectives add shop_bgm dummy "BGM"
 scoreboard objectives add shop_pig dummy "猪叫"
 scoreboard objectives add shop_easter_egg dummy "臭彩蛋"
+scoreboard objectives add shop_particle_s dummy "粒子效果系统"
+scoreboard objectives add shop_particle_1 dummy "粒子效果1"
+scoreboard objectives add shop_particle_2 dummy "粒子效果2"
+scoreboard objectives add shop_particle_3 dummy "粒子效果3"
+scoreboard objectives add shop_particle_4 dummy "粒子效果4"
+scoreboard objectives add shop_particle_5 dummy "粒子效果5"
+scoreboard objectives add shop_particle_5 dummy "粒子效果6"
 scoreboard objectives add shop_dice dummy "骰子"
 scoreboard objectives add stat_total dummy "总场次"
 scoreboard objectives add stat_win dummy "总胜场"