LTCatt 5 лет назад
Родитель
Сommit
1060ca2b94

+ 0 - 1
data/ltw/functions/main/player_enter.mcfunction

@@ -31,5 +31,4 @@ function lib:bossbar/show
 # FIXME: [LTCat] 最后一轮还是会刷出道具
 # TODO: [LTCat] 优化色彩迷阵的加速算法
 # FIXME: 准备倒计时与 Tooltip 降低不一致
-# TODO: 让主大厅 BGM 可以循环播放
 # FIXME: [LTCat] 初尝胜果 成就的判断似乎存在 Bug

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

@@ -0,0 +1,3 @@
+# 游戏结束
+forceload remove 1000 5000 1064 5064
+gamerule doDaylightCycle false

+ 20 - 0
data/mini/functions/diamond/game_init.mcfunction

@@ -0,0 +1,20 @@
+# 初始化钻石地图
+forceload add 1000 5000 1064 5064
+
+scoreboard players set $finish_mode mem 1
+
+# 调整时间
+time set 2000t
+
+# 生成地图
+setblock 1000 255 5000 minecraft:structure_block[mode=load]{metadata:"",mirror:"NONE",ignoreEntities:1b,powered:0b,seed:0L,author:"LTCat",rotation:"NONE",posX:0,mode:"LOAD",posY:-22,sizeX:20,posZ:0,integrity:1.0f,showair:0b,name:"mini:diamond",sizeY:23,sizeZ:20,showboundingbox:1b}
+setblock 1000 255 5001 redstone_block
+
+# 清理残余实体
+kill @e[type=!player,x=950,y=0,z=4950,dx=100,dy=500,dz=100]
+
+# 伤害管理
+scoreboard players set $remove_resistance mem 1
+team modify player friendlyFire true
+team modify player collisionRule always
+gamerule fallDamage true

+ 12 - 0
data/mini/functions/diamond/game_start.mcfunction

@@ -0,0 +1,12 @@
+gamerule doDaylightCycle true
+scoreboard players set $countdown mem 300
+
+# HUD
+execute if score $mini_type mem matches 5 run scoreboard objectives setdisplay list health_disp
+execute if score $mini_type mem matches 5 run scoreboard objectives setdisplay belowName health_disp
+execute if score $mini_type mem matches 5 run scoreboard objectives setdisplay sidebar total_score
+scoreboard players set $bossbar_color mem 4
+scoreboard players set $countdown_max mem 300
+scoreboard players set $bossbar_type mem 2
+function lib:bossbar/show
+bossbar set mini:blue name "剩余时间"

+ 20 - 0
data/mini/functions/diamond/player_enter.mcfunction

@@ -0,0 +1,20 @@
+# 单个玩家开始小游戏时执行
+# TODO: 让 BGM 支持循环播放
+function lib:sounds/music/mini_slow
+title @s clear
+title @s actionbar ""
+
+# 状态效果
+effect clear @s
+effect give @s saturation 1000000 0 true
+gamerule naturalRegeneration false
+
+# 设置玩家生命
+attribute @s generic.max_health base set 20
+
+# 传送玩家
+spreadplayers 1010 6010 4 6 under 255 false @s[team=playing,tag=!rejoining]
+
+# 调整模式
+gamemode spectator @s[team=!debugging]
+gamemode survival @s[team=playing,tag=!rejoining]