Просмотр исходного кода

金苹果允许恢复生命;跑酷固定给予 +2 分

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

+ 2 - 2
data/item/functions/special/clear_effect.mcfunction

@@ -5,8 +5,8 @@ effect clear @a[tag=consume_apple] fire_resistance
 effect give @a[tag=consume_apple] minecraft:resistance 999999 4 true
 
 # 检测是否保留抗性提升
-execute if score $t_remove_resistance mem matches 1 run effect clear @a[tag=consume_apple] resistance 
+execute if score $remove_resistance mem matches 1 run effect clear @a[tag=consume_apple] resistance 
 
 # 重置tag和分数
 tag @a[tag=consume_apple] remove consume_apple
-scoreboard players reset $t_remove_resistance mem
+scoreboard players reset $remove_resistance mem

+ 7 - 5
data/item/functions/special/enchanted_apple.mcfunction

@@ -6,13 +6,15 @@ execute if score $state mem matches 5 if score @s mini_heart matches 1.. run sco
 execute if score $state mem matches 5 if score @s mini_heart matches 1.. run function mini:main/player_max_health
 execute if score $state mem matches 5 if score @s mini_heart matches 1.. run tellraw @a ["",{"text": ">> ","color":"aqua","bold": true},{"selector": "@s","color":"aqua"}," 食用了附魔生命果, 生命加倍!"]
 
-# 归还苹果
-execute if score $state mem matches 5 unless score @s mini_heart matches 1.. run tellraw @s ["",{"text": ">> ","color":"aqua","bold": true},{"text":"你只能在存在生命计数的小游戏中食用生命果!","color":"aqua"}]
-execute if score $state mem matches 5 unless score @s mini_heart matches 1.. run give @s minecraft:enchanted_golden_apple{display:{Name:'{"text":"附魔生命果","italic":false}',Lore:['{"text":"恢复到满血或生命加倍","italic":false,"color":"gray"}']},bonus_new:0b,bonus_return:1b,is_bonus:1b,item_name:'{"text":"附魔生命果","color":"aqua"}'}
+# 无生命计数:恢复生命
+execute if score $state mem matches 5 unless score @s mini_heart matches 1.. run effect give @s instant_health 1 10 true
+execute if score $state mem matches 5 unless score @s mini_heart matches 1.. run tellraw @a ["",{"text": ">> ","color":"aqua","bold": true},{"selector": "@s","color":"aqua"}," 食用了附魔生命果, 生命恢复到满血!"]
 
-# 检测小游戏是否去除特殊效果
-execute if score $state mem matches 5 if score $mini_type mem matches 5 run scoreboard players set $t_remove_resistance mem 1 
+# 归还苹果
+#execute if score $state mem matches 5 unless score @s mini_heart matches 1.. run tellraw @s ["",{"text": ">> ","color":"aqua","bold": true},{"text":"你只能在存在生命计数的小游戏中食用生命果!","color":"aqua"}]
+#execute if score $state mem matches 5 unless score @s mini_heart matches 1.. run give @s minecraft:enchanted_golden_apple{display:{Name:'{"text":"附魔生命果","italic":false}',Lore:['{"text":"恢复到满血或生命加倍","italic":false,"color":"gray"}']},bonus_new:0b,bonus_return:1b,is_bonus:1b,item_name:'{"text":"附魔生命果","color":"aqua"}'}
 
+# $remove_resistance 信息在小游戏初始化时提供
 # 去除buff
 execute if score $state mem matches 5 run tag @s add consume_apple
 schedule function item:special/clear_effect 1t replace

+ 8 - 6
data/item/functions/special/golden_apple.mcfunction

@@ -1,18 +1,20 @@
 # 去除进度
 advancement revoke @s only item:special/consume_golden_apple
 
-# 计算生命值
+# 有生命计数:增加生命数
 execute if score $state mem matches 5 if score @s mini_heart matches 1.. run scoreboard players add @s mini_heart 1
 execute if score $state mem matches 5 if score @s mini_heart matches 1.. run function mini:main/player_max_health
 execute if score $state mem matches 5 if score @s mini_heart matches 1.. run tellraw @a ["",{"text": ">> ","color":"aqua","bold": true},{"selector": "@s","color":"aqua"}," 食用了生命果, 生命 +1!"]
 
-# 归还苹果
-execute if score $state mem matches 5 unless score @s mini_heart matches 1.. run tellraw @s ["",{"text": ">> ","color":"aqua","bold": true},{"text":"你只能在存在生命计数的小游戏中食用生命果!","color":"aqua"}]
-execute if score $state mem matches 5 unless score @s mini_heart matches 1.. run give @s minecraft:golden_apple{display:{Name:'{"text":"生命果","italic":false}',Lore:['{"text":"恢复 4 颗心或生命 +1","italic":false,"color":"gray"}']},bonus_new:0b,bonus_return:1b,is_bonus:1b,item_name:'{"text":"生命果","color":"green"}'}
+# 无生命计数:恢复生命
+execute if score $state mem matches 5 unless score @s mini_heart matches 1.. run effect give @s instant_health 1 1 true
+execute if score $state mem matches 5 unless score @s mini_heart matches 1.. run tellraw @a ["",{"text": ">> ","color":"aqua","bold": true},{"selector": "@s","color":"aqua"}," 食用了生命果, 生命恢复 4 颗心!"]
 
-# 检测小游戏是否去除特殊效果
-execute if score $state mem matches 5 if score $mini_type mem matches 5 run scoreboard players set $t_remove_resistance mem 1 
+## 归还苹果
+#execute if score $state mem matches 5 unless score @s mini_heart matches 1.. run tellraw @s ["",{"text": ">> ","color":"aqua","bold": true},{"text":"你只能在存在生命计数的小游戏中食用生命果!","color":"aqua"}]
+#execute if score $state mem matches 5 unless score @s mini_heart matches 1.. run give @s minecraft:golden_apple{display:{Name:'{"text":"生命果","italic":false}',Lore:['{"text":"恢复 4 颗心或生命 +1","italic":false,"color":"gray"}']},bonus_new:0b,bonus_return:1b,is_bonus:1b,item_name:'{"text":"生命果","color":"green"}'}
 
+# $remove_resistance 信息在小游戏初始化时提供
 # 去除buff
 execute if score $state mem matches 5 run tag @s add consume_apple
 schedule function item:special/clear_effect 1t replace

+ 0 - 2
data/ltw/functions/main/player_leave.mcfunction

@@ -13,9 +13,7 @@ execute if score $state mem matches 5 if score $mini_type mem matches 3 run func
 # FIXME : [010/HIM] 玩家可以钓鱼
 # FIXME : [010/HIM] 喝完药的玻璃瓶没有 clear
 # FIXME : [010/HIM] 跑酷中途掉线导致名次判断错误
-# TODO : [LTCat] 将跑酷的绿色奖励改为固定 3 分
 # TODO : [LTCat] 猪灵的房间角落改成圆角
 # TODO : [LTCat] 猪灵的物品改为随机位置发放
 # FIXME : [010] 弩和箭可能给不到人
-# TODO : [HIM] 附魔生命果支持在猪灵游戏回满血,普通生命果回复 4 心
 # FIXME : [010] 关闭原版进度

+ 1 - 0
data/mini/functions/colormatch/game_init.mcfunction

@@ -13,6 +13,7 @@ fill 1049 11 4025 1075 40 4025 stone
 scoreboard players set $finish_mode mem 0
 scoreboard players set $color_match_time mem 60
 scoreboard players set $color_match_type mem 0
+scoreboard players set $remove_resistance mem 0
 
 # 刷新地基
 function mini:colormatch/game/prepare_round

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

@@ -2,6 +2,7 @@
 forceload add 1000 3000 1100 3100
 
 scoreboard players set $finish_mode mem 0
+scoreboard players set $remove_resistance mem 0
 
 # 伤害管理
 team modify player friendlyFire true

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

@@ -1,6 +1,6 @@
 # 如小游戏有多条命,需在小游戏中设置给玩家mini_heart生命上限并调用此函数
 # 设置生命值上限
-execute if score @s mini_heart matches 13.. run tellraw @s ["",{"text": ">> ","color":"gold","bold": true},"小游戏生命值上限是12哦,请不要太贪心!"]
+execute if score @s mini_heart matches 13.. run tellraw @s ["",{"text": ">> ","color":"red","bold": true},{"text":"小游戏生命上限为 12!","color":"red"}]
 execute if score @s mini_heart matches 13.. run scoreboard players set @s mini_heart 12
 
 # 根据玩家mini_heart数量决定生命值上限

+ 2 - 1
data/mini/functions/parkour/game_init.mcfunction

@@ -2,6 +2,7 @@
 forceload add 1000 1000 1064 1064
 
 scoreboard players set $finish_mode mem 1
+scoreboard players set $remove_resistance mem 0
 
 # 生成地图
 setblock 1000 4 1000 minecraft:structure_block[mode=load]{metadata:"",mirror:"NONE",ignoreEntities:1b,powered:0b,seed:0L,author:"00ll00",rotation:"NONE",posX:0,mode:"LOAD",posY:1,sizeX:32,posZ:0,integrity:1.0f,showair:0b,name:"mini:parkour0",sizeY:32,sizeZ:32,showboundingbox:0b}
@@ -16,7 +17,7 @@ kill @e[type=falling_block,tag=parkour_block]
 
 # 生成奖励物品
 execute positioned 1004.5 18.5 1043.5 run function item:bonus_item/gameparty/normal/white
-execute positioned 1024.5 30.5 1038.5 run function item:bonus_item/gameparty/normal/green
+execute positioned 1024.5 30.5 1038.5 run function item:bonus_item/gameparty/last/green
 
 # 初始化开门变量
 scoreboard players set $parkour_door mem 0

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

@@ -10,7 +10,7 @@ gamerule naturalRegeneration true
 effect give @s resistance 1000000 4 true
 
 # 传送玩家
-tp @s[tag=!watcher,tag=!rejoining] 1010.07 7.50 1006.98 -1518.69 -10.62
+tp @s[tag=!watcher,tag=!rejoining] 1027.56 18.03 1046.89 13.48 4.84
 
 # 调整模式
 gamemode spectator @s

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

@@ -3,6 +3,6 @@ tp @s 1010.83 30.16 1033.66 -1117.71 18.17
 tellraw @s ["",{"text":"\n >> 旅途 >>\n\n","color":"red","bold":true}," 沿途前进, 到达终点, 获得胜利!\n"]
 tellraw @s ["",{"text": " <完成制> ","color":"red","bold": true}, {"text":"根据完成跑酷的速度快慢决定排名。","color":"gray"}]
 tellraw @s ["",{"text": " <和平环境> ","color":"light_purple","bold": true}, {"text":"无法攻击其他玩家。","color":"gray"}]
-tellraw @s ["",{"text": " <额外道具> ","color":"aqua","bold": true}, {"text":"小游戏地图中存在 1 个绿色道具、1 个白色道具。","color":"gray"}]
+tellraw @s ["",{"text": " <额外道具> ","color":"aqua","bold": true}, {"text":"小游戏地图中存在 1 个得分 +2 奖励与 1 个白色道具。","color":"gray"}]
 tellraw @s ["",{"text": " <缺乏测试> ","color":"gold","bold": true}, {"text":"此游戏尚未经过足够测试, 可能存在 Bug 或设计漏洞。","color":"gray"}]
 tellraw @s ""

+ 1 - 0
data/mini/functions/tntrun/game_init.mcfunction

@@ -2,6 +2,7 @@
 forceload add 1000 2000 1050 2050
 
 scoreboard players set $finish_mode mem 0
+scoreboard players set $remove_resistance mem 0
 
 # 生成地图
 setblock 1000 10 2000 minecraft:structure_block{mode:"LOAD",name:"mini:tntrun"}

+ 1 - 0
data/mini/functions/zombie/game_init.mcfunction

@@ -2,6 +2,7 @@
 forceload add 1000 5000 1050 5050
 
 scoreboard players set $finish_mode mem 0
+scoreboard players set $remove_resistance mem 1
 
 # 生成地图
 setblock 1000 10 5000 minecraft:structure_block{mode:"LOAD",name:"mini:zombie"}