pm_give.mcfunction 943 B

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