Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
09768c3
一旦実装
Lapis-LJA Dec 24, 2025
c343536
Priorityを変更
Lapis-LJA Dec 24, 2025
feabab8
NaturalMergeSortを更新
Lapis-LJA Dec 24, 2025
8ec3b1f
lib:arrayを更新
Lapis-LJA Dec 24, 2025
79c461f
pack_formatを戻していた問題を修正
Lapis-LJA Dec 24, 2025
a17495c
compound/descendがascendを呼び出していた問題を修正
Lapis-LJA Dec 24, 2025
2b4c57c
Merge branch 'dev/natural_merge_sort_update' into dev/lapis_modifier_…
Lapis-LJA Dec 24, 2025
439c162
NaturalMergeSortを用いてのソートに修正
Lapis-LJA Dec 24, 2025
edf03c3
補正の種類が1個だけならソートが実行されないように
Lapis-LJA Dec 24, 2025
e33406c
typoを修正
Lapis-LJA Dec 24, 2025
288393f
Priorityを鬼落とす処理を修正
Lapis-LJA Dec 24, 2025
5e7645c
Merge branch 'master' into dev/lapis_modifier_sort
Lapis-LJA Jan 11, 2026
f7da018
Merge branch 'master' into dev/lapis_modifier_sort
Lapis-LJA Apr 18, 2026
ae9f246
Merge branch 'master' into dev/lapis_modifier_sort
Lapis-LJA May 16, 2026
6af2d9e
CustomModifierからmax_healthを削除
Lapis-LJA May 16, 2026
3521710
Merge branch 'master' into dev/lapis_modifier_sort
Lapis-LJA May 22, 2026
9ef3b7b
最大体力をバニラattribute扱いに
Lapis-LJA May 22, 2026
1e5aa30
Merge branch 'master' into dev/lapis_modifier_sort
Lapis-LJA May 22, 2026
4eebb1d
Merge branch 'master' into dev/lapis_modifier_sort
haiiro2gou May 22, 2026
7f21b24
Merge branch 'dev/lapis_modifier_sort' of https://github.com/ProjectT…
Lapis-LJA May 22, 2026
798e849
if scoreのミスを修正
Lapis-LJA May 22, 2026
8674016
[regenerate cache]
Lapis-LJA May 22, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
### Copyright © 2020 赤石愛
### This software is released under the MIT License, see LICENSE.

#> natural_merge_sort:descend/
# 渡された数値配列を、降順にソートします。
#> natural_merge_sort:descend/
# 渡された数値配列を、降順にソートします。
# Sort the specified int list in descending order.
# @api
# @input storage natural_merge_sort: List
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@
execute if data storage asset:artifact Lore[0] run function asset_manager:artifact/create/set_lore/vanilla_lore
# 装備時効果
# ステータス補正
data modify storage asset:artifact CopiedModifiers set from storage asset:artifact Equipment.Modifiers
execute if data storage asset:artifact CopiedModifiers[0] if data storage asset:artifact Item.tag.display.Lore[0] run data modify storage asset:artifact Item.tag.display.Lore append value '""'
execute if data storage asset:artifact CopiedModifiers[0] run function asset_manager:artifact/create/set_lore/modifier/
data remove storage asset:artifact CopiedModifiers
execute if data storage asset:artifact Equipment.Modifiers[0] if data storage asset:artifact Item.tag.display.Lore[0] run data modify storage asset:artifact Item.tag.display.Lore append value '""'
execute if data storage asset:artifact Equipment.Modifiers[0] run function asset_manager:artifact/create/set_lore/modifier/
# セット効果
execute if data storage asset:artifact Equipment.Effects[{Visible:true}] if data storage asset:artifact Item.tag.display.Lore[0] run data modify storage asset:artifact Item.tag.display.Lore append value '""'
execute if data storage asset:artifact Equipment.Effects[0] run function asset_manager:artifact/create/set_lore/equipment/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,102 +2,18 @@
#
# 装備時効果の内容をLoreに追加
#
# @within function
# asset_manager:artifact/create/set_lore/
# asset_manager:artifact/create/set_lore/modifier/
# @within function asset_manager:artifact/create/set_lore/

#> temp
# @private
#declare score_holder $AmountFrac
#declare score_holder $AmountFrac2
#declare score_holder $AmountInt
#declare score_holder $CustomModifier
# 補正が2個以上ならソートする
execute if data storage asset:artifact Equipment.Modifiers[1] run function asset_manager:artifact/create/set_lore/modifier/sort

# 変数を用意
scoreboard players set $CustomModifier Temporary 0
data modify storage asset:artifact Modifier set from storage asset:artifact CopiedModifiers[0]
data modify storage asset:artifact Line set value ['{"text":"","color":"green","italic":false}','""','" +"','{"translate":"%s","with":[{"storage":"asset:artifact","nbt":"Amount.Int"}]}','""']
# 補正が2個以上でないならソートされたものとする
execute unless data storage asset:artifact Equipment.Modifiers[1] run data modify storage asset:artifact SortedModifiers set from storage asset:artifact Equipment.Modifiers

# カスタムModifier
execute if data storage asset:artifact Modifier{Type:"attack/base"} run scoreboard players set $CustomModifier Temporary 1
execute if data storage asset:artifact Modifier{Type:"attack/base"} run data modify storage asset:artifact Line[1] set value '"攻撃"'
execute if data storage asset:artifact Modifier{Type:"attack/fire"} run scoreboard players set $CustomModifier Temporary 1
execute if data storage asset:artifact Modifier{Type:"attack/fire"} run data modify storage asset:artifact Line[1] set value '"火攻撃"'
execute if data storage asset:artifact Modifier{Type:"attack/magic"} run scoreboard players set $CustomModifier Temporary 1
execute if data storage asset:artifact Modifier{Type:"attack/magic"} run data modify storage asset:artifact Line[1] set value '"魔法攻撃"'
execute if data storage asset:artifact Modifier{Type:"attack/physical"} run scoreboard players set $CustomModifier Temporary 1
execute if data storage asset:artifact Modifier{Type:"attack/physical"} run data modify storage asset:artifact Line[1] set value '"物理攻撃"'
execute if data storage asset:artifact Modifier{Type:"attack/thunder"} run scoreboard players set $CustomModifier Temporary 1
execute if data storage asset:artifact Modifier{Type:"attack/thunder"} run data modify storage asset:artifact Line[1] set value '"雷攻撃"'
execute if data storage asset:artifact Modifier{Type:"attack/water"} run scoreboard players set $CustomModifier Temporary 1
execute if data storage asset:artifact Modifier{Type:"attack/water"} run data modify storage asset:artifact Line[1] set value '"水攻撃"'
execute if data storage asset:artifact Modifier{Type:"defense/base"} run scoreboard players set $CustomModifier Temporary 1
execute if data storage asset:artifact Modifier{Type:"defense/base"} run data modify storage asset:artifact Line[1] set value '"耐性"'
execute if data storage asset:artifact Modifier{Type:"defense/fire"} run scoreboard players set $CustomModifier Temporary 1
execute if data storage asset:artifact Modifier{Type:"defense/fire"} run data modify storage asset:artifact Line[1] set value '"火耐性"'
execute if data storage asset:artifact Modifier{Type:"defense/magic"} run scoreboard players set $CustomModifier Temporary 1
execute if data storage asset:artifact Modifier{Type:"defense/magic"} run data modify storage asset:artifact Line[1] set value '"魔法耐性"'
execute if data storage asset:artifact Modifier{Type:"defense/physical"} run scoreboard players set $CustomModifier Temporary 1
execute if data storage asset:artifact Modifier{Type:"defense/physical"} run data modify storage asset:artifact Line[1] set value '"物理耐性"'
execute if data storage asset:artifact Modifier{Type:"defense/thunder"} run scoreboard players set $CustomModifier Temporary 1
execute if data storage asset:artifact Modifier{Type:"defense/thunder"} run data modify storage asset:artifact Line[1] set value '"雷耐性"'
execute if data storage asset:artifact Modifier{Type:"defense/water"} run scoreboard players set $CustomModifier Temporary 1
execute if data storage asset:artifact Modifier{Type:"defense/water"} run data modify storage asset:artifact Line[1] set value '"水耐性"'
execute if data storage asset:artifact Modifier{Type:"fall_resistance"} run scoreboard players set $CustomModifier Temporary 1
execute if data storage asset:artifact Modifier{Type:"fall_resistance"} run data modify storage asset:artifact Line[1] set value '"落下耐性"'
execute if data storage asset:artifact Modifier{Type:"heal"} run scoreboard players set $CustomModifier Temporary 1
execute if data storage asset:artifact Modifier{Type:"heal"} run data modify storage asset:artifact Line[1] set value '"与回復量"'
execute if data storage asset:artifact Modifier{Type:"receive_heal"} run scoreboard players set $CustomModifier Temporary 1
execute if data storage asset:artifact Modifier{Type:"receive_heal"} run data modify storage asset:artifact Line[1] set value '"被回復量"'
execute if data storage asset:artifact Modifier{Type:"mp_heal"} run scoreboard players set $CustomModifier Temporary 1
execute if data storage asset:artifact Modifier{Type:"mp_heal"} run data modify storage asset:artifact Line[1] set value '"MP回復量"'
execute if data storage asset:artifact Modifier{Type:"max_mp"} run scoreboard players set $CustomModifier Temporary 1
execute if data storage asset:artifact Modifier{Type:"max_mp"} run data modify storage asset:artifact Line[1] set value '"最大MP"'
execute if score $CustomModifier Temporary matches 0 run function asset_manager:artifact/create/set_lore/modifier/generic.m with storage asset:artifact Modifier

# ノックバック耐性だけバニラに合わせて表示を10倍しておく
execute if data storage asset:artifact Modifier{Type:"generic.knockback_resistance"} store result storage asset:artifact Modifier.Amount double 0.1 run data get storage asset:artifact Modifier.Amount 100

# 数値チェック
# Operation == "add":
# $AmountInt = floor(abs(Amount))
# $AmountFrac(e3) = abs(Amount) * e3 % e3
# Operation != "add":
# $AmountInt(e2) = floor(abs(Amount) * e2)
# $AmountFrac(e5) = abs(Amount) * e5 % e3
execute store result score $AmountFrac Temporary run data get storage asset:artifact Modifier.Amount 1000
execute unless data storage asset:artifact Modifier{Operation:"add"} run data modify storage asset:artifact Line[4] set value '"%"'
execute unless data storage asset:artifact Modifier{Operation:"add"} run scoreboard players operation $AmountFrac Temporary *= $100 Const
execute unless score $AmountFrac Temporary matches 0.. run data modify storage asset:artifact Line[0] set value '{"text":"","color":"red","italic":false}'
execute unless score $AmountFrac Temporary matches 0.. run data modify storage asset:artifact Line[2] set value '" -"'
execute unless score $AmountFrac Temporary matches 0.. run scoreboard players operation $AmountFrac Temporary *= $-1 Const
scoreboard players operation $AmountInt Temporary = $AmountFrac Temporary
scoreboard players operation $AmountInt Temporary /= $1000 Const
scoreboard players operation $AmountFrac Temporary %= $1000 Const
# $AmountFrac % 10 == 0:
# $AmountFrac(e2|e4) = $AmountFrac(e3|e5) / e1
scoreboard players operation $AmountFrac2 Temporary = $AmountFrac Temporary
scoreboard players operation $AmountFrac2 Temporary %= $10 Const
execute if score $AmountFrac2 Temporary matches 0 run scoreboard players operation $AmountFrac Temporary /= $10 Const
scoreboard players operation $AmountFrac2 Temporary = $AmountFrac Temporary
scoreboard players operation $AmountFrac2 Temporary %= $10 Const
execute if score $AmountFrac2 Temporary matches 0 run scoreboard players operation $AmountFrac Temporary /= $10 Const
# 文字列に代入
execute store result storage asset:artifact Amount.Int int 1 run scoreboard players get $AmountInt Temporary
execute store result storage asset:artifact Amount.Frac int 1 run scoreboard players get $AmountFrac Temporary
execute if score $AmountFrac Temporary matches 1.. run data modify storage asset:artifact Line[3] set value '{"translate":"%s.%s","with":[{"storage":"asset:artifact","nbt":"Amount.Int"},{"storage":"asset:artifact","nbt":"Amount.Frac"}]}'
# Lore追加
loot replace block 10000 0 10000 container.0 loot asset_manager:artifact/generate_lore/modifier
data modify storage asset:artifact Item.tag.display.Lore append from block 10000 0 10000 Items[0].tag.display.Lore[]
# 書き出し
function asset_manager:artifact/create/set_lore/modifier/write

# リセット
scoreboard players reset $CustomModifier Temporary
scoreboard players reset $AmountInt Temporary
scoreboard players reset $AmountFrac Temporary
scoreboard players reset $AmountFrac2 Temporary
data remove storage asset:artifact Line
data remove storage asset:artifact Amount
# 残っていればループ
data remove storage asset:artifact Modifier
data remove storage asset:artifact CopiedModifiers[0]
execute if data storage asset:artifact CopiedModifiers[0] run function asset_manager:artifact/create/set_lore/modifier/
data remove storage asset:artifact CopiedModifiers
data remove storage asset:artifact PrioritizedModifiers
data remove storage asset:artifact SortedModifiers
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#> asset_manager:artifact/create/set_lore/modifier/generic.m
# @input args
# Type : string
# @within function asset_manager:artifact/create/set_lore/modifier/
# @within function asset_manager:artifact/create/set_lore/modifier/write

$data modify storage asset:artifact Line[1] set value '{"translate":"attribute.name.$(Type)"}'
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#> asset_manager:artifact/create/set_lore/modifier/priority/define
#
# 各補正の優先度を定義します
#
# @within function core:load_once

# 攻撃
data modify storage asset:artifact ModifierPriority.attack/base set value 255
data modify storage asset:artifact ModifierPriority.attack/physical set value 254
data modify storage asset:artifact ModifierPriority.attack/magic set value 253
data modify storage asset:artifact ModifierPriority.attack/fire set value 252
data modify storage asset:artifact ModifierPriority.attack/water set value 251
data modify storage asset:artifact ModifierPriority.attack/thunder set value 250

# 耐性
data modify storage asset:artifact ModifierPriority.defense/base set value 249
data modify storage asset:artifact ModifierPriority.defense/physical set value 248
data modify storage asset:artifact ModifierPriority.defense/magic set value 247
data modify storage asset:artifact ModifierPriority.defense/fire set value 246
data modify storage asset:artifact ModifierPriority.defense/water set value 245
data modify storage asset:artifact ModifierPriority.defense/thunder set value 244

# その他のTSB固有の補正
data modify storage asset:artifact ModifierPriority.heal set value 243
data modify storage asset:artifact ModifierPriority.receive_heal set value 242
data modify storage asset:artifact ModifierPriority.max_mp set value 241
data modify storage asset:artifact ModifierPriority.mp_heal set value 240
data modify storage asset:artifact ModifierPriority.fall_resistance set value 239

# バニラattribute
data modify storage asset:artifact ModifierPriority.generic.armor set value 127
data modify storage asset:artifact ModifierPriority.generic.armor_toughness set value 126
data modify storage asset:artifact ModifierPriority.generic.movement_speed set value 125
data modify storage asset:artifact ModifierPriority.generic.max_health set value 124
data modify storage asset:artifact ModifierPriority.generic.knockback_resistance set value 123
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#> asset_manager:artifact/create/set_lore/modifier/priority/set.m
#
#
#
# @within function asset_manager:artifact/create/set_lore/modifier/priority/set

#> Private
# @private
#declare score_holder $Priority
#declare score_holder $Amount

# Priorityを取得
$execute store result score $Priority Temporary run data get storage asset:artifact ModifierPriority.$(Type)

# 補正の量を取得
execute store result score $Amount Temporary run data get storage asset:artifact Modifier.Amount 1000

# 補正がマイナスならPriorityをメチャクチャ落とす
execute if score $Amount Temporary matches ..-1 run scoreboard players remove $Priority Temporary 1024

# storageにPriorityを代入
# lib:array/sort/compound用にweightとして代入する
execute store result storage asset:artifact Modifier.weight int 1 run scoreboard players get $Priority Temporary

# 別のstorageへまとめて追加しておく
data modify storage asset:artifact PrioritizedModifiers append from storage asset:artifact Modifier

# リセット
data remove storage asset:artifact Modifier
scoreboard players reset $Priority Temporary
scoreboard players reset $Amount Temporary
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#> asset_manager:artifact/create/set_lore/modifier/priority/set
#
#
#
# @within function
# asset_manager:artifact/create/set_lore/modifier/sort
# asset_manager:artifact/create/set_lore/modifier/priority/set

# 必要な変数を用意
data modify storage asset:artifact Modifier set from storage asset:artifact CopiedModifiers[-1]

# 優先度をセット
function asset_manager:artifact/create/set_lore/modifier/priority/set.m with storage asset:artifact Modifier

# 最後尾の要素を削除
data remove storage asset:artifact CopiedModifiers[-1]

# 要素がまだあれば再帰
execute if data storage asset:artifact CopiedModifiers[0] run function asset_manager:artifact/create/set_lore/modifier/priority/set
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#> asset_manager:artifact/create/set_lore/modifier/sort
#
#
#
# @within function asset_manager:artifact/create/set_lore/modifier/

# 各補正にPriorityを設定
data modify storage asset:artifact CopiedModifiers set from storage asset:artifact Equipment.Modifiers
function asset_manager:artifact/create/set_lore/modifier/priority/set

# ソート
function lib:array/session/open
data modify storage lib: Array set from storage asset:artifact PrioritizedModifiers
function lib:array/sort/compound/descend
data modify storage asset:artifact SortedModifiers set from storage lib: Array
function lib:array/session/close

Loading
Loading