Skip to content

Commit

Permalink
Merge pull request #1852 from ProjectTSB/fix/issue1850
Browse files Browse the repository at this point in the history
🐛 セット装備の排出処理が正しくないのを修正
  • Loading branch information
ChenCMD authored Feb 11, 2025
2 parents 0db40e1 + 4a46cbc commit 9e87547
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@
scoreboard players operation $Pulls Temporary *= $CandidateLength Temporary
scoreboard players operation $Pulls Temporary /= $100 Const
# シャッフルして取り出す
scoreboard players add $CandidateLength Temporary 1
data modify storage asset:artifact Type set from storage asset:context Type
function asset_manager:artifact/give/candidates
function lib:array/shuffle
execute if score $Pulls Temporary matches 0.. if data storage lib: Array[0] run function asset_manager:artifact/give/foreach
# リセット
function lib:array/session/close
scoreboard players reset $CandidateLength Temporary
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@
#> asset_manager:artifact/give/candidates
#> asset_manager:artifact/give/foreach
# @within function asset_manager:artifact/give/*

#> private
# @private
#declare score_holder $CandidateLength
#declare score_holder $Argument.Index
#declare score_holder $Pulls

# asset:context idがある場合は退避
function asset_manager:common/context/id/stash
# 配列をランダムに動かす
execute store result score $Argument.Index Lib run function lib:random/
scoreboard players operation $Argument.Index Lib %= $CandidateLength Temporary
function lib:array/move
# 引数に代入
data modify storage asset:context id set from storage lib: Array[-1]
data modify storage asset:context Type set from storage asset:artifact Type
Expand All @@ -23,6 +17,5 @@

# リセット&ループ
data remove storage lib: Array[-1]
scoreboard players remove $CandidateLength Temporary 1
scoreboard players remove $Pulls Temporary 1
execute if score $Pulls Temporary matches 0.. if data storage lib: Array[0] run function asset_manager:artifact/give/candidates
execute if score $Pulls Temporary matches 0.. run function asset_manager:artifact/give/foreach
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# asset_manager:mob/triggers/death/manual
# asset_manager:effect/events/*/call_super_method
# asset_manager:mob/triggers/*/call_super_method
# asset_manager:artifact/give/candidates
# asset_manager:artifact/give/foreach
# api:spawner/subtract_hp
# asset_manager:object/summon/
# api:object/core/summon
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# api:entity/mob/effect/core/give
# asset_manager:mob/triggers/death/manual
# asset_manager:effect/events/*/call_super_method
# asset_manager:artifact/give/candidates
# asset_manager:artifact/give/foreach
# api:spawner/subtract_hp
# asset_manager:object/summon/
# api:object/core/summon
Expand Down

0 comments on commit 9e87547

Please sign in to comment.