LTCatt 6 years ago
parent
commit
0b0690af87

+ 2 - 8
data/lib/functions/effect/special_block.mcfunction → data/lib/functions/effect/floating.mcfunction

@@ -1,15 +1,9 @@
 # 5tick运行一次 计分板单位5tick
-
 # 钻石:起飞
-scoreboard players remove @a[scores={effect_floating=-5..}] effect_floating 1
+
+scoreboard players remove @a effect_floating 1
 execute as @a[gamemode=!spectator,scores={effect_floating=..-5}] at @s if block ~ ~-1 ~ diamond_block run effect give @s levitation 1 12
 execute as @a[gamemode=!spectator,scores={effect_floating=..-5}] at @s if block ~ ~-1 ~ diamond_block run effect give @s slow_falling 2 0 true
 execute as @a[gamemode=!spectator,scores={effect_floating=..-5}] at @s if block ~ ~-1 ~ diamond_block run scoreboard players set @s effect_floating 2
 execute as @a[gamemode=!spectator,scores={effect_floating=..-5}] at @s if block ~ ~-1 ~ diamond_block run function lib:sounds/teleport
 effect clear @a[scores={effect_floating=0}] levitation
-
-# 绿宝石:回血
-scoreboard players remove @a[scores={effect_regen=0..}] effect_regen 1
-execute as @a[gamemode=!spectator,scores={effect_regen=..0}] at @s if block ~ ~-1 ~ emerald_block run effect give @s regeneration 2 2
-execute as @a[gamemode=!spectator,scores={effect_regen=..0}] at @s if block ~ ~-1 ~ emerald_block run scoreboard players set @s effect_regen 4
-effect clear @a[scores={effect_regen=0}] regeneration

+ 8 - 0
data/lib/functions/effect/regen.mcfunction

@@ -0,0 +1,8 @@
+# 每秒一次
+# 绿宝石:回血
+
+execute as @a[gamemode=!spectator] at @s if block ~ ~-1 ~ emerald_block run effect give @s regeneration 2 2
+# scoreboard players remove @a[scores={effect_regen=0..}] effect_regen 1
+# execute as @a[gamemode=!spectator,scores={effect_regen=..0}] at @s if block ~ ~-1 ~ emerald_block run effect give @s regeneration 2 2
+# execute as @a[gamemode=!spectator,scores={effect_regen=..0}] at @s if block ~ ~-1 ~ emerald_block run scoreboard players set @s effect_regen 4
+# effect clear @a[scores={effect_regen=0}] regeneration

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

@@ -11,6 +11,9 @@ execute if score $state mem matches 5 run function ltw:state/5/tick20
 execute if score $state mem matches 6 run function ltw:state/6/tick20
 execute if score $state mem matches 7 run function ltw:state/7/tick20
 
+# 特殊方块给予效果
+function lib:effect/regen
+
 # 全局倒计时
 execute if score $countdown mem matches 1.. run scoreboard players remove $countdown mem 1
 scoreboard players remove @e[scores={countdown=1..}] countdown 1

+ 3 - 3
data/ltw/functions/clock/tick5.mcfunction

@@ -6,8 +6,8 @@ execute if score $state mem matches 0 run function ltw:state/0/tick5
 execute if score $state mem matches 5 run function ltw:state/5/tick5
 function ltw:main/tick5
 
+# 特殊方块给予效果
+function lib:effect/floating
+
 # 死亡触发
 execute as @a[scores={death=1..,health=1..}] at @s run function ltw:main/player_death
-
-# 特殊方块给予效果
-function lib:effect/special_block