HerobrineXia преди 6 години
родител
ревизия
341383732c

+ 13 - 0
data/lib/functions/effect/special_block.mcfunction

@@ -0,0 +1,13 @@
+# 5tick运行一次 计分板单位5tick
+# 钻石:起飞
+execute as @a[gamemode=!spectator] if score @s effect_floating matches 1.. run scoreboard players add @s effect_floating 1
+execute as @a[gamemode=!spectator] if score @s effect_floating matches 3.. run effect clear @s levitation
+execute as @a[gamemode=!spectator] if score @s effect_floating matches 3.. run scoreboard players set @s effect_floating 0
+execute as @a[gamemode=!spectator] unless score @s effect_floating matches 1.. at @s if block ~ ~-1 ~ diamond_block run effect give @s levitation 1 12 true
+execute as @a[gamemode=!spectator] unless score @s effect_floating matches 1.. at @s if block ~ ~-1 ~ diamond_block run effect give @s slow_falling 2 0 true
+execute as @a[gamemode=!spectator] unless score @s effect_floating matches 1.. at @s if block ~ ~-1 ~ diamond_block run scoreboard players set @s effect_floating 1
+# 绿宝石:回血
+execute as @a[gamemode=!spectator] if score @s effect_regen matches 1.. run scoreboard players add @s effect_regen 1
+execute as @a[gamemode=!spectator] if score @s effect_regen matches 5.. run effect clear @s regeneration
+execute as @a[gamemode=!spectator] unless score @s effect_regen matches 1.. at @s if block ~ ~-1 ~ emerald_block run effect give @s regeneration 2 2 true
+execute as @a[gamemode=!spectator] unless score @s effect_regen matches 1.. at @s if block ~ ~-1 ~ emerald_block run scoreboard players set @s effect_regen 1

+ 1 - 9
data/ltw/functions/clock/tick2.mcfunction

@@ -17,12 +17,4 @@ function item:tick2
 
 # 全局倒计时
 execute if score $countdown_fast mem matches 1.. run scoreboard players remove $countdown_fast mem 1
-scoreboard players remove @e[scores={countdown_fast=1..}] countdown_fast 1
-
-# 特殊方块给予效果
-execute as @a[gamemode=!spectator] if score @s effect_floating matches 1.. run scoreboard players add @s effect_floating 1
-execute as @a[gamemode=!spectator] if score @s effect_floating matches 6.. run effect clear @s levitation
-execute as @a[gamemode=!spectator] if score @s effect_floating matches 6.. run scoreboard players set @s effect_floating 0
-execute as @a[gamemode=!spectator] at @s if block ~ ~-1 ~ diamond_block run scoreboard players set @s effect_floating 1
-execute as @a[gamemode=!spectator] at @s if block ~ ~-1 ~ diamond_block run effect give @s levitation 1 12 true
-execute as @a[gamemode=!spectator] at @s if block ~ ~-1 ~ diamond_block run effect give @s slow_falling 2 0 true
+scoreboard players remove @e[scores={countdown_fast=1..}] countdown_fast 1

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

@@ -21,6 +21,3 @@ execute if score $twice mem matches 2.. run scoreboard players set $twice mem 0
 # 掐死原版 BGM
 stopsound @a music music.game
 stopsound @a music music.creative
-
-# 特殊方块给予效果
-execute as @a[tag=mini_running] at @s if block ~ ~-1 ~ emerald_block run effect give @s regeneration 2 2 true

+ 4 - 1
data/ltw/functions/clock/tick5.mcfunction

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

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

@@ -53,6 +53,8 @@ scoreboard objectives remove game_id
 scoreboard objectives add game_id dummy "游戏编号"
 scoreboard objectives remove effect_floating
 scoreboard objectives add effect_floating dummy "悬浮计时"
+scoreboard objectives remove effect_regen
+scoreboard objectives add effect_regen dummy "恢复计时"
 scoreboard players set $ game_id 0
 
 # 商店系统记分板