Browse Source

排名算法重置

HerobrineXia 6 years ago
parent
commit
f1e76f22c3

+ 1 - 2
data/item/functions/bonus_item/add_score.mcfunction

@@ -18,8 +18,7 @@ execute if score #bonus_add_score mem matches 100 if score $random mem matches 0
 execute if score #bonus_add_score mem matches 100 if score $random mem matches 0 run tellraw @a ["",{"text": ">> ","color":"red","bold": true},{"selector": "@s","color":"red"}," 的硬币投出了反面, 得分减半, 当前共有 ",{"score": {"name": "@s","objective": "total_score"},"color":"red"},{"text": " 分", "color":"red"}]
 
 # 200:偷分
-scoreboard players set #score_max mem -2147483648
-execute as @a run function ltw:main/get_max_score
+function ltw:main/get_max_score
 tag @a remove highest
 tag @a remove may_highest
 execute as @a if score @s total_score = #score_max mem run tag @s add may_highest

+ 9 - 9
data/ltw/functions/main/game_end.mcfunction

@@ -5,17 +5,17 @@ tag @a remove total_rank1
 tag @a remove total_rank2
 tag @a remove total_rank3
 # 1
-scoreboard players set #score_max mem -2147483648
-execute as @a run function ltw:main/get_max_score
-execute as @a unless entity @a[tag=total_rank1] if score @s total_score = #score_max mem run tag @s add total_rank1
+function ltw:main/get_max_score
+execute as @a if score @s total_score = #score_max mem run tag @s add total_rank1
+tag @a[tag=total_rank1] add max_uncounted
 # 2
-scoreboard players set #score_max mem -2147483648
-execute as @a[tag=!total_rank1] run function ltw:main/get_max_score
-execute as @a[tag=!total_rank1] unless entity @a[tag=total_rank2] if score @s total_score = #score_max mem run tag @s add total_rank2
+function ltw:main/get_max_score
+execute as @a[tag=!max_uncounted] if score @s total_score = #score_max mem run tag @s add total_rank2
+tag @a[tag=total_rank2] add max_uncounted
 # 3
-scoreboard players set #score_max mem -2147483648
-execute as @a[tag=!total_rank1,tag=!total_rank2] run function ltw:main/get_max_score
-execute as @a[tag=!total_rank1,tag=!total_rank2] unless entity @a[tag=total_rank3] if score @s total_score = #score_max mem run tag @s add total_rank3
+function ltw:main/get_max_score
+execute as @a[tag=!max_uncounted] if score @s total_score = #score_max mem run tag @s add total_rank3
+tag @a[tag=max_uncounted] remove max_uncounted
 
 # 计算金粒奖励
 scoreboard players set #total_gold mem 0

+ 3 - 0
data/ltw/functions/main/get_max_score.mcfunction

@@ -1 +1,4 @@
 execute if score @s total_score > #score_max mem run scoreboard players operation #score_max mem = @s total_score
+
+scoreboard players set #score_max mem -2147483648
+scoreboard players operation #score_max mem > @a[tag=!max_uncounted] total_score

+ 0 - 2
data/ltw/functions/state/0/parkour/tempo_block/marker_spawn.mcfunction

@@ -4,7 +4,6 @@ kill @e[type=armor_stand,tag=lobby_tempo]
 # 生成as
 execute positioned 6 12 -26 run summon armor_stand ~ ~-0.4 ~ {Marker:1b,Invisible:1b,Invulnerable:1b,Small:1b,NoGravity:1b,Tags:["lobby_tempo","tempo_red_t"]}
 execute positioned 11 14 -27 run summon armor_stand ~ ~-0.4 ~ {Marker:1b,Invisible:1b,Invulnerable:1b,Small:1b,NoGravity:1b,Tags:["lobby_tempo","tempo_red_t"]}
-execute positioned 11 16 -31 run summon armor_stand ~ ~-0.4 ~ {Marker:1b,Invisible:1b,Invulnerable:1b,Small:1b,NoGravity:1b,Tags:["lobby_tempo","tempo_red_t"]}
 execute positioned 10 16 -22 run summon armor_stand ~ ~-0.4 ~ {Marker:1b,Invisible:1b,Invulnerable:1b,Small:1b,NoGravity:1b,Tags:["lobby_tempo","tempo_red_t"]}
 execute positioned 5 17 -24 run summon armor_stand ~ ~-0.4 ~ {Marker:1b,Invisible:1b,Invulnerable:1b,Small:1b,NoGravity:1b,Tags:["lobby_tempo","tempo_red_t"]}
 execute positioned 6 19 -27 run summon armor_stand ~ ~-0.4 ~ {Marker:1b,Invisible:1b,Invulnerable:1b,Small:1b,NoGravity:1b,Tags:["lobby_tempo","tempo_red_t"]}
@@ -21,7 +20,6 @@ execute positioned 19 49 -30 run summon armor_stand ~ ~-0.4 ~ {Marker:1b,Invisib
 
 execute positioned 6 13 -26 run summon armor_stand ~ ~-0.4 ~ {Marker:1b,Invisible:1b,Invulnerable:1b,Small:1b,NoGravity:1b,Tags:["lobby_tempo","tempo_blue_t"]}
 execute positioned 11 15 -27 run summon armor_stand ~ ~-0.4 ~ {Marker:1b,Invisible:1b,Invulnerable:1b,Small:1b,NoGravity:1b,Tags:["lobby_tempo","tempo_blue_t"]}
-execute positioned 9 17 -31 run summon armor_stand ~ ~-0.4 ~ {Marker:1b,Invisible:1b,Invulnerable:1b,Small:1b,NoGravity:1b,Tags:["lobby_tempo","tempo_blue_t"]}
 execute positioned 10 17 -22 run summon armor_stand ~ ~-0.4 ~ {Marker:1b,Invisible:1b,Invulnerable:1b,Small:1b,NoGravity:1b,Tags:["lobby_tempo","tempo_blue_t"]}
 execute positioned 5 18 -24 run summon armor_stand ~ ~-0.4 ~ {Marker:1b,Invisible:1b,Invulnerable:1b,Small:1b,NoGravity:1b,Tags:["lobby_tempo","tempo_blue_t"]}
 execute positioned 6 20 -27 run summon armor_stand ~ ~-0.4 ~ {Marker:1b,Invisible:1b,Invulnerable:1b,Small:1b,NoGravity:1b,Tags:["lobby_tempo","tempo_blue_t"]}

+ 3 - 2
data/mini/functions/hotpm/game/pm_init_first.mcfunction

@@ -1,6 +1,7 @@
 # 第一次初始化土豆
-scoreboard players set #score_max mem -2147483648
-execute as @a[tag=mini_running] run function ltw:main/get_max_score
+tag @a[tag=mini_running] add max_uncounted
+function ltw:main/get_max_score
+tag @a[tag=max_uncounted] remove max_uncounted
 execute as @a[tag=mini_running] if score @s total_score = #score_max mem run tag @s add mini_hotpm_top
 execute as @a[tag=mini_hotpm_top,limit=1,sort=random] run function mini:hotpm/game/pm_init
 tag @a[tag=mini_hotpm_top] remove mini_hotpm_top

+ 10 - 9
data/mini/functions/main/game_end.mcfunction

@@ -12,17 +12,18 @@ tag @a remove mini_rank2
 tag @a remove mini_rank3
 tag @a remove mini_rank4
 # 1
-scoreboard players set #score_max mem -2147483648
-execute as @a run function mini:main/get_max_score
-execute as @a unless entity @a[tag=mini_rank1] if score @s mini_score = #score_max mem run tag @s[tag=!watcher] add mini_rank1
+function mini:main/get_max_score
+execute as @a if score @s mini_score = #score_max mem run tag @s[tag=!watcher] add mini_rank1
+tag @a[tag=mini_rank1] add max_uncounted
 # 2
-scoreboard players set #score_max mem -2147483648
-execute as @a[tag=!mini_rank1] run function mini:main/get_max_score
-execute as @a[tag=!mini_rank1] unless entity @a[tag=mini_rank2] if score @s mini_score = #score_max mem run tag @s[tag=!watcher] add mini_rank2
+function mini:main/get_max_score
+execute as @a[tag=!max_uncounted] if score @s mini_score = #score_max mem run tag @s[tag=!watcher] add mini_rank2
+tag @a[tag=mini_rank2] add max_uncounted
 # 3
-scoreboard players set #score_max mem -2147483648
-execute as @a[tag=!mini_rank1,tag=!mini_rank2] run function mini:main/get_max_score
-execute as @a[tag=!mini_rank1,tag=!mini_rank2] unless entity @a[tag=mini_rank3] if score @s mini_score = #score_max mem run tag @s[tag=!watcher] add mini_rank3
+function mini:main/get_max_score
+execute as @a[tag=!max_uncounted] if score @s mini_score = #score_max mem run tag @s[tag=!watcher] add mini_rank3
+tag @a[tag=max_uncounted] remove max_uncounted
+
 # 4
 tag @a[tag=!mini_rank1,tag=!mini_rank2,tag=!mini_rank3,tag=!watcher] add mini_rank4