Procházet zdrojové kódy

红幻翼的生成

龙腾猫跃 před 3 roky
rodič
revize
bb0023fa00

+ 2 - 0
data/ltw/functions/init.mcfunction

@@ -129,6 +129,8 @@ team remove gold
 team add gold "金色"
 team add gold "金色"
 team modify gold color gold
 team modify gold color gold
 team modify gold friendlyFire false
 team modify gold friendlyFire false
+team add red "红色(幻翼用)"
+team modify red color red
 team add green_test "绿色(显示测试用)"
 team add green_test "绿色(显示测试用)"
 team modify green_test color green
 team modify green_test color green
 team add orange_test "橙色(显示测试用)"
 team add orange_test "橙色(显示测试用)"

+ 1 - 0
data/mini/functions/colormatch/game/new_item.mcfunction

@@ -1,4 +1,5 @@
 tellraw @a ["",{"text": ">> ","color":"aqua","bold": true},{"text": "新的奖励物资已在空中部署!","color":"aqua"}]
 tellraw @a ["",{"text": ">> ","color":"aqua","bold": true},{"text": "新的奖励物资已在空中部署!","color":"aqua"}]
+playsound minecraft:entity.player.levelup player @a 0 1000000 0 1000000 2
 scoreboard players set $new_item_cd mem 0
 scoreboard players set $new_item_cd mem 0
 
 
 # 随机选择生成组
 # 随机选择生成组

+ 1 - 0
data/mini/functions/hotpm/game/new_item.mcfunction

@@ -1,4 +1,5 @@
 tellraw @a ["",{"text": ">> ","color":"aqua","bold": true},{"text": "新的奖励物资已在空中部署!","color":"aqua"}]
 tellraw @a ["",{"text": ">> ","color":"aqua","bold": true},{"text": "新的奖励物资已在空中部署!","color":"aqua"}]
+playsound minecraft:entity.player.levelup player @a 0 1000000 0 1000000 2
 scoreboard players set $new_item_cd mem 0
 scoreboard players set $new_item_cd mem 0
 
 
 # 随机选择生成组
 # 随机选择生成组

+ 16 - 3
data/mini/functions/phantom/game/summon2.mcfunction

@@ -1,14 +1,27 @@
 
 
 execute as @e[tag=new_phantom] at @s run tp @s ~ 30 ~
 execute as @e[tag=new_phantom] at @s run tp @s ~ 30 ~
 
 
-# 随机生命值
+# 设置攻击力与随机生命值
 scoreboard players set $random_min mem 1
 scoreboard players set $random_min mem 1
 scoreboard players set $random_max mem 3
 scoreboard players set $random_max mem 3
 function lib:random
 function lib:random
 execute if score $random mem matches 1 run attribute @e[tag=new_phantom,limit=1] generic.max_health base set 2
 execute if score $random mem matches 1 run attribute @e[tag=new_phantom,limit=1] generic.max_health base set 2
 execute if score $random mem matches 2 run attribute @e[tag=new_phantom,limit=1] generic.max_health base set 3
 execute if score $random mem matches 2 run attribute @e[tag=new_phantom,limit=1] generic.max_health base set 3
 execute if score $random mem matches 3 run attribute @e[tag=new_phantom,limit=1] generic.max_health base set 4
 execute if score $random mem matches 3 run attribute @e[tag=new_phantom,limit=1] generic.max_health base set 4
+attribute @e[tag=new_phantom,limit=1] generic.attack_damage base set 4
 
 
-attribute @e[tag=new_phantom,limit=1] generic.attack_damage base set 3
+# 如果满足条件(在 tick20 中检查),则刷出奖励幻翼
+execute if score #new_item mem matches 0 run tellraw @a ["",{"text": ">> ","color":"aqua","bold": true},{"text": "击杀红色幻翼, 获取奖励物资!","color":"aqua"}]
+execute if score #new_item mem matches 0 run playsound minecraft:entity.player.levelup player @a 0 1000000 0 1000000 2
+execute if score #new_item mem matches 0 run tag @e[tag=new_phantom] add bonus_phantom
+execute if score #new_item mem matches 0 run scoreboard players set $new_item_cd mem 0
+
+# 修改奖励幻翼的属性
+team join red @e[tag=bonus_phantom,tag=new_phantom,limit=1]
+effect give @e[tag=bonus_phantom,tag=new_phantom,limit=1] glowing 1000000 0 true
+attribute @e[tag=bonus_phantom,tag=new_phantom,limit=1] generic.max_health base set 20
+
+# 确认属性修改
 effect give @e[tag=new_phantom] instant_damage
 effect give @e[tag=new_phantom] instant_damage
-tag @e[tag=new_phantom] remove new_phantom
+
+tag @e[tag=new_phantom] remove new_phantom

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

@@ -3,6 +3,7 @@ forceload add 1000 6000 1064 6064
 
 
 scoreboard players set $show_score mem 1
 scoreboard players set $show_score mem 1
 scoreboard players set $survival mem 0
 scoreboard players set $survival mem 0
+scoreboard players set $new_item_cd mem 0
 scoreboard players reset * kill_phantom
 scoreboard players reset * kill_phantom
 scoreboard players reset * kill_phantom2
 scoreboard players reset * kill_phantom2
 
 
@@ -30,4 +31,4 @@ team modify playing collisionRule always
 team modify playing deathMessageVisibility always
 team modify playing deathMessageVisibility always
 gamerule fallDamage false
 gamerule fallDamage false
 
 
-schedule function mini:phantom/game_init2 10t replace
+schedule function mini:phantom/game_init2 15t replace

+ 3 - 0
data/mini/functions/phantom/tick2.mcfunction

@@ -10,3 +10,6 @@ execute as @e[type=trident,tag=!fixed_trident] run function mini:phantom/game/fi
 # 删除掉在地上的三叉戟
 # 删除掉在地上的三叉戟
 kill @e[type=trident,nbt={inGround:1b}]
 kill @e[type=trident,nbt={inGround:1b}]
 kill @e[type=item,nbt={Item:{id:"minecraft:trident",tag:{game_item:1b}}}]
 kill @e[type=item,nbt={Item:{id:"minecraft:trident",tag:{game_item:1b}}}]
+
+# 奖励幻翼特效
+execute as @e[tag=bonus_phantom] at @s run particle dust 1 0 0 2 ~ ~ ~ 0.2 0 0.2 0 2 normal

+ 9 - 1
data/mini/functions/phantom/tick20.mcfunction

@@ -1,10 +1,18 @@
-
 # 给予进度
 # 给予进度
 execute as @a[team=playing,scores={temp=1..,kill_phantom=8}] run advancement grant @s only ltw:blood/phantom1
 execute as @a[team=playing,scores={temp=1..,kill_phantom=8}] run advancement grant @s only ltw:blood/phantom1
 execute as @a[team=playing,scores={temp=1..,kill_phantom=16}] run advancement grant @s only ltw:blood/phantom2
 execute as @a[team=playing,scores={temp=1..,kill_phantom=16}] run advancement grant @s only ltw:blood/phantom2
 execute as @a[team=playing,scores={temp=1..,kill_phantom=24}] run advancement grant @s only ltw:blood/phantom3
 execute as @a[team=playing,scores={temp=1..,kill_phantom=24}] run advancement grant @s only ltw:blood/phantom3
 execute as @a[team=playing,scores={temp=1..,kill_phantom=32}] run advancement grant @s only ltw:blood/phantom4
 execute as @a[team=playing,scores={temp=1..,kill_phantom=32}] run advancement grant @s only ltw:blood/phantom4
 
 
+# 判断是否符合刷出新物品的条件:0 为可以,其他为不可以
+scoreboard players set #new_item mem 0
+# 当前场地上没有奖励幻翼
+execute if entity @e[tag=bonus_phantom] run scoreboard players set #new_item mem 1
+# 如果没有物品,则计算冷却
+execute if score #new_item mem matches 0 run scoreboard players add $new_item_cd mem 1
+# 已经超过 20s 冷却时间
+execute if score $new_item_cd mem matches ..19 run scoreboard players set #new_item mem 1
+
 # 召唤幻翼
 # 召唤幻翼
 execute if score $countdown mem matches 11.. run function mini:phantom/game/try_summon
 execute if score $countdown mem matches 11.. run function mini:phantom/game/try_summon