pm_give.mcfunction 807 B

12345678910111213141516171819
  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. # 寻找最高分
  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,sort=random,limit=1] if score @s temp = #score_max mem run function mini:hotpm/game/pm_get
  13. # 处理tag与分数
  14. tag @a[tag=max_uncounted] remove max_uncounted
  15. scoreboard players remove $new_potato_count mem 1
  16. execute if score $new_potato_count mem matches 1.. run function mini:hotpm/game/pm_give