Skip to content

Commit d68c492

Browse files
committed
🧑‍💻 その他のフラグ処理を追加
1 parent 9f5167d commit d68c492

17 files changed

+206
-1
lines changed

TheSkyBlessing/data/asset_manager/functions/artifact/_index.d.mcfunction

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919

2020
#> Trigger検知用
2121
# @within function
22-
# asset_manager:artifact/triggers/**
22+
# asset_manager:artifact/triggers/
23+
# asset_manager:artifact/triggers/*/
2324
# core:handler/**
2425
#declare tag TriggerFlag.ClickCarrot
2526
#declare tag TriggerFlag.UseItem
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#> asset_manager:artifact/triggers/click/
2+
#
3+
#
4+
#
5+
# @within function asset_manager:artifact/triggers/trigger/foreach/call.m
6+
7+
# フラグが存在しているか確認する
8+
execute if entity @s[tag=!TriggerFlag.ClickCarrot] run return fail
9+
# 使用条件を満たしているか確認する
10+
function asset_manager:artifact/check/
11+
function asset_manager:artifact/triggers/click/check.m with storage asset:context
12+
# 条件を満たしていれば使用する
13+
execute if entity @s[tag=CanUsed] run function asset_manager:artifact/triggers/click/use
14+
15+
# リセット
16+
tag @s remove CanUsed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#> asset_manager:artifact/triggers/click/check.m
2+
#
3+
#
4+
#
5+
# @input args id : int
6+
# @within function asset_manager:artifact/triggers/click/
7+
8+
$function asset:artifact/alias/$(id)/click/check
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#> asset_manager:artifact/triggers/click/click.m
2+
#
3+
#
4+
#
5+
# @input args id : int
6+
# @within function asset_manager:artifact/triggers/click/use
7+
8+
$function asset:artifact/alias/$(id)/click/
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#> asset_manager:artifact/triggers/click/use
2+
#
3+
#
4+
#
5+
# @within function asset_manager:artifact/triggers/click/
6+
7+
# 共通処理
8+
# アイテムを破壊するとBrokeItemが追加される
9+
function asset_manager:artifact/use/
10+
11+
# 処理対象の神器の重複数を取得する
12+
execute store result storage asset:context Count int 1 if data storage asset:artifact TargetItemList[]
13+
14+
# 神器を呼び出し
15+
function asset_manager:artifact/triggers/click/click.m with storage asset:context
16+
17+
# リセット
18+
data remove storage asset:context BrokeItem
19+
data remove storage asset:context Count
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#> asset_manager:artifact/triggers/keep_click/
2+
#
3+
#
4+
#
5+
# @within function asset_manager:artifact/triggers/trigger/foreach/call.m
6+
7+
# フラグが存在しているか確認する
8+
execute if entity @s[tag=!TriggerFlag.UsingItem] run return fail
9+
# 使用条件を満たしているか確認する
10+
function asset_manager:artifact/check/
11+
function asset_manager:artifact/triggers/keep_click/check.m with storage asset:context
12+
# 条件を満たしていれば使用する
13+
execute if entity @s[tag=CanUsed] run function asset_manager:artifact/triggers/keep_click/use
14+
15+
# リセット
16+
tag @s remove CanUsed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#> asset_manager:artifact/triggers/keep_click/check.m
2+
#
3+
#
4+
#
5+
# @input args id : int
6+
# @within function asset_manager:artifact/triggers/keep_click/
7+
8+
$function asset:artifact/alias/$(id)/keep_click/check
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#> asset_manager:artifact/triggers/keep_click/keep_click.m
2+
#
3+
#
4+
#
5+
# @input args id : int
6+
# @within function asset_manager:artifact/triggers/keep_click/use
7+
8+
$function asset:artifact/alias/$(id)/keep_click/
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#> asset_manager:artifact/triggers/keep_click/use
2+
#
3+
#
4+
#
5+
# @within function asset_manager:artifact/triggers/keep_click/
6+
7+
# 共通処理
8+
# アイテムを破壊するとBrokeItemが追加される
9+
function asset_manager:artifact/use/
10+
11+
# 処理対象の神器の重複数を取得する
12+
execute store result storage asset:context Count int 1 if data storage asset:artifact TargetItemList[]
13+
14+
# 神器を呼び出し
15+
function asset_manager:artifact/triggers/keep_click/keep_click.m with storage asset:context
16+
17+
# リセット
18+
data remove storage asset:context BrokeItem
19+
data remove storage asset:context Count
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#> asset_manager:artifact/triggers/tick/
2+
#
3+
#
4+
#
5+
# @within function asset_manager:artifact/triggers/trigger/foreach/call.m
6+
7+
# フラグが存在しているか確認する
8+
# return fail
9+
# 使用条件を満たしているか確認する
10+
function asset_manager:artifact/check/
11+
function asset_manager:artifact/triggers/tick/check.m with storage asset:context
12+
# 条件を満たしていれば使用する
13+
execute if entity @s[tag=CanUsed] run function asset_manager:artifact/triggers/tick/use
14+
15+
# リセット
16+
tag @s remove CanUsed

0 commit comments

Comments
 (0)