LTCatt 6 роки тому
батько
коміт
f2f8fc3f85

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

@@ -1,6 +0,0 @@
-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

+ 7 - 7
data/item/functions/particle/show_particle.mcfunction

@@ -1,11 +1,11 @@
 # 播放玩家粒子效果
-execute as @a[tag=show_particle_1,gamemode=!spectator] at @s run particle composter ~ ~0.1 ~ 0.15 0 0.15 0.001 2 force @a
-execute as @a[tag=show_particle_2,gamemode=!spectator] at @s run particle dust 1 1 1 1.5 ~ ~0.1 ~ 0.15 0 0.15 0.001 2 force @a
-execute as @a[tag=show_particle_3,gamemode=!spectator] at @s run particle falling_water ~ ~0.1 ~ 0.15 0 0.15 0.001 3 force @a
-execute as @a[tag=show_particle_4,gamemode=!spectator] at @s run particle flame ~ ~0.1 ~ 0.15 0 0.15 0.001 2 force @a
-execute as @a[tag=show_particle_5,gamemode=!spectator] at @s run particle dust 10 10 10 1.5 ~ ~0.1 ~ 0.15 0 0.15 0.001 2 force @a
-execute as @a[tag=show_particle_6,gamemode=!spectator] at @s run particle soul_fire_flame ~ ~0.1 ~ 0.15 0 0.15 0.001 1 force @a
-execute as @a[tag=show_particle_6,gamemode=!spectator] at @s run particle flame ~ ~0.1 ~ 0.15 0 0.15 0.001 1 force @a
+execute as @a[scores={particle_type=1},gamemode=!spectator] at @s run particle composter ~ ~0.1 ~ 0.15 0 0.15 0.001 2 force @a
+execute as @a[scores={particle_type=2},gamemode=!spectator] at @s run particle dust 1 1 1 1.5 ~ ~0.1 ~ 0.15 0 0.15 0.001 2 force @a
+execute as @a[scores={particle_type=3},gamemode=!spectator] at @s run particle falling_water ~ ~0.1 ~ 0.15 0 0.15 0.001 3 force @a
+execute as @a[scores={particle_type=4},gamemode=!spectator] at @s run particle flame ~ ~0.1 ~ 0.15 0 0.15 0.001 2 force @a
+execute as @a[scores={particle_type=5},gamemode=!spectator] at @s run particle dust 10 10 10 1.5 ~ ~0.1 ~ 0.15 0 0.15 0.001 2 force @a
+execute as @a[scores={particle_type=6},gamemode=!spectator] at @s run particle soul_fire_flame ~ ~0.1 ~ 0.15 0 0.15 0.001 1 force @a
+execute as @a[scores={particle_type=6},gamemode=!spectator] at @s run particle flame ~ ~0.1 ~ 0.15 0 0.15 0.001 1 force @a
 
 # 播放展示用实体的粒子效果
 execute as @e[type=!player,tag=show_particle_1] at @s run particle composter ~ ~0.5 ~ 0.15 0.15 0.15 0.001 2 force @a

+ 8 - 14
data/item/functions/shop/buy_particle0.mcfunction

@@ -1,16 +1,10 @@
 # 关闭粒子 (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
+
+tellraw @s[scores={shop_particle_s=0}] ["",{"text":">> ","color":"red","bold":true},{"text":"你需要先在左侧购买尾迹效果才能切换尾迹种类!","color":"red"}]
+execute as @s[scores={shop_particle_s=0}] at @s run function lib:sounds/error
+
+tellraw @s[scores={shop_particle_s=1..}] ["",{"text":">> ","color":"aqua","bold":true},{"text":"你关闭了自己的尾迹效果","color":"aqua"}]
+execute as @s[scores={shop_particle_s=1..}] at @s run function lib:sounds/hit
+
+scoreboard players set @s particle_type 0

+ 7 - 16
data/item/functions/shop/buy_particle1.mcfunction

@@ -1,19 +1,10 @@
 # 绿光粒子 (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=..-1},tag=particle] ["",{"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
+tellraw @s[scores={shop_particle_s=0}] ["",{"text":">> ","color":"red","bold":true},{"text":"你需要先在左侧购买尾迹效果才能切换尾迹种类!","color":"red"}]
+execute as @s[scores={shop_particle_s=0}] at @s run function lib:sounds/error
+
+tellraw @s[scores={shop_particle_s=1..}] ["",{"text":">> ","color":"aqua","bold":true},"尾迹效果已切换为 ",{"text":"绿光","color":"aqua"}]
+execute as @s[scores={shop_particle_s=1..}] at @s run function lib:sounds/hit
+
+scoreboard players set @s particle_type 1

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

@@ -1,12 +0,0 @@
-# 粒子系统关闭 (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

+ 8 - 10
data/item/functions/shop/buy_particle_system.mcfunction

@@ -2,18 +2,16 @@
 # 触发器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"}]
+tag @s[scores={shop_particle_s=0,green=18..}] add canbuy
+
+tellraw @s[scores={shop_particle_s=1..}] ["",{"text":">> ","color":"aqua","bold":true},{"text":"你已经购买了尾迹效果了!","color":"aqua"}]
+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
+tag @s remove canbuy

+ 1 - 1
data/ltw/functions/init.mcfunction

@@ -56,6 +56,7 @@ scoreboard objectives add effect_floating dummy "悬浮计时"
 scoreboard objectives remove game_id
 scoreboard objectives add game_id dummy "游戏编号"
 scoreboard players set $ game_id 0
+scoreboard objectives add particle_type dummy "粒子种类"
 
 # 商店系统记分板
 scoreboard objectives add gold dummy "金粒"
@@ -77,7 +78,6 @@ 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"

+ 7 - 7
data/ltw/functions/state/0/summon_entity.mcfunction

@@ -11,13 +11,13 @@ execute unless entity @e[type=piglin,tag=shop_piglin_9,tag=lobby_entity] run sum
 execute unless entity @e[type=piglin,tag=shop_piglin_10,tag=lobby_entity] run summon piglin 0 8 -55 {Tags:["lobby_entity","shop_piglin_10"],PersistenceRequired:1b,IsImmuneToZombification:1b,CannotHunt:1b,HandItems:[{id:"bow",Count:1b},{}],HandDropChances:[0.0f,0.0f]}
 execute unless entity @e[type=villager,tag=shop_particle_1,tag=lobby_entity] run summon minecraft:villager -23 20 -73 {Tags:["lobby_entity","shop_particle_1","show_particle_1"]}
 execute unless entity @e[type=villager,tag=shop_particle_2,tag=lobby_entity] run summon minecraft:villager -17 20 -76 {Tags:["lobby_entity","shop_particle_2","show_particle_6"]}
-execute unless entity @e[type=armor_stand,tag=shop_particle_3,tag=lobby_entity] run summon minecraft:armor_stand -20 20.1 -75 {Small:1b,Invisible:1b,Invulnerable:1b,Marker:1b,Tags:["shop_particle_3","show_particle_1","lobby_entity"]}
-execute unless entity @e[type=armor_stand,tag=shop_particle_4,tag=lobby_entity] run summon minecraft:armor_stand -19 20.1 -75 {Small:1b,Invisible:1b,Invulnerable:1b,Marker:1b,Tags:["shop_particle_4","show_particle_2","lobby_entity"]}
-execute unless entity @e[type=armor_stand,tag=shop_particle_5,tag=lobby_entity] run summon minecraft:armor_stand -18 20.1 -75 {Small:1b,Invisible:1b,Invulnerable:1b,Marker:1b,Tags:["shop_particle_5","show_particle_3","lobby_entity"]}
-execute unless entity @e[type=armor_stand,tag=shop_particle_6,tag=lobby_entity] run summon minecraft:armor_stand -17 20.1 -75 {Small:1b,Invisible:1b,Invulnerable:1b,Marker:1b,Tags:["shop_particle_6","show_particle_4","lobby_entity"]}
-execute unless entity @e[type=armor_stand,tag=shop_particle_7,tag=lobby_entity] run summon minecraft:armor_stand -16 20.1 -75 {Small:1b,Invisible:1b,Invulnerable:1b,Marker:1b,Tags:["shop_particle_7","show_particle_5","lobby_entity"]}
-execute unless entity @e[type=armor_stand,tag=shop_particle_8,tag=lobby_entity] run summon minecraft:armor_stand -15 20.1 -75 {Small:1b,Invisible:1b,Invulnerable:1b,Marker:1b,Tags:["shop_particle_8","show_particle_6","lobby_entity"]}
-execute unless entity @e[type=armor_stand,tag=shop_particle_9,tag=lobby_entity] run summon minecraft:armor_stand -14 20.1 -75 {Small:1b,Invisible:1b,Invulnerable:1b,Marker:1b,Tags:["shop_particle_9","show_particle_no","lobby_entity"]}
+execute unless entity @e[type=armor_stand,tag=shop_particle_9,tag=lobby_entity] run summon minecraft:armor_stand -20 20.1 -75 {Small:1b,Invisible:1b,Invulnerable:1b,Marker:1b,Tags:["shop_particle_9","show_particle_no","lobby_entity"]}
+execute unless entity @e[type=armor_stand,tag=shop_particle_3,tag=lobby_entity] run summon minecraft:armor_stand -19 20.1 -75 {Small:1b,Invisible:1b,Invulnerable:1b,Marker:1b,Tags:["shop_particle_3","show_particle_1","lobby_entity"]}
+execute unless entity @e[type=armor_stand,tag=shop_particle_4,tag=lobby_entity] run summon minecraft:armor_stand -18 20.1 -75 {Small:1b,Invisible:1b,Invulnerable:1b,Marker:1b,Tags:["shop_particle_4","show_particle_2","lobby_entity"]}
+execute unless entity @e[type=armor_stand,tag=shop_particle_5,tag=lobby_entity] run summon minecraft:armor_stand -17 20.1 -75 {Small:1b,Invisible:1b,Invulnerable:1b,Marker:1b,Tags:["shop_particle_5","show_particle_3","lobby_entity"]}
+execute unless entity @e[type=armor_stand,tag=shop_particle_6,tag=lobby_entity] run summon minecraft:armor_stand -16 20.1 -75 {Small:1b,Invisible:1b,Invulnerable:1b,Marker:1b,Tags:["shop_particle_6","show_particle_4","lobby_entity"]}
+execute unless entity @e[type=armor_stand,tag=shop_particle_7,tag=lobby_entity] run summon minecraft:armor_stand -15 20.1 -75 {Small:1b,Invisible:1b,Invulnerable:1b,Marker:1b,Tags:["shop_particle_7","show_particle_5","lobby_entity"]}
+execute unless entity @e[type=armor_stand,tag=shop_particle_8,tag=lobby_entity] run summon minecraft:armor_stand -14 20.1 -75 {Small:1b,Invisible:1b,Invulnerable:1b,Marker:1b,Tags:["shop_particle_8","show_particle_6","lobby_entity"]}
 execute unless entity @e[type=piglin,tag=shop_piglin_11,tag=lobby_entity] run kill @e[type=minecart,tag=lobby_entity]
 execute unless entity @e[type=minecart,tag=lobby_entity] run kill @e[type=piglin,tag=lobby_entity,tag=shop_piglin_11]
 execute unless entity @e[type=piglin,tag=shop_piglin_11,tag=lobby_entity] run summon minecart 4 28 -47 {Rotation:[0.0f,0.0f],Tags:["lobby_entity"],Passengers:[{id:"minecraft:piglin",Rotation:[90.0f,0.0f],Tags:["lobby_entity","shop_piglin_11"],CustomName:'{"text":"老板"}',ArmorItems:[{},{},{},{id:"player_head",Count:1b,tag:{SkullOwner:"HerobrineXia"}}],ArmorDropChances:[0.0f,0.0f,0.0f,0.0f],PersistenceRequired:1b,IsImmuneToZombification:1b,CannotHunt:1b,HandItems:[{id:"gold_block",Count:1b},{}],HandDropChances:[0.0f,0.0f]}]}