Przeglądaj źródła

允许玩家在大厅 PVP

LTCatt 5 lat temu
rodzic
commit
1f39501804

+ 3 - 0
data/ltw/functions/clock/tick100.mcfunction

@@ -4,3 +4,6 @@ schedule function ltw:clock/tick100 100t replace
 # 掐死原版 BGM
 stopsound @a music music.game
 stopsound @a music music.creative
+
+# 恢复饥饿
+effect give @a saturation 1 10 true

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

@@ -1,6 +1,9 @@
 # 每秒执行一次
 schedule function ltw:clock/tick20 20t replace
 
+# 恢复生命
+execute if score $state mem matches 0 run effect give @a instant_health 1 10 true
+
 # TODO: 未完成的重构
 
 # # 调用其他模块

+ 0 - 1
data/ltw/functions/init/player.mcfunction

@@ -6,4 +6,3 @@ title @s actionbar ""
 
 # 状态效果
 effect clear @s
-effect give @s saturation 1000000 0 true

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

@@ -2,8 +2,6 @@
 function ltw:init/player
 
 # 状态效果
-effect give @s resistance 1000000 4 true
-effect give @s weakness 1000000 4 true
 
 # 位置与模式
 tp @s -10 8 -42 68 -20

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

@@ -19,13 +19,11 @@ gamerule naturalRegeneration true
 team remove hub_watch
 team add hub_watch "旁观"
 team modify hub_watch collisionRule never
-team modify hub_watch friendlyFire false
 team modify hub_watch prefix {"text":" ◇ ","color":"white"}
 team modify hub_watch suffix " "
 team remove hub_play
 team add hub_play "准备"
 team modify hub_play collisionRule never
-team modify hub_play friendlyFire false
 team modify hub_play prefix {"text":" ◆ ","color":"green"}
 team modify hub_play suffix " "
 

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

@@ -1,4 +1,5 @@
 
 # 检查玩家是否移出了准备物品
+# FIXME: [HIM] 能否尝试解决玩家从物品栏丢出物品可以被其他人捡到的 Bug?
 execute as @a[team=hub_watch] unless data entity @s Inventory[{Slot:0b,id:"minecraft:gray_dye",tag:{"lobby_item":1b}}] run function ltw:state/0/sp/join_play
 execute as @a[team=hub_play] unless data entity @s Inventory[{Slot:0b,id:"minecraft:lime_dye",tag:{"lobby_item":1b}}] run function ltw:state/0/sp/join_watch