Skip to content

Commit

Permalink
🧑‍💻 スニーク時のフラグ処理を追加
Browse files Browse the repository at this point in the history
  • Loading branch information
haiiro2gou committed Nov 17, 2024
1 parent d68c492 commit 1da80df
Show file tree
Hide file tree
Showing 63 changed files with 855 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@
# asset_manager:artifact/check/**
#declare tag CheckFailed

#> スニークの閾値用スコアホルダー
# @within function asset_manager:artifact/triggers/sneak/*
#declare score_holder $SneakThreshold
#> スニーク用スコアホルダー
# @within function asset_manager:artifact/triggers/*sneak*/*
#declare score_holder $SneakTime

#> use_itemの誤検知対策タグ
# @within function
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@
execute if data storage asset:artifact {EquipmentChanges:[{_:{_:false}}]} run function asset_manager:artifact/triggers/equipments/update_cooldown/
execute if data storage asset:artifact {EquipmentChanges:[{_:{_:false}}]} run function asset_manager:artifact/triggers/equipments/update_cooldown_type
execute if data storage asset:artifact {EquipmentChanges:[{_:{_:false}}]} run function asset_manager:artifact/triggers/equipments/update_attribute/
execute if data storage asset:artifact {EquipmentChanges:[{_:{_:false}}]} if entity @s[tag=TriggerFlag.Sneak] run function asset_manager:artifact/triggers/event/sneak/reset_when_change_item
# 改宗時の更新処理
execute if entity @s[tag=Believe.Changed] unless data storage asset:artifact {EquipmentChanges:[{_:{_:false}}]} run function asset_manager:artifact/triggers/equipments/update_attribute/
execute if entity @s[tag=Believe.Changed] unless data storage asset:artifact {EquipmentChanges:[{_:{_:false}}]} run function asset_manager:artifact/triggers/event/sneak/reset
# バニラ攻撃をしているならフラグを建てる
execute if data storage asset:artifact ArtifactEvents.Attack[{Type:"vanilla_melee"}] run tag @s add ShouldVanillaAttack
# 各神器にトリガー受けわたし
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#> asset_manager:artifact/triggers/event/sneak/get_sneak_time/
#
#
#
# @within function asset_manager:artifact/triggers/*sneak*/

execute if data storage asset:artifact TargetItem{Slot:"mainhand"} store result storage asset:context SneakTime int 1 run scoreboard players get @s Sneak.Mainhand
execute if data storage asset:artifact TargetItem{Slot:"offhand"} store result storage asset:context SneakTime int 1 run scoreboard players get @s Sneak.Offhand
execute if data storage asset:artifact TargetItem{Slot:"feet"} store result storage asset:context SneakTime int 1 run scoreboard players get @s Sneak.Feet
execute if data storage asset:artifact TargetItem{Slot:"legs"} store result storage asset:context SneakTime int 1 run scoreboard players get @s Sneak.Legs
execute if data storage asset:artifact TargetItem{Slot:"chest"} store result storage asset:context SneakTime int 1 run scoreboard players get @s Sneak.Chest
execute if data storage asset:artifact TargetItem{Slot:"head"} store result storage asset:context SneakTime int 1 run scoreboard players get @s Sneak.Head
execute if data storage asset:artifact TargetItem{Slot:"hotbar"} store result storage asset:context SneakTime int 1 run function asset_manager:artifact/triggers/event/sneak/get_sneak_time/hotbar.m with storage asset:artifact TargetItem
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#> asset_manager:artifact/triggers/event/sneak/get_sneak_time/hotbar.m
#
#
#
# @input args InvSlot : int
# @within function asset_manager:artifact/triggers/event/sneak/get_sneak_time/

$return run scoreboard players get @s Sneak.Hotbar$(InvSlot)
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#> asset_manager:artifact/triggers/event/sneak/reset
#
#
#
# @within function
# core:tick/player/post
# asset_manager:artifact/triggers/

scoreboard players reset @s Sneak.Mainhand
scoreboard players reset @s Sneak.Offhand
scoreboard players reset @s Sneak.Head
scoreboard players reset @s Sneak.Chest
scoreboard players reset @s Sneak.Legs
scoreboard players reset @s Sneak.Feet
scoreboard players reset @s Sneak.Hotbar0
scoreboard players reset @s Sneak.Hotbar1
scoreboard players reset @s Sneak.Hotbar2
scoreboard players reset @s Sneak.Hotbar3
scoreboard players reset @s Sneak.Hotbar4
scoreboard players reset @s Sneak.Hotbar5
scoreboard players reset @s Sneak.Hotbar6
scoreboard players reset @s Sneak.Hotbar7
scoreboard players reset @s Sneak.Hotbar8
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#> asset_manager:artifact/triggers/event/sneak/reset_when_change_item
#
#
#
# @within function asset_manager:artifact/triggers/

execute if data storage asset:artifact EquipmentChanges[00]._{_:false} run scoreboard players set @s Sneak.Mainhand 1
execute if data storage asset:artifact EquipmentChanges[01]._{_:false} run scoreboard players set @s Sneak.Offhand 1
execute if data storage asset:artifact EquipmentChanges[02]._{_:false} run scoreboard players set @s Sneak.Head 1
execute if data storage asset:artifact EquipmentChanges[03]._{_:false} run scoreboard players set @s Sneak.Chest 1
execute if data storage asset:artifact EquipmentChanges[04]._{_:false} run scoreboard players set @s Sneak.Legs 1
execute if data storage asset:artifact EquipmentChanges[05]._{_:false} run scoreboard players set @s Sneak.Feet 1
execute if data storage asset:artifact EquipmentChanges[06]._{_:false} run scoreboard players set @s Sneak.Hotbar0 1
execute if data storage asset:artifact EquipmentChanges[07]._{_:false} run scoreboard players set @s Sneak.Hotbar1 1
execute if data storage asset:artifact EquipmentChanges[08]._{_:false} run scoreboard players set @s Sneak.Hotbar2 1
execute if data storage asset:artifact EquipmentChanges[09]._{_:false} run scoreboard players set @s Sneak.Hotbar3 1
execute if data storage asset:artifact EquipmentChanges[10]._{_:false} run scoreboard players set @s Sneak.Hotbar4 1
execute if data storage asset:artifact EquipmentChanges[11]._{_:false} run scoreboard players set @s Sneak.Hotbar5 1
execute if data storage asset:artifact EquipmentChanges[12]._{_:false} run scoreboard players set @s Sneak.Hotbar6 1
execute if data storage asset:artifact EquipmentChanges[13]._{_:false} run scoreboard players set @s Sneak.Hotbar7 1
execute if data storage asset:artifact EquipmentChanges[14]._{_:false} run scoreboard players set @s Sneak.Hotbar8 1
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#> asset_manager:artifact/triggers/keep_sneak/
#
# 各神器処理へデータ受け渡し
#
# @within function asset_manager:artifact/triggers/

# フラグが存在しているか確認する
execute if entity @s[tag=!TriggerFlag.Sneak] run return fail
# スニークしている時間を取得する
function asset_manager:artifact/triggers/event/sneak/get_sneak_time/
execute store result score $SneakTime Temporary run data get storage asset:context SneakTime
# 使用条件を満たしているか確認する
execute if score $SneakTime Temporary matches 1.. run function asset_manager:artifact/check/
execute if score $SneakTime Temporary matches 1.. run function asset_manager:artifact/triggers/keep_sneak/check.m with storage asset:context
# 条件を満たしていれば使用する
execute if entity @s[tag=CanUsed] run function asset_manager:artifact/triggers/keep_sneak/use

# リセット
scoreboard players reset $SneakTime Temporary
tag @s remove CanUsed
data remove storage asset:context SneakTime
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#> asset_manager:artifact/triggers/keep_sneak/check.m
#
#
#
# @input args id : int
# @within function asset_manager:artifact/triggers/keep_sneak/

$function asset:artifact/alias/$(id)/keep_sneak/check
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#> asset_manager:artifact/triggers/keep_sneak/keep_sneak.m
#
#
#
# @input args id : int
# @within function asset_manager:artifact/triggers/keep_sneak/use

$function asset:artifact/alias/$(id)/keep_sneak/
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#> asset_manager:artifact/triggers/keep_sneak/use
#
#
#
# @within function asset_manager:artifact/triggers/keep_sneak/

# 共通処理
# アイテムを破壊するとBrokeItemが追加される
function asset_manager:artifact/use/

# 処理対象の神器の重複数を取得する
execute store result storage asset:context Count int 1 if data storage asset:artifact TargetItemList[]

# 神器を呼び出し
function asset_manager:artifact/triggers/keep_sneak/keep_sneak.m with storage asset:context

# リセット
data remove storage asset:context BrokeItem
data remove storage asset:context Count
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#> asset_manager:artifact/triggers/keep_sneak_10s/
#
# 各神器処理へデータ受け渡し
#
# @within function asset_manager:artifact/triggers/

# フラグが存在しているか確認する
execute if entity @s[tag=!TriggerFlag.Sneak] run return fail
# スニークしている時間を取得する
function asset_manager:artifact/triggers/event/sneak/get_sneak_time/
execute store result score $SneakTime Temporary run data get storage asset:context SneakTime
# 使用条件を満たしているか確認する
execute if score $SneakTime Temporary matches 200.. run function asset_manager:artifact/check/
execute if score $SneakTime Temporary matches 200.. run function asset_manager:artifact/triggers/keep_sneak_10s/check.m with storage asset:context
# 条件を満たしていれば使用する
execute if entity @s[tag=CanUsed] run function asset_manager:artifact/triggers/keep_sneak_10s/use

# リセット
scoreboard players reset $SneakTime Temporary
tag @s remove CanUsed
data remove storage asset:context SneakTime
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#> asset_manager:artifact/triggers/keep_sneak_10s/check.m
#
#
#
# @input args id : int
# @within function asset_manager:artifact/triggers/keep_sneak_10s/

$function asset:artifact/alias/$(id)/keep_sneak_10s/check
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#> asset_manager:artifact/triggers/keep_sneak_10s/keep_sneak_10s.m
#
#
#
# @input args id : int
# @within function asset_manager:artifact/triggers/keep_sneak_10s/use

$function asset:artifact/alias/$(id)/keep_sneak_10s/
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#> asset_manager:artifact/triggers/keep_sneak_10s/use
#
#
#
# @within function asset_manager:artifact/triggers/keep_sneak_10s/

# 共通処理
# アイテムを破壊するとBrokeItemが追加される
function asset_manager:artifact/use/

# 処理対象の神器の重複数を取得する
execute store result storage asset:context Count int 1 if data storage asset:artifact TargetItemList[]

# 神器を呼び出し
function asset_manager:artifact/triggers/keep_sneak_10s/keep_sneak_10s.m with storage asset:context

# リセット
data remove storage asset:context BrokeItem
data remove storage asset:context Count
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#> asset_manager:artifact/triggers/keep_sneak_1s/
#
# 各神器処理へデータ受け渡し
#
# @within function asset_manager:artifact/triggers/

# フラグが存在しているか確認する
execute if entity @s[tag=!TriggerFlag.Sneak] run return fail
# スニークしている時間を取得する
function asset_manager:artifact/triggers/event/sneak/get_sneak_time/
execute store result score $SneakTime Temporary run data get storage asset:context SneakTime
# 使用条件を満たしているか確認する
execute if score $SneakTime Temporary matches 20.. run function asset_manager:artifact/check/
execute if score $SneakTime Temporary matches 20.. run function asset_manager:artifact/triggers/keep_sneak_1s/check.m with storage asset:context
# 条件を満たしていれば使用する
execute if entity @s[tag=CanUsed] run function asset_manager:artifact/triggers/keep_sneak_1s/use

# リセット
scoreboard players reset $SneakTime Temporary
tag @s remove CanUsed
data remove storage asset:context SneakTime
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#> asset_manager:artifact/triggers/keep_sneak_1s/check.m
#
#
#
# @input args id : int
# @within function asset_manager:artifact/triggers/keep_sneak_1s/

$function asset:artifact/alias/$(id)/keep_sneak_1s/check
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#> asset_manager:artifact/triggers/keep_sneak_1s/keep_sneak_1s.m
#
#
#
# @input args id : int
# @within function asset_manager:artifact/triggers/keep_sneak_1s/use

$function asset:artifact/alias/$(id)/keep_sneak_1s/
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#> asset_manager:artifact/triggers/keep_sneak_1s/use
#
#
#
# @within function asset_manager:artifact/triggers/keep_sneak_1s/

# 共通処理
# アイテムを破壊するとBrokeItemが追加される
function asset_manager:artifact/use/

# 処理対象の神器の重複数を取得する
execute store result storage asset:context Count int 1 if data storage asset:artifact TargetItemList[]

# 神器を呼び出し
function asset_manager:artifact/triggers/keep_sneak_1s/keep_sneak_1s.m with storage asset:context

# リセット
data remove storage asset:context BrokeItem
data remove storage asset:context Count
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#> asset_manager:artifact/triggers/keep_sneak_2s/
#
# 各神器処理へデータ受け渡し
#
# @within function asset_manager:artifact/triggers/

# フラグが存在しているか確認する
execute if entity @s[tag=!TriggerFlag.Sneak] run return fail
# スニークしている時間を取得する
function asset_manager:artifact/triggers/event/sneak/get_sneak_time/
execute store result score $SneakTime Temporary run data get storage asset:context SneakTime
# 使用条件を満たしているか確認する
execute if score $SneakTime Temporary matches 1.. run function asset_manager:artifact/check/
execute if score $SneakTime Temporary matches 1.. run function asset_manager:artifact/triggers/keep_sneak_2s/check.m with storage asset:context
# 条件を満たしていれば使用する
execute if entity @s[tag=CanUsed] run function asset_manager:artifact/triggers/keep_sneak_2s/use

# リセット
scoreboard players reset $SneakTime Temporary
tag @s remove CanUsed
data remove storage asset:context SneakTime
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#> asset_manager:artifact/triggers/keep_sneak_2s/check.m
#
#
#
# @input args id : int
# @within function asset_manager:artifact/triggers/keep_sneak_2s/

$function asset:artifact/alias/$(id)/keep_sneak_2s/check
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#> asset_manager:artifact/triggers/keep_sneak_2s/keep_sneak_2s.m
#
#
#
# @input args id : int
# @within function asset_manager:artifact/triggers/keep_sneak_2s/use

$function asset:artifact/alias/$(id)/keep_sneak_2s/
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#> asset_manager:artifact/triggers/keep_sneak_2s/use
#
#
#
# @within function asset_manager:artifact/triggers/keep_sneak_2s/

# 共通処理
# アイテムを破壊するとBrokeItemが追加される
function asset_manager:artifact/use/

# 処理対象の神器の重複数を取得する
execute store result storage asset:context Count int 1 if data storage asset:artifact TargetItemList[]

# 神器を呼び出し
function asset_manager:artifact/triggers/keep_sneak_2s/keep_sneak_2s.m with storage asset:context

# リセット
data remove storage asset:context BrokeItem
data remove storage asset:context Count
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#> asset_manager:artifact/triggers/keep_sneak_3s/
#
# 各神器処理へデータ受け渡し
#
# @within function asset_manager:artifact/triggers/

# フラグが存在しているか確認する
execute if entity @s[tag=!TriggerFlag.Sneak] run return fail
# スニークしている時間を取得する
function asset_manager:artifact/triggers/event/sneak/get_sneak_time/
execute store result score $SneakTime Temporary run data get storage asset:context SneakTime
# 使用条件を満たしているか確認する
execute if score $SneakTime Temporary matches 60.. run function asset_manager:artifact/check/
execute if score $SneakTime Temporary matches 60.. run function asset_manager:artifact/triggers/keep_sneak_3s/check.m with storage asset:context
# 条件を満たしていれば使用する
execute if entity @s[tag=CanUsed] run function asset_manager:artifact/triggers/keep_sneak_3s/use

# リセット
scoreboard players reset $SneakTime Temporary
tag @s remove CanUsed
data remove storage asset:context SneakTime
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#> asset_manager:artifact/triggers/keep_sneak_3s/check.m
#
#
#
# @input args id : int
# @within function asset_manager:artifact/triggers/keep_sneak_3s/

$function asset:artifact/alias/$(id)/keep_sneak_3s/check
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#> asset_manager:artifact/triggers/keep_sneak_3s/keep_sneak_3s.m
#
#
#
# @input args id : int
# @within function asset_manager:artifact/triggers/keep_sneak_3s/use

$function asset:artifact/alias/$(id)/keep_sneak_3s/
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#> asset_manager:artifact/triggers/keep_sneak_3s/use
#
#
#
# @within function asset_manager:artifact/triggers/keep_sneak_3s/

# 共通処理
# アイテムを破壊するとBrokeItemが追加される
function asset_manager:artifact/use/

# 処理対象の神器の重複数を取得する
execute store result storage asset:context Count int 1 if data storage asset:artifact TargetItemList[]

# 神器を呼び出し
function asset_manager:artifact/triggers/keep_sneak_3s/keep_sneak_3s.m with storage asset:context

# リセット
data remove storage asset:context BrokeItem
data remove storage asset:context Count
Loading

0 comments on commit 1da80df

Please sign in to comment.