pm_give.mcfunction 948 B

123456789101112131415161718192021
  1. # 计算权重
  2. scoreboard players reset @a temp
  3. execute as @a[team=!debugging] run scoreboard players operation @s temp = @s mini_heart
  4. execute as @a[team=!debugging] run scoreboard players operation @s temp *= #const_100 mem
  5. execute as @a[team=!debugging] run scoreboard players operation @s temp += @s total_score_disp
  6. scoreboard players add @a[tag=!pm_explode_last] temp 10000
  7. # 寻找最高分
  8. tag @a[tag=!mini_running] add max_uncounted
  9. tag @a[tag=pm_holding] add max_uncounted
  10. function mini:main/get_max_temp
  11. # 给予土豆
  12. execute as @a[tag=!max_uncounted] if score @s temp = #score_max mem run tag @s add pm_list
  13. execute as @a[tag=pm_list,sort=random,limit=1] run function mini:hotpm/game/pm_get
  14. tag @a[tag=pm_list] remove pm_list
  15. # 处理tag与分数
  16. tag @a[tag=max_uncounted] remove max_uncounted
  17. scoreboard players remove $new_potato_count mem 1
  18. execute if score $new_potato_count mem matches 1.. run function mini:hotpm/game/pm_give