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

+ 4 - 4
data/item/functions/bonus_item/add_score.mcfunction

@@ -10,11 +10,11 @@ execute if score #bonus_add_score mem matches ..10 run tellraw @a ["",{"text": "
 scoreboard players set $random_max mem 1
 scoreboard players set $random_min mem 0
 function lib:random
-execute if score #bonus_add_score mem matches 100 if score $random mem matches 1 run scoreboard players operation @s total_score *= $c_2 mem
-execute if score #bonus_add_score mem matches 100 if score $random mem matches 1 run scoreboard players operation @s total_score_disp *= $c_2 mem
+execute if score #bonus_add_score mem matches 100 if score $random mem matches 1 run scoreboard players operation @s total_score *= #const_2 mem
+execute if score #bonus_add_score mem matches 100 if score $random mem matches 1 run scoreboard players operation @s total_score_disp *= #const_2 mem
 execute if score #bonus_add_score mem matches 100 if score $random mem matches 1 run tellraw @a ["",{"text": ">> ","color":"green","bold": true},{"selector": "@s","color":"green"}," 的硬币投出了正面, 得分加倍, 当前共有 ",{"score": {"name": "@s","objective": "total_score"},"color":"green"},{"text": " 分", "color":"green"}]
-execute if score #bonus_add_score mem matches 100 if score $random mem matches 0 run scoreboard players operation @s total_score /= $c_2 mem
-execute if score #bonus_add_score mem matches 100 if score $random mem matches 0 run scoreboard players operation @s total_score_disp /= $c_2 mem
+execute if score #bonus_add_score mem matches 100 if score $random mem matches 0 run scoreboard players operation @s total_score /= #const_2 mem
+execute if score #bonus_add_score mem matches 100 if score $random mem matches 0 run scoreboard players operation @s total_score_disp /= #const_2 mem
 execute if score #bonus_add_score mem matches 100 if score $random mem matches 0 run tellraw @a ["",{"text": ">> ","color":"red","bold": true},{"selector": "@s","color":"red"}," 的硬币投出了反面, 得分减半, 当前共有 ",{"score": {"name": "@s","objective": "total_score"},"color":"red"},{"text": " 分", "color":"red"}]
 
 # 200:偷分

+ 1 - 1
data/item/functions/bonus_item/gameparty/normal/random.mcfunction

@@ -5,7 +5,7 @@ scoreboard players set $random_min mem -49
 scoreboard players set $random_max mem 50
 function lib:random
 scoreboard players operation #quality mem = $round mem
-scoreboard players operation #quality mem *= $c_10 mem
+scoreboard players operation #quality mem *= #const_10 mem
 scoreboard players operation #quality mem += $random mem
 
 # 根据品质生成不同的物品

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

@@ -52,8 +52,9 @@ scoreboard players set $ game_id 0
 
 # 常量与变量初始化
 scoreboard players set $c_mini_total mem 6
-scoreboard players set $c_2 mem 2
-scoreboard players set $c_10 mem 10
+scoreboard players set #const_2 mem 2
+scoreboard players set #const_5 mem 5
+scoreboard players set #const_10 mem 10
 scoreboard players set $game_type mem 1
 
 # 队伍

+ 1 - 0
data/mini/functions/phantom/game_start.mcfunction

@@ -1,3 +1,4 @@
 gamerule doDaylightCycle true
 scoreboard players set $countdown mem 110
 scoreboard players reset * kill_phantom
+scoreboard players reset * kill_phantom2

+ 2 - 0
data/mini/functions/phantom/init.mcfunction

@@ -3,3 +3,5 @@ scoreboard objectives remove use_trident
 scoreboard objectives add use_trident minecraft.used:trident "使用三叉戟"
 scoreboard objectives remove kill_phantom
 scoreboard objectives add kill_phantom killed:phantom "幻翼击杀数"
+scoreboard objectives remove kill_phantom2
+scoreboard objectives add kill_phantom2 dummy "幻翼击杀数缓存"

+ 2 - 0
data/mini/functions/phantom/player_enter.mcfunction

@@ -11,7 +11,9 @@ gamerule naturalRegeneration false
 
 # 计分板重置
 scoreboard players reset @s kill_phantom
+scoreboard players reset @s kill_phantom2
 scoreboard players set @s[tag=!watcher,tag=!rejoining,tag=!debug] kill_phantom 0
+scoreboard players set @s[tag=!watcher,tag=!rejoining,tag=!debug] kill_phantom2 0
 scoreboard players reset @s use_trident
 scoreboard players reset @s countdown
 

+ 12 - 0
data/mini/functions/phantom/tick20.mcfunction

@@ -1,4 +1,5 @@
 
+# 召唤幻翼
 execute if score $countdown mem matches 11.. run function mini:phantom/game/try_summon
 
 # 显示倒计时
@@ -11,3 +12,14 @@ execute if score $countdown mem matches ..10 as @a at @s run function lib:sounds
 execute if score $countdown mem matches 10 run tellraw @a ["",{"text": ">> ","color":"aqua","bold": true},{"text": "太阳即将升起!","color":"aqua"}]
 # 0s:游戏结束
 execute if score $countdown mem matches 0 run function mini:main/game_end
+
+# 击杀音效
+execute as @a run scoreboard players operation @s temp = @s kill_phantom
+execute as @a run scoreboard players operation @s temp -= @s kill_phantom2
+execute as @a[scores={temp=1..}] at @s run function lib:sounds/hit
+
+# 击杀提示
+execute as @a run scoreboard players operation @s kill_phantom2 = @s kill_phantom
+execute as @a run scoreboard players operation @s kill_phantom2 %= #const_5 mem
+execute as @a[scores={temp=1..,kill_phantom2=0}] run tellraw @a ["",{"text": ">> ","color":"gold","bold": true},{"selector": "@s","color":"gold"}," 已击杀 ",{"score": { "name": "@s","objective": "kill_phantom"}}," 只幻翼!"]
+execute as @a run scoreboard players operation @s kill_phantom2 = @s kill_phantom