Просмотр исходного кода

修改僵尸游戏刷怪机制

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

+ 18 - 0
data/mini/functions/zombie/game/summon_creeper.mcfunction

@@ -0,0 +1,18 @@
+# 召唤苦力怕
+
+scoreboard players set $random_min mem 0
+scoreboard players set $random_max mem 4
+function lib:random
+
+execute if score $random mem matches 0 positioned 1019.0 20.1 5002.0 unless entity @e[tag=mini_mob,distance=..1] run summon creeper
+execute if score $random mem matches 1 positioned 1002.0 19.1 5016.0 unless entity @e[tag=mini_mob,distance=..1] run summon creeper
+execute if score $random mem matches 2 positioned 1019.0 13.1 5013.0 unless entity @e[tag=mini_mob,distance=..1] run summon creeper
+execute if score $random mem matches 3 positioned 1002.0 13.1 5024.0 unless entity @e[tag=mini_mob,distance=..1] run summon creeper
+execute if score $random mem matches 4 positioned 1002.0 13.1 5002.0 unless entity @e[tag=mini_mob,distance=..1] run summon creeper
+tag @e[type=creeper] add mini_mob
+
+# 提高追踪范围
+execute as @e[type=creeper] run attribute @s generic.follow_range base set 35
+
+# 关闭怪物间友伤
+team join white @e[tag=mini_mob]

+ 18 - 0
data/mini/functions/zombie/game/summon_evoker.mcfuntion

@@ -0,0 +1,18 @@
+# 召唤唤魔者
+
+scoreboard players set $random_min mem 0
+scoreboard players set $random_max mem 4
+function lib:random
+
+execute if score $random mem matches 0 positioned 1019.0 20.1 5002.0 unless entity @e[tag=mini_mob,distance=..1] run summon evoker
+execute if score $random mem matches 1 positioned 1002.0 19.1 5016.0 unless entity @e[tag=mini_mob,distance=..1] run summon evoker
+execute if score $random mem matches 2 positioned 1019.0 13.1 5013.0 unless entity @e[tag=mini_mob,distance=..1] run summon evoker
+execute if score $random mem matches 3 positioned 1002.0 13.1 5024.0 unless entity @e[tag=mini_mob,distance=..1] run summon evoker
+execute if score $random mem matches 4 positioned 1002.0 13.1 5002.0 unless entity @e[tag=mini_mob,distance=..1] run summon evoker
+tag @e[type=evoker] add mini_mob
+
+# 提高追踪范围
+execute as @e[type=evoker] run attribute @s generic.follow_range base set 35
+
+# 关闭怪物间友伤
+team join white @e[tag=mini_mob]

+ 1 - 3
data/mini/functions/zombie/game/summon_skeleton.mcfunction

@@ -1,4 +1,4 @@
-# 召唤唤魔者
+# 召唤骷髅
 
 scoreboard players set $random_min mem 0
 scoreboard players set $random_max mem 4
@@ -11,8 +11,6 @@ execute if score $random mem matches 3 positioned 1002.0 13.1 5024.0 unless enti
 execute if score $random mem matches 4 positioned 1002.0 13.1 5002.0 unless entity @e[tag=mini_mob,distance=..1] run summon skeleton
 tag @e[type=skeleton] add mini_mob
 
-tellraw @a ["",{"text": ">> ","color":"gold","bold": true},{"text": "骷髅 ","color":"gold"},"已出现!"]
-
 # 提高追踪范围
 execute as @e[type=evoker] run attribute @s generic.follow_range base set 35
 

+ 0 - 3
data/mini/functions/zombie/game_init.mcfunction

@@ -12,9 +12,6 @@ kill @e[type=arrow]
 tp @e[tag=mini_mob] ~ -100 ~
 tp @e[type=vex] ~ -100 ~
 
-# 初始化附加值
-scoreboard players set $zombie_luck mem 0
-
 # 伤害管理
 team modify player friendlyFire false
 team modify player collisionRule always

+ 3 - 0
data/mini/functions/zombie/game_start.mcfunction

@@ -7,3 +7,6 @@ function mini:zombie/game/summon_zombie
 function mini:zombie/game/summon_zombie
 function mini:zombie/game/summon_zombie
 function mini:zombie/game/summon_zombie
+
+# 怪物刷新倒计时
+scoreboard players set $countdown mem 120

+ 11 - 6
data/mini/functions/zombie/tick20.mcfunction

@@ -5,18 +5,23 @@ effect clear @a hunger
 scoreboard players set $random_min mem 0
 scoreboard players set $random_max mem 100
 function lib:random
-scoreboard players operation $random mem += $zombie_luck mem
-execute if score $random mem matches 75.. run scoreboard players remove $zombie_luck mem 1
 
 # 清理恼鬼
 execute if score $random mem matches 40.. run tp @e[type=vex,limit=1,sort=random] ~ -100 ~
 
 # 赋予随机效果
-effect give @e[type=husk,limit=1,sort=random] speed 1 1
-effect give @e[type=husk,limit=1,sort=random] speed 4
+effect give @e[limit=1,sort=random] speed 1 1
+effect give @e[limit=1,sort=random] speed 4
 effect give @e[type=zombie,limit=1,sort=random] slowness 4
 effect give @e[type=zombie,limit=1,sort=random] slowness 2 1
 
 # 召唤怪物
-execute if score $random mem matches -5..5 run function mini:zombie/game/summon_zombie
-execute if score $random mem matches ..-8 run function mini:zombie/game/summon_skeleton
+execute if score $countdown mem matches ..120 if score $random mem matches 0..10 run function mini:zombie/game/summon_zombie
+execute if score $countdown mem matches ..90 if score $random mem matches 11..15 run function mini:zombie/game/summon_skeleton
+execute if score $countdown mem matches ..60 if score $random mem matches 16..20 run function mini:zombie/game/summon_creeper
+execute if score $countdown mem matches ..0 if score $random mem matches 21..25 run function mini:zombie/game/summon_evoker
+
+# 显示提示
+execute if score $countdown mem matches 90 run tellraw @a ["",{"text": ">> ","color":"red","bold": true},{"text": "骷髅 ","color":"red"},"已开始出现!"]
+execute if score $countdown mem matches 60 run tellraw @a ["",{"text": ">> ","color":"red","bold": true},{"text": "苦力怕 ","color":"red"},"已开始出现!"]
+execute if score $countdown mem matches 1 run tellraw @a ["",{"text": ">> ","color":"red","bold": true},{"text": "唤魔者 ","color":"red"},"已开始出现!"]