Ver Fonte

幻翼随机生命值;开启生命恢复

LTCatt há 6 anos atrás
pai
commit
def8d6c8d7

+ 1 - 0
data/mini/functions/phantom/game/clear_effect.mcfunction

@@ -0,0 +1 @@
+effect clear @a regeneration

+ 12 - 2
data/mini/functions/phantom/game/summon2.mcfunction

@@ -1,6 +1,16 @@
 
 execute as @e[tag=new_phantom] at @s run tp @s ~ 35 ~
-attribute @e[tag=new_phantom,limit=1] generic.max_health base set 4
-attribute @e[tag=new_phantom,limit=1] generic.attack_damage base set 1.7
+
+# 随机生命值
+scoreboard players set $random_min mem 0
+scoreboard players set $random_max mem 4
+function lib:random
+execute if score $random mem matches 0 run attribute @e[tag=new_phantom,limit=1] generic.max_health base set 2
+execute if score $random mem matches 1 run attribute @e[tag=new_phantom,limit=1] generic.max_health base set 3
+execute if score $random mem matches 2 run attribute @e[tag=new_phantom,limit=1] generic.max_health base set 4
+execute if score $random mem matches 3 run attribute @e[tag=new_phantom,limit=1] generic.max_health base set 5
+execute if score $random mem matches 4 run attribute @e[tag=new_phantom,limit=1] generic.max_health base set 6
+
+attribute @e[tag=new_phantom,limit=1] generic.attack_damage base set 4
 effect give @e[tag=new_phantom] instant_damage
 tag @e[tag=new_phantom] remove new_phantom

+ 1 - 1
data/mini/functions/phantom/game_init.mcfunction

@@ -35,5 +35,5 @@ execute positioned 1035.0 28.5 6002.5 run function item:bonus_item/gameparty/aut
 # 伤害管理
 scoreboard players set $remove_resistance mem 1
 team modify player friendlyFire false
-team modify player collisionRule never
+team modify player collisionRule always
 gamerule fallDamage false

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

@@ -10,3 +10,7 @@ execute if score $countdown mem matches ..10 as @a at @s run function lib:sounds
 
 # 0s:游戏结束
 execute if score $countdown mem matches 0 run function mini:main/game_end
+
+# 回复生命值
+execute if score $twice mem matches 1 run effect give @a regeneration 1 10 true
+execute if score $twice mem matches 1 run schedule function mini:phantom/game/clear_effect 1t replace

+ 1 - 1
data/mini/functions/slime/game/set_attack.mcfunction

@@ -1 +1 @@
-execute as @e[type=slime] run attribute @s minecraft:generic.attack_damage base set 6
+execute as @e[type=slime] run attribute @s minecraft:generic.attack_damage base set 7