Kaynağa Gözat

史莱姆上线

LTCatt 6 yıl önce
ebeveyn
işleme
b04003a164

+ 1 - 1
data/ltw/functions/init.mcfunction

@@ -51,7 +51,7 @@ scoreboard objectives add game_id dummy "游戏编号"
 scoreboard players set $ game_id 0
 
 # 常量与变量初始化
-scoreboard players set $c_mini_total mem 6
+scoreboard players set $c_mini_total mem 7
 scoreboard players set #const_2 mem 2
 scoreboard players set #const_5 mem 5
 scoreboard players set #const_10 mem 10

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

@@ -5,6 +5,7 @@ execute if score $mini_type mem matches 3 run function mini:hotpm/game_end
 execute if score $mini_type mem matches 4 run function mini:colormatch/game_end
 execute if score $mini_type mem matches 5 run function mini:zombie/game_end
 execute if score $mini_type mem matches 6 run function mini:phantom/game_end
+execute if score $mini_type mem matches 7 run function mini:slime/game_end
 
 # 计算排名
 tag @a remove mini_rank1

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

@@ -10,3 +10,4 @@ execute if score $mini_type mem matches 3 run function mini:hotpm/game_init
 execute if score $mini_type mem matches 4 run function mini:colormatch/game_init
 execute if score $mini_type mem matches 5 run function mini:zombie/game_init
 execute if score $mini_type mem matches 6 run function mini:phantom/game_init
+execute if score $mini_type mem matches 7 run function mini:slime/game_init

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

@@ -18,6 +18,9 @@ execute if score $mini_type mem matches 5 run scoreboard objectives setdisplay s
 execute if score $mini_type mem matches 6 run scoreboard objectives setdisplay list health_disp
 execute if score $mini_type mem matches 6 run scoreboard objectives setdisplay belowName kill_phantom
 execute if score $mini_type mem matches 6 run scoreboard objectives setdisplay sidebar kill_phantom
+execute if score $mini_type mem matches 7 run scoreboard objectives setdisplay list health_disp
+execute if score $mini_type mem matches 7 run scoreboard objectives setdisplay belowName total_score
+execute if score $mini_type mem matches 7 run scoreboard objectives setdisplay sidebar total_score
 
 # 调用其他模块
 execute if score $mini_type mem matches 1 run function mini:parkour/game_start
@@ -26,3 +29,4 @@ 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
 execute if score $mini_type mem matches 6 run function mini:phantom/game_start
+execute if score $mini_type mem matches 7 run function mini:slime/game_start

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

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

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

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

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

@@ -1 +1,2 @@
 execute if score $mini_type mem matches 2 run function mini:tntrun/tick1
+execute if score $mini_type mem matches 7 run function mini:slime/tick1

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

@@ -3,6 +3,7 @@
 execute if score $mini_type mem matches 1 run function mini:parkour/tick20
 execute if score $mini_type mem matches 5 run function mini:zombie/tick20
 execute if score $mini_type mem matches 6 run function mini:phantom/tick20
+execute if score $mini_type mem matches 7 run function mini:slime/tick20
 
 # 结束游戏判定
 function mini:main/check_game_end

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

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

+ 4 - 0
data/mini/functions/slime/game/summon.mcfunction

@@ -0,0 +1,4 @@
+# 召唤史莱姆
+summon slime 1012.0 6.01 7015.0 {Size:2}
+effect give @e[type=slime] resistance 1000000 5 true
+schedule function mini:slime/game/summon2 1t

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

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

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

@@ -19,3 +19,6 @@ scoreboard players set $remove_resistance mem 1
 team modify player friendlyFire false
 team modify player collisionRule always
 gamerule fallDamage false
+
+# 第一只
+function mini:slime/game/summon

+ 2 - 0
data/mini/functions/slime/game_start.mcfunction

@@ -0,0 +1,2 @@
+# 史莱姆刷新倒计时
+scoreboard players set $countdown mem 40

+ 24 - 0
data/mini/functions/slime/player_enter.mcfunction

@@ -0,0 +1,24 @@
+# 单个玩家开始小游戏时执行
+function lib:sounds/music/mini_middle
+title @s clear
+title @s actionbar ""
+
+# 状态效果
+effect clear @s
+effect give @s saturation 1000000 0 true
+effect give @s instant_health 10 0 true
+gamerule naturalRegeneration false
+effect give @s night_vision 1000000 0 true
+
+# 传送玩家
+tp @s[tag=!debug] 1015.79 7.01 7009.40
+
+# 调整模式
+gamemode spectator @s[tag=!debug]
+gamemode adventure @s[tag=!watcher,tag=!rejoining,tag=!debug]
+
+# 重新加入处理
+execute if entity @s[tag=rejoining] run function mini:slime/player_failed
+
+# 给予物品
+replaceitem entity @s hotbar.8 stick{Enchantments:[{id:"knockback",lvl:1}],Unbreakable:1b,display:{Name:'{"text":"击退棒","italic":false}'}} 1

+ 5 - 0
data/mini/functions/slime/player_failed.mcfunction

@@ -0,0 +1,5 @@
+# 玩家死亡时由玩家自己触发
+function mini:main/player_failed
+
+# 给死亡玩家加夜视
+effect give @s night_vision 1000000 0 true

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

@@ -1,5 +1,5 @@
 # 向单个玩家展示小游戏介绍
-tp @s[tag=!debug] 1062.34 27.11 7040.84 461.44 28.30
+tp @s[tag=!debug] 1008.54 7.69 7003.91 332.38 9.83
 tellraw @s ["",{"text":"\n >> 夺命足球 >>\n\n","color":"gold","bold":true}," 将史莱姆踢到其他人的脸上, 干掉他们!\n"]
 tellraw @s ["",{"text": " <死亡淘汰制> ","color":"red","bold": true}, {"text":"生命无法自然恢复, 被史莱姆杀死时即被淘汰。","color":"gray"}]
 tellraw @s ["",{"text": " <间接 PVP> ","color":"light_purple","bold": true}, {"text":"无法直接攻击他人, 但可以击退史莱姆撞击他人。","color":"gray"}]

+ 8 - 0
data/mini/functions/slime/tick20.mcfunction

@@ -0,0 +1,8 @@
+
+# 显示提示
+execute if score $countdown mem matches 5 run tellraw @a ["",{"text": ">> ","color":"gold","bold": true},{"text": "新的史莱姆将在 5 秒后空投到球场中央!","color":"gold"}]
+
+# 召唤
+execute if score $countdown mem matches 0 run function mini:slime/game/summon
+execute if score $countdown mem matches 0 run tellraw @a ["",{"text": ">> ","color":"red","bold": true},{"text": "新的史莱姆已空投!","color":"red"}]
+scoreboard players set $countdown mem 30

+ 3 - 0
data/mini/functions/slime/watcher_limit.mcfunction

@@ -0,0 +1,3 @@
+# 观察者限制飞行范围
+execute as @a[gamemode=spectator] unless entity @s[x=1001,y=6,z=7001,dx=30,dz=4,dy=30] run spectate
+execute as @a[gamemode=spectator] unless entity @s[x=1001,y=6,z=7001,dx=30,dz=4,dy=30] run tp @s[tag=!debug] 1008.54 7.69 7003.91 332.38 9.83

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

@@ -18,3 +18,10 @@ scoreboard players set $remove_resistance mem 1
 team modify player friendlyFire false
 team modify player collisionRule always
 gamerule fallDamage false
+
+# 先召唤几只
+function mini:zombie/game/summon_empty
+function mini:zombie/game/summon_empty
+function mini:zombie/game/summon_empty
+function mini:zombie/game/summon_empty
+function mini:zombie/game/summon_empty

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

@@ -1,8 +1 @@
-# 游戏开始时先召唤几只
-
-function mini:zombie/game/summon_empty
-function mini:zombie/game/summon_empty
-function mini:zombie/game/summon_empty
-
-# 怪物刷新倒计时
 scoreboard players set $countdown mem 170