Procházet zdrojové kódy

合并阶段 7、8

LTCatt před 6 roky
rodič
revize
71fe3b0fd2

+ 1 - 1
data/item/functions/bonus_item/call.mcfunction

@@ -19,4 +19,4 @@ execute if data block 0 0 0 RecordItem.tag.bonus_add_score run function item:bon
 execute if data block 0 0 0 RecordItem.tag.bonus_give_items[0] run function item:bonus_item/give_items
 
 # 执行特定函数
-execute if score $state mem matches 8 run function ltw:state/8/pickup
+execute if score $state mem matches 7 run function ltw:state/7/pickup

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

@@ -8,7 +8,6 @@ execute if score $state mem matches 4 run function ltw:state/4/tick2
 execute if score $state mem matches 5 run function ltw:state/5/tick2
 execute if score $state mem matches 6 run function ltw:state/6/tick2
 execute if score $state mem matches 7 run function ltw:state/7/tick2
-execute if score $state mem matches 8 run function ltw:state/8/tick2
 
 # 全局倒计时
 execute if score $countdown_fast mem matches 1.. run scoreboard players remove $countdown_fast mem 1

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

@@ -7,7 +7,6 @@ execute if score $state mem matches 4 run function ltw:state/4/tick20
 execute if score $state mem matches 5 run function ltw:state/5/tick20
 execute if score $state mem matches 6 run function ltw:state/6/tick20
 execute if score $state mem matches 7 run function ltw:state/7/tick20
-execute if score $state mem matches 8 run function ltw:state/8/tick20
 
 # 全局倒计时
 execute if score $countdown mem matches 1.. run scoreboard players remove $countdown mem 1

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

@@ -16,5 +16,4 @@ execute if score $state mem matches 4 run function ltw:state/4/player_enter
 execute if score $state mem matches 5 run function ltw:state/5/player_enter
 execute if score $state mem matches 6 run function ltw:state/6/player_enter
 execute if score $state mem matches 7 run function ltw:state/7/player_enter
-execute if score $state mem matches 8 run function ltw:state/8/player_enter
 tag @s remove rejoining

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

@@ -19,5 +19,4 @@ execute if score $state mem matches 4 run function ltw:state/4/player_enter
 execute if score $state mem matches 5 run function ltw:state/5/player_enter
 execute if score $state mem matches 6 run function ltw:state/6/player_enter
 execute if score $state mem matches 7 run function ltw:state/7/player_enter
-execute if score $state mem matches 8 run function ltw:state/8/player_enter
 tag @s remove rejoining

+ 3 - 0
data/ltw/functions/state/6/player_enter.mcfunction

@@ -3,6 +3,9 @@ function lib:sounds/music/rest
 title @s clear
 title @s actionbar ""
 
+# 重置玩家血量上限
+execute as @a run attribute @s generic.max_health base set 20
+
 # 状态效果
 effect clear @s
 effect give @s saturation 1000000 0 true

+ 28 - 1
data/ltw/functions/state/6/state_enter.mcfunction

@@ -8,4 +8,31 @@ scoreboard objectives setdisplay sidebar total_score
 scoreboard objectives setdisplay list total_score_disp
 
 # 初始化倒计时
-scoreboard players set $countdown mem 15
+scoreboard players set $countdown mem 10
+
+# 初始化地图
+forceload add 0 2000 50 2050
+kill @e[type=item]
+
+# 生成地图
+setblock 0 10 2000 minecraft:structure_block{mode:"LOAD",name:"ltw:select"}
+setblock 0 11 2000 minecraft:redstone_block
+
+# 生成奖励物品
+execute store result score $t_player_count mem if entity @a[tag=!watcher]
+# scoreboard players set $t_player_count mem 8
+execute if score $t_player_count mem matches 1.. positioned 9.0 12.5 2012.5 run function item:bonus_item/rank/random
+execute if score $t_player_count mem matches 2.. positioned 5.0 12.5 2012.5 run function item:bonus_item/rank/random
+execute if score $t_player_count mem matches 3.. positioned 1.5 12.5 2009.0 run function item:bonus_item/rank/random
+execute if score $t_player_count mem matches 4.. positioned 1.5 12.5 2005.0 run function item:bonus_item/rank/random
+execute if score $t_player_count mem matches 5.. positioned 5.0 12.5 2001.5 run function item:bonus_item/rank/random
+execute if score $t_player_count mem matches 6.. positioned 9.0 12.5 2001.5 run function item:bonus_item/rank/random
+execute if score $t_player_count mem matches 7.. positioned 12.5 12.5 2005.0 run function item:bonus_item/rank/random
+execute if score $t_player_count mem matches 8.. positioned 12.5 12.5 2009.0 run function item:bonus_item/rank/random
+
+# 生成拾取窗口
+execute as @e[type=item] at @s run fill ~-0.2 ~ ~-0.2 ~0.2 ~ ~0.2 air
+execute as @e[type=item] at @s run fill ~-0.2 ~1 ~-0.2 ~0.2 ~1 ~0.2 barrier
+
+# 防止幽灵实体,分 tick 执行
+schedule function ltw:state/7/state_enter2 1t

+ 0 - 0
data/ltw/functions/state/7/state_enter2.mcfunction → data/ltw/functions/state/6/state_enter2.mcfunction


+ 2 - 2
data/ltw/functions/state/6/tick20.mcfunction

@@ -1,7 +1,7 @@
 # 显示倒计时
 title @a times 3 14 2
 title @a subtitle {"score":{"name":"$countdown","objective":"mem"}}
-title @a title [""]
+title @a title "准备选择奖励"
 
 # 退出状态
-execute if score $countdown mem matches ..11 run function ltw:state/7/state_enter
+execute if score $countdown mem matches ..6 run function ltw:state/7/state_enter

+ 0 - 0
data/ltw/functions/state/8/continue_gameparty.mcfunction → data/ltw/functions/state/7/continue_gameparty.mcfunction


+ 5 - 3
data/ltw/functions/state/8/next.mcfunction → data/ltw/functions/state/7/next.mcfunction

@@ -15,13 +15,15 @@ execute unless entity @a[tag=selecting] run tag @a[tag=mini_rank4] add selecting
 execute unless entity @a[tag=mini_rank1] unless entity @a[tag=mini_rank2] unless entity @a[tag=mini_rank3] if entity @a[tag=mini_rank4] run tellraw @a[tag=!selecting] ["",{"text": ">> ","color":"gold","bold": true},"轮到其他人选择奖励了!"]
 
 # 以玩家为对象开始执行
-execute as @a[tag=selecting] run function ltw:state/8/next2
-execute unless entity @a[tag=selecting] if score $game_type mem matches 1 if score $round mem matches ..5 run function ltw:state/8/continue_gameparty
+execute as @a[tag=selecting] run function ltw:state/7/next2
+execute unless entity @a[tag=selecting] if score $game_type mem matches 1 if score $round mem matches ..5 run function ltw:state/7/continue_gameparty
 execute unless entity @a[tag=selecting] if score $game_type mem matches 1 if score $round mem matches 6.. run function ltw:main/game_end
 
 # 初始化倒计时
-scoreboard players set $countdown mem 5
+scoreboard players set $countdown mem 10
 
 # 播放音效
 execute as @a[tag=selecting] at @s run function lib:sounds/hit
 execute as @a[tag=!selecting] at @s run function lib:sounds/hit2
+
+# FIXME : 僵尸游戏的旁观者偶尔会抽搐

+ 0 - 0
data/ltw/functions/state/8/next2.mcfunction → data/ltw/functions/state/7/next2.mcfunction


+ 0 - 0
data/ltw/functions/state/8/pickup.mcfunction → data/ltw/functions/state/7/pickup.mcfunction


+ 17 - 5
data/ltw/functions/state/7/player_enter.mcfunction

@@ -2,15 +2,27 @@
 title @s clear
 title @s actionbar ""
 
-# 重置玩家血量上限
-execute as @a run attribute @s generic.max_health base set 20
-
 # 状态效果
 effect clear @s
 effect give @s saturation 1000000 0 true
 gamerule naturalRegeneration true
-effect give @s blindness 1000000 0 true
+effect give @s night_vision 1000000 0 true
+effect give @s resistance 1000000 4 true
+
+# 传送玩家
+tp @s 7.0 11.4 2007.0 0 0
+execute at @s run function lib:sounds/travel
+
+# 清除 Tag
+tag @s[tag=watcher] remove mini_rank1
+tag @s[tag=watcher] remove mini_rank2
+tag @s[tag=watcher] remove mini_rank3
+tag @s[tag=watcher] remove mini_rank4
+tag @s[tag=rejoining] remove mini_rank1
+tag @s[tag=rejoining] remove mini_rank2
+tag @s[tag=rejoining] remove mini_rank3
+tag @s[tag=rejoining] remove mini_rank4
 
 # 自由旁观
-gamemode spectator @s
+gamemode spectator
 spectate

+ 6 - 28
data/ltw/functions/state/7/state_enter.mcfunction

@@ -1,4 +1,4 @@
-# 要求系统进入状态 7(小游戏阶段结束,初始化奖励房)
+# 要求系统进入状态 7(选择奖励)
 scoreboard players set $state mem 7
 execute as @a run function ltw:state/7/player_enter
 
@@ -8,31 +8,9 @@ scoreboard objectives setdisplay sidebar total_score
 scoreboard objectives setdisplay list total_score_disp
 
 # 初始化倒计时
-scoreboard players set $countdown mem 11
+scoreboard players set $countdown mem 6
 
-# 初始化地图
-forceload add 0 2000 50 2050
-kill @e[type=item]
-
-# 生成地图
-setblock 0 10 2000 minecraft:structure_block{mode:"LOAD",name:"ltw:select"}
-setblock 0 11 2000 minecraft:redstone_block
-
-# 生成奖励物品
-execute store result score $t_player_count mem if entity @a[tag=!watcher]
-# scoreboard players set $t_player_count mem 8
-execute if score $t_player_count mem matches 1.. positioned 9.0 12.5 2012.5 run function item:bonus_item/rank/random
-execute if score $t_player_count mem matches 2.. positioned 5.0 12.5 2012.5 run function item:bonus_item/rank/random
-execute if score $t_player_count mem matches 3.. positioned 1.5 12.5 2009.0 run function item:bonus_item/rank/random
-execute if score $t_player_count mem matches 4.. positioned 1.5 12.5 2005.0 run function item:bonus_item/rank/random
-execute if score $t_player_count mem matches 5.. positioned 5.0 12.5 2001.5 run function item:bonus_item/rank/random
-execute if score $t_player_count mem matches 6.. positioned 9.0 12.5 2001.5 run function item:bonus_item/rank/random
-execute if score $t_player_count mem matches 7.. positioned 12.5 12.5 2005.0 run function item:bonus_item/rank/random
-execute if score $t_player_count mem matches 8.. positioned 12.5 12.5 2009.0 run function item:bonus_item/rank/random
-
-# 生成拾取窗口
-execute as @e[type=item] at @s run fill ~-0.2 ~ ~-0.2 ~0.2 ~ ~0.2 air
-execute as @e[type=item] at @s run fill ~-0.2 ~1 ~-0.2 ~0.2 ~1 ~0.2 barrier
-
-# 防止幽灵实体,分 tick 执行
-schedule function ltw:state/7/state_enter2 1t
+# 伤害管理
+team modify player friendlyFire false
+team modify player collisionRule always
+gamerule fallDamage false

+ 3 - 3
data/ltw/functions/state/7/tick2.mcfunction

@@ -1,3 +1,3 @@
-# 固定旁观
-execute as @a run spectate
-tp @a 0 10000 1000 0 0
+# 观察者限制
+execute as @a[gamemode=spectator] run spectate
+execute as @a[gamemode=spectator] run tp @s 7.0 11.4 2007.0

+ 3 - 3
data/ltw/functions/state/7/tick20.mcfunction

@@ -1,7 +1,7 @@
 # 显示倒计时
 title @a times 3 14 2
 title @a subtitle {"score":{"name":"$countdown","objective":"mem"}}
-title @a title "选择奖励"
+title @a title ""
 
-# 退出状态
-execute if score $countdown mem matches 7 run function ltw:state/8/state_enter
+# 下一状态
+execute if score $countdown mem matches 1 run function ltw:state/7/next

+ 0 - 30
data/ltw/functions/state/8/player_enter.mcfunction

@@ -1,30 +0,0 @@
-# 对单个玩家的处理(如果玩家中途加入就会执行此函数)
-title @s clear
-title @s actionbar ""
-
-# 状态效果
-effect clear @s
-effect give @s saturation 1000000 0 true
-gamerule naturalRegeneration true
-effect give @s night_vision 1000000 0 true
-effect give @s resistance 1000000 4 true
-
-# 传送玩家
-tp @s 7.0 11.4 2007.0 0 0
-
-# 清除 Tag
-tag @s[tag=watcher] remove mini_rank1
-tag @s[tag=watcher] remove mini_rank2
-tag @s[tag=watcher] remove mini_rank3
-tag @s[tag=watcher] remove mini_rank4
-tag @s[tag=rejoining] remove mini_rank1
-tag @s[tag=rejoining] remove mini_rank2
-tag @s[tag=rejoining] remove mini_rank3
-tag @s[tag=rejoining] remove mini_rank4
-
-# 播放音效
-execute at @s run function lib:sounds/travel
-
-# 自由旁观
-gamemode spectator
-spectate

+ 0 - 16
data/ltw/functions/state/8/state_enter.mcfunction

@@ -1,16 +0,0 @@
-# 要求系统进入状态 8(选择奖励)
-scoreboard players set $state mem 8
-execute as @a run function ltw:state/8/player_enter
-
-# HUD
-scoreboard objectives setdisplay belowName total_score_disp
-scoreboard objectives setdisplay sidebar total_score
-scoreboard objectives setdisplay list total_score_disp
-
-# 初始化倒计时
-scoreboard players set $countdown mem 7
-
-# 伤害管理
-team modify player friendlyFire false
-team modify player collisionRule always
-gamerule fallDamage false

+ 0 - 3
data/ltw/functions/state/8/tick2.mcfunction

@@ -1,3 +0,0 @@
-# 观察者限制
-execute as @a[gamemode=spectator] run spectate
-execute as @a[gamemode=spectator] run tp @s 7.0 11.4 2007.0

+ 0 - 7
data/ltw/functions/state/8/tick20.mcfunction

@@ -1,7 +0,0 @@
-# 显示倒计时
-title @a times 3 14 2
-title @a subtitle {"score":{"name":"$countdown","objective":"mem"}}
-title @a title ""
-
-# 下一状态
-execute if score $countdown mem matches 1 run function ltw:state/8/next

+ 1 - 1
data/mini/functions/main/game_start.mcfunction

@@ -18,4 +18,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
 
-# FIXME : 从状态 8 转到游戏结束的时候触发了状态 3
+# FIXME : 从状态 7 转到游戏结束的时候触发了状态 3

+ 1 - 2
data/test/functions/generate_bonus.mcfunction

@@ -2,7 +2,6 @@
 
 tag @a remove watcher
 scoreboard players set $round mem 4
-scoreboard players set $countdown mem 11
-function ltw:state/7/state_enter
+function ltw:state/6/state_enter
 scoreboard players set $state mem 0
 gamemode creative @a