Bläddra i källkod

史莱姆攻击判定

HerobrineXia 6 år sedan
förälder
incheckning
1b27d0b85a

+ 2 - 1
data/mini/functions/main/damage_taken.mcfunction

@@ -1,3 +1,4 @@
 # 检测分数调用对应函数
 execute if score $mini_type mem matches 3 run function mini:hotpm/game/damage_taken
-execute if score $mini_type mem matches 5 run function mini:zombie/game/damage_taken
+execute if score $mini_type mem matches 5 run function mini:zombie/game/damage_taken
+execute if score $mini_type mem matches 7 run function mini:slime/game/damage_taken

+ 2 - 1
data/mini/functions/main/tick2.mcfunction

@@ -3,4 +3,5 @@ execute if score $mini_type mem matches 1 run function mini:parkour/tick2
 execute if score $mini_type mem matches 2 run function mini:tntrun/tick2
 execute if score $mini_type mem matches 3 run function mini:hotpm/tick2
 execute if score $mini_type mem matches 4 run function mini:colormatch/tick2
-execute if score $mini_type mem matches 6 run function mini:phantom/tick2
+execute if score $mini_type mem matches 6 run function mini:phantom/tick2
+execute if score $mini_type mem matches 7 run function mini:slime/tick2

+ 1 - 0
data/mini/functions/slime/game/damage_dealt.mcfunction

@@ -1 +1,2 @@
 execute store result score $slime_last_hit mem run data get entity @s UUID[0]
+scoreboard players set $countdown_fast mem 20

+ 2 - 0
data/mini/functions/slime/game/damage_taken.mcfunction

@@ -0,0 +1,2 @@
+execute as @a[tag=mini_running] store result score @s UUID run data get entity @s UUID[0]
+execute as @a[tag=mini_running] if score @s UUID = $slime_last_hit mem run say 我打到人要加分!

+ 4 - 0
data/mini/functions/slime/game_init.mcfunction

@@ -14,6 +14,10 @@ kill @e[type=item]
 tp @e[type=slime] 1000 -100 6000
 kill @e[type=trident]
 
+# 重置分数
+scoreboard players reset $slime_last_hit mem
+scoreboard players set $countdown_fast mem 0
+
 # 伤害管理
 scoreboard players set $remove_resistance mem 1
 team modify player friendlyFire false

+ 1 - 0
data/mini/functions/slime/tick2.mcfunction

@@ -0,0 +1 @@
+execute if score $countdown_fast mem matches 0 run scoreboard players reset $slime_last_hit mem