LTCatt před 6 roky
rodič
revize
fdbf4c4a9f

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

@@ -2,6 +2,7 @@
 function mini:tntrun/init
 function mini:parkour/init
 function mini:phantom/init
+function mini:slime/init
 
 # 计分板初始化
 scoreboard objectives remove mini_score

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

@@ -1,6 +1,7 @@
 # 初始化跑酷地图
 forceload add 1000 1000 1064 1064
 
+scoreboard players reset * treasure
 scoreboard players set $finish_mode mem 1
 scoreboard players set $tempo_enable mem 1
 scoreboard players set $countdown_fast mem 0

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

@@ -1,4 +1,2 @@
 # 游戏结束倒计时
 scoreboard players set $countdown mem 140
-
-scoreboard players reset * treasure

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

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

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

@@ -1,4 +1 @@
-execute if score $countdown mem matches 101.. as @e[type=slime] run attribute @s minecraft:generic.attack_damage base set 3
-execute if score $countdown mem matches 61..100 as @e[type=slime] run attribute @s minecraft:generic.attack_damage base set 5
-execute if score $countdown mem matches 21..60 as @e[type=slime] run attribute @s minecraft:generic.attack_damage base set 7
-execute if score $countdown mem matches ..20 as @e[type=slime] run attribute @s minecraft:generic.attack_damage base set 9
+execute as @e[type=slime] run attribute @s minecraft:generic.attack_damage base set 2

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

@@ -1,2 +1,5 @@
 # 结束史莱姆
 forceload remove 1000 7000 1064 7064
+
+# 计算得分
+execute as @a[tag=!watcher,tag=!debug] run scoreboard players operation @s mini_score = @s slime_score

+ 1 - 4
data/mini/functions/slime/game_start.mcfunction

@@ -1,6 +1,3 @@
-
-# 第一只
 function mini:slime/game/summon
-
-# 史莱姆刷新倒计时
 scoreboard players set $countdown mem 120
+scoreboard players reset * slime_score

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

@@ -0,0 +1,3 @@
+# 重置记分板
+scoreboard objectives remove slime_score
+scoreboard objectives add slime_score dummy "史莱姆命中数"

+ 5 - 1
data/mini/functions/slime/player_enter.mcfunction

@@ -16,6 +16,10 @@ attribute @s generic.max_health base set 20
 # 传送玩家
 tp @s[tag=!debug] 1002.0 7.5 7002.0
 
+# 重置记分板
+scoreboard players reset @s slime_score
+scoreboard players set @s[tag=!watcher,tag=!rejoining,tag=!debug] slime_score 0
+
 # 调整模式
 gamemode spectator @s[tag=!debug]
 gamemode adventure @s[tag=!watcher,tag=!rejoining,tag=!debug]
@@ -24,4 +28,4 @@ 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{game_item:1b,Enchantments:[{id:"knockback",lvl:2}],display:{Name:'{"text":"补给用击退棒","italic":false,"color":"white"}'}} 1
+replaceitem entity @s hotbar.8 stick{game_item:1b,Enchantments:[{id:"knockback",lvl:1}],display:{Name:'{"text":"补给用击退棒","italic":false,"color":"white"}'}} 1

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

@@ -1,5 +1,6 @@
 # 玩家死亡时由玩家自己触发
-function mini:main/player_failed
-
-# 给死亡玩家加夜视
-effect give @s night_vision 1000000 0 true
+gamemode spectator
+effect give @s night_vision 1000000 0 true
+tellraw @a ["",{"text": ">> ","color":"red","bold": true},{"selector": "@s","color":"red"}," 已死亡!"]
+execute as @a at @s run function lib:sounds/error
+execute unless entity @a[gamemode=adventure] run function mini:main/game_end

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

@@ -1,9 +1,9 @@
 # 向单个玩家展示小游戏介绍
 tp @s[tag=!debug] 1004.13 7.86 7003.00 -2922.38 12.84
-tellraw @s ["",{"text":"\n >> 夺命足球 >>\n\n","color":"gold","bold":true}," 将史莱姆踢到其他人的脸上, 干掉他们!\n"]
-tellraw @s ["",{"text": " <死亡淘汰制> ","color":"red","bold": true}, {"text":"生命无法自然恢复, 被史莱姆杀死时即被淘汰。","color":"gray"}]
+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"}]
-tellraw @s ["",{"text": " <提供补给> ","color":"aqua","bold": true}, {"text":"快捷栏的最后一格将提供击退 II 木棍。","color":"gray"}]
+tellraw @s ["",{"text": " <提供补给> ","color":"aqua","bold": true}, {"text":"快捷栏的最后一格将提供击退 I 木棍。","color":"gray"}]
 tellraw @s ["",{"text": " <原型> ","color":"gold","bold": true}, {"text":"此游戏目前仅用于玩法测试, 尚未进行修缮。","color":"gray"}]
 tellraw @s ["",{"text": " <早期测试> ","color":"dark_red","bold": true}, {"text":"这是刚做出来的新游戏, 碰到什么见鬼问题都很正常!","color":"dark_red"}]
 tellraw @s ""

+ 10 - 35
data/mini/functions/slime/tick20.mcfunction

@@ -1,36 +1,11 @@
 
-# 属性提升 1
-execute if score $countdown mem matches 100 run function mini:slime/game/set_attack
-execute if score $countdown mem matches 100 run tellraw @a ["",{"text": ">> ","color":"red","bold": true},{"text": "史莱姆的攻击力提高了!","color":"red"}]
-execute if score $countdown mem matches 100 as @a at @s run function lib:sounds/error
-
-# 召唤提示 1
-execute if score $countdown mem matches 85 run tellraw @a ["",{"text": ">> ","color":"gold","bold": true},{"text": "新的史莱姆将在 5 秒后空投到球场中央!","color":"gold"}]
-execute if score $countdown mem matches 85 as @a at @s run function lib:sounds/error
-# 召唤 1
-execute if score $countdown mem matches 80 run function mini:slime/game/summon
-execute if score $countdown mem matches 80 run tellraw @a ["",{"text": ">> ","color":"red","bold": true},{"text": "新的史莱姆已空投!","color":"red"}]
-execute if score $countdown mem matches 80 as @a at @s run function lib:sounds/teleport
-
-# 属性提升 2
-execute if score $countdown mem matches 60 run function mini:slime/game/set_attack
-execute if score $countdown mem matches 60 run tellraw @a ["",{"text": ">> ","color":"red","bold": true},{"text": "史莱姆的攻击力提高了!","color":"red"}]
-execute if score $countdown mem matches 60 as @a at @s run function lib:sounds/error
-
-# 速度提升
-execute if score $countdown mem matches ..40 run effect give @e[type=slime] speed 2 6
-execute if score $countdown mem matches 40 run tellraw @a ["",{"text": ">> ","color":"red","bold": true},{"text": "史莱姆的速度提高了!","color":"red"}]
-execute if score $countdown mem matches 40 as @a at @s run function lib:sounds/error
-
-# 属性提升 3
-execute if score $countdown mem matches 20 run function mini:slime/game/set_attack
-execute if score $countdown mem matches 20 run tellraw @a ["",{"text": ">> ","color":"red","bold": true},{"text": "史莱姆的攻击力提高了!","color":"red"}]
-execute if score $countdown mem matches 20 as @a at @s run function lib:sounds/error
-
-# 召唤提示 2
-execute if score $countdown mem matches 6 run tellraw @a ["",{"text": ">> ","color":"gold","bold": true},{"text": "新的史莱姆将在 5 秒后空投到球场中央!","color":"gold"}]
-execute if score $countdown mem matches 6 as @a at @s run function lib:sounds/error
-# 召唤 2
-execute if score $countdown mem matches 1 run function mini:slime/game/summon
-execute if score $countdown mem matches 1 run tellraw @a ["",{"text": ">> ","color":"red","bold": true},{"text": "新的史莱姆已空投!","color":"red"}]
-execute if score $countdown mem matches 1 as @a at @s run function lib:sounds/teleport
+# 显示倒计时
+execute if score $countdown mem matches ..10 run title @a times 3 14 2
+execute if score $countdown mem matches ..10 run title @a subtitle {"score":{"name":"$countdown","objective":"mem"}}
+execute if score $countdown mem matches ..10 run title @a title [""]
+execute if score $countdown mem matches ..10 as @a at @s run function lib:sounds/hit2
+
+# -10s:提示游戏结束
+execute if score $countdown mem matches 10 run tellraw @a ["",{"text": ">> ","color":"aqua","bold": true},{"text": "球场马上就要关门了!","color":"aqua"}]
+# 0s:游戏结束
+execute if score $countdown mem matches 0 run function mini:main/game_end