Jelajahi Sumber

Merge branch 'master' of github.com:00ll00/LTW3

00ll00 6 tahun lalu
induk
melakukan
01d16fa485

+ 2 - 0
data/lib/functions/random.mcfunction

@@ -8,3 +8,5 @@ scoreboard players operation $random_max mem -= $random_min mem
 scoreboard players add $random_max mem 1
 scoreboard players add $random_max mem 1
 scoreboard players operation $random mem %= $random_max mem
 scoreboard players operation $random mem %= $random_max mem
 scoreboard players operation $random mem += $random_min mem
 scoreboard players operation $random mem += $random_min mem
+
+# TODO : 重置血量上限

+ 1 - 1
data/ltw/functions/state/4/player_enter.mcfunction

@@ -12,5 +12,5 @@ effect give @s night_vision 1000000 0 true
 function mini:main/player_intro
 function mini:main/player_intro
 
 
 # 自由旁观
 # 自由旁观
-gamemode spectator @s
+gamemode spectator
 spectate
 spectate

+ 0 - 4
data/ltw/functions/state/5/player_enter.mcfunction

@@ -1,6 +1,2 @@
 # 对单个玩家的处理(如果玩家中途加入就会执行此函数)
 # 对单个玩家的处理(如果玩家中途加入就会执行此函数)
-gamemode creative
-title @s clear
-
-# 使用小游戏的其他项目
 function mini:main/player_enter
 function mini:main/player_enter

+ 4 - 3
data/ltw/functions/state/7/player_enter.mcfunction

@@ -1,6 +1,6 @@
 # 对单个玩家的处理(如果玩家中途加入就会执行此函数)
 # 对单个玩家的处理(如果玩家中途加入就会执行此函数)
-title @s clear
 gamemode creative
 gamemode creative
+title @s clear
 
 
 # 状态效果
 # 状态效果
 effect clear @s
 effect clear @s
@@ -12,5 +12,6 @@ effect give @s resistance 1000000 4 true
 # 传送玩家
 # 传送玩家
 tp @s 7.0 11.4 2007.0 0 0
 tp @s 7.0 11.4 2007.0 0 0
 
 
-# 调整模式
-gamemode spectator
+# 自由旁观
+gamemode spectator
+spectate

+ 1 - 1
data/mini/functions/hotpm/player_enter.mcfunction

@@ -1,6 +1,6 @@
 # 单个玩家开始小游戏时执行
 # 单个玩家开始小游戏时执行
-title @s clear
 gamemode creative
 gamemode creative
+title @s clear
 
 
 # 状态效果
 # 状态效果
 effect clear @s
 effect clear @s

+ 3 - 1
data/mini/functions/hotpm/pm_boom.mcfunction

@@ -1,8 +1,10 @@
 #玩家失败
 #玩家失败
 function mini:hotpm/pm_lost
 function mini:hotpm/pm_lost
+# 告知玩家
+tellraw @a [{"text":">> ","color":"gold","bold": true},{"selector":"@s","color":"yellow","bold": false},{"text":"爆炸了!","color":"white","bold": false}]
 #记录位置
 #记录位置
 execute at @s run summon minecraft:area_effect_cloud ~ ~ ~ {Tags:["pm_boom"]}
 execute at @s run summon minecraft:area_effect_cloud ~ ~ ~ {Tags:["pm_boom"]}
 #减少生命
 #减少生命
 function mini:hotpm/player_failed
 function mini:hotpm/player_failed
 #选新土豆
 #选新土豆
-execute if score $t_alive mem matches 2.. as @e[type=area_effect_cloud,tag=pm_boom] run function mini:hotpm/pm_init
+execute if score $alive mem matches 2.. as @e[type=area_effect_cloud,tag=pm_boom] run function mini:hotpm/pm_init

+ 0 - 3
data/mini/functions/hotpm/pm_get.mcfunction

@@ -6,6 +6,3 @@ effect clear @s jump_boost
 effect give @s glowing 1000000 0 true
 effect give @s glowing 1000000 0 true
 effect give @s speed 1000000 1 true
 effect give @s speed 1000000 1 true
 effect give @s jump_boost 1000000 2 true
 effect give @s jump_boost 1000000 2 true
-
-# 告知玩家
-tellraw @a [{"text":">> ","color":"gold","bold": true},{"selector":"@s","color":"yellow","bold":false},{"text":" 获得了土豆!","color":"white","bold":false}]

+ 4 - 0
data/mini/functions/hotpm/pm_init.mcfunction

@@ -1,5 +1,9 @@
 # 将土豆刷新给离自己最远的人
 # 将土豆刷新给离自己最远的人
 execute at @s as @a[sort=furthest,tag=mini_running,tag=!watcher,limit=1] run function mini:hotpm/pm_get
 execute at @s as @a[sort=furthest,tag=mini_running,tag=!watcher,limit=1] run function mini:hotpm/pm_get
+
+# 告知玩家
+tellraw @a [{"text":">> ","color":"gold","bold": true},{"selector":"@a[tag=pm_hoding]","color":"yellow","bold":false},{"text":" 获得了土豆!","color":"white","bold":false}]
+
 # 强制观战
 # 强制观战
 execute at @s as @a[gamemode=spectator,distance=..0.1] run spectate @p[tag=pm_hoding]
 execute at @s as @a[gamemode=spectator,distance=..0.1] run spectate @p[tag=pm_hoding]
 
 

+ 1 - 4
data/mini/functions/hotpm/pm_lost.mcfunction

@@ -4,7 +4,4 @@ effect clear @s glowing
 effect clear @s speed
 effect clear @s speed
 effect clear @s jump_boost
 effect clear @s jump_boost
 effect give @s speed 3 1 true
 effect give @s speed 3 1 true
-effect give @s jump_boost 2 1 true
-
-# 告知玩家
-tellraw @a [{"text":">> ","color":"gold","bold": true},{"selector":"@s","color":"yellow","bold": false},{"text":"爆炸了!","color":"white","bold": false}]
+effect give @s jump_boost 2 1 true

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

@@ -6,3 +6,7 @@ execute if score $mini_type mem matches 4 run function mini:colormatch/game_init
 
 
 # 计分板初始化
 # 计分板初始化
 scoreboard players reset * mini_score
 scoreboard players reset * mini_score
+
+# 计算玩家数量
+execute store result score $alive mem if entity @a[tag=mini_running,tag=!watcher]
+

+ 3 - 3
data/mini/functions/main/player_failed.mcfunction

@@ -2,9 +2,9 @@
 
 
 # 计数
 # 计数
 tag @s remove mini_running
 tag @s remove mini_running
-execute store result score $t_alive mem if entity @a[tag=mini_running,tag=!watcher]
+execute store result score $alive mem if entity @a[tag=mini_running,tag=!watcher]
 execute store result score $t_finish mem if entity @a[tag=!mini_running,tag=!watcher]
 execute store result score $t_finish mem if entity @a[tag=!mini_running,tag=!watcher]
-execute if entity @s[tag=!rejoining] if score $t_alive mem matches 1.. run tellraw @a [{"selector": "@s","color":"red"}," 已失败! 剩余 ",{"score": {"name": "$t_alive","objective": "mem"}}," 人!"]
+execute if entity @s[tag=!rejoining] if score $alive mem matches 1.. run tellraw @a [{"selector": "@s","color":"red"}," 已失败! 剩余 ",{"score": {"name": "$alive","objective": "mem"}}," 人!"]
 
 
 # 给存活的玩家加分
 # 给存活的玩家加分
 scoreboard players add @a[tag=mini_running] mini_score 1
 scoreboard players add @a[tag=mini_running] mini_score 1
@@ -15,4 +15,4 @@ spectate @r[tag=mini_running]
 
 
 # 如果只有一个玩家没有失败,则游戏结束
 # 如果只有一个玩家没有失败,则游戏结束
 # 这里设置成等于就不会触发多次 game_end 了
 # 这里设置成等于就不会触发多次 game_end 了
-execute if score $t_alive mem matches 1 run function mini:main/game_end
+execute if score $alive mem matches 1 run function mini:main/game_end

+ 2 - 2
data/mini/functions/main/player_finished.mcfunction

@@ -2,7 +2,7 @@
 
 
 # 计数
 # 计数
 tag @s remove mini_running
 tag @s remove mini_running
-execute store result score $t_alive mem if entity @a[tag=mini_running,tag=!watcher]
+execute store result score $alive mem if entity @a[tag=mini_running,tag=!watcher]
 execute store result score $t_finish mem if entity @a[tag=!mini_running,tag=!watcher]
 execute store result score $t_finish mem if entity @a[tag=!mini_running,tag=!watcher]
 execute if entity @s[tag=!rejoining] if score $t_finish mem matches ..3 run tellraw @a [{"selector": "@s","color":"green"}," 已成功! 第 ",{"score": {"name": "$t_finish","objective": "mem"}}," 名!"]
 execute if entity @s[tag=!rejoining] if score $t_finish mem matches ..3 run tellraw @a [{"selector": "@s","color":"green"}," 已成功! 第 ",{"score": {"name": "$t_finish","objective": "mem"}}," 名!"]
 
 
@@ -16,4 +16,4 @@ spectate @r[tag=mini_running]
 # 如果有三个玩家成功,或只有一个玩家未成功,则游戏结束
 # 如果有三个玩家成功,或只有一个玩家未成功,则游戏结束
 # 这里设置成等于就不会触发多次 game_end 了
 # 这里设置成等于就不会触发多次 game_end 了
 execute if score $t_finish mem matches 3 run function mini:main/game_end
 execute if score $t_finish mem matches 3 run function mini:main/game_end
-execute if score $t_finish mem matches ..2 if score $t_alive mem matches 1 run function mini:main/game_end
+execute if score $t_finish mem matches ..2 if score $alive mem matches 1 run function mini:main/game_end

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

@@ -1,6 +1,6 @@
 # 单个玩家开始小游戏时执行
 # 单个玩家开始小游戏时执行
-title @s clear
 gamemode creative
 gamemode creative
+title @s clear
 
 
 # 状态效果
 # 状态效果
 effect clear @s
 effect clear @s

+ 1 - 1
data/mini/functions/tntrun/player_enter.mcfunction

@@ -1,6 +1,6 @@
 # 单个玩家开始小游戏时执行
 # 单个玩家开始小游戏时执行
-title @s clear
 gamemode creative
 gamemode creative
+title @s clear
 
 
 # 状态效果
 # 状态效果
 effect clear @s
 effect clear @s