Przeglądaj źródła

优化僵尸生成

LTCatt 6 lat temu
rodzic
commit
ae763ffa9a

+ 2 - 2
data/ltw/functions/state/7/state_enter.mcfunction

@@ -15,5 +15,5 @@ setblock 0 10 2000 minecraft:structure_block{mode:"LOAD",name:"ltw:select"}
 setblock 0 11 2000 minecraft:redstone_block
 
 # 判断进入下一轮小游戏或结束
-execute if score $game_type mem matches 1 if score $round mem matches ..3 run function ltw:state/7/continue_gameparty
-execute if score $game_type mem matches 1 if score $round mem matches 4.. run function ltw:main/game_end
+execute if score $game_type mem matches 1 if score $round mem matches ..5 run function ltw:state/7/continue_gameparty
+execute if score $game_type mem matches 1 if score $round mem matches 6.. run function ltw:main/game_end

+ 1 - 0
data/mini/functions/main/game_start.mcfunction

@@ -17,3 +17,4 @@ scoreboard objectives setdisplay list total_score_disp
 execute if score $mini_type mem matches 2 run function mini:tntrun/game_start
 execute if score $mini_type mem matches 3 run function mini:hotpm/game_start
 execute if score $mini_type mem matches 4 run function mini:colormatch/game_start
+execute if score $mini_type mem matches 5 run function mini:zombie/game_start

+ 1 - 1
data/mini/functions/parkour/player_intro.mcfunction

@@ -1,3 +1,3 @@
 # 向单个玩家展示小游戏介绍
 tp @s 1007 24 1005
-tellraw @s [{"text":"\n>> 跑酷 >>\n\n","color":"red","bold":true},{"text": "到达最上层即可获胜, 规则就是这么简单!\n","color":"white","bold": false}]
+tellraw @s [{"text":"\n>> 跑酷(测试) >>\n\n","color":"red","bold":true},{"text": "到达最上层即可获胜, 规则就是这么简单!\n这个小游戏还在测试中, 欢迎告诉我们让它变得更好玩的方法!\n","color":"white","bold": false}]

+ 4 - 0
data/mini/functions/zombie/game/summon_evoker.mcfunction

@@ -0,0 +1,4 @@
+# 召唤唤魔者
+
+summon evoker 1010.5 16.5 5007.5 {Tags:["mini_mob"]}
+tellraw @a ["",{"text": ">> ","color":"red","bold": true}," 唤魔者已出现!"]

+ 16 - 0
data/mini/functions/zombie/game/summon_zombie.mcfunction

@@ -0,0 +1,16 @@
+# 随机召唤僵尸或尸壳
+
+scoreboard players set $random_min mem 0
+scoreboard players set $random_max mem 11
+function lib:random
+
+# 尸壳
+execute if score $random mem matches 0 positioned 1019.0 18.1 5013.0 unless entity @e[tag=mini_mob,distance=..1] run summon husk ~ ~ ~ {Tags:["mini_mob"]}
+execute if score $random mem matches 1 positioned 1002.0 18.1 5013.0 unless entity @e[tag=mini_mob,distance=..1] run summon husk ~ ~ ~ {Tags:["mini_mob"]}
+execute if score $random mem matches 2 positioned 1002.5 13.1 5002.5 unless entity @e[tag=mini_mob,distance=..1] run summon husk ~ ~ ~ {Tags:["mini_mob"]}
+execute if score $random mem matches 3 positioned 1018.5 13.1 5023.5 unless entity @e[tag=mini_mob,distance=..1] run summon husk ~ ~ ~ {Tags:["mini_mob"]}
+# 僵尸
+execute if score $random mem matches 4..5 positioned 1019.0 18.1 5013.0 unless entity @e[tag=mini_mob,distance=..1] run summon zombie ~ ~ ~ {Tags:["mini_mob"]}
+execute if score $random mem matches 6..7 positioned 1002.0 18.1 5013.0 unless entity @e[tag=mini_mob,distance=..1] run summon zombie ~ ~ ~ {Tags:["mini_mob"]}
+execute if score $random mem matches 8..9 positioned 1002.5 13.1 5002.5 unless entity @e[tag=mini_mob,distance=..1] run summon zombie ~ ~ ~ {Tags:["mini_mob"]}
+execute if score $random mem matches 10..11 positioned 1018.5 13.1 5023.5 unless entity @e[tag=mini_mob,distance=..1] run summon zombie ~ ~ ~ {Tags:["mini_mob"]}

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

@@ -11,6 +11,9 @@ setblock 1000 11 5000 minecraft:redstone_block
 tp @e[tag=mini_mob] ~ -100 ~
 tp @e[type=vex] ~ -100 ~
 
+# 初始化附加值
+scoreboard players set $zombie_luck mem 0
+
 # 伤害管理
 team modify ltw friendlyFire false
 gamerule fallDamage false

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

@@ -0,0 +1,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

+ 1 - 1
data/mini/functions/zombie/player_intro.mcfunction

@@ -1,3 +1,3 @@
 # 向单个玩家展示小游戏介绍
 tp @s 1010.5 20 5006.0 0 25
-tellraw @s [{"text":"\n>> 尸海寻路 >>\n\n","color":"red","bold":true},{"text": "僵尸正在不断地涌现……成为最后的幸存者吧!\n","color":"white","bold": false}]
+tellraw @s ["",{"text":"\n>> 尸海寻路(测试) >>\n\n","color":"red","bold":true},{"text": "僵尸正在不断地涌现……成为最后的幸存者吧!\n这个小游戏还在测试中, 欢迎告诉我们让它变得更好玩的方法!\n"}]

+ 14 - 19
data/mini/functions/zombie/tick20.mcfunction

@@ -1,25 +1,20 @@
 # 随机召唤僵尸
-scoreboard players set $random_min mem 1
-scoreboard players set $random_max mem 100
-function lib:random
-
 effect clear @a hunger
 
-execute if score $random mem matches 1..2 positioned 1019.0 18.1 5013.0 unless entity @e[tag=mini_mob,distance=..1] run summon zombie ~ ~ ~ {Tags:["mini_mob"]}
-execute if score $random mem matches 4 positioned 1019.0 18.1 5013.0 unless entity @e[tag=mini_mob,distance=..1] run summon husk ~ ~ ~ {Tags:["mini_mob"]}
-execute if score $random mem matches 5..6 positioned 1002.0 18.1 5013.0 unless entity @e[tag=mini_mob,distance=..1] run summon zombie ~ ~ ~ {Tags:["mini_mob"]}
-execute if score $random mem matches 8 positioned 1002.0 18.1 5013.0 unless entity @e[tag=mini_mob,distance=..1] run summon husk ~ ~ ~ {Tags:["mini_mob"]}
-execute if score $random mem matches 9..10 positioned 1002.5 13.1 5002.5 unless entity @e[tag=mini_mob,distance=..1] run summon zombie ~ ~ ~ {Tags:["mini_mob"]}
-execute if score $random mem matches 12 positioned 1002.5 13.1 5002.5 unless entity @e[tag=mini_mob,distance=..1] run summon husk ~ ~ ~ {Tags:["mini_mob"]}
-execute if score $random mem matches 13..14 positioned 1018.5 13.1 5023.5 unless entity @e[tag=mini_mob,distance=..1] run summon zombie ~ ~ ~ {Tags:["mini_mob"]}
-execute if score $random mem matches 16 positioned 1018.5 13.1 5023.5 unless entity @e[tag=mini_mob,distance=..1] run summon husk ~ ~ ~ {Tags:["mini_mob"]}
-execute if score $random mem matches 99..100 positioned 1019.0 18.1 5013.0 run summon evoker ~ ~ ~ {Tags:["mini_mob"]}
+# 生成随机数
+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
 
-attribute @e[tag=mini_mob,limit=1,sort=random] generic.movement_speed modifier remove 3d2ff588-63bb-458f-b5b7-a533169db5d9
-attribute @e[tag=mini_mob,limit=1,sort=random] generic.movement_speed modifier remove 3d2ff588-63bb-458f-b5b7-a533169db5d9
-attribute @e[tag=mini_mob,limit=1,sort=random] generic.movement_speed modifier remove 3d2ff588-63bb-458f-b5b7-a533169db5d9
-attribute @e[type=husk,limit=1,sort=random] generic.movement_speed modifier add 3d2ff588-63bb-458f-b5b7-a533169db5d9 mob_speed 0.15 add
-attribute @e[type=zombie,limit=1,sort=random] generic.movement_speed modifier add 3d2ff588-63bb-458f-b5b7-a533169db5d9 mob_speed -0.1 add
+# 召唤怪物
+execute if score $random mem matches -2..8 run function mini:zombie/game/summon_zombie
+execute if score $random mem matches ..-5 run function mini:zombie/game/summon_evoker
 
 # 清理恼鬼
-execute if score $random mem matches 76..100 run tp @e[type=vex,limit=1,sort=random] ~ -100 ~
+execute if score $random mem matches 50.. run tp @e[type=vex,limit=1,sort=random] ~ -100 ~
+
+# 赋予随机效果
+effect give @e[type=husk,limit=1,sort=random] speed 4
+effect give @e[type=zombie,limit=1,sort=random] slowness 4