LTCatt 6 лет назад
Родитель
Сommit
d52c43babb

+ 1 - 0
data/ltw/functions/clock/tick4.mcfunction

@@ -2,6 +2,7 @@
 schedule function ltw:clock/tick4 4t replace
 schedule function ltw:clock/tick4 4t replace
 
 
 # 调用其他模块
 # 调用其他模块
+execute if score $state mem matches 0 run function ltw:state/0/tick4
 execute if score $state mem matches 4 run function ltw:state/4/tick4
 execute if score $state mem matches 4 run function ltw:state/4/tick4
 execute if score $state mem matches 5 run function ltw:state/5/tick4
 execute if score $state mem matches 5 run function ltw:state/5/tick4
 execute if score $state mem matches 6 run function ltw:state/6/tick4
 execute if score $state mem matches 6 run function ltw:state/6/tick4

+ 16 - 0
data/ltw/functions/state/0/player_enter.mcfunction

@@ -0,0 +1,16 @@
+# 对单个玩家的处理(如果玩家中途加入就会执行此函数)
+gamemode creative
+title @s clear
+
+# 状态效果
+effect clear @s
+effect give @s saturation 1000000 0 true
+effect give @s instant_health 10 0 true
+effect give @s night_vision 1000000 0 true
+effect give @s resistance 1000000 4 true
+
+# 冒险模式
+gamemode adventure
+
+# 传送玩家
+tp @s 10 16 10

+ 2 - 0
data/ltw/functions/state/0/start_classic.mcfunction

@@ -0,0 +1,2 @@
+# 尝试开始经典模式
+tellraw @a[tag=hub_classic] {"text": "经典模式尚未完成, 请开始小游戏模式!","color":"red"}

+ 10 - 0
data/ltw/functions/state/0/start_gameparty.mcfunction

@@ -0,0 +1,10 @@
+# 尝试开始小游戏模式
+
+# 计算玩家数量
+scoreboard players set $count mem 0
+execute as @a[tag=hub_gameparty] run scoreboard players add $count mem 1
+
+# 根据玩家数量判定
+execute if score $count mem matches ..2 run tellraw @a[tag=hub_classic] [{"text": "人数不足, 需要至少 3 人, 当前仅有 ","color":"red"},{"score": { "name": "$count","objective": "mem"}}, "人!"]
+execute if score $count mem matches 9.. run tellraw @a[tag=hub_classic] [{"text": "人数过多, 最多支持 8 人, 当前已有 ","color":"red"},{"score": { "name": "$count","objective": "mem"}}, "人!"]
+execute if score $count mem matches 3..8 run tellraw @a {"text": "小游戏模式即将开始!","color":"green"}

+ 3 - 0
data/ltw/functions/state/0/state_enter.mcfunction

@@ -0,0 +1,3 @@
+# 要求系统进入状态 0(等待大厅)
+scoreboard players set $state mem 0
+execute as @a run function ltw:state/0/player_enter

+ 9 - 0
data/ltw/functions/state/0/tick4.mcfunction

@@ -0,0 +1,9 @@
+# 将玩家分类:经典、小游戏、旁观
+tag @a remove hub_classic
+tag @a remove hub_gameparty
+tag @a remove hub_watch
+execute as @a if block ~ ~-1 ~ crimson_hyphae run tag @s add hub_classic
+execute as @a if block ~ ~-2 ~ crimson_hyphae run tag @s add hub_classic
+execute as @a if block ~ ~-1 ~ warped_hyphae run tag @s add hub_gameparty
+execute as @a if block ~ ~-2 ~ warped_hyphae run tag @s add hub_gameparty
+tag @a[tag=!hub_classic,tag=!hub_gameparty] add hub_watch

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

@@ -23,4 +23,4 @@ schedule function mini:hotpm/player_enter2 1t replace
 # schedule: tp @a ~ 25 ~
 # schedule: tp @a ~ 25 ~
 
 
 # 3秒后给予土豆
 # 3秒后给予土豆
-schedule function mini:hotpm/pm_init_init 3s replace
+schedule function mini:hotpm/pm_init_first 3s replace

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

@@ -1,6 +1,7 @@
 # 清理残余tag
 # 清理残余tag
 tag @a[tag=pm_hoding] remove pm_hoding
 tag @a[tag=pm_hoding] remove pm_hoding
 
 
+# TODO : 这个见鬼东西现在会刷新给最近的人
 # 将土豆刷新给离自己最远的人
 # 将土豆刷新给离自己最远的人
 execute at @s as @a[sort=furthest,tag=mini_running,limit=1] run function mini:hotpm/pm_get
 execute at @s as @a[sort=furthest,tag=mini_running,limit=1] run function mini:hotpm/pm_get
 
 

+ 0 - 0
data/mini/functions/hotpm/pm_init_init.mcfunction → data/mini/functions/hotpm/pm_init_first.mcfunction